[hfst] 01/02: Imported Upstream version 3.9.0~r4595

Tino Didriksen tinodidriksen-guest at moszumanska.debian.org
Thu Dec 31 20:58:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

tinodidriksen-guest pushed a commit to branch master
in repository hfst.

commit af73df52fe35c653296da78a6d939c338cd3fffd
Author: Tino Didriksen <mail at tinodidriksen.com>
Date:   Thu Dec 31 20:56:15 2015 +0000

    Imported Upstream version 3.9.0~r4595
---
 ChangeLog                                          |  1128 ++
 ChangeLog.old                                      |  1044 ++
 Doxyfile                                           |     2 +-
 Makefile.am                                        |     2 +-
 NEWS                                               |    24 +
 README                                             |    13 +-
 back-ends/foma/CHANGELOG                           |    15 +
 back-ends/foma/COPYING                             |    14 +-
 back-ends/foma/README                              |    16 +-
 back-ends/foma/apply.c                             |   105 +-
 back-ends/foma/coaccessible.c                      |    58 +-
 back-ends/foma/constructions.c                     |   810 +-
 back-ends/foma/define.c                            |   235 +-
 back-ends/foma/determinize.c                       |    29 +-
 back-ends/foma/dynarray.c                          |   113 +-
 back-ends/foma/flags.c                             |    97 +-
 back-ends/foma/foma.c                              |    76 +-
 back-ends/foma/foma.h                              |    39 +-
 back-ends/foma/fomalib.h                           |   116 +-
 back-ends/foma/fomalibconf.h                       |    29 +-
 back-ends/foma/iface.c                             |   226 +-
 back-ends/foma/io.c                                |   637 +-
 back-ends/foma/lex.cmatrix.c                       |    81 +-
 back-ends/foma/lex.interface.c                     | 14165 ++++++++++---------
 back-ends/foma/lex.lexc.c                          |   199 +-
 back-ends/foma/lex.yy.c                            |  2984 ++--
 back-ends/foma/lexc.l                              |    33 +-
 back-ends/foma/lexcread.c                          |   281 +-
 back-ends/foma/mem.c                               |     6 +-
 back-ends/foma/minimize.c                          |    75 +-
 back-ends/foma/regex.c                             |  2375 ++--
 back-ends/foma/regex.h                             |   160 +-
 back-ends/foma/regex.l                             |   260 +-
 back-ends/foma/regex.y                             |    41 +-
 back-ends/foma/reverse.c                           |     6 +-
 back-ends/foma/rewrite.c                           |     6 +-
 back-ends/foma/sigma.c                             |    21 +-
 back-ends/foma/spelling.c                          |     6 +-
 back-ends/foma/stringhash.c                        |    52 +-
 back-ends/foma/structures.c                        |   198 +-
 back-ends/foma/topsort.c                           |    16 +-
 back-ends/foma/trie.c                              |    84 +-
 back-ends/foma/utf8.c                              |    59 +-
 check_installation/check-ospell.sh                 |    93 +
 check_installation/check-python.sh                 |    43 +
 check_installation/check-swig.sh                   |    30 -
 .../{copy-swig-tests.sh => copy-python-tests.sh}   |     6 +-
 check_installation/copy-tool-tests.sh              |     9 +-
 check_installation/dist-README                     |    17 +-
 check_installation/make-dist.sh                    |    12 +-
 .../morphology_tests/english-analyze.output        |    53 +-
 ...h-analyze.output => english-analyze.output.old} |     0
 .../morphology_tests/finnish-analyze.output        |    19 +-
 check_installation/ospell_tests/ospell_input.txt   |     1 +
 check_installation/ospell_tests/test.zhfst         |   Bin 0 -> 21182410 bytes
 configure.ac                                       |    29 +-
 hfst.m4                                            |     3 +-
 libhfst/src/HfstExceptionDefs.cc                   |     2 +
 libhfst/src/HfstExceptionDefs.h                    |     1 +
 libhfst/src/HfstFlagDiacritics.h                   |     2 +-
 libhfst/src/HfstInputStream.cc                     |     5 +-
 libhfst/src/HfstOutputStream.cc                    |     5 +-
 libhfst/src/HfstPrintDot.cc                        |   421 +
 libhfst/src/HfstPrintDot.h                         |     8 +
 libhfst/src/HfstPrintPCKimmo.cc                    |   139 +
 libhfst/src/HfstPrintPCKimmo.h                     |     6 +
 libhfst/src/HfstRules.cc                           |     5 +-
 {tools => libhfst}/src/HfstStrings2FstTokenizer.cc |     0
 {tools => libhfst}/src/HfstStrings2FstTokenizer.h  |     0
 libhfst/src/HfstTransducer.cc                      |   259 +-
 libhfst/src/HfstTransducer.h                       |    57 +-
 libhfst/src/HfstXeroxRules.cc                      |   493 +-
 libhfst/src/HfstXeroxRules.h                       |    77 +-
 libhfst/src/HfstXeroxRulesTest.cc                  |   108 +-
 libhfst/src/Makefile.am                            |     8 +-
 .../src/implementations/ConvertFomaTransducer.cc   |     4 +-
 .../ConvertTropicalWeightTransducer.cc             |    12 +-
 libhfst/src/implementations/HfstTransition.h       |     7 +
 libhfst/src/implementations/HfstTransitionGraph.h  |   168 +-
 .../HfstTropicalTransducerTransitionData.h         |     6 +
 libhfst/src/implementations/SfstTransducer.cc      |    14 +-
 .../implementations/TropicalWeightTransducer.cc    |   134 +-
 .../src/implementations/TropicalWeightTransducer.h |     8 +
 .../src/implementations/optimized-lookup/pmatch.cc |    43 +-
 .../src/implementations/optimized-lookup/pmatch.h  |     3 +
 .../implementations/optimized-lookup/transducer.cc |    60 +-
 .../implementations/optimized-lookup/transducer.h  |    29 +-
 libhfst/src/parsers/LexcCompiler.cc                |   542 +-
 libhfst/src/parsers/LexcCompiler.h                 |    30 +-
 libhfst/src/parsers/Makefile.am                    |    20 +-
 {tools => libhfst}/src/parsers/XfstCompiler.cc     |  1604 ++-
 {tools => libhfst}/src/parsers/XfstCompiler.h      |   189 +-
 libhfst/src/parsers/XreCompiler.cc                 |   141 +-
 libhfst/src/parsers/XreCompiler.h                  |    26 +-
 libhfst/src/parsers/lexc-parser.yy                 |     5 +-
 libhfst/src/parsers/lexc-utils.cc                  |   114 +-
 libhfst/src/parsers/lexc-utils.h                   |    29 +-
 libhfst/src/parsers/pmatch_parse.yy                |   212 +-
 libhfst/src/parsers/pmatch_utils.cc                |    18 +
 libhfst/src/parsers/pmatch_utils.h                 |     7 +
 {tools => libhfst}/src/parsers/xfst-lexer.ll       |     8 +-
 {tools => libhfst}/src/parsers/xfst-parser.yy      |   850 +-
 {tools => libhfst}/src/parsers/xfst-utils.cc       |    47 +-
 {tools => libhfst}/src/parsers/xfst-utils.h        |     6 +-
 .../src/parsers/xfst_help_message.cc               |    87 +-
 {tools => libhfst}/src/parsers/xfst_help_message.h |     0
 libhfst/src/parsers/xre_lex.ll                     |    17 -
 libhfst/src/parsers/xre_parse.yy                   |    91 +-
 libhfst/src/parsers/xre_utils.cc                   |    88 +-
 libhfst/src/parsers/xre_utils.h                    |     2 +-
 man/hfst-affix-guessify.1                          |     2 +-
 man/hfst-apertium-proc.1                           |     6 +-
 man/hfst-calculate.1                               |     2 +-
 man/hfst-compare.1                                 |     5 +-
 man/hfst-compose-intersect.1                       |    12 +-
 man/hfst-compose.1                                 |    16 +-
 man/hfst-concatenate.1                             |     5 +-
 man/hfst-conjunct.1                                |     5 +-
 man/hfst-determinize.1                             |     2 +-
 man/hfst-disjunct.1                                |     5 +-
 man/hfst-edit-metadata.1                           |     2 +-
 man/hfst-expand-equivalences.1                     |     2 +-
 man/hfst-format.1                                  |     2 +-
 man/hfst-fst2fst.1                                 |     9 +-
 man/hfst-fst2strings.1                             |     7 +-
 man/hfst-fst2txt.1                                 |     2 +-
 man/hfst-grep.1                                    |     2 +-
 man/hfst-guess.1                                   |     2 +-
 man/hfst-guessify.1                                |     2 +-
 man/hfst-head.1                                    |     2 +-
 man/hfst-info.1                                    |     2 +-
 man/hfst-invert.1                                  |     2 +-
 man/hfst-lexc-wrapper.1                            |     2 +-
 man/hfst-lexc.1                                    |     8 +-
 man/hfst-lookup.1                                  |    22 +-
 man/hfst-minimize.1                                |     2 +-
 man/hfst-multiply.1                                |     2 +-
 man/hfst-name.1                                    |     2 +-
 man/hfst-optimized-lookup.1                        |    26 +-
 man/hfst-pair-test.1                               |    28 +-
 man/hfst-pmatch.1                                  |     5 +-
 man/hfst-pmatch2fst.1                              |     4 +-
 man/hfst-proc2.1                                   |    24 +-
 man/hfst-project.1                                 |     2 +-
 man/hfst-prune-alphabet.1                          |     2 +-
 man/hfst-push-weights.1                            |     2 +-
 man/hfst-regexp2fst.1                              |     8 +-
 man/hfst-remove-epsilons.1                         |     2 +-
 man/hfst-repeat.1                                  |     2 +-
 man/hfst-reverse.1                                 |     2 +-
 man/hfst-reweight-tagger.1                         |     2 +-
 man/hfst-reweight.1                                |    20 +-
 man/hfst-shuffle.1                                 |     5 +-
 man/hfst-split.1                                   |     2 +-
 man/hfst-strings2fst.1                             |     2 +-
 man/hfst-substitute.1                              |     7 +-
 man/hfst-subtract.1                                |     5 +-
 man/hfst-summarize.1                               |     7 +-
 man/hfst-tag.1                                     |     2 +-
 man/hfst-tail.1                                    |     2 +-
 man/hfst-train-tagger.1                            |     2 +-
 man/hfst-traverse.1                                |     2 +-
 man/hfst-twolc.1                                   |     4 +-
 man/hfst-txt2fst.1                                 |     7 +-
 man/hfst-xfst.1                                    |    15 +-
 {swig => old_python}/Makefile.am                   |     0
 {swig => old_python}/README                        |    41 +-
 {swig => old_python}/doc/Doxyfile                  |     2 +-
 {swig => old_python}/doc/libhfst.py                |     0
 {swig => old_python}/hfstBot.py                    |     0
 {swig => old_python}/hfst_swig_extensions.h        |     0
 {swig => old_python}/libhfst.i                     |    79 +-
 {swig => old_python}/omor_query.py                 |     0
 {swig => old_python}/setup.py                      |     2 +-
 {swig => old_python}/test/Makefile.am              |     0
 {swig => old_python}/test/test.sh                  |     0
 {swig => old_python}/test/test_constructors.py     |     0
 {swig => old_python}/test/test_examples.py         |     0
 {swig => old_python}/test/test_extensions.py       |     0
 {swig => old_python}/test/test_flag_diacritics.py  |     0
 .../test/test_hfst_basic_transducer.py             |     0
 {swig => old_python}/test/test_lexc.lexc           |     0
 {swig => old_python}/test/test_lexc.py             |     0
 {swig => old_python}/test/test_lexc_fail.lexc      |     0
 {swig => old_python}/test/test_rules.py            |     0
 {swig => old_python}/test/test_std_streams.py      |     0
 {swig => old_python}/test/test_std_streams.sh      |     0
 {swig => old_python}/test/test_streams.py          |     0
 {swig => old_python}/test/test_tokenizer.py        |     0
 .../test/test_transducer_functions.py              |     0
 {swig => old_python}/test/test_xre_compiler.py     |     0
 python/Makefile.am                                 |     3 +
 python/README                                      |    59 +
 {swig => python}/doc/Doxyfile                      |    16 +-
 {swig => python}/doc/libhfst.py                    |  2167 +--
 python/libhfst.i                                   |  1740 +++
 {swig => python}/setup.py                          |     4 +-
 python/test/Makefile.am                            |     1 +
 python/test/README                                 |    11 +
 python/test/examples.py                            |   378 +
 python/test/foobar.hfst                            |   Bin 0 -> 768 bytes
 python/test/test.lexc                              |     9 +
 python/test/test_fail.xfst                         |     2 +
 python/test/test_hfst.py                           |   458 +
 python/test/test_pass.xfst                         |     3 +
 python/test/testfile.att                           |     6 +
 scripts/Makefile.am                                |     6 +-
 scripts/README                                     |    52 +
 scripts/README_eight_tools_mac.txt                 |    30 +
 ..._eight_tools.txt => README_eight_tools_win.txt} |     0
 scripts/README_xfst_mac.txt                        |     9 +
 scripts/{README_xfst.txt => README_xfst_win.txt}   |     0
 scripts/copy-for-windows.sh                        |    69 +-
 scripts/generate-cc-files.sh                       |    22 +-
 scripts/make-hfst-lexc.bat                         |     9 +-
 scripts/make-hfst-proc.bat                         |     9 +-
 scripts/make-hfst-tool.bat                         |     9 +-
 scripts/make-hfst-xfst.bat                         |    14 +-
 scripts/make-htwolcpre1.bat                        |     9 +-
 scripts/make-htwolcpre2.bat                        |     9 +-
 scripts/make-htwolcpre3.bat                        |     9 +-
 scripts/make-python-bindings.bat                   |    13 +-
 scripts/package-static-binaries.sh                 |     2 +-
 scripts/test-hfst-tools.bat                        |     4 -
 scripts/test-libhfst.bat                           |     2 -
 scripts/test-openfstwin.bat                        |     2 -
 test/tools/Makefile.am                             |    21 +-
 test/tools/cat_cat.strings                         |     1 +
 test/tools/cat_weight_ambig.txt                    |     7 +
 test/tools/cat_weight_ambig_W1_xerox.strings       |     4 +
 test/tools/cat_weight_ambig_W_out.strings          |     1 +
 test/tools/cat_weight_ambig_W_xerox.strings        |     6 +
 test/tools/cat_weight_ambig_out.strings            |     1 +
 test/tools/cat_weight_ambig_xerox.strings          |     6 +
 test/tools/cats_and_dogs.xre                       |     2 +-
 test/tools/lexc-compiler-functionality.sh          |     6 +-
 test/tools/mismatching-input-streams.sh            |    81 +
 test/tools/negative_epsilon_cycles.txt             |     8 +
 test/tools/no_negative_epsilon_cycles.txt          |     8 +
 test/tools/pmatch-functionality.sh                 |     8 +-
 test/tools/proc-caps-out1.strings                  |     8 +-
 test/tools/proc-caps-out3.strings                  |     2 +-
 test/tools/proc-cat-NUL.strings                    |   Bin 0 -> 32 bytes
 test/tools/proc-functionality.sh                   |    61 +
 test/tools/regexp2fst-functionality.sh             |    23 +
 test/tools/substitute-functionality.sh             |    10 +
 test/tools/substituted_transducer.txt              |     6 +
 test/tools/substituting_transducer.txt             |     4 +
 test/tools/txt2fst-functionality.sh                |     9 +
 tools/src/Makefile.am                              |    10 +-
 tools/src/hfst-commandline.cc                      |    46 +
 tools/src/hfst-commandline.h                       |    12 +
 tools/src/hfst-compare.cc                          |     7 +-
 tools/src/hfst-compose-intersect.cc                |    59 +-
 tools/src/hfst-compose.cc                          |   109 +-
 tools/src/hfst-concatenate.cc                      |    72 +-
 tools/src/hfst-conjunct.cc                         |    75 +-
 tools/src/hfst-disjunct.cc                         |    63 +-
 tools/src/hfst-fst2txt.cc                          |   324 +-
 tools/src/hfst-lexc-compiler.cc                    |    10 +-
 tools/src/hfst-lookup.cc                           |    64 +-
 tools/src/hfst-optimized-lookup.cc                 |   394 +-
 tools/src/hfst-optimized-lookup.h                  |     4 +-
 tools/src/hfst-pmatch.cc                           |    28 +-
 tools/src/hfst-pmatch2fst.cc                       |     2 +-
 tools/src/hfst-proc/applicators.cc                 |    30 +-
 tools/src/hfst-proc/buffer.h                       |     4 +-
 tools/src/hfst-proc/formatter.cc                   |   191 +-
 tools/src/hfst-proc/formatter.h                    |    18 +-
 tools/src/hfst-proc/lookup-path.h                  |    13 +-
 tools/src/hfst-proc/tokenizer.cc                   |    23 +-
 tools/src/hfst-proc2.cc                            |    25 +-
 tools/src/hfst-program-options.cc                  |     1 +
 tools/src/hfst-program-options.h                   |    15 +-
 tools/src/hfst-regexp2fst.cc                       |    69 +-
 tools/src/hfst-remove-epsilons.cc                  |     3 +
 tools/src/hfst-shuffle.cc                          |    92 +-
 tools/src/hfst-string-conversions.cc               |    40 +-
 tools/src/hfst-string-conversions.h                |    21 +-
 tools/src/hfst-substitute.cc                       |    61 +-
 tools/src/hfst-subtract.cc                         |    68 +-
 tools/src/hfst-txt2fst.cc                          |    53 +-
 tools/src/inc/getopt-cases-binary.h                |     3 +
 tools/src/inc/globals-binary.h                     |     2 +-
 tools/src/parsers/Makefile.am                      |    23 +-
 tools/src/parsers/hfst-xfst.cc                     |    33 +-
 tools/src/parsers/test/Makefile.am                 |    14 +-
 tools/src/parsers/test/contains_with_weight.output |     6 +
 tools/src/parsers/test/contains_with_weight.xfst   |    10 +
 tools/src/parsers/test/flag_with_unknown.output    |     4 +
 tools/src/parsers/test/flag_with_unknown.xfst      |    19 +
 tools/src/parsers/test/merge_weighted.att          |     8 +
 tools/src/parsers/test/merge_weighted.xfst         |     3 +
 tools/src/parsers/test/priority_union_1.att        |    28 +
 tools/src/parsers/test/priority_union_1.xfst       |     2 +
 tools/src/parsers/test/priority_union_2.att        |     4 +
 tools/src/parsers/test/priority_union_2.xfst       |     2 +
 tools/src/parsers/test/priority_union_3.att        |     6 +
 tools/src/parsers/test/priority_union_3.xfst       |     2 +
 tools/src/parsers/test/priority_union_4.att        |     5 +
 tools/src/parsers/test/priority_union_4.xfst       |     2 +
 tools/src/parsers/test/replace_markup_1.att        |     8 +
 tools/src/parsers/test/replace_markup_1.xfst       |     2 +
 tools/src/parsers/test/replace_markup_2.att        |     6 +
 tools/src/parsers/test/replace_markup_2.xfst       |     2 +
 tools/src/parsers/test/replace_markup_3.att        |    15 +
 tools/src/parsers/test/replace_markup_3.xfst       |     2 +
 tools/src/parsers/test/replace_markup_4.att        |     9 +
 tools/src/parsers/test/replace_markup_4.xfst       |     2 +
 tools/src/parsers/test/replace_markup_5.att        |   109 +
 tools/src/parsers/test/replace_markup_5.xfst       |     2 +
 tools/src/parsers/test/replace_markup_6.att        |   213 +
 tools/src/parsers/test/replace_markup_6.xfst       |     2 +
 tools/src/parsers/test/replace_markup_7.att        |   200 +
 tools/src/parsers/test/replace_markup_7.xfst       |     2 +
 tools/src/parsers/test/replace_test_flags_1.att    |    17 +
 tools/src/parsers/test/replace_test_flags_1.xfst   |     2 +
 tools/src/parsers/test/replace_test_flags_2.att    |    18 +
 tools/src/parsers/test/replace_test_flags_2.xfst   |     2 +
 tools/src/parsers/test/test.sh                     |   258 +-
 .../parsers/test/weighted_parallel_rules_12.output |     1 +
 .../parsers/test/weighted_parallel_rules_12.xfst   |     7 +
 .../parsers/test/weighted_parallel_rules_13.output |     5 +
 .../parsers/test/weighted_parallel_rules_13.xfst   |     7 +
 324 files changed, 25818 insertions(+), 15591 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79d4943..49a3e37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,1131 @@
+2015-12-14 20:46  unhammer
+
+	* test/tools/cat_cat.strings,
+	  test/tools/cat_weight_ambig_W1_xerox.strings,
+	  test/tools/cat_weight_ambig_W_xerox.strings,
+	  test/tools/cat_weight_ambig_xerox.strings,
+	  test/tools/proc-functionality.sh,
+	  tools/src/hfst-proc/formatter.cc: fix for --xerox bug#328
+	  introduced by weight fix
+	  
+	  +tests
+
+2015-12-14 20:46  unhammer
+
+	* test/tools/proc-caps-out1.strings,
+	  test/tools/proc-caps-out3.strings,
+	  test/tools/proc-functionality.sh,
+	  tools/src/hfst-proc/formatter.cc,
+	  tools/src/hfst-proc/formatter.h: Revert -r4579 "Revert changes to
+	  hfst-proc made in revision 4427. This will (temporarily) fix bug
+	  #328."
+	  
+	  in preparation of real fix
+
+2015-12-14 14:47  eaxelson
+
+	* man/hfst-affix-guessify.1, man/hfst-apertium-proc.1,
+	  man/hfst-calculate.1, man/hfst-compare.1,
+	  man/hfst-compose-intersect.1, man/hfst-compose.1,
+	  man/hfst-concatenate.1, man/hfst-conjunct.1,
+	  man/hfst-determinize.1, man/hfst-disjunct.1,
+	  man/hfst-edit-metadata.1, man/hfst-expand-equivalences.1,
+	  man/hfst-format.1, man/hfst-fst2fst.1, man/hfst-fst2strings.1,
+	  man/hfst-fst2txt.1, man/hfst-grep.1, man/hfst-guess.1,
+	  man/hfst-guessify.1, man/hfst-head.1, man/hfst-info.1,
+	  man/hfst-invert.1, man/hfst-lexc-wrapper.1, man/hfst-lexc.1,
+	  man/hfst-lookup.1, man/hfst-minimize.1, man/hfst-multiply.1,
+	  man/hfst-name.1, man/hfst-optimized-lookup.1,
+	  man/hfst-pair-test.1, man/hfst-pmatch.1, man/hfst-pmatch2fst.1,
+	  man/hfst-proc2.1, man/hfst-project.1, man/hfst-prune-alphabet.1,
+	  man/hfst-push-weights.1, man/hfst-regexp2fst.1,
+	  man/hfst-remove-epsilons.1, man/hfst-repeat.1,
+	  man/hfst-reverse.1, man/hfst-reweight-tagger.1,
+	  man/hfst-reweight.1, man/hfst-shuffle.1, man/hfst-split.1,
+	  man/hfst-strings2fst.1, man/hfst-substitute.1,
+	  man/hfst-subtract.1, man/hfst-summarize.1, man/hfst-tag.1,
+	  man/hfst-tail.1, man/hfst-train-tagger.1, man/hfst-traverse.1,
+	  man/hfst-twolc.1, man/hfst-txt2fst.1, man/hfst-xfst.1: Remember
+	  to update the man pages, too.
+
+2015-12-14 13:30  eaxelson
+
+	* ChangeLog, ChangeLog.old, NEWS, configure.ac,
+	  libhfst/src/Makefile.am, python/setup.py: Ready for release
+	  3.9.0.
+
+2015-12-14 10:17  eaxelson
+
+	* test/tools/proc-caps-out1.strings,
+	  test/tools/proc-caps-out3.strings,
+	  test/tools/proc-functionality.sh,
+	  tools/src/hfst-proc/formatter.cc,
+	  tools/src/hfst-proc/formatter.h: Revert changes to hfst-proc made
+	  in revision 4427. This will (temporarily) fix bug #328.
+	  
+	  Change typedef ProcResults back to set<string> from
+	  vector<string>.
+	  This will remove the duplicates, but the results will again be
+	  listed in another order than they were inserted.
+	  vector<string> is probably be a better structure for storing the
+	  results, but it requires more changes in the code than just
+	  changing the typedef.
+
+2015-12-13 10:49  eaxelson
+
+	* python/libhfst.i: Change all pythoncode delimiters from '{' and
+	  '}' to '%{' and '%}'.
+	  
+	  The delimiters without a percent sign make swig interpret python
+	  comment lines with a leading hash sign as preprocessor
+	  directives.
+
+2015-12-12 12:15  jezral
+
+	* python/libhfst.i: Add two missing %
+
+2015-12-11 17:10  eaxelson
+
+	* test/tools/Makefile.am, test/tools/substitute-functionality.sh,
+	  test/tools/substituted_transducer.txt,
+	  test/tools/substituting_transducer.txt,
+	  tools/src/hfst-substitute.cc: Add tests for hfst-substitute.
+	  
+	  Disable the tests until option -T works correctly in
+	  hfst-substitute.
+	  Also fix a bug in transducer conversion in hfst-substitute.
+
+2015-12-11 15:25  eaxelson
+
+	* test/tools/mismatching-input-streams.sh: Add tests where one or
+	  both inputs are archives.
+
+2015-12-11 14:44  eaxelson
+
+	* tools/src/hfst-compose.cc: Set name of composition transducer
+	  after composition is called.
+
+2015-12-11 14:42  eaxelson
+
+	* test/tools/Makefile.am, test/tools/mismatching-input-streams.sh:
+	  Add tests for binary tools that use input streams whose types
+	  differ.
+
+2015-12-11 14:41  eaxelson
+
+	* libhfst/src/HfstTransducer.cc: Make HfstTransducer::compose throw
+	  and exception if transducers have mismatching types.
+
+2015-12-11 13:11  eaxelson
+
+	* tools/src/hfst-substitute.cc: Implement conversion of mismatching
+	  transducers also in hfst-substitute.
+
+2015-12-11 12:20  eaxelson
+
+	* tools/src/hfst-commandline.cc, tools/src/hfst-commandline.h,
+	  tools/src/hfst-compose-intersect.cc, tools/src/hfst-compose.cc,
+	  tools/src/hfst-concatenate.cc, tools/src/hfst-conjunct.cc,
+	  tools/src/hfst-disjunct.cc, tools/src/hfst-program-options.cc,
+	  tools/src/hfst-program-options.h, tools/src/hfst-shuffle.cc,
+	  tools/src/hfst-subtract.cc, tools/src/inc/getopt-cases-binary.h,
+	  tools/src/inc/globals-binary.h: Make binary command line tools
+	  convert mismatching input streams into common format.
+	  
+	  If the input streams have a different implementation type,
+	  convert transducers from the second stream into the type of the
+	  first stream.
+	  If information can be lost, i.e. weighted format is to be
+	  converted into unweighted format, convert the streams vice versa.
+	  Option --do-not-convert, in short form -C, can be used to
+	  disallow conversion and return with a failure value.
+
+2015-12-11 11:57  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h: Make
+	  'harmonize_flag_diacritics' throw an exception if transducer
+	  types differ. Make 'is_safe_conversion' public.
+
+2015-12-10 13:11  eaxelson
+
+	* libhfst/src/parsers/xre_lex.ll, libhfst/src/parsers/xre_parse.yy,
+	  test/tools/cats_and_dogs.xre,
+	  test/tools/regexp2fst-functionality.sh,
+	  tools/src/hfst-regexp2fst.cc: Fix a bug in hfst-regexp2fst
+	  related to comments and remove support for legacy way of defining
+	  weights from regexp parser.
+	  
+	  If hfst-regexp2fst cannot output any transducers because the
+	  input contains
+	  only whitespace or comments, exit with a failure. Remove support
+	  for legacy
+	  way of defining weights at the end of expression separated by a
+	  colon from
+	  the regexp parser.
+
+2015-12-09 10:22  sdrobac
+
+	* libhfst/src/parsers/xre_parse.yy, tools/src/parsers/test/test.sh:
+	  Xre parser - added check if contexts in replace rules are
+	  automata
+
+2015-12-08 15:34  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/xfst-parser.yy: Implement commands 'view net'
+	  and 'write dot' as system calls for non-windows platforms.
+
+2015-12-08 12:25  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-lexc.bat,
+	  scripts/make-hfst-proc.bat, scripts/make-hfst-tool.bat,
+	  scripts/make-hfst-xfst.bat, scripts/make-htwolcpre1.bat,
+	  scripts/make-htwolcpre2.bat, scripts/make-htwolcpre3.bat,
+	  scripts/make-python-bindings.bat: Update windows scripts so that
+	  they will work with the latest changes in dot and pckimmo
+	  printing functions.
+
+2015-12-08 12:13  eaxelson
+
+	* libhfst/src/HfstPrintDot.cc, libhfst/src/HfstPrintDot.h,
+	  libhfst/src/HfstPrintPCKimmo.cc, libhfst/src/HfstPrintPCKimmo.h,
+	  libhfst/src/Makefile.am, tools/src/hfst-fst2txt.cc: Move dot and
+	  pckimmo related functions in their own files.
+
+2015-12-04 07:43  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/parsers/XfstCompiler.cc, python/libhfst.i: Throw an
+	  exception in HfstTransducer::eliminate_flag if flag feature does
+	  not occur in the transducer or the flag includes a value or
+	  operator.
+
+2015-12-03 11:07  moshagen
+
+	* python, python/test, tools/src, tools/src/hfst-tagger/src,
+	  tools/src/hfst-twolc/src: Ignore generated files.
+
+2015-12-03 08:27  eaxelson
+
+	* python/test/Makefile.am: Add missing file
+
+2015-12-02 14:08  eaxelson
+
+	* configure.ac, python/README, python/doc/libhfst.py,
+	  python/examples.py, python/foobar.hfst, python/libhfst.i,
+	  python/test, python/test.lexc, python/test/README,
+	  python/test/examples.py, python/test/foobar.hfst,
+	  python/test/test.lexc, python/test/test_fail.xfst,
+	  python/test/test_hfst.py, python/test/test_pass.xfst,
+	  python/test/testfile.att, python/test_fail.xfst,
+	  python/test_hfst.py, python/test_pass.xfst, python/testfile.att:
+	  Move python tests to their own directory.
+
+2015-12-02 08:29  eaxelson
+
+	* Makefile.am, new_python_api, old_python, old_python/README,
+	  python, python/doc/Doxyfile, python/doc/libhfst.py,
+	  python/libhfst.i, python/test_hfst.py, swig: Rename directory
+	  'swig' to 'old_python' and directory 'new_python_api' to
+	  'python'.
+
+2015-12-01 10:38  eaxelson
+
+	* tools/src/hfst-compose.cc: Add information about the possible
+	  values of option --xerox-composition to the help message.
+
+2015-11-27 11:08  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  libhfst/src/parsers/XfstCompiler.cc, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py, tools/src/hfst-lookup.cc: Modify
+	  infinite_cutoff and time_cutoff arguments in lookup functions.
+	  
+	  Make argument 'infinite_cutoff' a pointer in function
+	  HfstTransitionGraph::lookup_fd, allowing it to de undefined.
+	  When calling lookup_fd from HfstTransducer::lookup, also pass the
+	  'time_cutoff' variable.
+	  Add 'time_cutoff' argument to lookup functions in the Python API.
+
+2015-11-26 11:48  sdrobac
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/lexc-utils.cc,
+	  libhfst/src/parsers/lexc-utils.h,
+	  tools/src/parsers/test/replace_test_flags_2.att,
+	  tools/src/parsers/test/replace_test_flags_2.xfst,
+	  tools/src/parsers/test/test.sh: Lexc, removed option -M +
+	  cosmetic changes to the alignment
+
+2015-11-25 14:00  eaxelson
+
+	* new_python_api/libhfst.i: Handle standard and console streams
+	  when libhfst is run from IDLE.
+
+2015-11-25 09:15  eaxelson
+
+	* libhfst/src/HfstTransducer.cc: Throw a
+	  FunctionNotImplementedException in HfstTransducer::lookup_fd
+	  instead of converting HfstTransducer automatically into
+	  HfstBasicTransducer.
+	  
+	  Lookup is often called many times, so it is better to convert the
+	  transducer once than every time lookup is called.
+
+2015-11-23 13:41  eaxelson
+
+	* new_python_api/libhfst.i: Update python interface.
+	  
+	  Add third argument to LexcCompiler constructor.
+	  Pass strings from C++ to Python as char pointers to prevent them
+	  from being interpreted as ascii strings.
+	  Add option output_to_console to compile_xfst_file.
+	  Add option align_strings to compile_lexc_file.
+
+2015-11-22 17:57  sdrobac
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/LexcCompiler.h,
+	  libhfst/src/parsers/lexc-utils.cc,
+	  libhfst/src/parsers/lexc-utils.h,
+	  tools/src/hfst-lexc-compiler.cc: Added option -A to lexc, it
+	  aligns same input and output transitions
+
+2015-11-20 16:02  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/xfst-parser.yy, new_python_api/libhfst.i: Fix
+	  a minor bug in python interface on windows.
+
+2015-11-18 09:10  eaxelson
+
+	* swig/libhfst.i: Fix LexcCompiler::printConnectedness const
+	  declaration.
+
+2015-11-17 10:53  sdrobac
+
+	* libhfst/src/HfstXeroxRules.cc, libhfst/src/HfstXeroxRules.h,
+	  libhfst/src/parsers/LexcCompiler.cc,
+	  tools/src/parsers/test/replace_test_flags_1.att,
+	  tools/src/parsers/test/replace_test_flags_1.xfst,
+	  tools/src/parsers/test/test.sh: Replace rules support flag
+	  diacritics (fixed lexc with -FM flags)
+
+2015-11-17 10:33  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  tools/src/parsers/hfst-xfst.cc: Use separate ostringstreams for
+	  standard output and standard error on Windows.
+
+2015-11-16 17:47  eaxelson
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/LexcCompiler.h,
+	  libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/XreCompiler.cc,
+	  libhfst/src/parsers/XreCompiler.h,
+	  libhfst/src/parsers/lexc-parser.yy,
+	  libhfst/src/parsers/lexc-utils.cc,
+	  libhfst/src/parsers/xre_utils.cc, tools/src/hfst-lookup.cc,
+	  tools/src/hfst-optimized-lookup.cc, tools/src/hfst-pmatch.cc,
+	  tools/src/hfst-remove-epsilons.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/hfst-string-conversions.h,
+	  tools/src/parsers/hfst-xfst.cc: Improvements to error and output
+	  stream handling.
+
+2015-11-13 16:34  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/xfst-lexer.ll,
+	  libhfst/src/parsers/xfst-parser.yy: Support printing to console
+	  on Windows.
+
+2015-11-12 17:08  eaxelson
+
+	* back-ends/foma/constructions.c,
+	  test/tools/lexc-compiler-functionality.sh: Update foma back-end
+	  composition algorithm to fix a bug noticed in lexc tests.
+
+2015-11-12 16:11  eaxelson
+
+	* libhfst/src/HfstInputStream.cc, libhfst/src/HfstOutputStream.cc,
+	  libhfst/src/HfstRules.cc,
+	  libhfst/src/implementations/ConvertTropicalWeightTransducer.cc,
+	  libhfst/src/implementations/SfstTransducer.cc: Replace system
+	  exit calls with HfstFatalExceptions.
+
+2015-11-12 15:55  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/TropicalWeightTransducer.cc,
+	  libhfst/src/implementations/TropicalWeightTransducer.h: Check for
+	  epsilon cycles with negative weights.
+	  
+	  Check if transducers have epsilon cycles with negative weights in
+	  functions that perform weight pushing and issue a warning, if
+	  needed.
+	  Add functions to set and get warning stream for
+	  TropicalWeightTransducer and HfstTransducer (basically a wrapper
+	  around the previous).
+
+2015-11-12 14:31  eaxelson
+
+	* libhfst/src/implementations/HfstTransitionGraph.h: Optimize
+	  function 'has_negative_epsilon_cycles'.
+	  
+	  Check if there are epsilon transitions with negative weights
+	  before testing for
+	  epsilon cycles with negative weights.
+
+2015-11-12 12:42  eaxelson
+
+	* tools/src/parsers/test/Makefile.am,
+	  tools/src/parsers/test/flag_with_unknown.output,
+	  tools/src/parsers/test/flag_with_unknown.xfst,
+	  tools/src/parsers/test/test.sh: Add a test for checking that
+	  unknowns are not expanded into flag diacritics.
+	  
+	  There were some cases where a FOMA_TYPE transducer would have
+	  failed this test
+	  before HfstTransducer::harmonize_ was modified.
+
+2015-11-12 11:28  eaxelson
+
+	* test/tools/Makefile.am, test/tools/negative_epsilon_cycles.txt,
+	  test/tools/no_negative_epsilon_cycles.txt,
+	  test/tools/txt2fst-functionality.sh, tools/src/hfst-txt2fst.cc:
+	  Add option 'check-negative-epsilon-cycles' to hfst-txt2fst and
+	  tests for it.
+
+2015-11-12 00:55  eaxelson
+
+	* libhfst/src/implementations/HfstTransitionGraph.h: Add function
+	  HfstTransitionGraph::has_negative_epsilon_cycles.
+
+2015-11-11 15:12  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, new_python_api/doc/libhfst.py,
+	  new_python_api/libhfst.i, new_python_api/test_hfst.py,
+	  test/tools/lexc-compiler-functionality.sh: Improve performance of
+	  transducer harmonization.
+	  
+	  Do not add flag diacritics to transducer alphabets twice, and
+	  when they are added,
+	  collect all flags and then add them instead of adding each flag
+	  separately.
+	  This removes the need to convert HfstTransducer to
+	  HfstBasicTransducer for each flag
+	  that gets added.
+	  
+	  This improvement also makes visible a bug in foma back-ends
+	  function 'eliminate_flags',
+	  so comment out one lexc compiler functionality test until the
+	  function is fixed.
+
+2015-11-10 13:12  hardwick
+
+	* tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-optimized-lookup.h: Time cutoff for the bundled
+	  standalone optimized-lookup tool too
+
+2015-11-08 13:51  eaxelson
+
+	* new_python_api/libhfst.i: Add parameter to control output in
+	  'compile_lexc_file'.
+
+2015-11-08 13:50  eaxelson
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/LexcCompiler.h: Add function unsigned int
+	  LexcCompiler::getVerbosity().
+
+2015-11-06 14:44  eaxelson
+
+	* new_python_api/libhfst.i, new_python_api/test_hfst.py: Allow user
+	  to control output in xre and xfst compilation.
+
+2015-11-05 13:22  eaxelson
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/LexcCompiler.h,
+	  libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/lexc-parser.yy,
+	  libhfst/src/parsers/lexc-utils.cc: Improve error handling in lexc
+	  compiler.
+	  
+	  Add functions 'set_error_stream' and 'get_error_stream'.
+	  Get rid of FILE pointers and replace them with ostreams when
+	  printing output.
+	  Propagate XfstCompiler's error stream and verbosity to its lexc
+	  compiler.
+
+2015-11-04 13:42  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/XreCompiler.cc,
+	  libhfst/src/parsers/XreCompiler.h,
+	  libhfst/src/parsers/xfst-parser.yy,
+	  libhfst/src/parsers/xfst-utils.cc,
+	  libhfst/src/parsers/xfst-utils.h,
+	  libhfst/src/parsers/xre_utils.cc, tools/src/hfst-regexp2fst.cc:
+	  Improve error handling mechanism in xre and xfst parsers.
+	  
+	  Get rid of XreCompiler's get_error_message and add functions
+	  set_error_stream, get_error_stream, set_verbosity and
+	  get_verbosity.
+	  Use ostreams instead of FILE pointers when writing output in
+	  XfstCompiler. Also add functions set_error_stream,
+	  get_error_stream, set_output_stream and get_output_stream.
+
+2015-11-03 08:46  eaxelson
+
+	* libhfst/src/implementations/HfstTransitionGraph.h: Add a missing
+	  period to the end of symbol lines when printing in prolog format.
+
+2015-11-02 19:14  mpsilfve
+
+	* libhfst/src/HfstTransducer.h: Added warning about very slow
+	  lookup when using HfstTransducer::lookup_fd.
+
+2015-11-02 19:13  mpsilfve
+
+	* libhfst/src/HfstTransducer.h: Added warning about very slow
+	  lookup when using HfstTransducer::lookup_fd.
+
+2015-11-02 19:00  mpsilfve
+
+	* libhfst/src/implementations/HfstTransition.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  libhfst/src/implementations/HfstTropicalTransducerTransitionData.h:
+	  Added possibility to transform individual transition weights in
+	  HfstTransitionGraph.
+
+2015-11-02 13:29  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.cc,
+	  libhfst/src/implementations/optimized-lookup/pmatch.h,
+	  tools/src/hfst-proc2.cc: Add option to suppress multichar
+	  tokenization and default to on in proc2
+
+2015-11-02 11:16  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/xfst-parser.yy: Replace part of
+	  XfstCompiler's FILE pointers with equivalent calls to ostream.
+	  
+	  The intention is to get rid of FILEs to make it easier to control
+	  if output is printed to a file or string.
+
+2015-10-30 15:12  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h: Tentatively move towards
+	  o(string)streams instead of FILE pointers when printing output.
+
+2015-10-30 11:43  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/transducer.cc:
+	  Remove debug printing
+
+2015-10-30 11:14  hardwick
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/optimized-lookup/transducer.cc,
+	  libhfst/src/implementations/optimized-lookup/transducer.h,
+	  tools/src/hfst-lookup.cc: Implement a time-based search cutoff
+	  for hfst-lookup in optimized-lookup mode only
+
+2015-10-30 10:14  eaxelson
+
+	* libhfst/src/parsers/xre_parse.yy,
+	  libhfst/src/parsers/xre_utils.cc,
+	  libhfst/src/parsers/xre_utils.h: Make 'define_function_args'
+	  return a bool instead of calling exit on error in xre parser.
+
+2015-10-30 09:36  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/XreCompiler.cc,
+	  libhfst/src/parsers/XreCompiler.h,
+	  libhfst/src/parsers/xfst-parser.yy,
+	  libhfst/src/parsers/xre_parse.yy: Fix error handling in xre and
+	  xfst compilers.
+	  
+	  Add YYABORT after xreerror is called in xre parser.
+	  Update error_message instead of printing it to standard error
+	  stream in xre compiler.
+	  Add a fail flag to xfst compiler and check its value in xfst
+	  parser instead of calling exit in the xfst compiler.
+
+2015-10-28 13:41  moshagen
+
+	* libhfst/src/parsers: Ignore generated files.
+
+2015-10-28 13:36  eaxelson
+
+	* new_python_api/doc/libhfst.py: Rewrite regular expression
+	  examples to be more informative.
+
+2015-10-28 11:32  eaxelson
+
+	* libhfst/src/implementations/TropicalWeightTransducer.cc: Scale
+	  weights to be non-negative in function n_best.
+
+2015-10-27 09:22  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Update documentation.
+
+2015-10-26 14:13  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i: Small
+	  fixes to read_att_string.
+
+2015-10-26 13:16  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Update documentation about special
+	  symbols. Add a function for reading AT&T strings.
+
+2015-10-26 08:10  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i: Add
+	  function start_xfst() that starts an interactive XFST compiler.
+
+2015-10-23 14:37  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/examples.py: Update
+	  documentation between HFST and backend conversions and add the
+	  examples to tests.
+
+2015-10-23 10:58  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Fix issues related to level of
+	  verbosity when compiling xfst and regexps. Add missing
+	  documentation.
+
+2015-10-23 10:37  hardwick
+
+	* libhfst/src/parsers/pmatch_parse.yy,
+	  libhfst/src/parsers/pmatch_utils.cc,
+	  libhfst/src/parsers/pmatch_utils.h: Merging of modified or added
+	  functionality from the xre parser
+
+2015-10-23 10:37  hardwick
+
+	* libhfst/src/HfstFlagDiacritics.h: Remove obsolete comment
+
+2015-10-23 08:19  eaxelson
+
+	* libhfst/src/HfstXeroxRules.cc, libhfst/src/HfstXeroxRules.h,
+	  libhfst/src/HfstXeroxRulesTest.cc: Revert HfstXeroxRules files to
+	  version 4484.
+
+2015-10-22 12:44  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Rewrite 'compile_lexc_file'.
+
+2015-10-22 08:45  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/xfst-parser.yy, new_python_api/libhfst.i,
+	  new_python_api/test_fail.xfst, new_python_api/test_hfst.py,
+	  new_python_api/test_pass.xfst, tools/src/parsers/hfst-xfst.cc:
+	  Improve handling of error and exit conditions in xfst.
+	  
+	  Do not call exit() directly from the xfst parser if 'quit' is
+	  requested or
+	  an unknown command is encountered, but leave it to the
+	  application to decide
+	  what should be done in those cases. For this purpose, add some
+	  functions to
+	  XfstCompiler:
+	  
+	  std::string get(const char * name) // Get the value of a
+	  variable.
+	  bool quit_requested() // Whether the script/user has requested
+	  'quit'
+	  int unknown_command(const char *) // For handling unknown
+	  commands
+	  
+	  Also rewrite the function compile_xfst_file(filename) in Python
+	  API and add
+	  some tests.
+
+2015-10-22 08:06  eaxelson
+
+	* libhfst/src/parsers/XfstCompiler.h: Add missing namespace:
+	  'string' -> 'std::string'.
+
+2015-10-21 09:16  jezral
+
+	* libhfst/src/implementations/optimized-lookup/transducer.cc,
+	  libhfst/src/implementations/optimized-lookup/transducer.h,
+	  tools/src/hfst-lookup.cc: Greatly reduce memory leaks when using
+	  hfst-ol format
+
+2015-10-20 14:03  eaxelson
+
+	* new_python_api/doc/Doxyfile, new_python_api/doc/libhfst.py,
+	  new_python_api/examples.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py, new_python_api/testfile.att: Update
+	  new python API.
+
+2015-10-20 13:57  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-lexc.bat,
+	  scripts/make-hfst-proc.bat, scripts/make-hfst-tool.bat,
+	  scripts/make-hfst-xfst.bat, scripts/make-htwolcpre1.bat,
+	  scripts/make-htwolcpre2.bat, scripts/make-htwolcpre3.bat,
+	  scripts/make-python-bindings.bat, scripts/test-hfst-tools.bat:
+	  Update windows scripts after moving XfstCompiler.
+
+2015-10-20 13:52  eaxelson
+
+	* libhfst/src/parsers/Makefile.am,
+	  libhfst/src/parsers/XfstCompiler.cc,
+	  libhfst/src/parsers/XfstCompiler.h,
+	  libhfst/src/parsers/xfst-lexer.ll,
+	  libhfst/src/parsers/xfst-parser.yy,
+	  libhfst/src/parsers/xfst-utils.cc,
+	  libhfst/src/parsers/xfst-utils.h,
+	  libhfst/src/parsers/xfst_help_message.cc,
+	  libhfst/src/parsers/xfst_help_message.h,
+	  scripts/generate-cc-files.sh, tools/src/parsers/Makefile.am,
+	  tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/XfstCompiler.h,
+	  tools/src/parsers/xfst-lexer.ll,
+	  tools/src/parsers/xfst-parser.yy,
+	  tools/src/parsers/xfst-utils.cc, tools/src/parsers/xfst-utils.h,
+	  tools/src/parsers/xfst_help_message.cc,
+	  tools/src/parsers/xfst_help_message.h: Move XfstCompiler from
+	  tools/src/parsers to libhfst/src/parsers.
+
+2015-10-20 13:50  eaxelson
+
+	* test/tools/Makefile.am: Add three missing files to dist.
+
+2015-10-20 12:56  jezral
+
+	* tools/src/hfst-lookup.cc: Add flushing to allow instrumentation
+	  of hfst-lookup
+
+2015-10-20 12:30  sdrobac
+
+	* libhfst/src/HfstXeroxRules.cc, libhfst/src/HfstXeroxRules.h,
+	  libhfst/src/HfstXeroxRulesTest.cc: Replace rules now should
+	  support Flag diacritics.
+
+2015-10-19 10:59  hardwick
+
+	* libhfst/src/parsers/pmatch_parse.yy: Fixed lenient composition
+	  (it used to be unimplemented).
+
+2015-10-19 10:56  eaxelson
+
+	* libhfst/src/HfstStrings2FstTokenizer.cc,
+	  libhfst/src/HfstStrings2FstTokenizer.h, libhfst/src/Makefile.am,
+	  tools/src/HfstStrings2FstTokenizer.cc,
+	  tools/src/HfstStrings2FstTokenizer.h, tools/src/Makefile.am,
+	  tools/src/parsers/Makefile.am, tools/src/parsers/XfstCompiler.cc:
+	  Move HfstStrings2FstTokenizer from tools to libhfst directory.
+
+2015-10-15 08:07  eaxelson
+
+	* libhfst/src/implementations/ConvertFomaTransducer.cc: Use the
+	  actual transition data object when copying transitions in
+	  conversion.
+
+2015-10-15 08:04  eaxelson
+
+	* libhfst/src/implementations/HfstTransitionGraph.h: Fix a warning
+	  about comparison of signed and unsigned value.
+
+2015-10-14 13:13  eaxelson
+
+	* libhfst/src/implementations/HfstTransitionGraph.h: Throw
+	  StateIndexOutOfBounds exception in get_final_weight, if state
+	  does not exist.
+
+2015-10-14 13:07  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/examples.py,
+	  new_python_api/libhfst.i: Add examples used in documentation to
+	  the tests.
+
+2015-10-14 08:25  eaxelson
+
+	* new_python_api/doc/Doxyfile, new_python_api/doc/libhfst.py,
+	  new_python_api/libhfst.i, new_python_api/test_hfst.py,
+	  new_python_api/testfile.att: Test examples and fix them, if
+	  needed.
+
+2015-10-12 12:56  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Add missing documentation and
+	  functions.
+
+2015-10-12 07:35  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Add a function that takes tokenized
+	  input and returns a transducer.
+
+2015-10-09 15:48  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Define new functions for creating
+	  transducers from string, string list and dictionary.
+
+2015-10-09 12:30  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py, new_python_api/testfile.att: Fix
+	  some issues in the new python interface.
+
+2015-10-06 13:16  eaxelson
+
+	* new_python_api/doc/Doxyfile, new_python_api/doc/libhfst.py,
+	  new_python_api/libhfst.i, new_python_api/test_hfst.py: Add more
+	  documentation and tests to the new python interface.
+
+2015-10-02 14:21  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h: Add aliases
+	  for different substitution functions.
+
+2015-10-02 13:50  eaxelson
+
+	* new_python_api/libhfst.i, new_python_api/test_hfst.py: Modify
+	  substitution functions to be more pythonic.
+
+2015-10-01 12:34  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Add more stuff to the new python
+	  interface.
+
+2015-10-01 08:46  eaxelson
+
+	* tools/src/parsers/xfst_help_message.cc: Fix output of hfst-xfst's
+	  command 'help'.
+	  
+	  Add explanation for commands where it was missing.
+	  Do not list commands that are not implemented.
+
+2015-10-01 08:43  eaxelson
+
+	* tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/xfst-lexer.ll: Fix small bugs in hfst-xfst.
+	  
+	  Add some space to the output of 'print longest-string'.
+	  Add missing aliases for command 'quit'.
+
+2015-09-30 09:46  eaxelson
+
+	* libhfst/src/implementations/TropicalWeightTransducer.cc: Modify
+	  also determinization function so that negative weights are
+	  handled correctly.
+	  
+	  This is this same procedure that was done for minimization
+	  function in revision #4439.
+
+2015-09-28 09:32  eaxelson
+
+	* new_python_api/doc/libhfst.py: Added more documentation.
+
+2015-09-28 08:31  eaxelson
+
+	* new_python_api/doc/libhfst.py: Added more documentation.
+
+2015-09-25 12:47  unhammer
+
+	* test/tools/proc-cat-NUL.strings,
+	  test/tools/proc-functionality.sh,
+	  tools/src/hfst-proc/tokenizer.cc: fix NUL flush, bug #240
+	  
+	  (NUL should also be kept in output, before flushing, as in
+	  lt-tools
+
+2015-09-24 13:56  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i,
+	  new_python_api/test_hfst.py: Add function __iter__() to
+	  libhfst.HfstBasicTransducer.
+
+2015-09-24 11:54  eaxelson
+
+	* new_python_api/doc/libhfst.py, new_python_api/libhfst.i: Modified
+	  libhfst files.
+
+2015-09-24 08:43  eaxelson
+
+	* new_python_api, new_python_api/Makefile.am,
+	  new_python_api/README, new_python_api/doc,
+	  new_python_api/doc/Doxyfile, new_python_api/doc/libhfst.py,
+	  new_python_api/foobar.hfst, new_python_api/libhfst.i,
+	  new_python_api/setup.py, new_python_api/test.lexc,
+	  new_python_api/test_hfst.py, new_python_api/testfile.att: Create
+	  directory for new python API.
+	  
+	  Copy all relevant parts from the old python API (from directory
+	  named 'swig')
+	  and modify them as needed. This API will at some point replace
+	  the old one,
+	  or at least be the default one.
+
+2015-09-24 08:36  eaxelson
+
+	* Doxyfile: Update Doxygen HFST version number.
+
+2015-09-24 07:31  eaxelson
+
+	* swig/README, swig/doc/Doxyfile: Update README and Doxygen
+	  documentation.
+	  
+	  Advise users to use python3 instead of python2.
+	  Tell how the swig wrapper can be modified if HFST exceptions do
+	  not inherit from BaseException.
+	  Update the Doxygen HFST version number.
+
+2015-09-22 12:35  eaxelson
+
+	* tools/src/parsers/test/contains_with_weight.output,
+	  tools/src/parsers/test/contains_with_weight.xfst,
+	  tools/src/parsers/test/merge_weighted.att,
+	  tools/src/parsers/test/merge_weighted.xfst,
+	  tools/src/parsers/test/test.sh,
+	  tools/src/parsers/test/weighted_parallel_rules_12.output,
+	  tools/src/parsers/test/weighted_parallel_rules_12.xfst,
+	  tools/src/parsers/test/weighted_parallel_rules_13.output,
+	  tools/src/parsers/test/weighted_parallel_rules_13.xfst: Add some
+	  tests with negative weights for contain, merge and parallel rule
+	  operators.
+
+2015-09-22 11:42  eaxelson
+
+	* libhfst/src/implementations/TropicalWeightTransducer.cc,
+	  libhfst/src/implementations/TropicalWeightTransducer.h: Modify
+	  minimization of weighted transducers so that negative weights are
+	  handled correctly.
+	  
+	  After epsilon removal, all states and transitions of the
+	  transducer are iterated over to find the lowest weight.
+	  If the lowest weight is negative, its opposite is added to all
+	  weights in the transducer.
+	  Then the transducer is determinized and minimized normally.
+	  Finally, if the original lowest weight was negative, it is added
+	  to all weights in the transducer.
+	  
+	  This procedure effectively removes negative weights from the
+	  transducer before determinization and adds them again in the end.
+	  It is needed because OpenFst's determinization algorithm cannot
+	  handle negative weights correctly.
+	  
+	  Running 'make check' in directory fsmbook-examples takes
+	  approximately 3 minutes before and after the changes, so it seems
+	  that the slowdown should not be an issue.
+
+2015-09-16 10:30  eaxelson
+
+	* scripts/Makefile.am: Always include 'generate-cc-files.sh' script
+	  in dist package.
+
+2015-09-16 10:17  eaxelson
+
+	* libhfst/src/parsers/xre_lex.ll, libhfst/src/parsers/xre_parse.yy:
+	  Do not allow omitting the question mark on either or both sides
+	  of colon in regular expressions. Xerox has also removed this
+	  feature from their regexp syntax. Interpret expressions such as
+	  [foo : bar], [foo: bar] and [foo :bar] as [foo:bar]. Expressions
+	  of type [foo:], [:bar] and [:] will yield an error.
+
+2015-09-16 09:50  eaxelson
+
+	* test/tools/pmatch-functionality.sh: Test if pmatch-tests.sh.*
+	  files exist before removing them to avoid 'rm: cannot remove:'
+	  messages.
+
+2015-09-16 08:21  eaxelson
+
+	* configure.ac: Remove foma license warning. The current license of
+	  foma has no compatibility issues.
+
+2015-09-16 08:06  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/HfstTransition.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  swig/libhfst.i, swig/setup.py: Make some changes for the python
+	  interface. Move HfstFile wrapper class to the swig interface
+	  file. Make HfstStates and HfstTransitions typedefs public. Add a
+	  destructor for HfstTransition. Update version number to 3.8.3.
+
+2015-09-15 07:13  hardwick
+
+	* tools/src/hfst-pmatch.cc, tools/src/hfst-proc2.cc: Handle a
+	  frequently encountered exception
+
+2015-09-03 07:19  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h: Reverted
+	  changes done for class HfstFile in revision 4431.
+
+2015-09-02 10:20  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h: Removed
+	  HfstFile wrapper class and functions using it. A better place for
+	  them is in the swig directory.
+
+2015-09-01 06:32  eaxelson
+
+	* libhfst/src/HfstExceptionDefs.cc,
+	  libhfst/src/HfstExceptionDefs.h: Added destructor for class
+	  HfstException. It needs to be defined for SWIG.
+
+2015-08-31 12:36  unhammer
+
+	* test/tools/Makefile.am, test/tools/cat_weight_ambig.txt,
+	  test/tools/cat_weight_ambig_W_out.strings,
+	  test/tools/cat_weight_ambig_out.strings,
+	  test/tools/proc-functionality.sh: tests for --weight-classes 1
+	  and ordering by weights in proc
+
+2015-08-31 12:06  unhammer
+
+	* test/tools/proc-caps-out1.strings,
+	  test/tools/proc-caps-out3.strings: make tests pass again (only
+	  analysis order changed here)
+
+2015-08-27 18:37  unhammer
+
+	* tools/src/hfst-proc/formatter.cc,
+	  tools/src/hfst-proc/formatter.h: use std::vector as ProcResult to
+	  get output sorted by weight-class
+
+2015-08-27 18:35  unhammer
+
+	* tools/src/hfst-proc/applicators.cc,
+	  tools/src/hfst-proc/formatter.cc,
+	  tools/src/hfst-proc/formatter.h,
+	  tools/src/hfst-proc/lookup-path.h: fix --weight-classes, bug #308
+	  
+	  old code did comparison without first casting (where possible) to
+	  weighted paths; added a compare fn that tries casting. Also,
+	  typedef
+	  the ProcResult
+
+2015-08-20 12:09  eaxelson
+
+	* scripts/generate-cc-files.sh: Now the script generate-cc-files.sh
+	  creates also lexer files.
+
+2015-08-20 10:04  jezral
+
+	* scripts/Makefile.am: Add $(EXEEXT) for Windows
+
+2015-08-20 09:56  jezral
+
+	* back-ends/foma/determinize.c, back-ends/foma/foma.h,
+	  back-ends/foma/mem.c, back-ends/foma/minimize.c: More Foma fixes
+	  for cross-building and clang
+
+2015-08-20 07:46  eaxelson
+
+	* back-ends/foma/determinize.c, back-ends/foma/minimize.c: Small
+	  modifications to foma code: struct and variable had the same
+	  name.
+
+2015-08-17 14:08  eaxelson
+
+	* README, back-ends/foma/CHANGELOG, back-ends/foma/COPYING,
+	  back-ends/foma/README, back-ends/foma/apply.c,
+	  back-ends/foma/coaccessible.c, back-ends/foma/constructions.c,
+	  back-ends/foma/define.c, back-ends/foma/determinize.c,
+	  back-ends/foma/dynarray.c, back-ends/foma/flags.c,
+	  back-ends/foma/foma.c, back-ends/foma/foma.h,
+	  back-ends/foma/fomalib.h, back-ends/foma/fomalibconf.h,
+	  back-ends/foma/iface.c, back-ends/foma/io.c,
+	  back-ends/foma/lex.cmatrix.c, back-ends/foma/lex.interface.c,
+	  back-ends/foma/lex.lexc.c, back-ends/foma/lex.yy.c,
+	  back-ends/foma/lexc.l, back-ends/foma/lexcread.c,
+	  back-ends/foma/mem.c, back-ends/foma/minimize.c,
+	  back-ends/foma/regex.c, back-ends/foma/regex.h,
+	  back-ends/foma/regex.l, back-ends/foma/regex.y,
+	  back-ends/foma/reverse.c, back-ends/foma/rewrite.c,
+	  back-ends/foma/sigma.c, back-ends/foma/spelling.c,
+	  back-ends/foma/stringhash.c, back-ends/foma/structures.c,
+	  back-ends/foma/topsort.c, back-ends/foma/trie.c,
+	  back-ends/foma/utf8.c: Updated to foma version 0.9.18alpha.
+
+2015-08-14 15:40  jezral
+
+	* hfst.m4, tools/src/hfst-proc/buffer.h: GNU address removal
+
+2015-08-10 13:04  eaxelson
+
+	* tools/src/hfst-compare.cc: Fixed some memory leaks in
+	  hfst-compare reported in bug #167.
+
+2015-08-07 09:37  eaxelson
+
+	* scripts/README, scripts/README_eight_tools_mac.txt,
+	  scripts/README_eight_tools_win.txt, scripts/README_xfst_mac.txt,
+	  scripts/README_xfst_win.txt: Adding the renamed files.
+
+2015-08-07 09:32  eaxelson
+
+	* scripts/README, scripts/README_eight_tools_win.txt,
+	  scripts/README_xfst_win.txt: Trying to rename README files...
+
+2015-08-07 09:24  eaxelson
+
+	* scripts/README_eight_tools.txt,
+	  scripts/README_eight_tools_win.txt, scripts/README_xfst.txt,
+	  scripts/README_xfst_win.txt, scripts/copy-for-windows.sh,
+	  scripts/package-static-binaries.sh, scripts/test-libhfst.bat,
+	  scripts/test-openfstwin.bat: Updated scripts.
+
+2015-08-04 08:13  eaxelson
+
+	* scripts/README: Now all files in this directory are listed in
+	  README
+
+2015-08-04 07:31  eaxelson
+
+	* scripts/README: Added a README file for the scripts directory.
+
+2015-06-25 09:16  hardwick
+
+	* tools/src/hfst-pmatch2fst.cc: Fix help message
+
+2015-06-25 09:14  hardwick
+
+	* libhfst/src/parsers/pmatch_parse.yy: Fix containment, implement
+	  some additional wanted operations
+
+2015-06-11 15:40  eaxelson
+
+	* ChangeLog, ChangeLog.old, NEWS, configure.ac,
+	  libhfst/src/Makefile.am: Ready for release 3.8.3.
+
 2015-06-11 10:24  eaxelson
 
 	* scripts/README_eight_tools.txt, scripts/copy-for-windows.sh:
diff --git a/ChangeLog.old b/ChangeLog.old
index 50487c4..79d4943 100644
--- a/ChangeLog.old
+++ b/ChangeLog.old
@@ -1,3 +1,1047 @@
+2015-06-11 10:24  eaxelson
+
+	* scripts/README_eight_tools.txt, scripts/copy-for-windows.sh:
+	  Updated windows scripts.
+
+2015-06-11 10:24  eaxelson
+
+	* tools/src/parsers/XfstCompiler.cc: Now a warning message gets
+	  printed if stack contains transducers whose types differ (can
+	  happen if lookup-optimize is called before pushing another
+	  transducer onto stack).
+
+2015-06-10 10:49  eaxelson
+
+	* scripts/README_eight_tools.txt: Added a windows README file for
+	  the package that contains eight command line tools.
+
+2015-06-10 09:54  eaxelson
+
+	* scripts/README_xfst.txt: Added a Windows README file for
+	  hfst-xfst.
+
+2015-06-09 13:09  eaxelson
+
+	* back-ends/openfst/src/include/fst/rmfinalepsilon.h,
+	  back-ends/openfst/src/include/fst/symbol-table-ops.h,
+	  back-ends/openfst/src/include/fst/synchronize.h,
+	  scripts/copy-for-windows.sh, scripts/test-hfst-tools.bat,
+	  scripts/windows_tests, scripts/windows_tests/test.lexc,
+	  scripts/windows_tests/test.pmatch,
+	  scripts/windows_tests/test.twolc,
+	  scripts/windows_tests/test.xfst,
+	  scripts/windows_tests/test_lexc_result.txt,
+	  scripts/windows_tests/test_pmatch_result.txt,
+	  scripts/windows_tests/test_twolc_result.txt,
+	  scripts/windows_tests/test_xfst_result.txt,
+	  tools/src/hfst-proc/hfst-proc.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/hfst-string-conversions.h,
+	  tools/src/hfst-twolc/src/hfst-twolc.bat: Added tests for windows.
+	  Made small fixes to hfst-proc and hfst-twolc for windows.
+
+2015-06-08 12:31  eaxelson
+
+	* tools/src/hfst-twolc/src/alphabet_src/Alphabet.cc,
+	  tools/src/hfst-twolc/src/commandline_src/CommandLine.cc,
+	  tools/src/hfst-twolc/src/htwolcpre1.yy,
+	  tools/src/hfst-twolc/src/htwolcpre2.yy,
+	  tools/src/hfst-twolc/src/htwolcpre3.yy,
+	  tools/src/hfst-twolc/src/rule_src/ConflictResolvingLeftArrowRule.cc,
+	  tools/src/hfst-twolc/src/rule_src/OtherSymbolTransducer.cc,
+	  tools/src/hfst-twolc/src/rule_src/Rule.cc,
+	  tools/src/hfst-twolc/src/rule_src/TwolCGrammar.cc,
+	  tools/src/hfst-twolc/src/scanner1.ll,
+	  tools/src/hfst-twolc/src/string_src/string_manipulation.cc,
+	  tools/src/hfst-twolc/src/variable_src/ConstContainerIterator.h,
+	  tools/src/hfst-twolc/src/variable_src/MixedConstContainerIterator.h,
+	  tools/src/hfst-twolc/src/variable_src/RuleSymbolVector.cc,
+	  tools/src/hfst-twolc/src/variable_src/RuleVariables.cc,
+	  tools/src/hfst-twolc/src/variable_src/RuleVariablesConstIterator.cc,
+	  tools/src/hfst-twolc/src/variable_src/VariableValueIterator.h:
+	  Replaced alternative tokens for logical operators with the
+	  standard ones.
+
+2015-06-08 12:22  eaxelson
+
+	* tools/src/hfst-twolc/src/commandline_src/CommandLine.h: Checking
+	  for existence of config.h and getopt.h.
+
+2015-06-08 12:19  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-tools.bat,
+	  scripts/make-htwolcpre2.bat: Updated scripts.
+
+2015-06-08 10:02  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-htwolcpre1.bat,
+	  scripts/make-htwolcpre2.bat, scripts/make-htwolcpre3.bat: Added
+	  make scripts for twolc.
+
+2015-06-08 08:26  eaxelson
+
+	* scripts/copy-for-windows.sh: Added twolc to windows compilation
+	  scripts.
+
+2015-06-05 13:46  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-proc.bat,
+	  scripts/make-hfst-xfst.bat: Updated windows scripts.
+
+2015-06-05 13:43  eaxelson
+
+	* tools/src/Makefile.am, tools/src/hfst-lookup.cc,
+	  tools/src/hfst-optimized-lookup.cc, tools/src/hfst-pmatch.cc,
+	  tools/src/hfst-pmatch2fst.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/hfst-string-conversions.h: Fixing again reading and
+	  writing to/from console on windows.
+
+2015-06-04 12:58  eaxelson
+
+	* libhfst/src/parsers/pmatch_utils.h: Using hex values for unicode
+	  characters when compiling with msvc to get rid of warnings (and
+	  possible segfaults).
+
+2015-06-04 08:24  jezral
+
+	* test/tools/proc-functionality.sh,
+	  tools/src/hfst-proc/tokenizer.cc: Terminator needs reading, and
+	  yes there are partial reads
+
+2015-06-03 14:34  jezral
+
+	* tools/src/hfst-proc/tokenizer.cc: std::string all the way
+
+2015-06-03 10:29  eaxelson
+
+	* tools/src/hfst-proc/alphabet.cc,
+	  tools/src/hfst-proc/hfst-proc.cc,
+	  tools/src/hfst-proc/tokenizer.cc: Added missing HAVE_CONFIG_H
+	  ifdef. Added globals-common.h header as some compilers complain
+	  about missing extern variables. Now creating variable size array
+	  'next_u8' dynamically with operator 'new'.
+
+2015-06-03 10:04  eaxelson
+
+	* tools/src/parsers/Makefile.am, tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/help_message.cc,
+	  tools/src/parsers/xfst_help_message.cc,
+	  tools/src/parsers/xfst_help_message.h: Renamed help_message.cc
+	  into xfst_help_message.cc and added a header file
+	  xfst_help_message.h. Now XfstCompiler includes only the header
+	  file.
+
+2015-06-03 07:53  eaxelson
+
+	* tools/src/parsers/XfstCompiler.cc: Fixed a typo and added
+	  explicit braces to an else statement.
+
+2015-06-02 12:54  eaxelson
+
+	* tools/src/hfst-getopt.cc, tools/src/hfst-lookup.cc,
+	  tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/hfst-xfst.cc, tools/src/parsers/test/test.sh:
+	  Now option --pipe-mode takes an optional argument { input,
+	  output, both }, 'both' being the default.
+
+2015-05-29 12:25  mpsilfve
+
+	* libhfst/src/Makefile.am: Install hfstdll.h
+
+2015-05-29 11:24  eaxelson
+
+	* tools/src/Makefile.am, tools/src/hfst-lookup.cc,
+	  tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/hfst-string-conversions.h,
+	  tools/src/parsers/hfst-xfst.cc: Now hfst-lookup and
+	  hfst-optimized-lookup read from console and print to console by
+	  default on windows.
+
+2015-05-28 12:21  eaxelson
+
+	* tools/src/hfst-optimized-lookup.cc: Commented out one debug
+	  print...
+
+2015-05-28 12:20  eaxelson
+
+	* tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/hfst-string-conversions.h,
+	  tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/hfst-xfst.cc: More improvements to utf-8
+	  handling on windows.
+
+2015-05-27 13:09  eaxelson
+
+	* tools/src/Makefile.am, tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-string-conversions.cc,
+	  tools/src/hfst-string-conversions.h,
+	  tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/XfstCompiler.h: Small modifications for better
+	  utf-8 support on windows.
+
+2015-05-26 12:06  eaxelson
+
+	* scripts/copy-for-windows.sh, tools/src/hfst-lookup.cc,
+	  tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-optimized-lookup.h, tools/src/hfst-pmatch.cc,
+	  tools/src/hfst-pmatch2fst.cc: Small modifications for some
+	  command line tools for windows.
+
+2015-05-25 13:08  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-lexc.bat,
+	  scripts/make-hfst-tool.bat, tools/src/hfst-compare.cc,
+	  tools/src/hfst-strings2fst.cc, tools/src/hfst-txt2fst.cc,
+	  tools/src/parsers/test/test.sh: Added tool compilation scripts
+	  for windows. Argument handling on windows is also supported for
+	  some tools needed for hfst-xfst testing.
+
+2015-05-25 12:56  eaxelson
+
+	* tools/src/hfst-getopt.cc: Fixed a bug in argument handling.
+
+2015-05-22 11:14  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-xfst.bat,
+	  tools/src/hfst-lexc-compiler.cc, tools/src/parsers/hfst-xfst.cc:
+	  Edited help messages and warnings of hfst-xfst and hfst-lexc on
+	  windows about character encodings.
+
+2015-05-21 13:06  eaxelson
+
+	* tools/src/hfst-getopt.cc, tools/src/hfst-getopt.h,
+	  tools/src/hfst-lexc-compiler.cc, tools/src/parsers/hfst-xfst.cc:
+	  Moved getopt implementation to a separate file.
+
+2015-05-20 14:01  eaxelson
+
+	* scripts/copy-for-windows.sh, tools/src/parsers/hfst-xfst.cc:
+	  Added an implementation for long options for windows.
+
+2015-05-19 11:50  eaxelson
+
+	* back-ends/foma/lex.cmatrix.c, back-ends/foma/sigma.c,
+	  back-ends/foma/spelling.c, back-ends/foma/structures.c,
+	  scripts/copy-for-windows.sh, tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/hfst-xfst.cc: Fixed some issues noticed during
+	  msvc compilation. Renamed function 'min' to 'min_' to avoid
+	  collision with a macro with the same name. Changed arguments of
+	  comparison function given to qsort to (const void *, const void
+	  *). Added support for commandline arguments of type
+	  '--option=argument' to hfst-xfst for windows. Also changed
+	  hfst-xfst's option --print-to-console (default false) into
+	  --no-console (default false) on windows.
+
+2015-05-18 13:41  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-hfst-xfst.bat,
+	  tools/src/getopt_long.cc, tools/src/getopt_long.h: Updated
+	  windows script files.
+
+2015-05-18 13:40  eaxelson
+
+	* tools/src/parsers/hfst-xfst.cc: Deleted getopt_long cc and h
+	  files. Processing command line arguments manually in hfst-xfst.cc
+	  on windows.
+
+2015-05-18 13:39  eaxelson
+
+	* libhfst/src/implementations/optimized-lookup/transducer.h,
+	  tools/src/hfst-commandline.cc: Added some ifdef _MSC_VER
+	  directives.
+
+2015-05-18 10:36  eaxelson
+
+	* libhfst/src/implementations/optimized-lookup/transducer.h:
+	  Applied patch for musl libc compilation.
+
+2015-05-11 12:04  eaxelson
+
+	* libhfst/src/HarmonizeUnknownAndIdentitySymbols.cc,
+	  libhfst/src/HarmonizeUnknownAndIdentitySymbols.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  libhfst/src/implementations/optimized-lookup/transducer.h,
+	  scripts/make-hfst-xfst.bat, tools/src/hfst-commandline.cc,
+	  tools/src/parsers/XfstCompiler.cc: Fixed some bugs noticed when
+	  compiling on windows.
+
+2015-05-08 20:21  hardwick
+
+	* tools/src/hfst-proc2.cc: Blank line between outputs in --finnpos
+	  mode
+
+2015-05-08 14:05  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/libhfst_win.i,
+	  scripts/make-hfst-xfst.bat,
+	  tools/src/HfstStrings2FstTokenizer.cc, tools/src/getopt_long.cc,
+	  tools/src/getopt_long.h, tools/src/hfst-commandline.cc,
+	  tools/src/hfst-commandline.h, tools/src/parsers/hfst-xfst.cc,
+	  tools/src/parsers/xfst-lexer.ll, tools/src/parsers/xfst-utils.h:
+	  Updated windows scripts. Added ifdefs for msvc compilation.
+
+2015-05-05 12:15  eaxelson
+
+	* scripts/libhfst_win.i, scripts/make-python-bindings.bat,
+	  scripts/test_libhfst_win.py: Updated swig scripts for windows.
+
+2015-04-29 12:32  hardwick
+
+	* tools/src/hfst-proc2.cc: Add FinnPos mode and reorganise
+
+2015-04-27 13:34  eaxelson
+
+	* back-ends/openfstwin/src/include/fst/flags.h,
+	  scripts/copy-for-windows.sh, scripts/make-foma.bat,
+	  scripts/make-libhfst.bat, scripts/make-openfstwin.bat,
+	  scripts/make-python-bindings.bat, scripts/test-libhfst.bat,
+	  scripts/test-openfstwin.bat, scripts/test_libhfst_win.py: Updated
+	  and added scripts for compiling python bindings on windows.
+
+2015-04-23 11:30  hardwick
+
+	* libhfst/src/parsers/pmatch_utils.cc,
+	  tools/src/hfst-pmatch2fst.cc: Fix harmonization issue and speed
+	  up the common case of only on top-level matcher
+
+2015-04-23 06:24  moshagen
+
+	* tools/src/hfst-reweight.cc: Documented the tsv file format, added
+	  some linebreaks to make the helpt text easier to read.
+
+2015-04-21 09:22  moshagen
+
+	* tools/src/hfst-reweight.cc: Always skip comment lines. Added
+	  verbose output for TSV file reweighting.
+
+2015-04-21 07:21  moshagen
+
+	* tools/src/hfst-reweight.cc: Fixed bug #293 by initialising the
+	  line variable before using it.
+
+2015-04-20 13:52  moshagen
+
+	* tools/src/hfst-reweight.cc: Whitespace only.
+
+2015-04-17 18:54  eaxelson
+
+	* libhfst/src/hfstdll.h: Added missing file 'hfstdll.h'.
+
+2015-04-17 12:43  eaxelson
+
+	* scripts/copy-for-windows.sh,
+	  scripts/generate-python-bindings.bat, scripts/libhfst_win.i,
+	  scripts/make-libhfst.bat, scripts/make-openfstwin.bat,
+	  scripts/test-libhfst.bat, scripts/test-openfstwin.bat: Edited and
+	  added scripts for windows compilation.
+
+2015-04-17 12:10  eaxelson
+
+	* libhfst/src/HarmonizeUnknownAndIdentitySymbols.h,
+	  libhfst/src/HfstExceptionDefs.h,
+	  libhfst/src/HfstFlagDiacritics.h, libhfst/src/HfstInputStream.h,
+	  libhfst/src/HfstOutputStream.h, libhfst/src/HfstSymbolDefs.h,
+	  libhfst/src/HfstTokenizer.h, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/HfstTransition.h,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  libhfst/src/implementations/HfstTropicalTransducerTransitionData.h:
+	  Added HFSTDLL's for some functions for windows compilation.
+
+2015-04-15 11:48  eaxelson
+
+	* tools/src/hfst-reweight.cc: Added option --arcs-only to
+	  hfst-reweight. Now weights of all arcs and end states are
+	  modified unless --arcs-only or --end-states-only is used. Also
+	  fixed '--end-state-only' as '--end-states-only'.
+
+2015-04-13 10:26  eaxelson
+
+	* libhfst/src/implementations/ConvertOlTransducer.cc,
+	  libhfst/src/implementations/FomaTransducer.cc,
+	  libhfst/src/implementations/LogWeightTransducer.cc,
+	  libhfst/src/implementations/TropicalWeightTransducer.cc: Added
+	  some explicit type conversions.
+
+2015-04-09 13:28  moshagen
+
+	* tools/src/hfst-pair-test.cc: Changed the short form of the xerox
+	  mode from -x to -X (upper case), to be more consistent with the
+	  other options, and to match the test on line 195.
+
+2015-04-08 13:12  eaxelson
+
+	* configure.ac, libhfst/src/HfstTransducer.cc,
+	  libhfst/src/implementations/FomaTransducer.cc,
+	  libhfst/src/implementations/FomaTransducer.h,
+	  libhfst/src/implementations/Makefile.am, tools/src/Makefile.am:
+	  Now it is checked if foma back-end and zlib are available before
+	  hfst-lexc-wrapper is generated. This also affects the way
+	  HfstTransducer::read_lexc_ptr is implemented for FOMA_TYPE:
+	  native HFST lexc compiler is used if lexc wrapper is not
+	  generated.
+
+2015-04-08 13:09  eaxelson
+
+	* swig/libhfst.i, swig/setup.py: Updated hfst version number in the
+	  python setup file. Fixed the argument type of
+	  LexcCompiler::setVerbosity from bool to unsigned int.
+
+2015-04-08 13:06  eaxelson
+
+	* libhfst/src/HfstInputStream.cc,
+	  libhfst/src/implementations/ConvertFomaTransducer.cc,
+	  libhfst/src/implementations/ConvertTropicalWeightTransducer.cc:
+	  Changed again some 'not' operators into \!.
+
+2015-04-08 13:01  eaxelson
+
+	* libhfst/src/implementations/optimized-lookup/convert.cc: Added a
+	  missing // in the beginning of a comment line noticed during
+	  windows compilation.
+
+2015-04-08 13:00  eaxelson
+
+	* scripts/copy-for-windows.sh,
+	  scripts/generate-python-bindings.bat, scripts/make-libhfst.bat:
+	  Edited windows batch scripts and added a new one for creating
+	  python bindings.
+
+2015-04-08 09:48  eaxelson
+
+	* libhfst/src/parsers/xre_parse.yy,
+	  libhfst/src/parsers/xre_utils.cc: Changed declaration 'class
+	  yy_buffer_state' into 'struct yy_buffer_state'.
+
+2015-04-07 14:23  eaxelson
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/pmatch_lex.ll,
+	  libhfst/src/parsers/pmatch_parse.yy: Fixed declared return type
+	  from 'void' into 'int' for functions hlexclex_destroy and
+	  pmatcherror.
+
+2015-04-07 13:24  mpsilfve
+
+	* tools/src/hfst-pair-test.cc: Xerox twolc test support in
+	  hfst-pair-test
+
+2015-04-02 14:37  mpsilfve
+
+	* libhfst/src/implementations/compose_intersect/ComposeIntersectLexicon.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectLexicon.h:
+	  Tentatively fixed missing paths problem in compose-intersect
+
+2015-04-01 12:21  eaxelson
+
+	* libhfst/src/implementations/compose_intersect/ComposeIntersectFst.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectFst.h,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectRulePair.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectRulePair.h:
+	  Moved definition of member 'static const HfstState START' of
+	  classes ComposeIntersectFst and ComposeIntersectRulePair from
+	  header to cc file.
+
+2015-04-01 11:39  hardwick
+
+	* libhfst/src/parsers/pmatch_lex.ll,
+	  libhfst/src/parsers/pmatch_parse.yy: Add [].t() syntax for
+	  delimiting tagged (and context-checked!) regions
+
+2015-03-31 14:47  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/make-implementations.bat,
+	  scripts/make-libhfst.bat: Added new scripts for testing native
+	  windows compilation.
+
+2015-03-31 14:46  eaxelson
+
+	* libhfst/src/HarmonizeUnknownAndIdentitySymbols.cc,
+	  libhfst/src/HfstEpsilonHandler.cc,
+	  libhfst/src/HfstInputStream.cc, libhfst/src/HfstOutputStream.cc,
+	  libhfst/src/HfstRules.cc, libhfst/src/HfstTokenizer.cc,
+	  libhfst/src/HfstTransducer.cc, libhfst/src/HfstXeroxRules.cc,
+	  libhfst/src/implementations/LogWeightTransducer.cc: Added missing
+	  return values for some functions. Replaced ciso646 keywords for
+	  logical operators with standard ones.
+
+2015-03-26 22:14  eaxelson
+
+	* scripts/make-implementations.bat, scripts/make-parsers.bat: Added
+	  make scripts for windows.
+
+2015-03-26 22:13  eaxelson
+
+	* scripts/copy-for-windows.sh: Updated script.
+
+2015-03-26 21:36  eaxelson
+
+	* libhfst/src/parsers/LexcCompiler.cc,
+	  libhfst/src/parsers/pmatch_utils.cc,
+	  tools/src/HfstStrings2FstTokenizer.cc,
+	  tools/src/HfstStrings2FstTokenizer.h, tools/src/hfst-lookup.cc,
+	  tools/src/hfst-pair-test.cc, tools/src/hfst-strings2fst.cc:
+	  Removed unnecessary HfstUtf8.h and HfstStrings2FstTokenizer.h
+	  inclusions from libhfst/src/ files. Also moved
+	  HfstStrings2FstTokenizer into hfst namespace.
+
+2015-03-26 20:44  eaxelson
+
+	* back-ends/foma/fomalib.h, back-ends/foma/fomalibconf.h,
+	  libhfst/src/FormatSpecifiers.h,
+	  libhfst/src/implementations/ConvertTransducerFormat.h,
+	  libhfst/src/implementations/FomaTransducer.h,
+	  libhfst/src/implementations/LogWeightTransducer.h: Now handling
+	  all stdbool definitions in foma headers.
+
+2015-03-26 15:05  eaxelson
+
+	* libhfst/src/implementations/FomaTransducer.h,
+	  libhfst/src/implementations/LogWeightTransducer.h,
+	  libhfst/src/implementations/Makefile.am,
+	  libhfst/src/implementations/TropicalWeightTransducer.h: Now
+	  HAVE_CONFIG_H is checked before including config.h. Removed
+	  inclusion of zlib.h that had no effect.
+
+2015-03-26 15:02  eaxelson
+
+	* back-ends/foma/Makefile.am, back-ends/foma/iface.c,
+	  back-ends/foma/io.c, back-ends/foma/lex.lexc.c,
+	  back-ends/foma/lex.yy.c: Changed ifdef WINDOWS into _MSC_VER. Now
+	  zlib.h is included only when requested with -DZLIB.
+
+2015-03-26 12:20  eaxelson
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.cc,
+	  libhfst/src/implementations/optimized-lookup/transducer.cc,
+	  libhfst/src/implementations/optimized-lookup/transducer.h: Using
+	  dynamic arrays instead of static ones to keep cl.exe happy. Also
+	  added definition for 'ssize_t' on windows.
+
+2015-03-26 12:18  eaxelson
+
+	* libhfst/src/implementations/compose_intersect/ComposeIntersectLexicon.cc:
+	  Replaced 'and' with '&&'.
+
+2015-03-26 12:17  eaxelson
+
+	* libhfst/src/implementations/FomaTransducer.cc: Replaced 'and'
+	  with '&&'. Also made a variable defining the size of an array
+	  const.
+
+2015-03-25 13:34  eaxelson
+
+	* libhfst/src/implementations/ConvertOlTransducer.cc,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectFst.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectLexicon.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectRulePair.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectUtilities.cc,
+	  libhfst/src/implementations/compose_intersect/ComposeIntersectUtilities.h,
+	  libhfst/src/implementations/optimized-lookup/transducer.h:
+	  Replaced ciso646 aliases and,or,not with &&,||,\!. Also changed
+	  sizeof(variable) into sizeof(variable_type) in ol transducer
+	  header because cl.exe complained about that for some reason.
+
+2015-03-25 12:47  eaxelson
+
+	* libhfst/src/parsers/xre_utils.cc: Fixed a bug where operator '=='
+	  was used instead of '=' when setting the value of last element in
+	  a char array.
+
+2015-03-23 14:58  eaxelson
+
+	* scripts/copy-for-windows.sh: Added missing files.
+
+2015-03-20 15:11  eaxelson
+
+	* scripts/copy-for-windows.sh, scripts/inttypes.h,
+	  scripts/make-foma.bat, scripts/make-openfstwin.bat,
+	  scripts/stdint.h: Added scripts and headers for windows
+	  compilation.
+
+2015-03-20 15:10  eaxelson
+
+	* libhfst/src/HfstFlagDiacritics.cc,
+	  libhfst/src/HfstLookupFlagDiacritics.cc,
+	  libhfst/src/HfstSymbolDefs.cc,
+	  libhfst/src/implementations/TropicalWeightTransducer.cc,
+	  libhfst/src/implementations/TropicalWeightTransducer.h: Changed
+	  operators {not,and,or} into {\!,&&,||} because cl.exe complains
+	  about them on windows.
+
+2015-03-20 14:20  eaxelson
+
+	* scripts/copy-for-windows.sh: Added a script for windows
+	  compilation
+
+2015-03-20 08:44  eaxelson
+
+	* back-ends/foma/apply.c, back-ends/foma/constructions.c,
+	  back-ends/foma/determinize.c, back-ends/foma/fomalib.h,
+	  back-ends/foma/fomalibconf.h, back-ends/foma/lex.cmatrix.c,
+	  back-ends/foma/lex.yy.c, back-ends/foma/mem.c,
+	  back-ends/foma/minimize.c, back-ends/foma/structures.c,
+	  back-ends/openfstwin/src/include/fst/compat.h,
+	  back-ends/openfstwin/src/include/fst/properties.h: Added support
+	  for compiling openfst and foma back-ends with cl.exe on windows.
+
+2015-03-15 17:45  hardwick
+
+	* libhfst/src/parsers/pmatch_lex.ll: Include zero in signed and
+	  unsigned integers
+
+2015-03-15 16:16  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.cc:
+	  Correction to handling trailing nonmatching material in
+	  locate_mode
+
+2015-03-11 14:22  eaxelson
+
+	* libhfst/src/HfstApply.cc, libhfst/src/HfstTransducer.cc: Forgot
+	  to commit these files too...
+
+2015-03-11 14:21  eaxelson
+
+	* tools/src/hfst-concatenate.cc, tools/src/hfst-conjunct.cc,
+	  tools/src/hfst-disjunct.cc, tools/src/hfst-head.cc,
+	  tools/src/hfst-info.cc, tools/src/hfst-minimize.cc,
+	  tools/src/hfst-split.cc, tools/src/hfst-subtract.cc,
+	  tools/src/hfst-tail.cc: Added xfsm support for some command line
+	  tools.
+
+2015-03-11 10:28  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Now HfstTransducer
+	  functions throw a FunctionNotImplementedExeption if xfsm
+	  implementation is not available.
+
+2015-03-10 15:47  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Added more xfsm
+	  implementations.
+
+2015-03-10 14:54  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Added more
+	  implementations for XFSM_TYPE for HfstTransducer functions.
+
+2015-03-09 12:41  hardwick
+
+	* libhfst/src/parsers/pmatch_parse.yy: Add ignoring
+
+2015-03-09 11:20  hardwick
+
+	* libhfst/src/parsers/pmatch_parse.yy: Correct parsing order of
+	  PARALLEL_RULES
+
+2015-03-04 15:18  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/ConvertTransducerFormat.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h,
+	  tools/src/hfst-compose.cc: Added support for composition for xfsm
+	  transducers.
+
+2015-03-03 14:48  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h,
+	  tools/src/hfst-minimize.cc: Added a variable to control if (xfsm)
+	  transducers that are already minimal are still minimized for
+	  profiling purposes.
+
+2015-03-02 15:13  eaxelson
+
+	* libhfst/src/HfstApply.cc,
+	  libhfst/src/implementations/HfstTransitionGraph.h,
+	  tools/src/hfst-fst2txt.cc, tools/src/hfst-minimize.cc,
+	  tools/src/hfst-txt2fst.cc: Fixed some bugs in escaping special
+	  symbols in prolog format. Added support for xfsm format in some
+	  command line tools.
+
+2015-03-02 11:29  eaxelson
+
+	* tools/src/hfst-fst2txt.cc: Fixed an error noticed when
+	  -Werror=format-security was enabled during compilation.
+
+2015-02-27 15:00  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h,
+	  tools/src/hfst-commandline.cc, tools/src/hfst-fst2fst.cc,
+	  tools/src/hfst-fst2txt.cc, tools/src/hfst-txt2fst.cc: Now xfsm
+	  conversion works in hfst-fst2fst and between prolog and binary
+	  format in hfst-fst2txt and hfst-txt2fst.
+
+2015-02-27 09:55  eaxelson
+
+	* libhfst/src/HfstTransducer.cc, libhfst/src/HfstTransducer.h:
+	  Added XFSM initializer class.
+
+2015-02-27 09:52  eaxelson
+
+	* libhfst/src/HfstApply.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Added function
+	  minimize to xfsm interface
+
+2015-02-26 10:56  eaxelson
+
+	* tools/src/hfst-commandline.cc,
+	  tools/src/hfst-compose-intersect.cc, tools/src/hfst-fst2fst.cc:
+	  Now hfst-compose-intersect does NOT harmonize transducers by
+	  default, as harmonizing produces unexpected results with
+	  hyperminimized transducers. Option --harmonize turns on
+	  harmonization. This is a partial fix to bug #288.
+
+2015-02-25 11:22  eaxelson
+
+	* configure.ac, libhfst/src/Makefile.am,
+	  tools/src/hfst-commandline.cc, tools/src/parsers/XfstCompiler.cc:
+	  Added a cross-build Windows patch given in bug report #289.
+
+2015-02-24 21:29  eaxelson
+
+	* libhfst/src/HfstOutputStream.cc: Added a missing #if HAVE_XFSM
+	  statement.
+
+2015-02-24 18:43  eaxelson
+
+	* libhfst/src/HfstInputStream.cc, libhfst/src/HfstTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc: Fixed some bugs in
+	  xfsm stream handling.
+
+2015-02-24 17:15  eaxelson
+
+	* libhfst/src/HfstOutputStream.cc, libhfst/src/HfstOutputStream.h,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Added more
+	  functions for writing and reading xfsm transducers.
+
+2015-02-23 14:33  eaxelson
+
+	* libhfst/src/HfstInputStream.h, libhfst/src/HfstOutputStream.cc,
+	  libhfst/src/HfstOutputStream.h,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Tentatively added
+	  input and output stream functions for xfsm transducer.
+
+2015-02-20 15:12  eaxelson
+
+	* scripts/generate-static-binaries.sh, scripts/hfst-twolc-bin,
+	  scripts/package-static-binaries.sh: Modified and added scripts
+	  for creating static binaries.
+
+2015-02-18 17:13  mpsilfve
+
+	* tools/src/hfst-compose-intersect.cc: Fast compose intersect
+	  available using option -f
+
+2015-02-18 14:52  eaxelson
+
+	* libhfst/src/implementations/ConvertXfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Reorganized xfsm
+	  interface.
+
+2015-02-18 14:14  mpsilfve
+
+	* tools/src/hfst-compose-intersect.cc: Hopefully speed up
+	  compose_intersect by doing l .o. (l.2 .o. r) instead of l .o. r
+	  directly.
+
+2015-02-16 12:47  eaxelson
+
+	* scripts/generate-static-binaries.sh: Updated script.
+
+2015-02-16 12:45  eaxelson
+
+	* tools/src/parsers/XfstCompiler.cc: Disable hfst-xfst's
+	  auto-complet with rl_insert instead of rl_abort, which is not
+	  found on Mac.
+
+2015-02-16 11:54  eaxelson
+
+	* scripts/generate-static-binaries.sh: Added a script to generate
+	  static binaries.
+
+2015-02-16 08:06  eaxelson
+
+	* libhfst/src/implementations/ConvertXfsmTransducer.cc: Now xfsm
+	  conversion swaps the state numbers to make a more readable state
+	  numbering.
+
+2015-02-13 14:08  eaxelson
+
+	* libhfst/src/implementations/ConvertXfsmTransducer.cc: Now special
+	  symbols should also work in xfsm conversion.
+
+2015-02-13 13:01  eaxelson
+
+	* libhfst/src/implementations/ConvertXfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Xfsm conversion
+	  functions almost work, escaped symbols still need some attention.
+
+2015-02-12 12:05  eaxelson
+
+	* libhfst/src/implementations/ConvertXfsmTransducer.cc: Conversion
+	  functions between xfsm and HfstBasicTransducer formats
+	  implemented, alphabets and special symbols still need some work.
+
+2015-02-11 08:36  hardwick
+
+	* tools/src/hfst-optimized-lookup.h: Autoindent entire file after
+	  removing tab characters to appease commit script
+
+2015-02-11 08:26  hardwick
+
+	* tools/src/hfst-optimized-lookup.cc,
+	  tools/src/hfst-optimized-lookup.h: Handle single-char ascii
+	  symbols shadowing multichar ones
+
+2015-02-10 14:14  eaxelson
+
+	* libhfst/src/HfstApply.cc, libhfst/src/HfstTransducer.cc,
+	  libhfst/src/HfstTransducer.h, libhfst/src/hfst_apply_schemas.h,
+	  libhfst/src/implementations/ConvertXfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Modified hfst to
+	  support xfsm format.
+
+2015-02-10 09:15  hardwick
+
+	* tools/src/hfst-proc2.cc: Fix cg quote interpolation
+
+2015-02-10 08:57  hardwick
+
+	* tools/src/hfst-proc2.cc: Clarify help string
+
+2015-02-10 08:55  hardwick
+
+	* tools/src/hfst-proc2.cc: Add segmenting and cg mode; improve
+	  handling of special cases and weights
+
+2015-02-09 13:43  eaxelson
+
+	* libhfst/src/HfstDataTypes.cc, libhfst/src/HfstDataTypes.h,
+	  libhfst/src/HfstTransducer.h,
+	  libhfst/src/implementations/ConvertXfsmTransducer.cc,
+	  libhfst/src/implementations/Makefile.am,
+	  libhfst/src/implementations/XfsmTransducer.h: Tentatively
+	  modified hfst to handle xfsm implementation type.
+
+2015-02-09 13:02  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.cc,
+	  tools/src/hfst-pmatch.cc, tools/src/hfst-proc2.cc: Preserve
+	  nonmatching sequances in locate_mode and parse the appropriately
+	  downstream
+
+2015-02-06 16:51  eaxelson
+
+	* configure.ac, libhfst/src/Makefile.am,
+	  libhfst/src/implementations/ConvertTransducerFormat.h,
+	  libhfst/src/implementations/ConvertXfsmTransducer.cc,
+	  libhfst/src/implementations/Makefile.am,
+	  libhfst/src/implementations/XfsmTransducer.cc,
+	  libhfst/src/implementations/XfsmTransducer.h: Tentatively added a
+	  skeleton implementation for xfsm library that can be included
+	  with configure option --with-xfsm (default is no). No linking to
+	  the library is performed, this is just a test version.
+
+2015-02-06 16:34  eaxelson
+
+	* tools/src/hfst-twolc/src/alphabet_src/Alphabet.cc,
+	  tools/src/hfst-twolc/src/alphabet_src/Alphabet.h,
+	  tools/src/hfst-twolc/src/htwolcpre3.yy,
+	  tools/src/hfst-twolc/src/rule_src/TwolCGrammar.cc: Added a
+	  preprocessing directive that defines hfst-twols's Alphabet as
+	  TwolCAlphabet if HAVE_XFSM is on. This will prevent variable
+	  collisions.
+
+2015-02-06 13:15  eaxelson
+
+	* tools/src/hfst-txt2fst.cc: Changed hfst-txt2fst's read_prolog
+	  into read_prolog_format to avoid conflict with xfsm library
+	  function.
+
+2015-02-05 16:07  eaxelson
+
+	* libhfst/src/parsers/pmatch_lex.ll,
+	  libhfst/src/parsers/pmatch_parse.yy,
+	  libhfst/src/parsers/xre_lex.ll, libhfst/src/parsers/xre_parse.yy:
+	  Named tokens 'UPPER' and 'LOWER' in pmatch and xre parsers into
+	  'XRE_UPPER', 'XRE_LOWER', 'PMATCH_UPPER' and 'PMATCH_LOWER'
+	  because the xfsm library (that might be added to hfst at some
+	  point) has an enumerator with the same name in C namespace.
+
+2015-02-05 15:58  eaxelson
+
+	* back-ends/foma/fomalib.h, back-ends/foma/iface.c,
+	  back-ends/foma/io.c: Named foma's write_prolog into
+	  foma_write_prolog because the xfsm library (that might be added
+	  to hfst at some point) has a function with the same name in C
+	  namespace.
+
+2015-02-05 15:50  eaxelson
+
+	* tools/src/parsers/xfst-parser.yy: Took away unused token 'LOWER'
+	  from xfst parser.
+
+2015-02-03 17:37  eaxelson
+
+	* tools/src/hfst-compose-intersect.cc: Added an option
+	  --do-not-harmonize to hfst-compose-intersect.
+
+2015-02-03 16:51  eaxelson
+
+	* tools/src/hfst-compose-intersect.cc: Now hfst-compose-intersect
+	  harmonizes the rule transducers with the lexicon.
+
+2015-02-03 15:42  eaxelson
+
+	* tools/src/hfst-fst2strings.cc: Added option --beam to
+	  hfst-strings2fst.
+
+2015-02-03 09:39  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.h,
+	  tools/src/hfst-pmatch.cc: More accurately name set_locate_mode as
+	  set_extract_tags mode
+	  (locate vs. match is determined by function call)
+
+2015-02-02 14:29  hardwick
+
+	* libhfst/src/parsers/pmatch_parse.yy: Fix bug in compiling
+	  UNKNOWNs on the left side of pair separators
+
+2015-02-02 13:58  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.cc: Fix bug
+	  affecting locate-mode where ?-matches were being seen as
+	  IDENTITIES in input.
+
+2015-02-02 10:34  eaxelson
+
+	* tools/src/hfst-lookup.cc: Added option --beam also to
+	  hfst-lookup. It is mostly untested for this tool.
+
+2015-01-30 13:35  eaxelson
+
+	* tools/src/hfst-optimized-lookup.cc: Tentatively added option
+	  --beam to hfst-optimized-lookup.
+
+2015-01-30 11:30  eaxelson
+
+	* tools/src/hfst-compose-intersect.cc: Fixed a typo in warning
+	  message about missing symbols in input tapes of rule transducers
+	  ('output' changed to 'input').
+
+2015-01-28 10:19  hardwick
+
+	* libhfst/src/implementations/optimized-lookup/pmatch.cc: In locate
+	  mode, zero-length hits could cause infinite loops. Commit fixes
+	  it.
+
+2015-01-23 15:31  eaxelson
+
+	* tools/src/hfst-lookup.cc: Now hfst-lookup checks it it is
+	  possible for an input to go through a transducer before calling
+	  is_infinitely_ambiguous. Should fix bug #278.
+
+2015-01-22 11:40  eaxelson
+
+	* libhfst/src/HfstTransducer.cc: Now reserved symbols are detected
+	  in composition if xerox-composition is ON. This will prevent
+	  symbol collisions by throwing an error message, giving at least a
+	  temporary solution to issues with reserved symbols.
+
+2015-01-22 09:52  eaxelson
+
+	* libhfst/src/parsers/xre_parse.yy: Fixed substitution operator in
+	  regexp, now flag diacritics are allowed both as substituting and
+	  subtituted symbols. Should fix bug #284.
+
+2015-01-21 21:31  eaxelson
+
+	* tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/xfst-parser.yy: Added better support for
+	  special symbols in hfst-xfst's substitute command.
+
+2015-01-21 15:25  eaxelson
+
+	* tools/src/parsers/test/Makefile.am,
+	  tools/src/parsers/test/substitute_symbol_7.att,
+	  tools/src/parsers/test/substitute_symbol_7.xfst,
+	  tools/src/parsers/test/substitute_symbol_8.att,
+	  tools/src/parsers/test/substitute_symbol_8.xfst,
+	  tools/src/parsers/test/test.sh: Added two tests for hfst-xfst's
+	  substitute command. They are skipped until substitute can also
+	  handle them.
+
+2015-01-21 12:48  eaxelson
+
+	* libhfst/src/HfstTransducer.cc,
+	  libhfst/src/parsers/LexcCompiler.cc: Fixed a bug in composition
+	  when xerox-composition is ON. Flag diacritics @SOMEFLAG@ were
+	  earlier transformed into $ and back into @SOMEFLAG@, but symbols
+	  of form $...$ are already reserved for lexc. Now diacritics are
+	  escaped as %SOMEFLAG% during composition. This creates a new set
+	  of reserved symbols which maybe needs more consideration
+	  though... Also added debug prints for LexcCompiler.
+
+2015-01-16 14:13  eaxelson
+
+	* configure.ac: Removed xml checks from configure, since they cause
+	  unlinked xml references in hfst-edit-metadata on some platforms.
+
+2015-01-16 13:13  eaxelson
+
+	* libhfst/src/HfstFlagDiacritics.cc,
+	  tools/src/parsers/XfstCompiler.cc: Fixed flag diacritic
+	  recognition, now also flags of form e.g. '@D.FOO@' are accepted
+	  and an empty string is returned as their value. Also added full
+	  support for flag handling in hfst-xfst.
+
+2015-01-15 15:55  eaxelson
+
+	* libhfst/src/HfstSymbolDefs.cc, libhfst/src/HfstSymbolDefs.h,
+	  tools/src/parsers/XfstCompiler.cc,
+	  tools/src/parsers/XfstCompiler.h: Added some conversion functions
+	  between StringPairVectors and StringVectors. Added checks for
+	  flag diacritics in hfst-xfst non-optimized lookup.
+
+2015-01-08 14:33  eaxelson
+
+	* tools/src/hfst-summarize.cc: A small fix to hfst-summarize option
+	  handling.
+
+2014-12-19 15:34  eaxelson
+
+	* ChangeLog, ChangeLog.old, NEWS, configure.ac,
+	  libhfst/src/Makefile.am: Ready for release 3.8.2.
+
+2014-12-19 14:41  eaxelson
+
+	* tools/src/hfst-summarize.cc: Added option
+	  --print-symbol-pair-statistics(=N) to hfst-summarize.
+
 2014-12-17 13:28  eaxelson
 
 	* configure.ac, libhfst/src/HfstTransducer.cc,
diff --git a/Doxyfile b/Doxyfile
index 4c4d982..c268b75 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME           = "HFST - Helsinki Finite-State Transducer Technology API
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = "version 3.7.1"
+PROJECT_NUMBER         = "version 3.8.3"
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
diff --git a/Makefile.am b/Makefile.am
index 9f06a84..c705b68 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = back-ends libhfst tools test doc man scripts swig
+SUBDIRS = back-ends libhfst tools test doc man scripts python
 
 # for external projects to use HFST from auto*
 m4dir=$(datadir)/aclocal
diff --git a/NEWS b/NEWS
index 2f6d1ed..dbedeb1 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,30 @@
 This file contains all noteworthy changes in HFST development between releases.
 For full listing of changes see ChangeLog.
 
+Noteworthy changes in 3.9.0
+---------------------------
+
+* Implement a new Python API
+
+* Add option --time-cutoff to hfst-lookup
+
+* Remove option --minimizeFlags from hfst-lexc and minimize flags by default, add option --alignStrings
+
+* Add support for controlling input and output streams in xre, xfst and lexc compilers
+
+* Update foma back-end
+
+* Improve handling of negative weights, check for epsilon cycles with negative weights and issue a warning, if needed
+
+* Improvements and bug fixes to hfst-optimized-lookup, hfst-proc2, hfst-proc and hfst-pmatch
+
+* Reduce memory leaks when using hfst-ol format
+
+* Support flag diacritics in replace rules
+
+* Make command line tools perform automatic conversion when processing transducers whose types differ
+
+
 Noteworthy changes in 3.8.3
 ---------------------------
 
diff --git a/README b/README
index 349f516..a5395c1 100644
--- a/README
+++ b/README
@@ -124,15 +124,14 @@ Compilation requirements
 
 - To use the foma_ backend (default):
 
-  - the foma library version 0.9.16alpha is bundled with HFST and included
+  - the foma library version 0.9.18alpha is bundled with HFST and included
     be default when building HFST
 
   - foma requires editline, termcap (or ncurses) and zlib libraries to compile
 
   - to disable foma backend, configure switch ``--without-foma`` may be used
 
-  - the *hfst-xfst* frontend currently **requires** foma binary; foma library
-    is not needed to be linked for this
+  - the *hfst-xfst* frontend currently does not require foma binary or foma library
 
 - For proper Unicode support in corpus tools:
 
@@ -203,9 +202,6 @@ When running HFST software or using HFST libraries from HFST-enabled software:
   that operating system is aware of this; In linux this may happen by setting
   ``LD_LIBRARY_PATH``, on Mac ``DYLD_LIBRARY_PATH``
 
-- the *hfst-xfst* frontend currently **requires** foma binary 
-  (--with-foma to enable)
-
 - the *hfst-xfst* frontend needs GNU compatible getopt, or basic getopts
   *without* GNU-incompatible getopt installed
 
@@ -247,10 +243,7 @@ If you would rather install in e.g. your home directory
 
 The HFST library may link to numerous FST handling backends with varying
 licences. If you are going to redistribute the HFST library you compiled, make
-sure there are no clashes in the licences of the linked libraries; all
-of them are free and open source, but under strict interpretation you may not
-be able to redistribute combination of strict GNU GPLv2 and Apache APLv2 in the
-same binary (e.g. foma and OpenFST).
+sure there are no clashes in the licences of the linked libraries.
 
 If you are checking out the development versions from SVN you must first create
 and install the necessary autotools files from the host system:
diff --git a/back-ends/foma/CHANGELOG b/back-ends/foma/CHANGELOG
index 2abc2bd..2468a36 100644
--- a/back-ends/foma/CHANGELOG
+++ b/back-ends/foma/CHANGELOG
@@ -1,3 +1,18 @@
+0.9.18alpha (20150612)
+
+- Many bugfixes and speedups
+- Corrects handling of some rare unicode composing diacritics
+- Python bindings
+- Adds _closeu()-builtin function which closes sigma
+- Adds _sublabel(L1,symbol,L2)-builtin function: substitute all instances of symbol in L1 with L2
+- Adds separate pairs, pairs > file, random-pairs commands in interface
+- Adds possibility to automatically align lexc-entries
+
+0.9.17alpha (20121117)
+
+- Many bugfixes in foma, flookup (apply code)
+- Adds possibility to redirect "print words" output to file by "print words > file"
+
 0.9.16alpha (20111213)
 
 - New faster apply code, as well as optional indexing of arcs in flookup
diff --git a/back-ends/foma/COPYING b/back-ends/foma/COPYING
index d159169..d511905 100644
--- a/back-ends/foma/COPYING
+++ b/back-ends/foma/COPYING
@@ -1,12 +1,12 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                            Preamble
+			    Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
   The precise terms and conditions for copying, distribution and
 modification follow.
 
-                    GNU GENERAL PUBLIC LICENSE
+		    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-                            NO WARRANTY
+			    NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-                     END OF TERMS AND CONDITIONS
+		     END OF TERMS AND CONDITIONS
 
-            How to Apply These Terms to Your New Programs
+	    How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
diff --git a/back-ends/foma/README b/back-ends/foma/README
index d4cd1f0..520a52d 100644
--- a/back-ends/foma/README
+++ b/back-ends/foma/README
@@ -1,17 +1,17 @@
-
-Note 
+Note
 ----
 
-This directory contains files from foma library that are used as a part of the HFST library. Makefile.am is an HFST addition, and some of the original foma files are omitted. There are small changes in fomalib.h that are indicated in comments.
+This directory contains files from foma library that are used as a part of the HFST library. Makefile.am is an HFST addition, and some of the original foma files are omitted. There are small changes in foma source files. The changes are indicated by "#ifdef ORIGINAL" preprocessor directives or in comments. The rest of this file is the same as foma's original README file:
 
 
 Foma
 ====
 
-version 0.9.16alpha
-2011/12/13
+version 0.9.18alpha
+2015/06/12
 
-Email: wampeter at users.sourceforge.net
+Author: Mans Hulden
+Email: mans.hulden at gmail.com
 WWW: http://foma.googlecode.com
 
 
@@ -46,5 +46,5 @@ To compile foma (and flookup) as well as the foma static and dynamic library, "m
 Bugs
 ----
 
-Many. The current release is 0.9.16alpha, and bug reports will be gratefully received at 
-wampeter at users.sourceforge.net.
+Many. The current release is 0.9.18alpha, and bug reports will be gratefully received at mans.hulden at gmail.com.
+
diff --git a/back-ends/foma/apply.c b/back-ends/foma/apply.c
index 91f9c21..bfa9452 100644
--- a/back-ends/foma/apply.c
+++ b/back-ends/foma/apply.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -79,6 +79,23 @@ void apply_set_show_flags(struct apply_handle *h, int value) {
 
 void apply_set_print_space(struct apply_handle *h, int value) {
     h->print_space = value;
+    h->space_symbol = strdup(" ");
+}
+
+void apply_set_separator(struct apply_handle *h, char *symbol) {
+    h->separator = strdup(symbol);
+}
+
+void apply_set_epsilon(struct apply_handle *h, char *symbol) {
+    xxfree(h->epsilon_symbol);
+    h->epsilon_symbol = strdup(symbol);
+    (h->sigs+EPSILON)->symbol = h->epsilon_symbol;
+    (h->sigs+EPSILON)->length =  strlen(h->epsilon_symbol);
+}
+
+void apply_set_space_symbol(struct apply_handle *h, char *space) {
+    h->space_symbol = strdup(space);
+    h->print_space = 1;
 }
 
 void apply_set_print_pairs(struct apply_handle *h, int value) {
@@ -194,11 +211,13 @@ void apply_clear(struct apply_handle *h) {
     if (h->flagstates != NULL) {
 	xxfree(h->flagstates);
 	h->flagstates = NULL;
-    }
+    }    
     apply_clear_index(h);
     h->last_net = NULL;
     h->iterator = 0;
     xxfree(h->outstring);
+    xxfree(h->separator);
+    xxfree(h->epsilon_symbol);
     xxfree(h);
 }
 
@@ -226,7 +245,7 @@ char *apply_updown(struct apply_handle *h, char *word) {
 }
 
 char *apply_down(struct apply_handle *h, char *word) {
-
+    
     h->mode = DOWN;
     if (h->index_in) { 
 	h->indexed = 1;
@@ -265,9 +284,9 @@ struct apply_handle *apply_init(struct fsm *net) {
     h->show_flags = 0;
     h->print_space = 0;
     h->print_pairs = 0;
-
+    h->separator = strdup(":");
+    h->epsilon_symbol = strdup("0");
     h->last_net = net;
-
     h->outstring = xxmalloc(sizeof(char)*DEFAULT_OUTSTRING_SIZE);
     h->outstringtop = DEFAULT_OUTSTRING_SIZE;
     *(h->outstring) = '\0';
@@ -393,9 +412,19 @@ void apply_clear_index(struct apply_handle *h) {
 }
 
 void apply_index(struct apply_handle *h, int inout, int densitycutoff, int mem_limit, int flags_only) {
-  struct fsm_state *fsm = h->gstates; // must be defined in the beginning for cl.exe compiler
+#ifdef ORIGINAL
+    struct fsm_state *fsm;
+#else
+    // variable initialization needed for cl.exe compiler
+    struct fsm_state *fsm = h->gstates;
+#endif
     unsigned int cnt = 0;
-    int i, j, maxtrans, numtrans, laststate, sym, stateno;
+    int i, j, maxtrans, numtrans, laststate, sym;
+#ifdef ORIGINAL
+    fsm = h->gstates;
+#else
+    // variable already initialized
+#endif
 
     struct apply_state_index **indexptr, *iptr, *tempiptr;
 
@@ -500,7 +529,6 @@ void apply_index(struct apply_handle *h, int inout, int densitycutoff, int mem_l
 	    continue;
 	}
 	sym = inout == APPLY_INDEX_INPUT ? (fsm+i)->in : (fsm+i)->out;
-	stateno = (fsm+i)->state_no;
 
 	if (h->has_flags && (h->flag_lookup+sym)->type) {
 	    sym = EPSILON;
@@ -938,7 +966,8 @@ int apply_append(struct apply_handle *h, int cptr, int sym) {
     bstring = ((h->sigs)+symout)->symbol;
     blen =  ((h->sigs)+symout)->length;
     
-    while (alen + blen + h->opos + 3 >= h->outstringtop) {
+    while (alen + blen + h->opos + 2 + strlen(h->separator) >= h->outstringtop) {
+	//    while (alen + blen + h->opos + 3 >= h->outstringtop) {
 	h->outstring = xxrealloc(h->outstring, sizeof(char) * ((h->outstringtop) * 2));
 	(h->outstringtop) *= 2;
     }
@@ -959,9 +988,12 @@ int apply_append(struct apply_handle *h, int cptr, int sym) {
 		len = alen;
 	    } else {
 		strcpy(h->outstring+h->opos, astring);
-		strcpy(h->outstring+h->opos+alen,":");
-		strcpy(h->outstring+h->opos+alen+1,bstring);
-		len = alen+blen+1;
+		//		strcpy(h->outstring+h->opos+alen,":");
+		strcpy(h->outstring+h->opos+alen,h->separator);
+		//strcpy(h->outstring+h->opos+alen+1,bstring);
+		strcpy(h->outstring+h->opos+alen+strlen(h->separator),bstring);
+		//		len = alen+blen+1;
+		len = alen+blen+strlen(h->separator);
 	    }
 	}
 	
@@ -995,15 +1027,20 @@ int apply_append(struct apply_handle *h, int cptr, int sym) {
 		strncpy(bstring, h->instring+h->ipos, 1);
 	    strcpy(h->outstring+h->opos, "<");
 	    strcpy(h->outstring+h->opos+1, astring);
-	    strcpy(h->outstring+h->opos+alen+1,":");
-	    strcpy(h->outstring+h->opos+alen+2,bstring);
-	    strcpy(h->outstring+h->opos+alen+blen+2,">");
-	    len = alen+blen+3;
+	    //strcpy(h->outstring+h->opos+alen+1,":");
+	    strcpy(h->outstring+h->opos+alen+1,h->separator);
+	    //strcpy(h->outstring+h->opos+alen+2,bstring);
+	    strcpy(h->outstring+h->opos+alen+1+strlen(h->separator), bstring);
+	    //strcpy(h->outstring+h->opos+alen+blen+2,">");
+	    strcpy(h->outstring+h->opos+alen+blen+1+strlen(h->separator),">");
+	    //len = alen+blen+3;
+	    len = alen+blen+2+strlen(h->separator);
 	}
 
 	else if (sym == IDENTITY) {
 	    /* Apply up/down */
-	    idlen = utf8skip(h->instring+h->ipos)+1;
+	    //idlen = utf8skip(h->instring+h->ipos)+1;
+	    idlen = (h->sigmatch_array+h->ipos)->consumes; // here
 	    strncpy(h->outstring+h->opos, h->instring+h->ipos, idlen);
 	    strncpy(h->outstring+h->opos+idlen,"", 1);
 	    len = idlen;
@@ -1021,7 +1058,7 @@ int apply_append(struct apply_handle *h, int cptr, int sym) {
 	}
     }
     if (h->print_space && len > 0) {
-	strcpy(h->outstring+h->opos+len, " ");
+	strcpy(h->outstring+h->opos+len, h->space_symbol);
 	len++;
     }
     return(len);
@@ -1184,12 +1221,8 @@ void apply_mark_flagstates(struct apply_handle *h) {
 
 void apply_create_sigarray(struct apply_handle *h, struct fsm *net) {
     struct sigma *sig;
-    struct fsm_state *fsm;
-    
     int i, maxsigma;
     
-    fsm = net->states;
-
     maxsigma = sigma_max(net->sigma);
     h->sigma_size = maxsigma+1;
     // Default size created at init, resized later if necessary
@@ -1223,8 +1256,8 @@ void apply_create_sigarray(struct apply_handle *h, struct fsm *net) {
 	}
     }
     if (maxsigma >= IDENTITY) {
-	(h->sigs+EPSILON)->symbol = "0";
-	(h->sigs+EPSILON)->length =  1;
+	(h->sigs+EPSILON)->symbol = h->epsilon_symbol;
+	(h->sigs+EPSILON)->length =  strlen(h->epsilon_symbol);
 	(h->sigs+UNKNOWN)->symbol = "?";
 	(h->sigs+UNKNOWN)->length =  1;
 	(h->sigs+IDENTITY)->symbol = "@";
@@ -1261,7 +1294,7 @@ void apply_create_sigarray(struct apply_handle *h, struct fsm *net) {
 void apply_create_sigmatch(struct apply_handle *h) {
     char *symbol;
     struct sigma_trie *st;
-    int i, j, inlen, lastmatch, consumes;
+    int i, j, inlen, lastmatch, consumes, cons;
     /* We create a sigmatch array only in case we match against a real string */
     if (((h->mode) & ENUMERATE) == ENUMERATE) {
 	return;
@@ -1274,6 +1307,8 @@ void apply_create_sigmatch(struct apply_handle *h) {
 	h->sigmatch_array = xxmalloc(sizeof(struct sigmatch_array)*(inlen));
 	h->sigmatch_array_size = inlen;
     }
+    /* Find longest match in alphabet at current position */
+    /* by traversing the trie of alphabet symbols         */
     for (i=0; i < inlen; i += consumes ) {
 	st = h->sigma_trie;
 	for (j=0, lastmatch = 0; ; j++) {
@@ -1295,13 +1330,27 @@ void apply_create_sigmatch(struct apply_handle *h) {
 	if (lastmatch != 0) {
 	    (h->sigmatch_array+i)->signumber = lastmatch;
 	    consumes = (h->sigs+lastmatch)->length;
-	    (h->sigmatch_array+i)->consumes = consumes;
 	} else {
-	    /* Not found */
+	    /* Not found in trie */
 	    (h->sigmatch_array+i)->signumber = IDENTITY;
 	    consumes = utf8skip(symbol+i)+1;
-	    (h->sigmatch_array+i)->consumes = consumes;
 	}
+
+	/* If we now find trailing unicode combining characters (0300-036F):      */
+	/* (1) Merge them all with current symbol                                 */
+	/* (2) Declare the whole sequence one ? (IDENTITY) symbol                 */
+        /*     Step 2 is motivated by the fact that                               */
+	/*     if the input is S(symbol) + D(diacritic)                           */
+        /*     and SD were a symbol in the alphabet, then this would have been    */
+        /*     found when searching the alphabet symbols earlier, so SD+ => ?     */
+        /*     Note that this means that a multi-char symbol followed by a        */
+        /*     diacritic gets converted to a single ?, e.g.                       */
+        /*     [TAG] + D => ? if [TAG] is in the alphabet, but [TAG]+D isn't.     */
+
+	for (  ; (cons = utf8iscombining((unsigned char *)(symbol+i+consumes))); consumes += cons) {
+	    (h->sigmatch_array+i)->signumber = IDENTITY;
+	}
+	(h->sigmatch_array+i)->consumes = consumes;
     }
 }
 
diff --git a/back-ends/foma/coaccessible.c b/back-ends/foma/coaccessible.c
index 495a4c6..67748e5 100644
--- a/back-ends/foma/coaccessible.c
+++ b/back-ends/foma/coaccessible.c
@@ -54,12 +54,12 @@ struct fsm *fsm_coaccessible(struct fsm *net) {
     if (t != -1 && s != t) {
       
       if (((inverses+t)->state) == -1) {
-        (inverses+t)->state = s;
+	(inverses+t)->state = s;
       } else {
         temp_i = xxmalloc(sizeof(struct invtable));
-        temp_i->next = (inverses+t)->next;
-        (inverses+t)->next = temp_i;
-        temp_i->state = s;
+	temp_i->next = (inverses+t)->next;
+	(inverses+t)->next = temp_i;
+	temp_i->state = s;
       }
     }
   }
@@ -81,9 +81,9 @@ struct fsm *fsm_coaccessible(struct fsm *net) {
     current_ptr = inverses+current_state;
     while(current_ptr != NULL && current_ptr->state != -1) {
       if (!*(coacc+(current_ptr->state))) {
-        *(coacc+(current_ptr->state)) = 1;
-        int_stack_push(current_ptr->state);
-        markcount++;
+	*(coacc+(current_ptr->state)) = 1;
+	int_stack_push(current_ptr->state);
+	markcount++;
       }
       current_ptr = current_ptr->next;
     }
@@ -101,35 +101,35 @@ struct fsm *fsm_coaccessible(struct fsm *net) {
     new_linecount = 0;
     for (i=1,j=0; i < (net->statecount);i++) {
       if (*(coacc+i) == 1) {
-        j++;
-        *(mapping+i) = j;
+	j++;
+	*(mapping+i) = j;
       }
     }
     
     for (i=0,j=0; (fsm+i)->state_no != -1; i++) {
       if (i > 0 && (fsm+i)->state_no != (fsm+i-1)->state_no && (fsm+i-1)->final_state && !*(added+((fsm+i-1)->state_no))) {
-        add_fsm_arc(fsm, j++, *(mapping+((fsm+i-1)->state_no)), -1, -1, -1, 1, (fsm+i-1)->start_state);
-        new_linecount++;
-        *(added+((fsm+i-1)->state_no)) = 1;
-        /* printf("addf ad %i\n",i); */
+	add_fsm_arc(fsm, j++, *(mapping+((fsm+i-1)->state_no)), -1, -1, -1, 1, (fsm+i-1)->start_state);
+	new_linecount++;
+	*(added+((fsm+i-1)->state_no)) = 1;
+	/* printf("addf ad %i\n",i); */
       }
       if (*(coacc+((fsm+i)->state_no)) && (((fsm+i)->target == -1) || *(coacc+((fsm+i)->target)))) {
-        (fsm+j)->state_no = *(mapping+((fsm+i)->state_no));
-        if ((fsm+i)->target == -1) {
-          (fsm+j)->target = -1;
-        } else {
-          (fsm+j)->target = *(mapping+((fsm+i)->target));
-        }
-        (fsm+j)->final_state = (fsm+i)->final_state;
-        (fsm+j)->start_state = (fsm+i)->start_state;
-        (fsm+j)->in = (fsm+i)->in;
-        (fsm+j)->out = (fsm+i)->out;
-        j++;
-        new_linecount++;
-        *(added+(fsm+i)->state_no) = 1;
-        if ((fsm+i)->target != -1) {
-          new_arccount++;
-        }       
+	(fsm+j)->state_no = *(mapping+((fsm+i)->state_no));
+	if ((fsm+i)->target == -1) {
+	  (fsm+j)->target = -1;
+	} else {
+	  (fsm+j)->target = *(mapping+((fsm+i)->target));
+	}
+	(fsm+j)->final_state = (fsm+i)->final_state;
+	(fsm+j)->start_state = (fsm+i)->start_state;
+	(fsm+j)->in = (fsm+i)->in;
+	(fsm+j)->out = (fsm+i)->out;
+	j++;
+	new_linecount++;
+	*(added+(fsm+i)->state_no) = 1;
+	if ((fsm+i)->target != -1) {
+	  new_arccount++;
+	}	
       }
     }
 
diff --git a/back-ends/foma/constructions.c b/back-ends/foma/constructions.c
index 51b49bb..198dae2 100644
--- a/back-ends/foma/constructions.c
+++ b/back-ends/foma/constructions.c
@@ -1,19 +1,19 @@
-/*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2012 Mans Hulden                                     */
+/*   Foma: a finite-state toolkit and library.                                 */
+/*   Copyright © 2008-2015 Mans Hulden                                         */
 
-/*     This file is part of foma.                                            */
+/*   This file is part of foma.                                                */
 
-/*     Foma is free software: you can redistribute it and/or modify          */
-/*     it under the terms of the GNU General Public License version 2 as     */
-/*     published by the Free Software Foundation.                            */
+/*   Licensed under the Apache License, Version 2.0 (the "License");           */
+/*   you may not use this file except in compliance with the License.          */
+/*   You may obtain a copy of the License at                                   */
 
-/*     Foma is distributed in the hope that it will be useful,               */
-/*     but WITHOUT ANY WARRANTY; without even the implied warranty of        */
-/*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         */
-/*     GNU General Public License for more details.                          */
+/*      http://www.apache.org/licenses/LICENSE-2.0                             */
 
-/*     You should have received a copy of the GNU General Public License     */
-/*     along with foma.  If not, see <http://www.gnu.org/licenses/>.         */
+/*   Unless required by applicable law or agreed to in writing, software       */
+/*   distributed under the License is distributed on an "AS IS" BASIS,         */
+/*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  */
+/*   See the License for the specific language governing permissions and       */
+/*   limitations under the License.                                            */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -27,10 +27,6 @@
 #define COMPLEMENT 0
 #define COMPLETE 1
 
-#define BI_AVL_HASH_THRESHOLD 2097152 /* We start hashing instead of array above this */
-#define BI_AVL_TYPE_HASH 0
-#define BI_AVL_TYPE_ARRAY 1
-
 #define STACK_3_PUSH(a,b,c) int_stack_push(a); int_stack_push(b); int_stack_push(c);
 #define STACK_2_PUSH(a,b) int_stack_push(a); int_stack_push(b);
 
@@ -179,7 +175,7 @@ struct fsm *fsm_symbol(char *symbol) {
   fsm_update_flags(net, YES, YES, YES, YES, YES, NO);
   if (strcmp(symbol,"@_EPSILON_SYMBOL_@")==0) {
     /* Epsilon */
-      symbol_no = sigma_add_special(EPSILON,net->sigma);
+    (void)sigma_add_special(EPSILON, net->sigma);
     net->states = xxmalloc(sizeof(struct fsm_state)*2);
     add_fsm_arc(net->states, 0, 0, -1,-1,-1,1,1);
     add_fsm_arc(net->states, 1, -1,-1,-1,-1,-1,-1);
@@ -254,7 +250,8 @@ struct state_arr *init_state_pointers(struct fsm_state *fsm_state) {
   /* Create an array for quick lookup of whether states are final, and a pointer to the first line regarding each state */
 
   struct state_arr *state_arr;
-  int states, i, sold = -1;
+  int states, i, sold;
+  sold = -1;
   states = fsm_count_states(fsm_state);
   state_arr = xxmalloc(sizeof(struct state_arr)*(states+1));
   for (i=0; i<states; i++) {
@@ -275,242 +272,129 @@ struct state_arr *init_state_pointers(struct fsm_state *fsm_state) {
   return(state_arr);
 }
 
-/* Tristate lookups */
-
-static struct tri_avl {
-    int state_a;
-    int state_b;
-    int state_number;
-    struct tri_avl *next;
-    char mode;
-} *tri_avl;
-
-static int tri_avl_state, tri_avl_tablesize;
-static _Bool *tri_avl_a, *tri_avl_b;
-
-static unsigned int primes[26] = {61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647};
+/* An open addressing scheme (with linear probing) to store triplets of ints */
+/* and hashing them with an automatically increasing key at every insert     */
+/* The table is rehashed whenever occupancy reaches 0.5                      */
 
-int tri_avl_insert(int a, int b, char mode);
-
-void tri_avl_init(int a, int b, int sizea, int sizeb) {
+struct triplethash_triplets {
+    int a;
+    int b;
+    int c;
+    int key;
+};
 
- int i, size;
- 
- size = (sizea+sizeb)/2;
- 
- tri_avl_state = 0;
- for (i=0; primes[i]<size; i++) { }
- 
- tri_avl_tablesize = primes[i];
- 
- tri_avl = xxmalloc(sizeof(struct tri_avl)*tri_avl_tablesize);
- tri_avl_a = xxmalloc(sizeof(_Bool)*sizea);
- tri_avl_b = xxmalloc(sizeof(_Bool)*sizeb);
- for (i = 0; i < sizea; i++) {
-     *(tri_avl_a+i) = 0;
- }
- for (i = 0; i < sizeb; i++) {
-     *(tri_avl_b+i) = 0;
- }
- for (i = 0; i < tri_avl_tablesize; i++) {
-     (tri_avl+i)->state_number = -1;
-     (tri_avl+i)->next = NULL;
- }
- tri_avl_insert(0,0,0);
-}
-
-static unsigned int tri_avl_hash (int a, int b, int mode) {
-    return(((unsigned int)((a+b)%tri_avl_tablesize)));
-    return(((unsigned int)((a+1+mode)^b))%tri_avl_tablesize);
-}
-
-int tri_avl_insert(int a, int b, char mode) {
-    
-    struct tri_avl *curr_tri_avl, *new_tri_avl;
-    *(tri_avl_a+a) = 1;
-    *(tri_avl_b+b) = 1;
-    curr_tri_avl = tri_avl + tri_avl_hash(a,b,mode);
+struct triplethash {
+    struct triplethash_triplets *triplets;
+    unsigned int tablesize;
+    int occupancy;
+};
 
-    if (curr_tri_avl->state_number != -1) {
-        new_tri_avl = xxmalloc(sizeof(struct tri_avl));
-        new_tri_avl->next = curr_tri_avl->next;
-        curr_tri_avl->next = new_tri_avl;
-        new_tri_avl->state_a = a;
-        new_tri_avl->state_b = b;
-        new_tri_avl->mode = mode;
-        new_tri_avl->state_number = tri_avl_state;
-        return(tri_avl_state++);
+struct triplethash *triplet_hash_init() {
+    struct triplethash *th;
+    int i;
+    th = xxmalloc(sizeof(struct triplethash));
+    th->tablesize = 128;
+    th->occupancy = 0;
+    th->triplets = xxmalloc(sizeof(struct triplethash_triplets) * th->tablesize);
+    for (i = 0; i < th->tablesize; i++) {
+	(th->triplets+i)->key = -1;
     }
-    curr_tri_avl->state_a = a;
-    curr_tri_avl->state_b = b;
-    curr_tri_avl->mode = mode;
-    curr_tri_avl->state_number = tri_avl_state;
-    return(tri_avl_state++);
+    return(th);
 }
 
-int tri_avl_find(int a, int b, char mode) {
-    struct tri_avl *curr_tri_avl;
-
-    if (*(tri_avl_a+a) == 0) {
-        return -1;
-    }
-    if (*(tri_avl_b+b) == 0) {
-        return -1;
-    }
-
-    curr_tri_avl = tri_avl + tri_avl_hash(a,b,mode);
-    
-    if (curr_tri_avl->state_number == -1)
-        return -1;
-    
-    for ( ; curr_tri_avl != NULL; curr_tri_avl = curr_tri_avl->next) {
-        if (curr_tri_avl->state_a == a && curr_tri_avl->state_b == b && curr_tri_avl->mode == mode)
-            return (curr_tri_avl->state_number);
-    }
-    return (-1);
+unsigned int triplethash_hashf(int a, int b, int c) {
+    return((unsigned int)(a * 7907 + b * 86028157 + c * 7919));
 }
 
-void tri_avl_free() {
-  struct tri_avl *temp_tri_avl, *prev_tri_avl;
-  int i;
-
-  for (i = 0; i < tri_avl_tablesize; i++) {
-    for (temp_tri_avl = (tri_avl+i)->next; temp_tri_avl != NULL;) {
-      prev_tri_avl = temp_tri_avl;
-      temp_tri_avl = temp_tri_avl->next;
-      xxfree(prev_tri_avl);
-    }
-  }
-  xxfree(tri_avl);  
-  xxfree(tri_avl_a);  
-  xxfree(tri_avl_b);
-  tri_avl = NULL;
-  return;
+void triplet_hash_free(struct triplethash *th) {
+    if (th != NULL) {
+	if (th->triplets != NULL) {
+	    xxfree(th->triplets);
+	}
+	xxfree(th);
+    }    
 }
 
-/* Bistate lookups */
-
-static struct bi_avl {
-  int state_a;
-  int state_b;
-  int state_number;
-  struct bi_avl *next;
-} *bi_avl;
-
-static int bi_avl_state, bi_avl_tablesize, **bi_avl_array, bi_avl_type, bi_avl_rowsize;
-
-int bi_avl_insert(int a, int b);
+void triplet_hash_rehash(struct triplethash *th);
 
-void bi_avl_init(int a, int b, int sizea, int sizeb) {
-  
-    int i, j, size;
-    
-    if ((sizea*sizeb) <= BI_AVL_HASH_THRESHOLD) {
-        bi_avl_rowsize = sizea; /* Save this for xxfree() */
-        bi_avl_array = (int **)xxcalloc(sizea,sizeof(int *));
-        for(i = 0; i < sizea; i++) {
-            bi_avl_array[i] = (int *)xxcalloc(sizeb,sizeof(int));
-        }
-        for (i=0; i < sizea; i++)
-            for (j=0; j < sizeb; j++)
-                bi_avl_array[i][j] = -1;
-        
-        bi_avl_type = BI_AVL_TYPE_ARRAY;
-        bi_avl_state = 0;
-        bi_avl_insert(a,b);
-        return;
-    }
-    
-    bi_avl_type = BI_AVL_TYPE_HASH;
-    
-    size = (sizea+sizeb)/2;
-    
-    bi_avl_state = 0;
-    for (i=0; primes[i]<size; i++) {
-    }
-    
-    bi_avl_tablesize = primes[i];
-    
-    bi_avl = xxmalloc(sizeof(struct bi_avl)*bi_avl_tablesize);
-    for (i = 0; i < bi_avl_tablesize; i++) {
-        (bi_avl+i)->state_number = -1;
-        (bi_avl+i)->next = NULL;
+void triplet_hash_insert_with_key(struct triplethash *th, int a, int b, int c, int key) {
+    struct triplethash_triplets *th_table;
+    unsigned int hash;
+    th_table = th->triplets;
+    hash = triplethash_hashf(a, b, c) % th->tablesize;
+    for (;;) {
+	if ((th_table + hash)->key == -1) {
+	    (th_table + hash)->key = key;
+	    (th_table + hash)->a = a;
+	    (th_table + hash)->b = b;
+	    (th_table + hash)->c = c;
+	    break;
+	}
+	hash++;
+	if (hash >= th->tablesize)
+	    hash -= th->tablesize;
     }
-    bi_avl_insert(a,b);
 }
 
-unsigned int bi_avl_hash (int a, int b) {
-    return(((unsigned int)((a+1)^b))%bi_avl_tablesize);
-    return (((a ^ 0xffffffff) + b) % bi_avl_tablesize);
-}
-
-int bi_avl_insert(int a, int b) {
-    
-    struct bi_avl *curr_bi_avl, *new_bi_avl;
-
-    if (bi_avl_type == BI_AVL_TYPE_ARRAY) {
-        bi_avl_array[a][b] = bi_avl_state;
-        return(bi_avl_state++);
-    }
-
-    curr_bi_avl = bi_avl + bi_avl_hash(a,b);
-
-    if (curr_bi_avl->state_number != -1) {
-        new_bi_avl = xxmalloc(sizeof(struct bi_avl));
-        new_bi_avl->next = curr_bi_avl->next;
-        curr_bi_avl->next = new_bi_avl;
-        new_bi_avl->state_a = a;
-        new_bi_avl->state_b = b;
-        new_bi_avl->state_number = bi_avl_state;
-        return(bi_avl_state++);
+int triplet_hash_insert(struct triplethash *th, int a, int b, int c) {
+    struct triplethash_triplets *th_table;
+    unsigned int hash;
+    th_table = th->triplets;
+    hash = triplethash_hashf(a,b,c) % th->tablesize;
+    for (;;) {
+	if ((th_table + hash)->key == - 1) {
+	    (th_table + hash)->key = th->occupancy;
+	    (th_table + hash)->a = a;
+	    (th_table + hash)->b = b;
+	    (th_table + hash)->c = c;
+	    th->occupancy = th->occupancy + 1;
+	    if (th->occupancy > th->tablesize / 2) {
+		triplet_hash_rehash(th);
+	    }
+	    return(th->occupancy - 1);
+	}
+	hash++;
+	if (hash >= th->tablesize)
+	    hash -= th->tablesize;
     }
-    curr_bi_avl->state_a = a;
-    curr_bi_avl->state_b = b;
-    curr_bi_avl->state_number = bi_avl_state;
-    return(bi_avl_state++);
 }
 
-int bi_avl_find(int a, int b) {
-    struct bi_avl *curr_bi_avl;
-
-    if (bi_avl_type == BI_AVL_TYPE_ARRAY) {
-        return(bi_avl_array[a][b]);            
-    }
-
-    curr_bi_avl = bi_avl + bi_avl_hash(a,b);
-    
-    if (curr_bi_avl->state_number == -1)
-        return (-1);
-    
-    for ( ; curr_bi_avl != NULL; curr_bi_avl = curr_bi_avl->next) {
-        if (curr_bi_avl->state_a == a && curr_bi_avl->state_b == b)
-            return (curr_bi_avl->state_number);
+void triplet_hash_rehash(struct triplethash *th) {
+    int i;
+    unsigned int newtablesize, oldtablesize;
+    struct triplethash_triplets *oldtriplets;
+    newtablesize = th->tablesize * 2;
+    oldtablesize = th->tablesize;
+    oldtriplets = th->triplets;
+    th->triplets = xxmalloc(sizeof(struct triplethash_triplets) * newtablesize);
+    th->tablesize = newtablesize;
+    for (i = 0; i < newtablesize; i++) {
+	(th->triplets+i)->key = -1;
+    }
+    for (i = 0; i < oldtablesize; i++) {
+	if ((oldtriplets+i)-> key != -1) {
+	    triplet_hash_insert_with_key(th, (oldtriplets+i)->a, (oldtriplets+i)->b, (oldtriplets+i)->c, (oldtriplets+i)->key);
+	}
     }
-    return (-1);
+    xxfree(oldtriplets);
 }
 
-void bi_avl_free() {
-  struct bi_avl *temp_bi_avl, *prev_bi_avl;
-  int i;
-
-  if (bi_avl_type == BI_AVL_TYPE_ARRAY) {
-     for(i = 0; i < bi_avl_rowsize; i++) {
-         xxfree(bi_avl_array[i]);
-     }
-     xxfree(bi_avl_array);
-     return;
-  }
-
-  for (i = 0; i < bi_avl_tablesize; i++) {
-    for (temp_bi_avl = (bi_avl+i)->next; temp_bi_avl != NULL;) {
-      prev_bi_avl = temp_bi_avl;
-      temp_bi_avl = temp_bi_avl->next;
-      xxfree(prev_bi_avl);
+int triplet_hash_find(struct triplethash *th, int a, int b, int c) {
+    struct triplethash_triplets *th_table;
+    unsigned int hash, j;
+    th_table = th->triplets;
+    hash = triplethash_hashf(a, b, c) % th->tablesize;
+    for (j = 0; j < th->tablesize; j++) {
+	if ((th_table + hash)->key == - 1)
+	    return -1;
+	if ((th_table + hash)->a == a && (th_table + hash)->b == b && (th_table + hash)->c == c) {
+	    return((th_table + hash)->key);
+	}
+	hash++;
+	if (hash >= th->tablesize)
+	    hash -= th->tablesize;
     }
-  }
-  xxfree(bi_avl);  
-  bi_avl = NULL;
-  return;  
+    return -1;
 }
 
 struct fsm *fsm_intersect(struct fsm *net1, struct fsm *net2) {
@@ -520,6 +404,7 @@ struct fsm *fsm_intersect(struct fsm *net1, struct fsm *net2) {
     struct fsm_state *machine_a, *machine_b;
     struct state_arr *point_a, *point_b;
     struct fsm *new_net;
+    struct triplethash *th;
 
     net1 = fsm_minimize(net1);
     net2 = fsm_minimize(net2);
@@ -546,8 +431,9 @@ struct fsm *fsm_intersect(struct fsm *net1, struct fsm *net2) {
     
     STACK_2_PUSH(0,0);
     
-    bi_avl_init(0,0,net1->statecount,net2->statecount);
-    
+    th = triplet_hash_init();
+    triplet_hash_insert(th, 0, 0, 0);
+
     fsm_state_init(sigma_max(net1->sigma));
     
     point_a = init_state_pointers(machine_a);
@@ -560,7 +446,7 @@ struct fsm *fsm_intersect(struct fsm *net1, struct fsm *net2) {
         a = int_stack_pop();
         b = int_stack_pop();
         
-        current_state = bi_avl_find(a,b);
+	current_state = triplet_hash_find(th, a, b, 0);
         current_start = (((point_a+a)->start == 1) && ((point_b+b)->start == 1)) ? 1 : 0;
         current_final = (((point_a+a)->final == 1) && ((point_b+b)->final == 1)) ? 1 : 0;
         
@@ -590,9 +476,9 @@ struct fsm *fsm_intersect(struct fsm *net1, struct fsm *net2) {
             if (bptr->mainloop != mainloop)
                 continue;
                 
-            if ((target_number = bi_avl_find(machine_a->target, bptr->target)) == -1) {
+            if ((target_number = triplet_hash_find(th, machine_a->target, bptr->target, 0)) == -1) {
                 STACK_2_PUSH(bptr->target, machine_a->target);
-                target_number = bi_avl_insert(machine_a->target, bptr->target);
+                target_number = triplet_hash_insert(th, machine_a->target, bptr->target, 0);		
             }
             
             fsm_state_add_arc(current_state, machine_a->in, machine_a->out, target_number, current_final, current_start);
@@ -610,7 +496,7 @@ struct fsm *fsm_intersect(struct fsm *net1, struct fsm *net2) {
     xxfree(point_a);
     xxfree(point_b);
     xxfree(array);
-    bi_avl_free();
+    triplet_hash_free(th);
     return(fsm_coaccessible(new_net));
 }
 
@@ -661,7 +547,8 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
     int a,b,i,mainloop,current_state, current_start, current_final, target_number, ain, bin, aout, bout, asearch, max2sigma;
     struct fsm_state *machine_a, *machine_b;
     struct state_arr *point_a, *point_b;
-    char mode;
+    struct triplethash *th;
+    int mode;
     _Bool *is_flag = NULL;
 
 
@@ -717,9 +604,7 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
 
     if (g_flag_is_epsilon) {
         /* Create lookup table for quickly checking if a symbol is a flag */
-        int smax;
         struct sigma *sig1;
-        smax = sigma_max(net1->sigma);
         is_flag = xxmalloc(sizeof(_Bool)*(sigma_max(net1->sigma)+1));
         for (sig1 = net1->sigma; sig1 != NULL; sig1=sig1->next) {
             if (flag_check(sig1->symbol)) {
@@ -756,7 +641,8 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
     /* Mode, a, b */
     STACK_3_PUSH(0,0,0);
 
-    tri_avl_init(0,0,net1->statecount,net2->statecount);
+    th = triplet_hash_init();
+    triplet_hash_insert(th, 0, 0, 0);
 
     fsm_state_init(sigma_max(net1->sigma));
     
@@ -771,9 +657,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
         
         a = int_stack_pop();
         b = int_stack_pop();
-        mode = (char) int_stack_pop();
+        mode = int_stack_pop();
         
-        current_state = tri_avl_find(a,b,mode);
+	current_state = triplet_hash_find(th, a,b,mode);
         current_start = (((point_a+a)->start == 1) && ((point_b+b)->start == 1) && (mode == 0)) ? 1 : 0;
         current_final = (((point_a+a)->final == 1) && ((point_b+b)->final == 1)) ? 1 : 0;
         
@@ -813,6 +699,8 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
             currtail = (index+asearch)->tail + 1;
             for ( ; iptr != currtail && iptr->mainloop == mainloop ; iptr++) {
                 
+                ain = machine_a->in;
+                aout = machine_a->out;
                 bin = iptr->symin;
                 bout = iptr->symout;
                 
@@ -826,9 +714,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
                 if (!g_compose_tristate) {
                     if (bin == aout && bin != -1 && bin != EPSILON) {
                         /* mode -> 0 */
-                        if ((target_number = tri_avl_find(machine_a->target, iptr->target, 0)) == -1) {
+                        if ((target_number = triplet_hash_find(th, machine_a->target, iptr->target, 0)) == -1) {
                             STACK_3_PUSH(0, iptr->target, machine_a->target);
-                            target_number = tri_avl_insert(machine_a->target, iptr->target, 0);
+                            target_number = triplet_hash_insert(th, machine_a->target, iptr->target, 0);
                         }
                         
                         fsm_state_add_arc(current_state, ain, bout, target_number, current_final, current_start);
@@ -838,9 +726,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
                 else if (g_compose_tristate) {
                     if (bin == aout && bin != -1 && ((bin != EPSILON || mode == 0))) {
                         /* mode -> 0 */
-                        if ((target_number = tri_avl_find(machine_a->target, iptr->target, 0)) == -1) {
+                        if ((target_number = triplet_hash_find(th, machine_a->target, iptr->target, 0)) == -1) {
                             STACK_3_PUSH(0, iptr->target, machine_a->target);
-                            target_number = tri_avl_insert(machine_a->target, iptr->target, 0);
+                            target_number = triplet_hash_insert(th, machine_a->target, iptr->target, 0);
                         }
                         
                         fsm_state_add_arc(current_state, ain, bout, target_number, current_final, current_start);
@@ -858,9 +746,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
             ain = machine_a->in;
 
             if (g_flag_is_epsilon && aout != -1 && mode == 0 && *(is_flag+aout)) {
-                if ((target_number = tri_avl_find(machine_a->target, b, 0)) == -1) {
+                if ((target_number = triplet_hash_find(th, machine_a->target, b, 0)) == -1) {
                     STACK_3_PUSH(0, b, machine_a->target);
-                    target_number = tri_avl_insert(machine_a->target, b, 0);
+		    target_number = triplet_hash_insert(th, machine_a->target, b, 0);
                 }
                 fsm_state_add_arc(current_state, ain, aout, target_number, current_final, current_start);
             }
@@ -869,9 +757,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
                 /* Check A:0 arcs on upper side */
                 if (aout == EPSILON && mode == 0) {
                     /* mode -> 0 */        
-                    if ((target_number = tri_avl_find(machine_a->target, b, 0)) == -1) {
+                    if ((target_number = triplet_hash_find(th, machine_a->target, b, 0)) == -1) {
                         STACK_3_PUSH(0, b, machine_a->target);
-                        target_number = tri_avl_insert(machine_a->target, b, 0);                    
+                        target_number = triplet_hash_insert(th, machine_a->target, b, 0);                    
                     }
                     
                     fsm_state_add_arc(current_state, ain, EPSILON, target_number, current_final, current_start);
@@ -881,9 +769,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
             else if (g_compose_tristate) {
                 if (aout == EPSILON && (mode != 2)) {
                     /* mode -> 1 */
-                    if ((target_number = tri_avl_find(machine_a->target, b, 1)) == -1) {
+                    if ((target_number = triplet_hash_find(th, machine_a->target, b, 1)) == -1) {
                         STACK_3_PUSH(1, b, machine_a->target);
-                        target_number = tri_avl_insert(machine_a->target, b, 1);                    
+                        target_number = triplet_hash_insert(th, machine_a->target, b, 1);                    
                     }
                     
                     fsm_state_add_arc(current_state, ain, EPSILON, target_number, current_final, current_start);
@@ -901,9 +789,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
             bout = machine_b->out;
             
             if (g_flag_is_epsilon && bin != -1 && *(is_flag+bin)) {
-                if ((target_number = tri_avl_find(a, machine_b->target, 1)) == -1) {
+                if ((target_number = triplet_hash_find(th, a, machine_b->target, 1)) == -1) {
                     STACK_3_PUSH(1, machine_b->target,a);
-                    target_number = tri_avl_insert(a, machine_b->target, 1);
+                    target_number = triplet_hash_insert(th, a, machine_b->target, 1);
                 }
                 fsm_state_add_arc(current_state, bin, bout, target_number, current_final, current_start);
             }
@@ -912,9 +800,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
                 /* Check 0:A arcs on lower side */
                 if (bin == EPSILON) {
                     /* mode -> 1 */
-                    if ((target_number = tri_avl_find(a, machine_b->target, 1)) == -1) {
+                    if ((target_number = triplet_hash_find(th, a, machine_b->target, 1)) == -1) {
                         STACK_3_PUSH(1, machine_b->target,a);
-                        target_number = tri_avl_insert(a, machine_b->target, 1);
+                        target_number = triplet_hash_insert(th, a, machine_b->target, 1);
                     }
                     
                     fsm_state_add_arc(current_state, EPSILON, bout, target_number, current_final, current_start);
@@ -925,9 +813,9 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
                 /* Check 0:A arcs on lower side */
                 if (bin == EPSILON && mode != 1) {
                     /* mode -> 1 */
-                    if ((target_number = tri_avl_find(a, machine_b->target, 2)) == -1) {
+                    if ((target_number = triplet_hash_find(th, a, machine_b->target, 2)) == -1) {
                         STACK_3_PUSH(2, machine_b->target, a);
-                        target_number = tri_avl_insert(a, machine_b->target, 2);
+                        target_number = triplet_hash_insert(th, a, machine_b->target, 2);
                     }
                     
                     fsm_state_add_arc(current_state, EPSILON, bout, target_number, current_final, current_start);
@@ -947,8 +835,7 @@ struct fsm *fsm_compose(struct fsm *net1, struct fsm *net2) {
 
     if (g_flag_is_epsilon)
         xxfree(is_flag);
-    tri_avl_free();
-
+    triplet_hash_free(th);
     net1 = fsm_topsort(fsm_coaccessible(net1));
     return(fsm_coaccessible(net1));
 }
@@ -1007,7 +894,7 @@ void fsm_merge_sigma(struct fsm *net1, struct fsm *net2) {
   struct fsm_state *fsm_state, *new_1_state, *new_2_state;
   int i, j, end_1 = 0, end_2 = 0, sigmasizes, *mapping_1, *mapping_2, equal = 1, unknown_1 = 0, unknown_2 = 0, net_unk = 0, net_adds = 0, net_lines;
 
-#ifdef foo
+#ifdef ORIGINAL
   i = sigma_find(".#.", net1->sigma);
   j = sigma_find(".#.", net2->sigma);
   if (i != -1 && j == -1) {
@@ -1018,6 +905,8 @@ void fsm_merge_sigma(struct fsm *net1, struct fsm *net2) {
       sigma_add(".#.", net1->sigma);
       sigma_sort(net1);
   }
+#else
+  // This is handled by HFST's XfstCompiler, if needed.
 #endif
 
   sigma_1 = net1->sigma;
@@ -1350,8 +1239,7 @@ int add_fsm_arc(struct fsm_state *fsm, int offset, int state_no, int in, int out
 
 void fsm_count(struct fsm *net) {
   struct fsm_state *fsm;
-  int i, linecount, arccount, oldstate, finalcount, maxstate, arity;
-  arity = 1;
+  int i, linecount, arccount, oldstate, finalcount, maxstate;
   linecount = arccount = finalcount = maxstate = 0;
 
   oldstate = -1;
@@ -1364,8 +1252,8 @@ void fsm_count(struct fsm *net) {
     linecount++;
     if ((fsm+i)->target != -1) {
         arccount++;
-        if (((fsm+i)->in != (fsm+i)->out) || ((fsm+i)->in == UNKNOWN) || ((fsm+i)->out == UNKNOWN))
-            arity = 2;
+	//        if (((fsm+i)->in != (fsm+i)->out) || ((fsm+i)->in == UNKNOWN) || ((fsm+i)->out == UNKNOWN))
+        //    arity = 2;
     }
     if ((fsm+i)->state_no != oldstate) {
         if ((fsm+i)->final_state) {
@@ -1380,7 +1268,6 @@ void fsm_count(struct fsm *net) {
   net->linecount = linecount;
   net->arccount = arccount;
   net->finalcount = finalcount;
-  //net->arity = arity;
 }
 
 static void fsm_add_to_states(struct fsm *net, int add) {
@@ -1740,6 +1627,18 @@ struct fsm *fsm_kleene_closure(struct fsm *net, int operation) {
     return(net);
 }
 
+char *fsm_network_to_char(struct fsm *net) {
+    struct sigma *sigma, *sigprev;
+    sigma = net->sigma;
+    if (sigma->number == -1) {
+        return NULL;
+    }
+    for (; sigma != NULL && sigma->number != -1 ; sigma = sigma->next) {
+	sigprev = sigma;
+    }
+    return(strdup(sigprev->symbol));
+}
+
 struct fsm *fsm_substitute_label(struct fsm *net, char *original, struct fsm *substitute) {
    
     struct fsm *outnet, *subnet2;
@@ -1748,6 +1647,7 @@ struct fsm *fsm_substitute_label(struct fsm *net, char *original, struct fsm *su
     char *subin, *subout;
     int i, repsym, source, target, in, out, addstate1, addstate2;
         
+    fsm_merge_sigma(net, substitute);
     addstate1 = net->statecount;
     addstate2 = substitute->statecount;
 
@@ -1756,7 +1656,7 @@ struct fsm *fsm_substitute_label(struct fsm *net, char *original, struct fsm *su
     repsym = fsm_get_symbol_number(inh, original);
     if (repsym == -1) {
 	fsm_read_done(inh);
-	return(NULL);
+	return(net);
     }
     outh = fsm_construct_init(net->name);
     fsm_construct_copy_sigma(outh, net->sigma);
@@ -1829,7 +1729,7 @@ struct fsm *fsm_substitute_symbol(struct fsm *net, char *original, char *substit
     if (strcmp(original,substitute) == 0)
         return(net);
     if ((o = sigma_find(original, net->sigma)) == -1) {
-	printf("\nSymbol '%s' not found in network!\n",original);
+	//fprintf(stderr, "\nSymbol '%s' not found in network!\n", original);
 	return(net);
     }
     if (strcmp(substitute,"0") == 0)
@@ -1858,6 +1758,7 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
   int i, a, b, current_state, current_start, current_final, target_number, symbol1, symbol2, epsilon = 0, unknown = 0;
   struct fsm_state *machine_a, *machine_b, *fsm;
   struct state_arr *point_a, *point_b;
+  struct triplethash *th;
 
   /* Perform a cross product by running two machines in parallel */
   /* The approach here allows a state to stay, creating a a:0 or 0:b transition */
@@ -1893,7 +1794,8 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
 
   STACK_2_PUSH(0,0);
 
-  bi_avl_init(0,0,net1->statecount,net2->statecount);
+  th = triplet_hash_init();
+  triplet_hash_insert(th, 0, 0, 0);
 
   fsm_state_init(sigma_max(net1->sigma));
 
@@ -1909,7 +1811,7 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
     
    /* printf("Treating pair: {%i,%i}\n",a,b); */
 
-    current_state = bi_avl_find(a,b);
+    current_state = triplet_hash_find(th, a, b, 0);
     current_start = (((point_a+a)->start == 1) && ((point_b+b)->start == 1)) ? 1 : 0;
     current_final = (((point_a+a)->final == 1) && ((point_b+b)->final == 1)) ? 1 : 0;
 
@@ -1929,9 +1831,9 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
 	}
 	/* Main check */
 	if (!((machine_a->target == -1) || (machine_b->target == -1))) {
-	  if ((target_number = bi_avl_find(machine_a->target, machine_b->target)) == -1) {
+	    if ((target_number = triplet_hash_find(th, machine_a->target, machine_b->target, 0)) == -1) {
               STACK_2_PUSH(machine_b->target, machine_a->target);
-              target_number = bi_avl_insert(machine_a->target, machine_b->target);
+              target_number = triplet_hash_insert(th, machine_a->target, machine_b->target, 0);
 	  }
 	  symbol1 = machine_a->in;
 	  symbol2 = machine_b->in;
@@ -1949,10 +1851,10 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
 	if (machine_a->final_state == 1 && machine_b->target != -1) {
             
 	  /* Add 0:b i.e. stay in state A */
-	  if ((target_number = bi_avl_find(machine_a->state_no, machine_b->target)) == -1) {
-              STACK_2_PUSH(machine_b->target, machine_a->state_no);
-              target_number = bi_avl_insert(machine_a->state_no, machine_b->target);
-	  }
+	    if ((target_number = triplet_hash_find(th, machine_a->state_no, machine_b->target, 0)) == -1) {
+		STACK_2_PUSH(machine_b->target, machine_a->state_no);
+		target_number = triplet_hash_insert(th, machine_a->state_no, machine_b->target, 0);
+	    }
 	  /* @:0 becomes ?:0 */
 	  symbol2 = machine_b->in == IDENTITY ? UNKNOWN : machine_b->in;
           fsm_state_add_arc(current_state, EPSILON, symbol2, target_number, current_final, current_start);
@@ -1961,9 +1863,9 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
 	if (machine_b->final_state == 1 && machine_a->target != -1) {
 	  
 	  /* Add a:0 i.e. stay in state B */
-	  if ((target_number = bi_avl_find(machine_a->target, machine_b->state_no)) == -1) {
+	    if ((target_number = triplet_hash_find(th, machine_a->target, machine_b->state_no, 0)) == -1) {
               STACK_2_PUSH(machine_b->state_no, machine_a->target);
-              target_number = bi_avl_insert(machine_a->target, machine_b->state_no);
+              target_number = triplet_hash_insert(th, machine_a->target, machine_b->state_no, 0);
 	  }
 	  /* @:0 becomes ?:0 */
 	  symbol1 = machine_a->in == IDENTITY ? UNKNOWN : machine_a->in;
@@ -1997,7 +1899,7 @@ struct fsm *fsm_cross_product(struct fsm *net1, struct fsm *net2) {
   xxfree(point_a);
   xxfree(point_b);
   fsm_destroy(net2);
-  bi_avl_free();
+  triplet_hash_free(th);
   return(fsm_coaccessible(net1));
 }
 
@@ -2009,10 +1911,92 @@ struct fsm *fsm_follows(struct fsm *net1, struct fsm *net2) {
     return(fsm_complement(fsm_minimize(fsm_contains(fsm_minimize(fsm_concat(fsm_minimize(fsm_copy(net1)),fsm_concat(fsm_universal(),fsm_minimize(fsm_copy(net2)))))))));
 }
 
+struct fsm *fsm_unflatten(struct fsm *net, char *epsilon_sym, char *repeat_sym) {
+    int a, b, current_state, current_start, current_final, target_number, epsilon, repeat, in, out;
+    struct fsm_state *even_state, *odd_state;
+    struct state_arr *point_a;
+    struct triplethash *th;
+    
+    fsm_minimize(net);
+    fsm_count(net);
+    
+    epsilon = sigma_find(epsilon_sym, net->sigma);
+    repeat = sigma_find(repeat_sym, net->sigma);  
+    
+    even_state = net->states;
+    
+    /* new state 0 = {0,0} */
+    
+    STACK_2_PUSH(0,0);
+    
+    th = triplet_hash_init();
+    triplet_hash_insert(th, 0, 0, 0);
+    
+    fsm_state_init(sigma_max(net->sigma));
+    
+    point_a = init_state_pointers(even_state);
+
+    while (!int_stack_isempty()) {
+	
+	/* Get a pair of states to examine */
+	
+	a = int_stack_pop();
+	a = int_stack_pop();
+	
+	/* printf("Treating pair: {%i,%i}\n",a,b); */
+	
+	current_state = triplet_hash_find(th, a, a, 0);
+	current_start = ((point_a+a)->start == 1) ? 1 : 0;
+	current_final = ((point_a+a)->final == 1) ? 1 : 0;
+	
+	fsm_state_set_current_state(current_state, current_final, current_start);
+	
+	for (even_state = (point_a+a)->transitions; even_state->state_no == a; even_state++) {
+	    if (even_state->target == -1) {
+		continue;
+	    }
+	    in = even_state->in;
+	    b = even_state->target;
+	    for (odd_state = (point_a+b)->transitions; odd_state->state_no == b; odd_state++) {
+		if (odd_state->target == -1) {
+		    continue;
+		}
+		if ((target_number = triplet_hash_find(th, odd_state->target, odd_state->target, 0)) == -1) {
+		    STACK_2_PUSH(odd_state->target, odd_state->target);
+		    target_number = triplet_hash_insert(th, odd_state->target, odd_state->target, 0);
+		}
+		in = even_state->in;
+		out = odd_state->in;
+		if (out == repeat) {
+		    out = in;
+		} else if (in == IDENTITY || out == IDENTITY) {
+		    in = in == IDENTITY ? UNKNOWN : in;
+		    out = out == IDENTITY ? UNKNOWN : out;
+		}
+		if (in == epsilon) {
+		    in = EPSILON;
+		}
+		if (out == epsilon) {
+		    out = EPSILON;
+		}
+		fsm_state_add_arc(current_state, in, out, target_number, current_final, current_start);
+	    }
+	}
+	fsm_state_end_state();
+    }
+    xxfree(net->states);
+    fsm_state_close(net);
+    xxfree(point_a);
+    triplet_hash_free(th);
+    return(net);
+}
+
+
 struct fsm *fsm_shuffle(struct fsm *net1, struct fsm *net2) {
   int a, b, current_state, current_start, current_final, target_number;
   struct fsm_state *machine_a, *machine_b;
   struct state_arr *point_a, *point_b;
+  struct triplethash *th;
 
   /* Shuffle A and B by making alternatively A move and B stay at each or */
   /* vice versa at each step */
@@ -2032,7 +2016,8 @@ struct fsm *fsm_shuffle(struct fsm *net1, struct fsm *net2) {
 
   STACK_2_PUSH(0,0);
 
-  bi_avl_init(0,0,net1->statecount,net2->statecount);
+  th = triplet_hash_init();
+  triplet_hash_insert(th, 0, 0, 0);
 
   fsm_state_init(sigma_max(net1->sigma));
 
@@ -2048,7 +2033,7 @@ struct fsm *fsm_shuffle(struct fsm *net1, struct fsm *net2) {
     
    /* printf("Treating pair: {%i,%i}\n",a,b); */
 
-    current_state = bi_avl_find(a,b);
+    current_state = triplet_hash_find(th, a, b, 0);
     current_start = (((point_a+a)->start == 1) && ((point_b+b)->start == 1)) ? 1 : 0;
     current_final = (((point_a+a)->final == 1) && ((point_b+b)->final == 1)) ? 1 : 0;
 
@@ -2059,9 +2044,9 @@ struct fsm *fsm_shuffle(struct fsm *net1, struct fsm *net2) {
 	if (machine_a->target == -1) {
 	  continue;
 	}
-	if ((target_number = bi_avl_find(machine_a->target, b)) == -1) {
+	if ((target_number = triplet_hash_find(th, machine_a->target, b, 0)) == -1) {
           STACK_2_PUSH(b, machine_a->target);
-	  target_number = bi_avl_insert(machine_a->target, b);
+	  target_number = triplet_hash_insert(th, machine_a->target, b, 0);
 	}
 
         fsm_state_add_arc(current_state, machine_a->in, machine_a->out, target_number, current_final, current_start);
@@ -2074,9 +2059,9 @@ struct fsm *fsm_shuffle(struct fsm *net1, struct fsm *net2) {
 	  continue;
 	}
 
-	  if ((target_number = bi_avl_find(a, machine_b->target)) == -1) {
+	if ((target_number = triplet_hash_find(th, a, machine_b->target, 0)) == -1) {
               STACK_2_PUSH(machine_b->target, a);
-              target_number = bi_avl_insert(a, machine_b->target);
+              target_number = triplet_hash_insert(th, a, machine_b->target, 0);
 	  }
           fsm_state_add_arc(current_state, machine_b->in, machine_b->out, target_number, current_final, current_start);
       }
@@ -2090,39 +2075,125 @@ struct fsm *fsm_shuffle(struct fsm *net1, struct fsm *net2) {
   xxfree(point_a);
   xxfree(point_b);
   fsm_destroy(net2);
-  bi_avl_free();
+  triplet_hash_free(th);
   return(net1);
 }
 
-struct fsm *fsm_minus(struct fsm *net1, struct fsm *net2) {
-    int a, b, current_state, current_start, current_final, target_number, b_has_trans, btarget, statecount;
-  struct fsm_state *machine_a, *machine_b;
-  struct state_arr *point_a, *point_b;
+int fsm_equivalent(struct fsm *net1, struct fsm *net2) {
+    /* Test path equivalence of two FSMs by traversing both in parallel */
+    int a, b, matching_arc, equivalent;
+    struct fsm_state *machine_a, *machine_b;
+    struct state_arr *point_a, *point_b;
+    struct triplethash *th;
+    
+    fsm_merge_sigma(net1, net2);
+    
+    fsm_count(net1);
+    fsm_count(net2);
+    
+    machine_a = net1->states;
+    machine_b = net2->states;
+    
+    equivalent = 0;
+    /* new state 0 = {0,0} */
+    STACK_2_PUSH(0,0);
+    
+    th = triplet_hash_init();
+    triplet_hash_insert(th, 0, 0, 0);
+    
+    point_a = init_state_pointers(machine_a);
+    point_b = init_state_pointers(machine_b);
+    
+    while (!int_stack_isempty()) {
+	
+	/* Get a pair of states to examine */
+	
+	a = int_stack_pop();
+	b = int_stack_pop();
+   	
+	if ((point_a+a)->final != (point_b+b)->final) {	  
+	    goto not_equivalent;
+	}
+	/* Check that all arcs in A have matching arc in B, push new state pair on stack */
+	for (machine_a = (point_a+a)->transitions ; machine_a->state_no == a  ; machine_a++) {
+	    if (machine_a->target == -1) {
+		break;
+	    }
+	    matching_arc = 0;
+	    for (machine_b = (point_b+b)->transitions; machine_b->state_no == b ; machine_b++) {
+		if (machine_b->target == -1) {
+		    break;
+		}
+		if (machine_a->in == machine_b->in && machine_a->out == machine_b->out) {
+		    matching_arc = 1;
+		    if ((triplet_hash_find(th, machine_a->target, machine_b->target, 0)) == -1) {
+			STACK_2_PUSH(machine_b->target, machine_a->target);
+			triplet_hash_insert(th, machine_a->target, machine_b->target, 0);
+		    }
+		    break;
+		}
+	    }
+	    if (matching_arc == 0) {
+		goto not_equivalent;
+	    }
+	}
+	for (machine_b = (point_b+b)->transitions; machine_b->state_no == b ; machine_b++) {
+	    if (machine_b->target == -1) {
+		break;
+	    }
+	    matching_arc = 0;
+	    for (machine_a = (point_a+a)->transitions ; machine_a->state_no == a  ; machine_a++) {
+		if (machine_a->in == machine_b->in && machine_a->out == machine_b->out) {
+		    matching_arc = 1;
+		    break;
+		}
+	    }
+	    if (matching_arc == 0) {
+		goto not_equivalent;
+	    }
+	}
+    }
+    equivalent = 1;
+ not_equivalent:
+    fsm_destroy(net1);
+    fsm_destroy(net2);
+    xxfree(point_a);
+    xxfree(point_b);
+    triplet_hash_free(th);
+    return(equivalent);
+}
 
-  statecount = 0;
 
-  net1 = fsm_minimize(net1);
-  net2 = fsm_minimize(net2);
-  
-  fsm_merge_sigma(net1, net2);
+struct fsm *fsm_minus(struct fsm *net1, struct fsm *net2) {
+    int a, b, current_state, current_start, current_final, target_number, b_has_trans, btarget, statecount;
+    struct fsm_state *machine_a, *machine_b;
+    struct state_arr *point_a, *point_b;
+    struct triplethash *th;
+    statecount = 0;
 
-  fsm_count(net1);
-  fsm_count(net2);
-  
-  machine_a = net1->states;
-  machine_b = net2->states;
-  
-  /* new state 0 = {1,1} */
+    net1 = fsm_minimize(net1);
+    net2 = fsm_minimize(net2);
+    
+    fsm_merge_sigma(net1, net2);
+    
+    fsm_count(net1);
+    fsm_count(net2);
+    
+    machine_a = net1->states;
+    machine_b = net2->states;
+    
+    /* new state 0 = {1,1} */
 
-  int_stack_clear();
-  STACK_2_PUSH(1,1);
+    int_stack_clear();
+    STACK_2_PUSH(1,1);
 
-  bi_avl_init(1,1,net1->statecount+1,net2->statecount+1);
+    th = triplet_hash_init();
+    triplet_hash_insert(th, 1, 1, 0);
 
-  point_a = init_state_pointers(machine_a);
-  point_b = init_state_pointers(machine_b);
+    point_a = init_state_pointers(machine_a);
+    point_b = init_state_pointers(machine_b);
 
-  fsm_state_init(sigma_max(net1->sigma));
+    fsm_state_init(sigma_max(net1->sigma));
 
   while (!int_stack_isempty()) {
       statecount++;
@@ -2131,7 +2202,7 @@ struct fsm *fsm_minus(struct fsm *net1, struct fsm *net2) {
       a = int_stack_pop();
       b = int_stack_pop();
 
-      current_state = bi_avl_find(a,b);
+      current_state = triplet_hash_find(th, a, b, 0);
       a--;
       b--;
     
@@ -2152,9 +2223,9 @@ struct fsm *fsm_minus(struct fsm *net1, struct fsm *net2) {
           }
           if (b == -1) {
               /* b is dead */
-              if ((target_number = bi_avl_find((machine_a->target)+1, 0)) == -1) {
+              if ((target_number = triplet_hash_find(th, (machine_a->target)+1, 0, 0)) == -1) {
                   STACK_2_PUSH(0, (machine_a->target)+1);
-                  target_number = bi_avl_insert((machine_a->target)+1, 0);
+                  target_number = triplet_hash_insert(th, (machine_a->target)+1, 0, 0);
               }
           } else {
               /* b is alive */
@@ -2167,15 +2238,15 @@ struct fsm *fsm_minus(struct fsm *net1, struct fsm *net2) {
                   }
               }
               if (b_has_trans) {
-                  if ((target_number = bi_avl_find((machine_a->target)+1, btarget+1)) == -1) {
+                  if ((target_number = triplet_hash_find(th, (machine_a->target)+1, btarget+1, 0)) == -1) {
                       STACK_2_PUSH(btarget+1, (machine_a->target)+1);
-                      target_number = bi_avl_insert((machine_a->target)+1, (machine_b->target)+1);
+		      target_number = triplet_hash_insert(th, (machine_a->target)+1, (machine_b->target)+1, 0);
                   }
               } else {
                   /* b is dead */
-                  if ((target_number = bi_avl_find((machine_a->target)+1, 0)) == -1) {
+                  if ((target_number = triplet_hash_find(th, (machine_a->target)+1, 0, 0)) == -1) {
                       STACK_2_PUSH(0, (machine_a->target)+1);
-                      target_number = bi_avl_insert((machine_a->target)+1, 0);
+		      target_number = triplet_hash_insert(th, (machine_a->target)+1, 0, 0);
                   }
               }
           }
@@ -2189,7 +2260,7 @@ struct fsm *fsm_minus(struct fsm *net1, struct fsm *net2) {
   xxfree(point_a);
   xxfree(point_b);
   fsm_destroy(net2);
-  bi_avl_free();
+  triplet_hash_free(th);
   return(fsm_minimize(net1));
 }
 
@@ -2944,12 +3015,86 @@ struct fsm *fsm_mark_fsm_tail(struct fsm *net, struct fsm *marker) {
     return(newnet);
 }
 
+#ifndef ORIGINAL
+struct fsm *fsm_context_restrict(struct fsm *X, struct fsmcontexts *LR);
+#else
+struct fsm *fsm_context_restrict(struct fsm *X, struct fsmcontexts *LR) {
+
+    struct fsm *Var, *Notvar, *UnionL, *UnionP, *Result, *Word;
+    struct fsmcontexts *pairs;
+
+    /* [.#. \.#.* .#.]-`[[ [\X* X C X \X*]&~[\X* [L1 X \X* X R1|...|Ln X \X* X Rn] \X*]],X,0] */
+    /* Where X = variable symbol */
+    /* The above only works if we do the subtraction iff the right hand side contains .#. in */
+    /* its alphabet */
+    /* A more generic formula is the following: */
+
+    /* `[[[(?) \.#.* (?)] - `[[[\X* X C X \X*] - [\X* [L1 X \X* X R1|...|Ln X \X* X Rn] \X*] ],X,0],.#.,0]; */
+    /* Here, the LHS is another way of saying ~[?+ .#. ?+] */
+
+    Var = fsm_symbol("@VARX@");
+    Notvar = fsm_minimize(fsm_kleene_star(fsm_term_negation(fsm_symbol("@VARX@"))));
+
+    /* We add the variable symbol to all alphabets to avoid ? mathing it */
+    /* which would cause extra nondeterminism */
+    sigma_add("@VARX@", X->sigma);
+    sigma_sort(X);
+    
+    /* Also, if any L or R is undeclared we add 0 */
+    for (pairs = LR; pairs != NULL; pairs = pairs->next) {
+        if (pairs->left == NULL) {
+            pairs->left = fsm_empty_string();
+        } else {
+            sigma_add("@VARX@",pairs->left->sigma);
+	    sigma_substitute(".#.", "@#@", pairs->left->sigma);
+            sigma_sort(pairs->left);
+        }
+        if (pairs->right == NULL) {
+            pairs->right = fsm_empty_string();
+        } else {
+            sigma_add("@VARX@",pairs->right->sigma);
+	    sigma_substitute(".#.", "@#@", pairs->right->sigma);
+            sigma_sort(pairs->right);
+        }
+    }
+
+    UnionP = fsm_empty_set();
+    
+    for (pairs = LR; pairs != NULL ; pairs = pairs->next) {
+        UnionP = fsm_minimize(fsm_union(fsm_minimize(fsm_concat(fsm_copy(pairs->left),fsm_concat(fsm_copy(Var),fsm_concat(fsm_copy(Notvar),fsm_concat(fsm_copy(Var),fsm_copy(pairs->right)))))), UnionP));
+    }
+    
+    UnionL = fsm_minimize(fsm_concat(fsm_copy(Notvar),fsm_concat(fsm_copy(Var), fsm_concat(fsm_copy(X), fsm_concat(fsm_copy(Var),fsm_copy(Notvar))))));
+
+    Result = fsm_intersect(UnionL, fsm_complement(fsm_concat(fsm_copy(Notvar),fsm_minimize(fsm_concat(fsm_copy(UnionP),fsm_copy(Notvar))))));
+    if (sigma_find("@VARX@", Result->sigma) != -1) {
+        Result = fsm_complement(fsm_substitute_symbol(Result, "@VARX@","@_EPSILON_SYMBOL_@"));
+    } else {
+	Result = fsm_complement(Result);
+    }
+
+    if (sigma_find("@#@", Result->sigma) != -1) {
+	Word = fsm_minimize(fsm_concat(fsm_symbol("@#@"),fsm_concat(fsm_kleene_star(fsm_term_negation(fsm_symbol("@#@"))),fsm_symbol("@#@"))));
+        Result = fsm_intersect(Word, Result);
+        Result = fsm_substitute_symbol(Result, "@#@", "@_EPSILON_SYMBOL_@");
+    }
+    fsm_destroy(UnionP);
+    fsm_destroy(Var);
+    fsm_destroy(Notvar);
+    fsm_destroy(X);
+    fsm_clear_contexts(pairs);
+    return(Result);
+}
+#endif
+
 struct fsm *fsm_flatten(struct fsm *net, struct fsm *epsilon) {
     struct fsm *newnet;
     struct fsm_construct_handle *outh;
     struct fsm_read_handle *inh, *eps;
     int i, maxstate, in, out, target;
     char *epssym, *instring, *outstring;
+
+    net = fsm_minimize(net);
     
     inh = fsm_read_init(net);
     eps = fsm_read_init(epsilon);
@@ -2998,3 +3143,30 @@ struct fsm *fsm_flatten(struct fsm *net, struct fsm *epsilon) {
     xxfree(epssym);
     return(newnet);
 }
+
+/* Removes IDENTITY and UNKNOWN transitions. If mode = 1, only removes UNKNOWNs */
+struct fsm *fsm_close_sigma(struct fsm *net, int mode) {
+    struct fsm *newnet;
+    struct fsm_construct_handle *newh;
+    struct fsm_read_handle *inh;
+    int i;
+
+    inh = fsm_read_init(net);
+    newh = fsm_construct_init(net->name);
+    fsm_construct_copy_sigma(newh, net->sigma);
+
+    while (fsm_get_next_arc(inh)) {
+	if ((fsm_get_arc_num_in(inh) != UNKNOWN && fsm_get_arc_num_in(inh) != IDENTITY && fsm_get_arc_num_out(inh) != UNKNOWN && fsm_get_arc_num_out(inh) != IDENTITY) || (mode == 1 && fsm_get_arc_num_in(inh) != UNKNOWN && fsm_get_arc_num_out(inh) != UNKNOWN))
+	    fsm_construct_add_arc_nums(newh, fsm_get_arc_source(inh), fsm_get_arc_target(inh), fsm_get_arc_num_in(inh), fsm_get_arc_num_out(inh));
+    }
+    while ((i = fsm_get_next_final(inh)) != -1) {
+	fsm_construct_set_final(newh, i);
+    }
+    while ((i = fsm_get_next_initial(inh)) != -1) {
+	fsm_construct_set_initial(newh, i);
+    }
+    fsm_read_done(inh);
+    newnet = fsm_construct_done(newh);
+    fsm_destroy(net);
+    return(fsm_minimize(newnet));
+}
diff --git a/back-ends/foma/define.c b/back-ends/foma/define.c
index 6ca4a70..a79e7f4 100644
--- a/back-ends/foma/define.c
+++ b/back-ends/foma/define.c
@@ -3,147 +3,142 @@
 #include <stdlib.h>
 #include "foma.h"
 
-struct defined   *defines;
-struct definedf  *defines_f;
-
-/** Find a defined symbol from the symbol table */
-struct fsm *find_defined (char *string) {
-  struct defined *defined;
-  for (defined = defines; defined != NULL; defined = defined->next) {
-    if (strcmp(string, defined->name) == 0) {
-      return(defined->net);
+/* Find a defined symbol from the symbol table */
+/* Return the corresponding FSM                */
+struct fsm *find_defined(struct defined_networks *def, char *string) {
+    struct defined_networks *d;
+    for (d = def; d != NULL; d = d->next) {
+	if (d->name != NULL && strcmp(string, d->name) == 0) {
+	    return(d->net);
+	}
     }
-  }
-  return NULL;
+    return NULL;
 }
 
-struct defined *get_defines() {
-    return(defines);    
+struct defined_networks *defined_networks_init(void) {
+    struct defined_networks *def;
+    def = calloc(1, sizeof(struct defined_networks)); /* Dummy first entry, so we can maintain the ptr */
+    return def;
 }
-struct definedf *get_defines_f() {
-    return(defines_f);    
+
+struct defined_functions *defined_functions_init(void) {
+    struct defined_functions *deff;
+    deff = calloc(1, sizeof(struct defined_functions)); /* Dummy first entry */
+    return deff;
 }
 
-/* Removes a defined function from the list */
+/* Removes a defined network from the list                 */
 /* Returns 0 on success, 1 if the definition did not exist */
+/* Undefines all if NULL is passed as the string argument  */
 
-int remove_defined (char *string) {
-  struct defined *defined, *defined_prev;
-  struct definedf *df, *dfprev;
-  int exists = 0;
-  defined_prev = NULL;
-  /* Undefine all */
-  if (string == NULL) {
-      for (defined = defines; defined != NULL; ) {
-          fsm_destroy(defined->net);
-          defined_prev = defined;
-          defined = defined->next;
-          xxfree(defined_prev->name);
-          xxfree(defined_prev);
-          defines = NULL;
-      }
-      for (df = defines_f; df != NULL; df = dfprev) {
-          dfprev = df->next;
-          if (df->name != NULL)
-              xxfree(df->name);
-          if (df->regex != NULL)
-              xxfree(df->regex);
-          xxfree(df);
-      }
-
- 
-     return(0);
-  }
-  for (defined = defines; defined != NULL; defined = defined->next) {
-      if (strcmp(defined->name, string) == 0) {
-          exists = 1;
-          break;
-      }
-      defined_prev = defined;
-  }
-  if (exists == 0) { 
-      //if (mode == 1) printf("*** Error: %s has no network definition.\n", string);
-      return 1;
-  }
-  if (defined_prev != NULL) {
-      defined_prev->next = defined->next;
-  } else {
-      defines = defined->next;
-  }
-  fsm_destroy(defined->net);
-  xxfree(defined->name);
-  xxfree(defined);
-  return(0);
+int remove_defined(struct defined_networks *def, char *string) {
+    struct defined_networks *d, *d_prev, *d_next;
+    int exists = 0;
+    /* Undefine all */
+    if (string == NULL) {
+	for (d = def; d != NULL; d = d_next) {
+	    d_next = d->next;	    
+	    fsm_destroy(d->net);
+	    xxfree(d->name);
+	}
+	return 0;
+    }
+    d_prev = NULL; 
+    for (d = def; d != NULL; d_prev = d, d = d->next) {
+	if (d->name != NULL && strcmp(d->name, string) == 0) {
+	    exists = 1;
+	    break;
+	}
+    }
+    if (exists == 0) {
+	return 1;
+    }
+    if (d == def) {
+	if (d->next != NULL) {
+	    fsm_destroy(d->net);
+	    xxfree(d->name);
+	    d->name = d->next->name;
+	    d->net = d->next->net;
+	    d_next = d->next->next;
+	    xxfree(d->next);
+	    d->next = d_next;
+	} else {
+	    fsm_destroy(d->net);
+	    xxfree(d->name);
+	    d->next = NULL;
+	    d->name = NULL;
+	}
+    } else {
+	fsm_destroy(d->net);
+	xxfree(d->name);
+	d_prev->next = d->next;
+	xxfree(d);
+    }
+    return 0;
 }
 
-/* Add a function to list of defined functions */
-char *find_defined_function(char *name, int numargs) {
-    struct definedf *df;
-    for (df = defines_f ; df != NULL; df = df->next) {
-        if (strcmp(df->name, name) == 0 && df->numargs == numargs) {
-            return(df->regex);
+/* Finds defined regex "function" based on name, numargs */
+/* Returns the corresponding regex                       */
+char *find_defined_function(struct defined_functions *deff, char *name, int numargs) {
+    struct defined_functions *d;
+    for (d = deff ; d != NULL; d = d->next) {
+        if (d->name != NULL && strcmp(d->name, name) == 0 && d->numargs == numargs) {
+            return(d->regex);
         }
     }
-    return(NULL);
+    return NULL;
 }
 
-int add_defined_function(char *name, char *regex, int numargs) {
-
-    struct definedf *df;
-    if (find_defined_function(name, numargs) == NULL) {
-        df = xxmalloc(sizeof(struct definedf));
-        df->name = xxstrdup(name);
-        df->regex = xxstrdup(regex);
-        df->numargs = numargs;
-        df->next = defines_f;
-        defines_f = df;
-        printf("defined %s@%i)\n", name, numargs);
+/* Add a function to list of defined functions */
+int add_defined_function(struct defined_functions *deff, char *name, char *regex, int numargs) {
+    struct defined_functions *d;
+    for (d = deff; d != NULL; d = d->next) {
+	if (d->name != NULL && strcmp(d->name, name) == 0 && d->numargs == numargs) {
+	    xxfree(d->regex);
+	    d->regex = xxstrdup(regex);
+	    printf("redefined %s@%i)\n", name, numargs);
+	    return 1;
+	}
+    }
+    if (deff->name == NULL) {
+	d = deff;
     } else {
-        for (df = defines_f; df != NULL; df = df->next) {
-            if (strcmp(df->name, name) == 0 && df->numargs == numargs) {
-                xxfree(df->regex);
-                df->regex = xxstrdup(regex);
-                printf("redefined %s@%i)\n", name, numargs);
-                break;
-            }
-        }
+	d = xxmalloc(sizeof(struct defined_functions));
+	d->next = deff->next;
+	deff->next = d;
     }
-    return 1;
+    d->name = xxstrdup(name);
+    d->regex = xxstrdup(regex);
+    d->numargs = numargs;
+    return 0;
 }
 
 /* Add a network to list of defined networks */
 /* Returns 0 on success or 1 on redefinition */
+/* Always maintain head of list at same ptr */
 
-int add_defined (struct fsm *net, char *string) {
-  struct defined *defined, *defined_prev;
-  int redefine;
-
-  redefine = 0;
-  if (net == NULL) { return 0; }
-  fsm_count(net);
-  if (defines == NULL) {
-    defined = xxmalloc(sizeof(struct defined));
-    defines = defined;
-    defined->next = NULL;
-  } else {
-    for (defined = defines; defined != NULL; defined = defined->next) {
-      defined_prev = defined;
-      if (strcmp(defined->name, string) == 0) {
-        redefine = 1;
-        break;
-      }
+int add_defined(struct defined_networks *def, struct fsm *net, char *string) {
+    struct defined_networks *d;
+    if (net == NULL)
+	return 0;
+    fsm_count(net);
+    for (d = def; d != NULL; d = d->next) {
+	if (d->name != NULL && strcmp(d->name, string) == 0) {
+	    xxfree(d->net);
+	    xxfree(d->name);
+	    d->net = net;
+	    d->name = xxstrdup(string);
+	    return 1;
+	}
     }
-    if (redefine == 0) {
-      defined_prev->next = xxmalloc(sizeof(struct defined));
-      defined = defined_prev->next;
-      defined->next = NULL;
+    if (def->name == NULL) {
+	d = def;
+    } else {
+	d = xxmalloc(sizeof(struct defined_networks));
+	d->next = def->next;
+	def->next = d;
     }
-  }
-  if (redefine) {
-      fsm_destroy(defined->net);
-      xxfree(defined->name);
-  }
-  defined->name = xxstrdup(string);
-  defined->net = net;
-  return(redefine);
+    d->name = xxstrdup(string);
+    d->net = net;
+    return 0;
 }
diff --git a/back-ends/foma/determinize.c b/back-ends/foma/determinize.c
index 85eb9fd..30f69f7 100644
--- a/back-ends/foma/determinize.c
+++ b/back-ends/foma/determinize.c
@@ -59,13 +59,17 @@ struct T_memo {
     unsigned int set_offset;
 };
 
-struct trans_list {
+// HFST MODIFICATIONS: struct trans_list -> struct trans_list_struct
+//                     struct trans_array -> struct trans_list_array
+// because some compilers complain about struct and variable having the same name
+
+static struct trans_list_struct {
     int inout;
     int target;
 } *trans_list;
 
-struct trans_array {
-    struct trans_list *transitions;
+static struct trans_array_struct {
+    struct trans_list_struct *transitions;
     unsigned int size;
     unsigned int tail;
 } *trans_array;
@@ -161,7 +165,7 @@ int fsm_isstarfree(struct fsm *net) {
 
 static struct fsm *fsm_subset(struct fsm *net, int operation) {
 
-    int T, U, tflag;
+    int T, U;
     
     if (net->is_deterministic == YES && operation != SUBSET_TEST_STAR_FREE) {
         return(net);
@@ -174,7 +178,6 @@ static struct fsm *fsm_subset(struct fsm *net, int operation) {
     init(net);
     nhash_init((num_states < 12) ? 6 : num_states/2);
     
-    tflag = 0;
     T = initial_e_closure(net);
 
     int_stack_clear();
@@ -222,8 +225,8 @@ static struct fsm *fsm_subset(struct fsm *net, int operation) {
 
     do {
         int i, j, tail, setsize, *theset, stateno, has_trans, minsym, next_minsym, trgt, symbol_in, symbol_out;
-        struct trans_list *transitions;
-        struct trans_array *tptr;
+        struct trans_list_struct *transitions;
+        struct trans_array_struct *tptr;
 
         fsm_state_set_current_state(T, (T_ptr+T)->finalstart, T == 0 ? 1 : 0);
         
@@ -377,16 +380,16 @@ static void init(struct fsm *net) {
 }
 
 static int trans_sort_cmp(const void *a, const void *b) {
-  return (((const struct trans_list *)a)->inout - ((const struct trans_list *)b)->inout);
+  return (((const struct trans_list_struct *)a)->inout - ((const struct trans_list_struct *)b)->inout);
 }
 
 static void init_trans_array(struct fsm *net) {
-    struct trans_list *arrptr;
+    struct trans_list_struct *arrptr;
     struct fsm_state *fsm;
     int i, j, laststate, lastsym, inout, size, state;
 
-    arrptr = trans_list = xxmalloc(net->linecount * sizeof(struct trans_list));
-    trans_array = xxcalloc(net->statecount, sizeof(struct trans_array));
+    arrptr = trans_list = xxmalloc(net->linecount * sizeof(struct trans_list_struct));
+    trans_array = xxcalloc(net->statecount, sizeof(struct trans_array_struct));
     
     laststate = -1;
     fsm = net->states;
@@ -422,7 +425,7 @@ static void init_trans_array(struct fsm *net) {
         arrptr = (trans_array+i)->transitions;
         size = (trans_array+i)->size;
         if (size > 1) {
-            qsort(arrptr, size, sizeof(struct trans_list), trans_sort_cmp);
+            qsort(arrptr, size, sizeof(struct trans_list_struct), trans_sort_cmp);
             lastsym = -1;
             /* Figure out if we're already deterministic */
             for (j=0; j < size; j++) {
@@ -685,7 +688,7 @@ static void sigma_to_pairs(struct fsm *net) {
       *(single_sigma_array+next_x) = z;
       next_x++;
       if (y == EPSILON && z == EPSILON) {
-        epsilon_symbol = x;
+	epsilon_symbol = x;
       }
       x++;
     }
diff --git a/back-ends/foma/dynarray.c b/back-ends/foma/dynarray.c
index 398cfac..50838b8 100644
--- a/back-ends/foma/dynarray.c
+++ b/back-ends/foma/dynarray.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -83,7 +83,7 @@ void fsm_state_set_current_state(int state_no, int final_state, int start_state)
     if (current_final == 1)
         num_finals++;
     if (current_start == 1)
-        num_initials++;
+	num_initials++;
 }
 
 /* Add sentinel if needed */
@@ -116,9 +116,9 @@ void fsm_state_add_arc(int state_no, int in, int out, int target, int final_stat
     if (in != -1 && out != -1) {
         if ((slookup+(ssize*in)+out)->mainloop == mainloop) {
             if ((slookup+(ssize*in)+out)->target == target) {
-                return;
+	        return;
             } else {
-                is_deterministic = 0;
+	        is_deterministic = 0;
             }
         }
         arccount++;
@@ -155,7 +155,7 @@ void fsm_state_close(struct fsm *net) {
     net->finalcount = num_finals;
     net->pathcount = PATHCOUNT_UNKNOWN;
     if (num_initials > 1)
-        is_deterministic = 0;
+	is_deterministic = 0;
     net->is_deterministic = is_deterministic;
     net->is_pruned = UNK;
     net->is_minimized = UNK;
@@ -187,6 +187,7 @@ struct fsm_construct_handle *fsm_construct_init(char *name) {
     } else {
         handle->name = xxstrdup(name);
     }
+    handle->hasinitial = 0;
     return(handle);
 }
 
@@ -232,6 +233,7 @@ void fsm_construct_set_initial(struct fsm_construct_handle *handle, int state_no
 
     sl = handle->fsm_state_list;
     (sl+state_no)->is_initial = 1;
+    handle->hasinitial = 1;
 }
 
 void fsm_construct_add_arc(struct fsm_construct_handle *handle, int source, int target, char *in, char *out) {
@@ -304,32 +306,32 @@ void fsm_construct_copy_sigma(struct fsm_construct_handle *handle, struct sigma
     char *symbol, *symdup;
 
     for (; sigma != NULL && sigma->number != -1; sigma = sigma->next) {
-        symnum = sigma->number;
-        if (symnum > handle->maxsigma) {
-            handle->maxsigma = symnum;
-        }
-        symbol = sigma->symbol;
-        if (symnum >= handle->fsm_sigma_list_size) {
-            handle->fsm_sigma_list_size = next_power_of_two(handle->fsm_sigma_list_size);
-            handle->fsm_sigma_list = xxrealloc(handle->fsm_sigma_list, (handle->fsm_sigma_list_size) * sizeof(struct fsm_sigma_list));
-        }
-        /* Insert into list */
-        symdup = xxstrdup(symbol);
-        ((handle->fsm_sigma_list)+symnum)->symbol = symdup;
-        
-        /* Insert into hashtable */
-        hash = fsm_construct_hash_sym(symbol);
-        fh = (handle->fsm_sigma_hash)+hash;   
-        if (fh->symbol == NULL) {
-            fh->symbol = symdup;
-            fh->sym = symnum;        
-        } else {
-            newfh = xxcalloc(1,sizeof(struct fsm_sigma_hash));
-            newfh->next = fh->next;
-            fh->next = newfh;
-            newfh->symbol = symdup;
-            newfh->sym = symnum;
-        }
+	symnum = sigma->number;
+	if (symnum > handle->maxsigma) {
+	    handle->maxsigma = symnum;
+	}
+	symbol = sigma->symbol;
+	if (symnum >= handle->fsm_sigma_list_size) {
+	    handle->fsm_sigma_list_size = next_power_of_two(handle->fsm_sigma_list_size);
+	    handle->fsm_sigma_list = xxrealloc(handle->fsm_sigma_list, (handle->fsm_sigma_list_size) * sizeof(struct fsm_sigma_list));
+	}
+	/* Insert into list */
+	symdup = xxstrdup(symbol);
+	((handle->fsm_sigma_list)+symnum)->symbol = symdup;
+	
+	/* Insert into hashtable */
+	hash = fsm_construct_hash_sym(symbol);
+	fh = (handle->fsm_sigma_hash)+hash;   
+	if (fh->symbol == NULL) {
+	    fh->symbol = symdup;
+	    fh->sym = symnum;        
+	} else {
+	    newfh = xxcalloc(1,sizeof(struct fsm_sigma_hash));
+	    newfh->next = fh->next;
+	    fh->next = newfh;
+	    newfh->symbol = symdup;
+	    newfh->sym = symnum;
+	}
     }
 }
 
@@ -421,20 +423,25 @@ struct sigma *fsm_construct_convert_sigma(struct fsm_construct_handle *handle) {
 }
 
 struct fsm *fsm_construct_done(struct fsm_construct_handle *handle) {
-    int i;
+    int i, emptyfsm;
     struct fsm *net;
     struct fsm_state_list *sl;
     struct fsm_trans_list *trans, *transnext;
     struct fsm_sigma_hash *sigmahash, *sigmahashnext;
 
     sl = handle->fsm_state_list;
-    if (handle->maxstate == -1 || handle->numfinals == 0) {
+    if (handle->maxstate == -1 || handle->numfinals == 0 || handle->hasinitial == 0) {
         return(fsm_empty_set());
     }
     fsm_state_init((handle->maxsigma)+1);
-    for (i=0; i <= handle->maxstate; i++) {
+
+    for (i=0, emptyfsm = 1; i <= handle->maxstate; i++) {
         fsm_state_set_current_state(i, (sl+i)->is_final, (sl+i)->is_initial);
+	if ((sl+i)->is_initial && (sl+i)->is_final)
+	    emptyfsm = 0; /* We want to keep track of if FSM has (a) something outgoing from initial, or (b) initial is final */
         for (trans = (sl+i)->fsm_trans_list; trans != NULL; trans = trans->next) {
+	    if ((sl+i)->is_initial)
+		emptyfsm = 0;
             fsm_state_add_arc(i, trans->in, trans->out, trans->target, (sl+i)->is_final, (sl+i)->is_initial);
         }
         fsm_state_end_state();
@@ -475,6 +482,10 @@ struct fsm *fsm_construct_done(struct fsm_construct_handle *handle) {
     xxfree(handle->fsm_state_list);
     xxfree(handle);
     sigma_sort(net);
+    if (emptyfsm) {
+	fsm_destroy(net);
+	return(fsm_empty_set());
+    }
     return(net);
 }
 
@@ -520,13 +531,13 @@ struct fsm_read_handle *fsm_read_init(struct fsm *net) {
                 num_finals++;
             }
         }
-        if ((fsm+i)->in == UNKNOWN || (fsm+i)->out == UNKNOWN || (fsm+i)->in == IDENTITY || (fsm+i)->out == IDENTITY) {
-            handle->has_unknowns = 1;
-        }
-        if ((fsm+i)->state_no != laststate) {
-            *(states_head+(fsm+i)->state_no) = fsm+i;
-        }
-        laststate = (fsm+i)->state_no;
+	if ((fsm+i)->in == UNKNOWN || (fsm+i)->out == UNKNOWN || (fsm+i)->in == IDENTITY || (fsm+i)->out == IDENTITY) {
+	    handle->has_unknowns = 1;
+	}
+	if ((fsm+i)->state_no != laststate) {
+	    *(states_head+(fsm+i)->state_no) = fsm+i;
+	}
+	laststate = (fsm+i)->state_no;
     }
     
     finals_head = xxcalloc(num_finals+1,sizeof(int));
@@ -560,7 +571,7 @@ struct fsm_read_handle *fsm_read_init(struct fsm *net) {
 
 void fsm_read_reset(struct fsm_read_handle *handle) {
     if (handle == NULL)
-        return;
+	return;
     handle->arcs_cursor = NULL;
     handle->initials_cursor = NULL;
     handle->finals_cursor = NULL;
@@ -570,8 +581,8 @@ void fsm_read_reset(struct fsm_read_handle *handle) {
 int fsm_get_next_state_arc(struct fsm_read_handle *handle) {
     handle->arcs_cursor++;
     if ((handle->arcs_cursor->state_no != handle->current_state) || (handle->arcs_cursor->target == -1)) {
-        handle->arcs_cursor--;
-        return 0;
+	handle->arcs_cursor--;
+	return 0;
     }
     return 1;
 }
@@ -612,11 +623,11 @@ int fsm_get_arc_target(struct fsm_read_handle *handle) {
 int fsm_get_symbol_number(struct fsm_read_handle *handle, char *symbol) {
     int i;
     for (i=0; i < handle->sigma_list_size; i++) {
-        if ((handle->fsm_sigma_list+i)->symbol == NULL)
-            continue;
-        if (strcmp(symbol,  (handle->fsm_sigma_list+i)->symbol) == 0) {
-            return i;
-        }
+	if ((handle->fsm_sigma_list+i)->symbol == NULL)
+	    continue;
+	if (strcmp(symbol,  (handle->fsm_sigma_list+i)->symbol) == 0) {
+	    return i;
+	}
     }
     return -1;
 }
@@ -686,10 +697,10 @@ int fsm_get_next_state(struct fsm_read_handle *handle) {
     if (handle->states_cursor == NULL) {
         handle->states_cursor = handle->states_head;
     } else {
-        handle->states_cursor++;
+	handle->states_cursor++;
     }
     if (handle->states_cursor - handle->states_head >= fsm_get_num_states(handle)) {
-        return -1;
+	return -1;
     }
     handle->arcs_cursor = *(handle->states_cursor);
     stateno = (*(handle->states_cursor))->state_no;
diff --git a/back-ends/foma/flags.c b/back-ends/foma/flags.c
index 1bc6d91..bee7f38 100644
--- a/back-ends/foma/flags.c
+++ b/back-ends/foma/flags.c
@@ -27,7 +27,6 @@
 
 static struct flags *flag_extract (struct fsm *net);
 static char *flag_type_to_char (int type);
-// HFST change: this is visible in fomalib.h: static int flag_build(int ftype, char *fname, char *fvalue, int fftype, char *ffname, char *ffvalue);
 static void flag_purge (struct fsm *net, char *name);
 static struct fsm *flag_create_symbol(int type, char *name, char *value);
 
@@ -78,8 +77,12 @@ struct fsm *flag_eliminate(struct fsm *net, char *name) {
                 found = 1;
         }
         if (found == 0) {
-          //printf("Flag attribute '%s' does not occur in the network.\n",name);
-          return(net);
+#ifdef ORIGINAL
+	    fprintf(stderr,"Flag attribute '%s' does not occur in the network.\n",name);
+#else
+            // TODO: Handle this in some other way.
+#endif
+            return(net);
         }
     }
 
@@ -284,9 +287,9 @@ void flag_purge (struct fsm *net, char *name) {
         }
     }
     for (i = 0; i < sigmasize; i++) {
-        if (*(ftable+i)) {
-            net->sigma = sigma_remove_num(i, net->sigma);
-        }
+	if (*(ftable+i)) {
+	    net->sigma = sigma_remove_num(i, net->sigma);
+	}
     }
 
     for (i=0; (fsm+i)->state_no != -1; i++) {
@@ -367,25 +370,25 @@ int flag_check(char *s) {
 
 int flag_get_type(char *string) {
     if (strncmp(string+1,"U.",2) == 0) {
-        return FLAG_UNIFY;
+	return FLAG_UNIFY;
     }    
     if (strncmp(string+1,"C.",2) == 0) {
-        return FLAG_CLEAR;
+	return FLAG_CLEAR;
     }    
     if (strncmp(string+1,"D.",2) == 0) {
-        return FLAG_DISALLOW;
+	return FLAG_DISALLOW;
     }    
     if (strncmp(string+1,"N.",2) == 0) {
-        return FLAG_NEGATIVE;
+	return FLAG_NEGATIVE;
     }    
     if (strncmp(string+1,"P.",2) == 0) {
-        return FLAG_POSITIVE;
+	return FLAG_POSITIVE;
     }    
     if (strncmp(string+1,"R.",2) == 0) {
-        return FLAG_REQUIRE;
+	return FLAG_REQUIRE;
     }    
     if (strncmp(string+1,"E.",2) == 0) {
-        return FLAG_EQUAL;
+	return FLAG_EQUAL;
     }    
     return 0;
 }
@@ -396,17 +399,17 @@ char *flag_get_name(char *string) {
     len = strlen(string);
 
     for (i=0; i < len; i += (utf8skip(string+i) + 1)) {
-        if (*(string+i) == '.' && start == 0) {
-            start = i+1;
-            continue;
-        }
-        if ((*(string+i) == '.' || *(string+i) == '@')  && start != 0) {
-            end = i;
-            break;
-        }
+	if (*(string+i) == '.' && start == 0) {
+	    start = i+1;
+	    continue;
+	}
+	if ((*(string+i) == '.' || *(string+i) == '@')  && start != 0) {
+	    end = i;
+	    break;
+	}
     }
     if (start > 0 && end > 0) {
-        return(xxstrndup(string+start,end-start));
+	return(xxstrndup(string+start,end-start));
     }
     return NULL;
 }
@@ -417,21 +420,21 @@ char *flag_get_value(char *string) {
     len = strlen(string);
 
     for (i=0; i < len; i += (utf8skip(string+i) + 1)) {
-        if (*(string+i) == '.' && first == 0) {
-            first = i+1;
-            continue;
-        }
-        if (*(string+i) == '@' && start != 0) {
-            end = i;
-            break;
-        }
-        if (*(string+i) == '.' && first != 0) {
-            start = i+1;
-            continue;
-        }
+	if (*(string+i) == '.' && first == 0) {
+	    first = i+1;
+	    continue;
+	}
+	if (*(string+i) == '@' && start != 0) {
+	    end = i;
+	    break;
+	}
+	if (*(string+i) == '.' && first != 0) {
+	    start = i+1;
+	    continue;
+	}
     }
     if (start > 0 && end > 0) {
-        return(xxstrndup(string+start,end-start));
+	return(xxstrndup(string+start,end-start));
     }
     return NULL;
 }
@@ -492,22 +495,22 @@ struct fsm *flag_twosided(struct fsm *net) {
       continue;
     if ((*(isflag+(fsm+i)->in) || *(isflag+(fsm+i)->out)) && (fsm+i)->in != (fsm+i)->out) {
       if (*(isflag+(fsm+i)->in) && !*(isflag+(fsm+i)->out)) {
-        j = add_fsm_arc(fsm, j, maxstate, EPSILON, (fsm+i)->out, (fsm+i)->target, 0, 0);
-        (fsm+i)->out = (fsm+i)->in;
-        (fsm+i)->target = maxstate;
-        maxstate++;
+	j = add_fsm_arc(fsm, j, maxstate, EPSILON, (fsm+i)->out, (fsm+i)->target, 0, 0);
+	(fsm+i)->out = (fsm+i)->in;
+	(fsm+i)->target = maxstate;
+	maxstate++;
       }
       else if (*(isflag+(fsm+i)->out) && !*(isflag+(fsm+i)->in)) {
-        j = add_fsm_arc(fsm, j, maxstate, (fsm+i)->out, (fsm+i)->out, (fsm+i)->target, 0, 0);
-        (fsm+i)->out = EPSILON;
-        (fsm+i)->target = maxstate;
-        maxstate++;
+	j = add_fsm_arc(fsm, j, maxstate, (fsm+i)->out, (fsm+i)->out, (fsm+i)->target, 0, 0);
+	(fsm+i)->out = EPSILON;
+	(fsm+i)->target = maxstate;
+	maxstate++;
       }
       else if (*(isflag+(fsm+i)->in) && *(isflag+(fsm+i)->out)) {
-        j = add_fsm_arc(fsm, j, maxstate, (fsm+i)->out, (fsm+i)->out, (fsm+i)->target, 0, 0);
-        (fsm+i)->out = (fsm+i)->in;
-        (fsm+i)->target = maxstate;
-        maxstate++;
+	j = add_fsm_arc(fsm, j, maxstate, (fsm+i)->out, (fsm+i)->out, (fsm+i)->target, 0, 0);
+	(fsm+i)->out = (fsm+i)->in;
+	(fsm+i)->target = maxstate;
+	maxstate++;
       }
     }
   }
diff --git a/back-ends/foma/foma.c b/back-ends/foma/foma.c
index c4ed6c9..d9b47f4 100644
--- a/back-ends/foma/foma.c
+++ b/back-ends/foma/foma.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2012 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -15,47 +15,43 @@
 /*     You should have received a copy of the GNU General Public License     */
 /*     along with foma.  If not, see <http://www.gnu.org/licenses/>.         */
 
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <time.h>
-
-#ifdef HAVE_READLINE
-#include <readline/readline.h>
-#endif // HAVE_READLINE
-
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
+  #include <readline/readline.h>
+#endif
 #include "foma.h"
 
 /* Front-end behavior variables */
 int pipe_mode = 0;
 int quiet_mode = 0;
-
-#ifdef HAVE_READLINE
-static int use_readline = 1;
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
+  static int use_readline = 1;
 #else
-static int use_readline = 0;
-#endif // HAVE_READLINE
+  static int use_readline = 0;
+#endif
 
 int promptmode = PROMPT_MAIN;
 int apply_direction;
 
 /* Variable to pass the position of rl completion to our completer */
-#ifdef HAVE_READLINE
-static int smatch;
-#endif // HAVE_READLINE
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
+  static int smatch;
+#endif
 
 char *usagestring = "Usage: foma [-e \"command\"] [-f run-once-script] [-l startupscript] [-p] [-q] [-s] [-v]\n";
 
-#ifdef HAVE_READLINE
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
 static char** my_completion(const char*, int ,int);
 char *my_generator(const char* , int);
-char *cmd [] = {"ambiguous upper","apply down","apply med","apply up","apropos","assert-stack","clear stack","compact sigma","complete net","compose net","concatenate net","crossproduct net","define","determinize net","echo","eliminate flags","eliminate flag","export cmatrix","extract ambiguous","extract unambiguous","factorize","help license","help warranty","ignore net","intersect net","invert net","label net","letter machine","load defined","lower-side net","minimize net","name net"," [...]
+char *cmd [] = {"ambiguous upper","apply down","apply med","apply up","apropos","assert-stack","clear stack","close sigma","compact sigma","complete net","compose net","concatenate net","crossproduct net","define","determinize net","echo","eliminate flags","eliminate flag","export cmatrix","extract ambiguous","extract unambiguous","factorize","help license","help warranty","ignore net","intersect net","invert net","label net","letter machine","load defined","lower-side net","minimize net [...]
 
-char *abbrvcmd [] = {"ambiguous","down","up","med","size","loadd","lower-words","upper-words","net","random-lower","random-upper","random-words","regex","rpl","au revoir","bye","exit","saved","seq","ss","stack","tunam","tid","tfu","tlu","tuu","tnu","tnn","tseq","tsf","equ","pss","psz","ratt","tfd","hyvästi","watt","wpl","examb","exunamb",NULL};
-#endif // HAVE_READLINE
+char *abbrvcmd [] = {"ambiguous","close","down","up","med","size","loadd","lower-words","upper-words","net","random-lower","random-upper","words","random-words","regex","rpl","au revoir","bye","exit","saved","seq","ss","stack","tunam","tid","tfu","tlu","tuu","tnu","tnn","tseq","tsf","equ","pss","psz","ratt","tfd","hyvästi","watt","wpl","examb","exunamb","pairs","random-pairs",NULL};
+#endif
 
 /* #include "yy.tab.h" */
 
@@ -66,7 +62,12 @@ extern int add_history (const char *);
 extern int my_yyparse(char *my_string);
 void print_help();
 void xprintf(char *string) { return ; printf("%s",string); }
-char disclaimer[] = "Foma, version 0.9.17alpha\nCopyright © 2008-2012 Mans Hulden\nThis is free software; see the source code for copying conditions.\nThere is ABSOLUTELY NO WARRANTY; for details, type \"help license\"\n\nType \"help\" to list all commands available.\nType \"help <topic>\" or help \"<operator>\" for further help.\n\n";
+char disclaimer1[] = "Foma, version ";
+char disclaimer2[] = "\nCopyright © 2008-2015 Mans Hulden\nThis is free software; see the source code for copying conditions.\nThere is ABSOLUTELY NO WARRANTY; for details, type \"help license\"\n\nType \"help\" to list all commands available.\nType \"help <topic>\" or help \"<operator>\" for further help.\n\n";
+
+#ifndef SVN_REV
+#define SVN_REV 0
+#endif
 
 /* A static variable for holding the line. */
 
@@ -82,24 +83,22 @@ char *rl_gets(char *prompt) {
     
     /* If the buffer has already been allocated,
        return the memory to the free pool. */
-#ifdef HAVE_READLINE
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
     if (use_readline == 1) {
         if (line_read) {
             free(line_read);
             line_read = (char *)NULL;
         }
     }
-
     if (use_readline == 0) {
-#endif // HAVE_READLINE
+#endif
         printf("%s",prompt);
         line_read = fgets(no_readline_line, 511, stdin);
         if (line_read != NULL) {
             strip_newline(line_read);
         }
-#ifdef HAVE_READLINE
-    }
-    else {
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
+    } else {
         line_read = readline(prompt);
     }
     
@@ -107,10 +106,9 @@ char *rl_gets(char *prompt) {
        save it on the history. */
     if (use_readline == 1) {
         if (line_read && *line_read)
-            add_history(line_read);
-        
+            add_history(line_read);        
     }
-#endif // HAVE_READLINE
+#endif
     return (line_read);
 }
 
@@ -122,6 +120,10 @@ int main(int argc, char *argv[]) {
     /*  YY_BUFFER_STATE flex_command; */
     stack_init();
     srand ((unsigned int)time(NULL));
+    /* Init defined_networks structures */
+    g_defines = defined_networks_init();
+    g_defines_f = defined_functions_init();
+
     while ((opt = getopt(argc, argv, "e:f:hl:pqrsv")) != -1) {
         switch(opt) {
         case 'e':
@@ -166,14 +168,12 @@ int main(int argc, char *argv[]) {
     }
 
     if (!pipe_mode && !quiet_mode) 
-        printf("%s",disclaimer);
-
-#ifdef HAVE_READLINE
+      printf("%s%i.%i.%i%s (svn r%i)%s",disclaimer1,MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,STATUS_VERSION,SVN_REV,disclaimer2);
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
     rl_basic_word_break_characters = " >";
 
     rl_attempted_completion_function = my_completion;
-#endif // HAVE_READLINE
-
+#endif
     for(;;) {
         if (promptmode == PROMPT_MAIN)
             sprintf(prompt, "foma[%i]: ",stack_size());
@@ -184,8 +184,10 @@ int main(int argc, char *argv[]) {
         if (promptmode == PROMPT_A && apply_direction == AP_M)
             sprintf(prompt, "apply med> ");
         if (pipe_mode || quiet_mode)
-            prompt[0] = '\0';
+	    prompt[0] = '\0';
 
+	fflush(stdout);
+	
         command = rl_gets(prompt);
 
         if (command == NULL && promptmode == PROMPT_MAIN) {
@@ -216,7 +218,7 @@ void print_help() {
     printf("-v\t\tprint version number\n");
 }
 
-#ifdef HAVE_READLINE
+#if defined(ORIGINAL) || defined(HAVE_READLINE)
 static char **my_completion(const char *text, int start, int end) {
     char **matches;
 
@@ -261,4 +263,4 @@ char *my_generator(const char *text, int state) {
     /* If no names matched, then return NULL. */
     return ((char *)NULL);
 }
-#endif // HAVE_READLINE
+#endif
diff --git a/back-ends/foma/foma.h b/back-ends/foma/foma.h
index 48da06c..b550d2e 100644
--- a/back-ends/foma/foma.h
+++ b/back-ends/foma/foma.h
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2012 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -24,27 +24,9 @@
 #define PROMPT_MAIN 0 /* Regular prompt */
 #define PROMPT_A 1    /* Apply prompt   */
 
-/* Defined networks */
-
-struct defined {
-  char *name;
-  struct fsm *net;
-  struct defined *next;
-};
-
-/* Defined functions */
-
-struct definedf {
-    char *name;
-    char *regex;
-    int numargs;
-    struct definedf *next;
-};
-
-struct defined_quantifiers {
-    char *name;
-    struct defined_quantifiers *next;
-};
+// HFST MODIFICATIONS: Add extern here, define in mem.c
+extern struct defined_networks   *g_defines;
+extern struct defined_functions  *g_defines_f;
 
 /** User stack */
 struct stack_entry {
@@ -56,15 +38,6 @@ struct stack_entry {
   struct stack_entry *previous;    
 };
 
-/* Define functions */
-struct fsm *find_defined (char *string);
-char *find_defined_function(char *name, int numargs);
-int add_defined (struct fsm *net, char *string);
-int add_defined_function (char *name, char *regex, int numargs);
-int remove_defined (char *string);
-struct defined *get_defines();
-struct definedf *get_defines_f();
-
 /* Quantifier & Logic-related */
 char *find_quantifier(char *string);
 void add_quantifier (char *string);
@@ -97,6 +70,7 @@ void iface_apply_med(char *word);
 void iface_apply_set_params(struct apply_handle *h);
 void iface_apply_up(char *word);
 void iface_apropos(char *s);
+void iface_close(void);
 void iface_compact(void);
 void iface_complete(void);
 void iface_compose(void);
@@ -138,6 +112,9 @@ void iface_apply_random(char *(*applyer)(), int limit);
 void iface_random_lower(int limit);
 void iface_random_upper(int limit);
 void iface_random_words(int limit);
+void iface_pairs(int limit);
+void iface_pairs_file(char *filename);
+void iface_random_pairs(int limit);
 void iface_print_sigma(void);
 void iface_print_stats(void);
 void iface_shuffle(void);
diff --git a/back-ends/foma/fomalib.h b/back-ends/foma/fomalib.h
index c4871c3..673ad31 100644
--- a/back-ends/foma/fomalib.h
+++ b/back-ends/foma/fomalib.h
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2013 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -21,23 +21,32 @@ extern "C" {
 #include <stdio.h>
 #include <inttypes.h>
 #include <string.h>
-
-#ifdef ZLIB
-#include <zlib.h>
-#endif
-
-#ifdef _MSC_VER
-  #define FEXPORT __declspec(dllexport)
-  #define INLINE 
-#else
-  #define FEXPORT __attribute__((visibility("default")))
-  #define INLINE inline
-#endif
+#ifdef ORIGINAL
+#include "zlib.h"
+#else // #ifdef ORIGINAL
+  #ifdef ZLIB
+    #include "zlib.h"
+  #endif
+#endif // #ifdef ORIGINAL
+
+#ifdef ORIGINAL
+#define INLINE inline
+
+#define FEXPORT __attribute__((visibility("default")))
+#else // #ifdef ORIGINAL
+  #ifdef _MSC_VER
+    #define FEXPORT __declspec(dllexport)
+    #define INLINE
+  #else
+    #define INLINE inline
+    #define FEXPORT __attribute__((visibility("default")))
+  #endif
+#endif // #ifdef ORIGINAL
 
 /* Library version */
 #define MAJOR_VERSION 0
 #define MINOR_VERSION 9
-#define BUILD_VERSION 17
+#define BUILD_VERSION 18
 #define STATUS_VERSION "alpha"
 
 /* Special symbols on arcs */
@@ -88,6 +97,26 @@ extern "C" {
 #define APPLY_INDEX_INPUT 1
 #define APPLY_INDEX_OUTPUT 2
 
+/* Defined networks */
+struct defined_networks {
+  char *name;
+  struct fsm *net;
+  struct defined_networks *next;
+};
+
+/* Defined functions */
+struct defined_functions {
+    char *name;
+    char *regex;
+    int numargs;
+    struct defined_functions *next;
+};
+
+struct defined_quantifiers {
+    char *name;
+    struct defined_quantifiers *next;
+};
+
 /* Automaton structures */
 
 /** Main automaton structure */
@@ -166,6 +195,15 @@ struct sigma {
 
 #include "fomalibconf.h"
 
+/* Define functions */
+FEXPORT struct defined_networks *defined_networks_init(void);
+FEXPORT struct defined_functions *defined_functions_init(void);
+struct fsm *find_defined(struct defined_networks *def, char *string);
+char *find_defined_function(struct defined_functions *deff, char *name, int numargs);
+FEXPORT int add_defined(struct defined_networks *def, struct fsm *net, char *string);
+int add_defined_function (struct defined_functions *deff, char *name, char *regex, int numargs);
+int remove_defined (struct defined_networks *def, char *string);
+
 /********************/
 /* Basic operations */
 /********************/
@@ -182,7 +220,8 @@ FEXPORT void fsm_sort_arcs(struct fsm *net, int direction);
 FEXPORT struct fsm *fsm_mark_ambiguous(struct fsm *net);
 FEXPORT struct fsm *fsm_sequentialize(struct fsm *net);
 FEXPORT struct fsm *fsm_bimachine(struct fsm *net);
-FEXPORT struct fsm *fsm_parse_regex(char *regex);
+
+FEXPORT struct fsm *fsm_parse_regex(char *regex, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 FEXPORT struct fsm *fsm_reverse(struct fsm *net);
 FEXPORT struct fsm *fsm_invert(struct fsm *net);
 FEXPORT struct fsm *fsm_lower(struct fsm *net);
@@ -245,13 +284,13 @@ FEXPORT struct fsm *fsm_mark_fsm_tail(struct fsm *net, struct fsm *marker);
 FEXPORT struct fsm *fsm_add_loop(struct fsm *net, struct fsm *marker, int finals);
 FEXPORT struct fsm *fsm_add_sink(struct fsm *net, int final);
 FEXPORT struct fsm *fsm_left_rewr(struct fsm *net, struct fsm *rewr);
-
 FEXPORT struct fsm *fsm_flatten(struct fsm *net, struct fsm *epsilon);
+FEXPORT struct fsm *fsm_close_sigma(struct fsm *net, int mode);
+FEXPORT char *fsm_network_to_char(struct fsm *net);
 
 /* Remove those symbols from sigma that have the same distribution as IDENTITY */
 FEXPORT void fsm_compact(struct fsm *net);
 
-/* HFST addition: function made visible. */
 FEXPORT int flag_build(int ftype, char *fname, char *fvalue, int fftype, char *ffname, char *ffvalue);
 
 /* Eliminate flag diacritics and return equivalent FSM          */
@@ -271,6 +310,7 @@ FEXPORT int fsm_isunambiguous(struct fsm *net);
 FEXPORT int fsm_isidentity(struct fsm *net);
 FEXPORT int fsm_isuniversal(struct fsm *net);
 FEXPORT int fsm_issequential(struct fsm *net);
+FEXPORT int fsm_equivalent(struct fsm *net1, struct fsm *net2);
 
 /* Test if a symbol occurs in a FSM */
 /* side = M_UPPER (upper side) M_LOWER (lower side), M_UPPER+M_LOWER (both) */
@@ -293,7 +333,6 @@ FEXPORT int fsm_sigma_destroy(struct sigma *sigma);
 /* Frees a FSM, associated data such as alphabet and confusion matrix */
 FEXPORT int fsm_destroy(struct fsm *net);
 
-
 /* IO functions */
 FEXPORT struct fsm *read_att(char *filename);
 FEXPORT int net_print_att(struct fsm *net, FILE *outfile);
@@ -305,14 +344,17 @@ FEXPORT fsm_read_binary_handle fsm_read_binary_file_multiple_init(char *filename
 FEXPORT struct fsm *fsm_read_text_file(char *filename);
 FEXPORT struct fsm *fsm_read_spaced_text_file(char *filename);
 FEXPORT int fsm_write_binary_file(struct fsm *net, char *filename);
-FEXPORT int load_defined(char *filename);
-FEXPORT int save_defined();
+FEXPORT int load_defined(struct defined_networks *def, char *filename);
+FEXPORT int save_defined(struct defined_networks *def, char *filename);
 FEXPORT int save_stack_att();
-  // write_prolog changed to foma_write_prolog because it conflicts with an xfsm function
 FEXPORT int foma_write_prolog(struct fsm *net, char *filename);
-#ifdef ZLIB // HFST addition
-  FEXPORT int foma_net_print(struct fsm *net, gzFile *outfile);
-#endif
+#ifdef ORIGINAL
+FEXPORT int foma_net_print(struct fsm *net, gzFile outfile);
+#else // #ifdef ORIGINAL
+  #ifdef ZLIB
+    FEXPORT int foma_net_print(struct fsm *net, gzFile outfile);
+  #endif
+#endif // #ifdef ORIGINAL
 
 /* Lookups */
 
@@ -347,7 +389,10 @@ FEXPORT void apply_set_show_flags(struct apply_handle *h, int value);
 FEXPORT void apply_set_obey_flags(struct apply_handle *h, int value);
 FEXPORT void apply_set_print_space(struct apply_handle *h, int value);
 FEXPORT void apply_set_print_pairs(struct apply_handle *h, int value);
-
+FEXPORT void apply_set_space_symbol(struct apply_handle *h, char *space);
+FEXPORT void apply_set_separator(struct apply_handle *h, char *symbol);
+FEXPORT void apply_set_epsilon(struct apply_handle *h, char *symbol);
+    
 /* Minimum edit distance & spelling correction */
 FEXPORT void fsm_create_letter_lookup(struct apply_med_handle *medh, struct fsm *net);
 FEXPORT void cmatrix_init(struct fsm *net);
@@ -358,7 +403,7 @@ FEXPORT void cmatrix_set_cost(struct fsm *net, char *in, char *out, int cost);
 FEXPORT void cmatrix_print(struct fsm *net);
 FEXPORT void cmatrix_print_att(struct fsm *net, FILE *outfile);
 
-/* Lexc. Verbose parameters added in HFST. */
+/* Lexc */
   FEXPORT struct fsm *fsm_lexc_parse_file(char *myfile, int verbose);
   FEXPORT struct fsm *fsm_lexc_parse_string(char *mystring, int verbose);
 
@@ -376,13 +421,6 @@ FEXPORT int fsm_construct_check_symbol(struct fsm_construct_handle *handle, char
 FEXPORT void fsm_construct_copy_sigma(struct fsm_construct_handle *handle, struct sigma *sigma);
 FEXPORT struct fsm *fsm_construct_done(struct fsm_construct_handle *handle);
 
-#ifndef __cplusplus
-#ifndef bool
-  #define bool int
-  #define false((bool)0)
-  #define true((bool)1)
-#endif
-#endif
 
 /******************/
 /* String hashing */
@@ -410,6 +448,17 @@ int sh_get_value(struct sh_handle *sh);
 /* Trie construction */
 /*********************/
 
+#ifndef ORIGINAL
+  #ifndef __cplusplus
+  #ifndef bool
+    #define bool int
+    #define false((bool)0)
+    #define true((bool)1)
+    #define _Bool bool
+  #endif
+  #endif
+#endif // #ifndef ORIGINAL
+
 struct trie_hash {
     char *insym;
     char *outsym;
@@ -433,7 +482,6 @@ struct fsm_trie_handle {
 
 FEXPORT struct fsm_trie_handle *fsm_trie_init();
 FEXPORT struct fsm *fsm_trie_done(struct fsm_trie_handle *th);
-FEXPORT void fsm_trie_new_word(struct fsm_trie_handle *th);
 FEXPORT void fsm_trie_add_word(struct fsm_trie_handle *th, char *word);
 FEXPORT void fsm_trie_end_word(struct fsm_trie_handle *th);
 FEXPORT void fsm_trie_symbol(struct fsm_trie_handle *th, char *insym, char *outsym);
diff --git a/back-ends/foma/fomalibconf.h b/back-ends/foma/fomalibconf.h
index e6d1d39..9dd33f7 100644
--- a/back-ends/foma/fomalibconf.h
+++ b/back-ends/foma/fomalibconf.h
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2012 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -15,16 +15,6 @@
 /*     You should have received a copy of the GNU General Public License     */
 /*     along with foma.  If not, see <http://www.gnu.org/licenses/>.         */
 
-#ifndef __cplusplus
-#ifndef bool
-  #define bool int
-  #define false ((bool)0)
-  #define true  ((bool)1)
-#endif
-#endif
-
-#define _Bool bool
-
 struct state_array {
     struct fsm_state *transitions;
 };
@@ -36,6 +26,17 @@ struct fsm_trans_list {
     struct fsm_trans_list *next;
 };
 
+#ifndef ORIGINAL
+  #ifndef __cplusplus
+    #ifndef bool
+      #define bool int
+      #define false ((bool)0)
+      #define true  ((bool)1)
+    #endif
+  #endif
+#define _Bool bool
+#endif // #ifndef ORIGINAL
+
 struct fsm_state_list {
     _Bool used;
     _Bool is_final;
@@ -67,6 +68,7 @@ struct fsm_construct_handle {
     int maxstate;
     int maxsigma;
     int numfinals;
+    int hasinitial;
     char *name;
 };
 
@@ -157,6 +159,9 @@ struct apply_handle {
     int obey_flags;
     int show_flags;
     int print_space;
+    char *space_symbol;
+    char *separator;
+    char *epsilon_symbol;
     int print_pairs;
     int apply_stack_ptr;
     int apply_stack_top; 
@@ -285,6 +290,7 @@ void xprintf(char *string);
 
 /* UTF8 */
 unsigned char *utf8code16tostr(char *str);
+int utf8iscombining(unsigned char *s);
 int utf8skip(char *str);
 int utf8strlen(char *str);
 int ishexstr(char *str);
@@ -292,6 +298,7 @@ void decode_quoted(char *s);
 void dequote_string(char *s);
 char *remove_trailing(char *s, char c);
 char *escape_string(char *string, char chr);
+char *xstrrev(char *str);
 
 /* Flag-related */
 int flag_check(char *sm);
diff --git a/back-ends/foma/iface.c b/back-ends/foma/iface.c
index 904c7a0..caed6df 100644
--- a/back-ends/foma/iface.c
+++ b/back-ends/foma/iface.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2012 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -24,9 +24,13 @@
 #include <ctype.h>
 
 #include "foma.h"
-#ifdef ZLIB
+#ifdef ORIGINAL
 #include "zlib.h"
-#endif
+#else // #ifdef ORIGINAL
+  #ifdef ZLIB
+    #include "zlib.h"
+  #endif
+#endif // #ifdef ORIGINAL 
 
 extern int g_show_flags;
 extern int g_obey_flags;
@@ -47,11 +51,19 @@ extern int g_list_random_limit;
 extern int g_compose_tristate;
 extern int g_med_limit ;
 extern int g_med_cutoff ;
+extern int g_lexc_align ;
 extern char *g_att_epsilon;
 
-#ifdef ZLIB
-extern int foma_net_print(struct fsm *net, gzFile *outfile);
-#endif
+extern struct defined_networks   *g_defines;
+extern struct defined_functions  *g_defines_f;
+
+#ifdef ORIGINAL
+extern int foma_net_print(struct fsm *net, gzFile outfile);
+#else // #ifdef ORIGINAL
+  #ifdef ZLIB
+    extern int foma_net_print(struct fsm *net, gzFile outfile);
+  #endif
+#endif // #ifdef ORIGINAL
 
 static char *sigptr(struct sigma *sigma, int number);
 static int print_dot(struct fsm *net, char *filename);
@@ -87,6 +99,7 @@ struct g_v {
     {&g_compose_tristate, "compose-tristate", FVAR_BOOL},
     {&g_med_limit,        "med-limit",        FVAR_INT},
     {&g_med_cutoff,       "med-cutoff",       FVAR_INT},
+    {&g_lexc_align,       "lexc-align",       FVAR_BOOL},
     {&g_att_epsilon,      "att-epsilon",      FVAR_STRING},
     {NULL, NULL, 0}
 };
@@ -108,6 +121,7 @@ struct global_help {
     {"apply med","enter apply med mode (Ctrl-D exits)","Short form: med\n"},
     {"apropos <string>","search help for <string>",""},
     {"clear stack","clears the stack",""},
+    {"close sigma","removes unknown symbols from FSM","" },
     {"compact sigma","removes redundant symbols from FSM","" },
     {"complete net","completes the FSM","" },
     {"compose net","composes networks on stack",""},
@@ -144,9 +158,12 @@ struct global_help {
     {"print lower-words > filename","prints words on the lower side of top FSM to file",""},
     {"print name","prints the name of the top FSM","" },
     {"print net","prints all information about top FSM","Short form: net\n" },
+    {"print pairs","prints input-output pairs from top FSM","Short form: pairs\n"},
+    {"print pairs > filename","prints input-output pairs from top FSM to file","Short form: pairs\n"},
     {"print random-lower","prints random words from lower side","Short form: random-lower\n" },
     {"print random-upper","prints random words from upper side","Short form: random-upper" },
     {"print random-words","prints random words from top FSM","Short form: random-words\n"},
+    {"print random-pairs","prints random input-output pairs from top FSM","Short form: random-pairs\n"},
     {"print sigma","prints the alphabet of the top FSM","Short form: sigma\n"},
     {"print size","prints size information about top FSM","Short form: size\n"},
     {"print shortest-string","prints the shortest string of the top FSM","Short form: pss\n"},
@@ -154,7 +171,7 @@ struct global_help {
     {"print upper-words","prints words on the upper side of top FSM","Short form: upper-words"},
     {"print upper-words > filename","prints words on the upper side of top FSM to file","Short form:upper-words"},
     {"print words","prints words of top FSM","Short form: words"},
-    {"print words > filename","prints words of top FSM to file","Short form: words"},
+    {"print words > filename","prints words of top FSM to file","Short form: words"},    
     {"prune net","makes top network coaccessible",""},
     {"push (defined) <name>","adds a defined FSM to top of stack",""},
     {"quit","exit foma",""},
@@ -210,6 +227,7 @@ struct global_help {
     {"variable med-limit","the limit on number of matches in apply med","Default value: 3\n"},
     {"variable med-cutoff","the cost limit for terminating a search in apply med","Default value: 3\n"},
     {"variable att-epsilon","the EPSILON symbol when reading/writing AT&T files","Default value: @0@\n"},
+    {"variable lexc-align","Forces X:0 X:X or 0:X alignment of lexicon entry symbols","Default value: OFF\n"},
     {"write prolog (> filename)","writes top network to prolog format file/stdout","Short form: wpl"},
     {"write att (> <filename>)","writes top network to AT&T format file/stdout","Short form: watt"},
     {"re operator: (∀<var name>)(F)","universal quantification","Example: $.A is equivalent to:\n(∃x)(x ∈ A ∧ (∀y)(¬(y ∈ A ∧ ¬(x = y))))"},
@@ -485,6 +503,12 @@ void iface_apply_up(char *word) {
     }
 }
 
+void iface_close() {
+    if (iface_stack_check(1)) {
+      stack_add(fsm_topsort(fsm_minimize(fsm_close_sigma(stack_pop(),0))));
+    }
+}
+
 void iface_compact() {
     if (iface_stack_check(1)) {
         fsm_compact(stack_find_top()->fsm); 
@@ -603,7 +627,7 @@ void iface_letter_machine() {
 }
 
 void iface_load_defined(char *filename) {
-    load_defined(filename);
+    load_defined(g_defines, filename);
 }
 
 void iface_load_stack(char *filename) {
@@ -693,7 +717,7 @@ void iface_print_dot(char *filename) {
 void iface_print_net(char *netname, char *filename) {
     struct fsm *net;
     if (netname != NULL) {
-        if ((net = find_defined(netname)) == NULL) {
+        if ((net = find_defined(g_defines, netname)) == NULL) {
             printf("No defined network %s.\n", netname);
             return;
         }
@@ -732,18 +756,22 @@ void iface_print_cmatrix() {
 }
 
 void iface_print_defined() {
-    struct defined  *defined;
-    struct definedf *defined_f;
-    if (get_defines() == NULL) {
+    struct defined_networks  *defined;
+    struct defined_functions *defined_f;
+    if (g_defines == NULL) {
         printf("No defined symbols.\n");
     }
-    for (defined = get_defines(); defined != NULL; defined = defined->next) {
-        printf("%s\t",defined->name);
-        print_stats(defined->net);
+    for (defined = g_defines; defined != NULL; defined = defined->next) {
+	if (defined->name != NULL) {
+	    printf("%s\t",defined->name);
+	    print_stats(defined->net);
+	}
     }
-    for (defined_f = get_defines_f(); defined_f != NULL; defined_f = defined_f->next) {
-        printf("%s@%i)\t",defined_f->name,defined_f->numargs);
-        printf("%s\n",defined_f->regex);
+    for (defined_f = g_defines_f; defined_f != NULL; defined_f = defined_f->next) {
+	if (defined_f->name != NULL) {
+		printf("%s@%i)\t",defined_f->name,defined_f->numargs);
+		printf("%s\n",defined_f->regex);
+	}
     }
 }
 
@@ -754,7 +782,7 @@ void iface_print_name() {
 
 void iface_quit() {
     struct fsm *net;
-    remove_defined(NULL);
+    remove_defined(g_defines, NULL);
     while (!(stack_isempty())) {
         net = stack_pop();
         fsm_destroy(net);
@@ -953,13 +981,13 @@ void iface_substitute_defined (char *original, char *substitute) {
     if (iface_stack_check(1)) {
         dequote_string(original);
         dequote_string(substitute);
-	if ((subnet = find_defined(substitute)) == NULL) {
+	if ((subnet = find_defined(g_defines, substitute)) == NULL) {
 	    printf("No defined network '%s'.\n",substitute);
 	} else {
-	    newnet = fsm_substitute_label(stack_find_top()->fsm, original, subnet);
-	    if (newnet == NULL) {
+	    if (fsm_symbol_occurs(stack_find_top()->fsm, original, M_UPPER + M_LOWER) == 0) {
 		printf("Symbol '%s' does not occur.\n", original);
 	    } else {
+		newnet = fsm_substitute_label(stack_find_top()->fsm, original, subnet);
 		stack_pop();
 		printf("Substituted network '%s' for '%s'.\n", substitute, original);
 		stack_add(fsm_topsort(fsm_minimize(newnet)));
@@ -999,11 +1027,12 @@ void iface_rotate() {
         stack_rotate();
 }
 void iface_save_defined(char *filename) {
-    save_defined(filename);
+    save_defined(g_defines, filename);
 }
 
+#if defined(ORIGINAL) || defined(ZLIB) 
 void iface_save_stack(char *filename) {
-    gzFile *outfile;
+    gzFile outfile;
     struct stack_entry *stack_ptr;
 
     if (iface_stack_check(1)) {
@@ -1013,14 +1042,16 @@ void iface_save_stack(char *filename) {
         }
         printf("Writing to file %s.\n", filename);
         for (stack_ptr = stack_find_bottom(); stack_ptr->next != NULL; stack_ptr = stack_ptr->next) {
-#ifdef ZLIB
           foma_net_print(stack_ptr->fsm, outfile);
-#endif
         }
         gzclose(outfile);
         return;
     }
 }
+#else
+void iface_save_stack(char *filename) {
+  fprintf(stderr, "IFACE_C_ERROR\n"); exit(1); }
+#endif
 
 void iface_show_variables() {
     int i;
@@ -1119,11 +1150,19 @@ void iface_sort() {
 
 
 void iface_test_equivalent() {
-    struct fsm *one, *two;
+  struct fsm *one, *two;
     if (iface_stack_check(2)) {
         one = fsm_copy(stack_find_top()->fsm);
         two = fsm_copy(stack_find_second()->fsm);
-        iface_print_bool(fsm_isempty(fsm_union(fsm_minus(fsm_copy(one),fsm_copy(two)),fsm_minus(fsm_copy(two),fsm_copy(one)))));
+	fsm_count(one);
+	fsm_count(two);
+	
+	//if (one->arccount != two->arccount || one->statecount != two->statecount || one->finalcount != two->finalcount) {
+	//iface_print_bool(0);
+	    //} else {
+	    iface_print_bool(fsm_equivalent(one, two));
+	    //iface_print_bool(fsm_isempty(fsm_union(fsm_minus(fsm_copy(one),fsm_copy(two)),fsm_minus(fsm_copy(two),fsm_copy(one)))));
+	    //}
     }
 }
 
@@ -1247,6 +1286,131 @@ void iface_words(int limit) {
     }
 }
 
+/* Splits string of upper:lower pairs with space separator into two strings */
+/* e.g. a:b c:d e 0:g => ace,bdeg  */
+
+void iface_split_string(char *result, char *string) {
+    int i;
+    char space = '\001', epsilon = '\002', separator = '\003';
+    /* Simulate: SEPARATOR \SPACE+ @-> 0 .o. SPACE|SEPARATOR|EPSILON -> 0 */
+    /*           to extract only upper side of string                     */
+    for (i = 0 ; ; ) {
+    zero:
+	if (result[i] == '\0') {
+	    break;
+	} else if (result[i] == space || result[i] == epsilon) {
+	    i++;
+	    goto zero;
+	} else if (result[i] == separator) {
+	    i++;
+	    goto one;
+	} else {
+	    strncat(string, result+i, 1);
+	    i++;
+	    goto zero;
+	}
+    one:
+	if (result[i] == '\0') {
+	    break;
+	} else if (result[i] == space) {
+	    i++;
+	    goto zero;
+	} else {
+	    i++;
+	    goto one;
+	}
+    }
+}
+
+void iface_split_result(char *result, char **upper, char **lower) {
+    *upper = calloc(strlen(result), sizeof(char));
+    *lower = calloc(strlen(result), sizeof(char));
+    /* Split string into upper by filtering input side */
+    /* and lower by the same filter, but reversed      */
+    iface_split_string(result, *upper);
+    xstrrev(result);
+    iface_split_string(result, *lower);
+    xstrrev(*lower);
+    xstrrev(result);
+}
+
+
+void iface_pairs_call(int limit, int random) {
+    char *result, *upper, *lower;
+    struct apply_handle *ah;
+    int i;
+    limit = (limit == -1) ? g_list_limit : limit;
+    if (iface_stack_check(1)) {
+        ah = stack_get_ah();
+	apply_set_show_flags(ah, g_show_flags);
+	apply_set_obey_flags(ah, g_obey_flags);	
+	apply_set_space_symbol(ah, "\001");
+	apply_set_epsilon(ah, "\002");
+	apply_set_separator(ah, "\003");
+        for (i = limit; i > 0; i--) {
+	    if (random == 1)		
+		result = apply_random_words(ah);
+	    else
+		result = apply_words(ah);		
+            if (result == NULL)
+                break;
+	    iface_split_result(result, &upper, &lower);
+            printf("%s\t%s\n",upper, lower);
+	    xxfree(upper);
+	    xxfree(lower);
+        }
+	apply_set_space_symbol(ah, " ");
+	apply_set_epsilon(ah, "0");
+	apply_set_separator(ah, ":");	
+        apply_reset_enumerator(ah);
+    }
+}
+
+void iface_random_pairs(int limit) {
+    iface_pairs_call(limit, 1);
+}
+
+void iface_pairs(int limit) {
+    iface_pairs_call(limit, 0);
+}
+
+void iface_pairs_file(char *filename) {
+    FILE *outfile;
+    char *result, *upper, *lower;
+    struct apply_handle *ah;
+    if (iface_stack_check(1)) {
+	if (stack_find_top()->fsm->pathcount == PATHCOUNT_CYCLIC) {
+	    printf("FSM is cyclic: can't write all pairs to file.\n");
+	    return;
+	}
+	printf("Writing to %s.\n",filename);
+	if ((outfile = fopen(filename, "w")) == NULL) {
+	    perror("Error opening file");
+	    return;
+	}
+	ah = stack_get_ah();
+	apply_set_show_flags(ah, g_show_flags);
+	apply_set_obey_flags(ah, g_obey_flags);	
+	apply_set_space_symbol(ah, "\001");
+	apply_set_epsilon(ah, "\002");
+	apply_set_separator(ah, "\003");
+        for (;;) {
+	    result = apply_words(ah);		
+            if (result == NULL)
+                break;
+	    iface_split_result(result, &upper, &lower);
+	    fprintf(outfile, "%s\t%s\n", upper, lower);
+	    xxfree(upper);
+	    xxfree(lower);
+        }
+	apply_set_space_symbol(ah, " ");
+	apply_set_epsilon(ah, "0");
+	apply_set_separator(ah, ":");	
+        apply_reset_enumerator(ah);
+	fclose(outfile);
+    }
+}
+
 int iface_write_att(char *filename) {
     FILE    *outfile;
     struct fsm *net;
@@ -1410,11 +1574,12 @@ void print_mem_size(struct fsm *net) {
     } else if (s >= 1024 && s < 1048576) {
         sprintf(size, "%.1f kB. ", sf/1024);
     } else if (s >= 1048576 && s < 1073741824) {
-        sprintf(size, "%.1f MB. ", sf/1048576);        
+        sprintf(size, "%.1f MB. ", sf/1048576);
     } else if (s >= 1073741824) {
         sprintf(size, "%.1f GB. ", sf/1073741824);        
     }
-    printf("%s", size);
+    fprintf(stdout, "%s", size);
+    fflush(stdout);
 }
 
 int print_stats(struct fsm *net) {
@@ -1461,7 +1626,6 @@ static int print_dot(struct fsm *net, char *filename) {
     int i, j, linelen;
     short *finals, *printed;
     
-    stateptr = net->states;
     fsm_count(net);
     
     finals = xxmalloc(sizeof(short)*net->statecount);
diff --git a/back-ends/foma/io.c b/back-ends/foma/io.c
index e5d5d59..9b50b69 100644
--- a/back-ends/foma/io.c
+++ b/back-ends/foma/io.c
@@ -1,11 +1,11 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
 /*     Foma is free software: you can redistribute it and/or modify          */
 /*     it under the terms of the GNU General Public License version 2 as     */
-/*     published by the Free Software Foundation. */
+/*     published by the Free Software Foundation.                            */
 
 /*     Foma is distributed in the hope that it will be useful,               */
 /*     but WITHOUT ANY WARRANTY; without even the implied warranty of        */
@@ -20,10 +20,12 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include "foma.h"
-#ifdef ZLIB
-  #include "zlib.h"
+#ifdef ORIGINAL
+#include "zlib.h"
 #else
-
+  #ifdef ZLIB
+    #include "zlib.h"
+  #endif
 #endif
 
 #define TYPE_TRANSITION 1
@@ -48,85 +50,93 @@ struct binaryline {
 
 extern char *g_att_epsilon;
 
+extern struct defined_networks   *g_defines;
+extern struct defined_functions  *g_defines_f;
+
 struct io_buf_handle {
     char *io_buf;
     char *io_buf_ptr;
 };
 
+#ifdef ORIGINAL
 struct io_buf_handle *io_init();
 void io_free(struct io_buf_handle *iobh);
-#ifdef ZLIB // HFST addition
-  static int io_gets(struct io_buf_handle *iobh, char *target);
-  static size_t io_get_gz_file_size(char *filename);
-  static size_t io_get_file_size(char *filename);
-  static size_t io_get_regular_file_size(char *filename);
-#endif
+static int io_gets(struct io_buf_handle *iobh, char *target);
+static size_t io_get_gz_file_size(char *filename);
+static size_t io_get_file_size(char *filename);
+static size_t io_get_regular_file_size(char *filename);
 size_t io_gz_file_to_mem (struct io_buf_handle *iobh, char *filename);
-#ifdef ZLIB // HFST addition
-  int foma_net_print(struct fsm *net, gzFile *outfile);
-#endif
+int foma_net_print(struct fsm *net, gzFile outfile);
 struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name);
-#ifdef ZLIB // HFST addition
-  static inline int explode_line (char *buf, int *values);
-#endif
-
-// HFST addition; dummy implementations for non-static io functions 
-// that might be called outside io.c.
-#ifndef ZLIB
-static void io_error() { 
-  fprintf(stderr, "ERROR: functions in io.c omitted on Windows."); 
-  exit(1); }
-struct io_buf_handle *io_init() { 
-  io_error(); return NULL; }
-void io_free(struct io_buf_handle *iobh) { 
-  io_error(); return; }
-size_t io_gz_file_to_mem (struct io_buf_handle *iobh, char *filename) { 
-  io_error(); return 0; }
-struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name) { 
-  io_error(); return NULL; }
-struct fsm *fsm_read_binary_file(char *filename) {
-  io_error(); return NULL; }
-struct fsm *fsm_read_binary_file_multiple(fsm_read_binary_handle fsrh) {
-  io_error(); return NULL; }
-fsm_read_binary_handle fsm_read_binary_file_multiple_init(char *filename) {
-  io_error(); return NULL; }
-struct fsm *read_att(char *filename) {
-  io_error(); return NULL; }
-struct fsm *fsm_read_prolog(char *filename) {
-  io_error(); return NULL; }
-int load_defined(char *filename) {
-  io_error(); return 0; }
-int save_defined(char *filename) {
-  io_error(); return 0; }
-// write_prolog changed to foma_write_prolog because it conflicts with an xfsm function
-int foma_write_prolog(struct fsm *net, char *filename) {
-  io_error(); return 0; }
-#else
-
-// HFST addition
-#if defined (_MSC_VER) || (__MINGW32__)
-#define LONG_LONG_SPECIFIER "%I64d"
-#else
-#define LONG_LONG_SPECIFIER "%lld"
-#endif
-
+static INLINE int explode_line (char *buf, int *values);
+#else // #ifdef ORIGINAL
+  struct io_buf_handle *io_init();
+  void io_free(struct io_buf_handle *iobh);
+  #ifdef ZLIB
+    static int io_gets(struct io_buf_handle *iobh, char *target);
+    static size_t io_get_gz_file_size(char *filename);
+    static size_t io_get_file_size(char *filename);
+    static size_t io_get_regular_file_size(char *filename);
+  #endif // ZLIB
+  size_t io_gz_file_to_mem (struct io_buf_handle *iobh, char *filename);
+  #ifdef ZLIB
+    int foma_net_print(struct fsm *net, gzFile outfile);
+  #endif // ZLIB
+  struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name);
+  #ifdef ZLIB
+    static INLINE int explode_line (char *buf, int *values);
+  #endif
+#endif // #ifdef ORIGINAL
+
+#ifndef ORIGINAL
+  #if defined (_MSC_VER) || (__MINGW32__)
+    #define LONG_LONG_SPECIFIER "%I64d"
+  #else
+    #define LONG_LONG_SPECIFIER "%lld"
+  #endif
+#endif // #ifndef ORIGINAL
+
+#ifndef ORIGINAL
+// HFST addition. Dummy implementations for non static io functions
+// that could be called outside io.c when ZLIB is not defined.
+  #ifndef ZLIB
+    static void io_error() { fprintf(stderr, "IO_C_ERROR\n"); exit(1); }
+    struct io_buf_handle *io_init() {  io_error(); return NULL; }
+    void io_free(struct io_buf_handle *iobh) { io_error(); return; }
+    size_t io_gz_file_to_mem (struct io_buf_handle *iobh, char *filename) {
+      io_error(); return 0; }
+    struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name) {
+      io_error(); return NULL; }
+    struct fsm *fsm_read_binary_file(char *filename) { io_error(); return NULL; }
+    struct fsm *fsm_read_binary_file_multiple(fsm_read_binary_handle fsrh) {
+      io_error(); return NULL; }
+    fsm_read_binary_handle fsm_read_binary_file_multiple_init(char *filename) {
+      io_error(); return NULL; }
+    struct fsm *read_att(char *filename) { io_error(); return NULL; }
+    struct fsm *fsm_read_prolog(char *filename) { io_error(); return NULL; }
+    int load_defined(struct defined_networks *def, char *filename) { io_error(); return 0; }
+    int save_defined(struct defined_networks *def, char *filename) { io_error(); return 0; }
+    int foma_write_prolog(struct fsm *net, char *filename) { io_error(); return 0; }
+  #endif // #ifndef ZLIB
+#endif // #ifndef ORIGINAL
+
+#if defined(ORIGINAL) || defined(ZLIB)
 void escape_print(FILE *stream, char* string) {
     int i;
     if (strchr(string, '"') != NULL) {
-        for (i = 0; *(string+i) != '\0'; i++) {
-            if (*(string+i) == '"') {
-                fprintf(stream, "\\\""); 
-            } else {
-                fputc(*(string+i), stream);
-            }
-        }
+	for (i = 0; *(string+i) != '\0'; i++) {
+	    if (*(string+i) == '"') {
+		fprintf(stream, "\\\""); 
+	    } else {
+		fputc(*(string+i), stream);
+	    }
+	}
     } else {
-        fprintf(stream, "%s", string);
+	fprintf(stream, "%s", string);
     }
 }
 
-// write_prolog changed to foma_write_prolog because it conflicts with an xfsm function
-int foma_write_prolog(struct fsm *net, char *filename) {
+int foma_write_prolog (struct fsm *net, char *filename) {
   struct fsm_state *stateptr;
   int i, *finals, *used_symbols, maxsigma;
   FILE *out;
@@ -172,7 +182,7 @@ int foma_write_prolog(struct fsm *net, char *filename) {
     if (*(used_symbols+i) == 0) {
       instring = sigma_string(i, net->sigma);
       if (strcmp(instring,"0") == 0) {
-          instring = "%0";
+	  instring = "%0";
       } 
       fprintf(out, "symbol(%s, \"", identifier);
       escape_print(out, instring);
@@ -204,11 +214,11 @@ int foma_write_prolog(struct fsm *net, char *filename) {
       fprintf(out, "\"?\").\n");
     }
     else if (net->arity == 2 && stateptr->in == stateptr->out && stateptr->in != UNKNOWN) {
-        fprintf(out, "\"");
-        escape_print(out, instring);
-        fprintf(out, "\").\n");
+	fprintf(out, "\"");
+	escape_print(out, instring);
+	fprintf(out, "\").\n");
     }
-    else if (net->arity == 2) { 
+    else if (net->arity == 2) {	
       fprintf(out, "\"");
       escape_print(out, instring);
       fprintf(out, "\":\"");
@@ -216,9 +226,9 @@ int foma_write_prolog(struct fsm *net, char *filename) {
       fprintf(out, "\").\n");
     }
     else if (net->arity == 1) {
-        fprintf(out, "\"");
-        escape_print(out, instring);
-        fprintf(out, "\").\n");
+	fprintf(out, "\"");
+	escape_print(out, instring);
+	fprintf(out, "\").\n");
     }
   }
 
@@ -240,7 +250,7 @@ struct fsm *read_att(char *filename) {
     struct fsm_construct_handle *h;
     struct fsm *net;
     int i;
-    char inword[1024], delimiters[] = "\t", *tokens[5];
+    char inword[1024], delimiters[] = "\t", *tokens[6];
     FILE *INFILE;
 
     INFILE = fopen(filename, "r");
@@ -298,135 +308,135 @@ struct fsm *fsm_read_prolog (char *filename) {
     has_net = 0;
     prolog_file = fopen(filename, "r");
     if (prolog_file == NULL) {
-        return NULL;
+	return NULL;
     }
 
     while (fgets(buf, 1023, prolog_file) != NULL) {
-        if (strstr(buf, "network(") == buf) {
-            /* Extract network name */
-            if (has_net == 1) {
-                perror("WARNING: prolog file contains multiple nets. Only returning the first one.\n");
-                break;
-            } else {
-                has_net = 1;
-            }
-            temp_ptr = strstr(buf, "network(")+8;
-            temp_ptr2 = strstr(buf, ").");
-            strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
-            temp[(temp_ptr2-temp_ptr)] = '\0';
-            
-            /* Start network */
-            outh = fsm_construct_init(temp);
-        }
-        if (strstr(buf, "final(") == buf) {
-            temp_ptr = strstr(buf, " ");
-            temp_ptr++;
-            temp_ptr2 = strstr(temp_ptr, ").");
-            strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
-            temp[(temp_ptr2-temp_ptr)] = '\0';
-            
-            fsm_construct_set_final(outh, atoi(temp));
-        }
-        if (strstr(buf, "symbol(") == buf) {
-            temp_ptr = strstr(buf, ", \"")+3;
-            temp_ptr2 = strstr(temp_ptr, "\").");
-            strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
-            temp[(temp_ptr2-temp_ptr)] = '\0';
-            if (strcmp(temp, "%0") == 0)
-                strcpy(temp, "0");
-            //printf("special: %s\n",temp);
-            
-            if (fsm_construct_check_symbol(outh, temp) == -1) {
-                fsm_construct_add_symbol(outh, temp);
-            }      
-            continue;
-        }
-        if (strstr(buf, "arc(") == buf) {
-            in[0] = '\0';
-            out[0] = '\0';
-            
-            if (strstr(buf, "\":\"") == NULL || strstr(buf, ", \":\").") != NULL) {
-                arity = 1;
-            } else {
-                arity = 2;
-            }
-            
-            /* Get source */
-            temp_ptr = strstr(buf, " ");
-            temp_ptr++;
-            temp_ptr2 = strstr(temp_ptr, ",");
-            strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
-            temp[(temp_ptr2-temp_ptr)] = '\0';
-            source = atoi(temp);
-            
-            /* Get target */
-            temp_ptr = strstr(temp_ptr2, " ");
-            temp_ptr++;
-            temp_ptr2 = strstr(temp_ptr, ",");
-            strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
-            temp[(temp_ptr2-temp_ptr)] = '\0';
-            target = atoi(temp);
-            
-            temp_ptr = strstr(temp_ptr2, "\"");
-            temp_ptr++;
-            if (arity == 2)  { 
-                temp_ptr2 = strstr(temp_ptr, "\":");
-            } else {
-                temp_ptr2 = strstr(temp_ptr, "\").");
-            }
-            strncpy(in, temp_ptr, (temp_ptr2 - temp_ptr));
-            in[(temp_ptr2 - temp_ptr)] = '\0';
-            
-            if (arity == 2) {
-                temp_ptr = strstr(temp_ptr2, ":\"");
-                temp_ptr += 2;
-                temp_ptr2 = strstr(temp_ptr, "\").");
-                strncpy(out, temp_ptr, (temp_ptr2 - temp_ptr));
-                out[(temp_ptr2 - temp_ptr)] = '\0';
-            }
-            if (arity == 1 && (strcmp(in, "?") == 0)) {
-                strcpy(in,"@_IDENTITY_SYMBOL_@");
-            }
-            if (arity == 2 && (strcmp(in, "?") == 0)) {
-                strcpy(in,"@_UNKNOWN_SYMBOL_@");
-            }
-            if (arity == 2 && (strcmp(out, "?") == 0)) {
-                strcpy(out,"@_UNKNOWN_SYMBOL_@");
-            }
-            if (strcmp(in, "0") == 0) {
-                strcpy(in,"@_EPSILON_SYMBOL_@");
-            }
-            if (strcmp(out, "0") == 0) {
-                strcpy(out,"@_EPSILON_SYMBOL_@");
-            }
-            if (strcmp(in, "%0") == 0) {
-                strcpy(in,"0");
-            }
-            if (strcmp(out, "%0") == 0) {
-                strcpy(out,"0");
-            }
-            if (strcmp(in, "%?") == 0) {
-                strcpy(in,"?");
-            }
-            if (strcmp(out, "%?") == 0) {
-                strcpy(out,"?");
-            }
-            
-            if (arity == 1) { 
-                fsm_construct_add_arc(outh, source, target, in, in);        
-            } else {
-                fsm_construct_add_arc(outh, source, target, in, out);
-            }
-        }
+	if (strstr(buf, "network(") == buf) {
+	    /* Extract network name */
+	    if (has_net == 1) {
+		perror("WARNING: prolog file contains multiple nets. Only returning the first one.\n");
+		break;
+	    } else {
+		has_net = 1;
+	    }
+	    temp_ptr = strstr(buf, "network(")+8;
+	    temp_ptr2 = strstr(buf, ").");
+	    strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
+	    temp[(temp_ptr2-temp_ptr)] = '\0';
+	    
+	    /* Start network */
+	    outh = fsm_construct_init(temp);
+	}
+	if (strstr(buf, "final(") == buf) {
+	    temp_ptr = strstr(buf, " ");
+	    temp_ptr++;
+	    temp_ptr2 = strstr(temp_ptr, ").");
+	    strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
+	    temp[(temp_ptr2-temp_ptr)] = '\0';
+	    
+	    fsm_construct_set_final(outh, atoi(temp));
+	}
+	if (strstr(buf, "symbol(") == buf) {
+	    temp_ptr = strstr(buf, ", \"")+3;
+	    temp_ptr2 = strstr(temp_ptr, "\").");
+	    strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
+	    temp[(temp_ptr2-temp_ptr)] = '\0';
+	    if (strcmp(temp, "%0") == 0)
+		strcpy(temp, "0");
+	    //printf("special: %s\n",temp);
+	    
+	    if (fsm_construct_check_symbol(outh, temp) == -1) {
+		fsm_construct_add_symbol(outh, temp);
+	    }      
+	    continue;
+	}
+	if (strstr(buf, "arc(") == buf) {
+	    in[0] = '\0';
+	    out[0] = '\0';
+	    
+	    if (strstr(buf, "\":\"") == NULL || strstr(buf, ", \":\").") != NULL) {
+		arity = 1;
+	    } else {
+		arity = 2;
+	    }
+	    
+	    /* Get source */
+	    temp_ptr = strstr(buf, " ");
+	    temp_ptr++;
+	    temp_ptr2 = strstr(temp_ptr, ",");
+	    strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
+	    temp[(temp_ptr2-temp_ptr)] = '\0';
+	    source = atoi(temp);
+	    
+	    /* Get target */
+	    temp_ptr = strstr(temp_ptr2, " ");
+	    temp_ptr++;
+	    temp_ptr2 = strstr(temp_ptr, ",");
+	    strncpy(temp, temp_ptr, (temp_ptr2 - temp_ptr));
+	    temp[(temp_ptr2-temp_ptr)] = '\0';
+	    target = atoi(temp);
+	    
+	    temp_ptr = strstr(temp_ptr2, "\"");
+	    temp_ptr++;
+	    if (arity == 2)  { 
+		temp_ptr2 = strstr(temp_ptr, "\":");
+	    } else {
+		temp_ptr2 = strstr(temp_ptr, "\").");
+	    }
+	    strncpy(in, temp_ptr, (temp_ptr2 - temp_ptr));
+	    in[(temp_ptr2 - temp_ptr)] = '\0';
+	    
+	    if (arity == 2) {
+		temp_ptr = strstr(temp_ptr2, ":\"");
+		temp_ptr += 2;
+		temp_ptr2 = strstr(temp_ptr, "\").");
+		strncpy(out, temp_ptr, (temp_ptr2 - temp_ptr));
+		out[(temp_ptr2 - temp_ptr)] = '\0';
+	    }
+	    if (arity == 1 && (strcmp(in, "?") == 0)) {
+		strcpy(in,"@_IDENTITY_SYMBOL_@");
+	    }
+	    if (arity == 2 && (strcmp(in, "?") == 0)) {
+		strcpy(in,"@_UNKNOWN_SYMBOL_@");
+	    }
+	    if (arity == 2 && (strcmp(out, "?") == 0)) {
+		strcpy(out,"@_UNKNOWN_SYMBOL_@");
+	    }
+	    if (strcmp(in, "0") == 0) {
+		strcpy(in,"@_EPSILON_SYMBOL_@");
+	    }
+	    if (strcmp(out, "0") == 0) {
+		strcpy(out,"@_EPSILON_SYMBOL_@");
+	    }
+	    if (strcmp(in, "%0") == 0) {
+		strcpy(in,"0");
+	    }
+	    if (strcmp(out, "%0") == 0) {
+		strcpy(out,"0");
+	    }
+	    if (strcmp(in, "%?") == 0) {
+		strcpy(in,"?");
+	    }
+	    if (strcmp(out, "%?") == 0) {
+		strcpy(out,"?");
+	    }
+	    
+	    if (arity == 1) { 
+		fsm_construct_add_arc(outh, source, target, in, in);	    
+	    } else {
+		fsm_construct_add_arc(outh, source, target, in, out);
+	    }
+	}
     }
     fclose(prolog_file);
     if (has_net == 1) {
-        fsm_construct_set_initial(outh, 0);
-        outnet = fsm_construct_done(outh);
-        fsm_topsort(outnet);
-        return(outnet);
+	fsm_construct_set_initial(outh, 0);
+	outnet = fsm_construct_done(outh);
+	fsm_topsort(outnet);
+	return(outnet);
     } else {
-        return(NULL);
+	return(NULL);
     }
 }
 
@@ -446,19 +456,19 @@ void io_free(struct io_buf_handle *iobh) {
     xxfree(iobh);
 }
 
-#endif // if zlib; HFST addition
+#endif // #if defined(ORIGINAL) || defined(ZLIB)
 
 char *spacedtext_get_next_line(char **text) {
     char *t, *ret;
     ret = *text;
     if (**text == '\0')
-        return NULL;
-    for (t = *text; *t != '\0' && *t != '\n'; t++) {    
+	return NULL;
+    for (t = *text; *t != '\0' && *t != '\n'; t++) {	
     }
     if (*t == '\0')
-        *text = t;
+	*text = t;
     else 
-        *text = t+1;
+	*text = t+1;
     *t = '\0';
     return(ret);
 }
@@ -466,16 +476,16 @@ char *spacedtext_get_next_line(char **text) {
 char *spacedtext_get_next_token(char **text) {
     char *t, *ret;
     if (**text == '\0' || **text == '\n')
-        return NULL;
+	return NULL;
     for ( ; **text == ' ' ; (*text)++) {
     }
     ret = *text;
     for (t = *text; *t != '\0' && *t != '\n' && *t != ' '; t++) {
     }
     if (*t == '\0' || *t == '\n')
-        *text = t;
+	*text = t;
     else
-        *text = t+1;
+	*text = t+1;
     *t = '\0';
     return(ret);
 }
@@ -487,50 +497,49 @@ struct fsm *fsm_read_spaced_text_file(char *filename) {
     text = textorig = file_to_mem(filename);
     
     if (text == NULL)
-        return NULL;
+	return NULL;
     th = fsm_trie_init();
     for (;;) {
-        for ( ; *text != '\0' && *text == '\n'; text++) { }
-        t1 = spacedtext_get_next_line(&text);
-        if (t1 == NULL)
-            break;
-        if (strlen(t1) == 0)
-            continue;
-        t2 = spacedtext_get_next_line(&text);
-        if (t2 == NULL || strlen(t2) == 0) {
-            for (l1 = t1; (insym = spacedtext_get_next_token(&l1)) != NULL; ) {
-                if (strcmp(insym, "0") == 0)
-                    fsm_trie_symbol(th,  "@_EPSILON_SYMBOL_@", "@_EPSILON_SYMBOL_@");
-                else if (strcmp(insym, "%0") == 0)
-                    fsm_trie_symbol(th,  "0", "0");
-                else
-                    fsm_trie_symbol(th,  insym, insym);
-            }
-            fsm_trie_end_word(th);
-        } else {
-            for (l1 = t1, l2 = t2; ; ) {
-                insym = spacedtext_get_next_token(&l1);
-                outsym = spacedtext_get_next_token(&l2);
-                if (insym == NULL && outsym == NULL)
-                    break;
-                if (insym == NULL || strcmp(insym, "0") == 0)
-                    insym = "@_EPSILON_SYMBOL_@";
-                if (strcmp(insym, "%0") == 0)
-                    insym = "0";
-                if (outsym == NULL || strcmp(outsym, "0") == 0)
-                    outsym = "@_EPSILON_SYMBOL_@";
-                if (strcmp(outsym, "%0") == 0)
-                    outsym = "0";
-                fsm_trie_symbol(th, insym, outsym);
-            }
-            fsm_trie_end_word(th);
-        }
+	for ( ; *text != '\0' && *text == '\n'; text++) { }
+	t1 = spacedtext_get_next_line(&text);
+	if (t1 == NULL)
+	    break;
+	if (strlen(t1) == 0)
+	    continue;
+	t2 = spacedtext_get_next_line(&text);
+	if (t2 == NULL || strlen(t2) == 0) {
+	    for (l1 = t1; (insym = spacedtext_get_next_token(&l1)) != NULL; ) {
+		if (strcmp(insym, "0") == 0)
+		    fsm_trie_symbol(th,  "@_EPSILON_SYMBOL_@", "@_EPSILON_SYMBOL_@");
+		else if (strcmp(insym, "%0") == 0)
+		    fsm_trie_symbol(th,  "0", "0");
+		else
+		    fsm_trie_symbol(th,  insym, insym);
+	    }
+	    fsm_trie_end_word(th);
+	} else {
+	    for (l1 = t1, l2 = t2; ; ) {
+		insym = spacedtext_get_next_token(&l1);
+		outsym = spacedtext_get_next_token(&l2);
+		if (insym == NULL && outsym == NULL)
+		    break;
+		if (insym == NULL || strcmp(insym, "0") == 0)
+		    insym = "@_EPSILON_SYMBOL_@";
+		if (strcmp(insym, "%0") == 0)
+		    insym = "0";
+		if (outsym == NULL || strcmp(outsym, "0") == 0)
+		    outsym = "@_EPSILON_SYMBOL_@";
+		if (strcmp(outsym, "%0") == 0)
+		    outsym = "0";
+		fsm_trie_symbol(th, insym, outsym);
+	    }
+	    fsm_trie_end_word(th);
+	}
     }
     xxfree(textorig);
     return(fsm_trie_done(th));
 }
 
-
 struct fsm *fsm_read_text_file(char *filename) {
     struct fsm_trie_handle *th;
     char *text, *textp1, *textp2;
@@ -538,33 +547,33 @@ struct fsm *fsm_read_text_file(char *filename) {
 
     text = file_to_mem(filename);
     if (text == NULL) {
-        return NULL;
+	return NULL;
     }
     textp1 = text;
     th = fsm_trie_init();
 
     for (lastword = 0 ; lastword == 0 ; textp1 = textp2+1) {
-        for (textp2 = textp1 ; *textp2 != '\n' && *textp2 != '\0'; textp2++) {
-        }
-        if (*textp2 == '\0') {
-            lastword = 1;
-            if (textp2 == textp1)
-                break;
-        }
-        *textp2 = '\0';
-        if (strlen(textp1) > 0)
-            fsm_trie_add_word(th, textp1);
+	for (textp2 = textp1 ; *textp2 != '\n' && *textp2 != '\0'; textp2++) {
+	}
+	if (*textp2 == '\0') {
+	    lastword = 1;
+	    if (textp2 == textp1)
+		break;
+	}
+	*textp2 = '\0';
+	if (strlen(textp1) > 0)
+	    fsm_trie_add_word(th, textp1);
     }
     xxfree(text);
     return(fsm_trie_done(th));
 }
 
-#ifdef ZLIB // HFST addition
+#if defined(ORIGINAL) || defined(ZLIB)
 
 int fsm_write_binary_file(struct fsm *net, char *filename) {
-    gzFile *outfile;
+    gzFile outfile;
     if ((outfile = gzopen(filename,"wb")) == NULL) {
-        return(1);
+	return(1);
     }
     foma_net_print(net, outfile);
     gzclose(outfile);
@@ -578,11 +587,11 @@ struct fsm *fsm_read_binary_file_multiple(fsm_read_binary_handle fsrh) {
     iobh = (struct io_buf_handle *) fsrh;
     net = io_net_read(iobh, &net_name);
     if (net == NULL) {
-        io_free(iobh);
-        return(NULL);
+	io_free(iobh);
+	return(NULL);
     } else {
-        xxfree(net_name);
-        return(net);
+	xxfree(net_name);
+	return(net);
     }
 }
 
@@ -593,8 +602,8 @@ fsm_read_binary_handle fsm_read_binary_file_multiple_init(char *filename) {
 
     iobh = io_init();
     if (io_gz_file_to_mem(iobh, filename) == 0) {
-        io_free(iobh);
-        return NULL;
+	io_free(iobh);
+	return NULL;
     }
     fsm_read_handle = (void *) iobh;
     return(fsm_read_handle);
@@ -606,7 +615,7 @@ struct fsm *fsm_read_binary_file(char *filename) {
     struct io_buf_handle *iobh;
     iobh = io_init();
     if (io_gz_file_to_mem(iobh, filename) == 0) {
-        io_free(iobh);
+	io_free(iobh);
         return NULL;
     }
     net = io_net_read(iobh, &net_name);
@@ -614,12 +623,11 @@ struct fsm *fsm_read_binary_file(char *filename) {
     return(net);
 }
 
-int save_defined(char *filename) {
-    gzFile *outfile;
-    struct defined *def;
-    def = get_defines();
+int save_defined(struct defined_networks *def, char *filename) {
+    struct defined_networks *d;
+    gzFile outfile;
     if (def == NULL) {
-        printf("No defined networks.\n");
+        fprintf(stderr, "No defined networks.\n");
         return(0);
     }
     if ((outfile = gzopen(filename, "wb")) == NULL) {
@@ -627,15 +635,15 @@ int save_defined(char *filename) {
         return(-1);
     }
     printf("Writing definitions to file %s.\n", filename);
-    for ( ; def != NULL; def = def->next) {
-        strcpy(def->net->name, def->name);
-        foma_net_print(def->net, outfile);
+    for (d = def; d != NULL; d = d->next) {
+        strcpy(d->net->name, d->name);
+        foma_net_print(d->net, outfile);
     }
     gzclose(outfile);
     return(1);
 }
 
-int load_defined(char *filename) {
+int load_defined(struct defined_networks *def, char *filename) {
     struct fsm *net;
     char *net_name;
     struct io_buf_handle *iobh;
@@ -643,20 +651,18 @@ int load_defined(char *filename) {
     iobh = io_init();
     printf("Loading definitions from %s.\n",filename);
     if (io_gz_file_to_mem(iobh, filename) == 0) {
-        printf("File error.\n");
-        io_free(iobh);
+        fprintf(stderr, "File error.\n");
+	io_free(iobh);
         return 0;
     }
-
     while ((net = io_net_read(iobh, &net_name)) != NULL) {
-        add_defined(net, net_name);
+        add_defined(def, net, net_name);
     }
     io_free(iobh);
     return(1);
 }
 
-static inline int explode_line(char *buf, int *values) {
-
+static INLINE int explode_line(char *buf, int *values) {
     int i, j, items;
     j = i = items = 0;
     for (;;) {
@@ -670,7 +676,6 @@ static inline int explode_line(char *buf, int *values) {
             *(values+items) = atoi(buf+i);
             items++;
             j++;
-            i = j;
         }
     }
     return(items);
@@ -701,6 +706,9 @@ static inline int explode_line(char *buf, int *values) {
 
 /* where name is used if defined networks are saved/loaded */
 
+/* Following the props line, we accept anything (for future expansion) */
+/* until we find ##sigma## */
+
 /* the section beginning with "##sigma##" consists of lines with two fields: */
 /* number string */
 /* correponding to the symbol number and the symbol string */
@@ -743,49 +751,56 @@ struct fsm *io_net_read(struct io_buf_handle *iobh, char **net_name) {
     net = fsm_create("");
 
     if (strcmp(buf, "##foma-net 1.0##") != 0) {
-        fsm_destroy(net);
+	fsm_destroy(net);
         perror("File format error foma!\n");
         return NULL;
     }
     io_gets(iobh, buf);
     if (strcmp(buf, "##props##") != 0) {
         perror("File format error props!\n");
-        fsm_destroy(net);
+	fsm_destroy(net);
         return NULL;
     }
     /* Properties */
     io_gets(iobh, buf);
     extras = 0;
-    sscanf(buf, "%i %i %i %i %i " LONG_LONG_SPECIFIER " %i %i %i %i %i %i %s", &net->arity, &net->arccount, &net->statecount, &net->linecount, &net->finalcount, &net->pathcount, &net->is_deterministic, &net->is_pruned, &net->is_minimized, &net->is_epsilon_free, &net->is_loop_free, &extras, buf);
+#ifdef ORIGINAL
+    sscanf(buf, "%i %i %i %i %i %lld %i %i %i %i %i %i %s", &net->arity, &net->arccount, &net->statecount, &net->linecount, &net->finalcount, &net->pathcount, &net->is_deterministic, &net->is_pruned, &net->is_minimized, &net->is_epsilon_free, &net->is_loop_free, &extras, buf);
+#else
+    sscanf(buf, "%i %i %i %i %i LONG_LONG_SPECIFIER %i %i %i %i %i %i %s", &net->arity, &net->arccount, &net->statecount, &net->linecount, &net->finalcount, &net->pathcount, &net->is_deterministic, &net->is_pruned, &net->is_minimized, &net->is_epsilon_free, &net->is_loop_free, &extras, buf);
+#endif
     strcpy(net->name, buf);
     *net_name = xxstrdup(buf);
     io_gets(iobh, buf);
 
-    net->is_completed = (extras & 3) ;
+    net->is_completed = (extras & 3);
     net->arcs_sorted_in = (extras & 12) >> 2;
     net->arcs_sorted_out = (extras & 48) >> 4;
 
     /* Sigma */
-    if (strcmp(buf, "##sigma##") != 0) {
-        printf("File format error sigma!\n");
-        fsm_destroy(net);
-        return NULL;
+    while (strcmp(buf, "##sigma##") != 0) { /* Loop until we encounter ##sigma## */
+        if (buf[0] == '\0') {
+	  printf("File format error at sigma definition!\n");
+	  fsm_destroy(net);
+	  return NULL;
+        }
+        io_gets(iobh, buf);
     }
-    //    net->sigma = sigma_create();
+
     for (;;) {
         io_gets(iobh, buf);
         if (buf[0] == '#') break;
         if (buf[0] == '\0') continue;
         new_symbol = strstr(buf, " ");
-        new_symbol[0] = '\0';
-        new_symbol++;
-        if (new_symbol[0] == '\0') {
-            sscanf(buf,"%i", &new_symbol_number);
-            sigma_add_number(net->sigma, "\n", new_symbol_number);
-        } else {
-            sscanf(buf,"%i", &new_symbol_number);
-            sigma_add_number(net->sigma, new_symbol, new_symbol_number);
-        }
+	new_symbol[0] = '\0';
+	new_symbol++;
+	if (new_symbol[0] == '\0') {
+	    sscanf(buf,"%i", &new_symbol_number);
+	    sigma_add_number(net->sigma, "\n", new_symbol_number);
+	} else {
+	    sscanf(buf,"%i", &new_symbol_number);
+	    sigma_add_number(net->sigma, new_symbol, new_symbol_number);
+	}
     }
 
     /* States */
@@ -884,7 +899,7 @@ static int io_gets(struct io_buf_handle *iobh, char *target) {
     return(i);
 }
 
-int foma_net_print(struct fsm *net, gzFile *outfile) {
+int foma_net_print(struct fsm *net, gzFile outfile) {
     struct sigma *sigma;
     struct fsm_state *fsm;
     int i, maxsigma, laststate, *cm, extras;
@@ -895,11 +910,15 @@ int foma_net_print(struct fsm *net, gzFile *outfile) {
     /* Properties */
     gzprintf(outfile, "%s","##props##\n");
 
-    extras = 0;
     extras = (net->is_completed) | (net->arcs_sorted_in << 2) | (net->arcs_sorted_out << 4);
  
+#ifdef ORIGINAL
     gzprintf(outfile, 
-             "%i %i %i %i %i " LONG_LONG_SPECIFIER " %i %i %i %i %i %i %s\n", net->arity, net->arccount, net->statecount, net->linecount, net->finalcount, net->pathcount, net->is_deterministic, net->is_pruned, net->is_minimized, net->is_epsilon_free, net->is_loop_free, extras, net->name);
+	     "%i %i %i %i %i %lld %i %i %i %i %i %i %s\n", net->arity, net->arccount, net->statecount, net->linecount, net->finalcount, net->pathcount, net->is_deterministic, net->is_pruned, net->is_minimized, net->is_epsilon_free, net->is_loop_free, extras, net->name);
+#else
+    gzprintf(outfile, 
+	     "%i %i %i %i %i LONG_LONG_SPECIFIER %i %i %i %i %i %i %s\n", net->arity, net->arccount, net->statecount, net->linecount, net->finalcount, net->pathcount, net->is_deterministic, net->is_pruned, net->is_minimized, net->is_epsilon_free, net->is_loop_free, extras, net->name);
+#endif
     
     /* Sigma */
     gzprintf(outfile, "%s","##sigma##\n");
@@ -909,7 +928,6 @@ int foma_net_print(struct fsm *net, gzFile *outfile) {
 
     /* State array */
     laststate = -1;
-    fsm = net->states;
     gzprintf(outfile, "%s","##states##\n");
     for (fsm = net->states; fsm->state_no !=-1; fsm++) {
         if (fsm->state_no != laststate) {
@@ -946,7 +964,7 @@ int foma_net_print(struct fsm *net, gzFile *outfile) {
     return(1);
 }
 
-#endif // if not zlib; HFST addition
+#endif // #if defined(ORIGINAL) || defined(ZLIB)
 
 int net_print_att(struct fsm *net, FILE *outfile) {
     struct fsm_state *fsm;
@@ -973,7 +991,7 @@ int net_print_att(struct fsm *net, FILE *outfile) {
     return(1);
 }
 
-#ifdef ZLIB // HFST addition
+#if defined(ORIGINAL) || defined(ZLIB)
 
 static size_t io_get_gz_file_size(char *filename) {
 
@@ -1008,7 +1026,7 @@ static size_t io_get_regular_file_size(char *filename) {
 
 
 static size_t io_get_file_size(char *filename) {
-    gzFile *FILE;
+    gzFile FILE;
     size_t size;
     FILE = gzopen(filename, "r");
     if (FILE == NULL) {
@@ -1027,7 +1045,7 @@ static size_t io_get_file_size(char *filename) {
 size_t io_gz_file_to_mem(struct io_buf_handle *iobh, char *filename) {
 
     size_t size;
-    gzFile *FILE;
+    gzFile FILE;
 
     size = io_get_file_size(filename);
     if (size == 0) {
@@ -1042,10 +1060,9 @@ size_t io_gz_file_to_mem(struct io_buf_handle *iobh, char *filename) {
     return(size);
 }
 
-#endif // if not zlib; HFST addition
+#endif // #if defined(ORIGINAL) || defined(ZLIB)
 
 char *file_to_mem(char *name) {
-
     FILE    *infile;
     size_t    numbytes;
     char *buffer;
@@ -1070,5 +1087,3 @@ char *file_to_mem(char *name) {
     *(buffer+numbytes)='\0';
     return(buffer);
 }
-
-
diff --git a/back-ends/foma/lex.cmatrix.c b/back-ends/foma/lex.cmatrix.c
index 750d0bf..86aa51b 100644
--- a/back-ends/foma/lex.cmatrix.c
+++ b/back-ends/foma/lex.cmatrix.c
@@ -65,7 +65,6 @@ typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
@@ -73,10 +72,8 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
-#ifndef _MSC_VER
 #ifndef INT8_MIN
 #define INT8_MIN               (-128)
 #endif
@@ -104,7 +101,8 @@ typedef unsigned int flex_uint32_t;
 #ifndef UINT32_MAX
 #define UINT32_MAX             (4294967295U)
 #endif
-#endif // _MSC_VER
+
+#endif /* ! C99 */
 
 #endif /* ! FLEXINT_H */
 
@@ -162,7 +160,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -174,12 +180,7 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t cmatrixleng;
+extern int cmatrixleng;
 
 extern FILE *cmatrixin, *cmatrixout;
 
@@ -205,6 +206,11 @@ extern FILE *cmatrixin, *cmatrixout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -222,7 +228,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	yy_size_t yy_n_chars;
+	int yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -292,8 +298,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when cmatrixtext is formed. */
 static char yy_hold_char;
-static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
-yy_size_t cmatrixleng;
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+int cmatrixleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
@@ -321,7 +327,7 @@ static void cmatrix_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
 YY_BUFFER_STATE cmatrix_scan_buffer (char *base,yy_size_t size  );
 YY_BUFFER_STATE cmatrix_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE cmatrix_scan_bytes (yyconst char *bytes,yy_size_t len  );
+YY_BUFFER_STATE cmatrix_scan_bytes (yyconst char *bytes,int len  );
 
 void *cmatrixalloc (yy_size_t  );
 void *cmatrixrealloc (void *,yy_size_t  );
@@ -377,7 +383,7 @@ static void yy_fatal_error (yyconst char msg[]  );
  */
 #define YY_DO_BEFORE_ACTION \
 	(yytext_ptr) = yy_bp; \
-	cmatrixleng = (yy_size_t) (yy_cp - yy_bp); \
+	cmatrixleng = (size_t) (yy_cp - yy_bp); \
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
@@ -727,7 +733,7 @@ void my_cmatrixparse(struct fsm *net, char *my_string) {
 }
 
 
-#line 729 "lex.cmatrix.c"
+#line 737 "lex.cmatrix.c"
 
 #define INITIAL 0
 #define SUB 1
@@ -741,9 +747,7 @@ void my_cmatrixparse(struct fsm *net, char *my_string) {
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
-#ifndef _MSC_VER
 #include <unistd.h>
-#endif // _MSC_VER
 #endif
 
 #ifndef YY_EXTRA_TYPE
@@ -773,7 +777,7 @@ FILE *cmatrixget_out (void );
 
 void cmatrixset_out  (FILE * out_str  );
 
-yy_size_t cmatrixget_leng (void );
+int cmatrixget_leng (void );
 
 char *cmatrixget_text (void );
 
@@ -813,7 +817,12 @@ static int input (void );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -821,7 +830,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( cmatrixtext, cmatrixleng, 1, cmatrixout )
+#define ECHO do { if (fwrite( cmatrixtext, cmatrixleng, 1, cmatrixout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -832,7 +841,7 @@ static int input (void );
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		yy_size_t n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( cmatrixin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -920,7 +929,7 @@ YY_DECL
 #line 53 "cmatrix.l"
 
 
-#line 920 "lex.cmatrix.c"
+#line 933 "lex.cmatrix.c"
 
 	if ( !(yy_init) )
 		{
@@ -991,7 +1000,6 @@ yy_match:
 yy_find_action:
 		yy_current_state = *--(yy_state_ptr);
 		(yy_lp) = yy_accept[yy_current_state];
-goto find_rule; /* Shut up GCC warning -Wall */
 find_rule: /* we branch to this label when backing up */
 		for ( ; ; ) /* until we find what rule we matched */
 			{
@@ -1138,7 +1146,7 @@ YY_RULE_SETUP
 #line 99 "cmatrix.l"
 ECHO;
 	YY_BREAK
-#line 1138 "lex.cmatrix.c"
+#line 1150 "lex.cmatrix.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(SUB):
 			case YY_STATE_EOF(DEL):
@@ -1221,7 +1229,7 @@ ECHO;
 				{
 				(yy_did_buffer_switch_on_eof) = 0;
 
-				if ( cmatrixwrap( void ) )
+				if ( cmatrixwrap( ) )
 					{
 					/* Note: because we've taken care in
 					 * yy_get_next_buffer() to have set up
@@ -1329,7 +1337,7 @@ static int yy_get_next_buffer (void)
 
 	else
 		{
-			yy_size_t num_to_read =
+			int num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
@@ -1345,7 +1353,7 @@ static int yy_get_next_buffer (void)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
+			(yy_n_chars), (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
@@ -1463,7 +1471,7 @@ static int yy_get_next_buffer (void)
 
 		else
 			{ /* need more input */
-			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+			int offset = (yy_c_buf_p) - (yytext_ptr);
 			++(yy_c_buf_p);
 
 			switch ( yy_get_next_buffer(  ) )
@@ -1486,8 +1494,8 @@ static int yy_get_next_buffer (void)
 
 				case EOB_ACT_END_OF_FILE:
 					{
-					if ( cmatrixwrap( void ) )
-						return 0;
+					if ( cmatrixwrap( ) )
+						return EOF;
 
 					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
@@ -1741,7 +1749,7 @@ void cmatrixpop_buffer_state (void)
  */
 static void cmatrixensure_buffer_stack (void)
 {
-	yy_size_t num_to_alloc;
+	int num_to_alloc;
     
 	if (!(yy_buffer_stack)) {
 
@@ -1833,16 +1841,17 @@ YY_BUFFER_STATE cmatrix_scan_string (yyconst char * yystr )
 
 /** Setup the input buffer state to scan the given bytes. The next call to cmatrixlex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE cmatrix_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
+YY_BUFFER_STATE cmatrix_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	int i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -1924,7 +1933,7 @@ FILE *cmatrixget_out  (void)
 /** Get the length of the current token.
  * 
  */
-yy_size_t cmatrixget_leng  (void)
+int cmatrixget_leng  (void)
 {
         return cmatrixleng;
 }
diff --git a/back-ends/foma/lex.interface.c b/back-ends/foma/lex.interface.c
index bcd335a..de9d2ea 100644
--- a/back-ends/foma/lex.interface.c
+++ b/back-ends/foma/lex.interface.c
@@ -69,7 +69,6 @@ typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
@@ -77,7 +76,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -108,6 +106,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -164,7 +164,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -176,12 +184,7 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t interfaceleng;
+extern int interfaceleng;
 
 extern FILE *interfacein, *interfaceout;
 
@@ -198,7 +201,7 @@ extern FILE *interfacein, *interfaceout;
      */
     #define  YY_LESS_LINENO(n) \
             do { \
-                yy_size_t yyl;\
+                int yyl;\
                 for ( yyl = n; yyl < interfaceleng; ++yyl )\
                     if ( interfacetext[yyl] == '\n' )\
                         --interfacelineno;\
@@ -220,6 +223,11 @@ extern FILE *interfacein, *interfaceout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -237,7 +245,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	yy_size_t yy_n_chars;
+	int yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -307,8 +315,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when interfacetext is formed. */
 static char yy_hold_char;
-static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
-yy_size_t interfaceleng;
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+int interfaceleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
@@ -336,7 +344,7 @@ static void interface_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
 YY_BUFFER_STATE interface_scan_buffer (char *base,yy_size_t size  );
 YY_BUFFER_STATE interface_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE interface_scan_bytes (yyconst char *bytes,yy_size_t len  );
+YY_BUFFER_STATE interface_scan_bytes (yyconst char *bytes,int len  );
 
 void *interfacealloc (yy_size_t  );
 void *interfacerealloc (void *,yy_size_t  );
@@ -393,13 +401,13 @@ static void yy_fatal_error (yyconst char msg[]  );
 #define YY_DO_BEFORE_ACTION \
 	(yytext_ptr) = yy_bp; \
 	(yytext_ptr) -= (yy_more_len); \
-	interfaceleng = (yy_size_t) (yy_cp - (yytext_ptr)); \
+	interfaceleng = (size_t) (yy_cp - (yytext_ptr)); \
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
 
-#define YY_NUM_RULES 207
-#define YY_END_OF_BUFFER 208
+#define YY_NUM_RULES 212
+#define YY_END_OF_BUFFER 213
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -407,188 +415,191 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_acclist[1605] =
+static yyconst flex_int16_t yy_acclist[1632] =
     {   0,
-      206,  206,  148,  148,  208,  205,  207,  202,  205,  207,
-      203,  205,  207,  202,  204,  205,  207,  177,  202,  205,
-      207,  138,  207,  205,  207,  202,  205,  207,  203,  205,
-      207,  202,  204,  205,  207,  177,  202,  205,  207,  205,
-      207,  205,  207,  205,  207,  205,  207,  205,  207,  205,
-      207,  205,  207,  205,  207,  205,  207,  205,  207,  205,
-      207,  205,  207,  205,  207,  205,  207,  205,  207,  205,
-      207,  205,  207,  205,  207,  205,  207,  205,  207,  205,
-      207,  205,  207,  205,  207,  205,  207,  140,  207,  140,
-      203,  207,  140,  204,  207,  140,  177,  207,  137,  207,
-
-      147,  207,  207,  140,  207,  143,  207,  144,  207,  207,
-      207,  207,  207,  163,  207,16546,  203,  207,  163,  204,
-      207,16546,  177,  207,  207,  207,  207,  207,  203,  207,
-      204,  207,  173,  207,  173,  177,  207,  207,  207,  207,
-      128,  129,  207,  128,  129,  177,  207,  207,  207,  207,
-      125,  207,  125,  203,  207,  125,  204,  207,  125,  177,
-      207,  207,  125,  207,  125,  207,  125,  207,  125,  207,
-      130,  207,  130,  177,  207,  207,  207,  207,  131,  207,
-      131,  177,  207,  207,  207,  207,  136,  207,  136,  177,
-      207,  207,  207,  207,  193,  207,  177,  193,  207,  207,
-
-      207,  207,  164,  207,  164,  177,  207,  207,  207,  207,
-      198,  207,  177,  198,  207,  207,  207,  207,  199,  207,
-      177,  199,  207,  207,  207,  207,  201,  207,  177,  201,
-      207,  207,  207,  207,  179,  207,  177,  179,  207,  207,
-      207,  207,  178,  207,  177,  178,  207,  207,  207,  207,
-      174,  207,  174,  177,  207,  207,  207,  207,  175,  207,
-      175,  203,  207,  175,  204,  207,  176,  207,  176,  204,
-      207,  184,  207,  177,  184,  207,  207,  207,  207,  183,
-      207,  177,  183,  207,  207,  207,  207,  185,  207,  177,
-      185,  207,  207,  207,  207,  186,  207,  177,  186,  207,
-
-      207,  207,  207,  206,  207,  204,  206,  207,  177,  206,
-      207,  148,  207,  148,  203,  207,  148,  204,  207,  148,
-      177,  207,  149,  207,  145,  207,  145,  203,  207,  145,
-      204,  207,  145,  177,  207,  146,  207,  135,  207,  135,
-      177,  207,  207,  207,  207,  132,  207,  132,  177,  207,
-      207,  207,  207,  195,  207,  177,  195,  207,  207,  207,
-      207,  194,  207,  177,  194,  207,  207,  207,  207,  151,
-      207,  207,16537,16538,  203,  207,16537,16538,  204,  207,
-    16537,16538,  152,  177,  207,  155,  207,  161,  207,  161,
-      204,  207,  161,  177,  207,  161,  207,  161,  207,  156,
-
-      161,  207,  161,  207,  160,  161,  207,  161,  207,  161,
-      207,  161,  207,  161,  207,  161,  207,  161,  207,  161,
-      207,  161,  207,  161,  207,  161,  207,  161,  207,  134,
-      207,  134,  177,  207,  207,  207,  207,  133,  207,  133,
-      177,  207,  207,  207,  207,  165,  207,  165,  177,  207,
-      207,  207,  207,  166,  207,  166,  177,  207,  207,  207,
-      207,  167,  207,  167,  203,  207,  167,  204,  207,  169,
-      207,  168,  207,  169,  203,  207,  169,  204,  207,  168,
-      177,  207,  172,  207,  172,  177,  207,  207,  207,  207,
-      187,  207,  187,  203,  207,  187,  204,  207,  207,  189,
-
-      207,  177,  189,  207,  207,  207,  207,  190,  207,  190,
-      203,  207,  190,  204,  207,  207,  192,  207,  177,  192,
-      207,  207,  207,  207,  170,  207,  170,  177,  207,  207,
-      207,  207,  171,  207,  171,  177,  207,  207,  207,  207,
-      142,  207,  141,  142,  203,  207,  142,  204,  207,  142,
-      177,  207,  207,  207,  207,  126,  207,  127,  207,  127,
-      177,  207,  207,  207,  207,  197,  207,  177,  197,  207,
-      207,  207,  207,  200,  207,  177,  200,  207,  207,  207,
-      207,  196,  207,  177,  196,  207,  207,  207,  207,  180,
-      207,  177,  180,  207,  207,  207,  207,  181,  207,  177,
-
-      181,  207,  207,  207,  207,  182,  207,  177,  182,  207,
-      207,  207,  207,  138,   19,   54,   45,   46,   78,   99,
-      113,    8,  123,  140,  139,  140,  163,16546, 8354,  163,
-      150,  163,  173,  128,  129,  125,  125,  124,  125,  125,
-      125,  125,  125,  130,  131,  136,  193,  164,  198,  199,
-      201,  179,  178,  174,  175,  176,  184,  183,  185,  186,
-      148,  135,  132,  195,  194,16537,16538, 8346, 8345,  155,
-      158,  156,  134,  133,  165,  166,  167,  169,  172,  187,
-      189,  190,  192,  170,  171,  142,  126,  127,  197,  200,
-      196,  180,  181,  182,   46,   80,  121,   79,   47,   18,
-
-       18,   48,   20,   49,  105,   29,   36,   52,    5,   42,
-       43,   43,   54,   44,   55,   45,   46,   77,   75,   76,
-       78,   78,   78,   85,   85,   88,   89,   83,   30,   95,
-       65,   66,   99,   91,   91,  103,  103,  114,  106,  107,
-      110,  108,  109,  113,  112,  116,    7,    8,    8,    7,
-        7,    9,    7,   19,    7,   68,    7,    7,    7,  119,
-      123,  163,  125,  159,  159,  159,  159,  161,  157,  157,
-      157,  157,  156,   46,   80,  121,   80,  121,   80,   47,
-       16,   48,   20,   49,   49,    3,   22,   29,   29,   32,
-       36,   84,   73,   52,    6,    5,    5,    6,    6,   19,
-
-        6,    6,    6,   54,   44,   55,16442,   55,16442,   45,
-       83,   77,   78,   80,   85,   85,   88,   89,   83,   83,
-       83,   30,   30,16476,   95,   65,   66,   99,  100,  100,
-       91,   91,   91,   91,   87,  111,  113,  115,  115,  116,
-        7,    9,    9,   74,   68,  118,  121,  119,  119,  123,
-      159,  159,  159,  159,  159,  159,  159,  157,  157,  157,
-      157,  157,  157,  157,  188,  191,   10,   10,   10,   10,
-       19,   10,   10,   10,   10,  122,   80,  121,  122,   80,
-      121,  122,   80,  122,   19,  122,  122,  122,  122,   80,
-      121,  122,   80,  122,   80,   80,   12,   47,   14,   15,
-
-       16,   17,   48,   20,   51,   49,   51,   51,   19,   51,
-       51,   51,   51,   49,   51,   50,   50,   50,   19,   50,
-       50,   50,   50,    2,    3,    3,    2,    4,    2,   19,
-        2,    2,    2,   21,   21,   27,   32,   32,   34,   36,
-       84,   84,   84,   40,   40,   53,   53,   73,   73,   73,
-       44,   57,   57,   19,   57,   57,   57,   57,   56,   56,
-       56,   19,   56,   56,   56,   56,   45,   45,   45,   54,
-       54,   83,   83,   83,   83,   77,   80,   80,   80,   88,
-       89,   83,   83,   83,   19,   95,   65,   97,   99,   97,
-       99,   91,   91,   91,   87,   87,   87,  113,  113,  104,
-
-      116,    9,   69,   69,   74,   74,   74,   68,  121,  121,
-       70,  120,  119,  120,  119,  120,   19,  120,  120,  120,
-      120,  119,  120,  123,  123,  123,  159,  159,  159,  159,
-      159,  159,  157,  157,  157,  157,  157,  157,  122,   80,
-      122,   47,   14,   15,   16,   17,   48,   20,   20,   20,
-       50,   50,    4,    4,   27,   27,   33,   32,   33,   33,
-       19,   33,   33,   33,   33,   33,   33,   32,   33,   33,
-       33,   34,   36,   36,   36,   84,   84,   84,   40,   40,
-       39,   39,   73,   52,   42,   42,   43,   43,   43,   44,
-       44,   44,   56,   56,   45,   45,   45,   46,   46,   47,
-
-       48,   52,   54,   65,   68,   47,   48,   49,   52,   54,
-       55,   65,   66,   68,   83,   83,   83,   83,  119,   77,
-       77,   78,   78,   80,   80,   80,   80,   80,   85,   88,
-       88,   88,   89,   89,   89,   83,   90,   90,   94,   94,
-       94,   19,   94,   94,   94,   94,   94,   94,   94,   95,
-       95,   95,   99,   98,   99,   98,   87,   87,   87,  113,
-      113,  116,  116,   74,   68,  121,  122,  121,  121,  122,
-       72,  120,  120,  121,  123,  123,  123,  122,   47,   81,
-       14,   15,   16,   16,   16,   17,   48,   20,   20,   20,
-        4,   28,   36,   36,   84,   31,   39,   39,   52,   42,
-
-       42,   44,   44, 8250, 8250, 8250,   19, 8250, 8250, 8250,
-     8250, 8250, 8250, 8250, 8250,   45,   46,   46,   47,   48,
-       52,   54,   65,   68,   47,   48,   49,   52,   54,   55,
-    16442,   65,   66,   68,   83,   83,  119,   83,  119,   77,
-       77,   78,   78,   78,   78,   78,   80,   80,   80,   83,
-       80,   80,   84,   83,   87,   88,   88,   88,   89,   89,
-       90,   90,   90,   90, 8284, 8284,   19, 8284,   95,   95,
-       95,   87,  113,  113,  116,  116,   68,  118,  118,   71,
-       71,   72,   72,   72,  120,  121,  123,    8,    8,   12,
-       12,   82,   81,   81,   82,   82,   19,   82,   82,   82,
-
-       82,   14,   14,   14,   15,   15,   16,   16,   16,   17,
-       17,   17,   20,   28,   28,   34,   34,   52,   42, 8250,
-       45,   46,   46,   47,   48,   65,   68,   47,   48,   49,
-       51,   65,   68,   70,   83,  119,  120,   83,  119,   83,
-      120,   83,  119,  120,   83,  120,   78,   78,   83,   84,
-       83,   83,   87,   89,   89,   90,   90,   90,   94,   94,
-       93,   94,   93,   97,   97,  101,  101,  102,  102,  101,
-      102,  113,  113,   68,  118,  118,   72,  121,  122,  121,
-      123,    1,    5,    8,   79,   12,   12,   82,   13,   13,
-       14,   14,   15,   15,   16,   17,   17,   17,   20,   29,
-
-       34,   34,   35,   37,   37,   52,   46,   46,   47,   48,
-       52,   68,   47,   48,   52,   68,   78,   78,   83,   83,
-       89,   89,   93,   93,   96,   96,   98,   98,   67,  109,
-       68,  119,  123,    1,    1,    3,    5,   12,   12,   13,
-       13,   16,   17,   20,   37,   37,   37,   40,   40,   41,
-       52,   47,   47,   48,   52,   68,   78,   78,   81,   81,
-       91,   91,   93,   93,   96,   96,   96,   67,  117,   68,
-      119,    3,   12,   12,   13,   13,   16,   17,   20,   40,
-       40,   40,   52,   52,   68,   81,   91,   91,   91,   93,
-       93,   86,   68,  119,  120,  119,   17,   31,   35,   35,
-
-       52,   67,   68,   59,   61,   63,   93,   93,   86,   86,
-       86,  117,  117,   11,   11,   35,   35,   39,   39,   39,
-       41,   41,   52,   67,   68,   90,   90,   90,   30,   93,
-       93,   86,   86,   86,  107,  108,  117,  117,   25,   25,
-       38,   38,   39,   39,   39,   41,   41,   52,   68,   60,
-       60,   62,   62,   64,   64,   86,   90,   90,   90,   93,
-       93,   86,  117,  117,    1,    1,   24,   24,   23,   24,
-       23,   26,   26,   19,   26,   26,   26,   26,   26,   26,
-       38,   38,   38,   59,   61,   63,   86,   75,  105,  106,
-      111,    1,    1,    1,  104,   27,   27,   75,   28,  112,
-
-       28,  110,   76,  114
+      211,  211,  152,  152,  213,  210,  212,  207,  210,  212,
+      208,  210,  212,  207,  209,  210,  212,  181,  207,  210,
+      212,  142,  212,  210,  212,  207,  210,  212,  208,  210,
+      212,  207,  209,  210,  212,  181,  207,  210,  212,  210,
+      212,  210,  212,  210,  212,  210,  212,  210,  212,  210,
+      212,  210,  212,  210,  212,  210,  212,  210,  212,  210,
+      212,  210,  212,  210,  212,  210,  212,  210,  212,  210,
+      212,  210,  212,  210,  212,  210,  212,  210,  212,  210,
+      212,  210,  212,  210,  212,  210,  212,  144,  212,  144,
+      208,  212,  144,  209,  212,  144,  181,  212,  141,  212,
+
+      151,  212,  212,  144,  212,  147,  212,  148,  212,  212,
+      212,  212,  212,  167,  212,16550,  208,  212,  167,  209,
+      212,16550,  181,  212,  212,  212,  212,  212,  208,  212,
+      209,  212,  177,  212,  177,  181,  212,  212,  212,  212,
+      132,  133,  212,  132,  133,  181,  212,  212,  212,  212,
+      129,  212,  129,  208,  212,  129,  209,  212,  129,  181,
+      212,  212,  129,  212,  129,  212,  129,  212,  129,  212,
+      134,  212,  134,  181,  212,  212,  212,  212,  135,  212,
+      135,  181,  212,  212,  212,  212,  140,  212,  140,  181,
+      212,  212,  212,  212,  198,  212,  181,  198,  212,  212,
+
+      212,  212,  168,  212,  168,  181,  212,  212,  212,  212,
+      203,  212,  181,  203,  212,  212,  212,  212,  204,  212,
+      181,  204,  212,  212,  212,  212,  206,  212,  181,  206,
+      212,  212,  212,  212,  183,  212,  181,  183,  212,  212,
+      212,  212,  182,  212,  181,  182,  212,  212,  212,  212,
+      178,  212,  178,  181,  212,  212,  212,  212,  179,  212,
+      179,  208,  212,  179,  209,  212,  180,  212,  180,  209,
+      212,  189,  212,  181,  189,  212,  212,  212,  212,  188,
+      212,  181,  188,  212,  212,  212,  212,  190,  212,  181,
+      190,  212,  212,  212,  212,  191,  212,  181,  191,  212,
+
+      212,  212,  212,  211,  212,  209,  211,  212,  181,  211,
+      212,  152,  212,  152,  208,  212,  152,  209,  212,  152,
+      181,  212,  153,  212,  149,  212,  149,  208,  212,  149,
+      209,  212,  149,  181,  212,  150,  212,  139,  212,  139,
+      181,  212,  212,  212,  212,  136,  212,  136,  181,  212,
+      212,  212,  212,  200,  212,  181,  200,  212,  212,  212,
+      212,  199,  212,  181,  199,  212,  212,  212,  212,  155,
+      212,  212,16541,16542,  208,  212,16541,16542,  209,  212,
+    16541,16542,  156,  181,  212,  159,  212,  165,  212,  165,
+      209,  212,  165,  181,  212,  165,  212,  165,  212,  160,
+
+      165,  212,  165,  212,  164,  165,  212,  165,  212,  165,
+      212,  165,  212,  165,  212,  165,  212,  165,  212,  165,
+      212,  165,  212,  165,  212,  165,  212,  165,  212,  138,
+      212,  138,  181,  212,  212,  212,  212,  137,  212,  137,
+      181,  212,  212,  212,  212,  169,  212,  169,  181,  212,
+      212,  212,  212,  170,  212,  170,  181,  212,  212,  212,
+      212,  171,  212,  171,  208,  212,  171,  209,  212,  173,
+      212,  172,  212,  173,  208,  212,  173,  209,  212,  172,
+      181,  212,  176,  212,  176,  181,  212,  212,  212,  212,
+      192,  212,  192,  208,  212,  192,  209,  212,  212,  194,
+
+      212,  181,  194,  212,  212,  212,  212,  195,  212,  195,
+      208,  212,  195,  209,  212,  212,  197,  212,  181,  197,
+      212,  212,  212,  212,  174,  212,  174,  181,  212,  212,
+      212,  212,  175,  212,  175,  181,  212,  212,  212,  212,
+      146,  212,  145,  146,  208,  212,  146,  209,  212,  146,
+      181,  212,  212,  212,  212,  130,  212,  131,  212,  131,
+      181,  212,  212,  212,  212,  202,  212,  181,  202,  212,
+      212,  212,  212,  205,  212,  181,  205,  212,  212,  212,
+      212,  201,  212,  181,  201,  212,  212,  212,  212,  184,
+      212,  181,  184,  212,  212,  212,  212,  185,  212,  181,
+
+      185,  212,  212,  212,  212,  186,  212,  181,  186,  212,
+      212,  212,  212,  187,  212,  181,  187,  212,  212,  212,
+      212,  142,   20,   55,   46,   47,   82,  103,  117,    8,
+      127,  144,  143,  144,  167,16550, 8358,  167,  154,  167,
+      177,  132,  133,  129,  129,  128,  129,  129,  129,  129,
+      129,  134,  135,  140,  198,  168,  203,  204,  206,  183,
+      182,  178,  179,  180,  189,  188,  190,  191,  152,  139,
+      136,  200,  199,16541,16542, 8350, 8349,  159,  162,  160,
+      138,  137,  169,  170,  171,  173,  176,  192,  194,  195,
+      197,  174,  175,  146,  130,  131,  202,  205,  201,  184,
+
+      185,  186,  187,   47,   84,  125,   83,   48,   19,   19,
+       49,   21,   50,  109,   30,   37,   53,    5,   43,   44,
+       44,   55,   45,   56,   46,   47,   81,   79,   80,   82,
+       82,   82,   89,   89,   92,   93,   87,   31,   99,   66,
+       67,  103,   95,   95,  107,  107,  118,  110,  111,  114,
+      112,  113,  117,  116,  120,    7,    8,    8,    7,    7,
+        9,    7,   20,    7,   69,    7,    7,    7,  123,  127,
+      167,  129,  163,  163,  163,  163,  165,  161,  161,  161,
+      161,  160,   47,   84,  125,   84,  125,   84,   48,   17,
+       49,   21,   50,   50,    3,   23,   30,   30,   33,   37,
+
+       88,   77,   53,    6,    5,    5,    6,    6,   20,    6,
+        6,    6,   55,   45,   56,16443,   56,16443,   46,   87,
+       81,   82,   84,   89,   89,   92,   93,   87,   87,   87,
+       31,   31,16480,   99,   66,   67,  103,  104,  104,   95,
+       95,   95,   95,   91,  115,  117,  119,  119,  120,    7,
+        9,    9,   78,   69,  122,  125,  123,  123,  127,  163,
+      163,  163,  163,  163,  163,  163,  161,  161,  161,  161,
+      161,  161,  161,  193,  196,   10,   10,   10,   10,   20,
+       10,   10,   10,   10,  126,   84,  125,  126,   84,  125,
+      126,   84,  126,   20,  126,  126,  126,  126,   84,  125,
+
+      126,   84,  126,   84,   84,   12,   13,   48,   15,   16,
+       17,   18,   49,   21,   52,   50,   52,   52,   20,   52,
+       52,   52,   52,   50,   52,   51,   51,   51,   20,   51,
+       51,   51,   51,    2,    3,    3,    2,    4,    2,   20,
+        2,    2,    2,   22,   22,   28,   33,   33,   35,   37,
+       88,   88,   88,   41,   41,   54,   54,   77,   77,   77,
+       45,   58,   58,   20,   58,   58,   58,   58,   57,   57,
+       57,   20,   57,   57,   57,   57,   46,   46,   46,   71,
+       55,   55,   87,   87,   87,   87,   81,   84,   84,   84,
+       92,   93,   87,   87,   87,   20,   99,   66,  101,  103,
+
+      101,  103,   95,   95,   95,   91,   91,   91,  117,  117,
+      108,  120,    9,   70,   70,   78,   78,   78,   69,  125,
+      125,   73,  124,  123,  124,  123,  124,   20,  124,  124,
+      124,  124,  123,  124,  127,  127,  127,  163,  163,  163,
+      163,  163,  163,  161,  161,  161,  161,  161,  161,  126,
+       84,  126,   48,   15,   16,   17,   18,   49,   21,   21,
+       21,   51,   51,    4,    4,   28,   28,   34,   33,   34,
+       34,   20,   34,   34,   34,   34,   34,   34,   33,   34,
+       34,   34,   35,   37,   37,   37,   88,   88,   88,   41,
+       41,   40,   40,   77,   53,   43,   43,   44,   44,   44,
+
+       45,   45,   45,   57,   57,   46,   46,   46,   76,   47,
+       47,   48,   49,   53,   55,   66,   69,   48,   49,   50,
+       53,   55,   56,   66,   67,   69,   87,   87,   87,   87,
+      123,   81,   81,   82,   82,   84,   84,   84,   84,   84,
+       89,   92,   92,   92,   93,   93,   93,   87,   94,   94,
+       98,   98,   98,   20,   98,   98,   98,   98,   98,   98,
+       98,   99,   99,   99,  103,  102,  103,  102,   91,   91,
+       91,  117,  117,  120,  120,   78,   69,  125,  126,  125,
+      125,  126,   75,  124,  124,  125,  127,  127,  127,  126,
+       48,   85,   15,   16,   17,   17,   17,   18,   49,   21,
+
+       21,   21,    4,   29,   37,   37,   88,   32,   40,   40,
+       53,   43,   43,   45,   45, 8251, 8251, 8251,   20, 8251,
+     8251, 8251, 8251, 8251, 8251, 8251, 8251,   46,   76,   76,
+       76,   47,   47,   48,   49,   53,   55,   66,   69,   48,
+       49,   50,   53,   55,   56,16443,   66,   67,   69,   87,
+       87,  123,   87,  123,   81,   81,   82,   82,   82,   82,
+       82,   84,   84,   84,   87,   84,   84,   88,   87,   91,
+       92,   92,   92,   93,   93,   94,   94,   94,   94, 8288,
+     8288,   20, 8288,   99,   99,   99,   91,  117,  117,  120,
+      120,   69,  122,  122,   74,   74,   75,   75,   75,  124,
+
+      125,  127,    8,    8,   12,   12,   13,   13,   86,   85,
+       85,   86,   86,   20,   86,   86,   86,   86,   15,   15,
+       15,   16,   16,   17,   17,   17,   18,   18,   18,   21,
+       29,   29,   35,   35,   53,   43, 8251,   46,   76,   47,
+       47,   48,   49,   66,   69,   48,   49,   50,   52,   71,
+       66,   69,   73,   87,  123,  124,   87,  123,   87,  124,
+       87,  123,  124,   87,  124,   82,   82,   87,   88,   87,
+       87,   91,   93,   93,   94,   94,   94,   98,   98,   97,
+       98,   97,  101,  101,  105,  105,  106,  106,  105,  106,
+      117,  117,   69,  122,  122,   75,  125,  126,  125,  127,
+
+        1,    5,    8,   83,   12,   12,   13,   13,   86,   14,
+       14,   15,   15,   16,   16,   17,   18,   18,   18,   21,
+       30,   35,   35,   36,   38,   38,   53,   47,   47,   48,
+       49,   53,   69,   48,   49,   53,   69,   82,   82,   87,
+       87,   93,   93,   97,   97,  100,  100,  102,  102,   68,
+      113,   69,  123,  127,    1,    1,    3,    5,   12,   12,
+       13,   13,   14,   14,   17,   18,   21,   38,   38,   38,
+       41,   41,   42,   53,   48,   48,   49,   53,   69,   82,
+       82,   85,   85,   95,   95,   97,   97,  100,  100,  100,
+       68,  121,   69,  123,    3,   12,   12,   13,   13,   14,
+
+       14,   17,   18,   21,   41,   41,   41,   53,   53,   69,
+       85,   95,   95,   95,   97,   97,   90,   69,  123,  124,
+      123,   18,   32,   36,   36,   53,   68,   69,   60,   72,
+       62,   64,   97,   97,   90,   90,   90,  121,  121,   11,
+       11,   36,   36,   40,   40,   40,   42,   42,   53,   68,
+       69,   94,   94,   94,   31,   97,   97,   90,   90,   90,
+      111,  112,  121,  121,   26,   26,   39,   39,   40,   40,
+       40,   42,   42,   53,   69,   61,   61,   63,   63,   65,
+       65,   90,   94,   94,   94,   97,   97,   90,  121,  121,
+        1,    1,   25,   25,   24,   25,   24,   27,   27,   20,
+
+       27,   27,   27,   27,   27,   27,   39,   39,   39,   60,
+       72,   62,   64,   90,   79,  109,  110,  115,    1,    1,
+        1,  108,   28,   28,   79,   29,  116,   29,  114,   80,
+      118
     } ;
 
-static yyconst flex_int16_t yy_accept[2857] =
+static yyconst flex_int16_t yy_accept[2914] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -603,307 +614,314 @@ static yyconst flex_int16_t yy_accept[2857] =
 
         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    6,    8,   11,   14,   18,   22,   24,   26,   29,
-       32,   36,   40,   42,   44,   46,   48,   50,   52,   54,
-       56,   58,   60,   62,   64,   66,   68,   70,   72,   74,
-       76,   78,   80,   82,   84,   86,   88,   90,   93,   96,
-       99,  101,  103,  104,  106,  108,  110,  111,  112,  113,
-      114,  117,  119,  123,  125,  126,  127,  128,  129,  131,
-      133,  135,  138,  139,  140,  141,  144,  148,  149,  150,
-      151,  153,  156,  159,  162,  163,  165,  167,  169,  171,
-
-      173,  176,  177,  178,  179,  181,  184,  185,  186,  187,
-      189,  192,  193,  194,  195,  197,  200,  201,  202,  203,
-      205,  208,  209,  210,  211,  213,  216,  217,  218,  219,
-      221,  224,  225,  226,  227,  229,  232,  233,  234,  235,
-      237,  240,  241,  242,  243,  245,  248,  249,  250,  251,
-      253,  256,  257,  258,  259,  261,  264,  267,  269,  272,
-      274,  277,  278,  279,  280,  282,  285,  286,  287,  288,
-      290,  293,  294,  295,  296,  298,  301,  302,  303,  304,
-      306,  309,  312,  314,  317,  320,  323,  325,  327,  330,
-      333,  336,  338,  340,  343,  344,  345,  346,  348,  351,
-
-      352,  353,  354,  356,  359,  360,  361,  362,  364,  367,
-      368,  369,  370,  372,  375,  379,  383,  386,  388,  390,
-      393,  396,  398,  400,  403,  405,  408,  410,  412,  414,
-      416,  418,  420,  422,  424,  426,  428,  430,  432,  435,
-      436,  437,  438,  440,  443,  444,  445,  446,  448,  451,
-      452,  453,  454,  456,  459,  460,  461,  462,  464,  467,
-      470,  472,  474,  477,  480,  483,  485,  488,  489,  490,
-      491,  493,  496,  499,  500,  502,  505,  506,  507,  508,
-      510,  513,  516,  517,  519,  522,  523,  524,  525,  527,
-      530,  531,  532,  533,  535,  538,  539,  540,  541,  543,
-
-      547,  550,  553,  554,  555,  556,  558,  560,  563,  564,
-      565,  566,  568,  571,  572,  573,  574,  576,  579,  580,
-      581,  582,  584,  587,  588,  589,  590,  592,  595,  596,
-      597,  598,  600,  603,  604,  605,  606,  608,  611,  612,
-      613,  614,  615,  615,  615,  615,  616,  616,  616,  616,
-      616,  616,  616,  616,  616,  616,  616,  616,  616,  616,
-      616,  616,  616,  616,  616,  616,  616,  616,  616,  616,
-      616,  616,  616,  616,  616,  616,  616,  616,  616,  616,
-      616,  616,  616,  616,  616,  616,  616,  616,  616,  616,
-      616,  616,  616,  616,  616,  616,  616,  616,  616,  616,
-
-      616,  616,  616,  616,  617,  617,  618,  619,  619,  619,
-      620,  620,  620,  620,  620,  620,  620,  620,  620,  620,
-      621,  621,  621,  621,  621,  621,  621,  621,  621,  621,
-      621,  621,  622,  622,  622,  623,  623,  623,  623,  623,
-      623,  624,  624,  624,  625,  625,  625,  625,  626,  627,
-      627,  627,  629,  631,  631,  632,  633,  633,  633,  633,
-      633,  633,  634,  634,  634,  634,  634,  634,  636,  636,
-      636,  636,  636,  636,  637,  638,  639,  640,  641,  642,
-      642,  642,  642,  642,  643,  643,  644,  644,  645,  645,
-      645,  645,  645,  645,  646,  646,  646,  646,  646,  646,
-
-      647,  647,  647,  647,  647,  647,  648,  648,  648,  648,
-      648,  648,  649,  649,  649,  649,  649,  649,  650,  650,
-      650,  650,  650,  650,  651,  651,  651,  651,  651,  651,
-      652,  652,  652,  652,  652,  652,  653,  653,  653,  653,
+        5,    5,    5,    6,    8,   11,   14,   18,   22,   24,
+       26,   29,   32,   36,   40,   42,   44,   46,   48,   50,
+       52,   54,   56,   58,   60,   62,   64,   66,   68,   70,
+       72,   74,   76,   78,   80,   82,   84,   86,   88,   90,
+       93,   96,   99,  101,  103,  104,  106,  108,  110,  111,
+      112,  113,  114,  117,  119,  123,  125,  126,  127,  128,
+      129,  131,  133,  135,  138,  139,  140,  141,  144,  148,
+      149,  150,  151,  153,  156,  159,  162,  163,  165,  167,
+
+      169,  171,  173,  176,  177,  178,  179,  181,  184,  185,
+      186,  187,  189,  192,  193,  194,  195,  197,  200,  201,
+      202,  203,  205,  208,  209,  210,  211,  213,  216,  217,
+      218,  219,  221,  224,  225,  226,  227,  229,  232,  233,
+      234,  235,  237,  240,  241,  242,  243,  245,  248,  249,
+      250,  251,  253,  256,  257,  258,  259,  261,  264,  267,
+      269,  272,  274,  277,  278,  279,  280,  282,  285,  286,
+      287,  288,  290,  293,  294,  295,  296,  298,  301,  302,
+      303,  304,  306,  309,  312,  314,  317,  320,  323,  325,
+      327,  330,  333,  336,  338,  340,  343,  344,  345,  346,
+
+      348,  351,  352,  353,  354,  356,  359,  360,  361,  362,
+      364,  367,  368,  369,  370,  372,  375,  379,  383,  386,
+      388,  390,  393,  396,  398,  400,  403,  405,  408,  410,
+      412,  414,  416,  418,  420,  422,  424,  426,  428,  430,
+      432,  435,  436,  437,  438,  440,  443,  444,  445,  446,
+      448,  451,  452,  453,  454,  456,  459,  460,  461,  462,
+      464,  467,  470,  472,  474,  477,  480,  483,  485,  488,
+      489,  490,  491,  493,  496,  499,  500,  502,  505,  506,
+      507,  508,  510,  513,  516,  517,  519,  522,  523,  524,
+      525,  527,  530,  531,  532,  533,  535,  538,  539,  540,
+
+      541,  543,  547,  550,  553,  554,  555,  556,  558,  560,
+      563,  564,  565,  566,  568,  571,  572,  573,  574,  576,
+      579,  580,  581,  582,  584,  587,  588,  589,  590,  592,
+      595,  596,  597,  598,  600,  603,  604,  605,  606,  608,
+      611,  612,  613,  614,  616,  619,  620,  621,  622,  623,
+      623,  623,  623,  624,  624,  624,  624,  624,  624,  624,
+      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
+      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
+      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
+      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
+
+      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
+      624,  625,  625,  626,  626,  627,  627,  627,  628,  628,
+      628,  628,  628,  628,  628,  628,  628,  628,  629,  629,
+      629,  629,  629,  629,  629,  629,  629,  629,  629,  629,
+      630,  630,  630,  631,  631,  631,  631,  631,  631,  632,
+      632,  632,  633,  633,  633,  633,  634,  635,  635,  635,
+      637,  639,  639,  640,  641,  641,  641,  641,  641,  641,
+      642,  642,  642,  642,  642,  642,  644,  644,  644,  644,
+      644,  644,  645,  646,  647,  648,  649,  650,  650,  650,
+      650,  650,  651,  651,  652,  652,  653,  653,  653,  653,
+
       653,  653,  654,  654,  654,  654,  654,  654,  655,  655,
-      655,  655,  655,  655,  656,  657,  658,  658,  658,  658,
+      655,  655,  655,  655,  656,  656,  656,  656,  656,  656,
+      657,  657,  657,  657,  657,  657,  658,  658,  658,  658,
       658,  658,  659,  659,  659,  659,  659,  659,  660,  660,
       660,  660,  660,  660,  661,  661,  661,  661,  661,  661,
-      662,  663,  663,  663,  663,  663,  663,  664,  664,  664,
-      664,  664,  664,  665,  665,  665,  665,  665,  665,  666,
-
-      666,  666,  666,  666,  666,  668,  668,  669,  670,  671,
-      671,  671,  671,  671,  672,  672,  672,  672,  673,  673,
-      673,  673,  673,  673,  673,  673,  673,  673,  673,  673,
-      673,  673,  673,  673,  673,  673,  673,  673,  673,  673,
-      673,  673,  673,  673,  673,  674,  674,  674,  674,  674,
-      674,  675,  675,  675,  675,  675,  675,  676,  676,  676,
-      676,  676,  676,  677,  677,  677,  677,  677,  677,  678,
-      679,  680,  680,  680,  680,  680,  680,  681,  681,  682,
-      682,  682,  682,  682,  682,  683,  683,  684,  684,  684,
-      684,  684,  684,  685,  685,  685,  685,  685,  685,  686,
-
-      686,  686,  686,  686,  686,  687,  687,  687,  688,  689,
-      689,  689,  689,  689,  689,  690,  690,  690,  690,  690,
-      690,  691,  691,  691,  691,  691,  691,  692,  692,  692,
-      693,  693,  693,  693,  693,  693,  694,  694,  694,  694,
-      694,  694,  695,  695,  695,  695,  695,  695,  696,  696,
-      696,  696,  696,  696,  698,  698,  698,  699,  699,  700,
-      700,  700,  700,  701,  702,  703,  704,  705,  705,  705,
-      705,  706,  706,  706,  706,  706,  706,  707,  707,  707,
-      707,  707,  707,  708,  708,  708,  708,  708,  708,  709,
-      710,  711,  712,  713,  714,  715,  716,  716,  716,  717,
-
-      718,  718,  718,  718,  718,  719,  720,  721,  722,  723,
-      724,  724,  724,  724,  725,  726,  726,  726,  727,  728,
-      729,  729,  730,  730,  730,  731,  732,  733,  733,  733,
-      734,  734,  734,  735,  736,  736,  736,  737,  738,  738,
-      738,  738,  739,  740,  741,  742,  743,  744,  744,  744,
-      744,  744,  745,  746,  746,  746,  747,  748,  749,  750,
-      751,  753,  755,  757,  758,  759,  760,  760,  760,  760,
-      760,  761,  761,  761,  761,  761,  761,  762,  762,  762,
-      762,  762,  763,  763,  763,  763,  764,  764,  764,  764,
-      764,  764,  764,  764,  764,  764,  764,  764,  764,  764,
+      662,  662,  662,  662,  662,  662,  663,  663,  663,  663,
+      663,  663,  664,  665,  666,  666,  666,  666,  666,  666,
+      667,  667,  667,  667,  667,  667,  668,  668,  668,  668,
+      668,  668,  669,  669,  669,  669,  669,  669,  670,  671,
+      671,  671,  671,  671,  671,  672,  672,  672,  672,  672,
+
+      672,  673,  673,  673,  673,  673,  673,  674,  674,  674,
+      674,  674,  674,  676,  676,  677,  678,  679,  679,  679,
+      679,  679,  680,  680,  680,  680,  681,  681,  681,  681,
+      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,
+      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,
+      681,  681,  681,  682,  682,  682,  682,  682,  682,  683,
+      683,  683,  683,  683,  683,  684,  684,  684,  684,  684,
+      684,  685,  685,  685,  685,  685,  685,  686,  687,  688,
+      688,  688,  688,  688,  688,  689,  689,  690,  690,  690,
+      690,  690,  690,  691,  691,  692,  692,  692,  692,  692,
+
+      692,  693,  693,  693,  693,  693,  693,  694,  694,  694,
+      694,  694,  694,  695,  695,  695,  696,  697,  697,  697,
+      697,  697,  697,  698,  698,  698,  698,  698,  698,  699,
+      699,  699,  699,  699,  699,  700,  700,  700,  701,  701,
+      701,  701,  701,  701,  702,  702,  702,  702,  702,  702,
+      703,  703,  703,  703,  703,  703,  704,  704,  704,  704,
+      704,  704,  705,  705,  705,  705,  705,  705,  707,  707,
+      707,  708,  708,  708,  709,  709,  709,  709,  710,  711,
+      712,  713,  714,  714,  714,  714,  715,  715,  715,  715,
+      715,  715,  716,  716,  716,  716,  716,  716,  717,  717,
+
+      717,  717,  717,  717,  718,  719,  720,  721,  722,  723,
+      724,  725,  725,  725,  726,  726,  727,  727,  727,  727,
+      727,  728,  729,  730,  731,  732,  733,  733,  733,  733,
+      734,  735,  735,  735,  736,  737,  738,  738,  739,  739,
+      739,  740,  741,  742,  742,  742,  743,  743,  743,  744,
+      745,  745,  745,  746,  747,  747,  747,  747,  748,  749,
+      750,  751,  752,  753,  753,  753,  753,  753,  754,  755,
+      755,  755,  756,  757,  758,  759,  760,  762,  764,  766,
+      767,  768,  769,  769,  769,  769,  769,  770,  770,  770,
+      770,  770,  770,  771,  771,  771,  771,  771,  772,  772,
+
+      772,  772,  773,  773,  773,  773,  773,  773,  773,  773,
+      773,  773,  773,  773,  773,  773,  773,  773,  773,  773,
+      773,  773,  773,  774,  774,  775,  775,  775,  775,  775,
+      776,  776,  776,  776,  776,  777,  777,  777,  777,  777,
+      777,  778,  779,  779,  780,  780,  780,  780,  780,  781,
+      781,  781,  781,  781,  782,  782,  782,  782,  783,  783,
+      783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
+      783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
+      783,  784,  784,  784,  784,  784,  784,  784,  786,  788,
+      789,  789,  789,  789,  789,  790,  790,  791,  791,  792,
+
+      792,  792,  793,  794,  795,  795,  796,  797,  797,  797,
+      797,  797,  797,  798,  799,  799,  800,  800,  800,  800,
+      800,  800,  801,  801,  801,  802,  802,  802,  802,  802,
+      803,  804,  805,  806,  807,  808,  810,  811,  812,  813,
+      813,  813,  813,  813,  813,  814,  814,  814,  815,  817,
+      819,  819,  819,  819,  820,  820,  820,  820,  820,  820,
+      820,  820,  820,  820,  820,  820,  820,  820,  820,  820,
+      820,  820,  820,  820,  820,  820,  820,  821,  821,  821,
+      822,  822,  822,  823,  823,  824,  824,  824,  824,  824,
+      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
+
+      824,  824,  824,  825,  826,  826,  826,  826,  827,  827,
+      827,  828,  829,  830,  831,  831,  832,  833,  833,  834,
+      834,  834,  834,  834,  835,  836,  837,  837,  837,  837,
+      837,  837,  837,  838,  839,  840,  840,  840,  841,  842,
+      843,  844,  844,  844,  844,  844,  844,  844,  845,  846,
+      846,  846,  846,  847,  847,  848,  849,  849,  849,  849,
+      850,  852,  853,  853,  853,  854,  855,  856,  856,  857,
+      857,  858,  859,  859,  859,  859,  859,  859,  859,  859,
+      860,  860,  860,  861,  861,  861,  861,  861,  862,  862,
+      862,  862,  862,  863,  863,  863,  863,  863,  864,  864,
+
+      864,  864,  864,  864,  865,  865,  865,  865,  865,  866,
+      866,  866,  866,  866,  867,  867,  867,  867,  867,  867,
+      868,  868,  868,  868,  868,  869,  869,  869,  869,  869,
+      870,  870,  870,  870,  870,  871,  871,  871,  871,  871,
+      871,  872,  872,  872,  872,  872,  873,  873,  873,  873,
+      873,  874,  874,  874,  874,  874,  875,  876,  876,  876,
+      877,  878,  879,  881,  882,  883,  884,  885,  885,  885,
+      886,  889,  891,  892,  894,  896,  896,  897,  898,  899,
+      902,  904,  904,  905,  906,  906,  906,  907,  908,  909,
+      909,  910,  911,  911,  911,  912,  913,  914,  914,  914,
+
+      915,  916,  918,  919,  921,  922,  923,  924,  926,  926,
+      927,  928,  928,  929,  931,  932,  933,  934,  935,  936,
+      937,  938,  939,  941,  942,  943,  944,  945,  946,  946,
+      947,  947,  947,  947,  947,  948,  949,  949,  950,  950,
+      950,  950,  951,  951,  951,  952,  953,  954,  954,  955,
+      956,  956,  957,  958,  959,  960,  961,  961,  961,  961,
+      961,  961,  961,  961,  961,  962,  963,  964,  966,  967,
+      968,  969,  969,  970,  971,  971,  972,  974,  975,  976,
+      977,  978,  979,  980,  981,  981,  981,  981,  981,  981,
+      981,  982,  982,  982,  982,  982,  982,  982,  982,  982,
 
-      764,  764,  764,  764,  764,  764,  764,  765,  765,  766,
-      766,  766,  766,  766,  767,  767,  767,  767,  767,  768,
-      768,  768,  768,  768,  768,  769,  770,  770,  771,  771,
-      771,  771,  771,  772,  772,  772,  772,  772,  773,  773,
-      773,  773,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  775,  775,  775,  775,  775,  775,
-      775,  777,  779,  780,  780,  780,  780,  781,  781,  782,
-      782,  783,  783,  783,  784,  785,  786,  786,  787,  788,
-      788,  788,  788,  788,  788,  789,  790,  790,  791,  791,
-
-      791,  791,  791,  791,  792,  792,  792,  793,  793,  793,
-      793,  793,  794,  795,  796,  797,  798,  799,  801,  802,
-      803,  804,  804,  804,  804,  804,  804,  805,  805,  805,
-      806,  808,  810,  810,  810,  810,  811,  811,  811,  811,
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-      811,  811,  811,  811,  811,  811,  812,  812,  812,  813,
-      813,  813,  814,  814,  815,  815,  815,  815,  815,  815,
-      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
-      815,  815,  816,  817,  817,  817,  817,  818,  818,  818,
-      819,  820,  821,  822,  822,  823,  824,  824,  825,  825,
-
-      825,  825,  825,  826,  827,  828,  828,  828,  828,  828,
-      828,  828,  829,  830,  831,  831,  831,  832,  833,  834,
-      835,  835,  835,  835,  835,  835,  835,  836,  837,  837,
-      837,  837,  838,  838,  839,  840,  840,  840,  840,  841,
-      843,  844,  844,  844,  845,  846,  847,  847,  848,  848,
-      849,  850,  850,  850,  850,  850,  850,  850,  850,  851,
-      851,  851,  852,  852,  852,  852,  852,  853,  853,  853,
-      853,  853,  854,  854,  854,  854,  854,  855,  855,  855,
-      855,  855,  855,  856,  856,  856,  856,  856,  857,  857,
-      857,  857,  857,  858,  858,  858,  858,  858,  858,  859,
-
-      859,  859,  859,  859,  860,  860,  860,  860,  860,  861,
-      861,  861,  861,  861,  862,  862,  862,  862,  862,  862,
-      863,  863,  863,  863,  863,  864,  864,  864,  864,  864,
-      865,  865,  865,  865,  865,  866,  867,  867,  867,  868,
-      869,  870,  872,  873,  874,  875,  876,  876,  876,  877,
-      880,  882,  883,  885,  887,  887,  888,  889,  890,  893,
-      895,  895,  896,  897,  897,  897,  898,  899,  899,  900,
-      901,  901,  901,  902,  903,  904,  904,  904,  905,  906,
-      908,  909,  911,  912,  913,  914,  916,  916,  917,  918,
-      918,  919,  921,  922,  923,  924,  925,  926,  927,  928,
-
-      929,  931,  932,  933,  934,  935,  936,  936,  937,  937,
-      937,  937,  937,  938,  939,  939,  940,  940,  940,  940,
-      941,  941,  941,  942,  943,  944,  944,  945,  946,  946,
-      947,  948,  949,  950,  951,  951,  951,  951,  951,  951,
-      951,  951,  951,  952,  953,  954,  956,  957,  958,  959,
-      959,  960,  961,  961,  962,  964,  965,  966,  967,  968,
-      969,  970,  970,  970,  970,  970,  970,  970,  971,  971,
-      971,  971,  971,  971,  971,  971,  971,  972,  972,  972,
-      972,  972,  972,  972,  972,  972,  973,  974,  975,  976,
-      976,  976,  977,  977,  977,  977,  978,  979,  980,  980,
+      983,  983,  983,  983,  983,  983,  983,  983,  983,  983,
+      984,  985,  986,  987,  987,  987,  988,  988,  988,  988,
+      989,  990,  991,  991,  991,  991,  991,  991,  991,  991,
+      991,  991,  991,  991,  991,  991,  991,  991,  991,  992,
+      992,  992,  993,  994,  995,  996,  996,  996,  996,  996,
+      996,  996,  997,  997,  997,  997,  997,  997,  998,  999,
+     1000, 1001, 1001, 1002, 1003, 1003, 1003, 1003, 1004, 1005,
+     1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006,
+     1007, 1008, 1009, 1010, 1011, 1012, 1012, 1012, 1012, 1012,
+     1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1020, 1020,
+
+     1020, 1021, 1022, 1023, 1024, 1026, 1027, 1028, 1030, 1030,
+     1031, 1032, 1033, 1035, 1035, 1035, 1035, 1035, 1035, 1035,
+     1036, 1037, 1038, 1038, 1039, 1039, 1039, 1039, 1039, 1040,
+     1040, 1040, 1040, 1040, 1041, 1041, 1041, 1041, 1041, 1042,
+     1042, 1042, 1042, 1042, 1043, 1043, 1043, 1043, 1043, 1044,
+     1044, 1044, 1044, 1044, 1045, 1045, 1045, 1045, 1045, 1046,
+     1046, 1046, 1046, 1046, 1047, 1047, 1047, 1047, 1047, 1048,
+     1048, 1048, 1048, 1048, 1049, 1049, 1049, 1049, 1049, 1050,
+     1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1051,
+     1051, 1052, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
+
+     1054, 1054, 1054, 1054, 1054, 1054, 1055, 1055, 1055, 1056,
+     1056, 1056, 1057, 1057, 1057, 1058, 1059, 1060, 1061, 1062,
+     1063, 1063, 1064, 1065, 1066, 1066, 1067, 1068, 1068, 1068,
+     1068, 1068, 1069, 1071, 1072, 1074, 1075, 1076, 1077, 1078,
+     1079, 1081, 1082, 1083, 1083, 1083, 1083, 1084, 1084, 1085,
+     1086, 1087, 1087, 1087, 1087, 1088, 1089, 1090, 1090, 1091,
+     1092, 1092, 1092, 1092, 1092, 1093, 1094, 1095, 1096, 1097,
+     1098, 1098, 1099, 1100, 1100, 1101, 1101, 1102, 1103, 1104,
+     1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104,
+     1105, 1105, 1106, 1107, 1108, 1109, 1109, 1109, 1110, 1111,
+
+     1112, 1113, 1114, 1115, 1116, 1116, 1117, 1118, 1119, 1120,
+     1121, 1122, 1123, 1124, 1124, 1124, 1124, 1125, 1126, 1126,
+     1127, 1127, 1128, 1129, 1130, 1132, 1133, 1134, 1135, 1136,
+     1136, 1137, 1138, 1139, 1140, 1140, 1140, 1141, 1141, 1141,
+     1141, 1142, 1142, 1142, 1142, 1143, 1144, 1145, 1146, 1147,
+     1148, 1149, 1149, 1149, 1149, 1149, 1150, 1151, 1151, 1151,
+     1151, 1151, 1152, 1153, 1154, 1156, 1157, 1158, 1159, 1160,
+     1161, 1162, 1163, 1164, 1165, 1165, 1165, 1165, 1166, 1167,
+     1167, 1168, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169,
+     1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169,
+
+     1169, 1169, 1169, 1169, 1169, 1169, 1170, 1171, 1172, 1173,
+     1174, 1174, 1174, 1175, 1176, 1177, 1177, 1177, 1178, 1178,
+     1178, 1178, 1180, 1181, 1183, 1183, 1183, 1184, 1185, 1185,
+     1186, 1186, 1186, 1187, 1187, 1188, 1189, 1190, 1190, 1190,
+     1190, 1190, 1190, 1190, 1190, 1190, 1190, 1191, 1191, 1191,
+     1191, 1191, 1191, 1191, 1193, 1193, 1193, 1193, 1193, 1193,
+     1194, 1194, 1194, 1195, 1196, 1197, 1198, 1198, 1198, 1199,
+     1200, 1201, 1202, 1203, 1204, 1204, 1204, 1204, 1204, 1205,
+     1205, 1205, 1205, 1205, 1205, 1205, 1205, 1206, 1207, 1207,
+     1207, 1207, 1207, 1208, 1209, 1209, 1209, 1209, 1209, 1210,
+
+     1211, 1211, 1212, 1213, 1214, 1214, 1215, 1216, 1217, 1218,
+     1218, 1219, 1221, 1222, 1223, 1224, 1225, 1225, 1226, 1226,
+     1226, 1226, 1227, 1228, 1228, 1229, 1230, 1231, 1232, 1233,
+     1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243,
+     1243, 1244, 1245, 1247, 1247, 1247, 1247, 1248, 1249, 1249,
+     1249, 1250, 1250, 1251, 1253, 1255, 1256, 1257, 1258, 1259,
+     1260, 1261, 1262, 1262, 1263, 1264, 1265, 1265, 1266, 1267,
+     1268, 1268, 1269, 1270, 1270, 1270, 1271, 1272, 1273, 1274,
+     1275, 1276, 1276, 1276, 1276, 1276, 1277, 1278, 1279, 1280,
+     1280, 1281, 1282, 1284, 1284, 1284, 1284, 1284, 1284, 1284,
+
+     1285, 1286, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287,
+     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287,
+     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287,
+     1287, 1287, 1287, 1287, 1288, 1289, 1290, 1290, 1290, 1291,
+     1292, 1292, 1293, 1294, 1295, 1295, 1296, 1297, 1298, 1299,
+     1300, 1301, 1301, 1302, 1302, 1303, 1303, 1303, 1304, 1304,
+     1304, 1305, 1305, 1305, 1305, 1306, 1307, 1308, 1309, 1310,
+     1311, 1312, 1313, 1314, 1316, 1317, 1318, 1319, 1319, 1319,
+     1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329,
+     1330, 1331, 1331, 1331, 1331, 1331, 1331, 1332, 1333, 1333,
+
+     1333, 1333, 1334, 1335, 1335, 1335, 1335, 1335, 1335, 1335,
+     1335, 1335, 1335, 1335, 1336, 1337, 1338, 1339, 1340, 1341,
+     1342, 1343, 1344, 1344, 1345, 1346, 1347, 1348, 1350, 1350,
+     1351, 1351, 1351, 1352, 1352, 1353, 1354, 1357, 1359, 1361,
+     1364, 1366, 1367, 1368, 1368, 1368, 1368, 1368, 1368, 1369,
+     1369, 1370, 1371, 1372, 1372, 1372, 1373, 1374, 1375, 1375,
+     1375, 1375, 1375, 1376, 1377, 1378, 1378, 1378, 1379, 1380,
+     1381, 1382, 1383, 1383, 1383, 1384, 1384, 1385, 1385, 1385,
+     1385, 1386, 1387, 1387, 1388, 1389, 1389, 1390, 1390, 1391,
+     1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391,
 
-      980,  980,  980,  980,  980,  980,  980,  980,  980,  980,
-      980,  980,  980,  980,  980,  981,  981,  981,  982,  983,
-      984,  985,  985,  985,  985,  985,  985,  985,  986,  986,
-      986,  986,  986,  986,  987,  988,  989,  990,  990,  991,
-      992,  992,  992,  992,  993,  994,  995,  995,  995,  995,
-      995,  995,  995,  995,  995,  995,  996,  997,  998,  999,
-     1000, 1001, 1001, 1001, 1001, 1001, 1002, 1003, 1004, 1005,
-     1006, 1007, 1008, 1009, 1009, 1009, 1009, 1010, 1011, 1012,
-     1013, 1015, 1016, 1017, 1019, 1019, 1020, 1021, 1022, 1024,
-     1024, 1024, 1024, 1024, 1024, 1024, 1025, 1026, 1027, 1027,
-
-     1028, 1028, 1028, 1028, 1028, 1029, 1029, 1029, 1029, 1029,
-     1030, 1030, 1030, 1030, 1030, 1031, 1031, 1031, 1031, 1031,
-     1032, 1032, 1032, 1032, 1032, 1033, 1033, 1033, 1033, 1033,
-     1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1035, 1035,
-     1036, 1036, 1036, 1036, 1036, 1037, 1037, 1037, 1037, 1037,
-     1038, 1038, 1038, 1038, 1038, 1039, 1039, 1039, 1039, 1039,
-     1039, 1039, 1039, 1039, 1039, 1040, 1040, 1041, 1042, 1042,
-     1042, 1042, 1042, 1042, 1043, 1043, 1043, 1043, 1043, 1043,
-     1044, 1044, 1044, 1045, 1045, 1045, 1046, 1046, 1046, 1047,
-     1048, 1049, 1050, 1051, 1052, 1052, 1053, 1054, 1055, 1055,
-
-     1056, 1057, 1057, 1057, 1057, 1057, 1058, 1060, 1061, 1063,
-     1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072, 1072, 1072,
-     1072, 1073, 1073, 1074, 1075, 1076, 1076, 1076, 1076, 1077,
-     1078, 1079, 1079, 1080, 1081, 1081, 1081, 1081, 1081, 1082,
-     1083, 1084, 1085, 1086, 1087, 1087, 1088, 1089, 1089, 1090,
-     1090, 1091, 1092, 1093, 1093, 1093, 1093, 1093, 1093, 1093,
-     1093, 1093, 1093, 1093, 1094, 1094, 1095, 1096, 1097, 1098,
-     1099, 1100, 1101, 1102, 1103, 1104, 1104, 1105, 1106, 1107,
-     1108, 1109, 1110, 1111, 1112, 1112, 1112, 1113, 1114, 1114,
-     1115, 1115, 1116, 1117, 1118, 1120, 1121, 1122, 1123, 1124,
-
-     1124, 1125, 1126, 1127, 1128, 1128, 1128, 1129, 1129, 1129,
-     1129, 1130, 1130, 1130, 1130, 1131, 1132, 1133, 1134, 1135,
-     1136, 1137, 1137, 1137, 1137, 1137, 1138, 1139, 1139, 1139,
-     1139, 1139, 1140, 1141, 1142, 1144, 1145, 1146, 1147, 1148,
-     1149, 1150, 1151, 1152, 1153, 1153, 1153, 1153, 1154, 1155,
-     1155, 1156, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157,
-     1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157,
-     1157, 1157, 1157, 1157, 1157, 1157, 1158, 1159, 1160, 1161,
-     1162, 1162, 1162, 1163, 1164, 1165, 1165, 1165, 1166, 1166,
-     1166, 1166, 1168, 1169, 1171, 1171, 1171, 1172, 1173, 1173,
-
-     1174, 1174, 1174, 1175, 1175, 1176, 1177, 1178, 1178, 1178,
-     1178, 1178, 1178, 1178, 1178, 1178, 1178, 1179, 1179, 1179,
-     1179, 1179, 1181, 1181, 1181, 1181, 1181, 1181, 1182, 1182,
-     1182, 1183, 1184, 1185, 1186, 1186, 1186, 1187, 1188, 1189,
-     1190, 1191, 1192, 1192, 1192, 1192, 1192, 1193, 1193, 1193,
-     1193, 1193, 1193, 1193, 1193, 1194, 1195, 1195, 1195, 1195,
-     1195, 1196, 1197, 1197, 1197, 1197, 1197, 1198, 1199, 1199,
-     1200, 1201, 1202, 1202, 1203, 1204, 1205, 1206, 1206, 1207,
-     1209, 1210, 1211, 1212, 1213, 1213, 1214, 1214, 1214, 1214,
-     1215, 1216, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223,
-
-     1224, 1225, 1226, 1227, 1228, 1228, 1229, 1230, 1232, 1232,
-     1232, 1233, 1234, 1234, 1234, 1235, 1235, 1236, 1238, 1240,
-     1241, 1242, 1243, 1244, 1245, 1246, 1247, 1247, 1248, 1249,
-     1250, 1250, 1251, 1252, 1253, 1253, 1254, 1255, 1255, 1255,
-     1256, 1257, 1258, 1259, 1260, 1261, 1261, 1261, 1261, 1261,
-     1262, 1263, 1264, 1265, 1265, 1266, 1267, 1269, 1269, 1269,
-     1269, 1269, 1269, 1269, 1270, 1271, 1272, 1272, 1272, 1272,
-     1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272,
-     1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272,
-     1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1273, 1274,
-
-     1275, 1275, 1275, 1276, 1277, 1277, 1278, 1279, 1280, 1280,
-     1281, 1282, 1283, 1284, 1285, 1286, 1286, 1287, 1287, 1288,
-     1288, 1288, 1289, 1289, 1289, 1290, 1290, 1290, 1290, 1291,
-     1292, 1293, 1294, 1295, 1296, 1297, 1299, 1300, 1301, 1302,
-     1302, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310,
-     1311, 1312, 1313, 1314, 1314, 1314, 1314, 1314, 1314, 1315,
-     1316, 1316, 1316, 1316, 1317, 1318, 1318, 1318, 1318, 1318,
-     1318, 1318, 1318, 1318, 1318, 1318, 1319, 1320, 1321, 1322,
-     1323, 1324, 1325, 1326, 1326, 1327, 1328, 1329, 1330, 1332,
-     1332, 1332, 1332, 1333, 1333, 1334, 1335, 1338, 1340, 1342,
-
-     1345, 1347, 1348, 1349, 1349, 1349, 1349, 1349, 1350, 1350,
-     1351, 1352, 1353, 1353, 1353, 1354, 1355, 1356, 1356, 1356,
-     1356, 1356, 1357, 1358, 1359, 1359, 1359, 1360, 1361, 1362,
-     1363, 1364, 1364, 1364, 1365, 1365, 1366, 1366, 1366, 1366,
-     1367, 1368, 1368, 1369, 1370, 1370, 1371, 1371, 1372, 1372,
-     1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372,
-     1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1373,
-     1374, 1374, 1374, 1374, 1375, 1376, 1377, 1378, 1378, 1380,
-     1381, 1381, 1382, 1383, 1383, 1384, 1385, 1385, 1386, 1387,
-     1388, 1389, 1389, 1389, 1390, 1391, 1392, 1393, 1394, 1395,
-
-     1396, 1397, 1398, 1399, 1400, 1400, 1400, 1400, 1400, 1400,
-     1400, 1400, 1401, 1401, 1401, 1402, 1403, 1404, 1405, 1406,
-     1406, 1406, 1406, 1406, 1406, 1406, 1406, 1407, 1408, 1409,
-     1410, 1411, 1412, 1413, 1414, 1415, 1416, 1416, 1416, 1416,
-     1416, 1417, 1417, 1418, 1419, 1419, 1419, 1419, 1419, 1420,
-     1420, 1421, 1421, 1422, 1423, 1423, 1423, 1423, 1423, 1423,
-     1423, 1424, 1425, 1426, 1427, 1428, 1429, 1429, 1430, 1430,
-     1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-     1430, 1430, 1430, 1430, 1430, 1430, 1430, 1431, 1431, 1431,
-     1431, 1431, 1431, 1431, 1432, 1433, 1434, 1435, 1436, 1437,
-
-     1438, 1438, 1439, 1440, 1440, 1441, 1442, 1443, 1444, 1445,
-     1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445,
-     1445, 1445, 1446, 1447, 1448, 1448, 1448, 1448, 1449, 1449,
-     1450, 1451, 1452, 1453, 1454, 1455, 1456, 1456, 1456, 1456,
-     1457, 1458, 1459, 1459, 1459, 1459, 1460, 1461, 1461, 1461,
-     1462, 1462, 1463, 1463, 1463, 1464, 1465, 1466, 1467, 1468,
-     1468, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469,
-     1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469,
-     1469, 1469, 1469, 1469, 1469, 1470, 1471, 1472, 1472, 1472,
-     1473, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1480,
-
-     1480, 1480, 1480, 1480, 1480, 1480, 1480, 1480, 1480, 1480,
-     1480, 1480, 1480, 1480, 1481, 1482, 1482, 1483, 1483, 1483,
-     1484, 1485, 1485, 1485, 1485, 1485, 1485, 1486, 1486, 1486,
-     1486, 1487, 1487, 1487, 1488, 1489, 1489, 1490, 1490, 1490,
-     1491, 1492, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493,
-     1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493,
-     1493, 1493, 1493, 1493, 1493, 1494, 1496, 1497, 1497, 1497,
-     1497, 1498, 1498, 1498, 1498, 1498, 1498, 1498, 1498, 1498,
-     1499, 1499, 1500, 1501, 1501, 1501, 1501, 1501, 1501, 1501,
-     1502, 1502, 1502, 1502, 1502, 1503, 1504, 1505, 1506, 1507,
-
-     1507, 1507, 1507, 1507, 1507, 1508, 1509, 1510, 1511, 1512,
-     1512, 1512, 1512, 1512, 1512, 1512, 1512, 1512, 1512, 1512,
-     1512, 1512, 1512, 1512, 1512, 1512, 1512, 1512, 1513, 1514,
-     1514, 1514, 1515, 1516, 1516, 1516, 1516, 1516, 1516, 1516,
-     1516, 1516, 1517, 1518, 1518, 1518, 1519, 1520, 1521, 1522,
-     1523, 1524, 1524, 1524, 1524, 1524, 1525, 1526, 1526, 1526,
-     1526, 1526, 1526, 1526, 1526, 1527, 1528, 1529, 1530, 1530,
-     1531, 1532, 1533, 1534, 1535, 1535, 1535, 1535, 1535, 1535,
-     1535, 1535, 1535, 1536, 1536, 1537, 1537, 1537, 1537, 1537,
-     1537, 1538, 1539, 1539, 1539, 1539, 1539, 1540, 1541, 1541,
-
-     1541, 1541, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548,
-     1549, 1549, 1549, 1549, 1549, 1550, 1551, 1552, 1553, 1554,
-     1555, 1556, 1557, 1558, 1559, 1560, 1560, 1561, 1562, 1563,
-     1563, 1563, 1563, 1563, 1563, 1563, 1563, 1563, 1563, 1563,
-     1563, 1563, 1563, 1563, 1564, 1565, 1566, 1567, 1568, 1569,
-     1570, 1571, 1572, 1573, 1573, 1573, 1574, 1576, 1577, 1578,
-     1579, 1580, 1580, 1581, 1581, 1581, 1581, 1581, 1582, 1583,
-     1584, 1585, 1586, 1587, 1587, 1588, 1589, 1589, 1589, 1589,
-     1590, 1591, 1591, 1592, 1592, 1592, 1592, 1592, 1593, 1594,
-     1595, 1595, 1595, 1595, 1595, 1595, 1595, 1595, 1595, 1595,
-
-     1595, 1595, 1595, 1595, 1595, 1595, 1596, 1596, 1596, 1596,
-     1596, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597,
-     1597, 1597, 1598, 1598, 1599, 1599, 1599, 1599, 1599, 1599,
-     1599, 1599, 1600, 1600, 1600, 1600, 1600, 1601, 1601, 1601,
-     1602, 1602, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603,
-     1603, 1604, 1604, 1604, 1605, 1605
+     1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391,
+     1392, 1393, 1393, 1393, 1393, 1394, 1395, 1396, 1397, 1397,
+     1399, 1400, 1400, 1401, 1402, 1402, 1403, 1404, 1404, 1405,
+     1406, 1407, 1408, 1409, 1410, 1410, 1410, 1411, 1412, 1413,
+     1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1421, 1421,
+     1421, 1421, 1421, 1421, 1421, 1422, 1422, 1422, 1423, 1424,
+     1425, 1426, 1427, 1427, 1427, 1427, 1427, 1427, 1427, 1427,
+     1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437,
+     1437, 1437, 1437, 1437, 1437, 1438, 1438, 1439, 1440, 1440,
+     1440, 1440, 1440, 1440, 1441, 1441, 1442, 1442, 1443, 1444,
+
+     1444, 1444, 1444, 1444, 1444, 1444, 1445, 1446, 1447, 1448,
+     1449, 1450, 1450, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
+     1451, 1451, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1453,
+     1454, 1455, 1456, 1457, 1458, 1459, 1459, 1460, 1461, 1462,
+     1463, 1463, 1464, 1465, 1466, 1467, 1468, 1468, 1468, 1468,
+     1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1469,
+     1470, 1471, 1471, 1471, 1471, 1472, 1472, 1473, 1474, 1475,
+     1476, 1477, 1478, 1479, 1479, 1479, 1479, 1480, 1481, 1482,
+     1482, 1482, 1482, 1482, 1483, 1484, 1484, 1484, 1485, 1485,
+
+     1486, 1486, 1486, 1487, 1488, 1489, 1490, 1491, 1491, 1492,
+     1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
+     1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492,
+     1492, 1492, 1492, 1493, 1494, 1495, 1495, 1495, 1496, 1496,
+     1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1505,
+     1505, 1505, 1505, 1505, 1505, 1505, 1505, 1505, 1505, 1505,
+     1505, 1505, 1505, 1505, 1506, 1507, 1507, 1508, 1508, 1508,
+     1509, 1510, 1510, 1510, 1510, 1510, 1510, 1510, 1511, 1511,
+     1511, 1511, 1511, 1512, 1512, 1512, 1513, 1514, 1514, 1515,
+     1515, 1515, 1516, 1517, 1518, 1518, 1518, 1518, 1518, 1518,
+
+     1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518,
+     1518, 1518, 1518, 1518, 1518, 1518, 1518, 1519, 1521, 1522,
+     1522, 1522, 1522, 1523, 1523, 1523, 1523, 1523, 1523, 1523,
+     1523, 1523, 1524, 1524, 1525, 1526, 1526, 1526, 1526, 1526,
+     1526, 1526, 1527, 1527, 1527, 1527, 1527, 1527, 1528, 1529,
+     1530, 1531, 1532, 1533, 1533, 1533, 1533, 1533, 1533, 1534,
+     1535, 1536, 1537, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
+     1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
+     1538, 1538, 1539, 1540, 1540, 1540, 1541, 1542, 1542, 1542,
+     1542, 1542, 1542, 1542, 1542, 1542, 1543, 1544, 1544, 1544,
+
+     1545, 1546, 1547, 1548, 1549, 1550, 1550, 1550, 1550, 1550,
+     1550, 1551, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552,
+     1553, 1554, 1555, 1556, 1556, 1557, 1558, 1559, 1560, 1561,
+     1561, 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1562, 1562,
+     1563, 1563, 1563, 1563, 1563, 1563, 1564, 1565, 1565, 1565,
+     1565, 1565, 1566, 1567, 1567, 1567, 1567, 1567, 1568, 1569,
+     1570, 1571, 1572, 1573, 1574, 1575, 1575, 1575, 1575, 1575,
+     1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584,
+     1585, 1586, 1586, 1587, 1588, 1589, 1589, 1589, 1589, 1589,
+     1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589,
+
+     1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599,
+     1599, 1599, 1600, 1602, 1603, 1604, 1605, 1606, 1606, 1607,
+     1607, 1607, 1607, 1607, 1608, 1609, 1610, 1611, 1612, 1613,
+     1614, 1614, 1615, 1616, 1616, 1616, 1616, 1617, 1618, 1618,
+     1619, 1619, 1619, 1619, 1619, 1620, 1621, 1622, 1622, 1622,
+     1622, 1622, 1622, 1622, 1622, 1622, 1622, 1622, 1622, 1622,
+     1622, 1622, 1622, 1623, 1623, 1623, 1623, 1623, 1624, 1624,
+     1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1625,
+     1625, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1627,
+     1627, 1627, 1627, 1627, 1628, 1628, 1628, 1629, 1629, 1630,
+
+     1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1631, 1631,
+     1631, 1632, 1632
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -951,7 +969,7 @@ static yyconst flex_int32_t yy_meta[85] =
         8,    8,   11,   11
     } ;
 
-static yyconst flex_int16_t yy_base[3398] =
+static yyconst flex_int16_t yy_base[3463] =
     {   0,
         0,    9,   93,    0,  177,    0,  259,  263,  269,    0,
       353,    0,  437,    0,  521,    0,  605,    0,  689,    0,
@@ -966,3701 +984,3768 @@ static yyconst flex_int16_t yy_base[3398] =
 
      3061,    0, 3145,    0, 2866, 3227, 3251,    0, 3335,    0,
      3419,    0, 3503,    0, 3587,    0, 3671,    0, 3755,    0,
-    11605,26441,26441,26441,26441,26441,    0, 3838, 3920, 4001,
-        0, 1817, 2719,11551, 2729, 1799, 2836,11564, 3200, 1822,
-     2848,  232, 1420,11551, 3195,11543, 3814, 3822, 3838, 1802,
-    11547, 2841,11550, 4081,    0,    0,26441,26441,26441,26441,
-    26441,26441, 3814,11568,26441,26441,26441,    0,    0,    0,
-     4165,11561,    0,26441,11559, 4237, 4256, 4275,26441,26441,
-     3824, 3901, 4343,    0,    0, 3935, 3952, 4423,    0,    0,
-     4507,    0,    0,    0, 3962,    0, 4587, 2744, 2749, 3972,
-
-     3982, 4667,    0,    0, 4018, 4028, 4747,    0,    0, 4038,
-     4048, 4827,    0,    0, 4081, 4178, 4907,    0,    0, 4188,
-     4198, 4987,    0,    0, 4208, 4276, 5067,    0,    0, 4286,
-     4296, 5147,    0,    0, 4306, 4343, 5227,    0,    0, 4356,
-     4366, 5307,    0,    0, 4376, 4386, 5387,    0,    0, 4423,
-     4520, 5467,    0,    0,    0,    0,    0,    0,    0, 4539,
-     4549, 5547,    0,    0, 4600, 4610, 5627,    0,    0, 4620,
-     4630, 5707,    0,    0, 4667, 4680, 5787,    0,    0,26441,
-    26441,26441,    0,    0,    0,    0,26441,26441,26441,26441,
-    26441,26441, 4690, 4700, 5867,    0,    0, 4710, 4747, 5947,
-
-        0,    0, 4760, 4770, 6027,    0,    0, 4780, 4790, 6107,
-        0,    0,26441, 3228, 3836, 3865,26441,    2,26441,26441,
-    26441, 4827, 4840, 4850,11562,26441, 4860,    0, 1796, 3843,
-        0, 3861,    0,    0, 6173,    0,    0, 4870, 4907, 6252,
-        0,    0, 4920, 4930, 6332,    0,    0, 4940, 4950, 6412,
-        0,    0, 4987, 5000, 6492,    0,    0,    0,    0,    0,
-        0,26441,    0,    0,26441, 5010, 5020, 6572,    0,    0,
-        0,    0,    0,11529, 5030, 5067, 6652,    0,    0,    0,
-        0,    0,11525, 5080, 5090, 6732,    0,    0, 5100, 5110,
-     6812,    0,    0, 5147, 5160, 6892,    0,    0,26441,26441,
-
-    26441,26441,    0,    0,    0,11558, 5170, 5180, 6972,    0,
-        0, 5190, 5227, 7052,    0,    0, 5240, 5250, 7132,    0,
-        0,26441,26441,    0,    0,    0, 5260, 5270, 7212,    0,
-        0, 5307, 5320, 7292,    0,    0, 5330, 5340, 7372,    0,
-        0,    0, 7455, 7536, 2868,26441, 7616,    0,    0, 7699,
-        0, 3946,11507, 4028, 2601, 5431,11345, 3828, 2616, 5396,
-     1424, 1776,11332, 3203,11317, 3820, 5447, 5463, 3844,11321,
-     3978,11310,    0, 3983,11312, 3866,11295,11280, 2768,11293,
-    11292,11282, 2723,11268, 5431, 2832,11261,11259,11231, 5469,
-    11247, 2839,11232,11239,11202,11209, 3975,11212, 3191,11204,
-
-     5413,11197,11183, 4601, 4040, 4602,11173, 5473, 1801, 5422,
-    11158, 2847, 5514,11146,11153,11130, 4025, 3834, 4036, 5497,
-    11124, 4387,11123,11121, 5423, 3799, 3958,11118,11095, 4430,
-    11079, 5540,11069, 4360, 7750,11066, 4088,11053,11057, 4603,
-     5463,    0,    0,26441,    0,    0,    0,26441,26441,    0,
-        0, 7834, 5484,11075,26441,11049, 7906, 7925, 7944,    0,
-     7963, 5489, 8031,    0,    0,    0,    0, 5514, 8111,    0,
-        0,    0,    0, 8195,    0, 5560, 8275, 5459, 5461, 5573,
-     8355,    0,    0,    0,    0, 5550,    0, 5547, 8435,    0,
-        0,    0,    0, 5583, 8515,    0,    0,    0,    0, 5593,
-
-     8595,    0,    0,    0,    0, 5627, 8675,    0,    0,    0,
-        0, 5640, 8755,    0,    0,    0,    0, 5650, 8835,    0,
-        0,    0,    0, 5660, 8915,    0,    0,    0,    0, 5670,
-     8995,    0,    0,    0,    0, 5707, 9075,    0,    0,    0,
-        0, 5720, 9155,    0,    0,    0,    0, 5730, 9235,    0,
-        0,    0,    0,    0,    0, 5740, 9315,    0,    0,    0,
-        0, 5750, 9395,    0,    0,    0,    0, 5787, 9475,    0,
-        0,    0,    0, 5800, 9555,    0,    0,    0,    0,    0,
-     5810, 9635,    0,    0,    0,    0, 5820, 9715,    0,    0,
-        0,    0, 5830, 9795,    0,    0,    0,    0, 5867, 9875,
-
-        0,    0,    0,    0, 5542, 5543,26441,26441, 4390, 5905,
-     5960, 5985, 6040,26441,    0,    0,    0, 5880,    0, 5355,
-     4069,    0, 5486,    0,    0, 9941,    0,    0,11043, 5947,
-     5996, 6050, 6130,    0,    0, 3855, 5911,    0,    0, 6132,
-     6076,    0,    0,    0, 6076,10020,    0,    0,    0,    0,
-     6140,10100,    0,    0,    0,    0, 6185,10180,    0,    0,
-        0,    0, 6195,10260,    0,    0,    0,    0,    0,    0,
-     6205,10340,    0,    0,    0,    0,    0,10989, 6215,10420,
-        0,    0,    0,    0,    0,10988, 6252,10500,    0,    0,
-        0,    0, 6265,10580,    0,    0,    0,    0, 6275,10660,
-
-        0,    0,    0,    0,26441,    0,    0,11023, 6285,10740,
-        0,    0,    0,    0, 6295,10820,    0,    0,    0,    0,
-     6332,10900,    0,    0,    0,    0,26441,    0,    0, 6345,
-    10980,    0,    0,    0,    0, 6355,11060,    0,    0,    0,
-        0, 6365,11140,    0,    0,    0,    0,11223,11304, 4435,
-     4434, 6098, 4601, 6483, 6447, 6485,10975, 5533, 4674, 4595,
-     2598, 4676, 6100, 5575, 6193, 6103, 6486,10966, 4677, 4755,
-    10960, 4757, 4834, 4758, 4567,10959, 6454, 6413, 4675, 5505,
-     4760, 5399, 6492, 5933, 4835, 2617, 5934, 5543, 6505,11386,
-     6498, 6500, 6563, 6539, 6565, 6566, 6577, 6578, 6579, 6585,
-
-     6643, 6723, 6607, 4598, 6608,10951,10942, 6646, 5968, 6619,
-     4914, 5546, 4915, 6736, 6803, 6658, 6659, 6661, 6737, 6739,
-     5938, 6768, 5478, 6007, 6664, 4837, 5958, 6693, 6816, 6804,
-     6818, 5516, 6821, 6511, 6015, 6819, 6745, 5969, 6848, 4994,
-     4995,10913,10911,10886,10871,10870,10863, 4047, 6883, 6884,
-     6018, 6886,10862, 5074, 6892, 6897,10832,11470, 6178,26441,
-     5637,26441, 6902,11552,    0,    0, 6008, 5076, 5075, 6155,
-     6899, 6963, 6964, 6900, 6928, 6972, 6977,    0,    0,    0,
-        0,26441,11624,    0,    0, 5575,    0,    0,    0,    0,
+     3839,    0,11432,26921,26921,26921,26921,26921,    0, 3922,
+     4004, 4085,    0, 1817, 2719,11381, 2729, 1799, 2836,11393,
+     3200, 1822, 2848,  232, 1420,11380, 3898,11365, 3899, 3916,
+     3932, 1802,11351, 2841,11354, 4165,    0,    0,26921,26921,
+    26921,26921,26921,26921, 3165,11375,26921,26921,26921,    0,
+        0,    0, 4249,11370,    0,26921,11369, 4321, 4340, 4359,
+    26921,26921, 3908, 3985, 4427,    0,    0, 4019, 4036, 4507,
+        0,    0, 4591,    0,    0,    0, 4046,    0, 4671, 2744,
+
+     2749, 4056, 4066, 4751,    0,    0, 4102, 4112, 4831,    0,
+        0, 4122, 4132, 4911,    0,    0, 4165, 4262, 4991,    0,
+        0, 4272, 4282, 5071,    0,    0, 4292, 4360, 5151,    0,
+        0, 4370, 4380, 5231,    0,    0, 4390, 4427, 5311,    0,
+        0, 4440, 4450, 5391,    0,    0, 4460, 4470, 5471,    0,
+        0, 4507, 4604, 5551,    0,    0,    0,    0,    0,    0,
+        0, 4623, 4633, 5631,    0,    0, 4684, 4694, 5711,    0,
+        0, 4704, 4714, 5791,    0,    0, 4751, 4764, 5871,    0,
+        0,26921,26921,26921,    0,    0,    0,    0,26921,26921,
+    26921,26921,26921,26921, 4774, 4784, 5951,    0,    0, 4794,
+
+     4831, 6031,    0,    0, 4844, 4854, 6111,    0,    0, 4864,
+     4874, 6191,    0,    0,26921, 3921, 3959, 4983,26921,    2,
+    26921,26921,26921, 4927, 4937, 4947,11372,26921, 4957,    0,
+     1796, 3926,    0, 3943,    0,    0, 6257,    0,    0, 4991,
+     5004, 6336,    0,    0, 5014, 5024, 6416,    0,    0, 5034,
+     5071, 6496,    0,    0, 5084, 5094, 6576,    0,    0,    0,
+        0,    0,    0,26921,    0,    0,26921, 5104, 5114, 6656,
+        0,    0,    0,    0,    0,11340, 5151, 5164, 6736,    0,
+        0,    0,    0,    0,11339, 5174, 5184, 6816,    0,    0,
+     5194, 5231, 6896,    0,    0, 5244, 5254, 6976,    0,    0,
+
+    26921,26921,26921,26921,    0,    0,    0,11372, 5264, 5274,
+     7056,    0,    0, 5311, 5324, 7136,    0,    0, 5334, 5344,
+     7216,    0,    0,26921,26921,    0,    0,    0, 5354, 5391,
+     7296,    0,    0, 5404, 5414, 7376,    0,    0, 5424, 5434,
+     7456,    0,    0, 5471, 5484, 7536,    0,    0,    0, 7619,
+     7700, 2868,26921, 7780,    0,    0, 7863,    0, 4030,11327,
+     3915, 2601, 5538,11328, 5540, 2616, 5541, 1424, 1776,11314,
+     5551,11293, 5542, 5597, 5613, 3195,11301, 4062,11300,    0,
+     4067,11301, 3890,11279,11269, 2768,11274, 2606,11276, 2723,
+    11259, 5594, 2832,11243,11240,11228, 5557,11244, 2839,11237,
+
+    11210,11189,11194, 3887,11204, 3923,11161, 3922,11159,11149,
+     4685, 3903, 4686,11149,11141, 5623, 1801, 5583,11141, 2847,
+     5677,11130,11132,11099, 3932, 4109, 4055, 5662,11116, 4148,
+    11115,11087, 5665, 3910, 4123,11084,11055, 4434,11058, 5674,
+    11036, 4121, 7914,11044, 3949,11031,11036, 4687, 4955,    0,
+        0,26921,    0,    0,    0,26921,26921,    0,    0, 7998,
+     5649,11059,26921,11058, 8070, 8089, 8108,    0, 8127, 5652,
+     8195,    0,    0,    0,    0, 5662, 8275,    0,    0,    0,
+        0, 8359,    0, 5682, 8439, 4149, 4960, 5724, 8519,    0,
+        0,    0,    0, 4961,    0, 5711, 8599,    0,    0,    0,
+
+        0, 5734, 8679,    0,    0,    0,    0, 5744, 8759,    0,
+        0,    0,    0, 5754, 8839,    0,    0,    0,    0, 5791,
+     8919,    0,    0,    0,    0, 5804, 8999,    0,    0,    0,
+        0, 5814, 9079,    0,    0,    0,    0, 5824, 9159,    0,
+        0,    0,    0, 5834, 9239,    0,    0,    0,    0, 5871,
+     9319,    0,    0,    0,    0, 5884, 9399,    0,    0,    0,
+        0,    0,    0, 5894, 9479,    0,    0,    0,    0, 5904,
+     9559,    0,    0,    0,    0, 5914, 9639,    0,    0,    0,
+        0, 5951, 9719,    0,    0,    0,    0,    0, 5964, 9799,
+        0,    0,    0,    0, 5974, 9879,    0,    0,    0,    0,
+
+     5984, 9959,    0,    0,    0,    0, 5994,10039,    0,    0,
+        0,    0, 5640, 5659,26921,26921, 4472, 6069, 6124, 6149,
+     6204,26921,    0,    0,    0, 6031,    0, 5515, 5514,    0,
+     5598,    0,    0,10105,    0,    0,11047, 6111, 6160, 6214,
+     6294,    0,    0, 5521, 4985,    0,    0, 6295, 6240,    0,
+        0,    0, 6044,10184,    0,    0,    0,    0, 6304,10264,
+        0,    0,    0,    0, 6336,10344,    0,    0,    0,    0,
+     6349,10424,    0,    0,    0,    0,    0,    0, 6359,10504,
+        0,    0,    0,    0,    0,10993, 6369,10584,    0,    0,
+        0,    0,    0,10992, 6379,10664,    0,    0,    0,    0,
+
+     6416,10744,    0,    0,    0,    0, 6429,10824,    0,    0,
+        0,    0,26921,    0,    0,11028, 6439,10904,    0,    0,
+        0,    0, 6449,10984,    0,    0,    0,    0, 6459,11064,
+        0,    0,    0,    0,26921,    0,    0, 6496,11144,    0,
+        0,    0,    0, 6509,11224,    0,    0,    0,    0, 6519,
+    11304,    0,    0,    0,    0, 6529,11384,    0,    0,    0,
+        0,11467,11548, 4440, 4178, 5672, 4685, 6647, 6262, 6648,
+    10994, 5633, 4514, 4515, 4177, 5601, 4758, 6263, 6131, 6264,
+     6649, 6650,10982, 4131, 4438,10970, 4517, 4759, 4679, 4651,
+    10955, 6618, 6307, 4760, 5643, 4681, 5714, 6656, 5715, 4838,
+
+     6099, 6100, 5544, 6666,11630, 6664, 6348, 6727, 6728, 6729,
+     6730, 6698, 6740, 6741, 4839, 6742, 6807, 6887, 6743, 4520,
+     6749,10954,10946, 6808, 6671, 6783, 4947, 5623, 4948, 6900,
+     6967, 6810, 6821, 6823, 6829, 6901, 6122, 6772, 4952, 6171,
+     6826, 4762, 6177, 6824, 6980, 6903, 6855, 6101, 6968, 6889,
+     6182, 6932, 6982, 6673, 6983, 5078, 5079,10917,10916,10915,
+    10914,10902,10890, 4065, 6985, 6902, 5680, 7011,10875, 4840,
+     7047, 7012,10874,11714, 7003,26921, 6123,26921, 7052,11796,
+        0,    0, 6170, 5158, 5159, 6321, 7060, 7061, 7062, 7090,
+     7067, 7128, 7068,    0,    0,    0,    0,26921,11868,    0,
+
+        0, 6131,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,26921, 7079, 7096, 7160, 7176, 7240, 7256,10902,
+     7320, 7336, 7400, 7416,    0, 7480, 7496, 7576,    0,    0,
+    26921,26921, 7136, 7216, 7586, 7634, 7666, 7676,10873, 7717,
+     7731, 7800, 8215,    0, 8228, 8245, 8472, 7149,10795,    0,
+        0,    0,    0,    0,    0, 5197,    0, 5275,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    11939,12020, 6108,12102, 6679, 7103, 6273,12186, 7302, 6356,
+     4929,10843, 6310, 5011, 6579, 6586, 7343, 6267, 7419, 7499,
+
+     7141, 7340,12270, 7382,12354,12438, 6676, 5086, 5250, 6582,
+     5330, 5331, 6751, 6909, 5404, 6916,12520, 6584, 6585, 7579,
+     7143, 7420, 5247, 5089, 7607, 5804, 7341, 7608, 7448, 7500,
+     8199,10840,12604, 6993,26921,26921,10780,    0,    0, 7641,
+     7384, 5405, 5169,10803, 7501, 7642, 7529, 7726,12688, 7463,
+    12772, 5328,10802, 7684, 6632, 7822, 7304, 5566, 6326, 5644,
+     5811, 5890, 5891, 6727, 6588, 5964,10787, 6652,10756, 5492,
+    10768,10767, 6730,10740,10714, 7823, 8082, 7729, 7541, 7852,
+     5329,10722, 7670, 6429, 8083, 6187, 5714, 5408, 6665, 5409,
+     6800, 5489,10700,10678,10684,10671,10682,10660,10658, 8200,
+
+     8443, 7671, 7731, 7000, 8267, 8084, 7543, 7824, 8202, 7542,
+     8444, 8085, 7075, 8201, 8281, 8207, 7078, 5690, 7540, 6738,
+     8214, 8446, 7682, 8280, 6051,10641, 6509, 5718, 6660,10634,
+    10634,10590, 8445, 8458, 7763, 8526, 5808, 8459, 8090, 8524,
+     5996, 5246, 8562, 8591, 8525, 8532, 8527, 8534,10602, 7049,
+    10589, 6430, 8533, 5886, 8592, 8096, 8594, 8599, 8451, 8606,
+    10627, 8097, 8609, 8617, 8611, 8670, 8614, 6516, 8616, 6743,
+    12856, 8215, 7105, 6791,10576,10566, 8644, 5889,10564, 8672,
+        0, 8643, 8679, 8692, 8703, 8723, 8783, 8803, 8863, 8883,
+     8943, 8963, 9023, 9043, 9103, 9123, 9183,10591, 9203, 9263,
+
+     9283,10582, 9343, 9363, 9423, 9443, 9503, 9523,10553, 9583,
+     9603, 9663, 9683,10552, 9743, 9763, 9823,    0, 8275, 8759,
+     9903, 9913, 9993,10003,10059,10139,10149,10204,10234,10285,
+    10297,10365,10377,10445,10551,10457,10525,10537,10550,10605,
+    10617,10685,10697,10765,10777,10538,10845,10857,10925,10937,
+    10511,11005,11017,11085,10454, 5997, 6077,12939,13020, 6154,
+    13102,26921,26921,13184,    0,    0, 8213, 7301, 7140, 6302,
+    13268, 8686,26921, 6771,26921, 7609,    0,    0,    0, 8786,
+     6837, 6890, 6991, 8453, 7624,10458, 7069, 7131, 7385, 8270,
+     7882, 7261, 7683, 8691, 7383, 7581, 8684, 8696,10445, 7632,
+
+     7181,13352,26921,26921,    0,    0,    0, 8844, 7259, 7260,
+    13436, 8846,26921,26921,    0,    0,    0, 7376,13520, 8910,
+    26921, 7449,26921,    0,    0,    0, 7460, 8847, 7724, 7676,
+     7814, 8452, 8849, 7817,13604, 9870, 8886, 8919, 8911, 8966,
+    10444, 7816, 7815, 8990, 8208, 8912, 7825, 8925, 9004, 9005,
+     8091, 8993, 4861, 8104, 8106, 8947, 8268, 8999,10443, 8646,
+     8628, 9070, 9079,10442, 9126, 9071, 9084, 9085, 9150, 9163,
+     9164, 8220, 8222,13688, 8992,26921,26921,    0,    0,    0,
+     9165,10416, 8535, 9166, 9187,10404, 9086, 9206, 9243, 8269,
+     9231, 9244, 9072, 9319, 9073,10407,10401,10380,10347,10356,
+
+    10348,10346,10315,10313, 6312,10318,10262,10246, 8465, 9153,
+     9245, 8467, 9886, 9324,10243, 8726, 9366,10241, 9234, 9233,
+     9310, 8787, 9268, 9246, 9347, 9087, 9395, 9403,10227,10239,
+    10187,10195, 9474,10207,10184, 8788, 9404,10167, 9325, 9348,
+    10113, 9479, 8913, 8946, 9312, 9484, 9485, 9152, 9393,10149,
+     9406,10147, 9559,13772, 9507, 9564,10113, 9550, 9313, 9409,
+     9428, 9487,10087,10045,10044, 9606, 9639, 9472, 9551, 9473,
+     9630, 9644, 9666,10032,10008, 9553, 9569, 9966,11148, 9567,
+     9632, 9486, 9566,10026, 9633, 9719, 9712, 9686, 9978, 9646,
+    10002, 9713, 5981, 9647, 9668, 9725, 9790, 9728, 9791, 9766,
+
+     9748, 9804, 9809, 9792,13856, 9871,26921,26921, 9885,    0,
+        0,    0, 9908, 9951, 9806, 9807, 9954, 9931, 9793, 9844,
+     9915, 9872, 9959,10309,10389,10469,10549,10629,10709,10789,
+    10869,10949,11029,11165,11178,11188,11268,11317,11327,11348,
+    11407,11454,11488,11499,11515,11809,11819,11829,11839,11955,
+    11981,11991,10217,11144,12954,12971,12984,13001,13938,13948,
+    13978,13989,14029,14040,14070,14080,14121,14131,14161,14172,
+    14212,14223,14253,14263,14304,14314,14344,14355,14395,14406,
+    14436,14446,    0,14527,14608,11798,10113,11940,14690,10123,
+     9846, 9873, 9879,11473, 9912,11468,10188,11941,11149,11800,
+
+    11958,11151,11963,12044,10125,12046,12522,11295,12524,12940,
+     9899,12942,12945,11298,12952,12959,13186, 9883,13188, 9884,
+     9909,10124, 9906,11296,13940,12962,11304,13941,13950,13947,
+    13959,13952,14774,26921,26921,14042,14528,14856,    0,    0,
+    12001, 9845, 9822,14133,14225,11470,14135,14186,14316, 9790,
+    14318,14408,11498,14369, 9915,14460,11309,14501,14534,11310,
+    14539,14546, 9803, 9787,14551,11410, 9918,14588,14611, 9784,
+    14609,14621,11411,14623, 9920, 9921,14858, 9756,14860,14927,
+    11412,14973,11493, 9923,15056,11514,15101,11580,11596, 9952,
+     9953,11499,15059,26921,15068,15071,11817,15081,15184, 9773,
+
+    15090,15185,15186,15195,15197,15198,15232, 9724, 9720,11805,
+    11942, 9722,11807, 9709, 9705, 9686, 9690, 9695, 9691,11950,
+     9683, 9959,15207,11812,15244,15246, 9667,15258, 9967,15269,
+     9968,15249,11949,15259,15271,15292,10043, 9645, 9660, 9650,
+     9998,10055, 9644, 9622,15304, 9606,15306,15318, 9613,15317,
+    10005,15329,15351, 9602, 9565,15352,11974,15363, 9603,12004,
+    15372,15377,15423,26921,26921,15506,    0,    0,    0,12954,
+    10086,15508, 9549,15509,15511,12530,15518,15521,15528, 9546,
+    26921, 9526,15559,15566,15569,15571,15576, 9528, 9520,15578,
+    15588,15589,15619,15626,15631,15636,15637,15648, 9485, 9466,
+
+     9465, 9454, 6932, 9446, 6041,10045,15678,12533,15689, 9443,
+    15679,15690,15696, 9404,10046,15731,12544,15738,15701, 9417,
+    15743,12535,12542,13065,15772,13067,15757,15818,12953,10048,
+    10053,15769,10058, 9410,15901,26921,15903,15904,15906,15923,
+    15918, 9393, 9396, 9373,15949,15956,13000,15961, 9378,15968,
+     9362,15974, 9365,16020,16103, 9359,16104,16105, 9361,16114,
+    16116, 9336,16123,16125, 9303,16126,16171, 9316,16173,16174,
+    16176,26921,16185, 9328,16188,16219,13196,16226,16233,16236,
+     9300, 9285,16238,16239, 9289,16284,16245,26921,16286, 9286,
+    16291,13197,10085,16293,16296,16306, 9260, 9263,16305,13194,
+
+    16339,16348,16351,26921,16353,16360,26921,16362,    0,13199,
+    26921,26921,    0,    0,    0,10112,10114,    0,    0,13204,
+        0,    0,    0,    0,16365,10115,16374,13206,16399, 9258,
+    16408,16411,16428,16417,16429,16438, 9232, 9215,13209,14072,
+    13960,26921,14073, 9209, 9201, 9189, 9182,26921, 9171,14166,
+    14088, 9151,10143,14255,14642,16458,26921,16459,13207,16471,
+    10148,10154,16477,10189,16489,14347,16496,16506,10335,10194,
+     9151,10415,14438,10256, 9161,10495,16518,26921,16527,16539,
+     9144,16548,16545, 9129, 9133,16557,14349,16560,10195,16582,
+     9147,13953, 9124,16591,10257,14164,16602,10197,10258,16603,
+
+    26921,16605,16608, 9098,16617,16620, 9062, 9048,16650,16651,
+    16663,16662,11110,11111,16669,16672,16681,16710,16715,16720,
+    16727,16730,16740,16741, 9034, 9013, 9019, 8999, 8993, 8992,
+     8985, 8987, 8968,10202,16775, 8972,16778,16787,16789,26921,
+    16796,16790,16835, 8955,16837,16838, 6116,10203,16844,14272,
+    14536,16858,14256, 8953,16847,16864,16889,16937, 8919, 8917,
+    10575,17020,17021, 8886,17022, 8901,17023, 8893,17032,    0,
+    14573,26921,10655,26921,    0,    0,    0,17041, 8887,17070,
+     8845,17071,17080, 8844,17082,26921,17092,17091, 8830,17093,
+    17105,17139,17142, 8836,17144,16476,17151,14559,17153, 8842,
+
+     8829,17156, 8809,17162,17173, 8802,17203, 8818,17204,17214,
+     8772, 8766,17215,17234,17221,14614,17260,10204,17263, 8751,
+    17272,17273,17283,17282,17320, 8740, 8698,14439, 8695,14656,
+     8669, 8673,26921, 8684,10259,14865,14870,14877,17285,14885,
+    10269,17330,10338,17332,17337,17339,17349,17380,17386, 8664,
+    10735,10815,14928,10300, 8666,10895,17391, 8655,17398,17401,
+     8650, 8651,17411,14622,10337,17432,17444,10349,14872,17446,
+    10340,11135,17449, 8634,17458,17461,26921, 8598,17467,17487,
+    17506,14879,17509,17512,14929,17521,10350,11138,10417,11060,
+    17524,17543,17554,17566,17580,17585,17591,17592,17597,17611,
+
+     8596, 8595, 8571, 8578, 8590, 8562, 8525, 8531, 8531,17614,
+    26921,17634,17644,17645,17657,17656,26921,10418,17659,14930,
+    14935, 8528,17671,17682, 8505,10420,10975,17702,26921,17704,
+     8514,17705, 8504,10429,11055,14940,17716, 8444,17717,26921,
+    17719,26921,17739,17750,26921,17762,17764,17765,17787, 8441,
+    17799,17810, 8424, 8417,17816, 8276, 8257,17817,26921,17822,
+    17828,10430,17851, 8248,17837,17863, 8186, 8176,17876,17886,
+    17885,26921,17888,17898,17911,17923, 8162, 8091,15337,14942,
+     8094, 8065, 8057,11229,15364,15110,17936,11322,17937,17946,
+    17948,17958,17949,17991, 8051,11228, 8078,17997,26921,18000,
+
+    18006, 8055, 7876,18003,18017,18018,11311,18020,10497,18051,
+    26921,18063,18065,18068,18070,10498,11320,18088,18085,18111,
+    18122,18123,18133,18144,18153,18171, 7852, 7851, 7844, 7844,
+     7847,26921, 7841, 7843, 7827,18156,15058,18174,18183,10500,
+    18194,18204,15076,11989,10509,18209,18216, 7826,18221, 7806,
+    10510,18231, 7805,18243,18254,18264,18266,15061,18269, 7770,
+    18291,18303, 7786, 7775, 6892, 7762,18314,15691,18316,14941,
+    10577,18321, 7766,18326,18333, 7757,10578,18336,18359,18371,
+    26921,26921,15371,10545, 7740, 7737,15596,18374,10590,18384,
+    18386,18396,18393,    0,12536, 7722,18405,18431, 7735,14943,
+
+    18419,18438,18444,11150,18450,15119,10657,18456,18457,18469,
+    18479,11553,10658,18491,18504,18498,18510,18521,18516,18533,
+    18547,18558, 7734, 7725, 7703, 7719, 7681, 7685, 7683, 7674,
+    18564, 7646,18559,18584,15397,18585, 7605,12947,18597,18607,
+    26921,18610,26921,18619,26921,18630,18632,18644,18649, 7608,
+    18661, 7593,18667,18678, 7600, 7586, 7592, 7572,18679, 7585,
+    18692, 7553,18690,18709,15131, 7537,10660,18712,15699,18729,
+    15519, 7511, 7523, 7496, 7496, 7513, 7478,15586,18727,18738,
+    18750,18739,13942, 7478,18760,18785,15639, 7478,15398,18795,
+    18797,18812,11457,18798,18815,10669,18832,18845,18850,18862,
+
+    18875,18880,18897,18909, 7463, 7445, 7439, 7424, 7427, 7412,
+     7423, 7403,18914, 7402,18926,15777,18943,15646,15649,18936,
+     7386,18948,18955,18957, 7377,18969, 7357,18986,19000, 7344,
+     7347,26921, 7322,19003, 7324,19006, 7301,19012,10670,19023,
+     7281,15913, 7263, 7274, 7261, 7225, 7216, 7216,15986,19021,
+    19033,19054,19060, 7197,19066,10737,19071,19080,19083,10738,
+    19081,15196,19093,19114,19126,19128,19131,19145,19151,19157,
+    19174, 7214, 7205, 7182, 7149, 7149, 7146, 7119, 7123,19186,
+     7115,19192, 7101,19203, 7100,19205,15206,19212, 7062,19223,
+     7044,19225,19238, 7044, 7044,19250,26921,19260, 7041,19272,
+
+    15698,10740,19275, 7020,15746, 7026, 7013, 7024, 6997, 6956,
+    26921,15921,19273,16732,19295,16895,19310,16897, 6955,19293,
+    15966,15911,19298,19320,19332,10749,10750,19341,15791,19343,
+    19358,19363,19378,19388,19397, 6959, 6956,26921, 6942,26921,
+     6948, 6907, 6885,19400, 6902,19409, 6852,19419, 6847,19431,
+    10817,19477,15969,19560,19561, 6829, 6834,19563,10818,19566,
+    15995,10820,19572,26921,15979, 6823, 6801, 6799, 6771, 6743,
+    16106,19609, 6252,19611, 6445,19614, 6447,14039,19621,16419,
+    16113,19620,19634,26921,10829,19640,19659,19669,19671,19681,
+    19682, 6725, 6715, 6691, 6670, 6638, 6620,19688, 6634,19700,
+
+    26921,19719,10830,19729,16182,19730,10897,26921,19731,    0,
+    16547,26921,26921,16115,    0,    0,    0,16183,10898,19741,
+    19742, 6570, 6568,19748,16193,10900,10909,26921,10910,10977,
+     6512,14079,19768,19787,19790,19793,26921,26921, 6515,26921,
+     6501, 6513,19802, 6353,19805,16244,10978,16256,16304,10980,
+    19820,19839, 6320, 6233,11458,11599,11814, 6205,19840,19850,
+    19851, 6172,26921, 6115,19881, 6054,19861,10989, 5794, 5717,
+    19888,19898,19903, 5678, 5654,19908, 5620,19915,10990, 5589,
+     5553,19918,19933,19945, 5494, 5006,19956, 4947,11057, 4915,
+    19966,19968, 4120,26921,19978, 4037,11058, 3978,26921,19987,
+
+     3948, 3928,20001, 3214, 3204,20013, 2832,26921,20016, 2699,
+    26921,26921,20062,20075,20088,20101,20114,20127,20140,20153,
+    20166,20179,20192,20205,20218,20231,20244,20254,20267,20280,
+    20290,20303,20316,20329,20342,20352,20365,20378,20388,20401,
+    20414,20427,20437,20450,20463,20473,20486,20499,20509,20522,
+    20535,20545,20558,20571,20581,20594,20607,20617,20630,20643,
+    20653,20666,20679,20689,20702,20715,20725,20738,20751,20761,
+    20774,20787,20797,20810,20823,20833,20846,20859,20872,20885,
+    20895,20908,20921,20931,20944,20957,20967,20980,20993,21003,
+    21016,21029,21042,21052,21065,21078,21088,21101,21114,21124,
+
+    21137,21150,21160,21173,21186,21199,21212, 2648,21222,21235,
+    21248,21261,21274,21287,21300,21310,21323,21336,21346,21359,
+    21372,21382,21395,21408,21418,21431,21444,21457,21470,21480,
+    21493,21506,21519,21529,21542,21555,21568,21578,21591,21604,
+    21614,21627,21640,21650,21663,21676,21689,21702,21715,21725,
+    21738,21751,21761,21774,21787,21797,21810,21823,21836,21849,
+    21862,21872,21885,21898,21908,21921,21934,21944,21957,21970,
+    21980,21993,22006,22019,22029,22042,22055,22068,22081,22094,
+    22107,22120,22133,22146,22156,22169,22182,22195,22205,22218,
+    22231,22244,22257,22267,22280,22293,22306,22319,22332,22345,
+
+    22355,22368,22381,22394,22404,22417,22430,22443,22453,22466,
+    22479,22492,22502,22515,22528,22541,22551,22564,22577,22590,
+    22600,22613,22626,22639,22649,22662,22675,22688,22698,22711,
+    22724,22737,22747,22760,22773,22786,22796,22809,22822,22835,
+    22845,22858,22871,22884,22897,22910,22920,22933,22946,22959,
+    22969,22982,22995,23008,23018,23031,23044,23057,23067,23080,
+    23093,23106,23119,23129,23142,23155,23168,23178,23191,23204,
+    23217,23227,23240,23253,23266,23276,23289,23302,23315,23328,
+    23341,23354,23367,23380,23393,23406, 2619,23419,23432,23445,
+    23458,23471,23484,23497,23510,23523,23536,23549,23562,23575,
+
+    23585,23598,23611,23624,23634,23647,23660,23673,23683,23696,
+    23709,23722,23732,23745,23758,23771,23784,23797,23807,23820,
+    23833,23846,23859,23869,23882,23895,23908,23921,23931,23944,
+    23957,23970,23980,23993,24006,24019,24029,24042,24055,24068,
+    24081,24094,24104,24117,24130,24143,24153,24166,24179,24192,
+    24202,24215,24228,24241,24254,24267,24277,24290,24303,24316,
+    24326,24339,24352,24365,24375,24388,24401,24414,24424,24437,
+    24450,24463,24473,24486,24499,24512,24525,24538,24551,24564,
+    24577,24590,24603,24616,24629,24642,24655,24668,24681,24694,
+    24707,24720,24733,24746,24759,24772,24785,24798,24811,24824,
+
+    24837,24850,24863,24876,24889,24902,24915,24928,24941,24954,
+    24967,24980,24993,25006,25019,25032,25045,25058,25071,25084,
+    25097,25110,25123,25136,25149,25162,25175,25188, 1819,25201,
+    25214,25227,25240,25253,25266,25279,25292,25305,25318,25331,
+    25344,25357,25370,25383,25396,25409,25422,25435,25448,25458,
+    25471,25484,25497,25510,25523,25536,25549,25562,25575,25588,
+    25601,25614,25627,25640,25653,25666,25679,25692,25705,25718,
+    25731,25744,25757,25770,25783,25796,25809,25822,25835,25848,
+    25861,25874,25887,25900,25913,25926,25939,25952,25965,25978,
+    25991,26004,26017,26030,26043,26053,26066,26079,26092,26105,
+
+    26118,26131,26144,26157,26170,26183,26196,26209,26222,26235,
+    26248,26261,26274,26287,26300,26313,26326,26339,26352,26365,
+    26378,26391,26404,26417,26430,26443,26456,26469,26482,26495,
+    26508,26521,26534,26547,26560,26573,26586,26599,26612,26625,
+    26638,26651,26663,26673,26686,26699,26712,26725,26738,26751,
+    26764,26777,26790,26803,26816,26829,26842,26855,26868,26881,
+    26894,26907
+    } ;
 
-        0,    0,    0,    0,    0,    0,26441, 6972, 6985, 6995,
-     7005, 7015, 7095,10865, 7145, 7155, 7175, 7235,    0, 7255,
-     7315, 7335,    0,    0,26441,26441, 6838, 7052, 7395, 7442,
-     7487, 7497,10842, 7553, 7583, 7636, 8051,    0, 8064, 8081,
-     8308, 7065,10750,    0,    0,    0,    0,    0,    0, 5191,
-        0, 5192,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,11695,11776, 5468,11858, 6592, 6966, 6154,
-    11942, 7158, 6510, 4924,10798, 6422, 6476, 6487, 6648, 6103,
-     6982, 7206, 6983, 6725,12026, 6829,12110,12194, 6587, 4923,
-     5167, 6497, 5246, 5247, 6672, 6806, 5320, 6724,12276, 6499,
-
-     6564, 7207, 7283, 6938, 5322, 5004, 7458, 5720, 6832, 7477,
-     7301, 6831, 7460,10788,12360, 7296,26441,26441,10750,    0,
-        0, 7208, 7363, 5401, 5005,10760, 7258, 7339, 7364, 7259,
-    12444, 7377,12528, 5244,10759, 7417, 7338, 7483, 5722, 6961,
-     5800, 5963, 6074, 7116, 6155, 6265,10750, 6542,10725, 5727,
-    10724, 6577,10709,10709, 7418, 7918, 7506, 7486, 7416, 5245,
-    10710, 7419, 6345, 7480, 6035, 5801, 5323, 6626, 5646, 6418,
-     5647,10666,10672,10677,10642,10639,10628,10630, 8035, 8279,
-     7547, 7549, 7579, 7588, 7920, 7581, 7689, 7691, 7599, 8036,
-     7919, 7644, 7591, 7690, 7636, 7645, 5804, 7696, 6470, 7688,
-
-     8038, 8043, 8041, 6430,10625, 6425, 5805, 6562,10592,10599,
-    10582, 7921, 8050, 7702, 8280, 5884, 8281, 7926, 8103, 5914,
-     4358, 8282, 8426, 8360, 8116, 8117, 8288,10557, 6493,10544,
-     6266, 8294, 6190, 8295, 7932, 8362, 8363, 8368, 8365,10575,
-     7933, 8427, 8435, 8370, 8428, 8373, 6573, 8429, 6555,12612,
-     8442, 6638, 6651,10506,10507, 8451, 6193,10518, 8506,    0,
-     8455, 8467, 8477, 8557, 8608, 8618, 8637, 8698, 8717, 8778,
-     8797, 8858, 8877, 8938, 8957, 9018,10545, 9037, 9098, 9117,
-    10522, 9178, 9197, 9258, 9277, 9338, 9357,10507, 9418, 9437,
-     9498, 9517,10506, 9578, 9597, 9658,    0, 8111, 8515, 9677,
-
-     9738, 9757, 9818, 9837, 9898, 9978, 9988,10040,10070,10121,
-    10133,10201,10213,10498,10281,10293,10361,10496,10373,10441,
-    10453,10521,10533,10601,10468,10613,10681,10693,10761,10467,
-    10773,10841,10853,10409, 6138, 6377,12695,12776, 6378,12858,
-    26441,26441,12940,    0,    0, 8515, 6742, 6617, 6748,13024,
-     8600,26441, 6753,26441, 8603,    0,    0,    0, 8746, 6980,
-     7160, 6994, 8606, 7505,10383, 7008, 7150, 7378, 8044, 7552,
-     7205, 8826, 8106, 8395, 8104, 8287,10398, 7288, 7018,13108,
-    26441,26441,    0,    0,    0, 8703, 7098, 7153,13192, 8701,
-    26441,26441,    0,    0,    0, 7299,13276, 8760,26441, 7379,
-
-    26441,    0,    0,    0, 7492, 8761, 7601, 7541, 8466, 8371,
-     8471, 8105,13360, 9946, 8472, 8611, 8481, 8612,10390, 8601,
-     7542, 8520, 7586, 8840, 7589, 8759, 8800, 8919, 7639, 7927,
-     4858, 7642, 7647, 8827, 8053, 8613,10387, 8667, 8802, 8839,
-     8880,10360, 8881, 8301, 8783, 8920, 8921, 8986, 8999, 7701,
-     7942,13444, 8907,26441,26441,    0,    0,    0, 8922,10345,
-     8960, 8962,10343, 9000, 9040, 9002, 8702, 8749, 9023, 8829,
-     9071, 8560,10338,10317,10296,10263,10272,10264,10246,10230,
-     6108,10242,10220,10188, 8051, 8987, 9080, 8059, 9960, 9121,
-    10199, 8289, 9042,10196, 9069, 9083, 9147, 8508, 9081, 9082,
-
-     8941, 8908, 8989, 9155,10172,10178,10141,10141, 9122,10115,
-    10085, 8666, 9200,10063, 9201, 9183,10027, 9231, 8668, 8669,
-     9160, 9280, 9319, 8747, 9148,10040, 9161,10039, 9281,13528,
-     9241, 9360,10013, 9228, 8862, 9240, 9362, 9399, 9996, 9989,
-     9982, 9391, 9440, 9022, 9261, 9162, 9309, 9441, 9311, 9965,
-     9945, 9388, 9230,10094,10971, 9321, 9386, 9242, 9400, 9960,
-     9342, 9475, 9467, 9520, 9939, 9422, 9958, 9469, 5097, 9423,
-     9480, 9481, 9546, 9522, 9562, 9548, 9501, 9560, 9626, 9547,
-    13612, 9639,26441,26441, 9640,    0,    0,    0, 9663, 9719,
-     9563, 9627, 9916, 9916, 9600, 9679, 9910, 9641,10145,10224,
-
-    10304,10384,10464,10544,10624,10704,10784,10864,10945,10993,
-    11004,11025,11084,11105,11210,11239,11255,11271,11565,11575,
-    11585,11595,11711,11737,11747,11757,12711,12727, 9635,11094,
-    12741,12757,13694,13704,13734,13745,13785,13796,13826,13836,
-    13877,13887,13917,13928,13968,13979,14009,14019,14060,14070,
-    14100,14111,14151,14162,14192,14202,14243,14253,    0,14334,
-    14415,11213, 9759,11214,14497, 9721, 9601, 9628, 9629,11215,
-     9913, 9839, 9800, 9919,11224, 9802,11235,11556, 9866,11554,
-    11696, 9961,11698,11701, 9897,11718,12278,10972,12280,11721,
-    12701, 9882,12702, 9642, 9720, 9740, 9916, 9743,12696,12715,
-
-     9786,12942,12944,13696,13697,13698,14581,26441,26441,13703,
-    14335,14663,    0,    0,11715, 9874, 9880,13715,13716,10974,
-    13798,13891,13889, 9842,13942,13981,11233,14072, 9762,14074,
-     9820,14125,14164,10986,14255,14257, 9850, 9831,14308, 9880,
-     9788,14342,14337, 9830,14347,14349, 9900,14354, 9822, 9868,
-    14395, 9828,14397,14418,10024,14747, 9902, 9882,14420,10026,
-    14830,10104,10106, 9918, 9948,11053,14417,26441,14430,14665,
-     9821,14667,14832,14913,14915,14920,14918,14963, 9802, 9807,
-    10980,11226, 9798,11087, 9797, 9764, 9763, 9765, 9766,11336,
-     9763, 9983,14930,11089,14932,14965, 9722,14977,10036,14975,
-
-     9984,14978,11131,14984,14996,14998,10027, 9717, 9719, 9710,
-     9986,10096, 9700, 9683,15023, 9639,15025,15037, 9656,15043,
-    10033,15046,15048, 9637, 9604,15085,11132,15060, 9631,11352,
-    15094,15095,15141,26441,26441,15224,    0,    0,    0,11707,
-    10105,15226, 9591,15227,15229,11756,15236,15239,15246, 9558,
-    26441, 9548,15277,15284,15287,15289,15294, 9556, 9544,15296,
-    15306,15307,15337,15344,15349,15354,15355,15366, 9528, 9521,
-     9527, 9516, 6694, 9524, 6261,10034,15396,11353,15407, 9498,
-    15397,15408,15414, 9476,10093,15449,12286,15456,15419, 9478,
-    15461,11269,11573,12288,15490,12822,15475,15536,11564,10095,
-
-    10133,15487,10135, 9471,15619,26441,15621,15622,15624,15641,
-    15636, 9450, 9454, 9443,15667,15674,11710,15679, 9441,15686,
-     9429,15732,15815, 9433,15816,15817, 9417,15826,15828, 9410,
-    15835,15837, 9365,15838,15883, 9373,15885,15886,15888,26441,
-    15897, 9397,15900,15931,12291,15938,15945,15948, 9367, 9352,
-    15950,15951, 9358,15996,15957,26441,15998, 9336,16003,12727,
-    10171,16005,16008,16018, 9315, 9318,16017,12296,16051,16060,
-    16063,26441,16065,16072,26441,16074,    0,12298,26441,26441,
-        0,    0,    0,10173,10174,    0,    0,11561,    0,    0,
-        0,    0,16077,16111, 9301,16086,16120,16131,16132,16133,
-
-    16162, 9286, 9289,12289,12949,12714,26441,12301, 9282, 9271,
-     9287,26441, 9273,12951,13844, 9264,10176,12703,12757,16142,
-    26441,16145,12760,16179,10185,11051,16191,10186,16192,12954,
-    16197,16204,10251,10187, 9226,10331,13795,11140, 9219,10411,
-    16217,26441,16218,16230, 9220,16239,16251, 9209, 9208,16256,
-    12960,16268,10227,16273, 9223,13706, 9202,16282,10266,13708,
-    16293,10253,10265,16294,26441,16299,16311, 9170,16316,16328,
-     9143, 9136,16341,16342,16354,16353,10387,10467,16363,16376,
-    16388,16401,16406,16411,16418,16423,16413,16436, 9119, 9117,
-     9120, 9100, 9082, 9071, 9048, 9054, 9035,10254,16456, 9034,
-
-    16461,16466,16473,26441,16478,16499,16487, 9024,16504,16529,
-     5625,10256,16534,13717,13828,16541,12704, 9003,16554,16555,
-    16556,16604, 8993, 8973,10491,16687,16688, 8953,16689, 8967,
-    16690,    0,13831,26441,10571,26441,    0,    0,    0,16707,
-     8928,16709, 8884,16700,16742, 8872,16754,26441,16755,16760,
-     8871,16761,16773,16807,16772, 8877,16814,15093,16819,13922,
-    16820, 8877, 8845,16825, 8836,16834,16837, 8822,16867, 8821,
-    16872,16879, 8808, 8808,16882,16897,16884,14011,16885,16927,
-     8800,16932,16930,16939,16942,16949, 8799, 8770,12823, 8747,
-     8719, 8725,26441, 8737,10333,12957,14194,14197,16944,14463,
-
-    10334,16969,10414,16987,16990,16992,16999,17017, 8693,10651,
-    10731,10891,10336, 8693,10811,17010, 8686,17047,17058, 8686,
-     8648,17056,14012,10345,17065,17059,10506,14103,17077,10346,
-    10627,17068, 8631,17078,17115,26441, 8603,17116,17125,17126,
-    14105,17127,17137,14211,17168,10413,11704,10425,10707,17175,
-    17180,17187,17189,17201,17228,17234,17235,17240,17246, 8612,
-     8612, 8589, 8589, 8593, 8567, 8521, 8526, 8530,17249,26441,
-    17255,17261,17288,17298,17300,26441,10426,17307,14027,14288,
-     8494,17313,17318, 8485,10494,11735,17325,26441,17348, 8486,
-    10496,14286,14428,17359, 8475,17360,26441,17366,26441,17373,
-
-    17378,26441,17379,17385,17408,17420, 8461,17426,17431, 8448,
-     8442,17433, 8440, 8449,17438,26441,17443,17453,10505,17472,
-     8440,17484,17490, 8428, 8428,17501,17491,17503,26441,17510,
-    17532,17544,17549, 8401, 8415,14692, 8426, 8398, 8364,11133,
-    14925,14680,17555,10906,17558,17561,17570,17592,17609, 8350,
-    14674, 8375,17612,26441,17615,17621, 8341, 8342,17626,17638,
-    17660,10973,17663,10573,17669,26441,17672,17686,17689,17706,
-    10574,11232,17720,17723,17735,17753,17754,17765,17776,17787,
-    17788, 8316, 8274, 8272, 8261, 8259,26441, 8261, 8125, 8109,
-    17806,14683,17799,17817,10576,17818,17837,15638,14685,10585,
-
-    17840,17851, 8085,10586,17852, 8093,17870,17882,17893,17900,
-    14840,17903, 8068,17912,17941, 8035, 8033, 6784, 8019,17915,
-    14838,17950,14841,10653,17960, 8017,17953,17963, 8017,10654,
-    17970,17980,17975,26441,26441,15314, 6631, 7994, 7922,15357,
-    18001,10665,18013,18023,18026,    0,14843, 7900,18032,18043,
-     7912,14677,18044,18046,18069,10787,18081,14846,10666,18092,
-    18094,18103,18104,11574,10733,18106,18129,18123,18141,18160,
-    18158,18172,18178,18195, 7915, 7902, 7901, 7914, 7884, 7710,
-     7713, 7689,18189, 7618,18201,18226,14849,18228, 7613,14852,
-    18215,18238,26441,18253,26441,18265,18271,18276,18283, 7615,
-
-    18288, 7557,18298,18313, 7564, 7560, 7558, 7539,18333, 7526,
-    18335, 7511,18336,18346,15105, 7511,10734,18347,15409,18366,
-    15237, 7486, 7473, 7465, 7487, 7448,15304,18381,18392,18393,
-    14854, 7456,18395,18404,15106, 7451,14923,18414,18415,18434,
-    11320,18445,18457,10736,18460,18471,18480,18482,18494,18513,
-    18483,18531, 7430, 7425, 7414, 7408, 7416, 7401, 7373, 7359,
-    18533, 7377,18536,15417,18543,14933,15111,18542, 7358,18548,
-    18562,18585, 7347,18591, 7338,18597,18604, 7335, 7339,26441,
-     7292,18603, 7294,18614, 7288,18616,10746,18634, 7269,15697,
-     7251, 7252, 7245, 7243, 7255,15898,18645,18655,18657, 7213,
-
-    18664,10814,18667,18676,18686,10867,18698,15509,18713,18719,
-    18724,18731,18736,18746,18758,18765,18783, 7228, 7203, 7156,
-     7166, 7142, 7132, 7119, 7118,18785, 7121,18795, 7071,18804,
-     7070,18806,15416,18818, 7066,18837, 6976,18843,18852, 6973,
-     6977,18855,26441,18864, 6978,18866,15495,10816,18878, 6952,
-    15364, 6942, 6912, 6912, 6890,26441,15464,18901,15687,18907,
-    17677,18913,18166, 6887,18912,16259,15112,18932,18938,18950,
-    10826,10825,18955,15627,18961,18981,18967,19004,18984,19010,
-     6890, 6897,26441, 6886,26441, 6883, 6869, 6865,19019, 6842,
-    19031, 6797,19037, 6798,19049,10905,19095,15356,19178,19179,
-
-     6796, 6786,19181,10893,19184,15630,10894,19190,26441,15367,
-     6768, 6742, 6739, 6729,15510,19227, 5737,19229, 5899,19232,
-     6032,15238,19239,16567,15639,19238,19252,26441,10945,19258,
-    19277,19287,19289,19299,19300, 6711, 6712, 6657, 6665, 6655,
-     6646,19306, 6621,19318,26441,19337,10985,19347,15633,19348,
-    10987,26441,19349,    0,16572,26441,26441,15684,    0,    0,
-        0,15818,11052,19359,19360, 6557, 6528,19366,15692,11054,
-    11134,11186,11276, 6531,15476,19386,19405,19408,19411,26441,
-    26441, 6490,26441, 6474, 6470,19420, 6427,19423,15829,11305,
-    15827,15956,11359,19438,19457, 6338, 6341,12959,15891,16011,
-
-     6264,19458,19468,19469, 6258,26441, 6183,19499, 6155,19479,
-    11360, 6135, 6127,19506,19516,19521, 6064, 5968,19526, 5947,
-    19533,11362, 5556, 5558,19536,19551,19563, 5485, 5440,19574,
-     5392,11367, 5388,19584,19586, 5320,26441,19596, 5164,11368,
-     5161,26441,19605, 4430, 4421,19619, 4097, 3992,19631, 3881,
-    26441,19634, 3201,26441,26441,19680,19693,19706,19719,19732,
-    19745,19758,19771,19784,19797,19810,19823,19836,19849,19862,
-    19872,19885,19898,19908,19921,19934,19947,19960,19970,19983,
-    19996,20006,20019,20032,20045,20055,20068,20081,20091,20104,
-    20117,20127,20140,20153,20163,20176,20189,20199,20212,20225,
-
-    20235,20248,20261,20271,20284,20297,20307,20320,20333,20343,
-    20356,20369,20379,20392,20405,20415,20428,20441,20451,20464,
-    20477,20490,20503,20513,20526,20539,20549,20562,20575,20585,
-    20598,20611,20621,20634,20647,20660,20670,20683,20696,20706,
-    20719,20732,20742,20755,20768,20778,20791,20804,20817,20830,
-     2853,20840,20853,20866,20879,20892,20905,20918,20928,20941,
-    20954,20964,20977,20990,21000,21013,21026,21036,21049,21062,
-    21075,21088,21098,21111,21124,21137,21147,21160,21173,21186,
-    21196,21209,21222,21232,21245,21258,21268,21281,21294,21307,
-    21320,21333,21343,21356,21369,21379,21392,21405,21415,21428,
-
-    21441,21454,21467,21480,21490,21503,21516,21526,21539,21552,
-    21562,21575,21588,21601,21611,21624,21637,21650,21663,21676,
-    21689,21702,21715,21728,21738,21751,21764,21777,21787,21800,
-    21813,21826,21839,21849,21862,21875,21888,21901,21914,21927,
-    21937,21950,21963,21976,21986,21999,22012,22025,22035,22048,
-    22061,22074,22084,22097,22110,22123,22133,22146,22159,22172,
-    22182,22195,22208,22221,22231,22244,22257,22270,22280,22293,
-    22306,22319,22329,22342,22355,22368,22378,22391,22404,22417,
-    22427,22440,22453,22466,22479,22492,22502,22515,22528,22541,
-    22551,22564,22577,22590,22600,22613,22626,22639,22649,22662,
-
-    22675,22688,22701,22711,22724,22737,22750,22760,22773,22786,
-    22799,22809,22822,22835,22848,22858,22871,22884,22897,22910,
-    22923,22936,22949,22962,22975,22988, 2735,23001,23014,23027,
-    23040,23053,23066,23079,23092,23105,23118,23131,23144,23157,
-    23167,23180,23193,23206,23216,23229,23242,23255,23265,23278,
-    23291,23304,23314,23327,23340,23353,23366,23379,23389,23402,
-    23415,23428,23441,23451,23464,23477,23490,23503,23513,23526,
-    23539,23552,23562,23575,23588,23601,23611,23624,23637,23650,
-    23663,23676,23686,23699,23712,23725,23735,23748,23761,23774,
-    23784,23797,23810,23823,23836,23849,23859,23872,23885,23898,
-
-    23908,23921,23934,23947,23957,23970,23983,23996,24006,24019,
-    24032,24045,24058,24071,24084,24097,24110,24123,24136,24149,
-    24162,24175,24188,24201,24214,24227,24240,24253,24266,24279,
-    24292,24305,24318,24331,24344,24357,24370,24383,24396,24409,
-    24422,24435,24448,24461,24474,24487,24500,24513,24526,24539,
-    24552,24565,24578,24591,24604,24617,24630,24643,24656,24669,
-    24682,24695,24708,24721, 1819,24734,24747,24760,24773,24786,
-    24799,24812,24825,24838,24851,24864,24877,24890,24903,24916,
-    24929,24942,24955,24968,24978,24991,25004,25017,25030,25043,
-    25056,25069,25082,25095,25108,25121,25134,25147,25160,25173,
-
-    25186,25199,25212,25225,25238,25251,25264,25277,25290,25303,
-    25316,25329,25342,25355,25368,25381,25394,25407,25420,25433,
-    25446,25459,25472,25485,25498,25511,25524,25537,25550,25563,
-    25573,25586,25599,25612,25625,25638,25651,25664,25677,25690,
-    25703,25716,25729,25742,25755,25768,25781,25794,25807,25820,
-    25833,25846,25859,25872,25885,25898,25911,25924,25937,25950,
-    25963,25976,25989,26002,26015,26028,26041,26054,26067,26080,
-    26093,26106,26119,26132,26145,26158,26171,26183,26193,26206,
-    26219,26232,26245,26258,26271,26284,26297,26310,26323,26336,
-    26349,26362,26375,26388,26401,26414,26427
-
+static yyconst flex_int16_t yy_def[3463] =
+    {   0,
+     2913, 2912, 2912,    3, 2912,    5, 2914, 2914, 2912,    9,
+     2912,   11, 2912,   13, 2912,   15, 2912,   17, 2912,   19,
+     2912,   21, 2912,   23, 2912,   25, 2912,   27, 2912,   29,
+     2912,   31, 2912,   33, 2912,   35, 2915, 2915, 2916, 2916,
+     2912,   41, 2912,   43, 2912,   45, 2912,   47, 2917, 2917,
+     2918, 2918, 2919, 2919, 2912,   55, 2912,   57, 2912,   59,
+     2912,   61, 2920, 2920, 2921, 2921, 2920, 2920, 2912,   69,
+     2912,   71, 2912,   73, 2912,   75, 2912,   77, 2922, 2922,
+     2923, 2923, 2912,   83, 2920, 2920, 2924, 2924, 2920, 2920,
+     2912,   91, 2925, 2925, 2920, 2920, 2912,   97, 2912,   99,
+
+     2912,  101, 2912,  103, 2920, 2920, 2912,  107, 2912,  109,
+     2912,  111, 2912,  113, 2912,  115, 2912,  117, 2912,  119,
+     2912,  121, 2912, 2912, 2912, 2912, 2912, 2912, 2926, 2927,
+     2912, 2927,  132,  131,  132,  132,  132,  132,  132,  132,
+      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
+      132,  132,  132,  132,  132, 2927, 2928, 2929, 2912, 2912,
+     2912, 2912, 2912, 2912, 2930, 2912, 2912, 2912, 2912, 2931,
+     2932, 2933, 2912, 2934,  173, 2912, 2934, 2934,  178,  178,
+     2912, 2912, 2935, 2935, 2935, 2936, 2937, 2938, 2938, 2938,
+     2939, 2940, 2912, 2941, 2941,  193, 2942, 2941,  193, 2943,
+
+     2944, 2945, 2945, 2945, 2946, 2947, 2948, 2948, 2948, 2949,
+     2950, 2951, 2951, 2951, 2952, 2953, 2954, 2954, 2954, 2955,
+     2956, 2957, 2957, 2957, 2958, 2959, 2960, 2960, 2960, 2961,
+     2962, 2963, 2963, 2963, 2964, 2965, 2966, 2966, 2966, 2967,
+     2968, 2969, 2969, 2969, 2970, 2971, 2972, 2972, 2972, 2973,
+     2974, 2975, 2975, 2975, 2976, 2977, 2978, 2978, 2978, 2979,
+     2979, 2980, 2980, 2980, 2981, 2982, 2983, 2983, 2983, 2984,
+     2985, 2986, 2986, 2986, 2987, 2988, 2989, 2989, 2989, 2990,
+     2991, 2912, 2912, 2912, 2992, 2992, 2992, 2992, 2912, 2912,
+     2912, 2912, 2912, 2912, 2993, 2993, 2993, 2994, 2995, 2996,
+
+     2996, 2996, 2997, 2998, 2999, 2999, 2999, 3000, 3001, 3002,
+     3002, 3002, 3003, 3004, 2912, 3005, 3005, 3005, 2912, 2912,
+     2912, 2912, 2912, 3006, 3007, 3008, 2912, 2912, 3009, 3010,
+     3010, 3010, 3010, 3010, 3010, 3011, 3012, 3013, 3014, 3015,
+     3015, 3015, 3016, 3017, 3018, 3018, 3018, 3019, 3020, 3021,
+     3021, 3021, 3022, 3023, 3024, 3024, 3024, 3025, 3026, 3027,
+     3027, 3027, 3028, 2912, 3028, 3028, 2912, 3029, 3029, 3029,
+     3030, 3031, 3032, 3032, 3032, 2912, 3033, 3033, 3033, 3034,
+     3035, 3036, 3036, 3036, 2912, 3037, 3037, 3037, 3038, 3039,
+     3040, 3040, 3040, 3041, 3042, 3043, 3043, 3043, 3044, 3045,
+
+     2912, 2912, 2912, 2912, 3046, 3047, 3048, 2912, 3049, 3049,
+     3049, 3050, 3051, 3052, 3052, 3052, 3053, 3054, 3055, 3055,
+     3055, 3056, 3057, 2912, 2912, 3058, 3059, 3060, 3061, 3061,
+     3061, 3062, 3063, 3064, 3064, 3064, 3065, 3066, 3067, 3067,
+     3067, 3068, 3069, 3070, 3070, 3070, 3071, 3072, 3073, 3074,
+     3074, 2912, 2912, 3074, 3075, 3076,  451,  457,  451,  451,
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  457,
+      457,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451, 2912,  451,  451,  451,  451,  451,  451,  454,
+     3077, 2912, 3078, 3079, 3080, 2912, 2912, 3081, 3082, 2912,
+     2912, 3083, 2912, 3083, 3083,  565,  565,  565,  565, 3084,
+     3084, 3085, 3086,  571, 3087, 3088, 3088, 3089, 3090,  577,
+     3091, 2912, 3092, 3093,  582, 3094, 3095, 3093, 3093, 3096,
+     3097,  585,  589, 3098, 3099, 3100, 3100, 3101, 3102,  597,
+
+     3103, 3104, 3104, 3105, 3106,  603, 3107, 3108, 3108, 3109,
+     3110,  609, 3111, 3112, 3112, 3113, 3114,  615, 3115, 3116,
+     3116, 3117, 3118,  621, 3119, 3120, 3120, 3121, 3122,  627,
+     3123, 3124, 3124, 3125, 3126,  633, 3127, 3128, 3128, 3129,
+     3130,  639, 3131, 3132, 3132, 3133, 3134,  645, 3135, 3136,
+     3136, 3137, 3138,  651, 3139, 3140, 3140, 3141, 3142,  657,
+     3143, 3144, 3145, 3146, 3146, 3147, 3148,  665, 3149, 3150,
+     3150, 3151, 3152,  671, 3153, 3154, 3154, 3155, 3156,  677,
+     3157, 3158, 3158, 3159, 3160,  683, 3161, 3162, 3163, 3163,
+     3164, 3165,  690, 3166, 3167, 3167, 3168, 3169,  696, 3170,
+
+     3171, 3171, 3172, 3173,  702, 3174, 3175, 3175, 3176, 3177,
+      708, 3178, 3179, 2912, 2912, 2912, 2912, 3180, 3181, 3182,
+     3183, 2912, 3184, 3185, 3186, 3187, 3188, 3188, 3188, 3188,
+     3188, 3188, 3189, 3190, 3191, 3192, 2912, 3193, 3194, 3195,
+     3196, 3188, 3188, 3197, 3188, 3198, 3188, 3188, 3188, 3188,
+     3188, 3199, 3200, 3200, 3201, 3202,  754, 3203, 3204, 3204,
+     3205, 3206,  760, 3207, 3208, 3208, 3209, 3210,  766, 3211,
+     3212, 3212, 3213, 3214,  772, 3215, 3216, 3217, 3218, 3218,
+     3219, 3220,  780, 3221, 3222, 2912, 3223, 3223, 3224, 3225,
+      788, 3226, 3227, 2912, 3228, 3228, 3229, 3230,  796, 3231,
+
+     3232, 3232, 3233, 3234,  802, 3235, 3236, 3236, 3237, 3238,
+      808, 3239, 2912, 3240, 3241, 2912, 3242, 3242, 3243, 3244,
+      818, 3245, 3246, 3246, 3247, 3248,  824, 3249, 3250, 3250,
+     3251, 3252,  830, 3253, 2912, 3254, 3255, 3256, 3256, 3257,
+     3258,  839, 3259, 3260, 3260, 3261, 3262,  845, 3263, 3264,
+     3264, 3265, 3266,  851, 3267, 3268, 3268, 3269, 3270,  857,
+     3271, 3272, 3272,  863,  863,  863,  863,  863,  863, 2912,
+      863,  863,  863,  863,  863,  863,  863,  863, 2912,  863,
+      863,  863,  863,  863,  863,  863,  863,  863,  863,  863,
+      863,  863,  863,  863,  863,  863,  863,  863,  863,  863,
+
+      863,  863,  863,  863, 2912,  863,  863, 2912,  863,  863,
+      863,  863, 2912,  863,  863,  863,  863, 2912,  863,  863,
+      863,  863,  863,  863, 2912,  863,  863,  863,  863,  863,
+     2912,  863,  863,  863,  863,  863,  863,  863,  863,  863,
+      863,  863,  863,  863, 2912,  863,  863,  863,  863, 2912,
+      863,  863,  863, 2912,  863,  863,  863,  863,  863,  863,
+      863,  863,  863,  863,  863, 2912,  863,  863,  863,  863,
+      863,  863,  863, 2912, 3273, 2912,  863, 2912,  863, 3272,
+     3274, 3275,  863,  863,  863,  863,  863,  863, 2912,  863,
+      863, 2912,  863,  980, 3276, 3277, 3278, 2912, 3279, 3280,
+
+     3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290,
+     3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300,
+     3301, 3302, 2912, 3303, 3303, 3304, 3305, 3306, 3304, 3303,
+     3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316,
+     2912, 2912, 3317, 3317, 3318, 3319, 3320, 3318, 3317, 3321,
+     3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 2912, 3330,
+     3331, 3332, 3333, 3334, 3335, 2912, 3336, 2912, 3337, 3338,
+     3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348,
+     3349, 3349, 1082, 2912, 3350, 1082, 1082, 2912, 3351, 1082,
+     1082, 2912, 1082, 1082, 1082, 1082, 1082, 1082, 1082, 1082,
+
+     2912, 1082, 2912, 3352, 2912, 2912, 1082, 1082, 1082, 1082,
+     1082, 1082, 1082, 2912, 1082, 1082, 3349, 1082, 1082, 1082,
+     2912, 1082, 1082, 1082, 1082, 1082, 1082, 1082, 2912, 1082,
+     1082, 1082, 2912, 3353, 2912, 2912, 1117, 3354, 3355, 1082,
+     2912, 1082, 1082, 2912, 1082, 1082, 2912, 1082, 2912, 3356,
+     2912, 1082, 2912, 1082, 1082, 1082, 2912, 1082, 1082, 1082,
+     1082, 1082, 1082, 1082, 1082, 1082, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 1082, 1082, 1082, 2912, 1082,
+     1082, 2912, 1082, 1082, 1082, 1082, 1082, 1082, 1082, 1082,
+     1082, 1082, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 1082,
+
+     2912, 1082, 1082, 2912, 1082, 1082, 2912, 1082, 1082, 2912,
+     1082, 1082, 2912, 1082, 1082, 1082, 2912, 1082, 3357, 1082,
+     1082, 1082, 2912, 1082, 1082, 1082, 1082, 1082, 1082, 2912,
+     2912, 2912, 1082, 1082, 2912, 1082, 1082, 1082, 2912, 1082,
+     2912, 1082, 1082, 2912, 1082, 1082, 1082, 1082, 1082, 1082,
+     2912, 1082, 1082, 1082, 1082, 2912, 1082, 1082, 2912, 1082,
+     2912, 2912, 1082, 2912, 1082, 1082, 1082, 1082, 1082, 1082,
+     2912, 3358, 1082, 1082, 2912, 2912, 1082, 1082, 2912, 1082,
+     3359, 3360, 3360, 3361, 3362, 3363, 3361, 3361, 3364, 3365,
+     3366, 3367, 3367, 3368, 3369, 3370, 3361, 3360, 3364, 3365,
+
+     3366, 3360, 3361, 3361, 3364, 3365, 3366, 3364, 3361, 3371,
+     3372, 3373, 3368, 3367, 3374, 3375, 3376, 3377, 3378, 3378,
+     3379, 3380, 3381, 3379, 3379, 3382, 3383, 3384, 3385, 3385,
+     3386, 3387, 3388, 3379, 3378, 3382, 3383, 3384, 3378, 3379,
+     3379, 3382, 3383, 3384, 3382, 3379, 3389, 3390, 3391, 3386,
+     3385, 3392, 3393, 3394, 2912, 2912, 2912, 3395, 3395, 1359,
+     2912, 2912, 2912, 3395, 3396, 3397, 3398, 1359, 1359, 1359,
+     2912, 3399, 2912, 1359, 2912, 1371, 1364, 3396, 3397, 3399,
+     2912, 3399, 1359, 2912, 1359, 2912, 1359, 1359, 1359, 1359,
+     1359, 1359, 1359, 2912, 1359, 1359, 1359, 1359, 2912, 1359,
+
+     1359, 2912, 2912, 2912, 1364, 3396, 3397, 3400, 3401, 1359,
+     2912, 3401, 2912, 2912, 1364, 3396, 3397, 1359, 2912, 3402,
+     2912, 1359, 2912, 1364, 3396, 3397, 1359, 2912, 1359, 1359,
+     1359, 1359, 1359, 1359, 2912, 3403, 1359, 1359, 1359, 1359,
+     2912, 1359, 1359, 1359, 1359, 2912, 1359, 1359, 1359, 2912,
+     1359, 1359, 2912, 2912, 1359, 2912, 1359, 1359, 2912, 1359,
+     1359, 2912, 1359, 2912, 1359, 1359, 2912, 2912, 1364, 3396,
+     3397, 3404, 1359, 2912, 3404, 2912, 2912, 1364, 3396, 3397,
+     1359, 2912, 1359, 1359, 1359, 2912, 1359, 1359, 1359, 1359,
+     1359, 1359, 1359, 1359, 1359, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 1359, 1359,
+     2912, 1359, 1359, 1359, 2912, 1359, 1359, 2912, 1359, 1359,
+     2912, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 1359, 1359, 2912, 1359, 1359,
+     2912, 1359, 2912, 1359, 2912, 1359, 2912, 1359, 1359, 3405,
+     3405, 3405, 1359, 2912, 3406, 1359, 2912, 1359, 1359, 1359,
+     1359, 1359, 2912, 2912, 2912, 1359, 1359, 1359, 2912, 2912,
+     1359, 1359, 1359, 2912, 2912, 1359, 1359, 1359, 2912, 1359,
+     2912, 1359, 1359, 2912, 1359, 1359, 1359, 1359, 2912, 1359,
+     2912, 1359, 2912, 2912, 1359, 2912, 1359, 1359, 2912, 1359,
+
+     1371, 3399, 1359, 1359, 2912, 3407, 2912, 2912, 1605, 1364,
+     3396, 3397, 3407, 3407, 1359, 1359, 2912, 2912, 1359, 1359,
+     2912, 1359, 3408, 3408, 3409, 3410, 3411, 3409, 3409, 3412,
+     3413, 3414, 3415, 3415, 3416, 3417, 3418, 3409, 3409, 3412,
+     3413, 3414, 3412, 3412, 3419, 3420, 3421, 3416, 3416, 3422,
+     3423, 3424, 3425, 3425, 3426, 3427, 3428, 3426, 3426, 3429,
+     3430, 3431, 3432, 3432, 3433, 3434, 3435, 3426, 3426, 3429,
+     3430, 3431, 3429, 3429, 3436, 3437, 3438, 3433, 3433, 3439,
+     3440, 3441, 3442, 3443, 3443, 2912, 1685, 1685, 2912, 3444,
+     2912, 3444, 3444, 1685, 2912, 1685, 2912, 1685, 2912, 1685,
+
+     1685, 2912, 1685, 1685, 2912, 1685, 1685, 2912, 1685, 1685,
+     2912, 1685, 1685, 2912, 1685, 1685, 1685, 2912, 1685, 3445,
+     3445, 3445, 2912, 2912, 1685, 1685, 2912, 1685, 1685, 1685,
+     1685, 1685, 2912, 2912, 2912, 1685, 1685, 3443, 3446, 3447,
+     3448, 2912, 2912, 1685, 1685, 2912, 1685, 1685, 1685, 2912,
+     1685, 1685, 2912, 1685, 2912, 1685, 2912, 1685, 1685, 2912,
+     1685, 1685, 2912, 2912, 1685, 2912, 2912, 1685, 1685, 2912,
+     1685, 1685, 2912, 1685, 2912, 2912, 1685, 2912, 1685, 1685,
+     2912, 2912, 2912, 3449, 1685, 1738, 1782, 3450, 3451, 3452,
+     3452, 3452, 1685, 2912, 1685, 1685, 2912, 1685, 1685, 2912,
+
+     1685, 1685, 1685, 1685, 1685, 1685, 1685, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 1685, 2912, 1685, 1685, 2912, 1685, 2912, 1685,
+     2912, 1685, 2912, 1685, 1685, 1685, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 1685, 2912, 1685, 1685, 2912, 1685,
+     2912, 1685, 1685, 2912, 2912, 1685, 2912, 1685, 3453, 3453,
+     1685, 1685, 2912, 2912, 2912, 1685, 1738, 3446, 3447, 3454,
+     2912, 1685, 2912, 1685, 1685, 2912, 1685, 1685, 1685, 2912,
+     2912, 2912, 1685, 1685, 1685, 1685, 1685, 2912, 2912, 1685,
+     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685, 2912,
+     1685, 1685, 1685, 2912, 2912, 1685, 2912, 1685, 1685, 2912,
+     1685, 1689, 3444, 3444, 1685, 2912, 1685, 2912, 3455, 3455,
+     3455, 1685, 2912, 2912, 1685, 2912, 1685, 1685, 1685, 1685,
+     1685, 2912, 2912, 2912, 1685, 1685, 3444, 1685, 2912, 1685,
+     2912, 1685, 2912, 2912, 1685, 2912, 1685, 1685, 2912, 1685,
+     1685, 2912, 1685, 1685, 2912, 1685, 1685, 2912, 1685, 1685,
+     1685, 2912, 1685, 2912, 1685, 1685, 2912, 1685, 1685, 1685,
+     2912, 2912, 1685, 1685, 2912, 1685, 1685, 2912, 1685, 2912,
+     1685, 2912, 2912, 1685, 1685, 1685, 2912, 2912, 1685, 2912,
+
+     1685, 1685, 1685, 2912, 1685, 1685, 2912, 1685, 1782, 3449,
+     2912, 2912, 1738, 3446, 3447, 3449, 3449, 1782, 1782, 1738,
+     1787, 1738, 1787, 1787, 1685, 2912, 1685, 2912, 1685, 2912,
+     1685, 1685, 1685, 1685, 1685, 1685, 2912, 2912, 3456, 2912,
+     2912, 2912, 3457, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 1928, 3455, 1685, 2912, 1685, 2912, 1685,
+     2912, 2912, 1685, 2912, 1685, 2912, 1685, 1685, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685, 1685,
+     2912, 1685, 1685, 2912, 2912, 1685, 2912, 1685, 2912, 1685,
+     3453, 3453, 3453, 1685, 1863, 3454, 1685, 3454, 2912, 1685,
+
+     2912, 1685, 1685, 2912, 1685, 1685, 2912, 2912, 1685, 1685,
+     1685, 1685, 2912, 2912, 1685, 1685, 1685, 1685, 1685, 1685,
+     1685, 1685, 1685, 1685, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 1685, 2912, 1685, 1685, 1685, 2912,
+     1685, 1685, 1685, 2912, 1685, 1685, 2912, 2912, 1685, 2912,
+     3455, 1685, 3444, 2912, 1685, 1685, 1685, 2912, 2912, 2912,
+     3458, 1685, 1685, 2912, 1685, 2912, 1685, 2912, 1685, 1954,
+     3459, 2912, 1954, 2912, 1738, 3446, 3447, 1685, 2912, 1685,
+     2912, 1685, 1685, 2912, 1685, 2912, 1685, 1685, 2912, 1685,
+     1685, 1685, 1685, 2912, 1685, 2912, 1685, 2912, 1685, 2912,
+
+     2912, 1685, 2912, 1685, 1685, 2912, 1685, 2912, 1685, 1685,
+     2912, 2912, 1685, 1685, 1685, 3449, 1685, 2912, 1685, 2912,
+     1685, 1685, 1685, 1685, 1685, 2912, 2912, 3456, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 1928, 3455, 1685, 3455,
+     2912, 1685, 2912, 1685, 1685, 1685, 1685, 1685, 1685, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685, 1685,
+     2912, 2912, 1685, 2912, 2912, 1685, 1685, 1863, 3454, 1685,
+     3454, 2912, 1685, 2912, 1685, 1685, 2912, 2912, 1685, 1685,
+     1685, 2912, 1685, 1685, 2912, 1685, 2912, 2912, 2912, 2912,
+     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 1685,
+     2912, 1685, 1685, 1685, 1685, 1685, 2912, 2912, 1685, 3444,
+     3444, 2912, 1685, 1685, 2912, 3460, 3458, 1685, 2912, 1685,
+     2912, 1685, 2912, 3459, 1954, 3459, 1685, 2912, 1685, 2912,
+     1685, 2912, 1685, 1685, 2912, 1685, 1685, 1685, 1685, 2912,
+     1685, 1685, 2912, 2912, 1685, 2912, 2912, 1685, 2912, 1685,
+     1685, 2912, 1685, 2912, 1685, 1685, 2912, 2912, 1685, 1685,
+     1685, 2912, 1685, 1685, 1685, 1685, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685, 1685,
+     1685, 1685, 1685, 1685, 2912, 2912, 2912, 1685, 2912, 1685,
+
+     1685, 2912, 2912, 1685, 1685, 1685, 2912, 1685, 2912, 1685,
+     2912, 1685, 1685, 1685, 1685, 2912, 2912, 1685, 1685, 1685,
+     1685, 1685, 1685, 1685, 1685, 1685, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685, 1685, 2912,
+     1685, 1685, 2912, 3461, 3460, 1685, 1685, 2912, 1685, 2912,
+     3459, 1685, 2912, 1685, 1685, 1685, 1685, 2912, 1685, 2912,
+     1685, 1685, 2912, 2912, 2912, 2912, 1685, 2912, 1685, 2912,
+     2912, 1685, 2912, 1685, 1685, 2912, 2912, 1685, 1685, 1685,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685,
+     1685, 1685, 1685, 1954, 3459, 2912, 1685, 1685, 2912, 2912,
+
+     1685, 1685, 1685, 2912, 1685, 2912, 2912, 1685, 1685, 1685,
+     1685, 2912, 2912, 1685, 1685, 1685, 1685, 1685, 1685, 1685,
+     1685, 1685, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     1685, 2912, 1685, 1685, 3455, 1685, 2912, 3461, 1685, 1685,
+     2912, 1685, 2912, 1685, 2912, 1685, 1685, 1685, 1685, 2912,
+     1685, 2912, 1685, 1685, 2912, 2912, 2912, 2912, 1685, 2912,
+     1685, 2912, 1685, 1685, 2912, 2912, 2912, 1685, 2912, 1685,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 1685, 1685,
+     1685, 1685, 3459, 2912, 1685, 1685, 2912, 2912, 2912, 1685,
+     1685, 1685, 2912, 1685, 1685, 2912, 1685, 1685, 1685, 1685,
+
+     1685, 1685, 1685, 1685, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 1685, 2912, 1685, 2912, 1685, 3455, 3455, 1685,
+     2912, 1685, 1685, 1685, 2912, 1685, 2912, 1685, 1685, 2912,
+     2912, 2912, 2912, 1685, 2912, 1685, 2912, 1685, 2912, 1685,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 1685,
+     1685, 1685, 1685, 2912, 1685, 2912, 1685, 1685, 1685, 2912,
+     1685, 2912, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,
+     1685, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 1685,
+     2912, 1685, 2912, 1685, 2912, 1685, 2912, 1685, 2912, 1685,
+     2912, 1685, 1685, 2912, 2912, 1685, 2912, 1685, 2912, 1685,
+
+     2912, 2912, 1685, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 1685, 2912, 1685, 2912, 1685, 2912, 2912, 1685,
+     2912, 2912, 1685, 1685, 1685, 2912, 2912, 1685, 2912, 1685,
+     1685, 1685, 1685, 1685, 1685, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 1685, 2912, 1685, 2912, 1685, 2912, 1685,
+     2912, 2912, 3462, 1685, 1685, 2912, 2912, 1685, 2912, 1685,
+     2912, 2912, 1685, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 1685, 2912, 1685, 2912, 1685, 2912, 2912, 1685, 2912,
+     2912, 1685, 1685, 2912, 2912, 1685, 1685, 1685, 1685, 1685,
+     1685, 2912, 2912, 2912, 2912, 2912, 2912, 1685, 2912, 1685,
+
+     2912, 1685, 2912, 1685, 2912, 1685, 2912, 2912, 1685, 2752,
+     3462, 2912, 2912, 2752, 1738, 3446, 3447, 3462, 3462, 1685,
+     1685, 2912, 2912, 1685, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 1685, 1685, 1685, 1685, 2912, 2912, 2912, 2912,
+     2912, 2912, 1685, 2912, 1685, 2912, 2912, 2752, 3462, 3462,
+     1685, 1685, 2912, 2912, 2912, 2912, 2912, 2912, 1685, 1685,
+     1685, 2912, 2912, 2912, 1685, 2912, 1685, 2912, 2912, 2912,
+     1685, 1685, 1685, 2912, 2912, 1685, 2912, 1685, 2912, 2912,
+     2912, 1685, 1685, 1685, 2912, 2912, 1685, 2912, 2912, 2912,
+     1685, 1685, 2912, 2912, 1685, 2912, 2912, 2912, 2912, 1685,
+
+     2912, 2912, 1685, 2912, 2912, 1685, 2912, 2912, 1685, 2912,
+     2912,    0, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912
     } ;
 
-static yyconst flex_int16_t yy_def[3398] =
+static yyconst flex_int16_t yy_nxt[27006] =
     {   0,
-     2856, 2855, 2855,    3, 2855,    5, 2857, 2857, 2855,    9,
-     2855,   11, 2855,   13, 2855,   15, 2855,   17, 2855,   19,
-     2855,   21, 2855,   23, 2855,   25, 2855,   27, 2855,   29,
-     2855,   31, 2855,   33, 2855,   35, 2858, 2858, 2859, 2859,
-     2855,   41, 2855,   43, 2855,   45, 2855,   47, 2860, 2860,
-     2861, 2861, 2862, 2862, 2855,   55, 2855,   57, 2855,   59,
-     2855,   61, 2863, 2863, 2864, 2864, 2863, 2863, 2855,   69,
-     2855,   71, 2855,   73, 2855,   75, 2855,   77, 2865, 2865,
-     2866, 2866, 2855,   83, 2863, 2863, 2867, 2867, 2863, 2863,
-     2855,   91, 2868, 2868, 2863, 2863, 2855,   97, 2855,   99,
-
-     2855,  101, 2855,  103, 2863, 2863, 2855,  107, 2855,  109,
-     2855,  111, 2855,  113, 2855,  115, 2855,  117, 2855,  119,
-     2855, 2855, 2855, 2855, 2855, 2855, 2869, 2870, 2855, 2870,
-      130,  129,  130,  130,  130,  130,  130,  130,  130,  130,
+     2912,  125,  126,  717,  127,  128,  129,  717,  129,  130,
+      131,  132,  130,  133,  134,  129,  130,  129,  130,  130,
       130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  130, 2870, 2871, 2872, 2855, 2855, 2855, 2855,
-     2855, 2855, 2873, 2855, 2855, 2855, 2855, 2874, 2875, 2876,
-     2855, 2877,  171, 2855, 2877, 2877,  176,  176, 2855, 2855,
-     2878, 2878, 2878, 2879, 2880, 2881, 2881, 2881, 2882, 2883,
-     2855, 2884, 2884,  191, 2885, 2884,  191, 2886, 2887, 2888,
-
-     2888, 2888, 2889, 2890, 2891, 2891, 2891, 2892, 2893, 2894,
-     2894, 2894, 2895, 2896, 2897, 2897, 2897, 2898, 2899, 2900,
-     2900, 2900, 2901, 2902, 2903, 2903, 2903, 2904, 2905, 2906,
-     2906, 2906, 2907, 2908, 2909, 2909, 2909, 2910, 2911, 2912,
-     2912, 2912, 2913, 2914, 2915, 2915, 2915, 2916, 2917, 2918,
-     2918, 2918, 2919, 2920, 2921, 2921, 2921, 2922, 2922, 2923,
-     2923, 2923, 2924, 2925, 2926, 2926, 2926, 2927, 2928, 2929,
-     2929, 2929, 2930, 2931, 2932, 2932, 2932, 2933, 2934, 2855,
-     2855, 2855, 2935, 2935, 2935, 2935, 2855, 2855, 2855, 2855,
-     2855, 2855, 2936, 2936, 2936, 2937, 2938, 2939, 2939, 2939,
-
-     2940, 2941, 2942, 2942, 2942, 2943, 2944, 2945, 2945, 2945,
-     2946, 2947, 2855, 2948, 2948, 2948, 2855, 2855, 2855, 2855,
-     2855, 2949, 2950, 2951, 2855, 2855, 2952, 2953, 2953, 2953,
-     2953, 2953, 2953, 2954, 2955, 2956, 2957, 2958, 2958, 2958,
-     2959, 2960, 2961, 2961, 2961, 2962, 2963, 2964, 2964, 2964,
-     2965, 2966, 2967, 2967, 2967, 2968, 2969, 2970, 2970, 2970,
-     2971, 2855, 2971, 2971, 2855, 2972, 2972, 2972, 2973, 2974,
-     2975, 2975, 2975, 2855, 2976, 2976, 2976, 2977, 2978, 2979,
-     2979, 2979, 2855, 2980, 2980, 2980, 2981, 2982, 2983, 2983,
-     2983, 2984, 2985, 2986, 2986, 2986, 2987, 2988, 2855, 2855,
-
-     2855, 2855, 2989, 2990, 2991, 2855, 2992, 2992, 2992, 2993,
-     2994, 2995, 2995, 2995, 2996, 2997, 2998, 2998, 2998, 2999,
-     3000, 2855, 2855, 3001, 3002, 3003, 3004, 3004, 3004, 3005,
-     3006, 3007, 3007, 3007, 3008, 3009, 3010, 3010, 3010, 3011,
-     3012, 3013, 3014, 3014, 2855, 2855, 3014, 3015, 3016,  444,
-      450,  444,  444,  444,  444,  444,  444,  444,  444,  444,
-      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
-      444,  444,  450,  450,  444,  444,  444,  444,  444,  444,
-      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
-      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
+      130,  124,  130,  130,  130,  135,  136,  137,  138,  139,
+      140,  130,  141,  142,  130,  143,  144,  145,  146,  147,
+      148,  149,  150,  151,  152,  153,  154,  130,  130,  155,
+      130,  130,  124,  124,  124,  124,  124,  124,  124,  124,
+      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
+      124,  156,  156,  156,  156,  156,  156,  157,  157,  157,
+      158,  124,  124,  159,  159,  160,  159,  161,  162,  163,
+
+      164,  163,  159,  165,  159,  159,  159,  159,  159,  159,
+      166,  159,  159,  167,  159,  159,  159,  159,  159,  159,
+      159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
+      159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
+      159,  159,  159,  159,  168,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  170,  170,  170,  170,  170,
+      170,  171,  171,  171,  172,  169,  169,  173,  169,  174,
+      173,  175,  176,  173,  173,  173,  173,  173,  173,  169,
+      173,  173,  173,  173,  173,  173,  173,  177,  173,  173,
+
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      177,  177,  177,  177,  177,  177,  177,  177,  177,  177,
+      177,  177,  177,  177,  177,  177,  177,  177,  177,  178,
+      178,  178,  178,  178,  178,  179,  179,  179,  180,  177,
+      177,  181,  509,  182,  176,  181,  510,  182,  176,  183,
+      183,  181,  183,  182,  184,  183,  183,  183,  183,  183,
+      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
+      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
 
-      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
-      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
-      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
-      444,  444,  444,  444, 2855,  444,  444,  444,  444,  444,
-      444,  447, 3017, 2855, 3018, 3019, 3020, 2855, 2855, 3021,
-     3022, 2855, 2855, 3023, 2855, 3023, 3023,  557,  557,  557,
-      557, 3024, 3024, 3025, 3026,  563, 3027, 3028, 3028, 3029,
-     3030,  569, 3031, 2855, 3032, 3033,  574, 3034, 3035, 3033,
-     3033, 3036, 3037,  577,  581, 3038, 3039, 3040, 3040, 3041,
-     3042,  589, 3043, 3044, 3044, 3045, 3046,  595, 3047, 3048,
-
-     3048, 3049, 3050,  601, 3051, 3052, 3052, 3053, 3054,  607,
-     3055, 3056, 3056, 3057, 3058,  613, 3059, 3060, 3060, 3061,
-     3062,  619, 3063, 3064, 3064, 3065, 3066,  625, 3067, 3068,
-     3068, 3069, 3070,  631, 3071, 3072, 3072, 3073, 3074,  637,
-     3075, 3076, 3076, 3077, 3078,  643, 3079, 3080, 3080, 3081,
-     3082,  649, 3083, 3084, 3085, 3086, 3086, 3087, 3088,  657,
-     3089, 3090, 3090, 3091, 3092,  663, 3093, 3094, 3094, 3095,
-     3096,  669, 3097, 3098, 3098, 3099, 3100,  675, 3101, 3102,
-     3103, 3103, 3104, 3105,  682, 3106, 3107, 3107, 3108, 3109,
-      688, 3110, 3111, 3111, 3112, 3113,  694, 3114, 3115, 3115,
-
-     3116, 3117,  700, 3118, 3119, 2855, 2855, 2855, 2855, 3120,
-     3121, 3122, 3123, 2855, 3124, 3125, 3126, 3127, 3128, 3128,
-     3128, 3128, 3128, 3128, 3129, 3130, 3131, 3132, 2855, 3133,
-     3134, 3135, 3136, 3128, 3128, 3137, 3128, 3138, 3128, 3128,
-     3128, 3128, 3128, 3139, 3140, 3140, 3141, 3142,  746, 3143,
-     3144, 3144, 3145, 3146,  752, 3147, 3148, 3148, 3149, 3150,
-      758, 3151, 3152, 3152, 3153, 3154,  764, 3155, 3156, 3157,
-     3158, 3158, 3159, 3160,  772, 3161, 3162, 2855, 3163, 3163,
-     3164, 3165,  780, 3166, 3167, 2855, 3168, 3168, 3169, 3170,
-      788, 3171, 3172, 3172, 3173, 3174,  794, 3175, 3176, 3176,
-
-     3177, 3178,  800, 3179, 2855, 3180, 3181, 2855, 3182, 3182,
-     3183, 3184,  810, 3185, 3186, 3186, 3187, 3188,  816, 3189,
-     3190, 3190, 3191, 3192,  822, 3193, 2855, 3194, 3195, 3196,
-     3196, 3197, 3198,  831, 3199, 3200, 3200, 3201, 3202,  837,
-     3203, 3204, 3204, 3205, 3206,  843, 3207, 3208, 3208,  849,
-      849,  849,  849,  849,  849, 2855,  849,  849,  849,  849,
-      849,  849,  849, 2855,  849,  849,  849,  849,  849,  849,
-      849,  849,  849,  849,  849,  849,  849,  849,  849,  849,
-      849,  849,  849,  849,  849,  849,  849,  849,  849, 2855,
-      849,  849, 2855,  849,  849,  849,  849, 2855,  849,  849,
-
-      849, 2855,  849,  849,  849,  849,  849,  849, 2855,  849,
-      849,  849,  849,  849, 2855,  849,  849,  849,  849,  849,
-      849,  849,  849,  849,  849,  849,  849,  849, 2855,  849,
-      849,  849,  849, 2855,  849,  849,  849, 2855,  849,  849,
-      849,  849,  849,  849,  849,  849,  849,  849,  849, 2855,
-      849,  849,  849,  849,  849,  849,  849, 2855, 3209, 2855,
-      849, 2855,  849, 3208, 3210, 3211,  849,  849,  849,  849,
-      849,  849, 2855,  849,  849, 2855,  849,  964, 3212, 3213,
-     3214, 2855, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222,
-     3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232,
-
-     3233, 3234, 3235, 3236, 3237, 3238, 2855, 3239, 3239, 3240,
-     3241, 3242, 3240, 3239, 3243, 3244, 3245, 3246, 3247, 3248,
-     3249, 3250, 3251, 3252, 2855, 2855, 3253, 3253, 3254, 3255,
-     3256, 3254, 3253, 3257, 3258, 3259, 3260, 3261, 3262, 3263,
-     3264, 3265, 2855, 3266, 3267, 3268, 3269, 3270, 3271, 2855,
-     3272, 2855, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280,
-     3281, 3282, 3283, 3284, 3284, 1065, 2855, 3285, 1065, 1065,
-     2855, 3286, 1065, 1065, 2855, 1065, 1065, 1065, 1065, 1065,
-     1065, 1065, 2855, 1065, 2855, 3287, 2855, 2855, 1065, 1065,
-     1065, 1065, 1065, 1065, 1065, 2855, 1065, 1065, 3284, 1065,
-
-     1065, 1065, 2855, 1065, 1065, 1065, 1065, 1065, 1065, 1065,
-     2855, 1065, 1065, 1065, 2855, 3288, 2855, 2855, 1099, 3289,
-     3290, 1065, 2855, 1065, 1065, 2855, 1065, 1065, 2855, 1065,
-     2855, 3291, 2855, 1065, 2855, 1065, 1065, 2855, 1065, 1065,
-     1065, 1065, 1065, 1065, 1065, 1065, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 1065, 1065, 1065, 2855, 1065, 1065,
-     2855, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065,
-     1065, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 1065, 2855,
-     1065, 1065, 2855, 1065, 1065, 2855, 1065, 1065, 2855, 1065,
-     1065, 2855, 1065, 1065, 1065, 2855, 1065, 3292, 1065, 1065,
-
-     1065, 2855, 1065, 1065, 1065, 1065, 1065, 1065, 2855, 2855,
-     2855, 1065, 1065, 2855, 1065, 1065, 1065, 2855, 1065, 2855,
-     1065, 1065, 2855, 1065, 1065, 1065, 1065, 1065, 1065, 2855,
-     1065, 1065, 1065, 1065, 2855, 1065, 1065, 2855, 1065, 2855,
-     2855, 1065, 2855, 1065, 1065, 1065, 1065, 1065, 1065, 2855,
-     3293, 1065, 1065, 2855, 2855, 1065, 1065, 2855, 1065, 3294,
-     3295, 3295, 3296, 3297, 3298, 3296, 3296, 3299, 3300, 3301,
-     3302, 3302, 3303, 3304, 3305, 3296, 3295, 3299, 3300, 3301,
-     3295, 3296, 3296, 3299, 3300, 3301, 3299, 3296, 3306, 3307,
-     3308, 3303, 3302, 3309, 3310, 3311, 3312, 3313, 3313, 3314,
-
-     3315, 3316, 3314, 3314, 3317, 3318, 3319, 3320, 3320, 3321,
-     3322, 3323, 3314, 3313, 3317, 3318, 3319, 3313, 3314, 3314,
-     3317, 3318, 3319, 3317, 3314, 3324, 3325, 3326, 3321, 3320,
-     3327, 3328, 3329, 2855, 2855, 2855, 3330, 3330, 1338, 2855,
-     2855, 2855, 3330, 3331, 3332, 3333, 1338, 1338, 1338, 2855,
-     3334, 2855, 1338, 2855, 1350, 1343, 3331, 3332, 3334, 2855,
-     3334, 1338, 2855, 1338, 2855, 1338, 1338, 1338, 1338, 1338,
-     1338, 2855, 1338, 1338, 1338, 1338, 2855, 1338, 1338, 2855,
-     2855, 2855, 1343, 3331, 3332, 3335, 3336, 1338, 2855, 3336,
-     2855, 2855, 1343, 3331, 3332, 1338, 2855, 3337, 2855, 1338,
-
-     2855, 1343, 3331, 3332, 1338, 2855, 1338, 1338, 1338, 1338,
-     1338, 1338, 2855, 3338, 1338, 1338, 1338, 1338, 2855, 1338,
-     1338, 1338, 1338, 2855, 1338, 1338, 1338, 2855, 1338, 1338,
-     2855, 2855, 1338, 2855, 1338, 1338, 2855, 1338, 1338, 2855,
-     1338, 2855, 1338, 1338, 2855, 2855, 1343, 3331, 3332, 3339,
-     1338, 2855, 3339, 2855, 2855, 1343, 3331, 3332, 1338, 2855,
-     1338, 1338, 2855, 1338, 1338, 1338, 1338, 1338, 1338, 1338,
-     1338, 1338, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 1338, 1338, 2855, 1338, 1338, 1338,
-     2855, 1338, 1338, 2855, 1338, 1338, 2855, 1338, 1338, 1338,
-
-     1338, 1338, 1338, 1338, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 1338, 1338, 2855, 1338, 1338, 2855, 1338, 2855, 1338,
-     2855, 1338, 2855, 1338, 1338, 3340, 3340, 3340, 1338, 2855,
-     3341, 1338, 2855, 1338, 1338, 1338, 1338, 1338, 2855, 2855,
-     2855, 1338, 1338, 1338, 2855, 2855, 1338, 1338, 1338, 2855,
-     2855, 1338, 1338, 1338, 2855, 1338, 2855, 1338, 1338, 2855,
-     1338, 1338, 1338, 1338, 2855, 1338, 2855, 1338, 2855, 2855,
-     1338, 2855, 1338, 1338, 2855, 1338, 1350, 3334, 1338, 1338,
-     2855, 3342, 2855, 2855, 1581, 1343, 3331, 3332, 3342, 3342,
-     1338, 1338, 2855, 2855, 1338, 1338, 2855, 1338, 3343, 3343,
-
-     3344, 3345, 3346, 3344, 3344, 3347, 3348, 3349, 3350, 3350,
-     3351, 3352, 3353, 3344, 3344, 3347, 3348, 3349, 3347, 3347,
-     3354, 3355, 3356, 3351, 3351, 3357, 3358, 3359, 3360, 3360,
-     3361, 3362, 3363, 3361, 3361, 3364, 3365, 3366, 3367, 3367,
-     3368, 3369, 3370, 3361, 3361, 3364, 3365, 3366, 3364, 3364,
-     3371, 3372, 3373, 3368, 3368, 3374, 3375, 3376, 3377, 3378,
-     3378, 2855, 1661, 1661, 2855, 3379, 2855, 3379, 3379, 1661,
-     2855, 1661, 2855, 1661, 1661, 2855, 1661, 1661, 2855, 1661,
-     1661, 2855, 1661, 1661, 2855, 1661, 1661, 2855, 1661, 1661,
-     1661, 2855, 1661, 3380, 3380, 3380, 2855, 2855, 1661, 1661,
-
-     2855, 1661, 1661, 1661, 1661, 1661, 2855, 2855, 2855, 1661,
-     1661, 3378, 3381, 3382, 3383, 2855, 2855, 1661, 1661, 2855,
-     1661, 1661, 1661, 2855, 1661, 1661, 2855, 1661, 2855, 1661,
-     2855, 1661, 1661, 2855, 1661, 1661, 2855, 2855, 1661, 2855,
-     2855, 1661, 1661, 2855, 1661, 1661, 2855, 1661, 2855, 2855,
-     1661, 2855, 1661, 1661, 2855, 2855, 2855, 3384, 1661, 1712,
-     1756, 3385, 3386, 3387, 3387, 3387, 1661, 2855, 1661, 1661,
-     2855, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 1661, 2855, 1661, 1661, 2855, 1661, 2855, 1661,
-
-     2855, 1661, 2855, 1661, 1661, 1661, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 1661, 2855, 1661, 1661, 2855, 1661,
-     2855, 1661, 1661, 2855, 2855, 1661, 2855, 1661, 3388, 3388,
-     1661, 1661, 2855, 2855, 2855, 1661, 1712, 3381, 3382, 3389,
-     2855, 1661, 2855, 1661, 1661, 2855, 1661, 1661, 1661, 2855,
-     2855, 2855, 1661, 1661, 1661, 1661, 1661, 2855, 2855, 1661,
-     1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 1661, 2855, 1661, 2855,
-     1661, 1661, 1661, 2855, 2855, 1661, 2855, 1661, 1661, 2855,
-     1661, 1665, 3379, 3379, 1661, 2855, 1661, 2855, 3390, 3390,
-
-     3390, 1661, 2855, 2855, 1661, 2855, 1661, 1661, 1661, 1661,
-     1661, 2855, 2855, 2855, 1661, 1661, 3379, 1661, 2855, 1661,
-     2855, 2855, 1661, 2855, 1661, 1661, 2855, 1661, 1661, 2855,
-     1661, 1661, 2855, 1661, 1661, 2855, 1661, 1661, 1661, 2855,
-     1661, 2855, 1661, 1661, 2855, 1661, 1661, 1661, 2855, 2855,
-     1661, 1661, 2855, 1661, 1661, 2855, 1661, 2855, 1661, 2855,
-     2855, 1661, 1661, 1661, 2855, 2855, 1661, 2855, 1661, 1661,
-     1661, 2855, 1661, 1661, 2855, 1661, 1756, 3384, 2855, 2855,
-     1712, 3381, 3382, 3384, 3384, 1756, 1756, 1712, 1761, 1712,
-     1761, 1761, 1661, 1661, 2855, 1661, 1661, 1661, 1661, 1661,
-
-     1661, 2855, 2855, 3391, 2855, 2855, 2855, 3392, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 1898, 3390, 1661,
-     2855, 1661, 2855, 1661, 2855, 2855, 1661, 2855, 1661, 2855,
-     1661, 1661, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     1661, 2855, 1661, 1661, 2855, 1661, 1661, 2855, 2855, 1661,
-     2855, 1661, 2855, 1661, 3388, 3388, 3388, 1661, 1833, 3389,
-     1661, 3389, 2855, 1661, 2855, 1661, 1661, 2855, 1661, 1661,
-     2855, 2855, 1661, 1661, 1661, 1661, 2855, 2855, 1661, 1661,
-     1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 1661, 2855,
-
-     1661, 1661, 1661, 2855, 1661, 1661, 1661, 2855, 1661, 1661,
-     2855, 2855, 1661, 2855, 3390, 1661, 3379, 2855, 1661, 1661,
-     1661, 2855, 2855, 2855, 3393, 1661, 1661, 2855, 1661, 2855,
-     1661, 1922, 3394, 2855, 1922, 2855, 1712, 3381, 3382, 1661,
-     2855, 1661, 2855, 1661, 1661, 2855, 1661, 2855, 1661, 1661,
-     2855, 1661, 1661, 1661, 1661, 2855, 1661, 2855, 1661, 2855,
-     1661, 2855, 2855, 1661, 2855, 1661, 1661, 2855, 1661, 2855,
-     1661, 1661, 2855, 2855, 1661, 1661, 1661, 3384, 1661, 1661,
-     2855, 1661, 1661, 1661, 1661, 1661, 2855, 2855, 3391, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 1898, 3390, 1661, 3390,
-
-     2855, 1661, 2855, 1661, 1661, 1661, 1661, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 1661, 2855, 1661, 1661, 2855,
-     2855, 1661, 2855, 2855, 1661, 1661, 1833, 3389, 1661, 3389,
-     2855, 1661, 2855, 1661, 1661, 2855, 2855, 1661, 1661, 1661,
-     2855, 1661, 1661, 2855, 1661, 2855, 2855, 2855, 2855, 1661,
-     1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 1661, 2855,
-     1661, 1661, 1661, 1661, 1661, 2855, 2855, 1661, 3379, 3379,
-     2855, 1661, 1661, 2855, 3395, 3393, 1661, 2855, 1661, 2855,
-     3394, 1922, 3394, 1661, 2855, 1661, 2855, 1661, 2855, 1661,
-
-     1661, 2855, 1661, 1661, 1661, 1661, 2855, 1661, 1661, 2855,
-     2855, 1661, 2855, 2855, 1661, 2855, 1661, 1661, 2855, 1661,
-     2855, 1661, 1661, 2855, 2855, 1661, 1661, 1661, 2855, 1661,
-     1661, 1661, 1661, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 1661, 2855, 1661, 1661, 1661, 1661, 1661, 2855,
-     2855, 2855, 1661, 2855, 1661, 1661, 2855, 2855, 1661, 1661,
-     1661, 2855, 1661, 2855, 1661, 2855, 1661, 1661, 1661, 1661,
-     2855, 2855, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661,
-     1661, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     1661, 2855, 1661, 1661, 2855, 1661, 1661, 2855, 3396, 3395,
-
-     1661, 1661, 2855, 3394, 1661, 2855, 1661, 1661, 1661, 1661,
-     2855, 1661, 2855, 1661, 1661, 2855, 2855, 2855, 2855, 1661,
-     2855, 1661, 2855, 2855, 1661, 2855, 1661, 1661, 2855, 2855,
-     1661, 1661, 1661, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     1661, 2855, 1661, 1661, 1661, 1922, 3394, 2855, 1661, 1661,
-     2855, 2855, 1661, 1661, 1661, 2855, 1661, 2855, 2855, 1661,
-     1661, 1661, 1661, 2855, 2855, 1661, 1661, 1661, 1661, 1661,
-     1661, 1661, 1661, 1661, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 1661, 2855, 1661, 1661, 3390, 1661, 2855, 3396,
-     1661, 1661, 2855, 1661, 2855, 1661, 1661, 1661, 1661, 2855,
-
-     1661, 2855, 1661, 1661, 2855, 2855, 2855, 2855, 1661, 2855,
-     1661, 2855, 1661, 1661, 2855, 2855, 2855, 1661, 2855, 1661,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 1661, 1661, 1661,
-     3394, 2855, 1661, 1661, 2855, 2855, 2855, 1661, 1661, 1661,
-     2855, 1661, 1661, 2855, 1661, 1661, 1661, 1661, 1661, 1661,
-     1661, 1661, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     1661, 2855, 1661, 2855, 1661, 3390, 3390, 1661, 2855, 1661,
-     1661, 1661, 2855, 1661, 2855, 1661, 1661, 2855, 2855, 2855,
-     2855, 1661, 2855, 1661, 2855, 1661, 2855, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 1661, 1661, 1661, 2855,
-
-     1661, 2855, 1661, 1661, 1661, 2855, 1661, 2855, 1661, 1661,
-     1661, 1661, 1661, 1661, 1661, 1661, 1661, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 1661, 2855, 1661, 2855, 1661,
-     2855, 1661, 2855, 1661, 2855, 1661, 2855, 1661, 1661, 2855,
-     2855, 1661, 2855, 1661, 2855, 1661, 2855, 2855, 1661, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 1661, 2855, 1661,
-     2855, 1661, 2855, 2855, 1661, 2855, 2855, 1661, 1661, 1661,
-     2855, 2855, 1661, 2855, 1661, 1661, 1661, 1661, 1661, 1661,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 1661, 2855,
-     1661, 2855, 1661, 2855, 1661, 2855, 2855, 3397, 1661, 1661,
-
-     2855, 2855, 1661, 2855, 1661, 2855, 2855, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 1661, 2855, 1661, 2855, 1661,
-     2855, 2855, 1661, 2855, 2855, 1661, 1661, 2855, 2855, 1661,
-     1661, 1661, 1661, 1661, 1661, 2855, 2855, 2855, 2855, 2855,
-     2855, 1661, 2855, 1661, 2855, 1661, 2855, 1661, 2855, 1661,
-     2855, 2855, 1661, 2697, 3397, 2855, 2855, 2697, 1712, 3381,
-     3382, 3397, 3397, 1661, 1661, 2855, 2855, 1661, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 1661, 1661, 1661, 1661, 2855,
-     2855, 2855, 2855, 2855, 2855, 1661, 2855, 1661, 2855, 2855,
-     2697, 3397, 3397, 1661, 1661, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 1661, 1661, 1661, 2855, 2855, 2855, 1661, 2855, 1661,
-     2855, 2855, 2855, 1661, 1661, 1661, 2855, 2855, 1661, 2855,
-     1661, 2855, 2855, 2855, 1661, 1661, 1661, 2855, 2855, 1661,
-     2855, 2855, 2855, 1661, 1661, 2855, 2855, 1661, 2855, 2855,
-     2855, 2855, 1661, 2855, 2855, 1661, 2855, 2855, 1661, 2855,
-     2855, 1661, 2855, 2855,    0, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855
+      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
+      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
+      183,  183,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  185,  185,  185,  185,  185,  185,  186,  186,  186,
+      187,  169,  169,  188,  188,  181,  188,  182,  189,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
 
-    } ;
+      188,  188,  188,  188,  188,  188,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  190,  190,  190,  190,  190,
+      190,  191,  191,  191,  192,  169,  169,  193,  193,  194,
+      193,  195,  196,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      197,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
+
+      198,  198,  198,  198,  198,  198,  198,  198,  198,  199,
+      199,  199,  199,  199,  199,  200,  200,  200,  201,  198,
+      198,  202,  202,  181,  202,  182,  203,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  204,  204,  204,  204,  204,  204,  205,
 
-static yyconst flex_int16_t yy_nxt[26526] =
-    {   0,
-     2855,  123,  124,  709,  125,  126,  127,  709,  127,  128,
-      129,  130,  128,  131,  132,  127,  128,  127,  128,  128,
-      128,  128,  128,  128,  128,  128,  128,  128,  128,  128,
-      128,  122,  128,  128,  128,  133,  134,  135,  136,  137,
-      138,  128,  139,  140,  128,  141,  142,  143,  144,  145,
-      146,  147,  148,  149,  150,  151,  152,  128,  128,  153,
-      128,  128,  122,  122,  122,  122,  122,  122,  122,  122,
-      122,  122,  122,  122,  122,  122,  122,  122,  122,  122,
-      122,  154,  154,  154,  154,  154,  154,  155,  155,  155,
-      156,  122,  122,  157,  157,  158,  157,  159,  160,  161,
-
-      162,  161,  157,  163,  157,  157,  157,  157,  157,  157,
-      164,  157,  157,  165,  157,  157,  157,  157,  157,  157,
-      157,  157,  157,  157,  157,  157,  157,  157,  157,  157,
-      157,  157,  157,  157,  157,  157,  157,  157,  157,  157,
-      157,  157,  157,  157,  166,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  168,  168,  168,  168,  168,
-      168,  169,  169,  169,  170,  167,  167,  171,  167,  172,
-      171,  173,  174,  171,  171,  171,  171,  171,  171,  167,
-      171,  171,  171,  171,  171,  171,  171,  175,  171,  171,
-
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      175,  175,  175,  175,  175,  175,  175,  175,  175,  175,
-      175,  175,  175,  175,  175,  175,  175,  175,  175,  176,
-      176,  176,  176,  176,  176,  177,  177,  177,  178,  175,
-      175,  179,  502,  180,  174,  179,  503,  180,  174,  181,
-      181,  179,  181,  180,  182,  181,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-      181,  181,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  183,  183,  183,  183,  183,  183,  184,  184,  184,
-      185,  167,  167,  186,  186,  179,  186,  180,  187,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-
-      186,  186,  186,  186,  186,  186,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  188,  188,  188,  188,  188,
-      188,  189,  189,  189,  190,  167,  167,  191,  191,  192,
-      191,  193,  194,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      195,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      196,  196,  196,  196,  196,  196,  196,  196,  196,  196,
-
-      196,  196,  196,  196,  196,  196,  196,  196,  196,  197,
-      197,  197,  197,  197,  197,  198,  198,  198,  199,  196,
-      196,  200,  200,  179,  200,  180,  201,  200,  200,  200,
-      200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-      200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-      200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-      200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-      200,  200,  200,  200,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  202,  202,  202,  202,  202,  202,  203,
-
-      203,  203,  204,  167,  167,  205,  205,  179,  205,  180,
-      206,  205,  205,  205,  205,  205,  205,  205,  205,  205,
-      205,  205,  205,  205,  205,  205,  205,  205,  205,  205,
-      205,  205,  205,  205,  205,  205,  205,  205,  205,  205,
-      205,  205,  205,  205,  205,  205,  205,  205,  205,  205,
-      205,  205,  205,  205,  205,  205,  205,  205,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  207,  207,  207,
-      207,  207,  207,  208,  208,  208,  209,  167,  167,  210,
-      210,  179,  210,  180,  211,  210,  210,  210,  210,  210,
-
-      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
-      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
-      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
-      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
-      210,  210,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  212,  212,  212,  212,  212,  212,  213,  213,  213,
-      214,  167,  167,  215,  215,  179,  215,  180,  216,  215,
-      215,  215,  215,  215,  215,  215,  215,  215,  215,  215,
-      215,  215,  215,  215,  215,  215,  215,  215,  215,  215,
-
-      215,  215,  215,  215,  215,  215,  215,  215,  215,  215,
-      215,  215,  215,  215,  215,  215,  215,  215,  215,  215,
-      215,  215,  215,  215,  215,  215,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  217,  217,  217,  217,  217,
-      217,  218,  218,  218,  219,  167,  167,  220,  220,  179,
-      220,  180,  221,  220,  220,  220,  220,  220,  220,  220,
-      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
-      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
-      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
-
-      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  222,
-      222,  222,  222,  222,  222,  223,  223,  223,  224,  167,
-      167,  225,  225,  179,  225,  180,  226,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      225,  225,  225,  225,  167,  167,  167,  167,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  227,  227,  227,  227,  227,  227,  228,
-      228,  228,  229,  167,  167,  230,  230,  179,  230,  180,
-      231,  230,  230,  230,  230,  230,  230,  230,  230,  230,
-      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
-      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
-      230,  230,  230,  230,  230,  230,  230,  230,  230,  230,
-      230,  230,  230,  230,  230,  230,  230,  230,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  232,  232,  232,
-
-      232,  232,  232,  233,  233,  233,  234,  167,  167,  235,
-      235,  179,  235,  180,  236,  235,  235,  235,  235,  235,
-      235,  235,  235,  235,  235,  235,  235,  235,  235,  235,
-      235,  235,  235,  235,  235,  235,  235,  235,  235,  235,
-      235,  235,  235,  235,  235,  235,  235,  235,  235,  235,
-      235,  235,  235,  235,  235,  235,  235,  235,  235,  235,
-      235,  235,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  237,  237,  237,  237,  237,  237,  238,  238,  238,
-      239,  167,  167,  240,  240,  179,  240,  180,  241,  240,
-
-      240,  240,  240,  240,  240,  240,  240,  240,  240,  240,
-      240,  240,  240,  240,  240,  240,  240,  240,  240,  240,
-      240,  240,  240,  240,  240,  240,  240,  240,  240,  240,
-      240,  240,  240,  240,  240,  240,  240,  240,  240,  240,
-      240,  240,  240,  240,  240,  240,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  242,  242,  242,  242,  242,
-      242,  243,  243,  243,  244,  167,  167,  245,  245,  179,
-      245,  180,  246,  245,  245,  245,  245,  245,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
-
-      245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  247,
-      247,  247,  247,  247,  247,  248,  248,  248,  249,  167,
-      167,  250,  250,  179,  250,  180,  251,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  252,  252,  252,  252,  252,  252,  253,
-      253,  253,  254,  167,  167,  256,  504,  257,  174,  256,
-      505,  257,  174,  179,  502,  259,  174,  179,  503,  259,
-      174,  260,  260,  179,  260,  180,  261,  260,  260,  260,
-      260,  260,  260,  260,  260,  260,  260,  260,  260,  260,
-      260,  260,  260,  260,  260,  260,  260,  260,  260,  260,
-      260,  260,  260,  260,  260,  260,  260,  260,  260,  260,
-
-      260,  260,  260,  260,  260,  260,  260,  260,  260,  260,
-      260,  260,  260,  260,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  262,  262,  262,  262,  262,  262,  263,
-      263,  263,  264,  167,  167,  265,  265,  179,  265,  180,
-      266,  265,  265,  265,  265,  265,  265,  265,  265,  265,
-      265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
-      265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
-      265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
-      265,  265,  265,  265,  265,  265,  265,  265,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  267,  267,  267,
-      267,  267,  267,  268,  268,  268,  269,  167,  167,  270,
-      270,  179,  270,  180,  271,  270,  270,  270,  270,  270,
-      270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
-      270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
-      270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
-      270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
-      270,  270,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-
-      167,  272,  272,  272,  272,  272,  272,  273,  273,  273,
-      274,  167,  167,  275,  275,  179,  275,  180,  276,  275,
-      275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
-      275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
-      275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
-      275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
-      275,  275,  275,  275,  275,  275,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  277,  277,  277,  277,  277,
-      277,  278,  278,  278,  279,  167,  167,  179,  718,  281,
-
-      282,  179,  504,  281,  282,  284,  505,  285,  286,  284,
-      287,  285,  286,  289,  287,  290,  291,  289,  473,  290,
-      291,  179,  474,  180,  174,  179,  718,  180,  174,  485,
-      315,  313,  316,  317,  315,  313,  316,  317,  486, 2855,
-      534,  167,  535,  167,  906,  167,  179,  167,  180,  174,
-      179,  907,  180,  174,  496,  167,  359,  318,  360,  174,
-      497,  318,  179,  292,  180,  174, 2855,  292,  293,  293,
-      179,  293,  180,  294,  293,  293,  293,  293,  293,  293,
-      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-
-      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-      293,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      295,  295,  295,  295,  295,  295,  296,  296,  296,  297,
-      167,  167,  298,  298,  179,  298,  180,  299,  298,  298,
-      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-
-      298,  298,  298,  298,  298,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  300,  300,  300,  300,  300,  300,
-      301,  301,  301,  302,  167,  167,  303,  303,  179,  303,
-      180,  304,  303,  303,  303,  303,  303,  303,  303,  303,
-      303,  303,  303,  303,  303,  303,  303,  303,  303,  303,
-      303,  303,  303,  303,  303,  303,  303,  303,  303,  303,
-      303,  303,  303,  303,  303,  303,  303,  303,  303,  303,
-      303,  303,  303,  303,  303,  303,  303,  303,  303,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  167,  167,  305,  305,
-      305,  305,  305,  305,  306,  306,  306,  307,  167,  167,
-      308,  308,  179,  308,  180,  309,  308,  308,  308,  308,
-      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
-      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
-      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
-      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
-      308,  308,  308,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  310,  310,  310,  310,  310,  310,  311,  311,
-
-      311,  312,  167,  167,  319,  319,  179,  319,  320,  321,
-      319,  322,  319,  319,  323,  324,  319,  319,  319,  319,
-      319,  325,  324,  324,  326,  319,  324,  319,  324,  319,
-      324,  324,  324,  324,  324,  324,  324,  324,  324,  324,
-      324,  324,  324,  324,  324,  324,  324,  324,  324,  324,
-      324,  324,  324,  324,  324,  327,  319,  319,  319,  319,
-      319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
-      319,  319,  319,  319,  319,  319,  328,  329,  330,  331,
-      332,  333,  334,  335,  336,  337,  319,  319,  338,  338,
-      179,  338,  180,  339,  338,  338,  338,  338,  338,  338,
-
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      340,  340,  340,  340,  340,  340,  341,  341,  341,  342,
-      167,  167,  343,  343,  179,  343,  180,  344,  343,  343,
-      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
-      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
-
-      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
-      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
-      343,  343,  343,  343,  343,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  345,  345,  345,  345,  345,  345,
-      346,  346,  346,  347,  167,  167,  348,  348,  179,  348,
-      180,  349,  348,  348,  348,  348,  348,  348,  348,  348,
-      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
-      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
-      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
-
-      348,  348,  348,  348,  348,  348,  348,  348,  348,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  350,  350,
-      350,  350,  350,  350,  351,  351,  351,  352,  167,  167,
-      353,  353,  179,  353,  180,  354,  353,  353,  353,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  167,  167,  167,  167,  167,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  355,  355,  355,  355,  355,  355,  356,  356,
-      356,  357,  167,  167,  167,  359, 1079,  360,  174,  362,
-      363,  485,  364,  365,  362,  363,  443,  364,  365,  179,
-      486,  180,  174,  167,  372, 1107,  373,  174,  496,  167,
-      372,  362,  373,  174,  497,  443,  362,  366,  366,  179,
-      366,  180,  367,  366,  366,  366,  366,  366,  366,  366,
-      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
-      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
-      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
-
-      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  368,
-      368,  368,  368,  368,  368,  369,  369,  369,  370,  167,
-      167,  179,  718,  180,  174,  179,  575,  180,  174,  167,
-      381,  575,  382,  174,  167,  381,  475,  382,  174,  476,
-      860,  861,  477,  478,  479,  481,  482,  585,  483,  855,
-      374,  484,  587,  856,  374,  375,  375,  179,  375,  180,
-      376,  375,  375,  375,  375,  375,  375,  375,  375,  375,
-      375,  375,  375,  375,  375,  375,  375,  375,  375,  375,
-
-      375,  375,  375,  375,  375,  375,  375,  375,  375,  375,
-      375,  375,  375,  375,  375,  375,  375,  375,  375,  375,
-      375,  375,  375,  375,  375,  375,  375,  375,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  377,  377,  377,
-      377,  377,  377,  378,  378,  378,  379,  167,  167,  179,
-      718,  180,  174,  179,  487,  180,  174,  537,  179,  445,
-      180,  174,  488,  445,  498,  878,  867,  489,  499,  868,
-      538,  539,  500,  540,  490,  912,  494,  501,  383,  406,
-      446,  913,  383,  384,  384,  179,  384,  180,  385,  384,
-
-      384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  384,  384,  384,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  386,  386,  386,  386,  386,
-      386,  387,  387,  387,  388,  167,  167,  389,  389,  179,
-      389,  180,  390,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  391,
-      391,  391,  391,  391,  391,  392,  392,  392,  393,  167,
-      167,  394,  394,  179,  394,  180,  395,  394,  394,  394,
-      394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
-      394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
-      394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
-
-      394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
-      394,  394,  394,  394,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  396,  396,  396,  396,  396,  396,  397,
-      397,  397,  398,  167,  167,  399,  399,  400,  399,  401,
-      402,  399,  399,  399,  399,  399,  399,  399,  399,  399,
-      399,  399,  399,  399,  399,  399,  399,  399,  399,  399,
-      399,  399,  399,  399,  399,  399,  399,  399,  399,  399,
-      399,  399,  399,  399,  399,  399,  399,  399,  399,  399,
-      399,  399,  399,  399,  399,  399,  399,  399,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  403,  403,  403,
-      403,  403,  403,  404,  404,  404,  405,  167,  167,  179,
-      492,  180,  174,  706,  507,  885,  493,  508,  509,  886,
-      510,  707,  848,  708, 2854,  508,  509,  494,  510,  495,
-      406,  407,  407,  179,  407,  180,  408,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-
-      407,  407,  407,  407,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  409,  409,  409,  409,  409,  409,  410,
-      410,  410,  411,  167,  167,  412,  412,  179,  412,  180,
-      413,  412,  412,  412,  412,  412,  412,  412,  412,  412,
-      412,  412,  412,  412,  412,  412,  412,  412,  412,  412,
-      412,  412,  412,  412,  412,  412,  412,  412,  412,  412,
-      412,  412,  412,  412,  412,  412,  412,  412,  412,  412,
-      412,  412,  412,  412,  412,  412,  412,  412,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  167,  414,  414,  414,
-      414,  414,  414,  415,  415,  415,  416,  167,  167,  417,
-      417,  179,  417,  180,  418,  417,  417,  417,  417,  417,
-      417,  417,  417,  417,  417,  417,  417,  417,  417,  417,
-      417,  417,  417,  417,  417,  417,  417,  417,  417,  417,
-      417,  417,  417,  417,  417,  417,  417,  417,  417,  417,
-      417,  417,  417,  417,  417,  417,  417,  417,  417,  417,
-      417,  417,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  419,  419,  419,  419,  419,  419,  420,  420,  420,
-
-      421,  167,  167,  422,  422,  179,  422,  180,  423,  422,
-      422,  422,  422,  422,  422,  422,  422,  422,  422,  422,
-      422,  422,  422,  422,  422,  422,  422,  422,  422,  422,
-      422,  422,  422,  422,  422,  422,  422,  422,  422,  422,
-      422,  422,  422,  422,  422,  422,  422,  422,  422,  422,
-      422,  422,  422,  422,  422,  422,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  424,  424,  424,  424,  424,
-      424,  425,  425,  425,  426,  167,  167,  427,  427,  179,
-      427,  180,  428,  427,  427,  427,  427,  427,  427,  427,
-
-      427,  427,  427,  427,  427,  427,  427,  427,  427,  427,
-      427,  427,  427,  427,  427,  427,  427,  427,  427,  427,
-      427,  427,  427,  427,  427,  427,  427,  427,  427,  427,
-      427,  427,  427,  427,  427,  427,  427,  427,  427,  427,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  429,
-      429,  429,  429,  429,  429,  430,  430,  430,  431,  167,
-      167,  432,  432,  179,  432,  180,  433,  432,  432,  432,
-      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
-      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
-
-      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
-      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
-      432,  432,  432,  432,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  434,  434,  434,  434,  434,  434,  435,
-      435,  435,  436,  167,  167,  437,  437,  179,  437,  180,
-      438,  437,  437,  437,  437,  437,  437,  437,  437,  437,
-      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,
-      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,
-      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,
-
-      437,  437,  437,  437,  437,  437,  437,  437,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  167,  167,  167,  439,  439,  439,
-      439,  439,  439,  440,  440,  440,  441,  167,  167,  444,
-      512,  706,  940,  445,  513,  718,  849,  941,  516,  707,
-      513,  708,  517,  514,  515,  518,  519,  718,  492,  514,
-      446,  520,  521,  718,  493,  522,  523,  524,  526,  527,
-      706,  525,  528,  924,  529,  494,  530,  495,  707,  925,
-      708,  531,  534,  532,  535,  533,  545,  545,  545,  545,
-      545,  545,  546,  546,  546,  547,  563,  563,  563,  563,
-
-      563,  563,  564,  564,  564,  565,  851, 2855,  852, 2853,
-      447,  447,  447,  447,  447,  447,  448,  448,  448,  449,
-      443,  450,  443,  443,  443,  451,  718,  443, 2855,  443,
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443,  446,  443,  443,  443,  452,  453,  454,  455,
-      456,  457,  443,  458,  459,  443,  460,  461,  462,  463,
-      464,  465,  466,  467,  468,  469,  470,  471,  443,  443,
-      472,  443,  443,  563,  563,  563,  563,  563,  563,  564,
-      564,  564,  565,  475,  473,  576,  476,  942,  474,  477,
-      478,  479,  447,  447,  447,  447,  447,  447,  448,  448,
-
-      448,  449,  444,  943,  537, 2855,  445,  569,  569,  569,
-      569,  569,  569,  570,  570,  570,  571,  538,  539,  882,
-      540,  883, 2851,  446,  569,  569,  569,  569,  569,  569,
-      570,  570,  570,  571,  581,  581,  581,  581,  581,  581,
-      582,  582,  582,  583,  589,  589,  589,  589,  589,  589,
-      590,  590,  590,  591,  589,  589,  589,  589,  589,  589,
-      590,  590,  590,  591,  481,  482,  922,  483,  926,  923,
-      484,  718,  895,  447,  447,  447,  447,  447,  447,  448,
-      448,  448,  449, 2855,  896,  443,  927,  443, 1228,  443,
-      595,  595,  595,  595,  595,  595,  596,  596,  596,  597,
-
-      595,  595,  595,  595,  595,  595,  596,  596,  596,  597,
-      601,  601,  601,  601,  601,  601,  602,  602,  602,  603,
-      601,  601,  601,  601,  601,  601,  602,  602,  602,  603,
-      968, 2850,  969, 2855,  443,  443,  443,  443,  443,  443,
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443,  443,  607,  607,  607,  607,  607,  607,  608,
-      608,  608,  609,  443,  443,  552,  553,  554,  552,  552,
-      553,  552,  552,  552,  552,  552,  552,  555,  552,  552,
-      552,  552,  552,  552,  552,  556,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
+      205,  205,  206,  169,  169,  207,  207,  181,  207,  182,
+      208,  207,  207,  207,  207,  207,  207,  207,  207,  207,
+      207,  207,  207,  207,  207,  207,  207,  207,  207,  207,
+      207,  207,  207,  207,  207,  207,  207,  207,  207,  207,
+      207,  207,  207,  207,  207,  207,  207,  207,  207,  207,
+      207,  207,  207,  207,  207,  207,  207,  207,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  209,  209,  209,
+      209,  209,  209,  210,  210,  210,  211,  169,  169,  212,
+      212,  181,  212,  182,  213,  212,  212,  212,  212,  212,
 
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  557,  557,  557,
-      557,  557,  557,  558,  558,  558,  559,  554,  554,  555,
-      607,  607,  607,  607,  607,  607,  608,  608,  608,  609,
-      613,  613,  613,  613,  613,  613,  614,  614,  614,  615,
-      613,  613,  613,  613,  613,  613,  614,  614,  614,  615,
-      619,  619,  619,  619,  619,  619,  620,  620,  620,  621,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
+      212,  212,  212,  212,  212,  212,  212,  212,  212,  212,
+      212,  212,  212,  212,  212,  212,  212,  212,  212,  212,
+      212,  212,  212,  212,  212,  212,  212,  212,  212,  212,
+      212,  212,  212,  212,  212,  212,  212,  212,  212,  212,
+      212,  212,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  214,  214,  214,  214,  214,  214,  215,  215,  215,
+      216,  169,  169,  217,  217,  181,  217,  182,  218,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
 
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  560,
-      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
-      560,  560,  560,  560,  560,  560,  560,  560,  561,  561,
-      561,  561,  561,  561,  561,  561,  561,  561,  561,  561,
-      561,  561,  561,  561,  561,  561,  561,  562,  619,  619,
-      619,  619,  619,  619,  620,  620,  620,  621,  625,  625,
-      625,  625,  625,  625,  626,  626,  626,  627,  625,  625,
-      625,  625,  625,  625,  626,  626,  626,  627,  631,  631,
-      631,  631,  631,  631,  632,  632,  632,  633,  933,  955,
-      443,  709,  934, 1547,  956,  709,  562,  562,  562,  562,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  219,  219,  219,  219,  219,
+      219,  220,  220,  220,  221,  169,  169,  222,  222,  181,
+      222,  182,  223,  222,  222,  222,  222,  222,  222,  222,
+      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
+      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
+      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
 
-      562,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      562,  562,  562,  562,  562,  631,  631,  631,  631,  631,
-      631,  632,  632,  632,  633,  562,  562,  568,  637,  637,
-      637,  637,  637,  637,  638,  638,  638,  639,  637,  637,
-      637,  637,  637,  637,  638,  638,  638,  639,  643,  643,
-      643,  643,  643,  643,  644,  644,  644,  645,  643,  643,
-      643,  643,  643,  643,  644,  644,  644,  645,  946, 1065,
-     1066, 2848,  443,  443, 2847,  947,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  649,  649,  649,  649,  649,
-
-      649,  650,  650,  650,  651,  568,  568,  574,  574,  575,
-      574,  575,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      576,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      575,  575,  575,  575,  575,  575,  575,  575,  575,  575,
-      575,  575,  575,  575,  575,  575,  575,  575,  575,  577,
-      577,  577,  577,  577,  577,  578,  578,  578,  579,  575,
-      575,  574,  649,  649,  649,  649,  649,  649,  650,  650,
-
-      650,  651,  892,  897,  972,  443,  893,  898,  973, 1093,
-      580,  657,  657,  657,  657,  657,  657,  658,  658,  658,
-      659,  657,  657,  657,  657,  657,  657,  658,  658,  658,
-      659, 1070,  899,  443, 1156, 1078,  443,  974,  894,  443,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  588,  663,  663,  663,  663,  663,  663,  664,  664,
-      664,  665,  663,  663,  663,  663,  663,  663,  664,  664,
-      664,  665,  669,  669,  669,  669,  669,  669,  670,  670,
-
-      670,  671,  669,  669,  669,  669,  669,  669,  670,  670,
-      670,  671,  443,  443,  443,  443, 1089,  968, 1077, 1080,
-      588,  588,  588,  588,  588,  588,  588,  588,  588,  588,
-      588,  588,  588,  588,  588,  588,  588,  588,  588,  675,
-      675,  675,  675,  675,  675,  676,  676,  676,  677,  588,
-      588,  594,  675,  675,  675,  675,  675,  675,  676,  676,
-      676,  677,  682,  682,  682,  682,  682,  682,  683,  683,
-      683,  684,  682,  682,  682,  682,  682,  682,  683,  683,
-      683,  684,  688,  688,  688,  688,  688,  688,  689,  689,
-      689,  690, 1090,  443, 1091,  443,  443, 1092,  443, 1100,
+      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  224,
+      224,  224,  224,  224,  224,  225,  225,  225,  226,  169,
+      169,  227,  227,  181,  227,  182,  228,  227,  227,  227,
+      227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
+      227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
+      227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
+      227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
+      227,  227,  227,  227,  169,  169,  169,  169,  169,  169,
 
-      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
-      594,  594,  594,  594,  594,  594,  594,  594,  594,  688,
-      688,  688,  688,  688,  688,  689,  689,  689,  690,  594,
-      594,  600,  694,  694,  694,  694,  694,  694,  695,  695,
-      695,  696,  694,  694,  694,  694,  694,  694,  695,  695,
-      695,  696,  700,  700,  700,  700,  700,  700,  701,  701,
-      701,  702,  700,  700,  700,  700,  700,  700,  701,  701,
-      701,  702,  443,  443, 1204,  443, 1431, 1431,  857, 1106,
-      600,  600,  600,  600,  600,  600,  600,  600,  600,  600,
-      600,  600,  600,  600,  600,  600,  600,  600,  600,  711,
-
-      711,  711,  711,  711,  711,  712,  712,  712,  713,  600,
-      600,  606,  715,  715,  715,  715,  715,  715,  716,  716,
-      716,  717,  719,  720,  721,  722,  723,  724,  725,  726,
-      727,  728,  731,  731,  731,  731,  731,  731,  732,  732,
-      732,  733,  746,  746,  746,  746,  746,  746,  747,  747,
-      747,  748,  443,  443, 1364,  443,  443, 1407,  857, 1164,
-      606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
-      606,  606,  606,  606,  606,  606,  606,  606,  606,  746,
-      746,  746,  746,  746,  746,  747,  747,  747,  748,  606,
-      606,  612,  752,  752,  752,  752,  752,  752,  753,  753,
-
-      753,  754,  752,  752,  752,  752,  752,  752,  753,  753,
-      753,  754,  758,  758,  758,  758,  758,  758,  759,  759,
-      759,  760,  758,  758,  758,  758,  758,  758,  759,  759,
-      759,  760,  443,  443, 1422, 1439,  443,  443, 1226, 1227,
-      612,  612,  612,  612,  612,  612,  612,  612,  612,  612,
-      612,  612,  612,  612,  612,  612,  612,  612,  612,  764,
-      764,  764,  764,  764,  764,  765,  765,  765,  766,  612,
-      612,  618,  764,  764,  764,  764,  764,  764,  765,  765,
-      765,  766,  772,  772,  772,  772,  772,  772,  773,  773,
-      773,  774,  772,  772,  772,  772,  772,  772,  773,  773,
-
-      773,  774,  780,  780,  780,  780,  780,  780,  781,  781,
-      781,  782,  443,  443,  443, 1569, 1569, 1233, 1247, 1248,
-      618,  618,  618,  618,  618,  618,  618,  618,  618,  618,
-      618,  618,  618,  618,  618,  618,  618,  618,  618,  780,
-      780,  780,  780,  780,  780,  781,  781,  781,  782,  618,
-      618,  624,  788,  788,  788,  788,  788,  788,  789,  789,
-      789,  790,  788,  788,  788,  788,  788,  788,  789,  789,
-      789,  790,  794,  794,  794,  794,  794,  794,  795,  795,
-      795,  796,  794,  794,  794,  794,  794,  794,  795,  795,
-      795,  796, 1335, 1336, 1408, 2845, 1335, 1336, 2844,  443,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  229,  229,  229,  229,  229,  229,  230,
+      230,  230,  231,  169,  169,  232,  232,  181,  232,  182,
+      233,  232,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  232,  232,  232,  232,  232,  232,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  234,  234,  234,
 
-      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
-      624,  624,  624,  624,  624,  624,  624,  624,  624,  800,
-      800,  800,  800,  800,  800,  801,  801,  801,  802,  624,
-      624,  630,  800,  800,  800,  800,  800,  800,  801,  801,
-      801,  802,  810,  810,  810,  810,  810,  810,  811,  811,
-      811,  812,  810,  810,  810,  810,  810,  810,  811,  811,
-      811,  812,  816,  816,  816,  816,  816,  816,  817,  817,
-      817,  818, 1410, 1411, 1459, 1493,  443,  443,  443,  443,
-      630,  630,  630,  630,  630,  630,  630,  630,  630,  630,
-      630,  630,  630,  630,  630,  630,  630,  630,  630,  816,
-
-      816,  816,  816,  816,  816,  817,  817,  817,  818,  630,
-      630,  636,  822,  822,  822,  822,  822,  822,  823,  823,
-      823,  824,  822,  822,  822,  822,  822,  822,  823,  823,
-      823,  824,  831,  831,  831,  831,  831,  831,  832,  832,
-      832,  833,  831,  831,  831,  831,  831,  831,  832,  832,
-      832,  833,  443, 1501,  443,  443, 2842,  718, 1421, 1412,
-      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
-      636,  636,  636,  636,  636,  636,  636,  636,  636,  837,
-      837,  837,  837,  837,  837,  838,  838,  838,  839,  636,
-      636,  642,  837,  837,  837,  837,  837,  837,  838,  838,
-
-      838,  839,  843,  843,  843,  843,  843,  843,  844,  844,
-      844,  845,  843,  843,  843,  843,  843,  843,  844,  844,
-      844,  845,  498,  908,  937, 2855,  499,  909,  938, 1101,
-      500, 2841,  863,  443, 2839,  501,  864,  443, 1438,  888,
-      642,  642,  642,  642,  642,  642,  642,  642,  642,  642,
-      642,  642,  642,  642,  642,  642,  642,  642,  642,  487,
-      889,  575,  865,  575,  975,  910,  939,  488,  976,  642,
-      642,  648,  489,  516,  901,  866, 2837,  517,  902,  490,
-      518,  519,  585, 1198,  587,  553,  520,  521,  718,  553,
-      522,  523,  524,  526,  527,  872,  525,  528,  928,  529,
-
-      443,  530,  929,  873,  982,  977,  531,  903,  532,  874,
-      533, 2836,  904,  875,  876,  914,  443, 1338,  905,  915,
-      648,  648,  648,  648,  648,  648,  648,  648,  648,  648,
-      648,  648,  648,  648,  648,  648,  648,  648,  648,  930,
-      916,  949,  931,  443, 1216,  950,  917,  706,  706,  648,
-      648,  656,  575, 2855,  443,  707,  707,  708,  708, 1076,
-      918,  563,  563,  563,  563,  563,  563,  564,  564,  564,
-      565,  443, 1109,  987, 2833, 1163,  864,  575,  951, 1099,
-      864,  443,  952,  576,  443,  953,  569,  569,  569,  569,
-      569,  569,  570,  570,  570,  571,  576,  446,  580, 2832,
+      234,  234,  234,  235,  235,  235,  236,  169,  169,  237,
+      237,  181,  237,  182,  238,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  239,  239,  239,  239,  239,  239,  240,  240,  240,
+      241,  169,  169,  242,  242,  181,  242,  182,  243,  242,
 
-      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
-      656,  656,  656,  656,  656,  656,  656,  656,  656,  589,
-      589,  589,  589,  589,  589,  590,  590,  590,  591,  656,
-      656,  662,  581,  581,  581,  581,  581,  581,  582,  582,
-      582,  583, 1241, 2111, 2111,  581,  581,  581,  581,  581,
-      581,  582,  582,  582,  583,  595,  595,  595,  595,  595,
-      595,  596,  596,  596,  597,  601,  601,  601,  601,  601,
-      601,  602,  602,  602,  603,  443, 1503, 1504,  443,  443,
-      662,  662,  662,  662,  662,  662,  662,  662,  662,  662,
-      662,  662,  662,  662,  662,  662,  662,  662,  662,  607,
-
-      607,  607,  607,  607,  607,  608,  608,  608,  609,  662,
-      662,  668,  613,  613,  613,  613,  613,  613,  614,  614,
-      614,  615,  619,  619,  619,  619,  619,  619,  620,  620,
-      620,  621,  625,  625,  625,  625,  625,  625,  626,  626,
-      626,  627,  631,  631,  631,  631,  631,  631,  632,  632,
-      632,  633,  443, 1477,  443, 2717, 2717, 1478, 1426, 1464,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  637,
-      637,  637,  637,  637,  637,  638,  638,  638,  639,  668,
-      668,  674,  643,  643,  643,  643,  643,  643,  644,  644,
-
-      644,  645,  649,  649,  649,  649,  649,  649,  650,  650,
-      650,  651,  657,  657,  657,  657,  657,  657,  658,  658,
-      658,  659,  663,  663,  663,  663,  663,  663,  664,  664,
-      664,  665,  443,  443, 1525, 1537,  443,  443, 1500, 1467,
-      674,  674,  674,  674,  674,  674,  674,  674,  674,  674,
-      674,  674,  674,  674,  674,  674,  674,  674,  674,  669,
-      669,  669,  669,  669,  669,  670,  670,  670,  671,  674,
-      674,  681,  675,  675,  675,  675,  675,  675,  676,  676,
-      676,  677,  682,  682,  682,  682,  682,  682,  683,  683,
-      683,  684,  688,  688,  688,  688,  688,  688,  689,  689,
-
-      689,  690,  694,  694,  694,  694,  694,  694,  695,  695,
-      695,  696, 1007,  718, 1543, 1546,  443, 2719, 2719, 1546,
-      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,
-      681,  681,  681,  681,  681,  681,  681,  681,  681,  700,
-      700,  700,  700,  700,  700,  701,  701,  701,  702,  681,
-      681,  687,  719,  720,  721,  722,  723,  724,  725,  726,
-      727,  728,  710, 1105, 1108, 2855, 2855, 1009, 1194,  909,
-      938,  443,  443,  909,  938, 2831,  443,  711,  711,  711,
-      711,  711,  711,  712,  712,  712,  713,  710, 1205, 1468,
-      446,  446, 1014, 1469, 2829,  443,  443, 1161,  730, 1026,
-
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  731,
-      731,  731,  731,  731,  731,  732,  732,  732,  733,  687,
-      687,  693, 1010, 1010, 1010, 1010, 1010, 1010, 1011, 1011,
-     1011, 1012,  710, 1221, 1231,  443,  443, 1019, 1028, 1199,
-     2721, 2721,  730,  443, 1200, 1246,  443, 1015, 1015, 1015,
-     1015, 1015, 1015, 1016, 1016, 1016, 1017,  443, 1029, 1029,
-     1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031,  718, 1499,
-      693,  693,  693,  693,  693,  693,  693,  693,  693,  693,
-      693,  693,  693,  693,  693,  693,  693,  693,  693, 1067,
-
-      849,  863, 1033, 1068, 1082,  864,  443, 2828, 1083,  693,
-      693,  699, 1020, 1020, 1020, 1020, 1020, 1020, 1021, 1021,
-     1021, 1022, 1034, 1034, 1034, 1034, 1034, 1034, 1035, 1035,
-     1035, 1036,  730, 1084,  718,  443,  443, 1069,  443, 1335,
-     1787,  443, 2855, 1335, 2855, 2855, 1374, 2855,  746,  746,
-      746,  746,  746,  746,  747,  747,  747,  748, 1788, 2824,
-      699,  699,  699,  699,  699,  699,  699,  699,  699,  699,
-      699,  699,  699,  699,  699,  699,  699,  699,  699,  959,
-     2823, 2820, 1038,  959, 1249, 2855,  443,  443, 2855,  699,
-      699,  736, 2855,  443,  863, 1472, 1348, 2855,  864, 1240,
-
-      962, 2855, 1039, 1039, 1039, 1039, 1039, 1039, 1040, 1040,
-     1040, 1041,  752,  752,  752,  752,  752,  752,  753,  753,
-      753,  754,  443, 1596, 1562,  443, 2818, 1081,  737,  738,
-      738,  443,  739,  740,  741,  742,  742,  742,  742,  742,
-      742,  742,  742,  742,  742,  742,  742,  742,  742,  742,
-      742,  742,  742,  742,  742,  742,  745,  758,  758,  758,
-      758,  758,  758,  759,  759,  759,  760,  764,  764,  764,
-      764,  764,  764,  765,  765,  765,  766,  772,  772,  772,
-      772,  772,  772,  773,  773,  773,  774,  780,  780,  780,
-      780,  780,  780,  781,  781,  781,  782,  443,  443, 2096,
-
-     2817, 2097, 2813, 1561,  538,  745,  745,  745,  745,  745,
-      745,  745,  745,  745,  745,  745,  745,  745,  745,  745,
-      745,  745,  745,  745,  788,  788,  788,  788,  788,  788,
-      789,  789,  789,  790,  745,  745,  751,  794,  794,  794,
-      794,  794,  794,  795,  795,  795,  796,  800,  800,  800,
-      800,  800,  800,  801,  801,  801,  802,  810,  810,  810,
-      810,  810,  810,  811,  811,  811,  812,  816,  816,  816,
-      816,  816,  816,  817,  817,  817,  818,  443, 1336,  444,
-     2812, 2811, 1336,  445, 1495,  751,  751,  751,  751,  751,
-      751,  751,  751,  751,  751,  751,  751,  751,  751,  751,
-
-      751,  751,  751,  751,  822,  822,  822,  822,  822,  822,
-      823,  823,  823,  824,  751,  751,  757,  831,  831,  831,
-      831,  831,  831,  832,  832,  832,  833,  837,  837,  837,
-      837,  837,  837,  838,  838,  838,  839,  843,  843,  843,
-      843,  843,  843,  844,  844,  844,  845,  500,  855,  493,
-      443,  443,  856, 1098,  443, 1095, 1535,  443,  521, 1096,
-      494, 2809,  443, 1536, 1366,  757,  757,  757,  757,  757,
-      757,  757,  757,  757,  757,  757,  757,  757,  757,  757,
-      757,  757,  757,  757, 1071,  443,  856, 1085, 1072, 1074,
-      856, 1086,  443, 1102,  757,  757,  763, 1103, 1097, 1122,
-
-     2807,  892,  443, 1123, 1073,  893, 1110,  446,  443, 1087,
-     1111, 1362, 1218, 1368, 1529, 1363, 1218, 2806, 1367,  443,
-     2805,  443, 1104, 1369,  443,  443, 1370, 1075, 1112,  443,
-      443,  443, 1124,  446, 1220, 1113,  443, 1559, 1125, 1409,
-      892, 1416,  443,  443,  893,  763,  763,  763,  763,  763,
-      763,  763,  763,  763,  763,  763,  763,  763,  763,  763,
-      763,  763,  763,  763,  893, 2801, 1128, 1131,  893, 1127,
-     1129, 1132, 1474, 2797,  763,  763,  771,  443,  897,  898,
-      897, 1475,  898,  898,  898,  446, 1137,  443, 1405, 1133,
-     1138, 1130, 1406, 1346,  443, 1136,  443, 1068, 1579, 1576,
-
-      446, 1126, 2796,  443,  443,  443, 1417, 1538,  901, 1157,
-     1480, 1481,  902, 1158, 1342, 1134, 1135,  443,  444,  443,
-      908, 1482,  445,  443,  909,  771,  771,  771,  771,  771,
-      771,  771,  771,  771,  771,  771,  771,  771,  771,  771,
-      771,  771,  771,  771,  901, 1155, 1159,  908,  902, 1371,
-     2787,  909, 1162, 1372,  771,  771,  779,  443,  443, 1179,
-     1182, 1664, 1185, 1180, 1183, 1201, 1186, 2522, 1502, 1202,
-      443, 1139, 1140, 1095, 1373, 1160, 2523, 1096, 2524, 1141,
-      443, 1142, 1591,  443,  443, 1143, 1144, 1181, 1145, 1184,
-     1146, 1187, 2785, 1592,  928, 1203,  443,  443,  929,  443,
-
-     2784, 2783,  443, 2782,  443,  779,  779,  779,  779,  779,
-      779,  779,  779,  779,  779,  779,  779,  779,  779,  779,
-      779,  779,  779,  779,  902, 1413, 1082, 1206,  902, 1414,
-     1083, 1207, 1208, 2093,  779,  779,  787,  914, 1188, 2094,
-     1191,  915, 1189, 1067, 1192,  446,  937, 1068, 2781,  444,
-      938, 1147, 1148,  445, 1362, 2780,  443,  443, 1363, 1149,
-     1193, 1150, 1165, 1190, 1166, 1151, 1152, 1378, 1153, 1195,
-     1154, 2774, 1167, 1196,  443,  443, 1168,  443, 1169, 1170,
-     1171, 1663, 2773,  443, 2772,  787,  787,  787,  787,  787,
-      787,  787,  787,  787,  787,  787,  787,  787,  787,  787,
+      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  242,  242,  242,  242,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  244,  244,  244,  244,  244,
+      244,  245,  245,  245,  246,  169,  169,  247,  247,  181,
+      247,  182,  248,  247,  247,  247,  247,  247,  247,  247,
+      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
 
-      787,  787,  787,  787,  915,  928,  443, 1096,  915,  929,
-     2771, 1096, 2507, 1197,  787,  787,  793,  929, 2767, 1213,
-     1222,  929, 1217, 1214, 1223,  446, 1218, 2507,  446, 1172,
-     1386, 1173, 1433, 1427, 1086, 2766, 1434, 1428,  446, 1174,
-     2747, 2745,  443, 1175, 1219, 1176, 1177, 1178, 1212,  937,
-     1209, 1382, 1387,  938, 1210, 1211,  443,  443, 2743,  443,
-     1215, 1429, 1224,  443,  443,  793,  793,  793,  793,  793,
-      793,  793,  793,  793,  793,  793,  793,  793,  793,  793,
-      793,  793,  793,  793,  949,  950,  443,  949,  950,  950,
-     1026,  950, 1225, 1234,  793,  793,  799, 1235, 1237, 2741,
-
-     1250,  972, 1238, 1242, 1251,  973,  446, 1243, 2740, 2739,
-      731,  731,  731,  731,  731,  731,  732,  732,  732,  733,
-     2738,  443, 1236, 2737, 1232, 1244, 1229, 1230, 2736,  975,
-      443, 2722, 1245,  976, 2714,  443, 1239,  443,  443, 1102,
-      443, 2713, 2712, 1103, 1256,  799,  799,  799,  799,  799,
-      799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
-      799,  799,  799,  799,  972,  973, 1257, 1067,  973,  973,
-      443, 1068, 2711,  976,  799,  799,  809,  976,  975, 1007,
-     1420, 1667,  976,  863, 1083, 1667,  446,  864, 1083, 1252,
-     1254, 1465, 1007,  443,  446, 1362, 2709,  710,  443, 1363,
-
-     1466,  443, 1009, 1253, 1255,  446, 1347,  710, 2704, 1672,
-     1258, 2702, 1014, 1673,  443,  443, 1259,  710, 2701,  444,
-     1375, 1377, 1019,  445, 2698,  809,  809,  809,  809,  809,
-      809,  809,  809,  809,  809,  809,  809,  809,  809,  809,
-      809,  809,  809,  809,  711,  711,  711,  711,  711,  711,
-      712,  712,  712,  713,  809,  809,  815,  711,  711,  711,
-      711,  711,  711,  712,  712,  712,  713, 1010, 1010, 1010,
-     1010, 1010, 1010, 1011, 1011, 1011, 1012, 1015, 1015, 1015,
-     1015, 1015, 1015, 1016, 1016, 1016, 1017, 1020, 1020, 1020,
-     1020, 1020, 1020, 1021, 1021, 1021, 1022,  710, 2696, 1694,
-
-     2694, 2692, 1009, 1695, 1026,  815,  815,  815,  815,  815,
-      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
-      815,  815,  815,  815,  731,  731,  731,  731,  731,  731,
-      732,  732,  732,  733,  815,  815,  821,  719,  720,  721,
-      722,  723,  724,  725,  726,  727,  728,  710,  443, 1470,
-     1471,  444, 1262, 2690,  444,  445, 2688,  710,  445, 1359,
-      523, 1668, 1267, 1351, 2687, 1669, 2686, 1010, 1010, 1010,
-     1010, 1010, 1010, 1011, 1011, 1011, 1012,  710, 2685, 1360,
-     1354, 1361, 1272, 2855, 1674,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-
-      821,  821,  821,  821, 2684, 2683, 1371, 1082, 1102, 1122,
-     1372, 1083, 1103, 1123,  821,  821,  830, 1263, 1263, 1263,
-     1263, 1263, 1263, 1264, 1264, 1264, 1265, 1268, 1268, 1268,
-     1268, 1268, 1268, 1269, 1269, 1269, 1270,  710,  443,  443,
-      443, 2682, 1277, 1684, 1376, 1418, 1436, 1273, 1273, 1273,
-     1273, 1273, 1273, 1274, 1274, 1274, 1275,  710, 2681,  892,
-     1128, 2664, 1283,  893, 1129,  830,  830,  830,  830,  830,
-      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
-      830,  830,  830,  830, 1103, 2656, 2655, 2654, 1103, 1082,
-      443,  443, 2653, 1083,  830,  830,  836, 1116, 2652, 2650,
-
-      444, 1116, 1111, 1443,  445,  446, 1111, 1278, 1278, 1278,
-     1278, 1278, 1278, 1279, 1279, 1279, 1280,  710, 1118, 1431,
-     1431, 1419, 1288,  446, 1432, 1693, 2645, 1284, 1284, 1284,
-     1284, 1284, 1284, 1285, 1285, 1285, 1286,  710, 2643, 1137,
-     1128, 2580, 1293, 1138, 1129,  836,  836,  836,  836,  836,
-      836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
-      836,  836,  836,  836, 1123, 1129, 2641, 2640, 1123, 1129,
-      443,  443, 2637, 2635,  836,  836,  842, 1441, 1132, 1675,
-      444, 1462, 1132, 1676, 1698,  446,  446, 1289, 1289, 1289,
-     1289, 1289, 1289, 1290, 1290, 1290, 1291,  730, 2631, 1446,
-
-     1450, 1437, 1442, 2627, 2625, 2624, 1677, 1294, 1294, 1294,
-     1294, 1294, 1294, 1295, 1295, 1295, 1296, 1157,  897,  901,
-      908, 1158,  898,  902,  909,  842,  842,  842,  842,  842,
-      842,  842,  842,  842,  842,  842,  842,  842,  842,  842,
-      842,  842,  842,  842,  730, 2623, 1492, 1028,  443,  443,
-      443,  443, 2622, 2621,  842,  842,  444, 1461, 2620, 1423,
-      445, 1110, 1485, 1424, 2619, 1111, 2618, 1029, 1029, 1029,
-     1029, 1029, 1029, 1030, 1030, 1030, 1031,  446, 1110, 1425,
-     2602, 1496, 1111, 1112, 1138, 1497, 2600, 1158, 1138,  730,
-      443, 1158,  443,  444, 1033, 1430, 1430,  445, 2595,  730,
-
-     1112, 1498, 1435, 2594, 2593,  446,  444, 1157,  446,  443,
-      445, 1158,  443, 2592, 1034, 1034, 1034, 1034, 1034, 1034,
-     1035, 1035, 1035, 1036, 1491, 2591, 1463,  447,  447,  447,
-      447,  447,  447,  448,  448,  448,  449,  444,  443, 1038,
-     2587,  445, 1700, 1726, 1490, 2585, 1701, 1727, 1179, 1028,
-     1182, 1670, 1180, 1681, 1183,  730, 2583, 1682,  446, 1039,
-     1039, 1039, 1039, 1039, 1039, 1040, 1040, 1040, 1041, 1029,
-     1029, 1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031,  443,
-     1183,  443, 1186, 2581, 1183,  730, 1186, 1423, 2580, 1182,
-     1730, 1424, 1520, 1183, 1731, 1683, 1521, 2579, 2578, 2575,
-
-     1189,  446,  444,  446, 1189, 1299,  445, 1425,  447,  447,
-      447,  447,  447,  447,  448,  448,  448,  449, 2855, 1514,
-      443,  446,  443,  443,  443, 1300, 1300, 1300, 1300, 1300,
-     1300, 1301, 1301, 1301, 1302, 1304, 1512, 1195,  730, 1699,
-     1739, 1196, 1517, 1741, 1740, 1192, 1196, 1741, 1433, 1192,
-     1196, 2573, 1434, 2569, 2562, 1305, 1305, 1305, 1305, 1305,
-     1305, 1306, 1306, 1306, 1307, 1519,  446,  446,  443,  443,
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443,  443,  443,  443,  443,  443,  443, 1309, 1530,
-     1185, 1522, 1188, 1531, 1186, 1523, 1189, 1527,  443,  443,
-
-      450, 1198, 1764, 1214,  451, 2560, 1765, 1214, 1310, 1310,
-     1310, 1310, 1310, 1310, 1311, 1311, 1311, 1312, 1528, 1524,
-      443,  443,  443,  443,  446,  452,  453,  454,  455,  456,
-      457, 1515,  458,  459, 1516,  460,  461,  462,  463,  464,
-      465,  466,  467,  468,  469,  470,  471, 2559, 2558,  472,
-      957,  958,  957,  957,  957,  959,  960,  957,  960,  957,
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      957,  961,  962,  957,  957,  957,  957,  957,  957,  957,
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      963,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-
-      957,  957,  957,  960,  960,  960,  960,  960,  960,  960,
-      960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
-      960,  960,  964,  964,  964,  964,  964,  964,  965,  965,
-      965,  966,  960,  960,  552,  553,  554,  552,  552,  553,
-      552,  552,  552,  552,  552,  552,  555,  552,  552,  552,
-      552,  552,  552,  552,  556,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-
-      554,  554,  554,  554,  554,  554,  557,  557,  557,  557,
-      557,  557,  558,  558,  558,  559,  554,  554,  555, 1486,
-     1191, 1185,  928, 1487, 1192, 1186,  929, 1218,  444, 2557,
-     2556, 1218,  445, 1235,  445, 2555, 2554, 1235, 1241, 1488,
-     1193, 2553, 2536,  444, 2532, 1430, 1430,  445,  446, 1220,
-      443,  443,  443,  443,  446,  446, 2526, 1489, 1513,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  560,  560,
-      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
-      560,  560,  560,  560,  560,  560,  560,  561,  561,  561,
+      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
+      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
+      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  249,
+      249,  249,  249,  249,  249,  250,  250,  250,  251,  169,
+      169,  252,  252,  181,  252,  182,  253,  252,  252,  252,
+      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
+      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
+      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
 
-      561,  561,  561,  561,  561,  561,  561,  561,  561,  561,
-      561,  561,  561,  561,  561,  561,  983,  983,  983,  983,
-      983,  983,  983,  983,  983,  983,  983,  983,  983,  983,
-      983,  983,  983,  983,  983,  562, 1179, 1188, 2525, 1201,
-     1180, 1189, 1201, 1202, 1202, 1678, 1202, 2516, 1202, 1679,
-     2512, 1213,  901,  730,  444, 1214,  902, 2508,  445, 2506,
-     1793, 1165, 2505, 1166, 1794,  446,  730,  443,  443, 1742,
-      443, 1167, 1534,  443, 1680, 1168, 1532, 1169, 1170, 1171,
-     1518, 1533,  443,  730,  562,  562,  562,  562,  562,  562,
-      562,  562,  562,  562,  562,  562,  562,  562,  562,  562,
+      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
+      252,  252,  252,  252,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  254,  254,  254,  254,  254,  254,  255,
+      255,  255,  256,  169,  169,  258,  511,  259,  176,  258,
+      512,  259,  176,  181,  509,  261,  176,  181,  510,  261,
+      176,  262,  262,  181,  262,  182,  263,  262,  262,  262,
+      262,  262,  262,  262,  262,  262,  262,  262,  262,  262,
+      262,  262,  262,  262,  262,  262,  262,  262,  262,  262,
+      262,  262,  262,  262,  262,  262,  262,  262,  262,  262,
 
-      562,  562,  562, 1314, 1544,  863,  444, 1371, 1545,  864,
-      445, 1372, 2502,  562,  562,  568, 1320,  937, 1554, 2495,
-     2493,  938, 1555, 1315, 1315, 1315, 1315, 1315, 1315, 1316,
-     1316, 1316, 1317, 1325, 1690,  443, 1321, 1321, 1321, 1321,
-     1321, 1321, 1322, 1322, 1322, 1323, 1553, 1705,  443,  443,
-     1686, 2482, 2481, 1326, 1326, 1326, 1326, 1326, 1326, 1327,
-     1327, 1327, 1328, 1026,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  731,  731,  731,  731,  731,  731,  732,
-      732,  732,  733,  568,  568,  574,  574,  575,  574,  575,
-
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  576,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  575,  575,
-      575,  575,  575,  575,  575,  575,  575,  575,  575,  575,
-      575,  575,  575,  575,  575,  575,  575,  577,  577,  577,
-      577,  577,  577,  578,  578,  578,  579,  575,  575,  574,
-     1180, 1213, 1217, 1222, 1180, 1214, 1218, 1223,  444, 1556,
-     1157, 2480,  445, 1557, 1158,  949, 1234, 2479,  580,  950,
-
-     1235,  446, 1754, 2478, 1219, 1172, 1755, 1173, 1542, 1558,
-      730, 1548,  443,  443,  443, 1174, 2477, 1691, 2476, 1175,
-      443, 1176, 1177, 1178, 1756, 1549,  443,  443,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  580,
-     1330, 1222, 2475, 1234, 1237, 1223, 1237, 1235, 1238, 1238,
-     1238, 1571,  444, 1238, 1574, 1572,  445, 2452, 1575, 2451,
-     1331, 1331, 1331, 1331, 1331, 1331, 1332, 1332, 1332, 1333,
-      446, 2448,  443, 1563,  443,  443, 1687,  443, 2447, 1703,
-
-     1688, 1564,  443, 1566, 1552,  443, 1565, 2439,  580,  580,
-      580,  580,  580,  580,  580,  580,  580,  580,  580,  580,
-      580,  580,  580,  580,  580,  580,  580, 1223, 1242, 1242,
-     1577, 1223, 1243, 1243, 1578, 1689, 1243,  580,  580,  588,
-     1243, 2438, 2437, 1589, 2435, 1568, 1568, 1582,  446, 2434,
-     1244, 1244,  972, 1569, 1569, 1550,  973,  446, 1570,  443,
-      443,  443, 1007, 2430, 1584, 1590, 2429,  444, 2426, 1551,
-     1573,  445,  444,  444, 1007, 2419,  445,  445, 2418,  710,
-     2417, 1595,  444,  443, 1009, 2416,  445, 2413,  588,  588,
-      588,  588,  588,  588,  588,  588,  588,  588,  588,  588,
+      262,  262,  262,  262,  262,  262,  262,  262,  262,  262,
+      262,  262,  262,  262,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  264,  264,  264,  264,  264,  264,  265,
+      265,  265,  266,  169,  169,  267,  267,  181,  267,  182,
+      268,  267,  267,  267,  267,  267,  267,  267,  267,  267,
+      267,  267,  267,  267,  267,  267,  267,  267,  267,  267,
+      267,  267,  267,  267,  267,  267,  267,  267,  267,  267,
+      267,  267,  267,  267,  267,  267,  267,  267,  267,  267,
+      267,  267,  267,  267,  267,  267,  267,  267,  169,  169,
 
-      588,  588,  588,  588,  588,  588,  588,  975, 1704, 1802,
-     1702,  976, 2406, 1803, 2403, 1718, 1346,  588,  588,  594,
-     1068,  444, 1598, 2399, 1722,  445, 2395,  711,  711,  711,
-      711,  711,  711,  712,  712,  712,  713, 1342,  443,  711,
-      711,  711,  711,  711,  711,  712,  712,  712,  713, 1010,
-     1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012,  710,
-     2390,  444, 1728, 2389, 1014,  445, 2388, 1026,  594,  594,
-      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
-      594,  594,  594,  594,  594,  594,  594,  731,  731,  731,
-      731,  731,  731,  732,  732,  732,  733,  594,  594,  600,
-
-     1778, 1359, 1102, 2387, 1665, 1351, 1103, 1363, 1666, 2386,
-      710, 1363, 1719,  444,  444, 1019, 1720,  445,  445, 2385,
-      710, 1360, 1354, 1361, 1349, 1009,  443, 2384,  446, 1015,
-     1015, 1015, 1015, 1015, 1015, 1016, 1016, 1016, 1017,  710,
-     2383, 1721, 1723, 1743, 1009, 1725, 2382, 2366,  600,  600,
-      600,  600,  600,  600,  600,  600,  600,  600,  600,  600,
-      600,  600,  600,  600,  600,  600,  600, 1182,  444, 1821,
-     1520, 1183,  445, 1821, 1521, 2364, 2358,  600,  600,  606,
-     1020, 1020, 1020, 1020, 1020, 1020, 1021, 1021, 1021, 1022,
-     1010, 1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012,
-
-      710, 1745, 1696,  444, 1386, 1262, 1390,  445, 1086, 1010,
-     1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012,  710,
-     2357, 2354, 2352, 1392, 1267, 1382, 1387, 2350,  606,  606,
-      606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
-      606,  606,  606,  606,  606,  606,  606, 1359, 1826, 1774,
-      444, 1351, 1827, 2339,  445, 2338, 2337,  606,  606,  612,
-      444, 1398,  445, 2336,  445, 1398,  445, 1360, 1354, 1361,
-     1263, 1263, 1263, 1263, 1263, 1263, 1264, 1264, 1264, 1265,
-      710, 1697, 1401,  446, 1757, 1272, 1775, 1732, 1757, 1268,
-     1268, 1268, 1268, 1268, 1268, 1269, 1269, 1269, 1270,  710,
-
-     2335, 1733, 1732, 1746, 1277, 1734, 1758, 1747,  612,  612,
-      612,  612,  612,  612,  612,  612,  612,  612,  612,  612,
-      612,  612,  612,  612,  612,  612,  612, 1372, 1434, 1735,
-      444, 1372, 1434, 2334,  445, 2329, 2325,  612,  612,  618,
-     1749, 1424, 2324, 1736, 1749, 1424, 1748, 2321,  446,  446,
-     1273, 1273, 1273, 1273, 1273, 1273, 1274, 1274, 1274, 1275,
-      710, 1729,  446, 1845, 1685, 1277, 2319, 1846, 1776, 1278,
-     1278, 1278, 1278, 1278, 1278, 1279, 1279, 1279, 1280,  710,
-     2316,  444, 1128, 1750, 1283,  445, 1129, 2314,  618,  618,
-      618,  618,  618,  618,  618,  618,  618,  618,  618,  618,
-
-      618,  618,  618,  618,  618,  618,  618, 2313, 1766,  444,
-     1751, 1753, 1453,  445, 2307, 2302, 2299,  618,  618,  624,
-     1734, 1757, 1759,  444, 1734, 1757, 1759,  445, 2297, 1455,
-     1278, 1278, 1278, 1278, 1278, 1278, 1279, 1279, 1279, 1280,
-      710,  446,  444, 1758, 1756, 1288,  445, 1806, 1737, 1284,
-     1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285, 1286,  710,
-     2295,  897, 1738,  444, 1293,  898, 1767,  445,  624,  624,
-      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
-      624,  624,  624,  624,  624,  624,  624, 1760, 1486,  886,
-     1182, 1760, 1487, 2290, 1183, 2288, 1769,  624,  624,  630,
-
-     1762,  444, 2285,  444, 1762,  445, 1770,  445, 1488, 1761,
-     1289, 1289, 1289, 1289, 1289, 1289, 1290, 1290, 1290, 1291,
-      710,  917, 1763, 1544,  444, 1009, 1772, 1545,  445, 1294,
-     1294, 1294, 1294, 1294, 1294, 1295, 1295, 1295, 1296,  710,
-     2284,  444, 2281,  444, 1262,  445,  867,  445,  630,  630,
-      630,  630,  630,  630,  630,  630,  630,  630,  630,  630,
-      630,  630,  630,  630,  630,  630,  630,  896, 2276, 2270,
-      444, 1773,  444, 1798,  445, 2268,  445,  630,  630,  636,
-     2267, 1487,  444,  444, 1496, 1487,  445,  445, 1497, 2266,
-     1010, 1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012,
-
-      710, 1792,  446, 1777, 1498, 1267, 1800, 2265, 1805, 1263,
-     1263, 1263, 1263, 1263, 1263, 1264, 1264, 1264, 1265,  710,
-     2264,  927,  444, 1811, 1272, 1804,  445, 1811,  636,  636,
-      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
-      636,  636,  636,  636,  636,  636,  636, 2263, 1497,  444,
-     2262, 1796, 1497,  445, 1812, 2261,  444,  636,  636,  642,
-      445, 1521, 1527, 1546, 2260, 1521, 1830, 1546, 1801,  446,
-     1268, 1268, 1268, 1268, 1268, 1268, 1269, 1269, 1269, 1270,
-      710, 2237,  446, 1528,  444, 1009, 1828, 2236,  445, 1273,
-     1273, 1273, 1273, 1273, 1273, 1274, 1274, 1274, 1275,  710,
-
-     2233,  444, 1185,  941, 1009,  445, 1186, 2855,  642,  642,
-      642,  642,  642,  642,  642,  642,  642,  642,  642,  642,
-      642,  642,  642,  642,  642,  642,  642, 1818, 2855, 1201,
-     1815,  937, 1188, 1202, 2221,  938, 1189,  642,  642,  648,
-     2220,  444, 1840, 1877, 1817,  445, 1531, 1878, 2217, 2214,
-     1010, 1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012,
-      710, 1820, 1545, 1835, 1844, 1262, 1545, 1861, 2209, 1010,
-     1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012,  710,
-     1847, 1522,  444,  446, 1267, 1523,  445, 1841,  648,  648,
-      648,  648,  648,  648,  648,  648,  648,  648,  648,  648,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  269,  269,  269,
+      269,  269,  269,  270,  270,  270,  271,  169,  169,  272,
+      272,  181,  272,  182,  273,  272,  272,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  272,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 
-      648,  648,  648,  648,  648,  648,  648, 2196, 2194, 1822,
-      444, 1831,  444, 2193,  445, 2192,  445,  648,  648,  656,
-     1523, 2191, 1556, 1823, 1523, 1855, 1557, 2188, 2187, 2181,
-     1263, 1263, 1263, 1263, 1263, 1263, 1264, 1264, 1264, 1265,
-      710,  446, 1558,  444, 2174, 1272, 2173,  445, 1824, 1268,
-     1268, 1268, 1268, 1268, 1268, 1269, 1269, 1269, 1270,  710,
-     1857,  444, 1825,  444, 1262,  445, 2168,  445,  656,  656,
-      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
-      656,  656,  656,  656,  656,  656,  656, 1557, 2165, 1222,
-     1842, 1557, 1213, 1223, 2163, 2162, 1214,  656,  656,  662,
-
-      444,  444, 1942, 2151,  445,  445, 1848, 1876,  446, 2148,
-     1273, 1273, 1273, 1273, 1273, 1273, 1274, 1274, 1274, 1275,
-      710, 1853, 1860, 1237, 1885, 1600, 1879, 1238, 1885, 1263,
-     1263, 1263, 1263, 1263, 1263, 1264, 1264, 1264, 1265,  710,
-     2146,  444,  444, 1849, 1605,  445,  445, 2143,  662,  662,
-      662,  662,  662,  662,  662,  662,  662,  662,  662,  662,
-      662,  662,  662,  662,  662,  662,  662, 2141, 1234, 1854,
-      444, 1856, 1235, 2130,  445, 2128,  444,  662,  662,  668,
-      445, 1571, 1572, 2125, 2124, 1572, 1572, 1568, 1568, 2123,
-     1601, 1601, 1601, 1601, 1601, 1601, 1602, 1602, 1602, 1603,
-
-      710, 1882, 1892,  446, 1881, 1610, 1893, 2118, 2108, 1606,
-     1606, 1606, 1606, 1606, 1606, 1607, 1607, 1607, 1608,  710,
-     2104,  444, 1349, 1574, 1283,  445, 2100, 1575,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668, 1886,  444,  444,
-     1883, 1887,  445,  445, 2095, 2092, 2091,  668,  668,  674,
-     1889, 1894, 1888, 1575,  444, 1893, 2090, 1575,  445, 2089,
-     1611, 1611, 1611, 1611, 1611, 1611, 1612, 1612, 1612, 1613,
-      710, 2078, 1354, 1361,  446, 1615, 1891, 2077, 2072, 1284,
-     1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285, 1286,  710,
-
-     1890,  972, 1667, 2071, 1620,  973, 1667, 1248,  674,  674,
-      674,  674,  674,  674,  674,  674,  674,  674,  674,  674,
-      674,  674,  674,  674,  674,  674,  674, 1895,  444, 1668,
-     1668, 1896,  445, 1669, 1669, 2065, 1829,  674,  674,  681,
-     1589, 1898,  975, 1694, 1582, 1899,  976, 1695, 2049, 1897,
-     1616, 1616, 1616, 1616, 1616, 1616, 1617, 1617, 1617, 1618,
-      710, 1584, 1590,  443, 1589, 1625, 1902, 2048, 1582, 1621,
-     1621, 1621, 1621, 1621, 1621, 1622, 1622, 1622, 1623,  730,
-      444, 1907, 2045, 2042,  445, 1584, 1590, 1026,  681,  681,
-      681,  681,  681,  681,  681,  681,  681,  681,  681,  681,
+      169,  274,  274,  274,  274,  274,  274,  275,  275,  275,
+      276,  169,  169,  277,  277,  181,  277,  182,  278,  277,
+      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  277,  277,  277,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  279,  279,  279,  279,  279,
+      279,  280,  280,  280,  281,  169,  169,  181,  726,  283,
+
+      284,  181,  511,  283,  284,  286,  512,  287,  288,  286,
+      289,  287,  288,  291,  289,  292,  293,  291,  480,  292,
+      293,  181,  481,  182,  176,  181,  726,  182,  176,  492,
+      317,  315,  318,  319,  317,  315,  318,  319,  493, 2912,
+      542,  169,  543,  169,  922,  169,  181,  169,  182,  176,
+      181,  923,  182,  176,  503,  169,  361,  320,  362,  176,
+      504,  320,  181,  294,  182,  176, 2912,  294,  295,  295,
+      181,  295,  182,  296,  295,  295,  295,  295,  295,  295,
+      295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
+      295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
 
-      681,  681,  681,  681,  681,  681,  681,  731,  731,  731,
-      731,  731,  731,  732,  732,  732,  733,  681,  681,  687,
-     1900, 1694, 1917, 1905, 1901, 1695, 1666, 2040, 2039, 1028,
-     1626, 1626, 1626, 1626, 1626, 1626, 1627, 1627, 1627, 1628,
-      730, 1696, 2855, 1354,  445, 1390, 2037, 2036, 1698, 1029,
-     1029, 1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031,  730,
-     1067, 2035, 1392, 1961, 1068,  446, 2021, 1961,  687,  687,
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  687,  687,  687,  687,  687,  687, 1701,  443, 1741,
-     1033, 1701, 2016, 1741, 2013, 2012,  443,  687,  687,  693,
-
-     2011, 1673, 1915, 1676,  443, 1673, 2010, 1676,  446, 1038,
-     1034, 1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1036,
-      730, 1731,  446, 1749,  446, 1731, 2009, 1749, 2007, 1039,
-     1039, 1039, 1039, 1039, 1039, 1040, 1040, 1040, 1041,  730,
-     1672, 2003,  446, 1921, 1673, 1924, 2002, 1995,  693,  693,
-      693,  693,  693,  693,  693,  693,  693,  693,  693,  693,
-      693,  693,  693,  693,  693,  693,  693, 1679,  443, 1749,
-     1028, 1679, 1975, 1749, 1972, 1966,  443,  693,  693,  699,
-     1965, 1968, 1920, 1984,  443, 1968, 1956, 1985,  446, 1028,
-     1029, 1029, 1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031,
-
-      730, 1747,  446, 1757, 1927, 1747, 1950, 1757, 1949, 1029,
-     1029, 1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031, 1764,
-      444, 1942,  446, 1765,  445, 1758, 1940, 1933,  699,  699,
-      699,  699,  699,  699,  699,  699,  699,  699,  699,  699,
-      699,  699,  699,  699,  699,  699,  699, 1715,  443, 1764,
-     1299, 1414, 1919, 1765, 1906, 1904,  443,  699,  699,  736,
-     1903, 1486, 1682, 1567,  443, 1487, 1682, 1922, 1709, 1884,
-     1300, 1300, 1300, 1300, 1300, 1300, 1301, 1301, 1301, 1302,
-      730, 1488, 1716,  446, 2017, 2028, 1880, 1811, 2017, 2028,
-      730, 1811, 1795, 1717, 1859, 1858,  737,  738,  738, 1930,
-
-      739,  740,  741,  742,  742,  742,  742,  742,  742,  742,
-      742,  742,  742,  742,  742,  742,  742,  742,  742,  742,
-      742,  742,  742,  742,  745, 1755, 1852, 1759, 2033, 1755,
-     1304, 1759, 2033, 1851, 1821, 2098, 1850, 2025, 1821, 2098,
-     1309, 2025,  730, 1843, 1829, 1829,  446, 1758, 2034, 1756,
-     1305, 1305, 1305, 1305, 1305, 1305, 1306, 1306, 1306, 1307,
-     1310, 1310, 1310, 1310, 1310, 1310, 1311, 1311, 1311, 1312,
-     2026, 1819,  730,  745,  745,  745,  745,  745,  745,  745,
-      745,  745,  745,  745,  745,  745,  745,  745,  745,  745,
-      745,  745, 1314, 1816, 1885, 1554, 1900, 1811, 1885, 1555,
-
-     1901, 1811,  745,  745,  751, 1988, 2062, 1991, 1979, 1988,
-     2062, 1992, 1315, 1315, 1315, 1315, 1315, 1315, 1316, 1316,
-     1316, 1317, 1314,  730, 1862, 1863, 2038, 1989, 1864,  978,
-     1865, 2063, 1866, 1814, 1900,  730, 2117, 1867, 1901, 1868,
-     2117, 1813, 1315, 1315, 1315, 1315, 1315, 1315, 1316, 1316,
-     1316, 1317, 1007,  751,  751,  751,  751,  751,  751,  751,
-      751,  751,  751,  751,  751,  751,  751,  751,  751,  751,
-      751,  751, 1961, 1320, 1984, 1984, 1961, 2017, 1985, 1985,
-     1810, 2017,  751,  751,  757, 1325, 2025, 2028, 1667, 1809,
-     2025, 2028, 1667, 1321, 1321, 1321, 1321, 1321, 1321, 1322,
-
-     1322, 1322, 1323,  730, 1808, 1326, 1326, 1326, 1326, 1326,
-     1326, 1327, 1327, 1327, 1328,  730, 1807,  711,  711,  711,
-      711,  711,  711,  712,  712,  712,  713, 1799, 2224, 1797,
-     1791, 1007, 2224,  757,  757,  757,  757,  757,  757,  757,
-      757,  757,  757,  757,  757,  757,  757,  757,  757,  757,
-      757,  757, 2033, 1330, 2230, 2098, 2033, 2277, 2062, 2098,
-     1790, 2277,  757,  757,  763, 1028, 2062, 2227, 1789, 1786,
-     2062, 2060, 2034, 1331, 1331, 1331, 1331, 1331, 1331, 1332,
-     1332, 1332, 1333,  730, 1785, 1029, 1029, 1029, 1029, 1029,
-     1029, 1030, 1030, 1030, 1031,  730,  711,  711,  711,  711,
-
-      711,  711,  712,  712,  712,  713,  710, 2231, 1784, 1783,
-     1782, 1009, 1832,  763,  763,  763,  763,  763,  763,  763,
-      763,  763,  763,  763,  763,  763,  763,  763,  763,  763,
-      763,  763, 2210, 1299, 2340, 2017, 2210, 1811, 2340, 2017,
-     1781, 1811,  763,  763,  771, 1304, 2224, 2230, 1780, 2341,
-     2224, 2062, 1729, 1300, 1300, 1300, 1300, 1300, 1300, 1301,
-     1301, 1301, 1302,  730, 1779, 1305, 1305, 1305, 1305, 1305,
-     1305, 1306, 1306, 1306, 1307,  730, 1010, 1010, 1010, 1010,
-     1010, 1010, 1011, 1011, 1011, 1012,  710, 1771, 2246, 1768,
-     1752, 1014, 2246,  771,  771,  771,  771,  771,  771,  771,
+      295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
+      295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
+      295,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      297,  297,  297,  297,  297,  297,  298,  298,  298,  299,
+      169,  169,  300,  300,  181,  300,  182,  301,  300,  300,
+      300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
+      300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
+      300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
+      300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
 
-      771,  771,  771,  771,  771,  771,  771,  771,  771,  771,
-      771,  771, 2215, 1309, 2246, 2025, 2215, 1744, 2246, 2025,
-     1724, 2247,  771,  771,  779, 1028, 2248, 2277, 1692, 1671,
-     2248, 2277, 1876, 1310, 1310, 1310, 1310, 1310, 1310, 1311,
-     1311, 1311, 1312,  730, 2344, 1029, 1029, 1029, 1029, 1029,
-     1029, 1030, 1030, 1030, 1031,  730, 1015, 1015, 1015, 1015,
-     1015, 1015, 1016, 1016, 1016, 1017,  710, 1659, 2248, 2855,
-     2855, 1019, 2248,  779,  779,  779,  779,  779,  779,  779,
-      779,  779,  779,  779,  779,  779,  779,  779,  779,  779,
-      779,  779, 2286, 1028, 2249, 2400, 2286, 2404, 2855, 2400,
-
-     2855, 2404,  779,  779,  787, 1299, 2424, 2227, 2855, 2855,
-     2424, 2060, 1240, 1029, 1029, 1029, 1029, 1029, 1029, 1030,
-     1030, 1030, 1031,  730, 2855, 1300, 1300, 1300, 1300, 1300,
-     1300, 1301, 1301, 1301, 1302,  730, 1020, 1020, 1020, 1020,
-     1020, 1020, 1021, 1021, 1021, 1022,  710, 2855, 1597, 1594,
-     1593, 1009, 1832,  787,  787,  787,  787,  787,  787,  787,
-      787,  787,  787,  787,  787,  787,  787,  787,  787,  787,
-      787,  787, 2292, 1304, 2459, 2246, 2293, 2487, 2459, 2246,
-     1567, 2487,  787,  787,  793, 1309, 2400, 2404, 1560,  443,
-     2400, 2404, 2131, 1305, 1305, 1305, 1305, 1305, 1305, 1306,
-
-     1306, 1306, 1307,  730, 2464, 1310, 1310, 1310, 1310, 1310,
-     1310, 1311, 1311, 1311, 1312,  730, 1010, 1010, 1010, 1010,
-     1010, 1010, 1011, 1011, 1011, 1012,  710, 1541, 2062, 1540,
-     1539, 1009, 2062,  793,  793,  793,  793,  793,  793,  793,
-      793,  793,  793,  793,  793,  793,  793,  793,  793,  793,
-      793,  793, 2210, 1299, 2424, 2517, 2210,  443, 2424, 2517,
-     1511, 2362,  793,  793,  799, 1630, 2025, 2459, 1510, 1509,
-     2025, 2459, 1729, 1300, 1300, 1300, 1300, 1300, 1300, 1301,
-     1301, 1301, 1302,  730, 1508, 1631, 1631, 1631, 1631, 1631,
-     1631, 1632, 1632, 1632, 1633,  730, 1010, 1010, 1010, 1010,
-
-     1010, 1010, 1011, 1011, 1011, 1012,  710, 1507, 2248, 1506,
-     1505, 1262, 2248,  799,  799,  799,  799,  799,  799,  799,
-      799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
-      799,  799, 2211, 1635, 2248, 2517, 2211, 2246, 2248, 2517,
-     1494, 2246,  799,  799,  809, 1640, 2372, 2648, 1484, 1483,
-     1479, 2648, 1792, 1636, 1636, 1636, 1636, 1636, 1636, 1637,
-     1637, 1637, 1638,  730, 1476, 1641, 1641, 1641, 1641, 1641,
-     1641, 1642, 1642, 1642, 1643,  730, 1263, 1263, 1263, 1263,
-     1263, 1263, 1264, 1264, 1264, 1265,  710, 1473, 2062, 1460,
-     1440, 1267, 2062,  809,  809,  809,  809,  809,  809,  809,
-
-      809,  809,  809,  809,  809,  809,  809,  809,  809,  809,
-      809,  809, 2215, 1320, 2541, 2667, 2215, 2707,  443, 2667,
-      443, 2707,  809,  809,  815, 1645, 2729, 2062, 1365, 1334,
-     2729, 2062, 1876, 1321, 1321, 1321, 1321, 1321, 1321, 1322,
-     1322, 1322, 1323,  730, 2855, 1646, 1646, 1646, 1646, 1646,
-     1646, 1647, 1647, 1647, 1648,  730, 1268, 1268, 1268, 1268,
-     1268, 1268, 1269, 1269, 1269, 1270,  710, 2855, 2062, 2728,
-      443, 1272, 2062,  815,  815,  815,  815,  815,  815,  815,
-      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
-      815,  815, 2211, 1650, 2770, 2707, 2211, 2671, 2770, 2707,
-
-      443,  443,  815,  815,  821, 1655, 2751, 2025,  443,  443,
-     2751, 2025, 1792, 1651, 1651, 1651, 1651, 1651, 1651, 1652,
-     1652, 1652, 1653, 2351,  443, 1656, 1656, 1656, 1656, 1656,
-     1656, 1657, 1657, 1657, 1658, 2442, 1273, 1273, 1273, 1273,
-     1273, 1273, 1274, 1274, 1274, 1275, 2729,  710, 2752,  443,
-     2729,  443, 1277,  821,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-      821,  821, 1555, 1688, 2062, 1720, 1555, 1688, 2062, 1720,
-      443, 2004,  821,  821,  830, 2004, 2790, 1734, 2751,  443,
-     2790, 1734, 2751,  446,  446,  710,  446, 1094,  443, 2456,
-
-     1277, 1869, 1870, 1387, 1088, 1871,  710, 1872,  446, 1873,
-     1936, 1283, 1953,  443, 1874, 1737, 1875, 1278, 1278, 1278,
-     1278, 1278, 1278, 1279, 1279, 1279, 1280,  710,  808, 1738,
-     1052, 1050, 1288,  830,  830,  830,  830,  830,  830,  830,
-      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
-      830,  830, 2025, 2793, 1766, 2770, 2025, 2793, 1453, 2770,
-     1025,  555,  830,  830,  836, 1278, 1278, 1278, 1278, 1278,
-     1278, 1279, 1279, 1279, 1280, 1455, 1284, 1284, 1284, 1284,
-     1284, 1284, 1285, 1285, 1285, 1286,  710,  555, 2008, 2203,
-     1794, 1293, 2008,  971, 1794,  970,  967, 1289, 1289, 1289,
-
-     1289, 1289, 1289, 1290, 1290, 1290, 1291,  710,  954,  948,
-     1450,  446, 1009,  836,  836,  836,  836,  836,  836,  836,
-      836,  836,  836,  836,  836,  836,  836,  836,  836,  836,
-      836,  836, 1803, 2051, 2340, 2798, 1803, 2051, 2340, 2798,
-      945, 1811,  836,  836,  842, 1811, 1026,  944,  936,  935,
-      932, 1569, 1569,  446,  446, 2053, 1294, 1294, 1294, 1294,
-     1294, 1294, 1295, 1295, 1295, 1296,  731,  731,  731,  731,
-      731,  731,  732,  732,  732,  733,  921, 1010, 1010, 1010,
-     1010, 1010, 1010, 1011, 1011, 1011, 1012, 2799, 2213,  920,
-      919, 2799,  911,  842,  842,  842,  842,  842,  842,  842,
+      300,  300,  300,  300,  300,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  302,  302,  302,  302,  302,  302,
+      303,  303,  303,  304,  169,  169,  305,  305,  181,  305,
+      182,  306,  305,  305,  305,  305,  305,  305,  305,  305,
+      305,  305,  305,  305,  305,  305,  305,  305,  305,  305,
+      305,  305,  305,  305,  305,  305,  305,  305,  305,  305,
+      305,  305,  305,  305,  305,  305,  305,  305,  305,  305,
+      305,  305,  305,  305,  305,  305,  305,  305,  305,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 
-      842,  842,  842,  842,  842,  842,  842,  842,  842,  842,
-      842,  842,  710,  900, 1662,  444,  444, 1009, 1662,  445,
-      445,  891,  842,  842,  444, 1675,  890, 2005,  445, 1676,
-     1916, 2005,  887, 2248, 1727,  446, 1675, 2248, 1727,  884,
-     1676,  710, 1912,  443,  443,  446, 1262,  881,  880, 1432,
-     1913,  443,  443,  443, 1918,  446, 2006,  710, 1914,  443,
-      443,  443, 1267, 1064,  443,  879,  500, 1923, 2465,  443,
-     1892, 1958,  443,  710, 1893,  877,  871, 2800, 1272, 1925,
-      443, 2800, 1010, 1010, 1010, 1010, 1010, 1010, 1011, 1011,
-     1011, 1012, 1355,  870,  869,  447,  447,  447,  447,  447,
-
-      447,  448,  448,  448,  449,  444, 2790,  862,  859,  445,
-     2790, 1263, 1263, 1263, 1263, 1263, 1263, 1264, 1264, 1264,
-     1265, 2062,  858,  857,  854, 2062,  446, 1268, 1268, 1268,
-     1268, 1268, 1268, 1269, 1269, 1269, 1270, 2014,  853,  850,
-      541, 2014,  912, 1273, 1273, 1273, 1273, 1273, 1273, 1274,
-     1274, 1274, 1275, 2056, 1878,  536, 2606, 1830, 1878, 1570,
-     2793, 2822,  511, 2822, 2793, 2822, 2015, 2822, 2840, 2840,
-      506,  491, 2840, 2840, 2057,  446,  447,  447,  447,  447,
-      447,  447,  448,  448,  448,  449, 1114, 1115, 1114, 1114,
-     1114, 1116, 1117, 1114, 1117, 1114, 1114, 1114, 1114, 1114,
-
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1118, 1114,
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1117,
-     1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
-     1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1119, 1119,
-     1119, 1119, 1119, 1119, 1120, 1120, 1120, 1121, 1117, 1117,
-      957,  958,  957,  957,  957,  959,  960,  957,  960,  957,
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      957,  961,  962,  957,  957,  957,  957,  957,  957,  957,
-
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      957,  957,  957,  960,  960,  960,  960,  960,  960,  960,
-      960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
-      960,  960,  964,  964,  964,  964,  964,  964,  965,  965,
-      965,  966,  960,  960, 2855, 1678,  480, 1678,  443, 1679,
-      443, 1679, 1759,  808,  786, 2115, 1759,  710,  778, 1899,
-      729,  555, 1262,  555, 1894, 2246,  548,  710, 1893, 2246,
-      541,  536, 1262,  443, 1756,  443, 1584,  710,  511,  506,
-      491,  443, 1600,  443, 1926, 1354, 1361,  710, 1928,  443,
-
-      480,  443, 1605, 2544, 2855,  443,  443,  443,  443,  443,
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443,  443,  443, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855,  443,  443,  555, 1263, 1263, 1263,
-     1263, 1263, 1263, 1264, 1264, 1264, 1265, 1263, 1263, 1263,
-     1263, 1263, 1263, 1264, 1264, 1264, 1265, 1601, 1601, 1601,
-     1601, 1601, 1601, 1602, 1602, 1602, 1603, 1606, 1606, 1606,
-     1606, 1606, 1606, 1607, 1607, 1607, 1608,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  444, 1681, 2855, 1681,
-
-      445, 1682,  444, 1682, 2855, 2246,  445, 2855, 1840, 2246,
-     2855, 1917, 1531,  710, 2855, 1666, 1715,  446, 1610, 1371,
-     1414, 2855,  863, 1372, 2855,  443,  864,  443, 1931, 1835,
-      443, 1932, 1354,  443, 1929,  443, 2286, 1709,  443,  710,
-     2286,  443, 2371,  443, 1283, 2855,  443,  443, 1934,  710,
-     1938, 1716, 2855, 1841, 1283,  443, 1240, 1846,  443,  710,
-     2855, 1846, 1717,  443, 1615, 2855,  443,  447,  447,  447,
-      447,  447,  447,  448,  448,  448,  449,  444,  446, 2855,
-     2855,  445, 2855, 1611, 1611, 1611, 1611, 1611, 1611, 1612,
-     1612, 1612, 1613, 2855, 2068, 2855, 2855, 2855,  446, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 1337, 1284,
-     1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285, 1286, 1284,
-     1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285, 1286, 1616,
-     1616, 1616, 1616, 1616, 1616, 1617, 1617, 1617, 1618, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,  447,  447,
-      447,  447,  447,  447,  448,  448,  448,  449, 1339, 1340,
-     1339, 1339, 1339, 1068, 1341, 1339, 1341, 1339, 1339, 1339,
-     1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-     1342, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-     1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-
-     1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-     1339, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
-     1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
-     1343, 1343, 1343, 1343, 1343, 1343, 1344, 1344, 1344, 1345,
-     1341, 1341, 1349, 1350, 1349, 1349, 1349, 1351, 1352, 1349,
-     1352, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1353, 1354, 1355, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1352, 1352, 1352, 1352, 1352,
-
-     1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352,
-     1352, 1352, 1352, 1352, 1356, 1356, 1356, 1356, 1356, 1356,
-     1357, 1357, 1357, 1358, 1352, 1352, 1379, 1380, 1379, 1379,
-     1379, 1086, 1381, 1379, 1381, 1379, 1379, 1379, 1379, 1379,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1382, 1087,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1381,
-     1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381,
-     1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1383, 1383,
-
-     1383, 1383, 1383, 1383, 1384, 1384, 1384, 1385, 1381, 1381,
-     1388, 1389, 1388, 1388, 1388, 1390, 1391, 1388, 1391, 1388,
-     1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1392,  443, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1391, 1391, 1391, 1391, 1391, 1391, 1391,
-     1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391,
-     1391, 1391, 1393, 1393, 1393, 1393, 1393, 1393, 1394, 1394,
-     1394, 1395, 1391, 1391, 1396, 1397, 1396, 1396, 1396, 1398,
-
-     1399, 1396, 1399, 1396, 1396, 1396, 1396, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1400, 1401, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1399, 1399, 1399,
-     1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399,
-     1399, 1399, 1399, 1399, 1399, 1399, 1402, 1402, 1402, 1402,
-     1402, 1402, 1403, 1403, 1403, 1404, 1399, 1399, 2855, 1687,
-     2855, 1687,  443, 1688,  443, 1688, 2855, 1887, 2855, 1894,
-     2189, 1887, 1945, 1893, 2004, 2855, 1945, 1968, 2855, 2178,
-
-     2855, 1968, 2008, 1978, 1569, 1569, 2008,  443,  446,  443,
-     1354, 1361, 1387,  446, 2855,  443, 1935,  443,  446, 2156,
-     1980, 2855, 1937,  443, 1450,  443, 2855, 2855, 2855,  443,
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443,  443,  443, 1415,  443,  443,  443, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,  443,  443,
-     1114, 1115, 1114, 1114, 1114, 1116, 1117, 1114, 1117, 1114,
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-     1114, 1114, 1118, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-
-     1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-     1114, 1114, 1114, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
-     1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
-     1117, 1117, 1119, 1119, 1119, 1119, 1119, 1119, 1120, 1120,
-     1120, 1121, 1117, 1117, 1444, 1131, 1444, 1444, 1444, 1132,
-     1445, 1444, 1445, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
-     1444, 1444, 1444, 1444, 1444, 1444, 1446, 1133, 1444, 1444,
-     1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
-     1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
-     1444, 1444, 1444, 1444, 1444, 1444, 1444, 1445, 1445, 1445,
-
-     1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445,
-     1445, 1445, 1445, 1445, 1445, 1445, 1447, 1447, 1447, 1447,
-     1447, 1447, 1448, 1448, 1448, 1449, 1445, 1445, 1451, 1452,
-     1451, 1451, 1451, 1453, 1454, 1451, 1454, 1451, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1455,  443, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1451, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
-     1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
-
-     1456, 1456, 1456, 1456, 1456, 1456, 1457, 1457, 1457, 1458,
-     1454, 1454, 1580, 1581, 1580, 1580, 1580, 1582, 1583, 1580,
-     1583, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1584, 1585, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1583, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 1586, 1586, 1586, 1586, 1586, 1586,
-     1587, 1587, 1587, 1588, 1583, 1583,  444,  444, 2855, 2855,
-
-      445,  445,  444, 1082, 2197, 2279,  445, 1083, 2198, 2280,
-     2855, 2855, 2855,  710, 2855, 2005, 1700,  446, 1620, 2005,
-     1701, 2855, 1943, 2855, 2199,  443, 1585, 1361, 1960,  710,
-      443,  443, 1960,  443, 1625, 2855, 1941, 1432,  443,  443,
-     1660,  443, 2855,  730,  443, 1939,  443,  443, 2855,  446,
-     2855, 2855,  443, 2855, 2855, 2855, 2190, 2855, 2200,  730,
-      443, 2023, 2198, 2855, 2170, 2023, 2855,  447,  447,  447,
-      447,  447,  447,  448,  448,  448,  449, 1661, 2201, 1584,
-     1590, 1662,  446, 1621, 1621, 1621, 1621, 1621, 1621, 1622,
-     1622, 1622, 1623, 1028, 2855, 2855, 2855, 2855,  446, 1626,
-
-     1626, 1626, 1626, 1626, 1626, 1627, 1627, 1627, 1628, 1033,
-     2855, 2855, 2855, 1029, 1029, 1029, 1029, 1029, 1029, 1030,
-     1030, 1030, 1031, 1896, 2189, 2855, 2855, 1896, 2004, 1034,
-     1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1036, 2855,
-     2111, 2111, 2855, 2855,  446, 2112, 1387, 2855,  447,  447,
-      447,  447,  447,  447,  448,  448,  448,  449, 1339, 1340,
-     1339, 1339, 1339, 1068, 1341, 1339, 1341, 1339, 1339, 1339,
-     1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-     1342, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-     1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-
-     1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
-     1339, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
-     1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
-     1343, 1343, 1343, 1343, 1343, 1343, 1344, 1344, 1344, 1345,
-     1341, 1341, 2855, 1944, 2855,  444,  443, 1945,  443,  445,
-     2005, 2855, 2014, 2855, 2005, 2030, 2014, 2855, 2342, 2030,
-     2798, 2051, 2342, 2855, 2798, 2051, 2855, 1431, 1431, 1569,
-     1569,  443, 1432,  443, 1570, 2034,  446, 2717, 2717,  443,
-     2112,  443,  446, 2053, 2855, 2855, 2855,  443, 1946,  443,
-     2855, 2855, 2855,  443,  443,  443,  443,  443,  443,  443,
-
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855,  443,  443, 1349, 1350, 1349, 1349, 1349, 1351,
-     1352, 1349, 1352, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1353, 1354, 1355, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1352, 1352, 1352,
-     1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352,
-     1352, 1352, 1352, 1352, 1352, 1352, 1356, 1356, 1356, 1356,
-
-     1356, 1356, 1357, 1357, 1357, 1358, 1352, 1352, 1379, 1380,
-     1379, 1379, 1379, 1086, 1381, 1379, 1381, 1379, 1379, 1379,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379,
-     1382, 1087, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379,
-     1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379,
-     1379, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381,
-     1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381,
-     1383, 1383, 1383, 1383, 1383, 1383, 1384, 1384, 1384, 1385,
-     1381, 1381, 1388, 1389, 1388, 1388, 1388, 1390, 1391, 1388,
-
-     1391, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1388, 1392,  443, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388,
-     1388, 1388, 1388, 1388, 1388, 1391, 1391, 1391, 1391, 1391,
-     1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391, 1391,
-     1391, 1391, 1391, 1391, 1393, 1393, 1393, 1393, 1393, 1393,
-     1394, 1394, 1394, 1395, 1391, 1391, 1396, 1397, 1396, 1396,
-     1396, 1398, 1399, 1396, 1399, 1396, 1396, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1400, 1401, 1396,
-
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396,
-     1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1399,
-     1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399,
-     1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1402, 1402,
-     1402, 1402, 1402, 1402, 1403, 1403, 1403, 1404, 1399, 1399,
-     1706, 1707, 1706, 1706, 1706, 1414, 1708, 1706, 1708, 1706,
-     1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706,
-     1706, 1706, 1709, 1706, 1706, 1706, 1706, 1706, 1706, 1706,
-     1706, 1706, 1706, 1706, 1706, 1706, 1710, 1706, 1706, 1706,
-
-     1706, 1706, 1706, 1706, 1706, 1706, 1706, 1711, 1706, 1706,
-     1706, 1706, 1706, 1708, 1708, 1708, 1708, 1708, 1708, 1708,
-     1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708,
-     1708, 1708, 1712, 1712, 1712, 1712, 1712, 1712, 1713, 1713,
-     1713, 1714, 1708, 1708, 1451, 1452, 1451, 1451, 1451, 1453,
-     1454, 1451, 1454, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1455,  443, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451,
-     1451, 1451, 1451, 1451, 1451, 1451, 1451, 1454, 1454, 1454,
-
-     1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
-     1454, 1454, 1454, 1454, 1454, 1454, 1456, 1456, 1456, 1456,
-     1456, 1456, 1457, 1457, 1457, 1458, 1454, 1454, 1832, 1833,
-     1832, 1832, 1832, 1531, 1834, 1832, 1834, 1832, 1832, 1832,
-     1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
-     1835, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
-     1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
-     1832, 1832, 1832, 1832, 1836, 1832, 1832, 1832, 1832, 1832,
-     1832, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
-     1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
-
-     1837, 1837, 1837, 1837, 1837, 1837, 1838, 1838, 1838, 1839,
-     1834, 1834, 1580, 1581, 1580, 1580, 1580, 1582, 1583, 1580,
-     1583, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1584, 1585, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1583, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 1586, 1586, 1586, 1586, 1586, 1586,
-     1587, 1587, 1587, 1588, 1583, 1583,  730,  444,  444,  444,
-
-     2855,  445,  445,  445,  444, 2855,  730, 2056,  445, 2228,
-     2855,  445, 2855, 2060, 2855, 2855,  444, 1719, 2114, 2855,
-      445, 1720, 2114, 1947, 2855,  443,  443,  443, 2057, 2855,
-     1835, 1948,  443,  443,  443,  443,  730,  500, 2855,  446,
-      443,  443,  443,  443,  443,  443, 1038,  730,  443, 2855,
-     2855, 2855,  443,  443, 1952, 2855, 1028, 2855, 2855, 1951,
-      443,  443, 2855, 2855, 2855, 2855, 1039, 1039, 1039, 1039,
-     1039, 1039, 1040, 1040, 1040, 1041, 1029, 1029, 1029, 1029,
-     1029, 1029, 1030, 1030, 1030, 1031, 1028,  730, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2211, 1299,  730, 1719,
-
-     2211, 2855, 2855, 1720, 2855, 2855, 1029, 1029, 1029, 1029,
-     1029, 1029, 1030, 1030, 1030, 1031, 1792, 1300, 1300, 1300,
-     1300, 1300, 1300, 1301, 1301, 1301, 1302,  443,  730, 2115,
-     2855, 2855, 2133, 1899, 2212,  443, 2133, 1304,  730, 2855,
-     2855, 2855, 2855,  443, 2855, 2014, 2855, 2855, 1309, 2014,
-     1584, 2855, 2291, 2136, 2855, 2855, 2855, 1305, 1305, 1305,
-     1305, 1305, 1305, 1306, 1306, 1306, 1307, 1570, 1310, 1310,
-     1310, 1310, 1310, 1310, 1311, 1311, 1311, 1312, 1314,  730,
-     2855, 2855, 2855, 2855, 2855, 2855, 2195, 2855, 1314,  730,
-      444, 2855,  444, 2855,  445, 2855,  445, 2855, 1315, 1315,
-
-     1315, 1315, 1315, 1315, 1316, 1316, 1316, 1317, 1315, 1315,
-     1315, 1315, 1315, 1315, 1316, 1316, 1316, 1317,  443,  730,
-      443, 1954, 2855, 2160, 2855, 2855,  443, 2160,  443, 1320,
-      730, 2855, 2855, 1955,  443, 2855,  443, 2855, 2855, 1325,
-     2855, 2855, 2855, 1102,  446, 2855, 2855, 1103, 2855, 1321,
-     1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322, 1323, 1326,
-     1326, 1326, 1326, 1326, 1326, 1327, 1327, 1327, 1328, 1330,
-      730,  443, 2855, 2855, 2855, 2855, 2855, 2855, 2855,  443,
-     1028,  730, 1726, 2855, 2855, 2855, 1727,  443, 2855, 1331,
-     1331, 1331, 1331, 1331, 1331, 1332, 1332, 1332, 1333, 2855,
-
-     1029, 1029, 1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031,
-      443,  730, 2178, 2223, 2855, 2855, 1978, 2223,  443, 1957,
-     1028,  730, 2855, 2855, 2855, 2855,  443, 2855, 2279, 2855,
-     2855, 1299, 2280, 1980,  446, 2855, 2855, 2855, 2855, 2855,
-     1029, 1029, 1029, 1029, 1029, 1029, 1030, 1030, 1030, 1031,
-     1361, 1300, 1300, 1300, 1300, 1300, 1300, 1301, 1301, 1301,
-     1302, 1304,  730, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 1309,  730, 1959, 2855, 1730, 2855, 1960, 2855, 1731,
-     2855, 1305, 1305, 1305, 1305, 1305, 1305, 1306, 1306, 1306,
-     1307, 1310, 1310, 1310, 1310, 1310, 1310, 1311, 1311, 1311,
-
-     1312,  443,  730,  443, 2228, 2855, 2241, 2855, 2060,  443,
-     2241,  443, 1299,  730, 2855, 2855, 2855,  443, 2855,  443,
-     2855, 2855, 1299, 2855, 2855, 1835,  444,  446, 2855, 2855,
-      445, 2855, 1300, 1300, 1300, 1300, 1300, 1300, 1301, 1301,
-     1301, 1302, 1300, 1300, 1300, 1300, 1300, 1300, 1301, 1301,
-     1301, 1302, 1630,  730,  443, 1962, 2855, 2855, 2855, 2855,
-     2855, 2855,  443, 1635,  730, 1733, 2855, 2855, 2855, 1734,
-      443, 2855, 1631, 1631, 1631, 1631, 1631, 1631, 1632, 1632,
-     1632, 1633, 2855, 1636, 1636, 1636, 1636, 1636, 1636, 1637,
-     1637, 1637, 1638, 1735,  730, 2197, 2855, 2855, 2200, 2198,
-
-     2855,  443, 2198, 1640,  730, 2855, 2855, 1736, 2855,  443,
-     2855, 2855, 2244, 2855, 1320, 2199, 2244, 1585, 2201, 1584,
-     1590, 2855, 2855, 1641, 1641, 1641, 1641, 1641, 1641, 1642,
-     1642, 1642, 1643,  446, 1321, 1321, 1321, 1321, 1321, 1321,
-     1322, 1322, 1322, 1323, 1320,  730, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 1645,  730,  444, 2855,  444, 2855,
-      445, 2855,  445, 2855, 1321, 1321, 1321, 1321, 1321, 1321,
-     1322, 1322, 1322, 1323, 1646, 1646, 1646, 1646, 1646, 1646,
-     1647, 1647, 1647, 1648,  443, 1963,  443, 2292, 2855, 2279,
-     2855, 2293,  443, 2280,  443, 1650, 2855, 2855, 2855, 2855,
-
-      443, 1964,  443, 2855, 2855, 1655, 2855, 2131, 2855, 1967,
-     2855, 1361, 2855, 1968, 2855, 1651, 1651, 1651, 1651, 1651,
-     1651, 1652, 1652, 1652, 1653, 1656, 1656, 1656, 1656, 1656,
-     1656, 1657, 1657, 1657, 1658,  444,  444,  443,  444,  445,
-      445, 2855,  445, 1110, 2855,  443, 2855, 1111,  444, 2855,
-     1746, 2855,  445,  443, 1747, 1746,  446, 2855, 2855, 1747,
-     2855,  879, 2855, 2855,  443, 1112,  443, 2855, 2855, 2855,
-     2855,  443,  443, 1908,  443, 2855,  443, 2855,  443,  443,
-      443, 1971,  443,  443,  443, 1969,  443,  443, 2855, 1970,
-     2855,  443,  443, 2855,  443, 2855,  444, 1973, 1128,  443,
-
-      445, 2855, 1129, 2855, 2855, 2855,  447,  447,  447,  447,
-      447,  447,  448,  448,  448,  449, 1661, 2855,  444, 1754,
-     1662, 1754,  445, 1755,  443, 1755,  443, 2855, 2855, 2293,
-     2855,  897,  443, 2293,  443,  898, 2855,  446, 2855, 1974,
-      443, 1756,  443, 1756, 1909, 2855,  443,  443, 2855,  443,
-     2136, 2855, 1910, 2855,  443,  443, 2855,  443, 2855,  443,
-     1911, 2855,  443,  443, 2200,  443, 2855,  443, 2198, 2855,
-     2855, 2855, 2855, 2855, 2855, 1993, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2201, 1584, 1590,  447,  447,  447,
-      447,  447,  447,  448,  448,  448,  449, 1349, 1665, 1349,
-
-     1349, 1349, 1666, 1352, 1349, 1352, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1354,
-      443, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
-     1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352,
-     1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1356,
-     1356, 1356, 1356, 1356, 1356, 1357, 1357, 1357, 1358, 1352,
-     1352, 1706, 1707, 1706, 1706, 1706, 1414, 1708, 1706, 1708,
-     1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706,
-
-     1706, 1706, 1706, 1709, 1706, 1706, 1706, 1706, 1706, 1706,
-     1706, 1706, 1706, 1706, 1706, 1706, 1706, 1710, 1706, 1706,
-     1706, 1706, 1706, 1706, 1706, 1706, 1706, 1706, 1711, 1706,
-     1706, 1706, 1706, 1706, 1708, 1708, 1708, 1708, 1708, 1708,
-     1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708,
-     1708, 1708, 1708, 1712, 1712, 1712, 1712, 1712, 1712, 1713,
-     1713, 1713, 1714, 1708, 1708, 2855,  444, 2855,  444,  443,
-      445,  443,  445, 2855, 2855, 2211, 2855, 2855, 2537, 2211,
-     2855, 2342, 2537, 2855, 2392, 2342, 2490, 2855, 2392, 2855,
-     2490, 1994, 2855, 2005,  443, 1792,  443, 2005, 2111, 2111,
-
-     1220, 2855,  443, 2112,  443,  446, 1697, 2855, 2855, 2855,
-      443, 1996,  443, 2855, 2484, 1432,  443,  443,  443,  443,
-      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  443,  443,  443,  443, 2855, 2855, 2855, 2855, 2436,
-     2855, 2855, 2855, 2855, 2855,  443,  443, 1976, 1977, 1976,
-     1976, 1976, 1978, 1979, 1976, 1979, 1976, 1976, 1976, 1976,
-     1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1980,
-      443, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976,
-     1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976,
-     1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976,
-
-     1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979,
-     1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1979, 1981,
-     1981, 1981, 1981, 1981, 1981, 1982, 1982, 1982, 1983, 1979,
-     1979, 1986, 1979,  444, 2855, 1987, 1976,  445, 1976, 2421,
-     2855, 2411, 2423, 2421, 2531, 2411, 2423, 2458, 2531, 2855,
-     2566, 2458, 1976, 2490, 2567, 2531, 2855, 2490, 2855, 2531,
-      446,  443,  446,  446, 2291, 2855, 1997, 2855,  446,  443,
-     2855, 2500, 1590, 1697, 2855, 2291, 2510,  443, 2855, 2855,
-     2855, 2855, 2855, 1976, 1976, 1976, 1976, 1976, 1976, 1976,
-     1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976,
-
-     1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976, 1976,
-     1976, 1976, 1976, 1976, 1110, 2855,  444, 2855, 1111,  444,
-      445,  444, 2855,  445, 2537,  445, 2014, 2855, 2537, 2855,
-     2014, 1793, 2855, 2018, 2566, 1794, 1112, 2019, 2567, 2855,
-     2855, 2855,  443, 1998,  443, 1999, 1220,  443, 1570,  443,
-      443, 2855,  443, 1488, 2855, 2000, 1590,  443,  443,  443,
-      443,  443, 1199,  443, 1242,  443,  444,  443, 1243,  443,
-      445, 2855, 2440, 2855, 2855,  443,  444,  443, 2022, 1802,
-      445, 2855, 2023, 1803, 2855, 2029, 1244, 2855, 2855, 2030,
-     2855, 2027,  443, 2001,  443, 2855, 2855,  444, 2855,  444,
-
-      443,  445,  443,  445,  443, 1073,  443,  443,  443, 2020,
-      443, 2024,  443,  443,  443,  443, 2855, 2855, 2855, 2855,
-      443,  443,  443,  443,  444,  443, 1185,  443,  445,  443,
-     1186, 2855, 2855,  443, 2032,  443, 2855, 2855,  444, 2855,
-     2031,  443,  445,  443, 1188, 2855, 2855,  444, 1189,  444,
-     2855,  445,  443,  445,  443, 2043, 2855, 2855, 2855, 2855,
-      443,  444,  443, 2044, 2855,  445,  443, 2041,  443, 2855,
-      443, 2855,  443, 2855,  443,  443, 2046,  443, 2855, 2855,
-      443, 2855,  443,  443, 2855,  443, 2050, 2855,  443,  443,
-     2051,  443, 2047,  443, 2158,  444,  444,  443, 2158,  445,
-
-      445, 2855, 2855, 2855, 2054,  443, 2515, 2535, 2052, 2855,
-     2515, 2535, 2566, 2725,  443,  446, 2567, 2725, 2855, 2310,
-     2855, 2855,  443,  443,  443, 2855, 2855,  446,  446, 1220,
-      443,  443,  443, 2855, 1590, 2053, 2855, 2058, 2311,  443,
-      443, 1832, 1833, 1832, 1832, 1832, 1531, 1834, 1832, 1834,
-     1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
-     1832, 1832, 1832, 1835, 1832, 1832, 1832, 1832, 1832, 1832,
-     1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
-     1832, 1832, 1832, 1832, 1832, 1832, 1832, 1836, 1832, 1832,
-     1832, 1832, 1832, 1832, 1834, 1834, 1834, 1834, 1834, 1834,
-
-     1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
-     1834, 1834, 1834, 1837, 1837, 1837, 1837, 1837, 1837, 1838,
-     1838, 1838, 1839, 1834, 1834, 2059, 2855,  444, 1201, 2060,
-     1845,  445, 1202, 2855, 1846, 2855, 2855,  444, 2005, 2775,
-      444,  445, 2005, 2775,  445, 2855, 2855,  444, 2855, 2855,
-     2061,  445, 2855,  443, 2855,  443,  443, 2066,  443, 2672,
-     1432,  443, 2855,  443,  443,  443,  443, 2067,  443,  443,
-     2064,  443,  443,  443,  443,  443,  443, 2855, 1213, 2590,
-     2855, 2069, 1214,  443,  443,  444, 2070, 2855,  444,  445,
-      444,  443,  445, 2855,  445,  444, 2855, 1222, 2855,  445,
-
-     2073, 1223, 2855, 2855, 2855, 2014,  443,  937,  444, 2014,
-     2855,  938,  445,  443,  443, 2005,  443, 2855,  443, 2005,
-     2075,  443,  443,  443,  443,  443,  443, 1570, 2855,  443,
-     2074, 2076,  443,  443,  443,  443,  443, 1432,  444,  443,
-     2079,  443,  445,  443,  443,  444, 2596, 2855, 2080,  445,
-      444,  443,  443, 2521,  445,  444,  444, 2762, 2014,  445,
-      445, 2762, 2014, 2855, 2855, 2005,  443,  444, 2005, 2005,
-     2855,  445, 2005, 2082,  443, 2855, 2855, 2855,  443, 2763,
-     1570,  443, 2081,  443,  443, 2086,  443, 1432, 2083,  443,
-     1432,  443,  443, 2084,  443,  443, 2527, 1877,  444, 2085,
-
-      443, 1878,  445,  443, 2087, 2855, 2088, 2710,  444, 1234,
-     2519,  443,  445, 1235, 2519,  444, 2855,  445, 2564,  445,
-      444,  445, 2564, 2855,  445,  443,  443, 2101, 2855, 2855,
-     2855,  446, 2855,  443,  443, 2099,  443,  443,  446,  446,
-     2855,  443,  443,  443,  443,  443, 2102, 2589,  443, 2107,
-     1886,  443,  443,  443, 1887, 2629,  443, 1242, 2103,  443,
-     2855, 1243,  444, 2855,  443, 2014,  445, 1568, 1568, 2014,
-     2855, 2855, 2855, 2855, 2855, 2855, 2113, 2775,  443, 1244,
-     2114, 2775, 2855, 2855, 2855,  443,  443, 1570,  444, 2855,
-      443, 1895,  445,  443,  443, 1896, 2706, 2672,  443, 2105,
-
-     2706,  443, 2855, 2106,  443, 2109,  443, 2715, 2110, 2110,
-     2608, 2014,  443, 1897, 2608, 2014,  443,  446, 2855,  443,
-      443, 2855, 2855, 2116,  443, 2855, 2855,  443, 2855, 2855,
-     2672,  446,  443, 1570, 2855,  443, 1580, 1898, 1580, 1580,
-     1580, 1899, 1583, 1580, 1583, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1584,  443,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580,
-     1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1583,
-     1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583,
-
-     1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1586, 1586,
-     1586, 1586, 1586, 1586, 1587, 1587, 1587, 1588, 1583, 1583,
-      444, 2855,  975,  444,  445,  444,  976,  445, 2674,  445,
-     2855, 2706, 2674, 2855, 2749, 2706, 2855,  444, 2749, 2398,
-     2725,  445,  444, 2398, 2725, 2855,  445, 2855,  443,  446,
-      443,  443,  446,  443, 2855,  446,  443, 2119,  443,  443,
-      446,  443, 2053, 2121,  443,  443,  443, 2120, 1067,  443,
-      443,  502, 1068,  443, 2855,  444, 2122, 2855,  443,  445,
-      444,  443, 2855, 2489,  445, 2791,  443,  444, 2659, 2792,
-     2855,  445, 2659, 2769, 2855, 2855,  443, 2769, 2005, 2855,
-
-     2855, 2855, 2005,  443,  443, 2717, 2717, 2753,  443,  446,
-     2855,  443,  443, 2127,  446,  443,  443, 2126, 2855,  443,
-     1432, 2855, 2855,  443,  443, 2855, 2651, 2855, 2855, 2855,
-     2129,  443, 2131, 2132, 2131, 2131, 2131, 2133, 2134, 2131,
-     2134, 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
-     2131, 2131, 2131, 2135, 2136, 2131, 2131, 2131, 2131, 2131,
-     2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
-     2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131, 2131,
-     2131, 2131, 2131, 2131, 2131, 2134, 2134, 2134, 2134, 2134,
-     2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134,
-
-     2134, 2134, 2134, 2134, 2137, 2137, 2137, 2137, 2137, 2137,
-     2138, 2138, 2138, 2139, 2134, 2134,  444, 1675,  444, 2762,
-      445, 1676,  445, 2762, 2855, 2855, 2855, 1678, 2791,  444,
-     2789, 1679, 2792,  445, 2789, 2855, 1681, 2855,  444, 1371,
-     1682, 2763,  445, 1372,  443,  443,  443, 2142, 2855, 2140,
-     2753,  446,  443,  443,  443,  443, 2144,  443, 2145, 2855,
-      443,  443,  443,  443,  443,  443,  443,  443, 2855, 2855,
-     2855,  443,  443,  443,  443,  443, 2149, 2855, 2855, 2855,
-      443, 2147,  443,  443,  444, 2855, 1687,  444,  445,  444,
-     1688,  445, 2799,  445, 2855, 2855, 2799, 2855, 1082, 2014,
-
-     2855,  444, 1083, 2014, 2855,  445, 2855, 2855, 2855, 2719,
-     2719, 2855,  443, 2150,  443,  443, 2855,  443, 2855, 2855,
-      443, 1570,  443,  443, 2152,  443,  443, 2657,  443,  443,
-      443,  443, 1944,  443,  443, 2153, 1945,  443, 2855, 2157,
-     2855, 2855,  443, 2158, 2154,  443, 2159, 2855, 2855,  444,
-     2160,  444,  444,  445, 2855,  445,  445, 2792,  444, 2155,
-      443, 2792,  445, 2855, 2855, 2855, 2855,  443,  443, 2855,
-     2855, 2855, 2855, 2855,  443,  443,  443,  443, 2757,  443,
-      443, 2164,  443,  443,  857,  443,  443,  443,  443, 2855,
-      443, 2855, 2855,  443,  443,  443,  443,  444, 2161,  444,
-
-     2855,  445,  443,  445, 1959, 2855,  444, 2855, 1960,  444,
-      445, 2855, 2800,  445, 2855, 2855, 2800, 2855, 1967,  444,
-     2855, 2855, 1968,  445, 2166,  443, 2855,  443, 2167, 2721,
-     2721, 2855,  443,  443,  443,  443, 2855,  443, 2855, 2171,
-     2169,  443,  443,  443, 2172,  443,  443,  443,  443, 2855,
-      443, 2855,  444,  443,  443,  443,  445, 2855, 2855, 2855,
-     2855, 1110,  443,  443,  444, 1111,  444, 2855,  445, 2855,
-      445, 2855, 2855,  444, 2855,  444, 2855,  445,  897,  445,
-      443, 2855,  898, 1112, 2855, 2175, 2855,  444,  443,  443,
-     2855,  445,  443, 2855,  443, 2177,  443,  443, 2855, 2176,
-
-      443,  443,  443,  443, 2855,  443,  443, 2855,  443,  443,
-      443,  443,  444, 2855,  443,  443,  445,  443, 2855,  443,
-     2179,  444,  443,  443, 2855,  445, 2855, 2855, 2182, 2855,
-     2855,  443, 1110,  444,  444, 2855, 1111,  445,  445, 2180,
-      443, 2855, 2855,  444, 2855, 2855, 2022,  445,  443,  443,
-     2023, 2855, 2855, 2855, 1112, 2855,  443,  443, 2183, 2185,
-      443,  443,  443, 1242, 2855,  443, 2855, 1243,  443,  443,
-      443,  443, 2855, 2184,  443, 2855,  443,  443,  443,  443,
-     2022, 2855,  443, 2855, 2023, 1244, 2855,  443, 2855, 2855,
-      443,  443,  444, 2029, 2855, 2855,  445, 2030,  444,  443,
-
-     2855, 2855,  445, 2855, 2186, 1486, 2855,  443,  443, 1487,
-     2855, 2855, 2855, 1073, 2855, 2855,  443, 2202,  444, 1185,
-      443,  443,  445, 1186,  443, 1488,  443, 2204,  443,  443,
-     2855,  444, 2855,  443,  443,  445, 2205,  443, 2206, 2207,
-      444,  443,  443, 2208,  445, 2855,  443,  443, 2855,  443,
-     2855, 2855,  444, 2855,  443,  443,  445, 2050, 2216,  443,
-     2724, 2051,  443,  443, 2724, 2855, 2855,  443,  443, 2222,
-     2218, 2855, 2855, 2223,  444,  443,  443, 2219,  445, 2052,
-      443,  446, 2053,  444,  443,  443, 2855,  445,  443, 2855,
-     2855, 2855, 2855,  443, 2059,  444,  443,  443, 2060,  445,
-
-     1201,  443,  443, 2855, 1202,  443, 2855, 2225, 2855, 2855,
-      443,  443,  444,  443, 2855, 2855,  445,  444,  443,  443,
-     2855,  445,  443,  443, 2855, 2855, 2226,  443,  443,  444,
-      443,  443, 2855,  445, 2855, 2229,  443, 2855,  443,  443,
-      443, 2232,  444,  444,  443,  443,  445,  445,  443, 2855,
-     2855, 2855, 2855,  443, 2243, 2240,  443,  443, 2244, 2241,
-     2234,  443, 2855, 2855, 1222,  443, 2855, 2855, 1223, 2855,
-      443,  443, 2855, 2235, 2855, 2855, 2239,  444,  443,  443,
-     2245,  445,  443,  443, 2855, 2238,  443,  443, 2242,  444,
-      443,  443,  443,  445, 2855, 2855, 2855, 2855,  443,  443,
-
-      443, 2855,  444, 2855, 2855,  443,  445,  444, 2250, 2855,
-     2855,  445,  444,  443,  444, 2855,  445,  443,  445,  444,
-     2855, 2251, 2855,  445,  444,  443, 2252, 2855,  445, 2855,
-      443, 2253, 2855,  443, 2855,  443, 2855,  444,  443, 2258,
-      443,  445,  443,  443, 2855, 2855,  443,  443,  443, 2255,
-      443,  443,  443, 2254, 2256,  443,  443,  444,  443, 2855,
-      443,  445,  444,  443, 2257,  443,  445, 1234,  443, 2855,
-     2855, 1235, 2855,  443,  444, 2855, 2259, 2855,  445,  444,
-     2855,  443, 2855,  445, 2855,  443, 2855, 2855,  444, 2855,
-     2271, 2269,  445,  443, 2855,  443, 2272, 2855,  443, 2855,
-
-     1242,  443,  443,  443, 1243,  444,  443,  443, 2855,  445,
-      443,  443, 2273, 2855, 2855,  443,  443, 2855,  443, 2855,
-     2855, 2855, 1244,  443,  443, 2855, 2855, 2855,  443, 2855,
-      444, 2275,  443,  443,  445, 2113,  443, 2855, 2274, 2114,
-     2855,  443,  444, 2855,  443, 2855,  445, 2110, 2110,  443,
-     2855, 2855, 2855, 1962, 2855,  975,  444,  444,  443,  976,
-      445,  445, 2855,  443, 2855, 2855,  443, 2855, 2724, 2855,
-      443,  443, 2724, 2755,  443, 2855, 2855, 2755,  443,  443,
-     2278, 2855, 2855,  443,  443,  443,  443, 2855, 2855,  446,
-     2053,  443,  443,  443, 2757, 2763, 2855, 2855, 2283, 2282,
-
-      443,  443, 2855,  868,  957,  958,  957,  957,  957,  959,
-      960,  957,  960,  957,  957,  957,  957,  957,  957,  957,
-      957,  957,  957,  957,  957,  961,  962,  957,  957,  957,
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
-      957,  957,  957,  957,  957,  957,  957,  960,  960,  960,
-      960,  960,  960,  960,  960,  960,  960,  960,  960,  960,
-      960,  960,  960,  960,  960,  960,  964,  964,  964,  964,
-      964,  964,  965,  965,  965,  966,  960,  960,  444,  444,
-      444,  444,  445,  445,  445,  445, 2855, 2855, 2855, 2855,
-
-     2855, 1678, 2855, 2855, 2855, 1679, 2855, 2855,  444, 2855,
-      444, 2855,  445, 2855,  445, 2289,  443,  443,  443,  443,
-     2855, 2855, 2855, 2855,  443,  443,  443,  443, 2855,  443,
-      857, 2287,  443,  443,  443,  443,  443,  443,  443, 2294,
-     2855, 2855, 2855,  444,  443,  443,  443,  445, 2855, 2855,
-     2855, 2855,  443, 2296,  443,  444, 1371, 2855, 2855,  445,
-     1372,  444, 1687, 2855, 2855,  445, 1688, 2855, 2855, 2855,
-     2855,  443, 2855,  444, 1082, 2855, 2855,  445, 1083,  443,
-     2855, 2300, 2855,  443,  443, 2855, 2298,  443, 2855,  443,
-     2303,  443,  443, 2855, 2855, 2855, 2855,  443,  443,  443,
-
-      443,  443,  443, 2855, 2301,  443,  443, 2304,  444, 2306,
-      443, 2855,  445, 2855, 2855, 2157, 2855,  443,  443, 2158,
-     2159,  444, 2855, 2855, 2160,  445,  444, 2855, 2855, 2855,
-      445, 2855, 2855, 2855, 2855,  444,  443, 2305,  444,  445,
-     2308, 2855,  445,  443,  443, 2855, 2855, 2855,  443,  443,
-     2312,  443,  443, 2855,  443, 2855,  443,  443, 2855, 2309,
-     2855, 2855,  443,  443,  443,  443,  443, 2855,  444, 2315,
-      443,  443,  445,  444,  443, 2855, 2855,  445, 2317,  443,
-      444, 2318,  443,  444,  445, 1122,  897,  445, 2855, 1123,
-      898, 2855, 2855, 2320, 2855, 2855,  443, 2855, 1110, 2855,
-
-     2855,  443, 1111, 2855,  443, 2855, 2322, 2323,  443,  443,
-     2855, 2326,  443,  443,  443, 2855,  443,  443, 2855,  443,
-     1112,  443,  443, 2855,  443, 2855,  443,  443,  444,  443,
-      443,  444,  445,  444,  443,  445, 2855,  445, 2855, 2327,
-      444, 2855,  443,  444,  445, 1793, 2855,  445, 2855, 1794,
-     1886, 2855, 2855, 2855, 1887, 2332,  443, 2855, 2855,  443,
-     2331,  443, 2328, 2855,  443, 2333, 2330,  443,  443,  443,
-     2022,  443,  443,  443, 2023,  443,  443,  443,  443,  443,
-     2855,  443, 2855, 2855,  443, 2855,  443,  443,  444,  443,
-     2855,  444,  445,  444,  443,  445, 2855,  445,  443, 2343,
-
-      444, 2855, 2855, 2855,  445, 2855,  443, 2855, 2855, 2855,
-     2855,  444, 2855, 2855,  443,  445,  443, 2855, 1486,  443,
-     2855,  443, 1487, 2855,  443, 2855, 2345,  443,  443,  443,
-     2346, 2347,  443, 2348, 2855,  443,  443,  443, 1488,  443,
-     2855, 2855, 2855, 2855,  443, 2353,  443,  443,  444, 2349,
-     2855, 2855,  445, 2855,  443,  443, 2855, 2222, 2855,  444,
-      444, 2223,  443,  445,  445, 2855,  444, 2855, 2855,  444,
-      445, 2855, 2855,  445, 2855, 2360,  443, 2855, 2059,  444,
-     2855, 2355, 2060,  445,  443,  443, 2356,  443,  443, 2855,
-     2855, 2359,  443,  443,  443,  443,  443,  443, 2855, 2855,
-
-     2855,  443,  443,  443,  443,  443,  443,  443, 2855, 2855,
-      443, 2361, 2363,  443,  443,  443,  444,  444, 2855, 2855,
-      445,  445,  443,  443, 2855, 2855,  444, 2240, 2240, 2855,
-      445, 2241, 2241, 2855, 2855, 2855, 2855, 2855, 2243, 2855,
-     2855, 2855, 2244, 2855,  443,  443, 2367, 2855, 2855, 2855,
-     2855, 2855,  443,  443,  443,  443,  443, 2855, 2855, 2365,
-      443,  443,  443,  443,  443, 2369,  443, 2855, 2855, 2243,
-      443,  443,  443, 2244,  443, 2368, 1222, 2855, 2855, 2855,
-     1223,  444,  443, 2855, 2855,  445, 2855, 2855,  444, 2855,
-      444, 2855,  445, 2855,  445, 2855, 2855,  443, 2855, 2855,
-
-     2855, 2855,  444, 2855,  443,  443,  445, 2370, 2855,  443,
-     2855, 2855,  443,  443, 2374, 2375,  443,  443,  443, 2373,
-      443, 2855, 2855, 2855,  443,  443,  443, 2376, 2855,  444,
-      443, 2377,  443,  445,  443,  444,  444, 2855,  443,  445,
-      445,  444, 2855, 2855, 2378,  445,  443,  444, 2855, 2855,
-      444,  445, 2855, 2855,  445, 2855, 2391,  443, 2855, 2855,
-     2392, 2855, 1234,  443,  443,  443, 1235, 2855, 2855,  443,
-      947,  443,  443,  443, 2855,  443, 2381, 2380,  443,  443,
-     2379, 2855, 2855,  443,  443,  443,  443, 2855, 2855,  444,
-      443,  443,  443,  445,  443, 2855, 2855, 2855,  443, 1242,
-
-      443,  444, 2855, 1243, 2855,  445,  443, 2855,  444, 2855,
-     2855, 2855,  445, 2855,  975, 2855, 2855, 2393,  976, 2397,
-     2855, 1244, 2855, 2398, 2855,  443,  444,  443, 2855,  443,
-      445, 2855, 2855,  443, 2855,  443,  443,  443, 2855,  971,
-     2394, 2855,  443,  443,  443,  443, 2855,  443, 2855,  444,
-      443, 2401,  443,  445,  443,  443, 2396, 2855,  443, 2855,
-      444,  444,  443,  443,  445,  445, 2855,  444, 2855, 2855,
-      443,  445, 2855, 2855, 1371, 2855, 2402,  443, 1372,  444,
-     1687, 2855, 2855,  445, 1688,  443, 1082, 2855,  443,  443,
-     1083, 2855, 2855,  443, 2855,  443, 2405,  443, 2855, 2855,
-
-     2855, 2855,  443,  443,  443,  443, 2855,  443,  443, 2410,
-      443,  443, 2855, 2411,  443,  443,  443, 2407,  443, 2855,
-     2855,  444,  443,  443, 2408,  445, 2855,  444, 2855, 2855,
-      443,  445,  444, 2855, 1095, 2409,  445,  443, 1096,  444,
-     2855, 2855, 2855,  445, 2420,  443, 2412, 2855, 2421,  443,
-     2855, 2855, 2855,  443, 2422,  443, 2855,  443, 2423, 2855,
-      443, 2855,  443, 2414, 2855,  443, 2855,  443,  443, 2415,
-      443,  443,  443,  444, 2855,  443,  443,  445,  443, 2855,
-      443, 2855,  443,  443, 2855,  444, 2855, 2855,  443,  445,
-      443,  444, 1110, 2855, 2855,  445, 1111, 2855,  443, 2855,
-
-     2425,  443,  444, 2855,  444, 2855,  445, 2855,  445,  443,
-     2855,  444, 2855,  443, 1112,  445, 2855,  443, 2855,  443,
-     2432,  443, 2427, 2855, 2855, 2428, 2855,  443,  443,  443,
-      443, 2431,  443,  444, 2855,  443,  443,  445,  443,  443,
-      443, 2855, 2855, 2855, 2855, 1110,  443,  443,  443, 1111,
-     1242, 2855, 2855, 2855, 1243,  443, 2022, 2855, 2433,  444,
-     2023, 1938,  444,  445, 2855, 2855,  445, 1112, 2855,  443,
-     2855,  444, 1244,  443, 2855,  445, 2855,  443,  443, 2855,
-     2855,  443, 2855, 2855, 2441, 2855,  443,  443, 2855,  443,
-      443, 1970,  443,  444,  443,  443, 2106,  445,  443,  443,
-
-      443, 2444, 2855,  443, 2855, 2443,  443,  443, 2855, 2855,
-     1486, 2855, 2445,  444, 1487,  443,  444,  445, 2855, 2855,
-      445,  443,  444, 2855, 2855, 2855,  445,  444, 2855,  443,
-     1488,  445, 2855, 2855, 2855, 2855, 2855,  443,  443,  444,
-     2446,  443, 2855,  445,  443, 2855,  443, 2855, 2855,  443,
-      443, 2855,  443, 2449,  443,  443, 2450,  443,  443, 2855,
-      443, 2059, 2453,  443, 2457, 2060,  443,  443, 2458, 2855,
-      444,  443, 2855,  444,  445,  443, 2855,  445, 2661, 2855,
-     2855, 2454, 2661,  443, 2855, 2855, 2455,  444, 2855,  443,
-     2240,  445,  443, 2855, 2241, 2719, 2719,  443,  443,  446,
-
-      443,  443, 2855, 2855, 2855,  443,  443, 2243,  443,  443,
-     2855, 2244, 2855, 2855,  443,  443, 2461,  443,  443, 2462,
-     2460, 1222, 2855,  443,  444, 1223,  443, 2855,  445, 2855,
-     2855,  443, 2855, 2855,  443,  443,  444, 2855, 2855, 2855,
-      445, 2855, 2463,  443, 2855, 2855, 2855, 2855, 2855,  443,
-     2466,  443,  443, 2855,  444,  444, 2855,  443,  445,  445,
-      443, 2855, 2855, 2855,  443,  443,  444, 2855,  443, 2467,
-      445, 2855,  443, 2855, 2855, 2855, 2855,  444, 2855, 2468,
-      443,  445,  443,  443, 2855, 2855, 2855, 2855,  444,  444,
-      443,  443,  445,  445,  443, 2855, 2470, 2469,  443,  443,
-
-      444, 2855,  443, 2471,  445,  443, 2472, 2391, 2855, 2855,
-      443, 2392, 2855,  443, 2473, 2855,  443,  443, 1242,  975,
-     2855,  443, 1243,  976,  443,  443, 2855, 2855,  443, 2485,
-     2474, 2855,  443,  443, 2855,  443,  443, 2483, 2397, 2855,
-     1244,  444, 2398,  443,  443,  445, 2486,  443, 2855, 2855,
-     2855,  443,  444,  444,  443,  443,  445,  445, 2855, 2855,
-     2855, 2855,  443,  443, 2855, 2855,  443, 2855, 2491,  443,
-     2855, 1371, 2855, 2855,  443, 1372, 2855,  443, 2494, 2855,
-      443,  443, 2488, 1687, 2855,  443, 2492, 1688,  443,  443,
-     2855, 2855, 2855, 2855, 1082, 2855,  443,  443, 1083,  443,
-
-     2496, 2410, 2855, 2855,  444, 2411, 2855,  443,  445, 2855,
-     2497,  443, 2855,  444, 2855,  443, 2420,  445, 2855,  443,
-     2421, 2855,  443, 2498, 2855, 2855, 2855,  443, 2855,  443,
-      443, 2499,  443, 2855, 2855, 2855, 2855,  443,  443, 2503,
-      443,  443,  444, 2855,  443,  443,  445, 2501,  443,  443,
-     2855, 2422,  443, 2509,  444, 2423, 2855,  443,  445, 2855,
-      443,  444, 2855, 2855, 2514,  445, 2855, 2504, 2515, 2855,
-      443, 2518, 2855, 2855, 2855, 2519,  444, 2855,  443,  443,
-      445, 1110,  443, 2513, 2855, 1111,  443,  443, 2855,  443,
-      443, 2855,  443, 2511, 2855,  443, 2855,  443,  443,  443,
-
-      443, 2855, 2022, 1112,  443,  443, 2023,  443,  443,  443,
-     2855, 2855,  443, 2855,  444,  443, 2855,  443,  445, 2855,
-      443, 2855, 2855, 2520,  444,  443, 2855,  444,  445, 2855,
-      443,  445, 2855,  444, 2855, 2855, 2855,  445,  443, 2855,
-     2855, 2855,  443, 2528, 2534,  444,  443,  444, 2535,  445,
-      443,  445,  443, 2529, 2855, 2530, 2855, 2855,  443, 2855,
-      443,  443, 2533,  443, 2855, 2855, 1219, 2855,  443,  443,
-     2059,  443,  443,  443, 2060,  443, 2855,  443, 2538, 2855,
-      443,  443, 2457,  443, 2855, 2855, 2458, 2855,  443,  443,
-     2539,  443, 2855,  444, 2855,  444, 2540,  445,  443,  445,
-
-     2855, 2855, 2855, 2855, 2240, 2243,  443, 1222, 2241, 2244,
-      443, 1223, 2855, 2855,  443, 2855, 2855, 2855,  443, 2855,
-     2855,  443, 2855,  443,  444, 2855,  443, 2855,  445,  443,
-      444,  443, 2543,  443,  445,  443, 2542,  443, 2855,  443,
-      443,  443,  444,  443, 2855, 2855,  445, 2855,  443,  443,
-     2855,  443,  443, 2855, 2855, 2545, 2855, 2546,  443,  444,
-      443,  444, 2855,  445, 2855,  445,  443, 2663,  443, 2855,
-      443, 2663, 2855,  444,  443, 2547, 2548,  445,  443,  444,
-     2855, 2855, 2855,  445, 2721, 2721,  443,  443,  446,  443,
-      444, 2855, 2855, 2855,  445,  443,  444,  443, 2855, 2855,
-
-      445,  443, 2563, 2549, 2855,  443, 2564,  443, 2855,  443,
-     2550, 2552, 2551, 2855, 2855,  443,  444,  443,  443, 2855,
-      445, 2855, 2855,  443,  443, 2561,  443, 1242, 2855,  444,
-      443, 1243,  443,  445,  443, 2855, 2855, 2855,  443,  444,
-      443, 2855, 2855,  445,  443, 2855,  443, 2855, 2855, 1244,
-     2570, 2855,  443, 2855,  444,  443, 2855,  443,  445, 2855,
-      443, 2855, 2855,  443, 2855,  443, 1371,  443, 2568, 2565,
-     1372,  443, 1687,  443, 2855,  443, 1688, 1082, 2855, 2855,
-     2855, 1083,  443,  443,  444, 2855, 2855, 2855,  445,  444,
-      443, 2855, 2855,  445,  443, 2855, 2855, 2855,  443,  444,
-
-      443, 2855,  443,  445, 2855,  443, 2855, 2855,  443, 2855,
-      443, 2855,  443,  443,  444, 2571,  443,  443,  445, 2572,
-      443,  443, 2855, 2855, 2855,  443, 2855,  443,  443, 2855,
-     2574, 2855, 2576,  443,  444,  443,  444,  444,  445, 2855,
-      445,  445,  443,  443, 2855, 2855, 2855, 2514, 2518, 2855,
-     2577, 2515, 2519, 2855, 2855, 2855, 2855, 2855,  443, 2855,
-     2855, 2855,  443, 2582,  443, 2586, 2855, 1110, 2855, 2584,
-      443, 1111,  443,  443, 2855,  443,  443, 2855,  443, 2855,
-      443,  443,  444,  443,  443, 2588,  445, 2855, 2855, 1112,
-     2855,  443,  443,  444,  444,  443,  444,  445,  445, 2855,
-
-      445, 2855, 2855,  443, 2855, 2534, 2855, 2855, 2855, 2535,
-      443,  443, 2855, 2855, 2855,  444,  444, 2855,  443,  445,
-      445,  443,  443, 2597, 2601, 2855,  443, 1219, 2855,  443,
-      443, 2855,  443,  443, 2598, 2059, 2599,  443,  443, 2060,
-      443,  443, 2855,  443,  443, 2855, 2607, 2855, 2855,  443,
-     2608,  443,  443, 2855, 2855, 2855, 2855, 2604, 2240,  443,
-      443,  444, 2241,  443, 2603,  445, 2609, 2855, 2855, 2855,
-     2605,  443,  444, 2855,  443, 2855,  445, 2855, 2855,  443,
-     2855,  444,  443,  444,  444,  445,  443,  445,  445,  443,
-      443, 2855, 2855, 2855,  443,  444, 2610,  443, 2855,  445,
-
-      443, 2855,  443, 2855, 2855,  443, 2855, 2855,  443,  443,
-     2611,  443,  443, 2855,  444, 2616,  443,  443,  445,  443,
-      443, 2855, 2855,  443, 2612,  443, 2855, 2613,  443, 2855,
-     2614,  443,  444, 2855,  444, 2855,  445, 2563,  445,  443,
-     2855, 2564,  443,  444, 1242, 2855, 2855,  445, 1243, 2632,
-      443, 2855, 2855, 2633, 2855, 2855, 2855, 2615,  443, 2626,
-      443, 2855,  443, 1687, 2855,  443, 1244, 1688,  443, 2855,
-      443,  443,  443,  443, 2628, 2855, 2617,  443,  443,  443,
-      443,  443, 2630, 2855, 2855,  443,  444,  443,  443, 2855,
-      445,  443,  444,  443, 2855, 2855,  445, 2855,  444,  443,
-
-     2855, 2855,  445, 2855,  444,  444, 2855,  443,  445,  445,
-     2855, 2634, 2855, 2855,  443,  444, 2855, 2646, 2855,  445,
-      443, 2647,  443, 2855, 2855, 2636,  443, 2855,  443, 2638,
-      443, 2639,  443,  443,  443,  444,  443, 2855, 2855,  445,
-      443,  443,  443,  443, 2855,  443, 2658, 2642,  443,  443,
-     2659,  443, 2644,  443, 2855, 2855, 2660, 2855, 2662,  443,
-     2661,  443, 2663,  443, 2649, 2665, 2855, 2855,  444, 2666,
-     2855,  443,  445, 2855,  443, 2855, 2855,  444, 2855,  443,
-     2855,  445,  443, 2855,  443, 2855,  443, 2059, 2855, 2855,
-      443, 2060,  443,  443,  443, 2855,  443, 2668, 2855, 2607,
-
-      443,  443,  443, 2608,  443,  443, 2855, 2855, 2855,  443,
-     2669, 2855,  443,  443, 2673,  443, 2670, 2855, 2674, 2609,
-      444,  443, 2855,  443,  445,  444, 2855,  443, 2855,  445,
-     2855,  443,  444, 2855, 2855,  443,  445,  444, 2855, 2855,
-     2855,  445,  443,  443, 2855, 2855, 2855,  444,  443, 2675,
-      443,  445, 2855,  443, 2855, 2855,  443, 2855,  443,  444,
-      443,  443, 2676,  445,  443,  443,  444, 2855,  443,  443,
-      445, 2855, 2855,  443, 2677,  443,  443, 2855, 2855, 2855,
-      944,  443,  946,  443,  444, 2855,  444,  443,  445, 2855,
-      445,  443, 2678, 2855,  443,  443,  444, 2855, 2855, 2855,
-
-      445, 2855,  443,  443, 2855,  444, 2855,  444, 2855,  445,
-     2679,  445,  443, 2855,  443, 2855, 2855, 2689, 2855,  444,
-      443, 2680,  443,  445,  443, 2691, 2855, 2855,  443, 2855,
-      443, 2855,  443,  443, 2693,  443, 2855, 2855,  444, 2855,
-      443,  443,  445,  443,  444, 2855, 2855,  443,  445,  443,
-     2695,  443, 2855,  444, 2855,  443,  444,  445, 2855, 2855,
-      445, 2855, 2855,  443, 2855,  444,  443, 2705, 2855,  445,
-     2855, 2706,  443, 2855,  443, 2855, 2855, 2855, 2855,  444,
-      443,  443,  443,  445,  443, 2697, 2700, 2855, 2699,  443,
-     2855, 2855,  443,  443, 2703,  443, 2855,  443, 2855, 2855,
-
-      443,  443, 2658,  443, 2855, 2855, 2659,  443, 2660,  443,
-     2855,  443, 2661, 2723, 2662,  443, 2855, 2724, 2663, 2716,
-     2716, 2855, 2708,  443, 2855, 2718, 2718, 2855, 2855, 2855,
-      443, 2720, 2720, 1195, 2855, 2052,  443, 1196,  443,  444,
-     2855,  443,  443,  445,  443, 2855,  443, 2855, 2855,  443,
-      443, 2059,  443, 2855, 2855, 2060, 2673,  443,  443, 2855,
-     2674,  443,  444, 2855, 2855, 2855,  445,  443,  444,  443,
-     2855, 2855,  445, 2855, 2855,  443, 2726,  443, 2855,  443,
-     2855, 2855,  444,  443,  443,  444,  445,  443, 2855,  445,
-      443, 2855,  443, 2727, 2855,  443,  443, 2855,  443, 2730,
-
-      443, 2732, 2855, 2855,  443,  444,  443, 2731, 2855,  445,
-      443,  444,  443,  443, 2855,  445, 2855, 2855,  443, 2855,
-      444,  443, 2855, 2734,  445, 2855,  443, 2855, 2855,  443,
-     2733, 2855,  444,  443, 2855, 2742,  445, 2855,  444,  443,
-     2855,  443,  445, 2855, 2735, 2855, 2855,  443,  443,  443,
-     2748, 2855, 2855, 2855, 2749,  443,  443, 2855, 2855, 2855,
-      443, 2855, 2855, 2855,  443, 2855,  443, 2855,  443, 2855,
-     2855, 2855, 2855, 2855,  443, 2744,  443, 2855,  443, 2746,
-     2855, 2855,  443, 2855, 2855, 2855,  443, 2855, 2855, 2855,
-     2855, 2855, 2750, 2855,  443, 2753, 2754, 2753, 2753, 2753,
-
-     2755, 2756, 2753, 2756, 2753, 2753, 2753, 2753, 2753, 2753,
-     2753, 2753, 2753, 2753, 2753, 2753, 2753, 2757, 2758, 2753,
-     2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753,
-     2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753,
-     2753, 2753, 2753, 2753, 2753, 2753, 2753, 2753, 2756, 2756,
-     2756, 2756, 2756, 2756, 2756, 2756, 2756, 2756, 2756, 2756,
-     2756, 2756, 2756, 2756, 2756, 2756, 2756, 2759, 2759, 2759,
-     2759, 2759, 2759, 2760, 2760, 2760, 2761, 2756, 2756,  444,
-      444, 2855, 2768,  445,  445, 2705, 2769, 2855, 2855, 2706,
-     2855,  444, 2855, 2855, 2855,  445, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855,  443,  443, 2855,
-      443, 2765, 2855,  443, 2855,  443,  443, 2764,  443,  443,
-     2855,  443, 2855,  443,  443, 2855,  443,  443,  444,  443,
-      444, 2855,  445,  444,  445,  443, 2855,  445, 2855,  444,
-     2723, 2855, 2855,  445, 2724, 2716, 2716, 2718, 2718, 2855,
-     2720, 2720, 2855,  444, 2855, 2855,  443,  445,  443,  444,
-     2855,  443, 2052,  445,  443, 2855,  443,  443,  443,  443,
-     2776, 2855,  443, 2855,  443,  443,  443,  443,  444, 2855,
-     2855,  443,  445,  443,  443, 2855, 2855,  443,  444,  443,
-      444, 2855,  445, 2855,  445,  443, 2855,  443, 2855, 2855,
-
-      444,  444,  871,  443,  445,  445,  443,  444, 2855, 2855,
-     2855,  445, 2855,  943,  443, 2855,  443, 2855,  443,  444,
-     2855, 2855,  443,  445,  443, 1228,  443, 2855,  443,  443,
-     2855, 2855,  443, 2777,  443, 2786,  443,  443, 2788, 2855,
-     2855, 2855, 2789,  443, 2778,  443, 2779,  443, 2748,  444,
-      444,  443, 2749,  445,  445,  443, 2855, 2855, 2855, 2855,
-      444,  444, 2855,  443,  445,  445,  443, 2768, 2855, 2855,
-     2855, 2769, 2855, 2855,  443, 2855,  443,  443,  443, 2855,
-     2855, 2855,  443, 2855,  443,  443,  443,  444,  443,  443,
-     2855,  445,  443,  443,  443,  443,  443,  443, 2855, 2855,
-
-     2855, 2855, 2802,  443, 2794, 2795,  444, 2855, 2855,  444,
-      445,  443,  444,  445, 2855,  443,  445, 2855, 2855, 2855,
-     2855,  444, 2855,  443, 2788,  445, 2855, 2855, 2789, 2855,
-     2855,  443, 2855, 2855,  443, 2803, 2855,  443, 2855,  444,
-      443, 2804,  443,  445, 2855,  443, 2855, 2855,  443,  443,
-      443, 1561,  443,  443, 2808, 2855,  443,  443,  444,  444,
-      443, 2855,  445,  445, 2855,  443, 2855,  443,  443,  444,
-      444, 2855, 2855,  445,  445,  443, 2855, 2855, 2855, 2855,
-      444, 1408, 2855,  443,  445, 2855,  443,  443, 2855, 2855,
-     2855, 2855, 2855, 2855,  443,  443, 2810,  443,  443, 2855,
-
-      444, 2814,  443,  443,  445,  443,  443,  444,  443, 2855,
-     2815,  445, 2816,  443,  443, 2855,  443,  444, 2855, 2855,
-     2855,  445,  444, 2855, 2821, 2819,  445,  444,  443, 2855,
-     2855,  445, 2855, 2855,  444,  443,  443,  444,  445, 2855,
-     2825,  445, 2855,  443,  443,  443, 2855, 2827, 2855, 2855,
-      443,  443,  444,  443, 2830,  443,  445, 2855,  443, 2826,
-     2855,  443,  443,  443,  444,  443,  443, 2855,  445, 2855,
-      443,  443, 2855,  443, 2855,  444, 1947, 2835,  443,  445,
-      443,  443, 2855, 2855, 2855,  444, 2834,  444,  443,  445,
-     2855,  445,  443, 2855, 2855, 2855,  443,  444, 2855,  953,
-
-      443,  445, 2855,  443, 2855, 2855,  444, 2855,  443, 2855,
-      445,  443, 2855,  443,  907,  443, 2838, 2855, 2855,  443,
-      444,  443,  945,  443,  445,  443, 2855, 2855, 2855,  443,
-     2843,  443,  444,  443,  443,  444,  445, 2855, 2855,  445,
-     2855,  443,  443, 2855, 2855, 2855, 2855, 2855,  443, 2846,
-      443, 2855, 2855, 2849, 2855, 2855,  443, 2855, 2855, 2852,
-      443, 2855, 2855,  443,  443, 2855, 2855, 2855,  443, 2855,
-     2855,  443, 2855, 2855, 2855, 2855,  443,  942, 2855,  443,
-      122,  122,  122,  122,  122,  122,  122,  122,  122,  122,
-      122,  122,  122,  167,  167,  167,  167,  167,  167,  167,
-
-      167,  167,  167,  167,  167,  167,  255,  255,  255,  255,
-      255,  255,  255,  255,  255,  255,  255,  255,  255,  258,
-      258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
-      258,  258,  280,  280,  280,  280,  280,  280,  280,  280,
-      280,  280,  280,  280,  280,  283,  283,  283,  283,  283,
-      283,  283,  283,  283,  283,  283,  283,  283,  288,  288,
-      288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
-      288,  167,  167,  167,  167,  167,  167,  167,  167,  167,
-      167,  167,  167,  167,  314,  314,  314,  314,  314,  314,
-      314,  314,  314,  314,  314,  314,  314,  358,  358,  358,
-
-      358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
-      361,  361,  361,  361,  361,  361,  361,  361,  361,  361,
-      361,  361,  361,  371,  371,  371,  371,  371,  371,  371,
-      371,  371,  371,  371,  371,  371,  380,  380,  380,  380,
-      380,  380,  380,  380,  380,  380,  380,  380,  380,  442,
-      442, 2855,  442,  442,  442,  442,  442,  442,  442,  442,
-      442,  442,  443,  443,  443,  443,  443, 2855,  443,  443,
-      443,  443,  542,  542, 2855,  542,  542,  542,  542,  542,
-      542,  542,  542,  542,  542,  543,  543, 2855,  543,  543,
-      543,  543,  543,  543,  543,  543,  543,  543,  544,  544,
-
-      544,  544,  544,  544,  544,  544,  544,  544,  549,  549,
-     2855,  549,  549,  549,  549,  549,  549,  549,  549,  549,
-      549,  550,  550, 2855,  550,  550,  550,  550,  550,  550,
-      550,  550,  550,  550,  551,  551, 2855,  551,  551,  551,
-      551,  551,  551,  551,  551,  551,  551,  554, 2855,  554,
-      554, 2855,  554,  554,  554,  554,  554,  554,  554,  554,
-      562,  562, 2855, 2855,  562,  562,  562,  562,  562,  562,
-      566,  566, 2855,  566,  566,  566,  566,  566,  566,  566,
-      566,  566,  566,  567,  567, 2855,  567,  567,  567,  567,
-      567,  567,  567,  567,  567,  567,  568,  568, 2855, 2855,
-
-      568,  568,  568,  568,  568,  568,  572,  572, 2855,  572,
-      572,  572,  572,  572,  572,  572,  572,  572,  572,  573,
-      573, 2855,  573,  573,  573,  573,  573,  573,  573,  573,
-      573,  573,  575,  575,  575,  575,  575,  575,  575,  575,
-     2855,  575,  575,  575,  575,  580,  580, 2855, 2855,  580,
-      580,  580,  580,  580,  580,  584,  584,  584,  584,  584,
-      584,  584,  584,  584,  584,  584,  584,  584,  586,  586,
-      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
-      586,  588,  588, 2855, 2855,  588,  588,  588,  588,  588,
-      588,  592,  592, 2855,  592,  592,  592,  592,  592,  592,
-
-      592,  592,  592,  592,  593,  593, 2855,  593,  593,  593,
-      593,  593,  593,  593,  593,  593,  593,  594,  594, 2855,
-     2855,  594,  594,  594,  594,  594,  594,  598,  598, 2855,
-      598,  598,  598,  598,  598,  598,  598,  598,  598,  598,
-      599,  599, 2855,  599,  599,  599,  599,  599,  599,  599,
-      599,  599,  599,  600,  600, 2855, 2855,  600,  600,  600,
-      600,  600,  600,  604,  604, 2855,  604,  604,  604,  604,
-      604,  604,  604,  604,  604,  604,  605,  605, 2855,  605,
-      605,  605,  605,  605,  605,  605,  605,  605,  605,  606,
-      606, 2855, 2855,  606,  606,  606,  606,  606,  606,  610,
-
-      610, 2855,  610,  610,  610,  610,  610,  610,  610,  610,
-      610,  610,  611,  611, 2855,  611,  611,  611,  611,  611,
-      611,  611,  611,  611,  611,  612,  612, 2855, 2855,  612,
-      612,  612,  612,  612,  612,  616,  616, 2855,  616,  616,
-      616,  616,  616,  616,  616,  616,  616,  616,  617,  617,
-     2855,  617,  617,  617,  617,  617,  617,  617,  617,  617,
-      617,  618,  618, 2855, 2855,  618,  618,  618,  618,  618,
-      618,  622,  622, 2855,  622,  622,  622,  622,  622,  622,
-      622,  622,  622,  622,  623,  623, 2855,  623,  623,  623,
-      623,  623,  623,  623,  623,  623,  623,  624,  624, 2855,
-
-     2855,  624,  624,  624,  624,  624,  624,  628,  628, 2855,
-      628,  628,  628,  628,  628,  628,  628,  628,  628,  628,
-      629,  629, 2855,  629,  629,  629,  629,  629,  629,  629,
-      629,  629,  629,  630,  630, 2855, 2855,  630,  630,  630,
-      630,  630,  630,  634,  634, 2855,  634,  634,  634,  634,
-      634,  634,  634,  634,  634,  634,  635,  635, 2855,  635,
-      635,  635,  635,  635,  635,  635,  635,  635,  635,  636,
-      636, 2855, 2855,  636,  636,  636,  636,  636,  636,  640,
-      640, 2855,  640,  640,  640,  640,  640,  640,  640,  640,
-      640,  640,  641,  641, 2855,  641,  641,  641,  641,  641,
-
-      641,  641,  641,  641,  641,  642,  642, 2855, 2855,  642,
-      642,  642,  642,  642,  642,  646,  646, 2855,  646,  646,
-      646,  646,  646,  646,  646,  646,  646,  646,  647,  647,
-     2855,  647,  647,  647,  647,  647,  647,  647,  647,  647,
-      647,  648,  648, 2855, 2855,  648,  648,  648,  648,  648,
-      648,  652,  652, 2855,  652,  652,  652,  652,  652,  652,
-      652,  652,  652,  652,  653,  653, 2855,  653,  653,  653,
-      653,  653,  653,  653,  653,  653,  653,  654,  654,  654,
-      654, 2855,  654,  654,  654,  654,  654,  654,  654,  654,
-      655,  655, 2855,  655, 2855,  655,  655,  655,  655,  655,
-
-      655,  655,  655,  656,  656, 2855, 2855,  656,  656,  656,
-      656,  656,  656,  660,  660, 2855,  660,  660,  660,  660,
-      660,  660,  660,  660,  660,  660,  661,  661, 2855,  661,
-      661,  661,  661,  661,  661,  661,  661,  661,  661,  662,
-      662, 2855, 2855,  662,  662,  662,  662,  662,  662,  666,
-      666, 2855,  666,  666,  666,  666,  666,  666,  666,  666,
-      666,  666,  667,  667, 2855,  667,  667,  667,  667,  667,
-      667,  667,  667,  667,  667,  668,  668, 2855, 2855,  668,
-      668,  668,  668,  668,  668,  672,  672, 2855,  672,  672,
-      672,  672,  672,  672,  672,  672,  672,  672,  673,  673,
-
-     2855,  673,  673,  673,  673,  673,  673,  673,  673,  673,
-      673,  674,  674, 2855, 2855,  674,  674,  674,  674,  674,
-      674,  678,  678, 2855,  678,  678,  678,  678,  678,  678,
-      678,  678,  678,  678,  679,  679, 2855,  679,  679,  679,
-      679,  679,  679,  679,  679,  679,  679,  680,  680,  680,
-      680,  680,  680, 2855,  680,  680,  680,  680,  680,  680,
-      681,  681, 2855, 2855,  681,  681,  681,  681,  681,  681,
-      685,  685, 2855,  685,  685,  685,  685,  685,  685,  685,
-      685,  685,  685,  686,  686, 2855,  686,  686,  686,  686,
-      686,  686,  686,  686,  686,  686,  687,  687, 2855, 2855,
-
-      687,  687,  687,  687,  687,  687,  691,  691, 2855,  691,
-      691,  691,  691,  691,  691,  691,  691,  691,  691,  692,
-      692, 2855,  692,  692,  692,  692,  692,  692,  692,  692,
-      692,  692,  693,  693, 2855, 2855,  693,  693,  693,  693,
-      693,  693,  697,  697, 2855,  697,  697,  697,  697,  697,
-      697,  697,  697,  697,  697,  698,  698, 2855,  698,  698,
-      698,  698,  698,  698,  698,  698,  698,  698,  699,  699,
-     2855, 2855,  699,  699,  699,  699,  699,  699,  703,  703,
-     2855,  703,  703,  703,  703,  703,  703,  703,  703,  703,
-      703,  704,  704, 2855,  704,  704,  704,  704,  704,  704,
-
-      704,  704,  704,  704,  705,  705,  705,  705,  705,  705,
-      705,  705,  705,  705,  705,  705,  705,  710,  710,  710,
-      710,  710,  710, 2855,  710,  710,  710,  710,  710,  710,
-      714,  714,  714,  714,  714,  714,  714,  714,  714,  714,
-      730,  730,  730,  730,  730,  730,  730,  730,  730, 2855,
-      730,  730,  730,  718,  718, 2855,  718,  718,  718,  718,
-      718,  718,  718,  718,  718,  718,  734,  734, 2855,  734,
-      734,  734,  734,  734,  734,  734,  734,  734,  734,  735,
-      735,  735,  735,  735,  735,  735,  735,  735,  735,  735,
-     2855,  735,  743,  743, 2855,  743,  743,  743,  743,  743,
-
-      743,  743,  743,  743,  743,  744,  744, 2855,  744,  744,
-      744,  744,  744,  744,  744,  744,  744,  744,  745,  745,
-     2855, 2855,  745,  745,  745,  745,  745,  745,  749,  749,
-     2855,  749,  749,  749,  749,  749,  749,  749,  749,  749,
-      749,  750,  750, 2855,  750,  750,  750,  750,  750,  750,
-      750,  750,  750,  750,  751,  751, 2855, 2855,  751,  751,
-      751,  751,  751,  751,  755,  755, 2855,  755,  755,  755,
-      755,  755,  755,  755,  755,  755,  755,  756,  756, 2855,
-      756,  756,  756,  756,  756,  756,  756,  756,  756,  756,
-      757,  757, 2855, 2855,  757,  757,  757,  757,  757,  757,
-
-      761,  761, 2855,  761,  761,  761,  761,  761,  761,  761,
-      761,  761,  761,  762,  762, 2855,  762,  762,  762,  762,
-      762,  762,  762,  762,  762,  762,  763,  763, 2855, 2855,
-      763,  763,  763,  763,  763,  763,  767,  767, 2855,  767,
-      767,  767,  767,  767,  767,  767,  767,  767,  767,  768,
-      768, 2855,  768,  768,  768,  768,  768,  768,  768,  768,
-      768,  768,  769, 2855,  769,  769, 2855,  769,  769,  769,
-      769,  769,  769,  769,  769,  770, 2855,  770,  770, 2855,
-      770,  770,  770, 2855,  770,  770,  770,  770,  771,  771,
-     2855, 2855,  771,  771,  771,  771,  771,  771,  775,  775,
-
-     2855,  775,  775,  775,  775,  775,  775,  775,  775,  775,
-      775,  776,  776, 2855,  776,  776,  776,  776,  776,  776,
-      776,  776,  776,  776,  777, 2855,  777,  777, 2855,  777,
-      777,  777,  777,  777,  777,  777,  777,  779,  779, 2855,
-     2855,  779,  779,  779,  779,  779,  779,  783,  783, 2855,
-      783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
-      784,  784, 2855,  784,  784,  784,  784,  784,  784,  784,
-      784,  784,  784,  785, 2855,  785,  785, 2855,  785,  785,
-      785,  785,  785,  785,  785,  785,  787,  787, 2855, 2855,
-      787,  787,  787,  787,  787,  787,  791,  791, 2855,  791,
-
-      791,  791,  791,  791,  791,  791,  791,  791,  791,  792,
-      792, 2855,  792,  792,  792,  792,  792,  792,  792,  792,
-      792,  792,  793,  793, 2855, 2855,  793,  793,  793,  793,
-      793,  793,  797,  797, 2855,  797,  797,  797,  797,  797,
-      797,  797,  797,  797,  797,  798,  798, 2855,  798,  798,
-      798,  798,  798,  798,  798,  798,  798,  798,  799,  799,
-     2855, 2855,  799,  799,  799,  799,  799,  799,  803,  803,
-     2855,  803,  803,  803,  803,  803,  803,  803,  803,  803,
-      803,  804,  804, 2855,  804,  804,  804,  804,  804,  804,
-      804,  804,  804,  804,  805,  805, 2855,  805,  805,  805,
-
-      805,  805,  805,  805,  805,  805,  805,  806,  806, 2855,
-      806,  806,  806,  806,  806,  806,  806,  806,  806,  806,
-      807,  807, 2855,  807,  807,  807,  807,  807,  807,  807,
-      807,  807,  807,  809,  809, 2855, 2855,  809,  809,  809,
-      809,  809,  809,  813,  813, 2855,  813,  813,  813,  813,
-      813,  813,  813,  813,  813,  813,  814,  814, 2855,  814,
-      814,  814,  814,  814,  814,  814,  814,  814,  814,  815,
-      815, 2855, 2855,  815,  815,  815,  815,  815,  815,  819,
-      819, 2855,  819,  819,  819,  819,  819,  819,  819,  819,
-      819,  819,  820,  820, 2855,  820,  820,  820,  820,  820,
-
-      820,  820,  820,  820,  820,  821,  821, 2855, 2855,  821,
-      821,  821,  821,  821,  821,  825,  825, 2855,  825,  825,
-      825,  825,  825,  825,  825,  825,  825,  825,  826,  826,
-     2855,  826,  826,  826,  826,  826,  826,  826,  826,  826,
-      826,  827,  827, 2855,  827,  827,  827,  827,  827,  827,
-      827,  827,  827,  827,  828,  828, 2855,  828,  828,  828,
-      828,  828,  828,  828,  828,  828,  828,  829,  829, 2855,
-      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
-      830,  830, 2855, 2855,  830,  830,  830,  830,  830,  830,
-      834,  834, 2855,  834,  834,  834,  834,  834,  834,  834,
-
-      834,  834,  834,  835,  835, 2855,  835,  835,  835,  835,
-      835,  835,  835,  835,  835,  835,  836,  836, 2855, 2855,
-      836,  836,  836,  836,  836,  836,  840,  840, 2855,  840,
-      840,  840,  840,  840,  840,  840,  840,  840,  840,  841,
-      841, 2855,  841,  841,  841,  841,  841,  841,  841,  841,
-      841,  841,  842,  842, 2855, 2855,  842,  842,  842,  842,
-      842,  842,  846,  846, 2855,  846,  846,  846,  846,  846,
-      846,  846,  846,  846,  846,  847,  847, 2855,  847,  847,
-      847,  847,  847,  847,  847,  847,  847,  847,  442,  442,
-     2855,  442,  442,  442,  442,  442,  442,  442,  442,  442,
-
-      442,  443,  443,  443,  443,  443, 2855,  443,  443,  443,
-      443,  542,  542, 2855,  542,  542,  542,  542,  542,  542,
-      542,  542,  542,  542,  543,  543, 2855,  543,  543,  543,
-      543,  543,  543,  543,  543,  543,  543,  978,  978, 2855,
-      978,  978,  978,  978,  978,  978,  978,  978,  978,  978,
-      544,  544, 2855,  544,  544,  544,  544,  544,  544,  544,
-      544,  544,  544,  979,  979, 2855,  979,  979,  979,  979,
-      979,  979,  979,  979,  979,  979,  980,  980, 2855,  980,
-      980,  980,  980,  980,  980,  980,  980,  980,  980,  549,
-      549, 2855,  549,  549,  549,  549,  549,  549,  549,  549,
-
-      549,  549,  981,  981, 2855,  981,  981,  981,  981,  981,
-      981,  981,  981,  981,  981,  554, 2855,  554,  554, 2855,
-      554,  554,  554,  554,  554,  554,  554,  554,  562,  562,
-     2855, 2855,  562,  562,  562,  562,  562,  562,  566,  566,
-     2855,  566,  566,  566,  566,  566,  566,  566,  566,  566,
-      566,  567,  567, 2855,  567,  567,  567,  567,  567,  567,
-      567,  567,  567,  567,  984,  984, 2855,  984,  984,  984,
-      984,  984,  984,  984,  984,  984,  984,  568,  568, 2855,
-     2855,  568,  568,  568,  568,  568,  568,  572,  572, 2855,
-      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
-
-      573,  573, 2855,  573,  573,  573,  573,  573,  573,  573,
-      573,  573,  573,  985,  985, 2855,  985,  985,  985,  985,
-      985,  985,  985,  985,  985,  985,  575,  575,  575,  575,
-      575,  575,  575,  575, 2855,  575,  575,  575,  575,  580,
-      580, 2855, 2855,  580,  580,  580,  580,  580,  580,  584,
-      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
-      584,  584,  586,  586,  586,  586,  586,  586,  586,  586,
-      586,  586,  586,  586,  586,  585,  585, 2855,  585,  585,
-      585,  585,  585,  585,  585,  585,  585,  585,  587,  587,
-     2855,  587,  587,  587,  587,  587,  587,  587,  587,  587,
-
-      587,  986,  986,  986,  986,  986,  986,  986,  986,  986,
-      986,  986,  986,  986,  987,  987, 2855,  987,  987,  987,
-      987,  987,  987,  987,  987,  987,  987,  588,  588, 2855,
-     2855,  588,  588,  588,  588,  588,  588,  592,  592, 2855,
-      592,  592,  592,  592,  592,  592,  592,  592,  592,  592,
-      593,  593, 2855,  593,  593,  593,  593,  593,  593,  593,
-      593,  593,  593,  988,  988, 2855,  988,  988,  988,  988,
-      988,  988,  988,  988,  988,  988,  594,  594, 2855, 2855,
-      594,  594,  594,  594,  594,  594,  598,  598, 2855,  598,
-      598,  598,  598,  598,  598,  598,  598,  598,  598,  599,
-
-      599, 2855,  599,  599,  599,  599,  599,  599,  599,  599,
-      599,  599,  989,  989, 2855,  989,  989,  989,  989,  989,
-      989,  989,  989,  989,  989,  600,  600, 2855, 2855,  600,
-      600,  600,  600,  600,  600,  604,  604, 2855,  604,  604,
-      604,  604,  604,  604,  604,  604,  604,  604,  605,  605,
-     2855,  605,  605,  605,  605,  605,  605,  605,  605,  605,
-      605,  990,  990, 2855,  990,  990,  990,  990,  990,  990,
-      990,  990,  990,  990,  606,  606, 2855, 2855,  606,  606,
-      606,  606,  606,  606,  610,  610, 2855,  610,  610,  610,
-      610,  610,  610,  610,  610,  610,  610,  611,  611, 2855,
-
-      611,  611,  611,  611,  611,  611,  611,  611,  611,  611,
-      991,  991, 2855,  991,  991,  991,  991,  991,  991,  991,
-      991,  991,  991,  612,  612, 2855, 2855,  612,  612,  612,
-      612,  612,  612,  616,  616, 2855,  616,  616,  616,  616,
-      616,  616,  616,  616,  616,  616,  617,  617, 2855,  617,
-      617,  617,  617,  617,  617,  617,  617,  617,  617,  992,
-      992, 2855,  992,  992,  992,  992,  992,  992,  992,  992,
-      992,  992,  618,  618, 2855, 2855,  618,  618,  618,  618,
-      618,  618,  622,  622, 2855,  622,  622,  622,  622,  622,
-      622,  622,  622,  622,  622,  623,  623, 2855,  623,  623,
-
-      623,  623,  623,  623,  623,  623,  623,  623,  993,  993,
-     2855,  993,  993,  993,  993,  993,  993,  993,  993,  993,
-      993,  624,  624, 2855, 2855,  624,  624,  624,  624,  624,
-      624,  628,  628, 2855,  628,  628,  628,  628,  628,  628,
-      628,  628,  628,  628,  629,  629, 2855,  629,  629,  629,
-      629,  629,  629,  629,  629,  629,  629,  994,  994, 2855,
-      994,  994,  994,  994,  994,  994,  994,  994,  994,  994,
-      630,  630, 2855, 2855,  630,  630,  630,  630,  630,  630,
-      634,  634, 2855,  634,  634,  634,  634,  634,  634,  634,
-      634,  634,  634,  635,  635, 2855,  635,  635,  635,  635,
-
-      635,  635,  635,  635,  635,  635,  995,  995, 2855,  995,
-      995,  995,  995,  995,  995,  995,  995,  995,  995,  636,
-      636, 2855, 2855,  636,  636,  636,  636,  636,  636,  640,
-      640, 2855,  640,  640,  640,  640,  640,  640,  640,  640,
-      640,  640,  641,  641, 2855,  641,  641,  641,  641,  641,
-      641,  641,  641,  641,  641,  996,  996, 2855,  996,  996,
-      996,  996,  996,  996,  996,  996,  996,  996,  642,  642,
-     2855, 2855,  642,  642,  642,  642,  642,  642,  646,  646,
-     2855,  646,  646,  646,  646,  646,  646,  646,  646,  646,
-      646,  647,  647, 2855,  647,  647,  647,  647,  647,  647,
-
-      647,  647,  647,  647,  997,  997, 2855,  997,  997,  997,
-      997,  997,  997,  997,  997,  997,  997,  648,  648, 2855,
-     2855,  648,  648,  648,  648,  648,  648,  652,  652, 2855,
-      652,  652,  652,  652,  652,  652,  652,  652,  652,  652,
-      653,  653, 2855,  653,  653,  653,  653,  653,  653,  653,
-      653,  653,  653,  998,  998, 2855,  998,  998,  998,  998,
-      998,  998,  998,  998,  998,  998,  654,  654,  654,  654,
-     2855,  654,  654,  654,  654,  654,  654,  654,  654,  655,
-      655, 2855,  655, 2855,  655,  655,  655,  655,  655,  655,
-      655,  655,  656,  656, 2855, 2855,  656,  656,  656,  656,
-
-      656,  656,  660,  660, 2855,  660,  660,  660,  660,  660,
-      660,  660,  660,  660,  660,  661,  661, 2855,  661,  661,
-      661,  661,  661,  661,  661,  661,  661,  661,  999,  999,
-     2855,  999,  999,  999,  999,  999,  999,  999,  999,  999,
-      999,  662,  662, 2855, 2855,  662,  662,  662,  662,  662,
-      662,  666,  666, 2855,  666,  666,  666,  666,  666,  666,
-      666,  666,  666,  666,  667,  667, 2855,  667,  667,  667,
-      667,  667,  667,  667,  667,  667,  667, 1000, 1000, 2855,
-     1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
-      668,  668, 2855, 2855,  668,  668,  668,  668,  668,  668,
-
-      672,  672, 2855,  672,  672,  672,  672,  672,  672,  672,
-      672,  672,  672,  673,  673, 2855,  673,  673,  673,  673,
-      673,  673,  673,  673,  673,  673, 1001, 1001, 2855, 1001,
-     1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001,  674,
-      674, 2855, 2855,  674,  674,  674,  674,  674,  674,  678,
-      678, 2855,  678,  678,  678,  678,  678,  678,  678,  678,
-      678,  678,  679,  679, 2855,  679,  679,  679,  679,  679,
-      679,  679,  679,  679,  679, 1002, 1002, 2855, 1002, 1002,
-     1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002,  680,  680,
-      680,  680,  680,  680, 2855,  680,  680,  680,  680,  680,
-
-      680,  681,  681, 2855, 2855,  681,  681,  681,  681,  681,
-      681,  685,  685, 2855,  685,  685,  685,  685,  685,  685,
-      685,  685,  685,  685,  686,  686, 2855,  686,  686,  686,
-      686,  686,  686,  686,  686,  686,  686, 1003, 1003, 2855,
-     1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003,
-      687,  687, 2855, 2855,  687,  687,  687,  687,  687,  687,
-      691,  691, 2855,  691,  691,  691,  691,  691,  691,  691,
-      691,  691,  691,  692,  692, 2855,  692,  692,  692,  692,
-      692,  692,  692,  692,  692,  692, 1004, 1004, 2855, 1004,
-     1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004,  693,
-
-      693, 2855, 2855,  693,  693,  693,  693,  693,  693,  697,
-      697, 2855,  697,  697,  697,  697,  697,  697,  697,  697,
-      697,  697,  698,  698, 2855,  698,  698,  698,  698,  698,
-      698,  698,  698,  698,  698, 1005, 1005, 2855, 1005, 1005,
-     1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,  699,  699,
-     2855, 2855,  699,  699,  699,  699,  699,  699,  703,  703,
-     2855,  703,  703,  703,  703,  703,  703,  703,  703,  703,
-      703,  704,  704, 2855,  704,  704,  704,  704,  704,  704,
-      704,  704,  704,  704, 1006, 1006, 2855, 1006, 1006, 1006,
-     1006, 1006, 1006, 1006, 1006, 1006, 1006,  705,  705,  705,
+      169,  169,  169,  169,  169,  169,  169,  169,  307,  307,
+      307,  307,  307,  307,  308,  308,  308,  309,  169,  169,
+      310,  310,  181,  310,  182,  311,  310,  310,  310,  310,
+      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
+      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
+      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
+      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
+      310,  310,  310,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  312,  312,  312,  312,  312,  312,  313,  313,
+
+      313,  314,  169,  169,  321,  321,  181,  321,  322,  323,
+      321,  324,  321,  321,  325,  326,  321,  321,  321,  321,
+      321,  327,  326,  326,  328,  321,  326,  321,  326,  321,
+      326,  326,  326,  326,  326,  326,  326,  326,  326,  326,
+      326,  326,  326,  326,  326,  326,  326,  326,  326,  326,
+      326,  326,  326,  326,  326,  329,  321,  321,  321,  321,
+      321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
+      321,  321,  321,  321,  321,  321,  330,  331,  332,  333,
+      334,  335,  336,  337,  338,  339,  321,  321,  340,  340,
+      181,  340,  182,  341,  340,  340,  340,  340,  340,  340,
 
-      705,  705,  705,  705,  705,  705,  705,  705,  705,  705,
-      710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
-      710,  710,  710, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
-     1008, 1008, 1008, 1008, 1008, 1008, 1013, 1013, 1013, 1013,
-     1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1018,
-     1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018,
-     1018, 1018,  714,  714, 2855,  714,  714,  714,  714,  714,
-      714,  714,  714,  714,  714, 1023, 1023, 2855, 1023, 1023,
-     1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024,
-     2855, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
-
-     1024,  718,  718, 2855,  718,  718,  718,  718,  718,  718,
-      718,  718,  718,  718,  734,  734, 2855,  734,  734,  734,
-      734,  734,  734,  734,  734,  734,  734,  735,  735,  735,
-      735,  735,  735,  735,  735,  735,  735,  735, 2855,  735,
-      743,  743, 2855,  743,  743,  743,  743,  743,  743,  743,
-      743,  743,  743,  744,  744, 2855,  744,  744,  744,  744,
-      744,  744,  744,  744,  744,  744,  730,  730,  730,  730,
-      730,  730,  730,  730,  730,  730,  730,  730,  730, 1027,
-     1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027,
-     1027, 1027, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032,
-
-     1032, 1032, 1032, 1032, 1032, 1037, 1037, 1037, 1037, 1037,
-     1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1042, 1042,
-     1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
-     1042, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
-     1043, 1043, 1043, 1043, 1044, 1044, 2855, 1044, 1044, 1044,
-     1044, 1044, 1044, 1044, 1044, 1044, 1044,  745,  745, 2855,
-     2855,  745,  745,  745,  745,  745,  745,  749,  749, 2855,
-      749,  749,  749,  749,  749,  749,  749,  749,  749,  749,
-      750,  750, 2855,  750,  750,  750,  750,  750,  750,  750,
-      750,  750,  750, 1045, 1045, 2855, 1045, 1045, 1045, 1045,
-
-     1045, 1045, 1045, 1045, 1045, 1045,  751,  751, 2855, 2855,
-      751,  751,  751,  751,  751,  751,  755,  755, 2855,  755,
-      755,  755,  755,  755,  755,  755,  755,  755,  755,  756,
-      756, 2855,  756,  756,  756,  756,  756,  756,  756,  756,
-      756,  756, 1046, 1046, 2855, 1046, 1046, 1046, 1046, 1046,
-     1046, 1046, 1046, 1046, 1046,  757,  757, 2855, 2855,  757,
-      757,  757,  757,  757,  757,  761,  761, 2855,  761,  761,
-      761,  761,  761,  761,  761,  761,  761,  761,  762,  762,
-     2855,  762,  762,  762,  762,  762,  762,  762,  762,  762,
-      762, 1047, 1047, 2855, 1047, 1047, 1047, 1047, 1047, 1047,
-
-     1047, 1047, 1047, 1047,  763,  763, 2855, 2855,  763,  763,
-      763,  763,  763,  763,  767,  767, 2855,  767,  767,  767,
-      767,  767,  767,  767,  767,  767,  767,  768,  768, 2855,
-      768,  768,  768,  768,  768,  768,  768,  768,  768,  768,
-     1048, 1048, 2855, 1048, 1048, 1048, 1048, 1048, 1048, 1048,
-     1048, 1048, 1048,  769, 2855,  769,  769, 2855,  769,  769,
-      769,  769,  769,  769,  769,  769,  770, 2855,  770,  770,
-     2855,  770,  770,  770, 2855,  770,  770,  770,  770,  771,
-      771, 2855, 2855,  771,  771,  771,  771,  771,  771,  775,
-      775, 2855,  775,  775,  775,  775,  775,  775,  775,  775,
-
-      775,  775,  776,  776, 2855,  776,  776,  776,  776,  776,
-      776,  776,  776,  776,  776, 1049, 1049, 2855, 1049, 1049,
-     1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049,  777, 2855,
-      777,  777, 2855,  777,  777,  777,  777,  777,  777,  777,
-      777,  779,  779, 2855, 2855,  779,  779,  779,  779,  779,
-      779,  783,  783, 2855,  783,  783,  783,  783,  783,  783,
-      783,  783,  783,  783,  784,  784, 2855,  784,  784,  784,
-      784,  784,  784,  784,  784,  784,  784, 1051, 1051, 2855,
-     1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
-      785, 2855,  785,  785, 2855,  785,  785,  785,  785,  785,
-
-      785,  785,  785,  787,  787, 2855, 2855,  787,  787,  787,
-      787,  787,  787,  791,  791, 2855,  791,  791,  791,  791,
-      791,  791,  791,  791,  791,  791,  792,  792, 2855,  792,
-      792,  792,  792,  792,  792,  792,  792,  792,  792, 1053,
-     1053, 2855, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053,  793,  793, 2855, 2855,  793,  793,  793,  793,
-      793,  793,  797,  797, 2855,  797,  797,  797,  797,  797,
-      797,  797,  797,  797,  797,  798,  798, 2855,  798,  798,
-      798,  798,  798,  798,  798,  798,  798,  798, 1054, 1054,
-     2855, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054,
-
-     1054,  799,  799, 2855, 2855,  799,  799,  799,  799,  799,
-      799,  803,  803, 2855,  803,  803,  803,  803,  803,  803,
-      803,  803,  803,  803,  804,  804, 2855,  804,  804,  804,
-      804,  804,  804,  804,  804,  804,  804, 1055, 1055, 2855,
-     1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055,
-      805,  805, 2855,  805,  805,  805,  805,  805,  805,  805,
-      805,  805,  805, 1056, 1056, 2855, 1056, 1056, 1056, 1056,
-     1056, 1056, 1056, 1056, 1056, 1056,  809,  809, 2855, 2855,
-      809,  809,  809,  809,  809,  809,  813,  813, 2855,  813,
-      813,  813,  813,  813,  813,  813,  813,  813,  813,  814,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      342,  342,  342,  342,  342,  342,  343,  343,  343,  344,
+      169,  169,  345,  345,  181,  345,  182,  346,  345,  345,
+      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
+      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
 
-      814, 2855,  814,  814,  814,  814,  814,  814,  814,  814,
-      814,  814, 1057, 1057, 2855, 1057, 1057, 1057, 1057, 1057,
-     1057, 1057, 1057, 1057, 1057,  815,  815, 2855, 2855,  815,
-      815,  815,  815,  815,  815,  819,  819, 2855,  819,  819,
-      819,  819,  819,  819,  819,  819,  819,  819,  820,  820,
-     2855,  820,  820,  820,  820,  820,  820,  820,  820,  820,
-      820, 1058, 1058, 2855, 1058, 1058, 1058, 1058, 1058, 1058,
-     1058, 1058, 1058, 1058,  821,  821, 2855, 2855,  821,  821,
-      821,  821,  821,  821,  825,  825, 2855,  825,  825,  825,
-      825,  825,  825,  825,  825,  825,  825,  826,  826, 2855,
-
-      826,  826,  826,  826,  826,  826,  826,  826,  826,  826,
-     1059, 1059, 2855, 1059, 1059, 1059, 1059, 1059, 1059, 1059,
-     1059, 1059, 1059,  827,  827, 2855,  827,  827,  827,  827,
-      827,  827,  827,  827,  827,  827, 1060, 1060, 2855, 1060,
-     1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,  830,
-      830, 2855, 2855,  830,  830,  830,  830,  830,  830,  834,
-      834, 2855,  834,  834,  834,  834,  834,  834,  834,  834,
-      834,  834,  835,  835, 2855,  835,  835,  835,  835,  835,
-      835,  835,  835,  835,  835, 1061, 1061, 2855, 1061, 1061,
-     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,  836,  836,
-
-     2855, 2855,  836,  836,  836,  836,  836,  836,  840,  840,
-     2855,  840,  840,  840,  840,  840,  840,  840,  840,  840,
-      840,  841,  841, 2855,  841,  841,  841,  841,  841,  841,
-      841,  841,  841,  841, 1062, 1062, 2855, 1062, 1062, 1062,
-     1062, 1062, 1062, 1062, 1062, 1062, 1062,  842,  842, 2855,
-     2855,  842,  842,  842,  842,  842,  842,  846,  846, 2855,
-      846,  846,  846,  846,  846,  846,  846,  846,  846,  846,
-      847,  847, 2855,  847,  847,  847,  847,  847,  847,  847,
-      847,  847,  847, 1063, 1063, 2855, 1063, 1063, 1063, 1063,
-     1063, 1063, 1063, 1063, 1063, 1063,  443,  443,  443,  443,
-
-      443, 2855,  443,  443,  443,  443,  960,  960,  960,  960,
-      960,  960,  960,  960,  960,  960,  960,  960,  960,  542,
-      542, 2855,  542,  542,  542,  542,  542,  542,  542,  542,
-      542,  542,  543,  543, 2855,  543,  543,  543,  543,  543,
-      543,  543,  543,  543,  543,  544,  544, 2855,  544,  544,
-      544,  544,  544,  544,  544,  544,  544,  544, 1260, 1260,
-     2855, 1260, 1260, 1260, 1260, 1260, 1260, 1260, 1260, 1260,
-     1260,  549,  549, 2855,  549,  549,  549,  549,  549,  549,
-      549,  549,  549,  549,  554, 2855,  554,  554, 2855,  554,
-      554,  554,  554,  554,  554,  554,  554,  562,  562, 2855,
+      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
+      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
+      345,  345,  345,  345,  345,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  347,  347,  347,  347,  347,  347,
+      348,  348,  348,  349,  169,  169,  350,  350,  181,  350,
+      182,  351,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
 
-      562,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      568,  568, 2855,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  580,  580, 2855,  580,
-      580,  580,  580,  580,  580,  580,  580,  580,  580,  588,
-      588, 2855,  588,  588,  588,  588,  588,  588,  588,  588,
-      588,  588,  594,  594, 2855,  594,  594,  594,  594,  594,
-      594,  594,  594,  594,  594,  600,  600, 2855,  600,  600,
-      600,  600,  600,  600,  600,  600,  600,  600,  606,  606,
-     2855,  606,  606,  606,  606,  606,  606,  606,  606,  606,
-
-      606,  612,  612, 2855,  612,  612,  612,  612,  612,  612,
-      612,  612,  612,  612,  618,  618, 2855,  618,  618,  618,
-      618,  618,  618,  618,  618,  618,  618,  624,  624, 2855,
-      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
-      630,  630, 2855,  630,  630,  630,  630,  630,  630,  630,
-      630,  630,  630,  636,  636, 2855,  636,  636,  636,  636,
-      636,  636,  636,  636,  636,  636,  642,  642, 2855,  642,
-      642,  642,  642,  642,  642,  642,  642,  642,  642,  648,
-      648, 2855,  648,  648,  648,  648,  648,  648,  648,  648,
-      648,  648,  656,  656, 2855,  656,  656,  656,  656,  656,
-
-      656,  656,  656,  656,  656,  662,  662, 2855,  662,  662,
-      662,  662,  662,  662,  662,  662,  662,  662,  668,  668,
-     2855,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  674,  674, 2855,  674,  674,  674,  674,  674,  674,
-      674,  674,  674,  674,  681,  681, 2855,  681,  681,  681,
-      681,  681,  681,  681,  681,  681,  681,  687,  687, 2855,
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      693,  693, 2855,  693,  693,  693,  693,  693,  693,  693,
-      693,  693,  693,  699,  699, 2855,  699,  699,  699,  699,
-      699,  699,  699,  699,  699,  699,  710,  710,  710,  710,
-
-      710,  710,  710,  710,  710,  710,  710,  710,  710, 1008,
-     1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
-     1008, 1008, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013,
-     1013, 1013, 1013, 1013, 1013, 1018, 1018, 1018, 1018, 1018,
-     1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1261, 1261,
-     1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
-     1261, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266,
-     1266, 1266, 1266, 1266, 1271, 1271, 1271, 1271, 1271, 1271,
-     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1276, 1276, 1276,
-     1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276,
-
-     1281, 1281, 2855, 1281, 1281, 1281, 1281, 1281, 1281, 1281,
-     1281, 1281, 1281, 1282, 1282, 1282, 1282, 1282, 1282, 1282,
-     1282, 1282, 1282, 1282, 1282, 1282, 1287, 1287, 1287, 1287,
-     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1292,
-     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292,
-     1292, 1292,  714,  714, 2855,  714,  714,  714,  714,  714,
-      714,  714,  714,  714,  714, 1297, 1297, 2855, 1297, 1297,
-     1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297,  730,  730,
-      730,  730,  730,  730,  730,  730,  730,  730,  730,  730,
-      730, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027,
-
-     1027, 1027, 1027, 1027, 1032, 1032, 1032, 1032, 1032, 1032,
-     1032, 1032, 1032, 1032, 1032, 1032, 1032, 1037, 1037, 1037,
-     1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
-     1298, 1298, 1298, 1298, 1298, 1298, 1298, 1298, 1298, 1298,
-     1298, 1298, 1298, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
-     1303, 1303, 1303, 1303, 1303, 1303, 1308, 1308, 1308, 1308,
-     1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1313,
-     1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313,
-     1313, 1313, 1318, 1318, 2855, 1318, 1318, 1318, 1318, 1318,
-     1318, 1318, 1318, 1318, 1318, 1319, 1319, 1319, 1319, 1319,
+      350,  350,  350,  350,  350,  350,  350,  350,  350,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  352,  352,
+      352,  352,  352,  352,  353,  353,  353,  354,  169,  169,
+      355,  355,  181,  355,  182,  356,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
+      355,  355,  355,  169,  169,  169,  169,  169,  169,  169,
+
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  357,  357,  357,  357,  357,  357,  358,  358,
+      358,  359,  169,  169,  169,  361,  726,  362,  176,  364,
+      365,  492,  366,  367,  364,  365,  872,  366,  367,  181,
+      493,  182,  176,  169,  374,  873,  375,  176,  503,  169,
+      374,  364,  375,  176,  504,  726,  364,  368,  368,  181,
+      368,  182,  369,  368,  368,  368,  368,  368,  368,  368,
+      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
+      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
+      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
 
-     1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1324, 1324,
-     1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324,
-     1324, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
-     1329, 1329, 1329, 1329,  718,  718, 2855,  718,  718,  718,
-      718,  718,  718,  718,  718,  718,  718,  745,  745, 2855,
-      745,  745,  745,  745,  745,  745,  745,  745,  745,  745,
-      751,  751, 2855,  751,  751,  751,  751,  751,  751,  751,
-      751,  751,  751,  757,  757, 2855,  757,  757,  757,  757,
-      757,  757,  757,  757,  757,  757,  763,  763, 2855,  763,
-      763,  763,  763,  763,  763,  763,  763,  763,  763,  771,
-
-      771, 2855,  771,  771,  771,  771,  771,  771,  771,  771,
-      771,  771,  779,  779, 2855,  779,  779,  779,  779,  779,
-      779,  779,  779,  779,  779,  787,  787, 2855,  787,  787,
-      787,  787,  787,  787,  787,  787,  787,  787,  793,  793,
-     2855,  793,  793,  793,  793,  793,  793,  793,  793,  793,
-      793,  799,  799, 2855,  799,  799,  799,  799,  799,  799,
-      799,  799,  799,  799,  805,  805, 2855,  805,  805,  805,
-      805,  805,  805,  805,  805,  805,  805,  809,  809, 2855,
-      809,  809,  809,  809,  809,  809,  809,  809,  809,  809,
-      815,  815, 2855,  815,  815,  815,  815,  815,  815,  815,
-
-      815,  815,  815,  821,  821, 2855,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  827,  827, 2855,  827,
-      827,  827,  827,  827,  827,  827,  827,  827,  827,  830,
-      830, 2855,  830,  830,  830,  830,  830,  830,  830,  830,
-      830,  830,  836,  836, 2855,  836,  836,  836,  836,  836,
-      836,  836,  836,  836,  836,  842,  842, 2855,  842,  842,
-      842,  842,  842,  842,  842,  842,  842,  842,  443,  443,
-      443,  443,  443, 2855,  443,  443,  443,  443, 1341, 1341,
-     1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
-     1341, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352,
-
-     1352, 1352, 1352, 1352, 1381, 1381, 1381, 1381, 1381, 1381,
-     1381, 1381, 1381, 1381, 1381, 1381, 1381, 1117, 1117, 1117,
-     1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
-      542,  542, 2855,  542,  542,  542,  542,  542,  542,  542,
-      542,  542,  542,  543,  543, 2855,  543,  543,  543,  543,
-      543,  543,  543,  543,  543,  543, 1445, 1445, 1445, 1445,
-     1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1526,
-     1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
-     1526, 1526, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 1583,  544,  544, 2855,  544,  544,
-
-      544,  544,  544,  544,  544,  544,  544,  544,  710,  710,
-      710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
-      710, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
-     1008, 1008, 1008, 1008, 1013, 1013, 1013, 1013, 1013, 1013,
-     1013, 1013, 1013, 1013, 1013, 1013, 1013, 1018, 1018, 1018,
-     1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018,
-     1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
-     1261, 1261, 1261, 1266, 1266, 1266, 1266, 1266, 1266, 1266,
-     1266, 1266, 1266, 1266, 1266, 1266, 1271, 1271, 1271, 1271,
-     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1276,
-
-     1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276,
-     1276, 1276, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282,
-     1282, 1282, 1282, 1282, 1282, 1287, 1287, 1287, 1287, 1287,
-     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1292, 1292,
-     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292,
-     1292, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599,
-     1599, 1599, 1599, 1599, 1604, 1604, 1604, 1604, 1604, 1604,
-     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1609, 1609, 1609,
-     1609, 1609, 1609, 1609, 1609, 1609, 1609, 1609, 1609, 1609,
-     1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614,
-
-     1614, 1614, 1614, 1619, 1619, 1619, 1619, 1619, 1619, 1619,
-     1619, 1619, 1619, 1619, 1619, 1619, 1624, 1624, 1624, 1624,
-     1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624,  714,
-      714, 2855,  714,  714,  714,  714,  714,  714,  714,  714,
-      714,  714,  730,  730,  730,  730,  730,  730,  730,  730,
-      730,  730,  730,  730,  730, 1027, 1027, 1027, 1027, 1027,
-     1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1032, 1032,
-     1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032,
-     1032, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
-     1037, 1037, 1037, 1037, 1298, 1298, 1298, 1298, 1298, 1298,
-
-     1298, 1298, 1298, 1298, 1298, 1298, 1298, 1303, 1303, 1303,
-     1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
-     1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308,
-     1308, 1308, 1308, 1313, 1313, 1313, 1313, 1313, 1313, 1313,
-     1313, 1313, 1313, 1313, 1313, 1313, 1319, 1319, 1319, 1319,
-     1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1324,
-     1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324,
-     1324, 1324, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
-     1329, 1329, 1329, 1329, 1329, 1629, 1629, 1629, 1629, 1629,
-     1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1634, 1634,
-
-     1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634,
-     1634, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
-     1639, 1639, 1639, 1639, 1644, 1644, 1644, 1644, 1644, 1644,
-     1644, 1644, 1644, 1644, 1644, 1644, 1644, 1649, 1649, 1649,
-     1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649,
-     1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
-     1654, 1654, 1654,  443,  443,  443,  443,  443, 2855,  443,
-      443,  443,  443,  542,  542, 2855,  542,  542,  542,  542,
-      542,  542,  542,  542,  542,  542,  543,  543, 2855,  543,
-      543,  543,  543,  543,  543,  543,  543,  543,  543, 1341,
-
-     1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
-     1341, 1341, 1352, 1352, 1352, 1352, 1352, 1352, 1352, 1352,
-     1352, 1352, 1352, 1352, 1352, 1381, 1381, 1381, 1381, 1381,
-     1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1391, 1391,
-     1391, 1391, 1391, 1391, 1391, 1391, 2855, 1391, 1391, 1391,
-     1391, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399,
-     1399, 1399, 1399, 1399, 1708, 1708, 1708, 1708, 1708, 1708,
-     1708, 1708, 1708, 1708, 1708, 1708, 1708, 1454, 1454, 1454,
-     1454, 1454, 1454, 1454, 1454, 2855, 1454, 1454, 1454, 1454,
-     1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526,
-
-     1526, 1526, 1526, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
-     1834, 1834, 1834, 1834, 1834, 1834, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583,  710,
-      710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
-      710,  710, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
-     1008, 1008, 1008, 1008, 1008, 1013, 1013, 1013, 1013, 1013,
-     1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1018, 1018,
-     1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018,
-     1018, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
-     1261, 1261, 1261, 1261, 1266, 1266, 1266, 1266, 1266, 1266,
-
-     1266, 1266, 1266, 1266, 1266, 1266, 1266, 1271, 1271, 1271,
-     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
-     1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276,
-     1276, 1276, 1276, 1282, 1282, 1282, 1282, 1282, 1282, 1282,
-     1282, 1282, 1282, 1282, 1282, 1282, 1287, 1287, 1287, 1287,
-     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1292,
-     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292,
-     1292, 1292, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599,
-     1599, 1599, 1599, 1599, 1599, 1604, 1604, 1604, 1604, 1604,
-     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1609, 1609,
-
-     1609, 1609, 1609, 1609, 1609, 1609, 1609, 1609, 1609, 1609,
-     1609, 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1614,
-     1614, 1614, 1614, 1614, 1619, 1619, 1619, 1619, 1619, 1619,
-     1619, 1619, 1619, 1619, 1619, 1619, 1619, 1624, 1624, 1624,
-     1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624,
-      730,  730,  730,  730,  730,  730,  730,  730,  730,  730,
-      730,  730,  730, 1027, 1027, 1027, 1027, 1027, 1027, 1027,
-     1027, 1027, 1027, 1027, 1027, 1027, 1032, 1032, 1032, 1032,
-     1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1037,
-     1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
-
-     1037, 1037, 1298, 1298, 1298, 1298, 1298, 1298, 1298, 1298,
-     1298, 1298, 1298, 1298, 1298, 1303, 1303, 1303, 1303, 1303,
-     1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1308, 1308,
-     1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308,
-     1308, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313,
-     1313, 1313, 1313, 1313, 1319, 1319, 1319, 1319, 1319, 1319,
-     1319, 1319, 1319, 1319, 1319, 1319, 1319, 1324, 1324, 1324,
-     1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324,
-     1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
-     1329, 1329, 1329, 1629, 1629, 1629, 1629, 1629, 1629, 1629,
-
-     1629, 1629, 1629, 1629, 1629, 1629, 1634, 1634, 1634, 1634,
-     1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1639,
-     1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639,
-     1639, 1639, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644,
-     1644, 1644, 1644, 1644, 1644, 1649, 1649, 1649, 1649, 1649,
-     1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1654, 1654,
-     1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654, 1654,
-     1654,  718,  718,  718,  718,  718,  718,  718,  718,  718,
-      718,  718,  718,  443,  443,  443,  443,  443, 2855,  443,
-      443,  443,  443, 1352, 1352, 1352, 1352, 1352, 1352, 1352,
-
-     1352, 2855, 1352, 1352, 1352, 1352, 1391, 1391, 1391, 1391,
-     1391, 1391, 1391, 1391, 2855, 1391, 1391, 1391, 1391,  542,
-      542, 2855,  542,  542,  542,  542,  542,  542,  542,  542,
-      542,  542,  543,  543, 2855,  543,  543,  543,  543,  543,
-      543,  543,  543,  543,  543, 1708, 1708, 1708, 1708, 1708,
-     1708, 1708, 1708, 1708, 1708, 1708, 1708, 1708, 1979, 1979,
-     1979, 1979, 1979, 1979, 1979, 1979, 2855, 1979, 1979, 1979,
-     1979,  978,  978, 2855,  978,  978,  978,  978,  978,  978,
-      978,  978,  978,  978, 1990, 1990, 1990, 1990, 1990, 1990,
-     1990, 1990, 1990, 1990, 1990, 1990, 1990, 1454, 1454, 1454,
-
-     1454, 1454, 1454, 1454, 1454, 2855, 1454, 1454, 1454, 1454,
-     2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055,
-     2055, 2055, 2055, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
-     1834, 1834, 1834, 1834, 1834, 1834, 1583, 1583, 1583, 1583,
-     1583, 1583, 1583, 1583, 2855, 1583, 1583, 1583, 1583, 1381,
-     1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381,
-     1381, 1381, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445,
-     1445, 1445, 1445, 1445, 1445,  960,  960,  960,  960,  960,
-      960,  960,  960,  960,  960,  960,  960,  960, 2134, 2134,
-     2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134, 2134,
-
-     2134, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
-     1117, 1117, 1117, 1117, 1399, 1399, 1399, 1399, 1399, 1399,
-     1399, 1399, 1399, 1399, 1399, 1399, 1399, 2756, 2756, 2756,
-     2756, 2756, 2756, 2756, 2756, 2756, 2756, 2756, 2756, 2756,
-      121, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855
-    } ;
+      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  370,
+      370,  370,  370,  370,  370,  371,  371,  371,  372,  169,
+      169,  181, 2911,  182,  176,  181,  583,  182,  176,  169,
+      383,  583,  384,  176,  169,  383,  482,  384,  176,  483,
+      875,  876,  484,  485,  486,  488,  489,  593,  490,  869,
+      376,  491,  595,  870,  376,  377,  377,  181,  377,  182,
+      378,  377,  377,  377,  377,  377,  377,  377,  377,  377,
+      377,  377,  377,  377,  377,  377,  377,  377,  377,  377,
 
-static yyconst flex_int16_t yy_chk[26526] =
-    {   0,
-        0,    1,    1,  318,    1,    1,    1,  318,    1,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    3,    3,    3,    3,    3,    3,    3,
+      377,  377,  377,  377,  377,  377,  377,  377,  377,  377,
+      377,  377,  377,  377,  377,  377,  377,  377,  377,  377,
+      377,  377,  377,  377,  377,  377,  377,  377,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  379,  379,  379,
+      379,  379,  379,  380,  380,  380,  381,  169,  169,  181,
+     2910,  182,  176,  181,  494,  182,  176,  545,  181,  452,
+      182,  176,  495,  452,  505,  893,  882,  496,  506,  883,
+      546,  547,  507,  548,  497,  928,  501,  508,  385,  408,
+      453,  929,  385,  386,  386,  181,  386,  182,  387,  386,
 
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  388,  388,  388,  388,  388,
+      388,  389,  389,  389,  390,  169,  169,  391,  391,  181,
+      391,  182,  392,  391,  391,  391,  391,  391,  391,  391,
+      391,  391,  391,  391,  391,  391,  391,  391,  391,  391,
 
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    7,  142,    7,    7,    8,  142,    8,    8,    9,
-        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
+      391,  391,  391,  391,  391,  391,  391,  391,  391,  391,
+      391,  391,  391,  391,  391,  391,  391,  391,  391,  391,
+      391,  391,  391,  391,  391,  391,  391,  391,  391,  391,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  393,
+      393,  393,  393,  393,  393,  394,  394,  394,  395,  169,
+      169,  396,  396,  181,  396,  182,  397,  396,  396,  396,
+      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
+      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
+      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
+
+      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
+      396,  396,  396,  396,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  398,  398,  398,  398,  398,  398,  399,
+      399,  399,  400,  169,  169,  401,  401,  402,  401,  403,
+      404,  401,  401,  401,  401,  401,  401,  401,  401,  401,
+      401,  401,  401,  401,  401,  401,  401,  401,  401,  401,
+      401,  401,  401,  401,  401,  401,  401,  401,  401,  401,
+      401,  401,  401,  401,  401,  401,  401,  401,  401,  401,
+      401,  401,  401,  401,  401,  401,  401,  401,  169,  169,
+
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  405,  405,  405,
+      405,  405,  405,  406,  406,  406,  407,  169,  169,  181,
+      499,  182,  176,  542, 2908,  543,  500,  553,  553,  553,
+      553,  553,  553,  554,  554,  554,  555,  501, 2907,  502,
+      408,  409,  409,  181,  409,  182,  410,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+
+      409,  409,  409,  409,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  411,  411,  411,  411,  411,  411,  412,
+      412,  412,  413,  169,  169,  414,  414,  181,  414,  182,
+      415,  414,  414,  414,  414,  414,  414,  414,  414,  414,
+      414,  414,  414,  414,  414,  414,  414,  414,  414,  414,
+      414,  414,  414,  414,  414,  414,  414,  414,  414,  414,
+      414,  414,  414,  414,  414,  414,  414,  414,  414,  414,
+      414,  414,  414,  414,  414,  414,  414,  414,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+
+      169,  169,  169,  169,  169,  169,  169,  416,  416,  416,
+      416,  416,  416,  417,  417,  417,  418,  169,  169,  419,
+      419,  181,  419,  182,  420,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  421,  421,  421,  421,  421,  421,  422,  422,  422,
+
+      423,  169,  169,  424,  424,  181,  424,  182,  425,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  424,  424,  424,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  426,  426,  426,  426,  426,
+      426,  427,  427,  427,  428,  169,  169,  429,  429,  181,
+      429,  182,  430,  429,  429,  429,  429,  429,  429,  429,
+
+      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
+      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
+      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
+      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  431,
+      431,  431,  431,  431,  431,  432,  432,  432,  433,  169,
+      169,  434,  434,  181,  434,  182,  435,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  436,  436,  436,  436,  436,  436,  437,
+      437,  437,  438,  169,  169,  439,  439,  181,  439,  182,
+      440,  439,  439,  439,  439,  439,  439,  439,  439,  439,
+      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
+      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
+      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
+
+      439,  439,  439,  439,  439,  439,  439,  439,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  441,  441,  441,
+      441,  441,  441,  442,  442,  442,  443,  169,  169,  444,
+      444,  181,  444,  182,  445,  444,  444,  444,  444,  444,
+      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
+      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
+      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
+      444,  444,  444,  444,  444,  444,  444,  444,  444,  444,
+      444,  444,  169,  169,  169,  169,  169,  169,  169,  169,
+
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      169,  446,  446,  446,  446,  446,  446,  447,  447,  447,
+      448,  169,  169,  451,  514,  520,  714,  452,  726,  521,
+      865,  897,  866,  898,  715,  910,  716,  515,  522,  523,
+      516,  517,  524,  518,  453,  726,  525,  911,  903,  526,
+      527,  488,  489,  956,  490,  528,  529,  491,  957,  530,
+      531,  532,  534,  535,  714,  533,  536,  900,  537,  904,
+      538,  901,  715,  938,  716,  539,  939,  540, 2905,  541,
+      571,  571,  571,  571,  571,  571,  572,  572,  572,  573,
+     2912,  984, 2904,  985,  454,  454,  454,  454,  454,  454,
+
+      455,  455,  455,  456,  450,  457,  450,  450,  450,  458,
+     2912,  450, 2902,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  453,  450,  450,  450,
+      459,  460,  461,  462,  463,  464,  450,  465,  466,  450,
+      467,  468,  469,  470,  471,  472,  473,  474,  475,  476,
+      477,  478,  450,  450,  479,  450,  450,  571,  571,  571,
+      571,  571,  571,  572,  572,  572,  573,  482,  480,  584,
+      483, 2901,  481,  484,  485,  486,  454,  454,  454,  454,
+      454,  454,  455,  455,  455,  456,  451,  942,  545, 2912,
+      452,  577,  577,  577,  577,  577,  577,  578,  578,  578,
+
+      579,  546,  547,  450,  548,  943, 1249,  453,  577,  577,
+      577,  577,  577,  577,  578,  578,  578,  579,  589,  589,
+      589,  589,  589,  589,  590,  590,  590,  591,  597,  597,
+      597,  597,  597,  597,  598,  598,  598,  599,  597,  597,
+      597,  597,  597,  597,  598,  598,  598,  599,  940,  949,
+      971,  583,  958,  950,  941,  972, 2899,  454,  454,  454,
+      454,  454,  454,  455,  455,  455,  456, 2912,  959,  450,
+     1107,  450,  593,  450,  603,  603,  603,  603,  603,  603,
+      604,  604,  604,  605,  603,  603,  603,  603,  603,  603,
+      604,  604,  604,  605,  609,  609,  609,  609,  609,  609,
+
+      610,  610,  610,  611,  609,  609,  609,  609,  609,  609,
+      610,  610,  610,  611, 1083,  450,  450, 1096,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  615,  615,  615,
+      615,  615,  615,  616,  616,  616,  617,  450,  450,  560,
+      561,  562,  560,  560,  561,  560,  560,  560,  560,  560,
+      560,  563,  560,  560,  560,  560,  560,  560,  560,  564,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+
+      560,  560,  562,  562,  562,  562,  562,  562,  562,  562,
+      562,  562,  562,  562,  562,  562,  562,  562,  562,  562,
+      562,  565,  565,  565,  565,  565,  565,  566,  566,  566,
+      567,  562,  562,  563,  615,  615,  615,  615,  615,  615,
+      616,  616,  616,  617,  621,  621,  621,  621,  621,  621,
+      622,  622,  622,  623,  621,  621,  621,  621,  621,  621,
+      622,  622,  622,  623,  627,  627,  627,  627,  627,  627,
+      628,  628,  628,  629,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  568,  568,  568,  568,  568,  568,  568,
+
+      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
+      568,  568,  569,  569,  569,  569,  569,  569,  569,  569,
+      569,  569,  569,  569,  569,  569,  569,  569,  569,  569,
+      569,  570,  627,  627,  627,  627,  627,  627,  628,  628,
+      628,  629,  633,  633,  633,  633,  633,  633,  634,  634,
+      634,  635,  633,  633,  633,  633,  633,  633,  634,  634,
+      634,  635,  639,  639,  639,  639,  639,  639,  640,  640,
+      640,  641,  962,  717, 1082, 1108,  450,  717,  450,  963,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  639,
+
+      639,  639,  639,  639,  639,  640,  640,  640,  641,  570,
+      570,  576,  645,  645,  645,  645,  645,  645,  646,  646,
+      646,  647,  645,  645,  645,  645,  645,  645,  646,  646,
+      646,  647,  651,  651,  651,  651,  651,  651,  652,  652,
+      652,  653,  651,  651,  651,  651,  651,  651,  652,  652,
+      652,  653,  450,  450, 1109,  450, 1177, 1094,  450, 1095,
+      576,  576,  576,  576,  576,  576,  576,  576,  576,  576,
+      576,  576,  576,  576,  576,  576,  576,  576,  576,  657,
+      657,  657,  657,  657,  657,  658,  658,  658,  659,  576,
+      576,  582,  582,  583,  582,  583,  582,  582,  582,  582,
+
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  584,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  583,  583,  583,  583,  583,  583,
+      583,  583,  583,  583,  583,  583,  583,  583,  583,  583,
+      583,  583,  583,  585,  585,  585,  585,  585,  585,  586,
+      586,  586,  587,  583,  583,  582,  657,  657,  657,  657,
+      657,  657,  658,  658,  658,  659,  907,  912,  988,  450,
+      908,  913,  989, 1111,  588,  665,  665,  665,  665,  665,
+
+      665,  666,  666,  666,  667,  665,  665,  665,  665,  665,
+      665,  666,  666,  666,  667, 1087,  914,  450, 1110,  450,
+     1118,  990,  909,  450,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  596,  671,  671,  671,  671,
+      671,  671,  672,  672,  672,  673,  671,  671,  671,  671,
+      671,  671,  672,  672,  672,  673,  677,  677,  677,  677,
+      677,  677,  678,  678,  678,  679,  677,  677,  677,  677,
+      677,  677,  678,  678,  678,  679,  450,  450,  450, 1225,
+
+      450, 1098,  984,  871,  596,  596,  596,  596,  596,  596,
+      596,  596,  596,  596,  596,  596,  596,  596,  596,  596,
+      596,  596,  596,  683,  683,  683,  683,  683,  683,  684,
+      684,  684,  685,  596,  596,  602,  683,  683,  683,  683,
+      683,  683,  684,  684,  684,  685,  690,  690,  690,  690,
+      690,  690,  691,  691,  691,  692,  690,  690,  690,  690,
+      690,  690,  691,  691,  691,  692,  696,  696,  696,  696,
+      696,  696,  697,  697,  697,  698,  450,  450,  450, 1453,
+     1453, 1155, 1124, 1254,  602,  602,  602,  602,  602,  602,
+      602,  602,  602,  602,  602,  602,  602,  602,  602,  602,
+
+      602,  602,  602,  696,  696,  696,  696,  696,  696,  697,
+      697,  697,  698,  602,  602,  608,  702,  702,  702,  702,
+      702,  702,  703,  703,  703,  704,  702,  702,  702,  702,
+      702,  702,  703,  703,  703,  704,  708,  708,  708,  708,
+      708,  708,  709,  709,  709,  710,  708,  708,  708,  708,
+      708,  708,  709,  709,  709,  710,  991, 1219, 2898, 1385,
+      992,  450,  583,  583,  608,  608,  608,  608,  608,  608,
+      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
+      608,  608,  608,  595, 1003,  450,  450,  726,  714, 2896,
+      450,  871, 1185,  608,  608,  614,  715,  993,  716,  719,
+
+      719,  719,  719,  719,  719,  720,  720,  720,  721,  723,
+      723,  723,  723,  723,  723,  724,  724,  724,  725,  727,
+      728,  729,  730,  731,  732,  733,  734,  735,  736,  739,
+      739,  739,  739,  739,  739,  740,  740,  740,  741, 2912,
+     2912, 1388, 2894,  450,  614,  614,  614,  614,  614,  614,
+      614,  614,  614,  614,  614,  614,  614,  614,  614,  614,
+      614,  614,  614,  754,  754,  754,  754,  754,  754,  755,
+      755,  755,  756,  614,  614,  620,  754,  754,  754,  754,
+      754,  754,  755,  755,  755,  756,  760,  760,  760,  760,
+      760,  760,  761,  761,  761,  762,  760,  760,  760,  760,
+
+      760,  760,  761,  761,  761,  762,  766,  766,  766,  766,
+      766,  766,  767,  767,  767,  768,  450,  450,  450, 1444,
+     1429,  450, 1247, 1248,  620,  620,  620,  620,  620,  620,
+      620,  620,  620,  620,  620,  620,  620,  620,  620,  620,
+      620,  620,  620,  766,  766,  766,  766,  766,  766,  767,
+      767,  767,  768,  620,  620,  626,  772,  772,  772,  772,
+      772,  772,  773,  773,  773,  774,  772,  772,  772,  772,
+      772,  772,  773,  773,  773,  774,  780,  780,  780,  780,
+      780,  780,  781,  781,  781,  782,  780,  780,  780,  780,
+      780,  780,  781,  781,  781,  782,  450,  450, 1356, 1461,
+
+     1268,  450, 1356, 1269,  626,  626,  626,  626,  626,  626,
+      626,  626,  626,  626,  626,  626,  626,  626,  626,  626,
+      626,  626,  626,  788,  788,  788,  788,  788,  788,  789,
+      789,  789,  790,  626,  626,  632,  788,  788,  788,  788,
+      788,  788,  789,  789,  789,  790,  796,  796,  796,  796,
+      796,  796,  797,  797,  797,  798,  796,  796,  796,  796,
+      796,  796,  797,  797,  797,  798,  802,  802,  802,  802,
+      802,  802,  803,  803,  803,  804, 1357, 1430,  450,  450,
+     1357, 1571,  450, 1443,  632,  632,  632,  632,  632,  632,
+      632,  632,  632,  632,  632,  632,  632,  632,  632,  632,
+
+      632,  632,  632,  802,  802,  802,  802,  802,  802,  803,
+      803,  803,  804,  632,  632,  638,  808,  808,  808,  808,
+      808,  808,  809,  809,  809,  810,  808,  808,  808,  808,
+      808,  808,  809,  809,  809,  810,  818,  818,  818,  818,
+      818,  818,  819,  819,  819,  820,  818,  818,  818,  818,
+      818,  818,  819,  819,  819,  820, 1432, 1433, 1481, 1517,
+      450,  450,  450,  450,  638,  638,  638,  638,  638,  638,
+      638,  638,  638,  638,  638,  638,  638,  638,  638,  638,
+      638,  638,  638,  824,  824,  824,  824,  824,  824,  825,
+      825,  825,  826,  638,  638,  644,  824,  824,  824,  824,
+
+      824,  824,  825,  825,  825,  826,  830,  830,  830,  830,
+      830,  830,  831,  831,  831,  832,  830,  830,  830,  830,
+      830,  830,  831,  831,  831,  832,  839,  839,  839,  839,
+      839,  839,  840,  840,  840,  841,  450,  450, 1525, 1527,
+      450,  450, 1460, 1434,  644,  644,  644,  644,  644,  644,
+      644,  644,  644,  644,  644,  644,  644,  644,  644,  644,
+      644,  644,  644,  839,  839,  839,  839,  839,  839,  840,
+      840,  840,  841,  644,  644,  650,  845,  845,  845,  845,
+      845,  845,  846,  846,  846,  847,  845,  845,  845,  845,
+      845,  845,  846,  846,  846,  847,  851,  851,  851,  851,
+
+      851,  851,  852,  852,  852,  853,  851,  851,  851,  851,
+      851,  851,  852,  852,  852,  853,  726,  726, 1500, 1528,
+     2893,  450, 1501,  726,  650,  650,  650,  650,  650,  650,
+      650,  650,  650,  650,  650,  650,  650,  650,  650,  650,
+      650,  650,  650,  857,  857,  857,  857,  857,  857,  858,
+      858,  858,  859,  650,  650,  656,  857,  857,  857,  857,
+      857,  857,  858,  858,  858,  859,  494,  505,  863, 2890,
+      499,  506,  521, 1127,  495,  507,  500,  514, 2912,  496,
+      508,  522,  450,  887,  924, 2912,  497,  501,  925,  502,
+      862,  888,  726,  516,  517,  878,  518,  889,  450,  879,
+
+      726,  890,  891, 1487,  656,  656,  656,  656,  656,  656,
+      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
+      656,  656,  656,  524,  917,  880,  926,  525,  918, 1097,
+      526,  527, 2889,  656,  656,  664,  528,  529,  881,  450,
+      530,  531,  532,  534,  535,  714,  533,  536, 2888,  537,
+      561,  538, 1184,  715,  561,  716,  539,  919,  540, 1093,
+      541,  450,  920,  944,  714, 2912,  953,  945,  921,  998,
+      954,  450,  715, 1084,  716,  965,  450, 1085,  930,  966,
+     2886,  450,  931, 1490,  664,  664,  664,  664,  664,  664,
+      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
+
+      664,  664,  664,  932,  946,  584, 1252,  947,  955,  933,
+      450, 1086,  967,  664,  664,  670,  968, 1117,  450,  969,
+     1549, 2885,  450,  934,  571,  571,  571,  571,  571,  571,
+      572,  572,  572,  573,  577,  577,  577,  577,  577,  577,
+      578,  578,  578,  579, 1119, 1123,  450,  584, 1561, 2881,
+      450, 1524,  450,  450,  589,  589,  589,  589,  589,  589,
+      590,  590,  590,  591,  670,  670,  670,  670,  670,  670,
+      670,  670,  670,  670,  670,  670,  670,  670,  670,  670,
+      670,  670,  670,  597,  597,  597,  597,  597,  597,  598,
+      598,  598,  599,  670,  670,  676,  589,  589,  589,  589,
+
+      589,  589,  590,  590,  590,  591,  603,  603,  603,  603,
+      603,  603,  604,  604,  604,  605,  609,  609,  609,  609,
+      609,  609,  610,  610,  610,  611,  615,  615,  615,  615,
+      615,  615,  616,  616,  616,  617,  450, 1491, 1567, 2880,
+      450, 1492, 1448,  450,  676,  676,  676,  676,  676,  676,
+      676,  676,  676,  676,  676,  676,  676,  676,  676,  676,
+      676,  676,  676,  621,  621,  621,  621,  621,  621,  622,
+      622,  622,  623,  676,  676,  682,  627,  627,  627,  627,
+      627,  627,  628,  628,  628,  629,  633,  633,  633,  633,
+      633,  633,  634,  634,  634,  635,  639,  639,  639,  639,
+
+      639,  639,  640,  640,  640,  641,  645,  645,  645,  645,
+      645,  645,  646,  646,  646,  647,  514,  863,  450, 1620,
+     1586,  450,  450,  450,  682,  682,  682,  682,  682,  682,
+      682,  682,  682,  682,  682,  682,  682,  682,  682,  682,
+      682,  682,  682,  651,  651,  651,  651,  651,  651,  652,
+      652,  652,  653,  682,  682,  689,  657,  657,  657,  657,
+      657,  657,  658,  658,  658,  659,  665,  665,  665,  665,
+      665,  665,  666,  666,  666,  667,  671,  671,  671,  671,
+      671,  671,  672,  672,  672,  673,  677,  677,  677,  677,
+      677,  677,  678,  678,  678,  679,  450, 1570, 1356, 1593,
+
+     1593, 1570, 1356,  546,  689,  689,  689,  689,  689,  689,
+      689,  689,  689,  689,  689,  689,  689,  689,  689,  689,
+      689,  689,  689,  683,  683,  683,  683,  683,  683,  684,
+      684,  684,  685,  689,  689,  695,  690,  690,  690,  690,
+      690,  690,  691,  691,  691,  692,  696,  696,  696,  696,
+      696,  696,  697,  697,  697,  698,  702,  702,  702,  702,
+      702,  702,  703,  703,  703,  704,  708,  708,  708,  708,
+      708,  708,  709,  709,  709,  710, 1023, 1559, 1357, 2132,
+     2877, 2133, 1357,  450,  695,  695,  695,  695,  695,  695,
+      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
+
+      695,  695,  695,  727,  728,  729,  730,  731,  732,  733,
+      734,  735,  736,  695,  695,  701,  754,  754,  754,  754,
+      754,  754,  755,  755,  755,  756,  718, 1125, 1262, 1237,
+     1126, 1025,  879,  583, 2147, 2147,  879,  450,  450,  450,
+      450,  719,  719,  719,  719,  719,  719,  720,  720,  720,
+      721,  718, 1215,  453,  588,  451, 1030, 1359, 2875,  452,
+      450,  450,  738, 1042,  701,  701,  701,  701,  701,  701,
+      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
+      701,  701,  701,  739,  739,  739,  739,  739,  739,  740,
+      740,  740,  741,  701,  701,  707, 1026, 1026, 1026, 1026,
+
+     1026, 1026, 1027, 1027, 1027, 1028,  718, 1226,  450,  450,
+     1242, 1035, 1044, 1220, 2874,  450,  738, 1267, 1221,  450,
+      450, 1031, 1031, 1031, 1031, 1031, 1031, 1032, 1032, 1032,
+     1033, 1523, 1045, 1045, 1045, 1045, 1045, 1045, 1046, 1046,
+     1046, 1047,  726, 2870,  707,  707,  707,  707,  707,  707,
+      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
+      707,  707,  707,  869,  878,  878, 1049,  870,  879,  879,
+     2773, 2773, 2869,  707,  707,  744, 1036, 1036, 1036, 1036,
+     1036, 1036, 1037, 1037, 1037, 1038, 1050, 1050, 1050, 1050,
+     1050, 1050, 1051, 1051, 1051, 1052,  738,  726, 1099,  450,
+
+      450,  450,  450,  451, 1091,  450, 2912,  452, 2912, 2912,
+     1396, 2912,  745,  746,  746, 1369,  747,  748,  749,  750,
+      750,  750,  750,  750,  750,  750,  750,  750,  750,  750,
+      750,  750,  750,  750,  750,  750,  750,  750,  750,  750,
+      753,  507,  450,  500, 1817,  450, 1054, 1116, 2912,  907,
+     1270, 2912, 1387,  908,  501, 2912, 1488, 1383,  450,  450,
+     2912, 1384, 1818, 2868, 2912, 1489, 1055, 1055, 1055, 1055,
+     1055, 1055, 1056, 1056, 1056, 1057,  760,  760,  760,  760,
+      760,  760,  761,  761,  761,  762, 1143, 2866,  450,  753,
+      753,  753,  753,  753,  753,  753,  753,  753,  753,  753,
+
+      753,  753,  753,  753,  753,  753,  753,  753,  766,  766,
+      766,  766,  766,  766,  767,  767,  767,  768,  753,  753,
+      759,  772,  772,  772,  772,  772,  772,  773,  773,  773,
+      774,  780,  780,  780,  780,  780,  780,  781,  781,  781,
+      782,  788,  788,  788,  788,  788,  788,  789,  789,  789,
+      790,  796,  796,  796,  796,  796,  796,  797,  797,  797,
+      798,  450,  450, 2775, 2775, 2777, 2777, 1585, 1519,  759,
+      759,  759,  759,  759,  759,  759,  759,  759,  759,  759,
+      759,  759,  759,  759,  759,  759,  759,  759,  802,  802,
+      802,  802,  802,  802,  803,  803,  803,  804,  759,  759,
+
+      765,  808,  808,  808,  808,  808,  808,  809,  809,  809,
+      810,  818,  818,  818,  818,  818,  818,  819,  819,  819,
+      820,  824,  824,  824,  824,  824,  824,  825,  825,  825,
+      826,  830,  830,  830,  830,  830,  830,  831,  831,  831,
+      832,  450, 1600, 2864, 2863, 2862, 2858, 1560,  450,  765,
+      765,  765,  765,  765,  765,  765,  765,  765,  765,  765,
+      765,  765,  765,  765,  765,  765,  765,  765,  839,  839,
+      839,  839,  839,  839,  840,  840,  840,  841,  765,  765,
+      771,  845,  845,  845,  845,  845,  845,  846,  846,  846,
+      847,  851,  851,  851,  851,  851,  851,  852,  852,  852,
+
+      853,  857,  857,  857,  857,  857,  857,  858,  858,  858,
+      859,  450, 1390, 2854,  450, 2853,  450,  450,  450, 1113,
+      450, 1389, 1391, 1114, 1431, 1392, 1438, 1439, 1495,  771,
+      771,  771,  771,  771,  771,  771,  771,  771,  771,  771,
+      771,  771,  771,  771,  771,  771,  771,  771, 1088,  870,
+     1100, 1103, 1089,  870, 1101, 1104,  450, 1120,  771,  771,
+      779, 1121, 1115, 2844,  450, 1140, 2842, 1128, 1090, 1141,
+      453, 1129,  925, 1105,  954, 1484,  925, 1427,  954, 1102,
+     1367, 1428, 1497, 2841, 1085,  450, 1122,  450,  450, 1130,
+     1092, 1498,  450,  453,  450,  453, 1131,  450, 1142,  912,
+
+     1182, 1363,  450,  913,  450, 1562, 2840, 1526,  450,  779,
+      779,  779,  779,  779,  779,  779,  779,  779,  779,  779,
+      779,  779,  779,  779,  779,  779,  779,  779,  908,  907,
+     1146, 1149,  908,  908, 1147, 1150, 1152, 2839,  779,  779,
+      787,  913,  912, 1156,  917,  913,  913, 1157,  918,  453,
+     1178, 2838, 1113, 1151, 1179, 1148, 1114, 1154, 1145,  450,
+     1493, 1494,  453, 1504, 1505, 1144,  450,  450,  450, 2837,
+      450,  531, 1383, 1216, 1506,  450, 1384, 1217, 1153,  450,
+      450, 1176, 1553,  450,  924, 2831, 1603, 1180,  925,  787,
+      787,  787,  787,  787,  787,  787,  787,  787,  787,  787,
+
+      787,  787,  787,  787,  787,  787,  787,  787,  917,  924,
+      450, 1200,  918,  925, 2830, 1201, 1183, 1218,  787,  787,
+      795,  450, 1203,  450, 1206,  944, 1204, 1222, 1207,  945,
+     1209, 1223,  450, 1616, 1210, 1158, 1159, 1181, 1691, 1202,
+      529, 2829, 1691, 1160, 2828, 1161,  450, 1162,  450, 1163,
+     1164, 1205, 1165, 1208, 1166, 1211, 1234, 1224, 1227,  450,
+     1235,  450, 1228, 1229,  450, 2827, 2823,  450, 2822,  795,
+      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
+      795,  795,  795,  795,  795,  795,  795,  795,  918, 2803,
+     1239, 1692,  918,  450, 1239, 1693, 2801, 1236,  795,  795,
+
+      801,  930, 1212,  966,  944,  931, 1213,  966,  945,  453,
+     1114,  453, 1241, 2912, 1114, 1167, 1168, 1435, 2799, 2797,
+     2557, 1436, 1214, 1169,  453, 1170, 1186, 1171, 1187, 1172,
+     1173,  453, 1174, 1243, 1175, 2557, 1188, 1244,  450,  450,
+     1189,  450, 1190, 1191, 1192, 1251, 2796, 1233,  450,  801,
+      801,  801,  801,  801,  801,  801,  801,  801,  801,  801,
+      801,  801,  801,  801,  801,  801,  801,  801,  931, 1238,
+      450, 2129,  931, 1239, 2795, 1245, 2794, 2130,  801,  801,
+      807,  945, 2793,  953,  953,  945,  965,  954,  954,  453,
+      966, 1240, 1383, 1193, 1134, 1194, 1384, 2792, 1134, 2778,
+
+     2770, 1204,  453, 1195,  975, 1204,  450, 1196,  975, 1197,
+     1198, 1199,  965, 1258, 1230, 1136,  966, 1259, 1231, 1232,
+      450,  450,  453,  450, 1261,  978, 2769, 1246, 1250,  807,
+      807,  807,  807,  807,  807,  807,  807,  807,  807,  807,
+      807,  807,  807,  807,  807,  807,  807,  807, 1255, 1253,
+      450, 1260, 1256, 1263, 2768, 2767, 2766, 1264,  807,  807,
+      817, 1271,  988,  989, 2764, 1272,  989,  989,  991,  991,
+     1696, 2759,  992,  992, 1697, 1265, 1213, 1257, 2757, 1217,
+     1213,  450, 1266, 1217,  453,  450, 1023, 1273, 1275, 2756,
+      450,  988, 2753, 1583, 2751,  989, 1543,  453,  450,  450,
+
+      453, 1274, 1276, 1023, 1084, 1278,  450, 1280, 1085,  817,
+      817,  817,  817,  817,  817,  817,  817,  817,  817,  817,
+      817,  817,  817,  817,  817,  817,  817,  817,  450,  992,
+     2749, 2747, 1698,  992, 1277,  450, 1699,  450,  817,  817,
+      823,  451, 1101, 1368, 1121,  452, 1101, 2745, 1121, 1615,
+      453,  719,  719,  719,  719,  719,  719,  720,  720,  720,
+      721, 2743,  718,  453, 2742,  453, 1279, 1025,  719,  719,
+      719,  719,  719,  719,  720,  720,  720,  721,  718, 1399,
+     2741, 1441,  451, 1030, 1688, 2740,  452, 2739, 1042,  823,
+      823,  823,  823,  823,  823,  823,  823,  823,  823,  823,
+
+      823,  823,  823,  823,  823,  823,  823,  823,  739,  739,
+      739,  739,  739,  739,  740,  740,  740,  741,  823,  823,
+      829,  727,  728,  729,  730,  731,  732,  733,  734,  735,
+      736, 2738, 1026, 1026, 1026, 1026, 1026, 1026, 1027, 1027,
+     1027, 1028,  718, 2737, 2736, 2719, 2711, 1035, 1031, 1031,
+     1031, 1031, 1031, 1031, 1032, 1032, 1032, 1033,  718, 2710,
+     1720,  451, 1707, 1025, 1721,  452, 1708, 2709, 1042,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  739,  739,
+      739,  739,  739,  739,  740,  740,  740,  741,  829,  829,
+
+      838, 2708, 1084, 1380, 1709, 1157, 1085, 1372, 2707, 1157,
+     2706, 2704, 1036, 1036, 1036, 1036, 1036, 1036, 1037, 1037,
+     1037, 1038,  718, 1381, 1375, 1382,  453, 1283, 1026, 1026,
+     1026, 1026, 1026, 1026, 1027, 1027, 1027, 1028,  718, 2699,
+     1687, 1100, 1449, 1288, 1393, 1101, 1450, 1486, 1394,  838,
+      838,  838,  838,  838,  838,  838,  838,  838,  838,  838,
+      838,  838,  838,  838,  838,  838,  838,  838, 2697, 1395,
+     1451, 2632,  450,  450, 2695,  450, 2694,  451,  838,  838,
+      844,  452, 1400, 1408, 1393, 1141,  451, 1104, 1394, 1141,
+      452, 2691, 1284, 1284, 1284, 1284, 1284, 1284, 1285, 1285,
+
+     1285, 1286,  718, 2689, 1404, 1409,  453, 1293, 1289, 1289,
+     1289, 1289, 1289, 1289, 1290, 1290, 1290, 1291,  718, 1700,
+      878, 1120, 1459, 1298,  879, 1121, 2685, 1712, 2681,  844,
+      844,  844,  844,  844,  844,  844,  844,  844,  844,  844,
+      844,  844,  844,  844,  844,  844,  844,  844, 2679, 1129,
+      451,  450,  450, 1129, 1724, 2678, 2677, 1397,  844,  844,
+      850,  451, 1442, 2676, 1150,  452, 1453, 1453, 1150, 2675,
+      453, 1454, 1294, 1294, 1294, 1294, 1294, 1294, 1295, 1295,
+     1295, 1296,  718, 2674, 2673, 1468, 1472, 1304, 1299, 1299,
+     1299, 1299, 1299, 1299, 1300, 1300, 1300, 1301,  718, 2672,
+
+     1100, 1455,  907, 1309, 1101, 1456,  908, 2656, 2654,  850,
+      850,  850,  850,  850,  850,  850,  850,  850,  850,  850,
+      850,  850,  850,  850,  850,  850,  850,  850, 2648, 2647,
+     1147,  450,  450,  450, 1147, 2646, 2645, 1398,  850,  850,
+      856, 1551, 1179, 1210, 1207, 1219, 1179, 1210, 1207, 2644,
+     2643,  453, 1305, 1305, 1305, 1305, 1305, 1305, 1306, 1306,
+     1306, 1307, 1552,  453,  453,  453, 2639, 1464, 1310, 1310,
+     1310, 1310, 1310, 1310, 1311, 1311, 1311, 1312,  718, 1515,
+     1120, 1538, 1713, 1314, 1121, 1541, 1714, 2637,  738,  856,
+      856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
+
+      856,  856,  856,  856,  856,  856,  856,  856, 1445, 1128,
+     1689,  450, 1446, 1129, 1690, 2635, 2633, 1440,  856,  856,
+      451, 1715, 2632, 2631,  452,  451, 1452, 1452, 1447,  452,
+     1370, 1130,  450, 1100, 2630, 2627,  738, 1101, 1044,  450,
+      450,  453, 1140, 1146, 2625, 2621, 1141, 1147, 1315, 1315,
+     1315, 1315, 1315, 1315, 1316, 1316, 1316, 1317, 1045, 1045,
+     1045, 1045, 1045, 1045, 1046, 1046, 1046, 1047,  738, 1719,
+     1694,  924, 1200,  450,  450,  925, 1201, 1726,  738, 1458,
+     1463, 1727, 2614, 1223, 1393,  912, 1049, 1223, 1394,  913,
+     2612,  454,  454,  454,  454,  454,  454,  455,  455,  455,
+
+      456,  451,  450,  450,  453,  452, 1050, 1050, 1050, 1050,
+     1050, 1050, 1051, 1051, 1051, 1052,  450, 2611, 1054,  738,
+     1557, 1710,  453, 2610, 1483,  451, 2609, 1146, 1044,  452,
+     1178, 1147, 1203,  738, 1179, 2608, 1204, 2607, 1055, 1055,
+     1055, 1055, 1055, 1055, 1056, 1056, 1056, 1057, 1045, 1045,
+     1045, 1045, 1045, 1045, 1046, 1046, 1046, 1047,  450, 2606,
+     2605,  450, 1725,  450, 1235, 2588, 2584, 1514, 1235, 1320,
+     1465, 2577,  454,  454,  454,  454,  454,  454,  455,  455,
+      455,  456, 2912, 1325, 2576,  453,  450, 2566,  450, 1321,
+     1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322, 1323, 2562,
+
+     2558, 2556,  738, 1326, 1326, 1326, 1326, 1326, 1326, 1327,
+     1327, 1327, 1328, 2555, 2552,  451, 1752, 1120,  451,  452,
+     1753, 1121,  452, 1156,  917, 1206, 1756, 1157,  918, 1207,
+     1757, 2545, 2543,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+      450,  450, 1330, 1178,  450,  450,  450, 1179, 1728, 1731,
+     1751, 2541,  450,  450,  457, 1485, 1539, 1509,  458, 2530,
+     2529, 2528, 1331, 1331, 1331, 1331, 1331, 1331, 1332, 1332,
+     1332, 1333, 1516, 1704,  450, 2527, 2526, 1705, 2525,  459,
+      460,  461,  462,  463,  464, 2524,  465,  466, 2523,  467,
+
+      468,  469,  470,  471,  472,  473,  474,  475,  476,  477,
+      478, 2500, 1706,  479,  973,  974,  973,  973,  973,  975,
+      976,  973,  976,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  977,  978,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  979,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  976,  976,  976,
+      976,  976,  976,  976,  976,  976,  976,  976,  976,  976,
+      976,  976,  976,  976,  976,  976,  980,  980,  980,  980,
+      980,  980,  981,  981,  981,  982,  976,  976,  560,  561,
+
+      562,  560,  560,  561,  560,  560,  560,  560,  560,  560,
+      563,  560,  560,  560,  560,  560,  560,  560,  564,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  562,  562,  562,  562,  562,  562,  562,  562,  562,
+      562,  562,  562,  562,  562,  562,  562,  562,  562,  562,
+      565,  565,  565,  565,  565,  565,  566,  566,  566,  567,
+      562,  562,  563, 1510, 1520, 1206, 1212, 1511, 1521, 1207,
+     1213, 1239, 1765, 2499, 2496, 1239, 1766, 1256,  452, 2495,
+
+     2486, 1256, 1262, 1512, 1522, 1767, 1214, 1455, 2485, 1767,
+     2484, 1456,  453, 1241,  450,  450,  450,  450,  453,  453,
+     2482, 1513, 1537,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  568,  568,  568,  568,  568,  568,  568,  568,
+      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
+      568,  569,  569,  569,  569,  569,  569,  569,  569,  569,
+      569,  569,  569,  569,  569,  569,  569,  569,  569,  569,
+      999,  999,  999,  999,  999,  999,  999,  999,  999,  999,
+      999,  999,  999,  999,  999,  999,  999,  999,  999,  570,
+
+     1128, 1200, 1544, 1209, 1129, 1201, 1545, 1210, 1216, 1445,
+     2481, 2477, 1217, 1446, 1367, 1554, 1613,  738, 1085, 1555,
+     1606, 1790, 1130,  451, 2476, 1791, 1186,  452, 1187, 1447,
+      738,  450,  450,  450,  450, 1363, 1188, 1608, 1614,  450,
+     1189, 1457, 1190, 1191, 1192, 1540,  450,  738,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570, 1335, 1203,  451,
+      451, 1701, 1204,  452,  452, 1702, 2473,  570,  570,  576,
+     1341, 1222, 1546, 2466, 1768, 1223, 1547, 1336, 1336, 1336,
+     1336, 1336, 1336, 1337, 1337, 1337, 1338, 1346, 1703,  450,
+
+     1342, 1342, 1342, 1342, 1342, 1342, 1343, 1343, 1343, 1344,
+     1548, 1558,  450,  450, 2465, 1536, 1803, 1347, 1347, 1347,
+     1347, 1347, 1347, 1348, 1348, 1348, 1349, 1042,  576,  576,
+      576,  576,  576,  576,  576,  576,  576,  576,  576,  576,
+      576,  576,  576,  576,  576,  576,  576,  739,  739,  739,
+      739,  739,  739,  740,  740,  740,  741,  576,  576,  582,
+      582,  583,  582,  583,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  584,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  583,  583,  583,  583,  583,  583,  583,  583,
+      583,  583,  583,  583,  583,  583,  583,  583,  583,  583,
+      583,  585,  585,  585,  585,  585,  585,  586,  586,  586,
+      587,  583,  583,  582, 1201, 1209,  944, 1222, 1201, 1210,
+      945, 1223, 1259,  451, 1384, 2464, 1259,  452, 1384, 1234,
+     1238, 2463,  588, 1235, 1239,  453,  917, 2460, 1823, 1193,
+      918, 1194, 1824,  453,  738,  453,  450,  450,  450, 1195,
+     1729, 2453, 1240, 1196, 1556, 1197, 1198, 1199, 1542, 1589,
+      450,  450,  582,  582,  582,  582,  582,  582,  582,  582,
+
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  588, 1351, 1568, 1243, 1234, 1578, 1569,
+     1244, 1235, 1579,  953,  965, 1580,  912,  954,  966, 1581,
+      913, 2450, 2448, 2444, 1352, 1352, 1352, 1352, 1352, 1352,
+     1353, 1353, 1353, 1354, 1566, 1582,  450,  450,  450,  450,
+     2440, 2435, 1577, 1243,  450,  450,  450, 1244, 2434, 1576,
+     2433, 1795,  588,  588,  588,  588,  588,  588,  588,  588,
+      588,  588,  588,  588,  588,  588,  588,  588,  588,  588,
+      588, 1572, 1244, 1255,  450, 1255, 1244, 1256, 2432, 1256,
+
+     1258,  588,  588,  596, 1259, 1573, 2431, 1258, 2430, 2429,
+     1263, 1259, 1595,  453, 1264, 1598, 1596, 1601, 1264, 1599,
+     1574, 1602, 1264, 2428,  450, 1587,  450, 1592, 1592, 1772,
+     2427,  450, 1265, 1773, 1575, 1593, 1593, 1588,  450,  453,
+     1594,  450, 2411,  450, 1590,  988,  450,  451,  450,  989,
+     1023,  452,  596,  596,  596,  596,  596,  596,  596,  596,
+      596,  596,  596,  596,  596,  596,  596,  596,  596,  596,
+      596, 1263, 1774,  991, 1619, 1264,  450,  992, 2409, 2403,
+     1771,  596,  596,  602, 2402,  878, 1023, 1380, 1622,  879,
+     2399, 1372, 1394, 1265,  718, 2397, 1394,  451, 2395, 1025,
+
+     2383,  452,  450, 2382,  450,  718, 2381, 1381, 1375, 1382,
+     1030, 2379, 1597,  453, 1716,  719,  719,  719,  719,  719,
+      719,  720,  720,  720,  721,  718, 1717, 1178, 2378, 1711,
+     1035, 1179,  602,  602,  602,  602,  602,  602,  602,  602,
+      602,  602,  602,  602,  602,  602,  602,  602,  602,  602,
+      602,  719,  719,  719,  719,  719,  719,  720,  720,  720,
+      721,  602,  602,  608, 1026, 1026, 1026, 1026, 1026, 1026,
+     1027, 1027, 1027, 1028, 2377, 1031, 1031, 1031, 1031, 1031,
+     1031, 1032, 1032, 1032, 1033,  718, 2372, 1380, 1832, 1203,
+     1025, 1372, 1833, 1204, 2368, 1036, 1036, 1036, 1036, 1036,
+
+     1036, 1037, 1037, 1037, 1038,  718, 2367, 1381, 1375, 1382,
+     1025, 1042,  608,  608,  608,  608,  608,  608,  608,  608,
+      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
+      608,  739,  739,  739,  739,  739,  739,  740,  740,  740,
+      741,  608,  608,  614, 2364, 1408, 2362, 1722,  452, 1104,
+      451, 1412,  452, 2359,  452, 1026, 1026, 1026, 1026, 1026,
+     1026, 1027, 1027, 1027, 1028,  718, 1404, 1409, 1414,  453,
+     1283, 2357, 2356, 2350, 2345, 1026, 1026, 1026, 1026, 1026,
+     1026, 1027, 1027, 1027, 1028,  718, 1730,  451, 2342, 2340,
+     1288,  452,  614,  614,  614,  614,  614,  614,  614,  614,
+
+      614,  614,  614,  614,  614,  614,  614,  614,  614,  614,
+      614, 1420,  451, 1446, 1851, 1420,  452, 1446, 1851, 2338,
+     1745,  614,  614,  620, 1746, 2333,  451, 2331, 2329, 1744,
+      452, 1723, 1423, 1755,  453, 1284, 1284, 1284, 1284, 1284,
+     1284, 1285, 1285, 1285, 1286,  718, 2326, 1544, 1456, 1747,
+     1293, 1545, 1456, 1758, 1748, 1289, 1289, 1289, 1289, 1289,
+     1289, 1290, 1290, 1290, 1291,  718, 2325,  451, 1758,  453,
+     1298,  452,  620,  620,  620,  620,  620,  620,  620,  620,
+      620,  620,  620,  620,  620,  620,  620,  620,  620,  620,
+      620,  451, 2322, 1792,  451,  452, 1749, 1475,  452, 2317,
+
+      451,  620,  620,  626,  452, 1759, 1760, 2311, 2309, 1760,
+     1760, 1452, 1452, 2308, 1477, 1294, 1294, 1294, 1294, 1294,
+     1294, 1295, 1295, 1295, 1296,  718, 2307,  453, 2306, 1769,
+     1298, 2305, 1754, 1761, 1763, 1299, 1299, 1299, 1299, 1299,
+     1299, 1300, 1300, 1300, 1301,  718, 2304, 1762, 1764, 2303,
+     1304, 2302,  626,  626,  626,  626,  626,  626,  626,  626,
+      626,  626,  626,  626,  626,  626,  626,  626,  626,  626,
+      626, 1775, 1780,  451,  451, 1775, 1781,  452,  452, 2301,
+      451,  626,  626,  632,  452, 1783, 1783,  451,  451, 1783,
+     1783,  452,  452, 2278, 1782, 1299, 1299, 1299, 1299, 1299,
+
+     1299, 1300, 1300, 1300, 1301,  718, 2277, 1784, 1784, 1777,
+     1309, 1805, 1801, 1807, 1776, 1305, 1305, 1305, 1305, 1305,
+     1305, 1306, 1306, 1306, 1307,  718, 1836, 1146, 2274, 2912,
+     1314, 1147,  632,  632,  632,  632,  632,  632,  632,  632,
+      632,  632,  632,  632,  632,  632,  632,  632,  632,  632,
+      632, 1785, 2912, 1856, 1510, 1785, 1779, 1857, 1511, 2262,
+     2261,  632,  632,  638, 1786, 1788,  451, 1796, 1786, 1788,
+      452, 1797, 2258, 1782, 1512, 1310, 1310, 1310, 1310, 1310,
+     1310, 1311, 1311, 1311, 1312,  718, 1787, 1789,  451, 1798,
+     1025, 2255,  452, 2250, 2236, 1315, 1315, 1315, 1315, 1315,
+
+     1315, 1316, 1316, 1316, 1317,  718, 2234,  451, 2233, 1793,
+     1283,  452,  638,  638,  638,  638,  638,  638,  638,  638,
+      638,  638,  638,  638,  638,  638,  638,  638,  638,  638,
+      638, 1799,  451, 2232, 1520,  451,  452, 1802, 1521,  452,
+     2231,  638,  638,  644,  451,  451, 1511,  451,  452,  452,
+     1511,  452, 2230, 2227, 1522, 1026, 1026, 1026, 1026, 1026,
+     1026, 1027, 1027, 1027, 1028,  718, 1822,  453, 1804,  451,
+     1288, 1830, 1835,  452, 2226, 1284, 1284, 1284, 1284, 1284,
+     1284, 1285, 1285, 1285, 1286,  718, 2220,  882,  911, 2212,
+     1293, 2211,  644,  644,  644,  644,  644,  644,  644,  644,
+
+      644,  644,  644,  644,  644,  644,  644,  644,  644,  644,
+      644, 1521, 1834, 1545, 1875, 1521, 2206, 1545, 1876, 2203,
+      451,  644,  644,  650,  452,  451, 1206, 2201, 2200,  452,
+     1207, 1831,  453, 1974,  453, 1289, 1289, 1289, 1289, 1289,
+     1289, 1290, 1290, 1290, 1291,  718, 2189, 2186,  451,  451,
+     1025, 1806,  452,  452, 1826, 1294, 1294, 1294, 1294, 1294,
+     1294, 1295, 1295, 1295, 1296,  718, 2184,  451, 1847,  943,
+     1025,  452,  650,  650,  650,  650,  650,  650,  650,  650,
+      650,  650,  650,  650,  650,  650,  650,  650,  650,  650,
+      650, 2181, 1848, 2179,  451,  901, 1203, 1828,  452, 2168,
+
+     1204,  650,  650,  656,  451,  451, 2166, 1551,  452,  452,
+      451, 1860, 2164, 2161,  452, 1026, 1026, 1026, 1026, 1026,
+     1026, 1027, 1027, 1027, 1028,  718, 2160,  933, 1552,  451,
+     1283, 1858, 2159,  452, 1845, 1026, 1026, 1026, 1026, 1026,
+     1026, 1027, 1027, 1027, 1028,  718, 2154, 2144, 2140, 1877,
+     1288,  957,  656,  656,  656,  656,  656,  656,  656,  656,
+      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
+      656, 2136, 1878, 1568, 1570, 1841, 2131, 1569, 1570, 1841,
+     1209,  656,  656,  664, 1210, 1546, 1547, 1907,  451, 1547,
+     1547, 1908,  452, 2128, 2127, 1284, 1284, 1284, 1284, 1284,
+
+     1284, 1285, 1285, 1285, 1286,  718, 1842,  453, 1870, 1850,
+     1293, 2126, 1555, 1852, 1854, 1289, 1289, 1289, 1289, 1289,
+     1289, 1290, 1290, 1290, 1291,  718, 2125, 1853, 1855, 1865,
+     1283, 1879,  664,  664,  664,  664,  664,  664,  664,  664,
+      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
+      664, 1222, 1569, 1871, 1243, 1223, 1569, 2114, 1244, 2113,
+      451,  664,  664,  670,  452,  451, 2108,  451, 1580,  452,
+      953,  452, 1581,  453,  954, 1294, 1294, 1294, 1294, 1294,
+     1294, 1295, 1295, 1295, 1296,  718, 1874, 1890, 1582, 1861,
+     1624, 2107, 1909, 2101, 1872, 1284, 1284, 1284, 1284, 1284,
+
+     1284, 1285, 1285, 1285, 1286,  718, 1891, 1234, 1859, 2085,
+     1629, 1235,  670,  670,  670,  670,  670,  670,  670,  670,
+      670,  670,  670,  670,  670,  670,  670,  670,  670,  670,
+      670,  451, 2084, 1581,  451,  452, 1883, 1581,  452, 2081,
+      451,  670,  670,  676,  452,  451, 1885, 1258, 1915,  452,
+     2078, 1259, 1915, 1906,  453, 1625, 1625, 1625, 1625, 1625,
+     1625, 1626, 1626, 1626, 1627,  718, 2076,  451, 1884, 1595,
+     1634,  452, 2075, 1596, 1886, 1630, 1630, 1630, 1630, 1630,
+     1630, 1631, 1631, 1631, 1632,  718, 2073,  451, 2072, 2071,
+     1304,  452,  676,  676,  676,  676,  676,  676,  676,  676,
+
+      676,  676,  676,  676,  676,  676,  676,  676,  676,  676,
+      676, 2057, 2052, 1255,  451, 1887, 1913, 1256,  452, 2049,
+      451,  676,  676,  682,  452, 2048, 1596, 2047, 2046, 1598,
+     1596, 1592, 1592, 1599, 2045, 1635, 1635, 1635, 1635, 1635,
+     1635, 1636, 1636, 1636, 1637,  718, 1912,  453, 1911, 1922,
+     1639, 2044, 2042, 1923, 2038, 1305, 1305, 1305, 1305, 1305,
+     1305, 1306, 1306, 1306, 1307,  718, 1919,  451, 2037, 1370,
+     1644,  452,  682,  682,  682,  682,  682,  682,  682,  682,
+      682,  682,  682,  682,  682,  682,  682,  682,  682,  682,
+      682, 1916, 1599,  451,  988, 1917, 1599,  452,  989, 2030,
+
+     2007,  682,  682,  689, 1921, 1924, 1918,  451,  451, 1923,
+     1925,  452,  452,  453, 1926, 1640, 1640, 1640, 1640, 1640,
+     1640, 1641, 1641, 1641, 1642,  718, 1375, 1382, 2004, 1920,
+     1649, 1998, 1927, 1997, 1988, 1645, 1645, 1645, 1645, 1645,
+     1645, 1646, 1646, 1646, 1647,  451, 1932, 1691, 1982,  452,
+     1269, 1691,  689,  689,  689,  689,  689,  689,  689,  689,
+      689,  689,  689,  689,  689,  689,  689,  689,  689,  689,
+      689, 1741, 1613,  991, 1692, 1436, 1606,  992, 1693, 1981,
+     1692,  689,  689,  695, 1693, 1720, 1928, 1510, 1935, 1721,
+     1929, 1511, 1735, 1608, 1614, 1650, 1650, 1650, 1650, 1650,
+
+     1650, 1651, 1651, 1651, 1652,  738, 1742, 1512,  450, 1613,
+     1720, 1974, 1937, 1606, 1721,  738, 1993, 1743, 1825, 1767,
+     1993, 1775, 1775, 1767, 2016, 1775, 1775, 1972, 2017, 1965,
+     1608, 1614,  695,  695,  695,  695,  695,  695,  695,  695,
+      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
+      695, 1949, 1930, 1790, 1790, 1044, 1931, 1791, 1791, 1936,
+     2053,  695,  695,  701, 2053, 1049, 1023, 1578, 2061, 2064,
+     1934, 1579, 2061, 2064, 2912, 1045, 1045, 1045, 1045, 1045,
+     1045, 1046, 1046, 1046, 1047, 1050, 1050, 1050, 1050, 1050,
+     1050, 1051, 1051, 1051, 1052,  738, 1892, 1893, 1933, 1841,
+
+     1894, 2062, 1895, 1841, 1896,  738, 1851, 1591, 1914, 1897,
+     1851, 1898,  701,  701,  701,  701,  701,  701,  701,  701,
+      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
+      701,  719,  719,  719,  719,  719,  719,  720,  720,  720,
+      721,  701,  701,  707, 2069, 1054, 2134, 1915, 2069, 1930,
+     2134, 1915, 1910, 1931, 1930, 1044, 1841, 1889, 1931, 2153,
+     1841,  738, 1888, 2153, 2070, 1055, 1055, 1055, 1055, 1055,
+     1055, 1056, 1056, 1056, 1057, 1045, 1045, 1045, 1045, 1045,
+     1045, 1046, 1046, 1046, 1047, 2074, 1993, 2098, 1882, 1881,
+     1993, 2098,  707,  707,  707,  707,  707,  707,  707,  707,
+
+      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
+      707, 1044, 2099, 2016, 1084, 2016, 2218, 2017, 1085, 2017,
+     2218,  707,  707,  744, 1947, 1722, 1705, 1880, 1690, 1412,
+     1705, 1045, 1045, 1045, 1045, 1045, 1045, 1046, 1046, 1046,
+     1047,  738,  450, 1873, 2053, 1375, 1414,  453, 2053, 2061,
+      450,  738, 1859, 2061, 1859, 2061, 1945, 1849,  450, 2061,
+      745,  746,  746, 1959,  747,  748,  749,  750,  750,  750,
+      750,  750,  750,  750,  750,  750,  750,  750,  750,  750,
+      750,  750,  750,  750,  750,  750,  750,  750,  753, 1697,
+     2064, 1320, 2243, 1697, 2064, 1691, 2265, 1846, 2271, 1691,
+
+     2265, 1325, 2098, 2134, 2318, 2218,  738, 2134, 2318, 2218,
+      453, 1321, 1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322,
+     1323, 1326, 1326, 1326, 1326, 1326, 1326, 1327, 1327, 1327,
+     1328, 1951, 1844, 1843, 1840, 1839,  738,  753,  753,  753,
+      753,  753,  753,  753,  753,  753,  753,  753,  753,  753,
+      753,  753,  753,  753,  753,  753, 1330, 1841, 2268, 2098,
+     2384, 1841, 2096, 2098, 2384, 1838,  753,  753,  759, 1042,
+     2053, 1837, 1829, 1827, 2053, 2385, 1331, 1331, 1331, 1331,
+     1331, 1331, 1332, 1332, 1332, 1333, 1335,  738, 1821,  739,
+      739,  739,  739,  739,  739,  740,  740,  740,  741,  738,
+
+     2272, 1841, 1820, 1862, 2254, 1841, 1336, 1336, 1336, 1336,
+     1336, 1336, 1337, 1337, 1337, 1338, 1023,  759,  759,  759,
+      759,  759,  759,  759,  759,  759,  759,  759,  759,  759,
+      759,  759,  759,  759,  759,  759, 2069, 1335, 2265, 2061,
+     2069, 2271, 2265, 2061, 1819, 2098,  759,  759,  765, 1341,
+     2268, 2287, 1816, 1815, 2096, 2287, 2070, 1336, 1336, 1336,
+     1336, 1336, 1336, 1337, 1337, 1337, 1338,  738, 2388, 1342,
+     1342, 1342, 1342, 1342, 1342, 1343, 1343, 1343, 1344,  738,
+     1814,  719,  719,  719,  719,  719,  719,  720,  720,  720,
+      721,  718, 1813, 1812, 1811, 1862, 1025,  765,  765,  765,
+
+      765,  765,  765,  765,  765,  765,  765,  765,  765,  765,
+      765,  765,  765,  765,  765,  765, 2251, 1346, 2289, 2318,
+     2251, 2445, 2289, 2318, 1810, 2445,  765,  765,  771, 1351,
+     2451, 2471, 1809, 1808, 2451, 2471, 1755, 1347, 1347, 1347,
+     1347, 1347, 1347, 1348, 1348, 1348, 1349,  738, 1800, 1352,
+     1352, 1352, 1352, 1352, 1352, 1353, 1353, 1353, 1354,  738,
+     1794, 1026, 1026, 1026, 1026, 1026, 1026, 1027, 1027, 1027,
+     1028,  718, 1778, 1770, 1750, 1718, 1030,  771,  771,  771,
+      771,  771,  771,  771,  771,  771,  771,  771,  771,  771,
+      771,  771,  771,  771,  771,  771, 2256, 1044, 2507, 2287,
+
+     2256, 2535, 2507, 2287, 1695, 2535,  771,  771,  779, 1320,
+     2445, 2451, 1683, 2912, 2445, 2451, 1906, 1045, 1045, 1045,
+     1045, 1045, 1045, 1046, 1046, 1046, 1047,  738, 2512, 1321,
+     1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322, 1323,  738,
+     2912, 1031, 1031, 1031, 1031, 1031, 1031, 1032, 1032, 1032,
+     1033,  718, 2912, 2912, 2912, 2912, 1035,  779,  779,  779,
+      779,  779,  779,  779,  779,  779,  779,  779,  779,  779,
+      779,  779,  779,  779,  779,  779, 2327, 1325, 2471, 2567,
+     2327, 2572, 2471, 2567, 2912, 2573,  779,  779,  787, 1330,
+     2574, 2061, 2575, 2912, 1621, 2061, 1261, 1326, 1326, 1326,
+
+     1326, 1326, 1326, 1327, 1327, 1327, 1328,  738, 1618, 1331,
+     1331, 1331, 1331, 1331, 1331, 1332, 1332, 1332, 1333,  738,
+     1617, 1036, 1036, 1036, 1036, 1036, 1036, 1037, 1037, 1037,
+     1038,  718, 1591, 1584,  450, 1565, 1025,  787,  787,  787,
+      787,  787,  787,  787,  787,  787,  787,  787,  787,  787,
+      787,  787,  787,  787,  787,  787, 2335, 1044, 2507, 2289,
+     2336, 2567, 2507, 2289, 1564, 2567,  787,  787,  795, 1044,
+     2287, 2702, 1563,  450, 2287, 2702, 2169, 1045, 1045, 1045,
+     1045, 1045, 1045, 1046, 1046, 1046, 1047,  738, 1535, 1045,
+     1045, 1045, 1045, 1045, 1045, 1046, 1046, 1046, 1047,  738,
+
+     1534, 1026, 1026, 1026, 1026, 1026, 1026, 1027, 1027, 1027,
+     1028,  718, 1533, 1532, 1531, 1530, 1025,  795,  795,  795,
+      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
+      795,  795,  795,  795,  795,  795, 2251, 1320, 2722, 2098,
+     2251, 2762, 2722, 2098, 1529, 2762,  795,  795,  801, 1325,
+     2098, 2785, 1518, 1508, 2098, 2785, 1755, 1321, 1321, 1321,
+     1321, 1321, 1321, 1322, 1322, 1322, 1323,  738, 2726, 1326,
+     1326, 1326, 1326, 1326, 1326, 1327, 1327, 1327, 1328,  738,
+     1507, 1026, 1026, 1026, 1026, 1026, 1026, 1027, 1027, 1027,
+     1028,  718, 2784, 1503, 1502, 1499, 1283,  801,  801,  801,
+
+      801,  801,  801,  801,  801,  801,  801,  801,  801,  801,
+      801,  801,  801,  801,  801,  801, 2252, 1330, 2807, 2826,
+     2252, 2762, 2807, 2826, 1496, 2762,  801,  801,  807, 1320,
+     2785, 2847, 1482, 1462, 2785, 2847, 1822, 1331, 1331, 1331,
+     1331, 1331, 1331, 1332, 1332, 1332, 1333,  738,  450, 1321,
+     1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322, 1323,  738,
+     2808, 1284, 1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285,
+     1286,  718,  450, 1386, 1355, 2912, 1288,  807,  807,  807,
+      807,  807,  807,  807,  807,  807,  807,  807,  807,  807,
+      807,  807,  807,  807,  807,  807, 2256, 1654, 2807, 2850,
+
+     2256, 2826, 2807, 2850, 2912, 2826,  807,  807,  817, 1659,
+     2855, 2856,  450,  450, 2855, 2856, 1906, 1655, 1655, 1655,
+     1655, 1655, 1655, 1656, 1656, 1656, 1657,  738,  450, 1660,
+     1660, 1660, 1660, 1660, 1660, 1661, 1661, 1661, 1662,  738,
+      450, 1289, 1289, 1289, 1289, 1289, 1289, 1290, 1290, 1290,
+     1291,  718,  450,  450,  450,  450, 1293,  817,  817,  817,
+      817,  817,  817,  817,  817,  817,  817,  817,  817,  817,
+      817,  817,  817,  817,  817,  817, 2327, 1664, 2857, 2847,
+     2327, 2850, 2857, 2847,  450, 2850,  817,  817,  823, 1341,
+     2879, 2879,  450, 1112, 2879, 2879, 1261, 1665, 1665, 1665,
+
+     1665, 1665, 1665, 1666, 1666, 1666, 1667,  738,  450, 1342,
+     1342, 1342, 1342, 1342, 1342, 1343, 1343, 1343, 1344,  738,
+     1106, 1294, 1294, 1294, 1294, 1294, 1294, 1295, 1295, 1295,
+     1296,  718,  450,  816, 1068, 1066, 1298,  823,  823,  823,
+      823,  823,  823,  823,  823,  823,  823,  823,  823,  823,
+      823,  823,  823,  823,  823,  823, 2335, 1669, 2897, 2897,
+     2336, 2289, 2897, 2897, 1041, 2289,  823,  823,  829, 1674,
+      563,  563,  987,  986,  983,  970, 2169, 1670, 1670, 1670,
+     1670, 1670, 1670, 1671, 1671, 1671, 1672,  738,  964, 1675,
+     1675, 1675, 1675, 1675, 1675, 1676, 1676, 1676, 1677, 2417,
+
+      961, 1299, 1299, 1299, 1299, 1299, 1299, 1300, 1300, 1300,
+     1301, 2287, 2289,  960,  952, 2287, 2289,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829, 2098, 1679, 2290, 2287,
+     2098,  951,  948, 2287, 2288,  937,  829,  829,  838, 1579,
+     1699, 2098, 1702, 1579, 1699, 2098, 1702, 1680, 1680, 1680,
+     1680, 1680, 1680, 1681, 1681, 1681, 1682,  718,  936, 2407,
+      453,  453, 1298,  453,  935,  927, 2416, 2593, 1899, 1900,
+      718,  916, 1901,  915, 1902, 1304, 1903,  906,  905,  902,
+      718, 1904, 1953, 1905, 1956, 1309, 1042,  838,  838,  838,
+
+      838,  838,  838,  838,  838,  838,  838,  838,  838,  838,
+      838,  838,  838,  838,  838,  838,  739,  739,  739,  739,
+      739,  739,  740,  740,  740,  741,  838,  838,  844, 2252,
+     2384,  899,  896, 2252, 2384,  895,  894, 1299, 1299, 1299,
+     1299, 1299, 1299, 1300, 1300, 1300, 1301, 1593, 1593, 1822,
+     1305, 1305, 1305, 1305, 1305, 1305, 1306, 1306, 1306, 1307,
+     1310, 1310, 1310, 1310, 1310, 1310, 1311, 1311, 1311, 1312,
+      718,  507,  892,  886,  885, 1314,  884,  844,  844,  844,
+      844,  844,  844,  844,  844,  844,  844,  844,  844,  844,
+      844,  844,  844,  844,  844,  844, 1708,  452,  877, 1714,
+
+     1708, 1724,  874, 1714,  871, 1727,  844,  844,  850, 1727,
+     1757, 1760, 2098,  868, 1757, 1760, 2098,  453,  453,  718,
+      453, 2289,  867, 2061, 1025, 2289,  453, 2061,  864,  718,
+      549,  453,  453, 1962, 1025,  544, 1968, 2504,  519, 1763,
+     1315, 1315, 1315, 1315, 1315, 1315, 1316, 1316, 1316, 1317,
+      718, 2489,  513, 1764,  498, 1283, 2513,  850,  850,  850,
+      850,  850,  850,  850,  850,  850,  850,  850,  850,  850,
+      850,  850,  850,  850,  850,  850,  487,  816,  794,  786,
+      737,  563,  563,  556,  549,  544,  850,  850,  856, 1026,
+     1026, 1026, 1026, 1026, 1026, 1027, 1027, 1027, 1028, 1026,
+
+     1026, 1026, 1026, 1026, 1026, 1027, 1027, 1027, 1028,  718,
+      519, 2000, 1773, 1781, 1288, 2000, 1773, 1781,  513,  498,
+     1284, 1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285, 1286,
+      487, 2912,  453,  453,  453, 1784, 2912,  856,  856,  856,
+      856,  856,  856,  856,  856,  856,  856,  856,  856,  856,
+      856,  856,  856,  856,  856,  856,  718, 2912, 2098, 2855,
+     2912, 1293, 2098, 2855, 2912, 2912,  856,  856,  451, 1696,
+     2912, 1746,  452, 1697,  451, 1746, 2773, 2773,  452, 1289,
+     1289, 1289, 1289, 1289, 1289, 1290, 1290, 1290, 1291,  453,
+      718, 2912,  453, 2660, 1783, 1283, 2912,  450, 1783, 1753,
+
+     1792,  718,  450, 1753, 1475,  450, 1283, 1081, 1985, 2912,
+      450, 1950, 1948,  450, 2912, 1785, 1784,  718,  450, 1785,
+      453, 1477, 1624, 2912, 2912, 2912, 1294, 1294, 1294, 1294,
+     1294, 1294, 1295, 1295, 1295, 1296, 1990, 1782, 2912,  454,
+      454,  454,  454,  454,  454,  455,  455,  455,  456,  451,
+     2912, 2912, 2912,  452, 2287, 2912, 2912, 2912, 2287, 2912,
+     1284, 1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285, 1286,
+      453, 1284, 1284, 1284, 1284, 1284, 1284, 1285, 1285, 1285,
+     1286, 2020, 2596, 2912, 2912, 2020,  928, 1625, 1625, 1625,
+     1625, 1625, 1625, 1626, 1626, 1626, 1627, 2023, 2011, 2912,
+
+     2856, 2024, 2912, 2021, 2856, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2775, 2775,  994,
+      454,  454,  454,  454,  454,  454,  455,  455,  455,  456,
+     1132, 1133, 1132, 1132, 1132, 1134, 1135, 1132, 1135, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1136, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1132, 1135, 1135, 1135, 1135, 1135, 1135, 1135,
+     1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135,
+
+     1135, 1135, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1138,
+     1138, 1139, 1135, 1135,  973,  974,  973,  973,  973,  975,
+      976,  973,  976,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  977,  978,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  976,  976,  976,
+      976,  976,  976,  976,  976,  976,  976,  976,  976,  976,
+      976,  976,  976,  976,  976,  976,  980,  980,  980,  980,
+      980,  980,  981,  981,  981,  982,  976,  976, 2912, 1686,
+
+     2912,  451,  450, 1686,  450,  452, 2039, 2912, 2043, 2912,
+     2039,  718, 2043, 1824, 2912, 2857, 1629, 1824, 1797, 2857,
+      453,  718, 1797, 2912, 2912, 2912, 1634, 1942, 1409,  450,
+     1472,  718, 2777, 2777,  453, 1943, 1304,  450, 2912,  453,
+     2026,  718, 2912, 1944, 2912,  450, 1304, 2912, 1954,  450,
+      450,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  450, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,  450,  450,
+      563, 1630, 1630, 1630, 1630, 1630, 1630, 1631, 1631, 1631,
+     1632, 1635, 1635, 1635, 1635, 1635, 1635, 1636, 1636, 1636,
+
+     1637, 1305, 1305, 1305, 1305, 1305, 1305, 1306, 1306, 1306,
+     1307, 1305, 1305, 1305, 1305, 1305, 1305, 1306, 1306, 1306,
+     1307,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      451,  451, 1698, 2040,  452,  452, 1699, 2040, 2912, 2912,
+     1833, 2050, 2912, 2912, 1833, 2050, 1946,  718, 2912, 1701,
+     2912,  453, 1639, 1702, 1701, 1454, 2912, 2912, 1702,  450,
+      450,  453, 2041, 1594, 2912, 2087, 2912,  450,  450, 2087,
+     2051, 2912, 2912,  718, 1952,  450,  450,  450, 1644, 2912,
+     2538, 2912,  450,  718, 2538,  450,  453, 2089, 1649, 2912,
+
+      450, 1955, 1741,  450, 2912, 2092, 1436, 1957,  450, 1860,
+     1723,  454,  454,  454,  454,  454,  454,  455,  455,  455,
+      456,  451, 2912, 1735, 2912,  452, 2093, 1640, 1640, 1640,
+     1640, 1640, 1640, 1641, 1641, 1641, 1642, 1742, 2912, 2912,
+     2912, 2912,  453, 2912, 2912, 1704, 2912, 1704, 1743, 1705,
+     2912, 1705, 1358, 1645, 1645, 1645, 1645, 1645, 1645, 1646,
+     1646, 1646, 1647, 1650, 1650, 1650, 1650, 1650, 1650, 1651,
+     1651, 1651, 1652,  450, 2912,  450, 2912, 2912, 2912, 2912,
+     2912,  450, 1958,  450, 2912, 2912, 2912, 2912, 2912,  450,
+     1960,  450,  454,  454,  454,  454,  454,  454,  455,  455,
+
+      455,  456, 1360, 1361, 1360, 1360, 1360, 1085, 1362, 1360,
+     1362, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1363, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1360, 1362, 1362, 1362, 1362, 1362,
+     1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
+     1362, 1362, 1362, 1362, 1364, 1364, 1364, 1364, 1364, 1364,
+     1365, 1365, 1365, 1366, 1362, 1362, 1370, 1371, 1370, 1370,
+     1370, 1372, 1373, 1370, 1373, 1370, 1370, 1370, 1370, 1370,
+
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1374, 1375, 1376,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1373,
+     1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1377, 1377,
+     1377, 1377, 1377, 1377, 1378, 1378, 1378, 1379, 1373, 1373,
+     1401, 1402, 1401, 1401, 1401, 1104, 1403, 1401, 1403, 1401,
+     1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401,
+     1401, 1401, 1404, 1105, 1401, 1401, 1401, 1401, 1401, 1401,
+
+     1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401,
+     1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401,
+     1401, 1401, 1401, 1403, 1403, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1405, 1405, 1405, 1405, 1405, 1405, 1406, 1406,
+     1406, 1407, 1403, 1403, 1410, 1411, 1410, 1410, 1410, 1412,
+     1413, 1410, 1413, 1410, 1410, 1410, 1410, 1410, 1410, 1410,
+     1410, 1410, 1410, 1410, 1410, 1410, 1414,  450, 1410, 1410,
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410,
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410,
+
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1413, 1413, 1413,
+     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
+     1413, 1413, 1413, 1413, 1413, 1413, 1415, 1415, 1415, 1415,
+     1415, 1415, 1416, 1416, 1416, 1417, 1413, 1413, 1418, 1419,
+     1418, 1418, 1418, 1420, 1421, 1418, 1421, 1418, 1418, 1418,
+     1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1422,
+     1423, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421,
+
+     1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421,
+     1424, 1424, 1424, 1424, 1424, 1424, 1425, 1425, 1425, 1426,
+     1421, 1421, 2912, 1707, 2912, 1707,  450, 1708,  450, 1708,
+     2912, 1876, 2912, 2912, 1908, 1876, 1922, 2583, 1908, 2912,
+     1923, 2583, 2912, 1924, 2912, 1917, 2912, 1923, 2912, 1917,
+     2912,  450,  453,  450, 1963,  453, 2912, 2334, 1376,  450,
+     1961,  450, 1593, 1593, 1375, 1382,  453,  450, 2104,  450,
+     2912, 2912, 2912,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  450, 1437,  450,
+      450,  450, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912,  450,  450, 1132, 1133, 1132, 1132, 1132, 1134,
+     1135, 1132, 1135, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1136, 1132, 1132, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1135, 1135, 1135,
+     1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135,
+     1135, 1135, 1135, 1135, 1135, 1135, 1137, 1137, 1137, 1137,
+     1137, 1137, 1138, 1138, 1138, 1139, 1135, 1135, 1466, 1149,
+     1466, 1466, 1466, 1150, 1467, 1466, 1467, 1466, 1466, 1466,
+
+     1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466,
+     1468, 1151, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466,
+     1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466,
+     1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466,
+     1466, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+     1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+     1469, 1469, 1469, 1469, 1469, 1469, 1470, 1470, 1470, 1471,
+     1467, 1467, 1473, 1474, 1473, 1473, 1473, 1475, 1476, 1473,
+     1476, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1473, 1473, 1473, 1473, 1477,  450, 1473, 1473, 1473, 1473,
+
+     1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1473, 1473, 1473, 1473, 1473, 1476, 1476, 1476, 1476, 1476,
+     1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476,
+     1476, 1476, 1476, 1476, 1478, 1478, 1478, 1478, 1478, 1478,
+     1479, 1479, 1479, 1480, 1476, 1476, 1604, 1605, 1604, 1604,
+     1604, 1606, 1607, 1604, 1607, 1604, 1604, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1608, 1609,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1607,
+     1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607,
+     1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1610, 1610,
+     1610, 1610, 1610, 1610, 1611, 1611, 1611, 1612, 1607, 1607,
+      451,  451, 2912, 1393,  452,  452, 1713, 1394, 2538, 2912,
+     1714, 2912, 2538, 1713, 2151, 1870,  738, 1714, 1929, 1555,
+      878,  453, 2912, 1726,  879, 2912, 2912, 1727, 1723,  450,
+     1964,  450, 1966,  738,  450, 1608, 1865,  450, 2912,  450,
+     2912,  450,  450, 1967, 1684,  450,  738,  450, 1970,  450,
+      450,  450, 2912, 2912, 1969, 2912,  450,  450, 2912,  450,
+
+     1871, 1947, 2912,  738,  450, 1690, 1044,  450, 2912, 2912,
+     2912,  454,  454,  454,  454,  454,  454,  455,  455,  455,
+      456, 1685, 1375, 1049, 2912, 1686, 1045, 1045, 1045, 1045,
+     1045, 1045, 1046, 1046, 1046, 1047, 1054, 2912, 2912, 2912,
+     2912, 2912,  453, 1050, 1050, 1050, 1050, 1050, 1050, 1051,
+     1051, 1051, 1052, 1044, 2912, 2912, 1055, 1055, 1055, 1055,
+     1055, 1055, 1056, 1056, 1056, 1057, 1924, 2912, 1926, 2912,
+     1923, 2912, 1926, 1045, 1045, 1045, 1045, 1045, 1045, 1046,
+     1046, 1046, 1047, 2912, 2912, 2147, 2147, 1375, 1382,  453,
+     2148, 2912,  454,  454,  454,  454,  454,  454,  455,  455,
+
+      455,  456, 1360, 1361, 1360, 1360, 1360, 1085, 1362, 1360,
+     1362, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1363, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
+     1360, 1360, 1360, 1360, 1360, 1362, 1362, 1362, 1362, 1362,
+     1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
+     1362, 1362, 1362, 1362, 1364, 1364, 1364, 1364, 1364, 1364,
+     1365, 1365, 1365, 1366, 1362, 1362, 2912,  451, 2912, 1100,
+      450,  452,  450, 1101, 2912, 2000, 2912, 1977, 1992, 2000,
+
+     2216, 1977, 1992, 2912, 2010, 1785, 2912, 2028, 2059, 1785,
+     2228, 2028, 2059, 2912, 2039,  450,  453,  450,  453,  453,
+     2912, 2012, 1973,  450, 2194,  450, 2912, 1782,  453,  453,
+     1971,  450, 1409,  450, 2208, 2912, 2912,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912,  450,  450, 1370, 1371,
+     1370, 1370, 1370, 1372, 1373, 1370, 1373, 1370, 1370, 1370,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1374,
+     1375, 1376, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1377, 1377, 1377, 1377, 1377, 1377, 1378, 1378, 1378, 1379,
+     1373, 1373, 1401, 1402, 1401, 1401, 1401, 1104, 1403, 1401,
+     1403, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401,
+     1401, 1401, 1401, 1401, 1404, 1105, 1401, 1401, 1401, 1401,
+     1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401,
+     1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401,
+
+     1401, 1401, 1401, 1401, 1401, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1403, 1403, 1405, 1405, 1405, 1405, 1405, 1405,
+     1406, 1406, 1406, 1407, 1403, 1403, 1410, 1411, 1410, 1410,
+     1410, 1412, 1413, 1410, 1413, 1410, 1410, 1410, 1410, 1410,
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1414,  450,
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410,
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410,
+     1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1413,
+     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
+
+     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1415, 1415,
+     1415, 1415, 1415, 1415, 1416, 1416, 1416, 1417, 1413, 1413,
+     1418, 1419, 1418, 1418, 1418, 1420, 1421, 1418, 1421, 1418,
+     1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1422, 1423, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418,
+     1418, 1418, 1418, 1421, 1421, 1421, 1421, 1421, 1421, 1421,
+     1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421,
+     1421, 1421, 1424, 1424, 1424, 1424, 1424, 1424, 1425, 1425,
+
+     1425, 1426, 1421, 1421, 1732, 1733, 1732, 1732, 1732, 1436,
+     1734, 1732, 1734, 1732, 1732, 1732, 1732, 1732, 1732, 1732,
+     1732, 1732, 1732, 1732, 1732, 1732, 1735, 1732, 1732, 1732,
+     1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732,
+     1736, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732,
+     1732, 1737, 1732, 1732, 1732, 1732, 1732, 1734, 1734, 1734,
+     1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734,
+     1734, 1734, 1734, 1734, 1734, 1734, 1738, 1738, 1738, 1738,
+     1738, 1738, 1739, 1739, 1739, 1740, 1734, 1734, 1473, 1474,
+     1473, 1473, 1473, 1475, 1476, 1473, 1476, 1473, 1473, 1473,
+
+     1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1477,  450, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473,
+     1473, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476,
+     1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476,
+     1478, 1478, 1478, 1478, 1478, 1478, 1479, 1479, 1479, 1480,
+     1476, 1476, 1862, 1863, 1862, 1862, 1862, 1555, 1864, 1862,
+     1864, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
+     1862, 1862, 1862, 1862, 1865, 1862, 1862, 1862, 1862, 1862,
+
+     1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
+     1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1866, 1862,
+     1862, 1862, 1862, 1862, 1862, 1864, 1864, 1864, 1864, 1864,
+     1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
+     1864, 1864, 1864, 1864, 1867, 1867, 1867, 1867, 1867, 1867,
+     1868, 1868, 1868, 1869, 1864, 1864, 1604, 1605, 1604, 1604,
+     1604, 1606, 1607, 1604, 1607, 1604, 1604, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1608, 1609,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1607,
+     1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607,
+     1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1610, 1610,
+     1610, 1610, 1610, 1610, 1611, 1611, 1611, 1612, 1607, 1607,
+      738,  451, 1976, 2583, 2912,  452, 1977, 2583,  451, 2912,
+      738,  451,  452,  451, 2092,  452, 2912,  452,  452, 2912,
+      451, 2040, 2912, 2334,  452, 2040, 1975, 2912, 2912,  450,
+      450, 2912, 2912, 2912, 1979, 2093,  450,  450,  450,  450,
+      738,  450, 2912, 1454,  450,  450,  450,  450,  450,  450,
+     1044,  738,  450, 1980, 1978,  450,  450,  450, 2912, 2912,
+
+     1320, 2912, 2229, 2912,  450, 2912, 2912, 2912, 2912, 2912,
+     1045, 1045, 1045, 1045, 1045, 1045, 1046, 1046, 1046, 1047,
+     1321, 1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322, 1323,
+     1325,  738, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2832, 1330,  738,  451, 2832, 2912, 2912,  452, 2912, 2912,
+     1326, 1326, 1326, 1326, 1326, 1326, 1327, 1327, 1327, 1328,
+     2727, 1331, 1331, 1331, 1331, 1331, 1331, 1332, 1332, 1332,
+     1333,  450,  738, 2040, 2043, 2912,  507, 2040, 2043,  450,
+     2832, 1335,  738, 2912, 2832, 2912, 2912,  450, 2912, 2050,
+     1453, 1453, 1335, 2050, 2912, 1454, 1472, 2912, 2912, 2912,
+
+     2727, 1336, 1336, 1336, 1336, 1336, 1336, 1337, 1337, 1337,
+     1338, 1594, 1336, 1336, 1336, 1336, 1336, 1336, 1337, 1337,
+     1337, 1338, 1341,  738, 2912, 2912, 2912, 2912, 2912, 2912,
+     2235, 2912, 1346,  738,  451, 2912, 1745, 2912,  452, 2912,
+     1746, 2912, 1342, 1342, 1342, 1342, 1342, 1342, 1343, 1343,
+     1343, 1344, 1347, 1347, 1347, 1347, 1347, 1347, 1348, 1348,
+     1348, 1349,  450,  738,  450, 2269, 2912, 2050, 2912, 2096,
+      450, 2050,  450, 1351,  738, 2912, 2912, 1983,  450, 2912,
+      450, 2912, 2912, 1044, 1593, 1593, 1865,  451, 2912, 1594,
+     2912,  452, 2912, 1352, 1352, 1352, 1352, 1352, 1352, 1353,
+
+     1353, 1353, 1354, 1045, 1045, 1045, 1045, 1045, 1045, 1046,
+     1046, 1046, 1047, 1044,  738,  450, 1986, 2912, 2912, 2912,
+     2912, 2912, 2912,  450, 1320,  738, 1745, 2912, 2912, 2912,
+     1746,  450, 2912, 1045, 1045, 1045, 1045, 1045, 1045, 1046,
+     1046, 1046, 1047, 2912, 1321, 1321, 1321, 1321, 1321, 1321,
+     1322, 1322, 1322, 1323,  450,  738, 2237, 2320, 2912, 2912,
+     2238, 2321,  450, 1984, 1325,  738, 2912, 2912, 2912, 2912,
+      450, 2912, 2912, 2150, 2912, 1330, 2239, 2150, 1609, 1382,
+     2912, 2912, 2912, 2912, 1326, 1326, 1326, 1326, 1326, 1326,
+     1327, 1327, 1327, 1328,  453, 1331, 1331, 1331, 1331, 1331,
+
+     1331, 1332, 1332, 1332, 1333, 1320,  738, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 1320,  738,  451, 2912, 1120,
+     2912,  452, 2912, 1121, 2912, 1321, 1321, 1321, 1321, 1321,
+     1321, 1322, 1322, 1322, 1323, 1321, 1321, 1321, 1321, 1321,
+     1321, 1322, 1322, 1322, 1323,  450,  738,  450, 2066, 2912,
+     2087, 2912, 2066,  450, 2087,  450, 1654,  738, 2912, 2912,
+     1987,  450, 2912,  450, 2912, 2912, 1659, 2912, 2070,  453,
+     1991,  453, 2089, 2912, 1992, 2912, 1655, 1655, 1655, 1655,
+     1655, 1655, 1656, 1656, 1656, 1657, 1660, 1660, 1660, 1660,
+     1660, 1660, 1661, 1661, 1661, 1662, 1664,  738,  450, 2912,
+
+     2912, 2912, 2912, 2912, 2912, 2912,  450, 1341,  738, 1752,
+     2912, 2912, 2912, 1753,  450, 2912, 1665, 1665, 1665, 1665,
+     1665, 1665, 1666, 1666, 1666, 1667, 2912, 1342, 1342, 1342,
+     1342, 1342, 1342, 1343, 1343, 1343, 1344,  450,  738, 2252,
+     2228, 2912, 2912, 2252, 2039,  450, 1989, 1341,  738, 2912,
+     2912, 2912, 2912,  450, 2912, 2912, 2912, 2912, 1669, 1822,
+     2912, 1756, 1409, 2912, 2912, 1757, 2912, 1342, 1342, 1342,
+     1342, 1342, 1342, 1343, 1343, 1343, 1344, 2253, 1670, 1670,
+     1670, 1670, 1670, 1670, 1671, 1671, 1671, 1672, 1674,  450,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912,  450, 1679, 2912,
+
+     2912, 2912,  451, 2912, 2912,  450,  452, 2912, 1675, 1675,
+     1675, 1675, 1675, 1675, 1676, 1676, 1676, 1677, 1680, 1680,
+     1680, 1680, 1680, 1680, 1681, 1681, 1681, 1682,  451,  451,
+      450, 1994,  452,  452, 2912, 1759, 2912, 2151,  450, 1760,
+      451, 1929, 2912, 2912,  452, 2912,  450,  451, 2912,  453,
+     2912,  452, 1999, 2912,  894, 2912, 2000,  450, 1608, 2912,
+     2198, 2912, 2912, 1761, 2198,  450, 1938, 2912,  450, 1995,
+     2912,  450, 2912,  450, 2171,  450,  450, 1762, 2171,  450,
+      450,  453, 2912,  450,  450, 2912, 2912, 2912,  450, 1128,
+     1996,  450, 2912, 1129, 2334, 2174,  450, 2912, 2912,  454,
+
+      454,  454,  454,  454,  454,  455,  455,  455,  456, 1685,
+      451, 1130,  451, 1686,  452, 2216,  452,  450, 2912, 2010,
+     2912, 2912, 1772, 2264, 1772,  450, 1773, 2264, 1773, 2912,
+      453, 2001, 2912,  450, 2912, 2002, 2012, 1939,  450, 2912,
+      450, 2912, 2912, 2240,  453, 1940,  450, 2238,  450, 2912,
+      450, 2912,  450, 1941,  450, 2003,  450, 2380,  450, 2005,
+      450, 2380, 2912, 2241, 1608, 1614,  450, 2912,  450, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2026,
+      454,  454,  454,  454,  454,  454,  455,  455,  455,  456,
+     1370, 1689, 1370, 1370, 1370, 1690, 1373, 1370, 1373, 1370,
+
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1375,  450, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370,
+     1370, 1370, 1370, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1373, 1373, 1377, 1377, 1377, 1377, 1377, 1377, 1378, 1378,
+     1378, 1379, 1373, 1373, 1732, 1733, 1732, 1732, 1732, 1436,
+     1734, 1732, 1734, 1732, 1732, 1732, 1732, 1732, 1732, 1732,
+     1732, 1732, 1732, 1732, 1732, 1732, 1735, 1732, 1732, 1732,
+
+     1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732,
+     1736, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732, 1732,
+     1732, 1737, 1732, 1732, 1732, 1732, 1732, 1734, 1734, 1734,
+     1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734,
+     1734, 1734, 1734, 1734, 1734, 1734, 1738, 1738, 1738, 1738,
+     1738, 1738, 1739, 1739, 1739, 1740, 1734, 1734, 2912,  451,
+     2912, 1146,  450,  452,  450, 1147, 2386, 2912, 2912, 2912,
+     2386, 2237, 2912, 2269, 2912, 2238, 2912, 2096, 2240, 2912,
+     2282, 2912, 2238, 2912, 2282, 2912, 2240,  450, 2148,  450,
+     2238, 2239, 2912, 1609, 1865,  450, 2912,  450, 2241, 1608,
+
+     1614,  453, 2006,  450, 2912,  450, 2241, 1608, 1614,  450,
+      450,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+      450,  450,  450,  450,  450,  450,  450,  450, 1780, 2252,
+     2285, 2320, 1781, 2252, 2285, 2321, 2320, 2912,  450,  450,
+     2321, 2336, 2470, 2380, 2589, 2336, 2470, 2380, 2589, 1822,
+     1782,  453, 2912, 1382, 2912, 2912,  450, 2912, 1382, 2912,
+     2396, 2912, 2174,  453,  450, 2026, 1241, 2912, 2912, 2912,
+     2912, 2912,  450, 2008, 2009, 2008, 2008, 2008, 2010, 2011,
+     2008, 2011, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008,
+     2008, 2008, 2008, 2008, 2008, 2012,  450, 2008, 2008, 2008,
+
+     2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008,
+     2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008,
+     2008, 2008, 2008, 2008, 2008, 2008, 2011, 2011, 2011, 2011,
+     2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011, 2011,
+     2011, 2011, 2011, 2011, 2011, 2013, 2013, 2013, 2013, 2013,
+     2013, 2014, 2014, 2014, 2015, 2011, 2011, 1780, 2912, 2437,
+      451, 1781, 2458, 2437,  452, 2912, 2458, 2912, 2912,  912,
+     2912, 2912, 1796,  913, 2912, 2912, 1797, 2443, 2912, 1782,
+      453, 2443, 2027,  453, 2912,  450, 2028, 2912,  450, 2532,
+     2912,  451, 2550,  450, 1798,  452,  450,  450,  453, 2912,
+
+      450,  450, 2018, 2011,  450,  450, 2019, 2008,  450, 2008,
+      450, 2386, 2912, 2025, 2912, 2386,  450, 2912,  450,  450,
+     2506, 2537, 2912, 2008, 2506, 2912,  450,  450, 2147, 2147,
+     2912, 2912, 2565, 2148, 2031,  450, 2565, 2912, 2912, 2912,
+     2912,  453, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912,  453, 2008, 2008, 2008, 2008, 2008, 2008,
+     2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008,
+     2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008,
+     2008, 2008, 2008, 2008, 2008,  451,  451, 1128, 2912,  452,
+      452, 1129, 2912, 2912, 2912, 2912,  451, 2662,  451,  451,
+
+      452, 2662,  452,  452, 2912, 2912, 2912,  452, 1823, 1130,
+     2029,  452, 1824,  450,  450,  450, 2033, 2727,  453, 2032,
+     2912,  450,  450,  450,  450, 2034,  450,  450,  453,  450,
+      450,  450,  450, 1263,  450, 2035,  450, 1264, 2912, 1220,
+      450, 2912,  450,  450,  450, 2054, 2912,  451, 2912, 2055,
+     1832,  452,  450, 2912, 1833, 1265, 2912, 2912, 2912, 2058,
+     2065,  450, 2036, 2059, 2066, 1512, 2912, 2912, 2912,  450,
+      451, 2912,  451,  450,  452,  450,  452,  450,  450, 2912,
+     1090,  450, 2912,  450, 2912, 2063,  450,  450,  450,  450,
+     2056,  450, 2060,  451,  450,  450,  450,  452,  450, 2912,
+
+      450, 2912, 2912,  450,  450,  451,  450, 1206,  450,  452,
+     2912, 1207, 2912, 2912,  450, 2067,  450, 2912, 1209,  451,
+     2912,  450, 1210,  452, 2912, 2912, 2912, 2912, 2068,  450,
+      451, 2912, 2912,  450,  452,  450, 2079,  450, 2040, 2912,
+     2912,  450, 2040,  450, 2080, 2912,  450,  450, 2077,  450,
+     2912,  450,  451, 2086,  450,  450,  452, 2087,  450, 2082,
+     1454, 2912,  450,  450,  451, 2050,  450, 2912,  452, 2050,
+     2912, 2912, 2040,  451,  450, 2088, 2040,  452,  451, 2912,
+      450,  450,  452, 2912, 2483, 2912, 2912, 1594,  450,  450,
+     2912, 2912,  450, 2912, 1454, 2083,  450,  450, 2618, 2589,
+
+      450,  450, 2619, 2589, 2912, 2912,  450, 2090,  450,  450,
+     2571, 2487, 2912, 2912,  450, 2094, 2912,  450, 2912, 2912,
+     1614, 1241,  450, 1862, 1863, 1862, 1862, 1862, 1555, 1864,
+     1862, 1864, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
+     1862, 1862, 1862, 1862, 1862, 1865, 1862, 1862, 1862, 1862,
+     1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862,
+     1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1862, 1866,
+     1862, 1862, 1862, 1862, 1862, 1862, 1864, 1864, 1864, 1864,
+     1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
+     1864, 1864, 1864, 1864, 1864, 1867, 1867, 1867, 1867, 1867,
+
+     1867, 1868, 1868, 1868, 1869, 1864, 1864, 2095, 2912,  451,
+     1222, 2096, 1875,  452, 1223, 2912, 1876, 2912, 2912,  451,
+     2040, 2912,  451,  452, 2040, 2912,  452, 2912, 2912,  451,
+     2912, 2912, 2097,  452, 2912,  450, 2912,  450,  450, 2102,
+      450, 2912, 1454,  450, 2912,  450,  450,  450,  450, 2103,
+      450,  450, 2100,  450,  450,  450,  450,  450,  450, 2912,
+     1234, 2642, 2912, 2105, 1235,  450,  450,  451, 2106, 2912,
+      451,  452,  451,  450,  452, 2912,  452,  451, 2912, 1243,
+     2912,  452, 2109, 1244, 2912, 2912, 2912, 2050,  450,  953,
+      451, 2050, 2912,  954,  452,  450,  450, 2050,  450, 2912,
+
+      450, 2050, 2111,  450,  450,  450,  450,  450,  450, 1594,
+     2912,  450, 2110, 2112,  450,  450,  450,  450,  450, 1594,
+      451,  450, 2115,  450,  452,  450,  450,  451, 2649, 2912,
+     2116,  452,  451,  450,  450, 2578,  452,  451,  451, 2912,
+     2587,  452,  452, 2912, 2587, 2912, 2912, 2618,  450,  451,
+     2618, 2619, 2912,  452, 2619, 2118,  450, 2912, 2912, 2912,
+      450,  453, 1241,  450, 2117,  450,  450, 2122,  450, 1614,
+     2119,  450, 1614,  450,  450, 2120,  450,  450, 2912, 1907,
+      451, 2121,  450, 1908,  452,  450, 2123, 2912, 2124, 2912,
+      451, 1255, 2468,  450,  452, 1256, 2468,  451, 2912, 2761,
+
+     2569,  452,  451, 2761, 2569, 2912,  452,  450,  450, 2137,
+     2912, 2912, 2912,  453, 2912,  450,  450, 2135,  450,  450,
+      453,  453, 2912,  450,  450,  450,  450,  450, 2138, 2560,
+      450, 2143, 1916,  450,  450,  450, 1917, 2641,  450, 1263,
+     2139,  450, 2912, 1264,  451, 2912,  450, 2040,  452, 1592,
+     1592, 2040, 2912, 2912, 2912, 2912, 2912, 2912, 2149, 2912,
+      450, 1265, 2150, 2912, 2912, 2912, 2912,  450,  450, 1454,
+      451, 2912,  450, 1925,  452,  450,  450, 1926, 2616, 2912,
+      450, 2141, 2616,  450, 2912, 2142,  450, 2145,  450, 2765,
+     2146, 2146, 2729, 2912,  450, 1927, 2729, 2912,  450,  453,
+
+     2912,  450,  450, 2912, 2912, 2152,  450, 2912, 2912,  450,
+     2912, 2912, 2912,  453,  450, 2683, 2912,  450, 1604, 1928,
+     1604, 1604, 1604, 1929, 1607, 1604, 1607, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+     1608,  450, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+     1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604, 1604,
+     1604, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607,
+     1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607,
+     1610, 1610, 1610, 1610, 1610, 1610, 1611, 1611, 1611, 1612,
+
+     1607, 1607,  451, 2912,  991,  451,  452,  451,  992,  452,
+     2912,  452, 2781, 2912, 2040, 2912, 2781, 2912, 2040,  451,
+     2912, 2912, 2050,  452,  451, 2912, 2050, 2912,  452, 2912,
+      450, 2912,  450,  450, 2089,  450, 1454, 2912,  450, 2155,
+      450,  450, 2705,  450, 1594, 2157,  450,  450,  450, 2156,
+     1084,  450,  450,  509, 1085,  450, 2912,  451, 2158, 2912,
+      450,  452,  451,  450, 2771, 2912,  452, 2780,  450,  451,
+     2818, 2780, 2912,  452, 2818,  451, 2912, 2912,  450,  452,
+     2040, 2912, 2912, 2912, 2040,  450,  450, 2050,  453, 2089,
+      450, 2050, 2819,  450,  450, 2163, 2761,  450,  450, 2162,
+
+     2761,  450, 1454,  450, 2912,  450,  450, 2912, 2167, 1594,
+     2912,  450, 2165,  450, 2912, 2712, 2912,  453, 2912,  450,
+     2169, 2170, 2169, 2169, 2169, 2171, 2172, 2169, 2172, 2169,
+     2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169,
+     2169, 2173, 2174, 2169, 2169, 2169, 2169, 2169, 2169, 2169,
+     2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169,
+     2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2169,
+     2169, 2169, 2169, 2172, 2172, 2172, 2172, 2172, 2172, 2172,
+     2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172,
+     2172, 2172, 2175, 2175, 2175, 2175, 2175, 2175, 2176, 2176,
+
+     2176, 2177, 2172, 2172,  451, 1701,  451, 2050,  452, 1702,
+      452, 2050, 2912, 2912, 2781, 1704, 2848,  451, 2781, 1705,
+     2849,  452, 2912, 2912, 1707, 2912,  451, 1393, 1708, 1594,
+      452, 1394,  450,  450,  450, 2180, 2089, 2178, 2809, 2912,
+      450,  450,  450,  450, 2182,  450, 2183, 2912,  450,  450,
+      450,  450,  450,  450,  450,  450, 2912, 2912, 2912,  450,
+      450,  450,  450,  450, 2187, 2912, 2912, 2912,  450, 2185,
+      450,  450,  451, 2912, 1713,  451,  452,  451, 1714,  452,
+     2912,  452, 2912, 2805, 2818, 2912, 1100, 2805, 2818,  451,
+     1101, 2912, 2912,  452, 2825, 2912, 2912, 2912, 2825, 2912,
+
+      450, 2188,  450,  450,  453,  450, 2819, 2912,  450, 2912,
+      450,  450, 2190,  450,  450,  453,  450,  450,  450,  450,
+     1976,  450,  450, 2191, 1977,  450, 2912, 2195, 2912, 2912,
+      450, 2196, 2192,  450, 2197, 2912, 2912,  451, 2198,  451,
+      451,  452, 2912,  452,  452, 2846,  451, 2193,  450, 2846,
+      452, 2912, 2912, 2912, 2912,  450,  450, 2848, 2912, 2912,
+     2912, 2849,  450,  450,  450,  450,  453,  450,  450, 2202,
+      450,  450,  871,  450,  450,  450,  450, 2912,  450, 2809,
+     2912,  450,  450,  450,  450,  451, 2199,  451, 2912,  452,
+      450,  452, 1991, 2912,  451, 2912, 1992,  451,  452, 2912,
+
+     2912,  452, 2912, 2912, 2912, 2849, 1999,  451, 2912, 2849,
+     2000,  452, 2204,  450, 2912,  450, 2205, 2912, 2912, 2912,
+      450,  450,  450,  450, 2912,  450, 2813, 2209, 2207,  450,
+      450,  450, 2210,  450,  450,  450,  450, 2912,  450, 2912,
+      451,  450,  450,  450,  452, 2912, 2912, 2912, 2912, 1128,
+      450,  450,  451, 1129,  451, 2912,  452, 2912,  452, 2912,
+     2912,  451, 2912,  451, 2912,  452,  912,  452,  450, 2912,
+      913, 1130, 2912, 2213, 2912, 2027,  450,  450, 2912, 2028,
+      450, 2912,  450, 2215,  450,  450, 2912, 2214,  450,  450,
+      450,  450, 2912,  450,  450, 2912,  450,  450,  450,  450,
+
+      451, 2912,  450,  450,  452,  450, 2912,  450, 2217,  451,
+      450,  450,  451,  452, 2912, 2912,  452, 2912,  451,  450,
+     2780, 2912,  452, 2912, 2780, 2912, 2912, 2219,  450, 1128,
+      451, 2912, 2912, 1129,  452, 2912,  450,  450, 2912, 1263,
+      450,  453, 2089, 1264,  450,  450,  450, 2912,  450, 2222,
+     2221, 1130, 2912,  450,  450, 2224,  450,  450,  450,  451,
+     2058, 1265,  450,  452, 2059,  450,  450,  450, 2912, 2912,
+     2223, 2912, 2058,  450,  450,  450, 2059, 2196,  451, 2912,
+     2225, 2196,  452,  450, 2912, 2912, 2912,  450,  450, 2912,
+     2065, 2912, 2912, 2912, 2066,  450,  450,  451,  453, 2912,
+
+      450,  452, 2353,  450,  450, 2912,  450, 1510,  450, 2242,
+     1090, 1511, 2912, 2244,  450, 2912,  450, 2245,  450,  451,
+     2912, 2354, 2246,  452, 2247,  450,  450, 1512, 1206, 2912,
+     2912, 2912, 1207,  450,  450,  450, 2912, 2912, 2248, 2912,
+      451,  450, 2912,  450,  452, 2249,  451,  450, 2811,  451,
+      452,  450, 2811,  452, 2912,  450,  450, 2912, 2086, 2912,
+     2912, 2263, 2087,  450,  450, 2264, 2912, 2257,  450, 2813,
+     2819, 2260,  450, 2912,  450, 2912,  450,  450, 2912, 2259,
+     2088, 2912,  450,  451,  450,  450,  450,  452, 2912,  450,
+      450, 2912,  451,  450,  450, 2912,  452,  450, 2912, 2912,
+
+     2912, 2912,  450, 2095,  451,  450, 1222, 2096,  452,  451,
+     1223,  450, 2912,  452, 2912, 2912, 2266, 2912,  451,  450,
+      450,  451,  452, 2912, 2912,  452, 2912,  450,  450, 2912,
+     2912,  450,  450, 2912,  450, 2267,  450,  450, 2273,  450,
+      450, 2912,  450, 2912, 2270,  450,  450,  450,  450,  450,
+      450,  451,  451,  450,  450,  452,  452,  450, 2912, 2912,
+     2912, 2275,  450, 2284, 2281, 2276, 2912, 2285, 2282, 2912,
+     1243, 2912, 2912,  451, 1244, 2912, 2912,  452, 2912,  450,
+      450, 2912,  451, 2912, 2912, 2280,  452,  450,  450, 2286,
+     2912,  450,  450, 2912, 2279,  450,  450, 2283,  450,  450,
+
+      450,  450, 2912, 2912, 2912, 2912,  450,  450,  450,  450,
+      450,  451, 2912, 2912, 2291,  452,  451, 2292,  450, 2293,
+      452,  451, 2912, 2912, 2912,  452,  450, 2912,  451, 2912,
+     2912,  451,  452, 2714, 2912,  452, 2912, 2714, 2912,  450,
+     2294,  451,  451, 2912,  450,  452,  452,  450, 2912,  450,
+     2773, 2773,  450, 2912,  453,  450,  450,  450, 2296,  450,
+      450, 2912, 2295, 2297,  450,  450, 2299,  450, 2912,  450,
+      450, 2298,  450, 2912, 2912,  450,  451,  450,  450,  451,
+      452, 2300, 2912,  452, 2912,  450,  450, 2912, 1255, 2912,
+      451, 1263, 1256, 2912,  452, 1264, 2912,  451, 2912, 2912,
+
+     2912,  452, 2912, 2912,  450, 2912, 2912, 2312, 2912, 2912,
+     2310, 2912,  450, 1265, 2912,  450,  450, 2313,  450,  450,
+      450, 2912, 2912,  450,  450,  450,  450,  450, 2912, 2315,
+     2314, 2912,  450,  450,  450,  450,  451, 2912,  451,  451,
+      452,  450,  452,  452, 2912, 2149, 2912, 2912,  991, 2150,
+     2912, 2912,  992, 2912, 2912, 2912, 2146, 2146, 2912,  451,
+     2912, 2912, 2912,  452,  450,  451,  450,  450, 2912,  452,
+     2912, 2912,  450,  450,  450,  450,  450, 2912, 2912, 2316,
+      450,  450,  450,  450,  450, 2912, 1994,  450, 2912,  450,
+      451, 2912, 2323,  450,  452,  450, 2716, 2319, 2718, 2912,
+
+     2716,  450, 2718,  450, 2912, 2912, 2912, 2324, 2912,  450,
+     2912, 2912, 2912, 2775, 2775, 2777, 2777,  453,  450,  453,
+     2912, 2912, 2912, 2912, 2912, 2912,  450, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912,  450, 2912,  883,  973,  974,  973,
+      973,  973,  975,  976,  973,  976,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  973,  977,  978,
+      973,  973,  973,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  973,  973,  973,
+      973,  973,  973,  973,  973,  973,  973,  973,  973,  973,
+      976,  976,  976,  976,  976,  976,  976,  976,  976,  976,
+
+      976,  976,  976,  976,  976,  976,  976,  976,  976,  980,
+      980,  980,  980,  980,  980,  981,  981,  981,  982,  976,
+      976,  451,  451,  451,  451,  452,  452,  452,  452, 2912,
+     2912, 2912, 2912,  451, 2912, 2912, 2912,  452, 2912, 2912,
+     2912, 2912,  451, 2912, 2912, 2912,  452, 2912, 2330,  450,
+      450,  450,  450, 2912, 2912, 2332, 2912,  450,  450,  450,
+      450,  450, 2912,  871, 2328,  450,  450,  450,  450,  450,
+      450,  451, 1704, 2337, 2912,  452, 1705,  450,  450, 2912,
+     2912,  451, 2912,  451, 2912,  452,  450,  452, 2912, 2912,
+     2912, 2912,  451, 1393, 1713, 2912,  452, 1394, 1714,  450,
+
+      450, 2912, 2912, 2912, 2912, 2912, 1100,  450,  450,  450,
+     1101,  450, 2912, 2912, 2339,  450,  450,  450, 2343,  450,
+      450,  450, 2346, 2912, 2341,  450, 2912,  450,  450,  450,
+      450, 2912, 2912, 2912,  450, 2344,  450,  450,  450, 2347,
+      451, 2912,  450,  451,  452, 2195, 2912,  452, 2912, 2196,
+      450, 2912, 2197, 2912,  451, 2912, 2198,  451,  452, 2912,
+     2912,  452, 2912,  451, 2912, 2912, 2912,  452,  450, 2348,
+     2351,  450, 2912,  450,  451, 2912,  450, 2912,  452, 2349,
+      450,  450,  450, 2355,  450,  450, 2912,  450,  450, 2352,
+      450,  450, 2912,  450, 2912, 2912,  450, 2912,  450,  450,
+
+     2358,  450,  450, 2912,  451,  451, 2360,  450,  452,  452,
+      450, 2912, 2912, 2912, 2912,  451,  451, 2361,  450,  452,
+      452, 2912, 1140, 2912, 2912, 2912, 1141, 2912, 2912, 2363,
+     2912, 2912,  450,  450, 2912, 1128, 2912, 2912, 2365, 1129,
+      450,  450, 2366,  450, 2369, 2912, 2912, 2912,  450,  450,
+      450,  450,  450, 2912, 2912, 2912, 2912, 1130,  450,  450,
+      450,  912, 2912,  450,  451,  913,  450, 2912,  452, 2912,
+     2912,  450, 2912,  451,  451, 2912, 2370,  452,  452,  450,
+     2912, 2912, 2912,  451,  451, 2912, 1823,  452,  452,  450,
+     1824, 2912,  450, 2912, 2912, 2912, 2912,  450, 2371, 2375,
+
+      450,  450,  450, 2374, 2912,  450, 2373, 2912,  450,  450,
+      450,  450,  450, 2912,  450, 2912, 2912,  450,  450,  450,
+      450, 1916,  450, 2912, 2912, 1917, 2912,  450,  450, 2912,
+      450, 2058, 2912,  451, 2912, 2059, 2376,  452,  451, 2912,
+      451, 2912,  452, 2912,  452, 2912, 2912, 2912, 2912,  450,
+      451, 2912, 2912, 2912,  452, 2912, 2912,  450, 2912,  450,
+     2387,  450, 2912, 2390, 2912,  450,  450,  450,  450,  450,
+     2912, 2389, 2912, 2912,  450,  450,  450,  450,  450, 2391,
+     2912,  451,  450, 2912,  450,  452,  450, 1510, 2392, 2912,
+     2912, 1511,  451, 2912,  450, 2912,  452, 2912, 2912,  451,
+
+     2912, 2912,  451,  452, 2912, 2912,  452, 1512, 2912,  450,
+     2912, 2912, 2263, 2912, 2393,  450, 2264,  450, 2394, 2912,
+      450, 2912, 2912,  450, 2912,  450, 2398,  450,  450, 2401,
+      450,  450, 2400,  451, 2912,  450,  450,  452,  450, 2912,
+      450, 2912, 2912,  450, 2912,  451,  450, 2095,  450,  452,
+      451, 2096, 2912, 2912,  452, 2912,  450, 2912, 2404,  451,
+     2405,  450,  451,  452, 2912, 2912,  452, 2912,  451,  450,
+     2912, 2912,  452,  450, 2912,  450, 2912,  450,  450, 2912,
+     2406,  450, 2912,  450, 2912, 2912,  450,  450,  451,  450,
+      450,  450,  452, 2408,  450,  450,  450, 2412,  450, 2912,
+
+     2912, 2912, 2912,  450,  450, 2410,  450, 2281, 2912, 2912,
+     2281, 2282,  450, 2284, 2282, 2912,  450, 2285, 2912, 2912,
+     2912, 2912, 2284, 2912,  450, 1243, 2285, 2912, 2912, 1244,
+     2912, 2912,  450, 2912, 2912,  450, 2912, 2413,  450, 2912,
+     2912,  450, 2912,  450,  451, 2912,  450, 2414,  452,  450,
+      450,  450, 2912,  450,  450,  451, 2912,  450,  450,  452,
+     2415,  450, 2912, 2912, 2912, 2912,  450,  451, 2418,  450,
+     2912,  452,  450, 2912, 2912, 2912, 2912, 2419, 2912, 2912,
+      450,  451, 2420,  450, 2912,  452,  451, 2912,  450, 2912,
+      452,  450,  451,  451, 2912,  450,  452,  452,  451,  450,
+
+     2912, 2423,  452,  450, 2421, 2912, 2912, 2912, 2912,  450,
+     2422,  450,  451, 2912,  450,  451,  452,  450, 2912,  452,
+      450,  450,  450, 2912, 2912,  450,  450,  963,  450,  450,
+      450, 2912, 2912, 2912, 2425, 2436,  450, 2424, 2912, 2437,
+      450, 2426,  450,  450, 2912, 1255,  451, 2912,  450, 1256,
+      452,  450, 2912, 2912, 2912, 2912,  450,  451, 1263,  450,
+      451,  452, 1264,  450,  452, 2912, 2912, 2912, 2912, 2912,
+     2912,  450,  991,  450, 2438, 2912,  992, 2912, 2912,  450,
+     1265,  450,  450, 2442, 2912,  450,  450, 2443,  450,  450,
+      450,  987, 2912,  450,  450, 2912,  450, 2912, 2912, 2439,
+
+      450,  450,  450,  451,  450,  451,  451,  452,  450,  452,
+      452,  450, 2912, 2912, 2441, 2912,  450,  451,  451,  450,
+      451,  452,  452, 2912,  452, 2912, 2912,  450, 2446, 2912,
+     2912,  450, 2447,  450,  450, 2912, 2912, 2912, 2912,  450,
+     1393,  450, 2449, 2912, 1394,  450,  450,  450,  450,  450,
+      450,  451, 2912, 2452,  450,  452,  450, 2912, 2912, 2912,
+     2912,  450,  450, 1713,  450, 1100, 2457, 1714,  450, 1101,
+     2458, 2912, 2912, 2912, 2912, 2912,  450, 2912, 2912,  450,
+     2912, 2912, 2912, 2454,  450, 2912, 2912,  450,  451, 2912,
+     2912,  450,  452,  450,  450,  450, 2912, 2912, 2912,  450,
+
+      451,  450,  450, 2912,  452, 2912, 2912, 2455, 2912,  450,
+      450,  451, 2912, 2459, 2456,  452,  450, 1113,  451, 2912,
+     2912, 1114,  452, 2467,  450, 2912, 2912, 2468,  450, 2469,
+     2912, 2912,  450, 2470, 2912, 2912, 2461, 2912,  451,  450,
+     2912, 2912,  452, 2912,  450,  450,  450,  450, 2462, 2912,
+     2912,  450,  451,  450,  450,  450,  452,  450, 2912,  450,
+     2912,  450,  450, 2912,  451,  450,  450,  450,  452, 2912,
+     2912, 2912, 2912,  450,  450, 2474, 2912,  451, 2912, 2472,
+      450,  452,  450, 2912, 2912, 2912,  451, 1128,  450,  451,
+      452, 1129,  450,  452, 2912, 2912,  450, 2912, 2475,  451,
+
+      450, 2912, 2912,  452, 2912,  450, 2478, 2912,  450, 1130,
+     2912, 2912, 1128,  450,  450, 2479, 1129,  450, 2912, 2912,
+     2912,  450,  450,  450, 1263,  450, 2912, 1970, 1264, 2912,
+      450,  450, 2912,  450, 1130,  450, 2480, 2058,  451, 2912,
+      450, 2059,  452,  450, 2912, 2912, 1265,  451,  450,  451,
+      451,  452,  450,  452,  452, 2912,  450, 2912, 2002,  451,
+      450, 2912, 2912,  452, 2912, 2488,  450, 2912,  450, 2912,
+     2142, 2912, 2912,  450,  450,  450, 2912,  450,  450, 2912,
+     2491,  450,  450,  450, 2490,  450,  450,  450, 2492, 2912,
+     2912,  450, 1510,  450,  450,  450, 1511, 2494,  451, 2912,
+
+     2493,  451,  452,  450,  451,  452, 2912,  451,  452, 2912,
+     2912,  452, 1512, 2912, 2912, 2912, 2912, 2912,  451, 2095,
+      450, 2505,  452, 2096, 2912, 2506,  450, 2912,  450,  450,
+     2912, 2912,  450, 2912,  450,  450,  450,  450, 2497, 2501,
+      450, 2498,  450,  450, 2503,  450,  450,  450,  450,  450,
+     2912,  450,  451, 2912,  450,  450,  452,  450, 2912, 2912,
+     2502, 2912,  450,  450,  451,  450,  451, 2912,  452, 2281,
+      452, 2284, 2912, 2282, 2912, 2285, 2912, 2912, 2912, 2912,
+      450, 2912, 2912, 2912, 2912, 2912,  451, 2912,  450, 1243,
+      452, 2912,  450, 1244,  450, 2509,  450,  450, 2510,  450,
+
+      450, 2912,  450, 2912, 2912,  450, 2511,  450,  450, 2912,
+      450, 2508,  451,  450,  450,  450,  452,  450, 2514, 2912,
+     2912, 2912,  450,  451,  451,  450, 2912,  452,  452, 2912,
+      450, 2515, 2912,  450,  451, 2912, 2912, 2912,  452, 2912,
+      450, 2912, 2912, 2912, 2912,  451, 2912, 2912,  450,  452,
+     2912,  450,  450, 2912,  451, 2516,  450, 2436,  452,  450,
+      450, 2437,  450, 2912, 2912, 2518, 2517,  450,  450, 2912,
+      450, 2519,  451,  450, 2520,  451,  452, 2912,  450,  452,
+     2521,  450,  450, 2912, 1263,  450, 2912, 2531, 1264,  450,
+      450, 2912, 2912,  450, 2912,  991, 2912, 2912,  450,  992,
+
+      450,  450, 2912,  450, 2533, 2442, 1265, 2912,  450, 2443,
+      451,  450, 2534, 2522,  452, 2912,  450,  451, 2912,  450,
+      450,  452,  451,  450, 2912, 2912,  452, 2912,  450, 2912,
+     2912,  450,  451,  450, 2912, 2912,  452, 2539,  450,  450,
+     2912,  450, 2912, 2912, 1393,  450,  450, 2542, 1394, 2536,
+      450, 2540, 2912,  450,  450, 1713, 2912, 2544,  450, 1714,
+      450,  450, 2912, 2912, 2912, 1100,  450, 2457,  450, 1101,
+      451, 2458,  450, 2546,  452, 2912,  450, 2912, 2912, 2912,
+      450, 2912, 2547,  450, 2912, 2912, 2912, 2912,  450, 2912,
+     2912,  450,  451,  450, 2548,  450,  452, 2549,  450,  450,
+
+     2912,  450, 2912,  450,  451, 2912,  450, 2912,  452,  450,
+     2912,  450, 2912, 2551,  450, 2467, 2912, 2469, 2553, 2468,
+      450, 2470,  451, 2912, 2912, 2912,  452,  451,  450, 2554,
+     2912,  452,  450, 2912, 2564, 2912,  450, 2568, 2565, 2912,
+      450, 2569, 2912,  450, 2912,  450, 2912, 2912,  450, 2912,
+      450,  450, 2559,  450, 2561,  450, 2563, 2912,  450,  450,
+     1128,  450,  450,  450, 1129,  450,  450, 2912, 2912, 2912,
+      450,  450,  451,  450, 2912, 2058,  452, 2912,  450, 2059,
+     2912,  450, 1130, 2912, 2912,  451, 2912,  451,  450,  452,
+     2912,  452, 2912, 2912,  451, 2912,  450,  451,  452, 2912,
+
+      450,  452, 2570,  450,  450, 2912,  451, 2912,  450, 2912,
+      452,  450, 2912,  450, 2579,  450,  450, 2912, 2912,  450,
+      451,  450, 2582,  450,  452,  450, 2581, 2912, 2580,  450,
+      450,  450, 2586,  450,  450, 2585, 2587, 2912,  450,  451,
+     2912,  450,  450,  452, 2912, 2095, 2912, 2912,  450, 2096,
+      450, 2505, 2912, 2590, 1240, 2506,  450,  451,  451, 2912,
+      450,  452,  452, 2912,  450, 2912, 2912,  450,  450, 2912,
+     2281, 2592, 2912,  450, 2282,  450,  450, 2912, 2912,  450,
+     2284,  450, 2591,  450, 2285,  450,  450,  450, 2912,  450,
+     2912, 2912, 1243,  450,  450,  450, 1244, 2912, 2595,  451,
+
+     2594,  450,  450,  452, 2912,  451,  450, 2912,  450,  452,
+     2912,  451, 2912, 2912,  450,  452,  450,  451, 2912, 2912,
+      450,  452,  451, 2912,  450, 2912,  452,  450,  450, 2912,
+     2597, 2912, 2598,  450,  451,  450,  450, 2600,  452,  450,
+     2912,  450, 2912,  450, 2599,  450, 2912,  450,  451,  450,
+      450, 2912,  452,  450, 2912,  450, 2912, 2912,  450,  451,
+     2615, 2601,  450,  452, 2616,  451,  450, 2912, 2912,  452,
+      450, 2602, 2912, 2912, 2604, 2912,  450, 2912,  450, 2912,
+     2912, 2603, 2912, 2912,  450, 1263,  451,  450,  450, 1264,
+      452, 2912,  450,  450, 2912,  450,  450, 2912,  451, 2912,
+
+     2613,  450,  452,  450,  450, 2912, 2912, 1265,  451,  450,
+     2912,  451,  452,  450,  450,  452, 2912, 2912, 2912, 2912,
+      451,  450,  450, 2912,  452, 2620,  450, 2617, 2912,  450,
+      450, 1393, 2622, 1713,  450, 1394,  450, 1714, 2912,  450,
+     2912, 2912,  450, 2912,  450, 1100, 2912,  450,  450, 1101,
+      451, 2912,  450, 2912,  452,  450,  450, 2912, 2912,  450,
+     2912,  450,  451, 2912,  450, 2912,  452,  450,  451,  450,
+     2912, 2912,  452,  450, 2912,  450, 2623,  450,  450,  451,
+      451,  450, 2912,  452,  452, 2624,  450, 2912, 2912,  450,
+      450,  451, 2912,  451,  450,  452,  450,  452,  450, 2912,
+
+     2912, 2628, 2912, 2626,  450, 2912,  450,  450,  450, 2634,
+     2564, 2912,  450, 2568, 2565, 2629,  450, 2569, 2912, 2638,
+     2912,  450, 2912,  450,  450, 2912, 2636,  450,  451,  450,
+     1128, 2912,  452, 2912, 1129,  450, 2912,  450,  450,  451,
+      451,  450, 2912,  452,  452, 2912,  450, 2912, 2912,  450,
+     2640,  451, 1130, 2912,  450,  452,  450,  450,  450, 2912,
+     2912,  451, 2912, 2912,  450,  452,  450,  450,  450, 2650,
+     2912, 2912,  450, 2912,  450,  450,  450, 2912, 2912,  450,
+     2912, 2651, 2653,  450,  450, 2912, 2586,  450, 2912, 2655,
+     2587, 2912, 2652, 2912, 2912,  450,  451,  450,  451, 2661,
+
+      452, 2912,  452, 2662, 2912,  450, 2912, 2912, 1240, 2912,
+     2912, 2912, 2912, 2095,  450, 2912, 2281, 2096, 2912, 2663,
+     2282, 2912,  450, 2912,  450, 2912,  450,  450, 2912, 2912,
+      450, 2912,  450,  451,  450,  450, 2912,  452, 2912, 2658,
+      450,  450,  450,  450,  450, 2657,  451, 2912, 2659,  450,
+      452,  451,  450, 2912, 2912,  452, 2912,  450, 2912, 2912,
+      450,  450, 2912,  451, 2912, 2912, 2912,  452, 2664,  450,
+     2912, 2912, 2912, 2912,  450, 2912,  451,  450, 2912,  450,
+      452,  451,  450, 2912, 2665,  452, 2912,  450, 2912, 2912,
+      450,  450, 2912, 2912, 2666,  450, 2912, 2912,  451,  450,
+
+     2912, 2912,  452, 2912,  450, 2912, 2912, 2667, 2912,  450,
+      451, 2668,  450, 2912,  452,  451, 2912,  450, 2912,  452,
+      450, 2912, 2912, 2912, 2669,  450,  450, 2615, 2912, 2670,
+     2912, 2616, 2912, 2912,  450, 2912, 2912,  451,  450, 2912,
+     2680,  452,  450,  450, 1263, 2912,  450, 2912, 1264, 2686,
+     2912,  450, 2912, 2687, 2671,  450, 1713, 2912,  451,  450,
+     1714, 2912,  452,  450, 2682,  450, 1265, 2912, 2912, 2912,
+      451,  450,  450,  450,  452, 2912, 2684,  450, 2912, 2912,
+      450,  450, 2912, 2688,  450,  450,  450,  451,  450, 2912,
+     2912,  452,  450,  450,  450, 2912, 2912, 2912,  450, 2912,
+
+      450,  451,  450, 2690,  451,  452,  450,  451,  452, 2912,
+     2912,  452, 2912, 2700,  450,  450, 2912, 2701, 2692, 2912,
+     2912, 2912, 2713,  450,  451, 2912, 2714, 2693,  452,  450,
+     2912,  450,  450, 2912,  451,  450, 2912,  450,  452, 2912,
+      450,  450, 2912,  450, 2698,  450, 2912, 2696,  450,  450,
+      450,  450,  450, 2703, 2912, 2715, 2912,  450,  450, 2716,
+      450, 2717,  450, 2912, 2912, 2718,  450, 2720,  450, 2912,
+      450, 2721,  451, 2912, 2912, 2912,  452, 2912,  450, 2912,
+     2912,  451, 2661,  450, 2095,  452, 2662, 2912, 2096,  450,
+     2912,  450, 2912, 2912, 2728,  450, 2912,  450, 2729,  450,
+
+      450, 2723, 2663,  450, 2912,  450, 2912, 2912,  450,  450,
+      450,  450,  450, 2725, 2724,  451,  450,  450,  450,  452,
+      450, 2912,  450, 2912, 2912,  450,  450,  451,  450,  451,
+      450,  452,  451,  452, 2912, 2912,  452, 2912,  450, 2912,
+     2912, 2912, 2912,  450, 2730, 2912,  451, 2912, 2912, 2912,
+      452,  450,  451, 2912, 2912,  450,  452,  450,  451,  450,
+      450, 2912,  452,  450, 2731,  450, 2912, 2912,  450, 2732,
+     2912,  450, 2912,  450,  450,  451,  450,  960, 2912,  452,
+      450,  962,  450, 2912, 2912, 2733,  450,  451,  450, 2912,
+      450,  452, 2912,  451,  450, 2912,  450,  452, 2912, 2912,
+
+     2912, 2912, 2734,  450,  451, 2912,  451, 2912,  452, 2912,
+      452,  450, 2735,  451, 2912,  450, 2912,  452, 2744,  450,
+     2912,  450, 2746,  450,  451, 2912,  451, 2912,  452,  450,
+      452,  450,  450, 2748,  450, 2912, 2912,  450, 2912,  451,
+      450,  450,  450,  452, 2750, 2912, 2912, 2912,  450,  450,
+      450,  451,  450, 2912,  450,  452, 2912,  450, 2912, 2912,
+      450,  451,  450, 2912, 2912,  452, 2912,  450,  450, 2912,
+     2754, 2752, 2755, 2760, 2713,  450,  451, 2761, 2714,  450,
+      452, 2912, 2912,  450, 2912, 2912, 2912,  450, 2912,  450,
+     2758, 2772, 2772, 2912, 2779,  450, 2715,  450, 2780, 1216,
+
+     2716,  450,  450, 1217,  450,  450, 2912, 2912, 2912,  450,
+      450, 2717,  450, 2774, 2774, 2718, 2088,  450,  450, 2763,
+      450,  451,  450, 2912,  450,  452, 2912,  450, 2776, 2776,
+      450, 2912,  450, 2095, 2912,  450, 2912, 2096,  450,  450,
+      450, 2912, 2728,  450,  451, 2912, 2729,  450,  452,  450,
+     2912, 2912, 2912, 2912, 2912,  450, 2912,  450, 2782,  451,
+     2912,  450, 2912,  452,  451,  450, 2912, 2912,  452,  450,
+      450, 2912,  450, 2912, 2912, 2783, 2912,  450,  450,  451,
+      450, 2786, 2912,  452, 2787, 2912,  450,  450,  450,  451,
+     2912, 2912,  450,  452, 2912,  450, 2912, 2788,  451, 2912,
+
+      450,  451,  452,  450, 2789,  452, 2912,  450,  450, 2912,
+      451, 2912, 2912, 2912,  452,  450, 2798,  450, 2912, 2912,
+      451, 2912, 2912,  450,  452,  450,  450, 2790, 2912,  450,
+     2912, 2791, 2804,  450,  450, 2912, 2805,  450,  450, 2912,
+     2912, 2912,  450, 2912, 2912,  450,  450, 2912,  450, 2912,
+     2912, 2912, 2912, 2800,  450, 2912,  450, 2912, 2912, 2912,
+      450, 2802, 2912, 2912,  450, 2912, 2912, 2912,  450, 2912,
+     2912, 2912, 2912, 2912, 2806, 2912,  450, 2809, 2810, 2809,
+     2809, 2809, 2811, 2812, 2809, 2812, 2809, 2809, 2809, 2809,
+     2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2813,
+
+     2814, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809,
+     2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809,
+     2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809, 2809,
+     2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812,
+     2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812, 2815,
+     2815, 2815, 2815, 2815, 2815, 2816, 2816, 2816, 2817, 2812,
+     2812,  451,  451, 2912, 2824,  452,  452, 2760, 2825, 2912,
+     2912, 2761, 2912,  451, 2912, 2912, 2912,  452, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,  450,
+      450, 2912,  450, 2821, 2912,  450, 2912,  450,  450, 2820,
+
+      450,  450, 2912,  450, 2912,  450,  450, 2912,  450,  450,
+      451,  450,  451, 2912,  452,  451,  452,  450, 2912,  452,
+     2912,  451, 2779, 2912, 2912,  452, 2780, 2772, 2772, 2774,
+     2774, 2912, 2776, 2776, 2912,  451, 2912, 2912,  450,  452,
+      450,  451, 2912,  450, 2088,  452,  450, 2912,  450,  450,
+      450,  450, 2833, 2912,  450, 2912,  450,  450,  450,  450,
+      451, 2912, 2912,  450,  452,  450,  450, 2912, 2912,  450,
+      451,  450,  451, 2912,  452, 2912,  452,  450, 2912,  450,
+     2912, 2912,  451,  451,  886,  450,  452,  452,  450,  451,
+     2912, 2912, 2912,  452, 2912,  959,  450, 2912,  450, 2912,
+
+      450,  451, 2912, 2912,  450,  452,  450, 1249,  450, 2912,
+      450,  450, 2912, 2912,  450, 2834,  450, 2843,  450,  450,
+     2845, 2912, 2912, 2912, 2846,  450, 2835,  450, 2836,  450,
+     2804,  451,  451,  450, 2805,  452,  452,  450, 2912, 2912,
+     2912, 2912,  451,  451, 2912,  450,  452,  452,  450, 2824,
+     2912, 2912, 2912, 2825, 2912, 2912,  450, 2912,  450,  450,
+      450, 2912, 2912, 2912,  450, 2912,  450,  450,  450,  451,
+      450,  450, 2912,  452,  450,  450,  450,  450,  450,  450,
+     2912, 2912, 2912, 2912, 2859,  450, 2851, 2852,  451, 2912,
+     2912,  451,  452,  450,  451,  452, 2912,  450,  452, 2912,
+
+     2912, 2912, 2912,  451, 2912,  450, 2845,  452, 2912, 2912,
+     2846, 2912, 2912,  450, 2912, 2912,  450, 2860, 2912,  450,
+     2912,  451,  450, 2861,  450,  452, 2912,  450, 2912, 2912,
+      450,  450,  450, 1585,  450,  450, 2865, 2912,  450,  450,
+      451,  451,  450, 2912,  452,  452, 2912,  450, 2912,  450,
+      450,  451,  451, 2912, 2912,  452,  452,  450, 2912, 2912,
+     2912, 2912,  451, 1430, 2912,  450,  452, 2912,  450,  450,
+     2912, 2912, 2912, 2912, 2912, 2912,  450,  450, 2867,  450,
+      450, 2912,  451, 2871,  450,  450,  452,  450,  450,  451,
+      450, 2912, 2872,  452, 2873,  450,  450, 2912,  450,  451,
+
+     2912, 2912, 2912,  452,  451, 2912, 2878, 2876,  452,  451,
+      450, 2912, 2912,  452, 2912, 2912,  451,  450,  450,  451,
+      452, 2912, 2882,  452, 2912,  450,  450,  450, 2912, 2884,
+     2912, 2912,  450,  450,  451,  450, 2887,  450,  452, 2912,
+      450, 2883, 2912,  450,  450,  450,  451,  450,  450, 2912,
+      452, 2912,  450,  450, 2912,  450, 2912,  451, 1979, 2892,
+      450,  452,  450,  450, 2912, 2912, 2912,  451, 2891,  451,
+      450,  452, 2912,  452,  450, 2912, 2912, 2912,  450,  451,
+     2912,  969,  450,  452, 2912,  450, 2912, 2912,  451, 2912,
+      450, 2912,  452,  450, 2912,  450,  923,  450, 2895, 2912,
+
+     2912,  450,  451,  450,  961,  450,  452,  450, 2912, 2912,
+     2912,  450, 2900,  450,  451,  450,  450,  451,  452, 2912,
+     2912,  452, 2912,  450,  450, 2912, 2912, 2912, 2912, 2912,
+      450, 2903,  450, 2912, 2912, 2906, 2912, 2912,  450, 2912,
+     2912, 2909,  450, 2912, 2912,  450,  450, 2912, 2912, 2912,
+      450, 2912, 2912,  450, 2912, 2912, 2912, 2912,  450,  958,
+     2912,  450,  124,  124,  124,  124,  124,  124,  124,  124,
+      124,  124,  124,  124,  124,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  257,  257,
+      257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+
+      257,  260,  260,  260,  260,  260,  260,  260,  260,  260,
+      260,  260,  260,  260,  282,  282,  282,  282,  282,  282,
+      282,  282,  282,  282,  282,  282,  282,  285,  285,  285,
+      285,  285,  285,  285,  285,  285,  285,  285,  285,  285,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  169,  169,  169,  169,  169,  169,  169,
+      169,  169,  169,  169,  169,  169,  316,  316,  316,  316,
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  360,
+      360,  360,  360,  360,  360,  360,  360,  360,  360,  360,
+      360,  360,  363,  363,  363,  363,  363,  363,  363,  363,
+
+      363,  363,  363,  363,  363,  373,  373,  373,  373,  373,
+      373,  373,  373,  373,  373,  373,  373,  373,  382,  382,
+      382,  382,  382,  382,  382,  382,  382,  382,  382,  382,
+      382,  449,  449, 2912,  449,  449,  449,  449,  449,  449,
+      449,  449,  449,  449,  450,  450,  450,  450,  450, 2912,
+      450,  450,  450,  450,  550,  550, 2912,  550,  550,  550,
+      550,  550,  550,  550,  550,  550,  550,  551,  551, 2912,
+      551,  551,  551,  551,  551,  551,  551,  551,  551,  551,
+      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
+      557,  557, 2912,  557,  557,  557,  557,  557,  557,  557,
+
+      557,  557,  557,  558,  558, 2912,  558,  558,  558,  558,
+      558,  558,  558,  558,  558,  558,  559,  559, 2912,  559,
+      559,  559,  559,  559,  559,  559,  559,  559,  559,  562,
+     2912,  562,  562, 2912,  562,  562,  562,  562,  562,  562,
+      562,  562,  570,  570, 2912, 2912,  570,  570,  570,  570,
+      570,  570,  574,  574, 2912,  574,  574,  574,  574,  574,
+      574,  574,  574,  574,  574,  575,  575, 2912,  575,  575,
+      575,  575,  575,  575,  575,  575,  575,  575,  576,  576,
+     2912, 2912,  576,  576,  576,  576,  576,  576,  580,  580,
+     2912,  580,  580,  580,  580,  580,  580,  580,  580,  580,
+
+      580,  581,  581, 2912,  581,  581,  581,  581,  581,  581,
+      581,  581,  581,  581,  583,  583,  583,  583,  583,  583,
+      583,  583, 2912,  583,  583,  583,  583,  588,  588, 2912,
+     2912,  588,  588,  588,  588,  588,  588,  592,  592,  592,
+      592,  592,  592,  592,  592,  592,  592,  592,  592,  592,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  596,  596, 2912, 2912,  596,  596,  596,
+      596,  596,  596,  600,  600, 2912,  600,  600,  600,  600,
+      600,  600,  600,  600,  600,  600,  601,  601, 2912,  601,
+      601,  601,  601,  601,  601,  601,  601,  601,  601,  602,
+
+      602, 2912, 2912,  602,  602,  602,  602,  602,  602,  606,
+      606, 2912,  606,  606,  606,  606,  606,  606,  606,  606,
+      606,  606,  607,  607, 2912,  607,  607,  607,  607,  607,
+      607,  607,  607,  607,  607,  608,  608, 2912, 2912,  608,
+      608,  608,  608,  608,  608,  612,  612, 2912,  612,  612,
+      612,  612,  612,  612,  612,  612,  612,  612,  613,  613,
+     2912,  613,  613,  613,  613,  613,  613,  613,  613,  613,
+      613,  614,  614, 2912, 2912,  614,  614,  614,  614,  614,
+      614,  618,  618, 2912,  618,  618,  618,  618,  618,  618,
+      618,  618,  618,  618,  619,  619, 2912,  619,  619,  619,
+
+      619,  619,  619,  619,  619,  619,  619,  620,  620, 2912,
+     2912,  620,  620,  620,  620,  620,  620,  624,  624, 2912,
+      624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
+      625,  625, 2912,  625,  625,  625,  625,  625,  625,  625,
+      625,  625,  625,  626,  626, 2912, 2912,  626,  626,  626,
+      626,  626,  626,  630,  630, 2912,  630,  630,  630,  630,
+      630,  630,  630,  630,  630,  630,  631,  631, 2912,  631,
+      631,  631,  631,  631,  631,  631,  631,  631,  631,  632,
+      632, 2912, 2912,  632,  632,  632,  632,  632,  632,  636,
+      636, 2912,  636,  636,  636,  636,  636,  636,  636,  636,
+
+      636,  636,  637,  637, 2912,  637,  637,  637,  637,  637,
+      637,  637,  637,  637,  637,  638,  638, 2912, 2912,  638,
+      638,  638,  638,  638,  638,  642,  642, 2912,  642,  642,
+      642,  642,  642,  642,  642,  642,  642,  642,  643,  643,
+     2912,  643,  643,  643,  643,  643,  643,  643,  643,  643,
+      643,  644,  644, 2912, 2912,  644,  644,  644,  644,  644,
+      644,  648,  648, 2912,  648,  648,  648,  648,  648,  648,
+      648,  648,  648,  648,  649,  649, 2912,  649,  649,  649,
+      649,  649,  649,  649,  649,  649,  649,  650,  650, 2912,
+     2912,  650,  650,  650,  650,  650,  650,  654,  654, 2912,
+
+      654,  654,  654,  654,  654,  654,  654,  654,  654,  654,
+      655,  655, 2912,  655,  655,  655,  655,  655,  655,  655,
+      655,  655,  655,  656,  656, 2912, 2912,  656,  656,  656,
+      656,  656,  656,  660,  660, 2912,  660,  660,  660,  660,
+      660,  660,  660,  660,  660,  660,  661,  661, 2912,  661,
+      661,  661,  661,  661,  661,  661,  661,  661,  661,  662,
+      662,  662,  662, 2912,  662,  662,  662,  662,  662,  662,
+      662,  662,  663,  663, 2912,  663, 2912,  663,  663,  663,
+      663,  663,  663,  663,  663,  664,  664, 2912, 2912,  664,
+      664,  664,  664,  664,  664,  668,  668, 2912,  668,  668,
+
+      668,  668,  668,  668,  668,  668,  668,  668,  669,  669,
+     2912,  669,  669,  669,  669,  669,  669,  669,  669,  669,
+      669,  670,  670, 2912, 2912,  670,  670,  670,  670,  670,
+      670,  674,  674, 2912,  674,  674,  674,  674,  674,  674,
+      674,  674,  674,  674,  675,  675, 2912,  675,  675,  675,
+      675,  675,  675,  675,  675,  675,  675,  676,  676, 2912,
+     2912,  676,  676,  676,  676,  676,  676,  680,  680, 2912,
+      680,  680,  680,  680,  680,  680,  680,  680,  680,  680,
+      681,  681, 2912,  681,  681,  681,  681,  681,  681,  681,
+      681,  681,  681,  682,  682, 2912, 2912,  682,  682,  682,
+
+      682,  682,  682,  686,  686, 2912,  686,  686,  686,  686,
+      686,  686,  686,  686,  686,  686,  687,  687, 2912,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  688,
+      688,  688,  688,  688,  688, 2912,  688,  688,  688,  688,
+      688,  688,  689,  689, 2912, 2912,  689,  689,  689,  689,
+      689,  689,  693,  693, 2912,  693,  693,  693,  693,  693,
+      693,  693,  693,  693,  693,  694,  694, 2912,  694,  694,
+      694,  694,  694,  694,  694,  694,  694,  694,  695,  695,
+     2912, 2912,  695,  695,  695,  695,  695,  695,  699,  699,
+     2912,  699,  699,  699,  699,  699,  699,  699,  699,  699,
+
+      699,  700,  700, 2912,  700,  700,  700,  700,  700,  700,
+      700,  700,  700,  700,  701,  701, 2912, 2912,  701,  701,
+      701,  701,  701,  701,  705,  705, 2912,  705,  705,  705,
+      705,  705,  705,  705,  705,  705,  705,  706,  706, 2912,
+      706,  706,  706,  706,  706,  706,  706,  706,  706,  706,
+      707,  707, 2912, 2912,  707,  707,  707,  707,  707,  707,
+      711,  711, 2912,  711,  711,  711,  711,  711,  711,  711,
+      711,  711,  711,  712,  712, 2912,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  713,  713,  713,  713,
+      713,  713,  713,  713,  713,  713,  713,  713,  713,  718,
+
+      718,  718,  718,  718,  718, 2912,  718,  718,  718,  718,
+      718,  718,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  738,  738,  738,  738,  738,  738,  738,  738,
+      738, 2912,  738,  738,  738,  726,  726, 2912,  726,  726,
+      726,  726,  726,  726,  726,  726,  726,  726,  742,  742,
+     2912,  742,  742,  742,  742,  742,  742,  742,  742,  742,
+      742,  743,  743,  743,  743,  743,  743,  743,  743,  743,
+      743,  743, 2912,  743,  751,  751, 2912,  751,  751,  751,
+      751,  751,  751,  751,  751,  751,  751,  752,  752, 2912,
+      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
+
+      753,  753, 2912, 2912,  753,  753,  753,  753,  753,  753,
+      757,  757, 2912,  757,  757,  757,  757,  757,  757,  757,
+      757,  757,  757,  758,  758, 2912,  758,  758,  758,  758,
+      758,  758,  758,  758,  758,  758,  759,  759, 2912, 2912,
+      759,  759,  759,  759,  759,  759,  763,  763, 2912,  763,
+      763,  763,  763,  763,  763,  763,  763,  763,  763,  764,
+      764, 2912,  764,  764,  764,  764,  764,  764,  764,  764,
+      764,  764,  765,  765, 2912, 2912,  765,  765,  765,  765,
+      765,  765,  769,  769, 2912,  769,  769,  769,  769,  769,
+      769,  769,  769,  769,  769,  770,  770, 2912,  770,  770,
+
+      770,  770,  770,  770,  770,  770,  770,  770,  771,  771,
+     2912, 2912,  771,  771,  771,  771,  771,  771,  775,  775,
+     2912,  775,  775,  775,  775,  775,  775,  775,  775,  775,
+      775,  776,  776, 2912,  776,  776,  776,  776,  776,  776,
+      776,  776,  776,  776,  777, 2912,  777,  777, 2912,  777,
+      777,  777,  777,  777,  777,  777,  777,  778, 2912,  778,
+      778, 2912,  778,  778,  778, 2912,  778,  778,  778,  778,
+      779,  779, 2912, 2912,  779,  779,  779,  779,  779,  779,
+      783,  783, 2912,  783,  783,  783,  783,  783,  783,  783,
+      783,  783,  783,  784,  784, 2912,  784,  784,  784,  784,
+
+      784,  784,  784,  784,  784,  784,  785, 2912,  785,  785,
+     2912,  785,  785,  785,  785,  785,  785,  785,  785,  787,
+      787, 2912, 2912,  787,  787,  787,  787,  787,  787,  791,
+      791, 2912,  791,  791,  791,  791,  791,  791,  791,  791,
+      791,  791,  792,  792, 2912,  792,  792,  792,  792,  792,
+      792,  792,  792,  792,  792,  793, 2912,  793,  793, 2912,
+      793,  793,  793,  793,  793,  793,  793,  793,  795,  795,
+     2912, 2912,  795,  795,  795,  795,  795,  795,  799,  799,
+     2912,  799,  799,  799,  799,  799,  799,  799,  799,  799,
+      799,  800,  800, 2912,  800,  800,  800,  800,  800,  800,
+
+      800,  800,  800,  800,  801,  801, 2912, 2912,  801,  801,
+      801,  801,  801,  801,  805,  805, 2912,  805,  805,  805,
+      805,  805,  805,  805,  805,  805,  805,  806,  806, 2912,
+      806,  806,  806,  806,  806,  806,  806,  806,  806,  806,
+      807,  807, 2912, 2912,  807,  807,  807,  807,  807,  807,
+      811,  811, 2912,  811,  811,  811,  811,  811,  811,  811,
+      811,  811,  811,  812,  812, 2912,  812,  812,  812,  812,
+      812,  812,  812,  812,  812,  812,  813,  813, 2912,  813,
+      813,  813,  813,  813,  813,  813,  813,  813,  813,  814,
+      814, 2912,  814,  814,  814,  814,  814,  814,  814,  814,
+
+      814,  814,  815,  815, 2912,  815,  815,  815,  815,  815,
+      815,  815,  815,  815,  815,  817,  817, 2912, 2912,  817,
+      817,  817,  817,  817,  817,  821,  821, 2912,  821,  821,
+      821,  821,  821,  821,  821,  821,  821,  821,  822,  822,
+     2912,  822,  822,  822,  822,  822,  822,  822,  822,  822,
+      822,  823,  823, 2912, 2912,  823,  823,  823,  823,  823,
+      823,  827,  827, 2912,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  828,  828, 2912,  828,  828,  828,
+      828,  828,  828,  828,  828,  828,  828,  829,  829, 2912,
+     2912,  829,  829,  829,  829,  829,  829,  833,  833, 2912,
+
+      833,  833,  833,  833,  833,  833,  833,  833,  833,  833,
+      834,  834, 2912,  834,  834,  834,  834,  834,  834,  834,
+      834,  834,  834,  835,  835, 2912,  835,  835,  835,  835,
+      835,  835,  835,  835,  835,  835,  836,  836, 2912,  836,
+      836,  836,  836,  836,  836,  836,  836,  836,  836,  837,
+      837, 2912,  837,  837,  837,  837,  837,  837,  837,  837,
+      837,  837,  838,  838, 2912, 2912,  838,  838,  838,  838,
+      838,  838,  842,  842, 2912,  842,  842,  842,  842,  842,
+      842,  842,  842,  842,  842,  843,  843, 2912,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  844,  844,
+
+     2912, 2912,  844,  844,  844,  844,  844,  844,  848,  848,
+     2912,  848,  848,  848,  848,  848,  848,  848,  848,  848,
+      848,  849,  849, 2912,  849,  849,  849,  849,  849,  849,
+      849,  849,  849,  849,  850,  850, 2912, 2912,  850,  850,
+      850,  850,  850,  850,  854,  854, 2912,  854,  854,  854,
+      854,  854,  854,  854,  854,  854,  854,  855,  855, 2912,
+      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
+      856,  856, 2912, 2912,  856,  856,  856,  856,  856,  856,
+      860,  860, 2912,  860,  860,  860,  860,  860,  860,  860,
+      860,  860,  860,  861,  861, 2912,  861,  861,  861,  861,
+
+      861,  861,  861,  861,  861,  861,  449,  449, 2912,  449,
+      449,  449,  449,  449,  449,  449,  449,  449,  449,  450,
+      450,  450,  450,  450, 2912,  450,  450,  450,  450,  550,
+      550, 2912,  550,  550,  550,  550,  550,  550,  550,  550,
+      550,  550,  551,  551, 2912,  551,  551,  551,  551,  551,
+      551,  551,  551,  551,  551,  994,  994, 2912,  994,  994,
+      994,  994,  994,  994,  994,  994,  994,  994,  552,  552,
+     2912,  552,  552,  552,  552,  552,  552,  552,  552,  552,
+      552,  995,  995, 2912,  995,  995,  995,  995,  995,  995,
+      995,  995,  995,  995,  996,  996, 2912,  996,  996,  996,
+
+      996,  996,  996,  996,  996,  996,  996,  557,  557, 2912,
+      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
+      997,  997, 2912,  997,  997,  997,  997,  997,  997,  997,
+      997,  997,  997,  562, 2912,  562,  562, 2912,  562,  562,
+      562,  562,  562,  562,  562,  562,  570,  570, 2912, 2912,
+      570,  570,  570,  570,  570,  570,  574,  574, 2912,  574,
+      574,  574,  574,  574,  574,  574,  574,  574,  574,  575,
+      575, 2912,  575,  575,  575,  575,  575,  575,  575,  575,
+      575,  575, 1000, 1000, 2912, 1000, 1000, 1000, 1000, 1000,
+     1000, 1000, 1000, 1000, 1000,  576,  576, 2912, 2912,  576,
+
+      576,  576,  576,  576,  576,  580,  580, 2912,  580,  580,
+      580,  580,  580,  580,  580,  580,  580,  580,  581,  581,
+     2912,  581,  581,  581,  581,  581,  581,  581,  581,  581,
+      581, 1001, 1001, 2912, 1001, 1001, 1001, 1001, 1001, 1001,
+     1001, 1001, 1001, 1001,  583,  583,  583,  583,  583,  583,
+      583,  583, 2912,  583,  583,  583,  583,  588,  588, 2912,
+     2912,  588,  588,  588,  588,  588,  588,  592,  592,  592,
+      592,  592,  592,  592,  592,  592,  592,  592,  592,  592,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  593,  593, 2912,  593,  593,  593,  593,
+
+      593,  593,  593,  593,  593,  593,  595,  595, 2912,  595,
+      595,  595,  595,  595,  595,  595,  595,  595,  595, 1002,
+     1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002,
+     1002, 1002, 1003, 1003, 2912, 1003, 1003, 1003, 1003, 1003,
+     1003, 1003, 1003, 1003, 1003,  596,  596, 2912, 2912,  596,
+      596,  596,  596,  596,  596,  600,  600, 2912,  600,  600,
+      600,  600,  600,  600,  600,  600,  600,  600,  601,  601,
+     2912,  601,  601,  601,  601,  601,  601,  601,  601,  601,
+      601, 1004, 1004, 2912, 1004, 1004, 1004, 1004, 1004, 1004,
+     1004, 1004, 1004, 1004,  602,  602, 2912, 2912,  602,  602,
+
+      602,  602,  602,  602,  606,  606, 2912,  606,  606,  606,
+      606,  606,  606,  606,  606,  606,  606,  607,  607, 2912,
+      607,  607,  607,  607,  607,  607,  607,  607,  607,  607,
+     1005, 1005, 2912, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
+     1005, 1005, 1005,  608,  608, 2912, 2912,  608,  608,  608,
+      608,  608,  608,  612,  612, 2912,  612,  612,  612,  612,
+      612,  612,  612,  612,  612,  612,  613,  613, 2912,  613,
+      613,  613,  613,  613,  613,  613,  613,  613,  613, 1006,
+     1006, 2912, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006,
+     1006, 1006,  614,  614, 2912, 2912,  614,  614,  614,  614,
+
+      614,  614,  618,  618, 2912,  618,  618,  618,  618,  618,
+      618,  618,  618,  618,  618,  619,  619, 2912,  619,  619,
+      619,  619,  619,  619,  619,  619,  619,  619, 1007, 1007,
+     2912, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007, 1007,
+     1007,  620,  620, 2912, 2912,  620,  620,  620,  620,  620,
+      620,  624,  624, 2912,  624,  624,  624,  624,  624,  624,
+      624,  624,  624,  624,  625,  625, 2912,  625,  625,  625,
+      625,  625,  625,  625,  625,  625,  625, 1008, 1008, 2912,
+     1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
+      626,  626, 2912, 2912,  626,  626,  626,  626,  626,  626,
+
+      630,  630, 2912,  630,  630,  630,  630,  630,  630,  630,
+      630,  630,  630,  631,  631, 2912,  631,  631,  631,  631,
+      631,  631,  631,  631,  631,  631, 1009, 1009, 2912, 1009,
+     1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 1009,  632,
+      632, 2912, 2912,  632,  632,  632,  632,  632,  632,  636,
+      636, 2912,  636,  636,  636,  636,  636,  636,  636,  636,
+      636,  636,  637,  637, 2912,  637,  637,  637,  637,  637,
+      637,  637,  637,  637,  637, 1010, 1010, 2912, 1010, 1010,
+     1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,  638,  638,
+     2912, 2912,  638,  638,  638,  638,  638,  638,  642,  642,
+
+     2912,  642,  642,  642,  642,  642,  642,  642,  642,  642,
+      642,  643,  643, 2912,  643,  643,  643,  643,  643,  643,
+      643,  643,  643,  643, 1011, 1011, 2912, 1011, 1011, 1011,
+     1011, 1011, 1011, 1011, 1011, 1011, 1011,  644,  644, 2912,
+     2912,  644,  644,  644,  644,  644,  644,  648,  648, 2912,
+      648,  648,  648,  648,  648,  648,  648,  648,  648,  648,
+      649,  649, 2912,  649,  649,  649,  649,  649,  649,  649,
+      649,  649,  649, 1012, 1012, 2912, 1012, 1012, 1012, 1012,
+     1012, 1012, 1012, 1012, 1012, 1012,  650,  650, 2912, 2912,
+      650,  650,  650,  650,  650,  650,  654,  654, 2912,  654,
+
+      654,  654,  654,  654,  654,  654,  654,  654,  654,  655,
+      655, 2912,  655,  655,  655,  655,  655,  655,  655,  655,
+      655,  655, 1013, 1013, 2912, 1013, 1013, 1013, 1013, 1013,
+     1013, 1013, 1013, 1013, 1013,  656,  656, 2912, 2912,  656,
+      656,  656,  656,  656,  656,  660,  660, 2912,  660,  660,
+      660,  660,  660,  660,  660,  660,  660,  660,  661,  661,
+     2912,  661,  661,  661,  661,  661,  661,  661,  661,  661,
+      661, 1014, 1014, 2912, 1014, 1014, 1014, 1014, 1014, 1014,
+     1014, 1014, 1014, 1014,  662,  662,  662,  662, 2912,  662,
+      662,  662,  662,  662,  662,  662,  662,  663,  663, 2912,
+
+      663, 2912,  663,  663,  663,  663,  663,  663,  663,  663,
+      664,  664, 2912, 2912,  664,  664,  664,  664,  664,  664,
+      668,  668, 2912,  668,  668,  668,  668,  668,  668,  668,
+      668,  668,  668,  669,  669, 2912,  669,  669,  669,  669,
+      669,  669,  669,  669,  669,  669, 1015, 1015, 2912, 1015,
+     1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015, 1015,  670,
+      670, 2912, 2912,  670,  670,  670,  670,  670,  670,  674,
+      674, 2912,  674,  674,  674,  674,  674,  674,  674,  674,
+      674,  674,  675,  675, 2912,  675,  675,  675,  675,  675,
+      675,  675,  675,  675,  675, 1016, 1016, 2912, 1016, 1016,
+
+     1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016,  676,  676,
+     2912, 2912,  676,  676,  676,  676,  676,  676,  680,  680,
+     2912,  680,  680,  680,  680,  680,  680,  680,  680,  680,
+      680,  681,  681, 2912,  681,  681,  681,  681,  681,  681,
+      681,  681,  681,  681, 1017, 1017, 2912, 1017, 1017, 1017,
+     1017, 1017, 1017, 1017, 1017, 1017, 1017,  682,  682, 2912,
+     2912,  682,  682,  682,  682,  682,  682,  686,  686, 2912,
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
+      687,  687, 2912,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687, 1018, 1018, 2912, 1018, 1018, 1018, 1018,
+
+     1018, 1018, 1018, 1018, 1018, 1018,  688,  688,  688,  688,
+      688,  688, 2912,  688,  688,  688,  688,  688,  688,  689,
+      689, 2912, 2912,  689,  689,  689,  689,  689,  689,  693,
+      693, 2912,  693,  693,  693,  693,  693,  693,  693,  693,
+      693,  693,  694,  694, 2912,  694,  694,  694,  694,  694,
+      694,  694,  694,  694,  694, 1019, 1019, 2912, 1019, 1019,
+     1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,  695,  695,
+     2912, 2912,  695,  695,  695,  695,  695,  695,  699,  699,
+     2912,  699,  699,  699,  699,  699,  699,  699,  699,  699,
+      699,  700,  700, 2912,  700,  700,  700,  700,  700,  700,
+
+      700,  700,  700,  700, 1020, 1020, 2912, 1020, 1020, 1020,
+     1020, 1020, 1020, 1020, 1020, 1020, 1020,  701,  701, 2912,
+     2912,  701,  701,  701,  701,  701,  701,  705,  705, 2912,
+      705,  705,  705,  705,  705,  705,  705,  705,  705,  705,
+      706,  706, 2912,  706,  706,  706,  706,  706,  706,  706,
+      706,  706,  706, 1021, 1021, 2912, 1021, 1021, 1021, 1021,
+     1021, 1021, 1021, 1021, 1021, 1021,  707,  707, 2912, 2912,
+      707,  707,  707,  707,  707,  707,  711,  711, 2912,  711,
+      711,  711,  711,  711,  711,  711,  711,  711,  711,  712,
+      712, 2912,  712,  712,  712,  712,  712,  712,  712,  712,
+
+      712,  712, 1022, 1022, 2912, 1022, 1022, 1022, 1022, 1022,
+     1022, 1022, 1022, 1022, 1022,  713,  713,  713,  713,  713,
+      713,  713,  713,  713,  713,  713,  713,  713,  718,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
+      718, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
+     1024, 1024, 1024, 1024, 1029, 1029, 1029, 1029, 1029, 1029,
+     1029, 1029, 1029, 1029, 1029, 1029, 1029, 1034, 1034, 1034,
+     1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+      722,  722, 2912,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722, 1039, 1039, 2912, 1039, 1039, 1039, 1039,
+
+     1039, 1039, 1039, 1039, 1039, 1039, 1040, 1040, 2912, 1040,
+     1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040,  726,
+      726, 2912,  726,  726,  726,  726,  726,  726,  726,  726,
+      726,  726,  742,  742, 2912,  742,  742,  742,  742,  742,
+      742,  742,  742,  742,  742,  743,  743,  743,  743,  743,
+      743,  743,  743,  743,  743,  743, 2912,  743,  751,  751,
+     2912,  751,  751,  751,  751,  751,  751,  751,  751,  751,
+      751,  752,  752, 2912,  752,  752,  752,  752,  752,  752,
+      752,  752,  752,  752,  738,  738,  738,  738,  738,  738,
+      738,  738,  738,  738,  738,  738,  738, 1043, 1043, 1043,
+
+     1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+     1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048,
+     1048, 1048, 1048, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
+     1053, 1053, 1053, 1053, 1053, 1053, 1058, 1058, 1058, 1058,
+     1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1059,
+     1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059,
+     1059, 1059, 1060, 1060, 2912, 1060, 1060, 1060, 1060, 1060,
+     1060, 1060, 1060, 1060, 1060,  753,  753, 2912, 2912,  753,
+      753,  753,  753,  753,  753,  757,  757, 2912,  757,  757,
+      757,  757,  757,  757,  757,  757,  757,  757,  758,  758,
+
+     2912,  758,  758,  758,  758,  758,  758,  758,  758,  758,
+      758, 1061, 1061, 2912, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061,  759,  759, 2912, 2912,  759,  759,
+      759,  759,  759,  759,  763,  763, 2912,  763,  763,  763,
+      763,  763,  763,  763,  763,  763,  763,  764,  764, 2912,
+      764,  764,  764,  764,  764,  764,  764,  764,  764,  764,
+     1062, 1062, 2912, 1062, 1062, 1062, 1062, 1062, 1062, 1062,
+     1062, 1062, 1062,  765,  765, 2912, 2912,  765,  765,  765,
+      765,  765,  765,  769,  769, 2912,  769,  769,  769,  769,
+      769,  769,  769,  769,  769,  769,  770,  770, 2912,  770,
+
+      770,  770,  770,  770,  770,  770,  770,  770,  770, 1063,
+     1063, 2912, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063,
+     1063, 1063,  771,  771, 2912, 2912,  771,  771,  771,  771,
+      771,  771,  775,  775, 2912,  775,  775,  775,  775,  775,
+      775,  775,  775,  775,  775,  776,  776, 2912,  776,  776,
+      776,  776,  776,  776,  776,  776,  776,  776, 1064, 1064,
+     2912, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064,
+     1064,  777, 2912,  777,  777, 2912,  777,  777,  777,  777,
+      777,  777,  777,  777,  778, 2912,  778,  778, 2912,  778,
+      778,  778, 2912,  778,  778,  778,  778,  779,  779, 2912,
+
+     2912,  779,  779,  779,  779,  779,  779,  783,  783, 2912,
+      783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
+      784,  784, 2912,  784,  784,  784,  784,  784,  784,  784,
+      784,  784,  784, 1065, 1065, 2912, 1065, 1065, 1065, 1065,
+     1065, 1065, 1065, 1065, 1065, 1065,  785, 2912,  785,  785,
+     2912,  785,  785,  785,  785,  785,  785,  785,  785,  787,
+      787, 2912, 2912,  787,  787,  787,  787,  787,  787,  791,
+      791, 2912,  791,  791,  791,  791,  791,  791,  791,  791,
+      791,  791,  792,  792, 2912,  792,  792,  792,  792,  792,
+      792,  792,  792,  792,  792, 1067, 1067, 2912, 1067, 1067,
+
+     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,  793, 2912,
+      793,  793, 2912,  793,  793,  793,  793,  793,  793,  793,
+      793,  795,  795, 2912, 2912,  795,  795,  795,  795,  795,
+      795,  799,  799, 2912,  799,  799,  799,  799,  799,  799,
+      799,  799,  799,  799,  800,  800, 2912,  800,  800,  800,
+      800,  800,  800,  800,  800,  800,  800, 1069, 1069, 2912,
+     1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069,
+      801,  801, 2912, 2912,  801,  801,  801,  801,  801,  801,
+      805,  805, 2912,  805,  805,  805,  805,  805,  805,  805,
+      805,  805,  805,  806,  806, 2912,  806,  806,  806,  806,
+
+      806,  806,  806,  806,  806,  806, 1070, 1070, 2912, 1070,
+     1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070,  807,
+      807, 2912, 2912,  807,  807,  807,  807,  807,  807,  811,
+      811, 2912,  811,  811,  811,  811,  811,  811,  811,  811,
+      811,  811,  812,  812, 2912,  812,  812,  812,  812,  812,
+      812,  812,  812,  812,  812, 1071, 1071, 2912, 1071, 1071,
+     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,  813,  813,
+     2912,  813,  813,  813,  813,  813,  813,  813,  813,  813,
+      813, 1072, 1072, 2912, 1072, 1072, 1072, 1072, 1072, 1072,
+     1072, 1072, 1072, 1072,  817,  817, 2912, 2912,  817,  817,
+
+      817,  817,  817,  817,  821,  821, 2912,  821,  821,  821,
+      821,  821,  821,  821,  821,  821,  821,  822,  822, 2912,
+      822,  822,  822,  822,  822,  822,  822,  822,  822,  822,
+     1073, 1073, 2912, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
+     1073, 1073, 1073,  823,  823, 2912, 2912,  823,  823,  823,
+      823,  823,  823,  827,  827, 2912,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  828,  828, 2912,  828,
+      828,  828,  828,  828,  828,  828,  828,  828,  828, 1074,
+     1074, 2912, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074,
+     1074, 1074,  829,  829, 2912, 2912,  829,  829,  829,  829,
+
+      829,  829,  833,  833, 2912,  833,  833,  833,  833,  833,
+      833,  833,  833,  833,  833,  834,  834, 2912,  834,  834,
+      834,  834,  834,  834,  834,  834,  834,  834, 1075, 1075,
+     2912, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
+     1075,  835,  835, 2912,  835,  835,  835,  835,  835,  835,
+      835,  835,  835,  835, 1076, 1076, 2912, 1076, 1076, 1076,
+     1076, 1076, 1076, 1076, 1076, 1076, 1076,  838,  838, 2912,
+     2912,  838,  838,  838,  838,  838,  838,  842,  842, 2912,
+      842,  842,  842,  842,  842,  842,  842,  842,  842,  842,
+      843,  843, 2912,  843,  843,  843,  843,  843,  843,  843,
+
+      843,  843,  843, 1077, 1077, 2912, 1077, 1077, 1077, 1077,
+     1077, 1077, 1077, 1077, 1077, 1077,  844,  844, 2912, 2912,
+      844,  844,  844,  844,  844,  844,  848,  848, 2912,  848,
+      848,  848,  848,  848,  848,  848,  848,  848,  848,  849,
+      849, 2912,  849,  849,  849,  849,  849,  849,  849,  849,
+      849,  849, 1078, 1078, 2912, 1078, 1078, 1078, 1078, 1078,
+     1078, 1078, 1078, 1078, 1078,  850,  850, 2912, 2912,  850,
+      850,  850,  850,  850,  850,  854,  854, 2912,  854,  854,
+      854,  854,  854,  854,  854,  854,  854,  854,  855,  855,
+     2912,  855,  855,  855,  855,  855,  855,  855,  855,  855,
+
+      855, 1079, 1079, 2912, 1079, 1079, 1079, 1079, 1079, 1079,
+     1079, 1079, 1079, 1079,  856,  856, 2912, 2912,  856,  856,
+      856,  856,  856,  856,  860,  860, 2912,  860,  860,  860,
+      860,  860,  860,  860,  860,  860,  860,  861,  861, 2912,
+      861,  861,  861,  861,  861,  861,  861,  861,  861,  861,
+     1080, 1080, 2912, 1080, 1080, 1080, 1080, 1080, 1080, 1080,
+     1080, 1080, 1080,  450,  450,  450,  450,  450, 2912,  450,
+      450,  450,  450,  976,  976,  976,  976,  976,  976,  976,
+      976,  976,  976,  976,  976,  976,  550,  550, 2912,  550,
+      550,  550,  550,  550,  550,  550,  550,  550,  550,  551,
+
+      551, 2912,  551,  551,  551,  551,  551,  551,  551,  551,
+      551,  551,  552,  552, 2912,  552,  552,  552,  552,  552,
+      552,  552,  552,  552,  552, 1281, 1281, 2912, 1281, 1281,
+     1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281,  557,  557,
+     2912,  557,  557,  557,  557,  557,  557,  557,  557,  557,
+      557,  562, 2912,  562,  562, 2912,  562,  562,  562,  562,
+      562,  562,  562,  562,  570,  570, 2912,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  576,  576, 2912,
+      576,  576,  576,  576,  576,  576,  576,  576,  576,  576,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+
+      582,  582,  582,  588,  588, 2912,  588,  588,  588,  588,
+      588,  588,  588,  588,  588,  588,  596,  596, 2912,  596,
+      596,  596,  596,  596,  596,  596,  596,  596,  596,  602,
+      602, 2912,  602,  602,  602,  602,  602,  602,  602,  602,
+      602,  602,  608,  608, 2912,  608,  608,  608,  608,  608,
+      608,  608,  608,  608,  608,  614,  614, 2912,  614,  614,
+      614,  614,  614,  614,  614,  614,  614,  614,  620,  620,
+     2912,  620,  620,  620,  620,  620,  620,  620,  620,  620,
+      620,  626,  626, 2912,  626,  626,  626,  626,  626,  626,
+      626,  626,  626,  626,  632,  632, 2912,  632,  632,  632,
+
+      632,  632,  632,  632,  632,  632,  632,  638,  638, 2912,
+      638,  638,  638,  638,  638,  638,  638,  638,  638,  638,
+      644,  644, 2912,  644,  644,  644,  644,  644,  644,  644,
+      644,  644,  644,  650,  650, 2912,  650,  650,  650,  650,
+      650,  650,  650,  650,  650,  650,  656,  656, 2912,  656,
+      656,  656,  656,  656,  656,  656,  656,  656,  656,  664,
+      664, 2912,  664,  664,  664,  664,  664,  664,  664,  664,
+      664,  664,  670,  670, 2912,  670,  670,  670,  670,  670,
+      670,  670,  670,  670,  670,  676,  676, 2912,  676,  676,
+      676,  676,  676,  676,  676,  676,  676,  676,  682,  682,
+
+     2912,  682,  682,  682,  682,  682,  682,  682,  682,  682,
+      682,  689,  689, 2912,  689,  689,  689,  689,  689,  689,
+      689,  689,  689,  689,  695,  695, 2912,  695,  695,  695,
+      695,  695,  695,  695,  695,  695,  695,  701,  701, 2912,
+      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
+      707,  707, 2912,  707,  707,  707,  707,  707,  707,  707,
+      707,  707,  707,  718,  718,  718,  718,  718,  718,  718,
+      718,  718,  718,  718,  718,  718, 1024, 1024, 1024, 1024,
+     1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1029,
+     1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+
+     1029, 1029, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+     1034, 1034, 1034, 1034, 1034, 1282, 1282, 1282, 1282, 1282,
+     1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1287, 1287,
+     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287,
+     1287, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292,
+     1292, 1292, 1292, 1292, 1297, 1297, 1297, 1297, 1297, 1297,
+     1297, 1297, 1297, 1297, 1297, 1297, 1297, 1302, 1302, 2912,
+     1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302,
+     1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+     1303, 1303, 1303, 1308, 1308, 1308, 1308, 1308, 1308, 1308,
+
+     1308, 1308, 1308, 1308, 1308, 1308, 1313, 1313, 1313, 1313,
+     1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313,  722,
+      722, 2912,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722, 1318, 1318, 2912, 1318, 1318, 1318, 1318, 1318,
+     1318, 1318, 1318, 1318, 1318,  738,  738,  738,  738,  738,
+      738,  738,  738,  738,  738,  738,  738,  738, 1043, 1043,
+     1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+     1043, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048,
+     1048, 1048, 1048, 1048, 1053, 1053, 1053, 1053, 1053, 1053,
+     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1319, 1319, 1319,
+
+     1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319,
+     1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324,
+     1324, 1324, 1324, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
+     1329, 1329, 1329, 1329, 1329, 1329, 1334, 1334, 1334, 1334,
+     1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1339,
+     1339, 2912, 1339, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
+     1339, 1339, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
+     1340, 1340, 1340, 1340, 1340, 1345, 1345, 1345, 1345, 1345,
+     1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1350, 1350,
+     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
+
+     1350,  726,  726, 2912,  726,  726,  726,  726,  726,  726,
+      726,  726,  726,  726,  753,  753, 2912,  753,  753,  753,
+      753,  753,  753,  753,  753,  753,  753,  759,  759, 2912,
+      759,  759,  759,  759,  759,  759,  759,  759,  759,  759,
+      765,  765, 2912,  765,  765,  765,  765,  765,  765,  765,
+      765,  765,  765,  771,  771, 2912,  771,  771,  771,  771,
+      771,  771,  771,  771,  771,  771,  779,  779, 2912,  779,
+      779,  779,  779,  779,  779,  779,  779,  779,  779,  787,
+      787, 2912,  787,  787,  787,  787,  787,  787,  787,  787,
+      787,  787,  795,  795, 2912,  795,  795,  795,  795,  795,
+
+      795,  795,  795,  795,  795,  801,  801, 2912,  801,  801,
+      801,  801,  801,  801,  801,  801,  801,  801,  807,  807,
+     2912,  807,  807,  807,  807,  807,  807,  807,  807,  807,
+      807,  813,  813, 2912,  813,  813,  813,  813,  813,  813,
+      813,  813,  813,  813,  817,  817, 2912,  817,  817,  817,
+      817,  817,  817,  817,  817,  817,  817,  823,  823, 2912,
+      823,  823,  823,  823,  823,  823,  823,  823,  823,  823,
+      829,  829, 2912,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  835,  835, 2912,  835,  835,  835,  835,
+      835,  835,  835,  835,  835,  835,  838,  838, 2912,  838,
+
+      838,  838,  838,  838,  838,  838,  838,  838,  838,  844,
+      844, 2912,  844,  844,  844,  844,  844,  844,  844,  844,
+      844,  844,  850,  850, 2912,  850,  850,  850,  850,  850,
+      850,  850,  850,  850,  850,  856,  856, 2912,  856,  856,
+      856,  856,  856,  856,  856,  856,  856,  856,  450,  450,
+      450,  450,  450, 2912,  450,  450,  450,  450, 1362, 1362,
+     1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
+     1362, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1373, 1373, 1373, 1373, 1403, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1403, 1403, 1403, 1403, 1403, 1135, 1135, 1135,
+
+     1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135,
+      550,  550, 2912,  550,  550,  550,  550,  550,  550,  550,
+      550,  550,  550,  551,  551, 2912,  551,  551,  551,  551,
+      551,  551,  551,  551,  551,  551, 1467, 1467, 1467, 1467,
+     1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1550,
+     1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
+     1550, 1550, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607,
+     1607, 1607, 1607, 1607, 1607,  552,  552, 2912,  552,  552,
+      552,  552,  552,  552,  552,  552,  552,  552,  718,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
+
+      718, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
+     1024, 1024, 1024, 1024, 1029, 1029, 1029, 1029, 1029, 1029,
+     1029, 1029, 1029, 1029, 1029, 1029, 1029, 1034, 1034, 1034,
+     1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+     1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282,
+     1282, 1282, 1282, 1287, 1287, 1287, 1287, 1287, 1287, 1287,
+     1287, 1287, 1287, 1287, 1287, 1287, 1292, 1292, 1292, 1292,
+     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1297,
+     1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297,
+     1297, 1297, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+
+     1303, 1303, 1303, 1303, 1303, 1308, 1308, 1308, 1308, 1308,
+     1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1313, 1313,
+     1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313,
+     1313, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+     1623, 1623, 1623, 1623, 1628, 1628, 1628, 1628, 1628, 1628,
+     1628, 1628, 1628, 1628, 1628, 1628, 1628, 1633, 1633, 1633,
+     1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633,
+     1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+     1638, 1638, 1638, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+     1643, 1643, 1643, 1643, 1643, 1643, 1648, 1648, 1648, 1648,
+
+     1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,  722,
+      722, 2912,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  738,  738,  738,  738,  738,  738,  738,  738,
+      738,  738,  738,  738,  738, 1043, 1043, 1043, 1043, 1043,
+     1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043, 1048, 1048,
+     1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048,
+     1048, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
+     1053, 1053, 1053, 1053, 1319, 1319, 1319, 1319, 1319, 1319,
+     1319, 1319, 1319, 1319, 1319, 1319, 1319, 1324, 1324, 1324,
+     1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324,
+
+     1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
+     1329, 1329, 1329, 1334, 1334, 1334, 1334, 1334, 1334, 1334,
+     1334, 1334, 1334, 1334, 1334, 1334, 1340, 1340, 1340, 1340,
+     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1345,
+     1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
+     1345, 1345, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
+     1350, 1350, 1350, 1350, 1350, 1653, 1653, 1653, 1653, 1653,
+     1653, 1653, 1653, 1653, 1653, 1653, 1653, 1653, 1658, 1658,
+     1658, 1658, 1658, 1658, 1658, 1658, 1658, 1658, 1658, 1658,
+     1658, 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
+
+     1663, 1663, 1663, 1663, 1668, 1668, 1668, 1668, 1668, 1668,
+     1668, 1668, 1668, 1668, 1668, 1668, 1668, 1673, 1673, 1673,
+     1673, 1673, 1673, 1673, 1673, 1673, 1673, 1673, 1673, 1673,
+     1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678,
+     1678, 1678, 1678,  450,  450,  450,  450,  450, 2912,  450,
+      450,  450,  450,  550,  550, 2912,  550,  550,  550,  550,
+      550,  550,  550,  550,  550,  550,  551,  551, 2912,  551,
+      551,  551,  551,  551,  551,  551,  551,  551,  551, 1362,
+     1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362,
+     1362, 1362, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+
+     1373, 1373, 1373, 1373, 1373, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1413, 1413,
+     1413, 1413, 1413, 1413, 1413, 1413, 2912, 1413, 1413, 1413,
+     1413, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421,
+     1421, 1421, 1421, 1421, 1734, 1734, 1734, 1734, 1734, 1734,
+     1734, 1734, 1734, 1734, 1734, 1734, 1734, 1476, 1476, 1476,
+     1476, 1476, 1476, 1476, 1476, 2912, 1476, 1476, 1476, 1476,
+     1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550,
+     1550, 1550, 1550, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
+     1864, 1864, 1864, 1864, 1864, 1864, 1607, 1607, 1607, 1607,
+
+     1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
+      718,  718, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
+     1024, 1024, 1024, 1024, 1024, 1029, 1029, 1029, 1029, 1029,
+     1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1034, 1034,
+     1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+     1034, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282,
+     1282, 1282, 1282, 1282, 1287, 1287, 1287, 1287, 1287, 1287,
+     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1292, 1292, 1292,
+     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292,
+
+     1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297,
+     1297, 1297, 1297, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
+     1303, 1303, 1303, 1303, 1303, 1303, 1308, 1308, 1308, 1308,
+     1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1313,
+     1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313, 1313,
+     1313, 1313, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+     1623, 1623, 1623, 1623, 1623, 1628, 1628, 1628, 1628, 1628,
+     1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1633, 1633,
+     1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633,
+     1633, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638,
+
+     1638, 1638, 1638, 1638, 1643, 1643, 1643, 1643, 1643, 1643,
+     1643, 1643, 1643, 1643, 1643, 1643, 1643, 1648, 1648, 1648,
+     1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
+      738,  738,  738,  738,  738,  738,  738,  738,  738,  738,
+      738,  738,  738, 1043, 1043, 1043, 1043, 1043, 1043, 1043,
+     1043, 1043, 1043, 1043, 1043, 1043, 1048, 1048, 1048, 1048,
+     1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1053,
+     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
+     1053, 1053, 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1319,
+     1319, 1319, 1319, 1319, 1319, 1324, 1324, 1324, 1324, 1324,
+
+     1324, 1324, 1324, 1324, 1324, 1324, 1324, 1324, 1329, 1329,
+     1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
+     1329, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334,
+     1334, 1334, 1334, 1334, 1340, 1340, 1340, 1340, 1340, 1340,
+     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1345, 1345, 1345,
+     1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345,
+     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
+     1350, 1350, 1350, 1653, 1653, 1653, 1653, 1653, 1653, 1653,
+     1653, 1653, 1653, 1653, 1653, 1653, 1658, 1658, 1658, 1658,
+     1658, 1658, 1658, 1658, 1658, 1658, 1658, 1658, 1658, 1663,
+
+     1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
+     1663, 1663, 1668, 1668, 1668, 1668, 1668, 1668, 1668, 1668,
+     1668, 1668, 1668, 1668, 1668, 1673, 1673, 1673, 1673, 1673,
+     1673, 1673, 1673, 1673, 1673, 1673, 1673, 1673, 1678, 1678,
+     1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678, 1678,
+     1678,  726,  726,  726,  726,  726,  726,  726,  726,  726,
+      726,  726,  726,  450,  450,  450,  450,  450, 2912,  450,
+      450,  450,  450, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
+     1373, 2912, 1373, 1373, 1373, 1373, 1413, 1413, 1413, 1413,
+     1413, 1413, 1413, 1413, 2912, 1413, 1413, 1413, 1413,  550,
+
+      550, 2912,  550,  550,  550,  550,  550,  550,  550,  550,
+      550,  550,  551,  551, 2912,  551,  551,  551,  551,  551,
+      551,  551,  551,  551,  551, 1734, 1734, 1734, 1734, 1734,
+     1734, 1734, 1734, 1734, 1734, 1734, 1734, 1734, 2011, 2011,
+     2011, 2011, 2011, 2011, 2011, 2011, 2912, 2011, 2011, 2011,
+     2011,  994,  994, 2912,  994,  994,  994,  994,  994,  994,
+      994,  994,  994,  994, 2022, 2022, 2022, 2022, 2022, 2022,
+     2022, 2022, 2022, 2022, 2022, 2022, 2022, 1476, 1476, 1476,
+     1476, 1476, 1476, 1476, 1476, 2912, 1476, 1476, 1476, 1476,
+     2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091,
+
+     2091, 2091, 2091, 1864, 1864, 1864, 1864, 1864, 1864, 1864,
+     1864, 1864, 1864, 1864, 1864, 1864, 1607, 1607, 1607, 1607,
+     1607, 1607, 1607, 1607, 2912, 1607, 1607, 1607, 1607, 1403,
+     1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403,
+     1403, 1403, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467,
+     1467, 1467, 1467, 1467, 1467,  976,  976,  976,  976,  976,
+      976,  976,  976,  976,  976,  976,  976,  976, 2172, 2172,
+     2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172, 2172,
+     2172, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135,
+     1135, 1135, 1135, 1135, 1421, 1421, 1421, 1421, 1421, 1421,
+
+     1421, 1421, 1421, 1421, 1421, 1421, 1421, 2812, 2812, 2812,
+     2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812, 2812,
+      123, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912
+    } ;
+
+static yyconst flex_int16_t yy_chk[27006] =
+    {   0,
+        0,    1,    1,  320,    1,    1,    1,  320,    1,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
+        2,    2,    2,    3,    3,    3,    3,    3,    3,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    7,  144,    7,    7,    8,  144,    8,    8,    9,
+        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
 
@@ -4789,8 +4874,8 @@ static yyconst flex_int16_t yy_chk[26526] =
        35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
        35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
        35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
-       35,   35,   35,   35,   35,   37,  143,   37,   37,   38,
-      143,   38,   38,   39,  461,   39,   39,   40,  461,   40,
+       35,   35,   35,   35,   35,   37,  145,   37,   37,   38,
+      145,   38,   38,   39,  468,   39,   39,   40,  468,   40,
        40,   41,   41,   41,   41,   41,   41,   41,   41,   41,
        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
@@ -4827,15 +4912,15 @@ static yyconst flex_int16_t yy_chk[26526] =
        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   49,  329,   49,
-
-       49,   50,  462,   50,   50,   51,  462,   51,   51,   52,
-       51,   52,   52,   53,   52,   53,   53,   54,  132,   54,
-       54,   63,  132,   63,   63,   64, 3265,   64,   64,  136,
-       65,   63,   65,   65,   66,   64,   66,   66,  136,  132,
-      150,   65,  150,   65,  509,   66,   67,   66,   67,   67,
-       68,  509,   68,   68,  140,   79,   79,   67,   79,   79,
-      140,   68,   85,   53,   85,   85,  329,   54,   55,   55,
+       47,   47,   47,   47,   47,   47,   47,   49,  331,   49,
+
+       49,   50,  469,   50,   50,   51,  469,   51,   51,   52,
+       51,   52,   52,   53,   52,   53,   53,   54,  134,   54,
+       54,   63,  134,   63,   63,   64, 3329,   64,   64,  138,
+       65,   63,   65,   65,   66,   64,   66,   66,  138,  134,
+      152,   65,  152,   65,  517,   66,   67,   66,   67,   67,
+       68,  517,   68,   68,  142,   79,   79,   67,   79,   79,
+      142,   68,   85,   53,   85,   85,  331,   54,   55,   55,
        55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
        55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
        55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
@@ -4919,10 +5004,10 @@ static yyconst flex_int16_t yy_chk[26526] =
 
        77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
        77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   80,   80,  861,   80,   80,   81,
-       81,  455,   81,   81,   82,   82,  861,   82,   82,   86,
-      455,   86,   86,   87,   87,  886,   87,   87,  459,   88,
-       88,   81,   88,   88,  459,  886,   82,   83,   83,   83,
+       77,   77,   77,   77,   80,   80, 3187,   80,   80,   81,
+       81,  462,   81,   81,   82,   82,  488,   82,   82,   86,
+      462,   86,   86,   87,   87,  488,   87,   87,  466,   88,
+       88,   81,   88,   88,  466, 3008,   82,   83,   83,   83,
        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
@@ -4932,10 +5017,10 @@ static yyconst flex_int16_t yy_chk[26526] =
        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
        83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
-       83,   89, 3127,   89,   89,   90,  198,   90,   90,   93,
-       93,  199,   93,   93,   94,   94,  133,   94,   94,  133,
-      483,  483,  133,  133,  133,  135,  135,  198,  135,  479,
-       89,  135,  199,  479,   90,   91,   91,   91,   91,   91,
+       83,   89, 2910,   89,   89,   90,  200,   90,   90,   93,
+       93,  201,   93,   93,   94,   94,  135,   94,   94,  135,
+      490,  490,  135,  135,  135,  137,  137,  200,  137,  486,
+       89,  137,  201,  486,   90,   91,   91,   91,   91,   91,
        91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
        91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
 
@@ -4945,10 +5030,10 @@ static yyconst flex_int16_t yy_chk[26526] =
        91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
        91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
        91,   91,   91,   91,   91,   91,   91,   91,   91,   95,
-     2951,   95,   95,   96,  137,   96,   96,  152,  105,  445,
-      105,  105,  137,  445,  141,  492,  486,  137,  141,  486,
-      152,  152,  141,  152,  137,  512,  492,  141,   95,  105,
-      445,  512,   96,   97,   97,   97,   97,   97,   97,   97,
+     2907,   95,   95,   96,  139,   96,   96,  154,  105,  452,
+      105,  105,  139,  452,  143,  499,  493,  139,  143,  493,
+      154,  154,  143,  154,  139,  520,  499,  143,   95,  105,
+      452,  520,   96,   97,   97,   97,   97,   97,   97,   97,
 
        97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
        97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
@@ -4986,8 +5071,8 @@ static yyconst flex_int16_t yy_chk[26526] =
       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
       103,  103,  103,  103,  103,  103,  103,  103,  103,  106,
-      139,  106,  106,  314,  145,  499,  139,  145,  145,  499,
-      145,  314,  464,  314, 2853,  464,  464,  139,  464,  139,
+      141,  106,  106,  476, 2905,  476,  141,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  141, 2904,  141,
       106,  107,  107,  107,  107,  107,  107,  107,  107,  107,
       107,  107,  107,  107,  107,  107,  107,  107,  107,  107,
       107,  107,  107,  107,  107,  107,  107,  107,  107,  107,
@@ -5052,2519 +5137,2572 @@ static yyconst flex_int16_t yy_chk[26526] =
       119,  119,  119,  119,  119,  119,  119,  119,  119,  119,
       119,  119,  119,  119,  119,  119,  119,  119,  119,  119,
       119,  119,  119,  119,  119,  119,  119,  119,  119,  119,
-      119,  119,  119,  119,  119,  119,  119,  119,  119,  128,
-      147,  315,  526,  128,  147,  330,  466,  526,  148,  315,
-      466,  315,  148,  147,  147,  148,  148,  736,  458,  466,
-      128,  148,  148,  332,  458,  148,  148,  148,  149,  149,
-      316,  148,  149,  518,  149,  458,  149,  458,  316,  518,
-      316,  149,  469,  149,  469,  149,  163,  163,  163,  163,
-      163,  163,  163,  163,  163,  163,  181,  181,  181,  181,
-
-      181,  181,  181,  181,  181,  181,  476,  330,  476, 2850,
-      128,  128,  128,  128,  128,  128,  128,  128,  128,  128,
-      129,  129,  129,  129,  129,  129,  736,  129,  332,  129,
-      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
-      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
-      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
-      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
-      129,  129,  129,  182,  182,  182,  182,  182,  182,  182,
-      182,  182,  182,  452,  474,  195,  452,  527,  474,  452,
-      452,  452,  129,  129,  129,  129,  129,  129,  129,  129,
-
-      129,  129,  130,  527,  471,  474,  130,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  471,  471,  497,
-      471,  497, 2848,  130,  187,  187,  187,  187,  187,  187,
-      187,  187,  187,  187,  195,  195,  195,  195,  195,  195,
-      195,  195,  195,  195,  200,  200,  200,  200,  200,  200,
-      200,  200,  200,  200,  201,  201,  201,  201,  201,  201,
-      201,  201,  201,  201,  454,  454,  517,  454,  519,  517,
-      454,  721,  505,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  130,  154,  505,  948,  519,  154,  948,  154,
-      205,  205,  205,  205,  205,  205,  205,  205,  205,  205,
-
-      206,  206,  206,  206,  206,  206,  206,  206,  206,  206,
-      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
-      211,  211,  211,  211,  211,  211,  211,  211,  211,  211,
-      537, 2847,  537,  721,  154,  154,  154,  154,  154,  154,
-      154,  154,  154,  154,  154,  154,  154,  154,  154,  154,
-      154,  154,  154,  215,  215,  215,  215,  215,  215,  215,
-      215,  215,  215,  154,  154,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171,  171,  176,
-      216,  216,  216,  216,  216,  216,  216,  216,  216,  216,
-      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
-      221,  221,  221,  221,  221,  221,  221,  221,  221,  221,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
-
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  177,
-      177,  177,  177,  177,  177,  177,  177,  177,  177,  177,
-      177,  177,  177,  177,  177,  177,  177,  177,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  183,  226,  226,
-      226,  226,  226,  226,  226,  226,  226,  226,  230,  230,
-      230,  230,  230,  230,  230,  230,  230,  230,  231,  231,
-      231,  231,  231,  231,  231,  231,  231,  231,  235,  235,
-      235,  235,  235,  235,  235,  235,  235,  235,  522,  534,
-     1221,  709,  522, 1221,  534,  709,  183,  183,  183,  183,
-
+      119,  119,  119,  119,  119,  119,  119,  119,  119,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  130,  147,  149,  316,  130,  332,  149,
+      483,  504,  483,  504,  316,  512,  316,  147,  149,  149,
+      147,  147,  150,  147,  130,  334,  150,  512,  508,  150,
+      150,  461,  461,  534,  461,  150,  150,  461,  534,  150,
+      150,  150,  151,  151,  317,  150,  151,  506,  151,  508,
+      151,  506,  317,  525,  317,  151,  525,  151, 2902,  151,
       183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
-      183,  183,  183,  183,  183,  236,  236,  236,  236,  236,
-      236,  236,  236,  236,  236,  183,  183,  188,  240,  240,
-      240,  240,  240,  240,  240,  240,  240,  240,  241,  241,
-      241,  241,  241,  241,  241,  241,  241,  241,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245,  246,  246,
-      246,  246,  246,  246,  246,  246,  246,  246,  530,  850,
-      851, 2845,  851,  850, 2844,  530,  188,  188,  188,  188,
-      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
-      188,  188,  188,  188,  188,  250,  250,  250,  250,  250,
-
-      250,  250,  250,  250,  250,  188,  188,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-      191,  197,  251,  251,  251,  251,  251,  251,  251,  251,
-
-      251,  251,  504,  506,  540,  875,  504,  506,  540,  875,
-      197,  260,  260,  260,  260,  260,  260,  260,  260,  260,
-      260,  261,  261,  261,  261,  261,  261,  261,  261,  261,
-      261,  853,  506,  860,  904,  860,  904,  540,  504,  853,
-      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
-      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
-      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
-      197,  202,  265,  265,  265,  265,  265,  265,  265,  265,
-      265,  265,  266,  266,  266,  266,  266,  266,  266,  266,
-      266,  266,  270,  270,  270,  270,  270,  270,  270,  270,
-
-      270,  270,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  859,  879,  862,  869,  869,  879,  859,  862,
-      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
-      202,  202,  202,  202,  202,  202,  202,  202,  202,  275,
-      275,  275,  275,  275,  275,  275,  275,  275,  275,  202,
-      202,  207,  276,  276,  276,  276,  276,  276,  276,  276,
-      276,  276,  293,  293,  293,  293,  293,  293,  293,  293,
-      293,  293,  294,  294,  294,  294,  294,  294,  294,  294,
-      294,  294,  298,  298,  298,  298,  298,  298,  298,  298,
-      298,  298,  870,  870,  872,  872,  874,  874,  881,  881,
-
-      207,  207,  207,  207,  207,  207,  207,  207,  207,  207,
-      207,  207,  207,  207,  207,  207,  207,  207,  207,  299,
-      299,  299,  299,  299,  299,  299,  299,  299,  299,  207,
-      207,  212,  303,  303,  303,  303,  303,  303,  303,  303,
-      303,  303,  304,  304,  304,  304,  304,  304,  304,  304,
-      304,  304,  308,  308,  308,  308,  308,  308,  308,  308,
-      308,  308,  309,  309,  309,  309,  309,  309,  309,  309,
-      309,  309,  873,  885,  926,  926, 1431, 1431,  873,  885,
-      212,  212,  212,  212,  212,  212,  212,  212,  212,  212,
-      212,  212,  212,  212,  212,  212,  212,  212,  212,  322,
-
-      322,  322,  322,  322,  322,  322,  322,  322,  322,  212,
-      212,  217,  323,  323,  323,  323,  323,  323,  323,  323,
-      323,  323,  324,  324,  324,  324,  324,  324,  324,  324,
-      324,  324,  327,  327,  327,  327,  327,  327,  327,  327,
-      327,  327,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  911,  913, 1074, 1090, 1074, 1090,  911,  913,
-      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
-      217,  217,  217,  217,  217,  217,  217,  217,  217,  339,
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  217,
-      217,  222,  343,  343,  343,  343,  343,  343,  343,  343,
-
-      343,  343,  344,  344,  344,  344,  344,  344,  344,  344,
-      344,  344,  348,  348,  348,  348,  348,  348,  348,  348,
-      348,  348,  349,  349,  349,  349,  349,  349,  349,  349,
-      349,  349,  940,  941, 1106, 1125, 1106, 1125,  940,  941,
-      222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
-      222,  222,  222,  222,  222,  222,  222,  222,  222,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  222,
-      222,  227,  354,  354,  354,  354,  354,  354,  354,  354,
-      354,  354,  366,  366,  366,  366,  366,  366,  366,  366,
-      366,  366,  367,  367,  367,  367,  367,  367,  367,  367,
-
-      367,  367,  375,  375,  375,  375,  375,  375,  375,  375,
-      375,  375,  954,  969,  968, 1569, 1569,  954,  968,  969,
-      227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
-      227,  227,  227,  227,  227,  227,  227,  227,  227,  376,
-      376,  376,  376,  376,  376,  376,  376,  376,  376,  227,
-      227,  232,  384,  384,  384,  384,  384,  384,  384,  384,
-      384,  384,  385,  385,  385,  385,  385,  385,  385,  385,
-      385,  385,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  390,  390,  390,  390,  390,  390,  390,  390,
-      390,  390, 1050, 1052, 1091, 2841, 1050, 1052, 2839, 1091,
-
-      232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
-      232,  232,  232,  232,  232,  232,  232,  232,  232,  394,
-      394,  394,  394,  394,  394,  394,  394,  394,  394,  232,
-      232,  237,  395,  395,  395,  395,  395,  395,  395,  395,
-      395,  395,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  408,  408,  408,  408,  408,  408,  408,  408,
-      408,  408,  412,  412,  412,  412,  412,  412,  412,  412,
-      412,  412, 1093, 1094, 1134, 1160, 1134, 1160, 1093, 1094,
-      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
-      237,  237,  237,  237,  237,  237,  237,  237,  237,  413,
-
-      413,  413,  413,  413,  413,  413,  413,  413,  413,  237,
-      237,  242,  417,  417,  417,  417,  417,  417,  417,  417,
-      417,  417,  418,  418,  418,  418,  418,  418,  418,  418,
-      418,  418,  427,  427,  427,  427,  427,  427,  427,  427,
-      427,  427,  428,  428,  428,  428,  428,  428,  428,  428,
-      428,  428, 1097, 1167, 1105, 1167, 2836,  720, 1105, 1097,
-      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
-      242,  242,  242,  242,  242,  242,  242,  242,  242,  432,
-      432,  432,  432,  432,  432,  432,  432,  432,  432,  242,
-      242,  247,  433,  433,  433,  433,  433,  433,  433,  433,
-
-      433,  433,  437,  437,  437,  437,  437,  437,  437,  437,
-      437,  437,  438,  438,  438,  438,  438,  438,  438,  438,
-      438,  438,  460,  510,  525,  720,  460,  510,  525,  882,
-      460, 2833,  485, 1124, 2831,  460,  485,  882, 1124,  501,
-      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
-      247,  247,  247,  247,  247,  247,  247,  247,  247,  456,
-      501,  578,  485,  579,  541,  510,  525,  456,  541,  247,
-      247,  252,  456,  467,  508,  485, 2829,  467,  508,  456,
-      467,  467,  578,  923,  579,  553,  467,  467,  723,  553,
-      467,  467,  467,  468,  468,  490,  467,  468,  520,  468,
-
-     1066,  468,  520,  490,  553,  541,  468,  508,  468,  490,
-      468, 2828,  508,  490,  490,  513,  923, 1066,  508,  513,
-      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
-      252,  252,  252,  252,  252,  252,  252,  252,  252,  520,
-      513,  532,  520,  880,  932,  532,  513,  705,  706,  252,
-      252,  262,  586,  723,  932,  705,  706,  705,  706,  858,
-      513,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      562,  858,  888,  586, 2824,  912,  864,  986,  532,  880,
-      864,  888,  532,  576,  912,  532,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  580,  864,  986, 2823,
-
-      262,  262,  262,  262,  262,  262,  262,  262,  262,  262,
-      262,  262,  262,  262,  262,  262,  262,  262,  262,  588,
-      588,  588,  588,  588,  588,  588,  588,  588,  588,  262,
-      262,  267,  576,  576,  576,  576,  576,  576,  576,  576,
-      576,  576,  961, 2111, 2111,  580,  580,  580,  580,  580,
-      580,  580,  580,  580,  580,  594,  594,  594,  594,  594,
-      594,  594,  594,  594,  594,  600,  600,  600,  600,  600,
-      600,  600,  600,  600,  600,  961, 1169, 1171, 1169, 1171,
-      267,  267,  267,  267,  267,  267,  267,  267,  267,  267,
-      267,  267,  267,  267,  267,  267,  267,  267,  267,  606,
-
-      606,  606,  606,  606,  606,  606,  606,  606,  606,  267,
-      267,  272,  612,  612,  612,  612,  612,  612,  612,  612,
-      612,  612,  618,  618,  618,  618,  618,  618,  618,  618,
-      618,  618,  624,  624,  624,  624,  624,  624,  624,  624,
-      624,  624,  630,  630,  630,  630,  630,  630,  630,  630,
-      630,  630, 1108, 1150, 1139, 2717, 2717, 1150, 1108, 1139,
-      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
-      272,  272,  272,  272,  272,  272,  272,  272,  272,  636,
-      636,  636,  636,  636,  636,  636,  636,  636,  636,  272,
-      272,  277,  642,  642,  642,  642,  642,  642,  642,  642,
-
-      642,  642,  648,  648,  648,  648,  648,  648,  648,  648,
-      648,  648,  656,  656,  656,  656,  656,  656,  656,  656,
-      656,  656,  662,  662,  662,  662,  662,  662,  662,  662,
-      662,  662, 1141, 1166, 1197, 1207, 1197, 1207, 1166, 1141,
-      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
-      277,  277,  277,  277,  277,  277,  277,  277,  277,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  277,
-      277,  295,  674,  674,  674,  674,  674,  674,  674,  674,
-      674,  674,  681,  681,  681,  681,  681,  681,  681,  681,
-      681,  681,  687,  687,  687,  687,  687,  687,  687,  687,
-
-      687,  687,  693,  693,  693,  693,  693,  693,  693,  693,
-      693,  693,  710,  737, 1216, 1220, 1216, 2719, 2719, 1220,
-      295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
-      295,  295,  295,  295,  295,  295,  295,  295,  295,  699,
-      699,  699,  699,  699,  699,  699,  699,  699,  699,  295,
-      295,  300,  718,  718,  718,  718,  718,  718,  718,  718,
-      718,  718,  711,  884,  887,  737,  737,  711,  921,  909,
-      938,  884,  887,  909,  938, 2820,  921,  710,  710,  710,
-      710,  710,  710,  710,  710,  710,  710,  712,  927, 1142,
-      909,  938,  712, 1142, 2818, 1142,  927,  909,  731,  730,
-
-      300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
-      300,  300,  300,  300,  300,  300,  300,  300,  300,  730,
-      730,  730,  730,  730,  730,  730,  730,  730,  730,  300,
-      300,  305,  711,  711,  711,  711,  711,  711,  711,  711,
-      711,  711,  713,  935,  951,  924,  967,  713,  731,  924,
-     2721, 2721,  732,  935,  924,  967,  951,  712,  712,  712,
-      712,  712,  712,  712,  712,  712,  712, 1165,  731,  731,
-      731,  731,  731,  731,  731,  731,  731,  731,  741, 1165,
-      305,  305,  305,  305,  305,  305,  305,  305,  305,  305,
-      305,  305,  305,  305,  305,  305,  305,  305,  305,  852,
-
-     1143,  863,  732,  852,  866,  863, 1143, 2817,  866,  305,
-      305,  310,  713,  713,  713,  713,  713,  713,  713,  713,
-      713,  713,  732,  732,  732,  732,  732,  732,  732,  732,
-      732,  732,  733,  866,  740, 1080,  852,  852,  863, 1335,
-     1481,  866,  741, 1335,  741,  741, 1080,  741,  745,  745,
-      745,  745,  745,  745,  745,  745,  745,  745, 1481, 2813,
-      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
-      310,  310,  310,  310,  310,  310,  310,  310,  310,  959,
-     2812, 2809,  733,  959,  970,  740, 1070, 1145,  740,  310,
-      310,  335,  740,  970,  865, 1145, 1070,  740,  865,  959,
-
-      959,  740,  733,  733,  733,  733,  733,  733,  733,  733,
-      733,  733,  751,  751,  751,  751,  751,  751,  751,  751,
-      751,  751, 1233, 1257, 1233, 1257, 2807,  865,  335,  335,
-      335,  865,  335,  335,  335,  335,  335,  335,  335,  335,
-      335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
-      335,  335,  335,  335,  335,  335,  340,  757,  757,  757,
-      757,  757,  757,  757,  757,  757,  757,  763,  763,  763,
-      763,  763,  763,  763,  763,  763,  763,  771,  771,  771,
-      771,  771,  771,  771,  771,  771,  771,  779,  779,  779,
-      779,  779,  779,  779,  779,  779,  779, 1146, 1231, 1875,
-
-     2805, 1875, 2801, 1231, 1146,  340,  340,  340,  340,  340,
-      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
-      340,  340,  340,  340,  787,  787,  787,  787,  787,  787,
-      787,  787,  787,  787,  340,  340,  345,  793,  793,  793,
-      793,  793,  793,  793,  793,  793,  793,  799,  799,  799,
-      799,  799,  799,  799,  799,  799,  799,  809,  809,  809,
-      809,  809,  809,  809,  809,  809,  809,  815,  815,  815,
-      815,  815,  815,  815,  815,  815,  815, 1163, 1336, 1339,
-     2797, 2796, 1336, 1339, 1163,  345,  345,  345,  345,  345,
-      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
-
-      345,  345,  345,  345,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  345,  345,  350,  830,  830,  830,
-      830,  830,  830,  830,  830,  830,  830,  836,  836,  836,
-      836,  836,  836,  836,  836,  836,  836,  842,  842,  842,
-      842,  842,  842,  842,  842,  842,  842,  878,  855,  878,
-     1170,  878,  855,  878, 1076,  877, 1204, 1206, 1170,  877,
-      878, 2787, 1204, 1206, 1076,  350,  350,  350,  350,  350,
-      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
-      350,  350,  350,  350,  854,  855,  856,  867,  854,  855,
-      856,  867,  877,  883,  350,  350,  355,  883,  877,  891,
-
-     2785,  892, 1199,  891,  854,  892,  889,  856, 1077,  867,
-      889, 1073,  934, 1078, 1199, 1073,  934, 2784, 1077, 1078,
-     2782,  854,  883, 1078,  867, 1229, 1078,  856,  889, 1092,
-      883, 1100,  891,  934,  934,  889,  891, 1229,  892, 1092,
-      894, 1100, 1073,  889,  894,  355,  355,  355,  355,  355,
-      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
-      355,  355,  355,  355,  893, 2774,  895,  896,  893,  894,
-      895,  896, 1148, 2767,  355,  355,  368,  894,  897,  898,
-      899, 1148,  897,  898,  899,  893,  900, 1249, 1089,  896,
-      900,  895, 1089, 1068, 1208,  899, 1101, 1068, 1249, 1247,
-
-      898,  893, 2766,  895,  896, 1247, 1101, 1208,  903,  905,
-     1152, 1152,  903,  905, 1068,  897,  898,  899, 1348, 1089,
-      910, 1152, 1348,  900,  910,  368,  368,  368,  368,  368,
-      368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
-      368,  368,  368,  368,  901,  903,  905,  908,  901, 1079,
-     2743,  908,  910, 1079,  368,  368,  377,  910, 1168,  916,
-      917, 1348,  918,  916,  917,  925,  918, 2437, 1168,  925,
-     1252,  901,  901, 1095, 1079,  908, 2437, 1095, 2437,  901,
-     1079,  901, 1252, 1253,  908,  901,  901,  916,  901,  917,
-      901,  918, 2741, 1253,  928,  925,  916,  917,  928,  918,
-
-     2740, 2739,  925, 2738, 1095,  377,  377,  377,  377,  377,
-      377,  377,  377,  377,  377,  377,  377,  377,  377,  377,
-      377,  377,  377,  377,  902, 1098, 1084,  928,  902, 1098,
-     1084,  928,  928, 1873,  377,  377,  386,  914,  919, 1873,
-      920,  914,  919, 1347,  920,  902,  937, 1347, 2737, 1349,
-      937,  902,  902, 1349, 1353, 2736, 1098, 1084, 1353,  902,
-      920,  902,  914,  919,  914,  902,  902, 1084,  902,  922,
-      902, 2714,  914,  922,  914,  919,  914,  920,  914,  914,
-      914, 1347, 2713,  937, 2712,  386,  386,  386,  386,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
-
-      386,  386,  386,  386,  915,  930,  922, 1096,  915,  930,
-     2711, 1096, 2418,  922,  386,  386,  391,  929, 2702,  931,
-      936,  929,  933,  931,  936,  915,  933, 2418, 1096,  915,
-     1086,  915, 1112, 1109, 1086, 2701, 1112, 1109,  929,  915,
-     2694, 2692,  930,  915,  933,  915,  915,  915,  930,  939,
-      929, 1086, 1086,  939,  929,  929,  931,  936, 2690,  933,
-      931, 1109,  936, 1112, 1109,  391,  391,  391,  391,  391,
-      391,  391,  391,  391,  391,  391,  391,  391,  391,  391,
-      391,  391,  391,  391,  949,  950,  939,  952,  949,  950,
-     1027,  952,  939,  955,  391,  391,  396,  955,  956, 2688,
-
-      971,  974,  956,  963,  971,  974,  950,  963, 2687, 2686,
-     1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027,
-     2684,  949,  955, 2682,  952,  963,  949,  950, 2681,  975,
-      955, 2664,  963,  975, 2655,  956,  956,  971,  974, 1104,
-      963, 2654, 2653, 1104,  974,  396,  396,  396,  396,  396,
-      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
-      396,  396,  396,  396,  972,  973,  975, 1069,  972,  973,
-     1104, 1069, 2652,  976,  396,  396,  409,  976,  977, 1008,
-     1104, 1360,  977, 1081, 1083, 1360,  973, 1081, 1083,  972,
-      973, 1140, 1009, 1140,  976, 1362, 2650, 1010, 1069, 1362,
-
-     1140,  972, 1010,  972,  973, 1083, 1069, 1011, 2645, 1366,
-      976, 2641, 1011, 1366, 1081,  977,  977, 1012, 2640, 1379,
-     1081, 1083, 1012, 1379, 2637,  409,  409,  409,  409,  409,
-      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
-      409,  409,  409,  409, 1008, 1008, 1008, 1008, 1008, 1008,
-     1008, 1008, 1008, 1008,  409,  409,  414, 1009, 1009, 1009,
-     1009, 1009, 1009, 1009, 1009, 1009, 1009, 1010, 1010, 1010,
-     1010, 1010, 1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011,
-     1011, 1011, 1011, 1011, 1011, 1011, 1011, 1012, 1012, 1012,
-     1012, 1012, 1012, 1012, 1012, 1012, 1012, 1013, 2635, 1387,
-
-     2631, 2629, 1013, 1387, 1028,  414,  414,  414,  414,  414,
-      414,  414,  414,  414,  414,  414,  414,  414,  414,  414,
-      414,  414,  414,  414, 1028, 1028, 1028, 1028, 1028, 1028,
-     1028, 1028, 1028, 1028,  414,  414,  419, 1042, 1042, 1042,
-     1042, 1042, 1042, 1042, 1042, 1042, 1042, 1015, 1144, 1144,
-     1144, 1367, 1015, 2627, 1388, 1367, 2625, 1016, 1388, 1072,
-     1144, 1361, 1016, 1072, 2624, 1361, 2623, 1013, 1013, 1013,
-     1013, 1013, 1013, 1013, 1013, 1013, 1013, 1017, 2622, 1072,
-     1072, 1072, 1017, 1361, 1367,  419,  419,  419,  419,  419,
-      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
-
-      419,  419,  419,  419, 2621, 2620, 1371, 1082, 1102, 1122,
-     1371, 1082, 1102, 1122,  419,  419,  429, 1015, 1015, 1015,
-     1015, 1015, 1015, 1015, 1015, 1015, 1015, 1016, 1016, 1016,
-     1016, 1016, 1016, 1016, 1016, 1016, 1016, 1018, 1082, 1102,
-     1122, 2619, 1018, 1371, 1082, 1102, 1122, 1017, 1017, 1017,
-     1017, 1017, 1017, 1017, 1017, 1017, 1017, 1020, 2618, 1127,
-     1130, 2600, 1020, 1127, 1130,  429,  429,  429,  429,  429,
-      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
-      429,  429,  429,  429, 1103, 2595, 2594, 2593, 1103, 1378,
-     1127, 1130, 2592, 1378,  429,  429,  434, 1116, 2591, 2589,
-
-     1396, 1116, 1111, 1130, 1396, 1103, 1111, 1018, 1018, 1018,
-     1018, 1018, 1018, 1018, 1018, 1018, 1018, 1021, 1116, 1111,
-     1111, 1103, 1021, 1111, 1111, 1378, 2585, 1020, 1020, 1020,
-     1020, 1020, 1020, 1020, 1020, 1020, 1020, 1022, 2583, 1137,
-     1128, 2581, 1022, 1137, 1128,  434,  434,  434,  434,  434,
-      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
-      434,  434,  434,  434, 1123, 1129, 2579, 2578, 1123, 1129,
-     1137, 1128, 2575, 2573,  434,  434,  439, 1128, 1132, 1368,
-     1400, 1137, 1132, 1368, 1400, 1123, 1129, 1021, 1021, 1021,
-     1021, 1021, 1021, 1021, 1021, 1021, 1021, 1029, 2569, 1132,
-
-     1132, 1123, 1129, 2562, 2560, 2559, 1368, 1022, 1022, 1022,
-     1022, 1022, 1022, 1022, 1022, 1022, 1022, 1159, 1136, 1155,
-     1162, 1159, 1136, 1155, 1162,  439,  439,  439,  439,  439,
-      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
-      439,  439,  439,  439, 1030, 2558, 1159, 1029, 1159, 1136,
-     1155, 1162, 2557, 2556,  439,  439,  443, 1136, 2555, 1107,
-      443, 1113, 1155, 1107, 2554, 1113, 2553, 1029, 1029, 1029,
-     1029, 1029, 1029, 1029, 1029, 1029, 1029,  443, 1110, 1107,
-     2536, 1164, 1110, 1113, 1138, 1164, 2532, 1158, 1138, 1031,
-     1107, 1158, 1113, 1405, 1030, 1110, 1110, 1405, 2526, 1032,
-
-     1110, 1164, 1113, 2525, 2524, 1138, 1364, 1157, 1158, 1110,
-     1364, 1157, 1164, 2523, 1030, 1030, 1030, 1030, 1030, 1030,
-     1030, 1030, 1030, 1030, 1158, 2522, 1138,  443,  443,  443,
-      443,  443,  443,  443,  443,  443,  443,  444, 1157, 1031,
-     2516,  444, 1408, 1421, 1157, 2512, 1408, 1421, 1181, 1032,
-     1182, 1364, 1181, 1370, 1182, 1034, 2510, 1370,  444, 1031,
-     1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1032,
-     1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1181,
-     1183, 1182, 1186, 2508, 1183, 1035, 1186, 1423, 2507, 1184,
-     1425, 1423, 1193, 1184, 1425, 1370, 1193, 2506, 2505, 2502,
-
-     1189, 1183, 1407, 1186, 1189, 1034, 1407, 1423,  444,  444,
-      444,  444,  444,  444,  444,  444,  444,  444,  447, 1186,
-     1184, 1189,  447, 1193,  447, 1034, 1034, 1034, 1034, 1034,
-     1034, 1034, 1034, 1034, 1034, 1035, 1184, 1195, 1036, 1407,
-     1429, 1195, 1189, 1432, 1429, 1192, 1196, 1432, 1433, 1192,
-     1196, 2500, 1433, 2489, 2484, 1035, 1035, 1035, 1035, 1035,
-     1035, 1035, 1035, 1035, 1035, 1192, 1192, 1196, 1195,  447,
-      447,  447,  447,  447,  447,  447,  447,  447,  447,  447,
-      447,  447,  447,  447,  447,  447,  447,  447, 1036, 1200,
-     1187, 1194, 1188, 1200, 1187, 1194, 1188, 1198,  447,  447,
-
-      450, 1198, 1450, 1214,  450, 2482, 1450, 1214, 1036, 1036,
-     1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1198, 1194,
-     1200, 1187, 1194, 1188, 1214,  450,  450,  450,  450,  450,
-      450, 1187,  450,  450, 1188,  450,  450,  450,  450,  450,
-      450,  450,  450,  450,  450,  450,  450, 2481, 2480,  450,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  535,  535,  535,  535,  535,  535,
-      535,  535,  535,  535,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
+      332,  545, 2901,  545,  130,  130,  130,  130,  130,  130,
+
+      130,  130,  130,  130,  131,  131,  131,  131,  131,  131,
+      334,  131, 2898,  131,  131,  131,  131,  131,  131,  131,
+      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
+      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
+      131,  131,  131,  131,  131,  131,  131,  131,  131,  131,
+      131,  131,  131,  131,  131,  131,  131,  184,  184,  184,
+      184,  184,  184,  184,  184,  184,  184,  459,  481,  197,
+      459, 2896,  481,  459,  459,  459,  131,  131,  131,  131,
+      131,  131,  131,  131,  131,  131,  132,  527,  478,  481,
+      132,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+
+      188,  478,  478,  964,  478,  527,  964,  132,  189,  189,
+      189,  189,  189,  189,  189,  189,  189,  189,  197,  197,
+      197,  197,  197,  197,  197,  197,  197,  197,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  203,  203,
+      203,  203,  203,  203,  203,  203,  203,  203,  526,  530,
+      542,  586,  535,  530,  526,  542, 2893,  132,  132,  132,
+      132,  132,  132,  132,  132,  132,  132,  156,  535,  884,
+      884,  156,  586,  156,  207,  207,  207,  207,  207,  207,
+      207,  207,  207,  207,  208,  208,  208,  208,  208,  208,
+      208,  208,  208,  208,  212,  212,  212,  212,  212,  212,
+
+      212,  212,  212,  212,  213,  213,  213,  213,  213,  213,
+      213,  213,  213,  213,  865,  875,  865,  875,  156,  156,
+      156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
+      156,  156,  156,  156,  156,  156,  156,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  156,  156,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  178,  218,  218,  218,  218,  218,  218,
+      218,  218,  218,  218,  222,  222,  222,  222,  222,  222,
+      222,  222,  222,  222,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  227,  227,  227,  227,  227,  227,
+      227,  227,  227,  227,  178,  178,  178,  178,  178,  178,
+      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
+      178,  178,  178,  179,  179,  179,  179,  179,  179,  179,
+
+      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
+      179,  179,  180,  180,  180,  180,  180,  180,  180,  180,
+      180,  180,  180,  180,  180,  180,  180,  180,  180,  180,
+      180,  185,  228,  228,  228,  228,  228,  228,  228,  228,
+      228,  228,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  233,  233,  233,  233,  233,  233,  233,  233,
+      233,  233,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  538,  717,  864,  885,  885,  717,  864,  538,
+      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  185,  185,  185,  185,  185,  185,  185,  185,  238,
+
+      238,  238,  238,  238,  238,  238,  238,  238,  238,  185,
+      185,  190,  242,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  243,  243,  243,  243,  243,  243,  243,  243,
+      243,  243,  247,  247,  247,  247,  247,  247,  247,  247,
+      247,  247,  248,  248,  248,  248,  248,  248,  248,  248,
+      248,  248,  873,  874,  887,  887,  920,  873,  920,  874,
+      190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
+      190,  190,  190,  190,  190,  190,  190,  190,  190,  252,
+      252,  252,  252,  252,  252,  252,  252,  252,  252,  190,
+      190,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  199,  253,  253,  253,  253,
+      253,  253,  253,  253,  253,  253,  511,  513,  548,  890,
+      511,  513,  548,  890,  199,  262,  262,  262,  262,  262,
+
+      262,  262,  262,  262,  262,  263,  263,  263,  263,  263,
+      263,  263,  263,  263,  263,  867,  513,  889,  889,  896,
+      896,  548,  511,  867,  199,  199,  199,  199,  199,  199,
+      199,  199,  199,  199,  199,  199,  199,  199,  199,  199,
+      199,  199,  199,  199,  199,  199,  199,  199,  199,  199,
+      199,  199,  199,  199,  199,  204,  267,  267,  267,  267,
+      267,  267,  267,  267,  267,  267,  268,  268,  268,  268,
+      268,  268,  268,  268,  268,  268,  272,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  273,  273,  273,  273,
+      273,  273,  273,  273,  273,  273,  877,  888,  894,  942,
+
+      942,  877,  894,  888,  204,  204,  204,  204,  204,  204,
+      204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
+      204,  204,  204,  277,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  204,  204,  209,  278,  278,  278,  278,
+      278,  278,  278,  278,  278,  278,  295,  295,  295,  295,
+      295,  295,  295,  295,  295,  295,  296,  296,  296,  296,
+      296,  296,  296,  296,  296,  296,  300,  300,  300,  300,
+      300,  300,  300,  300,  300,  300,  900,  915,  970, 1453,
+     1453,  915,  900,  970,  209,  209,  209,  209,  209,  209,
+      209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
+
+      209,  209,  209,  301,  301,  301,  301,  301,  301,  301,
+      301,  301,  301,  209,  209,  214,  305,  305,  305,  305,
+      305,  305,  305,  305,  305,  305,  306,  306,  306,  306,
+      306,  306,  306,  306,  306,  306,  310,  310,  310,  310,
+      310,  310,  310,  310,  310,  310,  311,  311,  311,  311,
+      311,  311,  311,  311,  311,  311,  549,  939, 2890, 1091,
+      549, 1091,  587,  594,  214,  214,  214,  214,  214,  214,
+      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
+      214,  214,  214,  587,  594,  927,  929,  745,  318, 2888,
+      939,  927,  929,  214,  214,  219,  318,  549,  318,  324,
+
+      324,  324,  324,  324,  324,  324,  324,  324,  324,  325,
+      325,  325,  325,  325,  325,  325,  325,  325,  325,  326,
+      326,  326,  326,  326,  326,  326,  326,  326,  326,  329,
+      329,  329,  329,  329,  329,  329,  329,  329,  329,  745,
+      745, 1094, 2886, 1094,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  219,  219,  224,  341,  341,  341,  341,
+      341,  341,  341,  341,  341,  341,  345,  345,  345,  345,
+      345,  345,  345,  345,  345,  345,  346,  346,  346,  346,
+
+      346,  346,  346,  346,  346,  346,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  350,  956,  957, 1108, 1124,
+     1108, 1124,  956,  957,  224,  224,  224,  224,  224,  224,
+      224,  224,  224,  224,  224,  224,  224,  224,  224,  224,
+      224,  224,  224,  351,  351,  351,  351,  351,  351,  351,
+      351,  351,  351,  224,  224,  229,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  355,  356,  356,  356,  356,
+      356,  356,  356,  356,  356,  356,  368,  368,  368,  368,
+      368,  368,  368,  368,  368,  368,  369,  369,  369,  369,
+      369,  369,  369,  369,  369,  369,  984,  985, 1066, 1143,
+
+      984, 1143, 1066,  985,  229,  229,  229,  229,  229,  229,
+      229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
+      229,  229,  229,  377,  377,  377,  377,  377,  377,  377,
+      377,  377,  377,  229,  229,  234,  378,  378,  378,  378,
+      378,  378,  378,  378,  378,  378,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  387,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  391,  391,  391,  391,
+      391,  391,  391,  391,  391,  391, 1068, 1109, 1242, 1123,
+     1068, 1242, 1109, 1123,  234,  234,  234,  234,  234,  234,
+      234,  234,  234,  234,  234,  234,  234,  234,  234,  234,
+
+      234,  234,  234,  392,  392,  392,  392,  392,  392,  392,
+      392,  392,  392,  234,  234,  239,  396,  396,  396,  396,
+      396,  396,  396,  396,  396,  396,  397,  397,  397,  397,
+      397,  397,  397,  397,  397,  397,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  410,  410,  410,  410,
+      410,  410,  410,  410,  410,  410, 1111, 1112, 1152, 1181,
+     1152, 1181, 1111, 1112,  239,  239,  239,  239,  239,  239,
+      239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
+      239,  239,  239,  414,  414,  414,  414,  414,  414,  414,
+      414,  414,  414,  239,  239,  244,  415,  415,  415,  415,
+
+      415,  415,  415,  415,  415,  415,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  429,  429,  429,  429,
+      429,  429,  429,  429,  429,  429, 1115, 1142, 1188, 1190,
+     1188, 1190, 1142, 1115,  244,  244,  244,  244,  244,  244,
+      244,  244,  244,  244,  244,  244,  244,  244,  244,  244,
+      244,  244,  244,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  244,  244,  249,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  435,  435,  435,  435,
+      435,  435,  435,  435,  435,  435,  439,  439,  439,  439,
+
+      439,  439,  439,  439,  439,  439,  440,  440,  440,  440,
+      440,  440,  440,  440,  440,  440,  729,  728, 1170, 1192,
+     2885, 1192, 1170,  744,  249,  249,  249,  249,  249,  249,
+      249,  249,  249,  249,  249,  249,  249,  249,  249,  249,
+      249,  249,  249,  444,  444,  444,  444,  444,  444,  444,
+      444,  444,  444,  249,  249,  254,  445,  445,  445,  445,
+      445,  445,  445,  445,  445,  445,  463,  467,  473, 2881,
+      465,  467,  473,  903,  463,  467,  465,  471,  729,  463,
+      467,  473,  903,  497,  518,  728,  463,  465,  518,  465,
+      471,  497,  744,  471,  471,  492,  471,  497, 1158,  492,
+
+      731,  497,  497, 1158,  254,  254,  254,  254,  254,  254,
+      254,  254,  254,  254,  254,  254,  254,  254,  254,  254,
+      254,  254,  254,  474,  516,  492,  518,  474,  516,  876,
+      474,  474, 2880,  254,  254,  264,  474,  474,  492,  876,
+      474,  474,  474,  475,  475,  713,  474,  475, 2877,  475,
+      561,  475,  928,  713,  561,  713,  475,  516,  475,  872,
+      475,  928,  516,  528,  714,  731,  533,  528,  516,  561,
+      533,  872,  714,  866,  714,  540, 1160,  866,  521,  540,
+     2875,  895,  521, 1160,  264,  264,  264,  264,  264,  264,
+      264,  264,  264,  264,  264,  264,  264,  264,  264,  264,
+
+      264,  264,  264,  521,  528,  584,  967,  528,  533,  521,
+      866,  866,  540,  264,  264,  269,  540,  895,  967,  540,
+     1218, 2874, 1218,  521,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  576,  576,  576,  576,  576,  576,
+      576,  576,  576,  576,  897,  899, 1187,  588, 1228, 2870,
+     1228, 1187,  897,  899,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  269,  269,  269,  269,  269,  269,
+      269,  269,  269,  269,  269,  269,  269,  269,  269,  269,
+      269,  269,  269,  596,  596,  596,  596,  596,  596,  596,
+      596,  596,  596,  269,  269,  274,  588,  588,  588,  588,
+
+      588,  588,  588,  588,  588,  588,  602,  602,  602,  602,
+      602,  602,  602,  602,  602,  602,  608,  608,  608,  608,
+      608,  608,  608,  608,  608,  608,  614,  614,  614,  614,
+      614,  614,  614,  614,  614,  614, 1126, 1161, 1237, 2869,
+     1237, 1161, 1126, 1161,  274,  274,  274,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  274,  274,  620,  620,  620,  620,  620,  620,  620,
+      620,  620,  620,  274,  274,  279,  626,  626,  626,  626,
+      626,  626,  626,  626,  626,  626,  632,  632,  632,  632,
+      632,  632,  632,  632,  632,  632,  638,  638,  638,  638,
+
+      638,  638,  638,  638,  638,  638,  644,  644,  644,  644,
+      644,  644,  644,  644,  644,  644, 1162, 1163, 1254, 1278,
+     1254, 1278, 1162, 1163,  279,  279,  279,  279,  279,  279,
+      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
+      279,  279,  279,  650,  650,  650,  650,  650,  650,  650,
+      650,  650,  650,  279,  279,  297,  656,  656,  656,  656,
+      656,  656,  656,  656,  656,  656,  664,  664,  664,  664,
+      664,  664,  664,  664,  664,  664,  670,  670,  670,  670,
+      670,  670,  670,  670,  670,  670,  676,  676,  676,  676,
+      676,  676,  676,  676,  676,  676, 1166, 1241, 1356, 1593,
+
+     1593, 1241, 1356, 1166,  297,  297,  297,  297,  297,  297,
+      297,  297,  297,  297,  297,  297,  297,  297,  297,  297,
+      297,  297,  297,  682,  682,  682,  682,  682,  682,  682,
+      682,  682,  682,  297,  297,  302,  689,  689,  689,  689,
+      689,  689,  689,  689,  689,  689,  695,  695,  695,  695,
+      695,  695,  695,  695,  695,  695,  701,  701,  701,  701,
+      701,  701,  701,  701,  701,  701,  707,  707,  707,  707,
+      707,  707,  707,  707,  707,  707,  718, 1225, 1357, 1905,
+     2866, 1905, 1357, 1225,  302,  302,  302,  302,  302,  302,
+      302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
+
+      302,  302,  302,  726,  726,  726,  726,  726,  726,  726,
+      726,  726,  726,  302,  302,  307,  753,  753,  753,  753,
+      753,  753,  753,  753,  753,  753,  719,  901,  977,  948,
+      902,  719,  879, 1002, 2147, 2147,  879,  901,  902,  948,
+     1083,  718,  718,  718,  718,  718,  718,  718,  718,  718,
+      718,  720,  937,  879, 1002, 1360,  720, 1083, 2864, 1360,
+      937,  977,  739,  738,  307,  307,  307,  307,  307,  307,
+      307,  307,  307,  307,  307,  307,  307,  307,  307,  307,
+      307,  307,  307,  738,  738,  738,  738,  738,  738,  738,
+      738,  738,  738,  307,  307,  312,  719,  719,  719,  719,
+
+      719,  719,  719,  719,  719,  719,  721,  943,  983,  940,
+      951,  721,  739,  940, 2862,  943,  740,  983,  940, 1186,
+      951,  720,  720,  720,  720,  720,  720,  720,  720,  720,
+      720, 1186,  739,  739,  739,  739,  739,  739,  739,  739,
+      739,  739,  749, 2858,  312,  312,  312,  312,  312,  312,
+      312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
+      312,  312,  312,  869,  878,  880,  740,  869,  878,  880,
+     2773, 2773, 2854,  312,  312,  337,  721,  721,  721,  721,
+      721,  721,  721,  721,  721,  721,  740,  740,  740,  740,
+      740,  740,  740,  740,  740,  740,  741,  748,  880, 1098,
+
+      869,  878,  880, 1370,  869, 1087,  749, 1370,  749,  749,
+     1098,  749,  337,  337,  337, 1087,  337,  337,  337,  337,
+      337,  337,  337,  337,  337,  337,  337,  337,  337,  337,
+      337,  337,  337,  337,  337,  337,  337,  337,  337,  337,
+      342,  893, 1093,  893, 1505,  893,  741,  893,  748,  907,
+      986,  748, 1093,  907,  893,  748, 1159, 1090, 1159,  986,
+      748, 1090, 1505, 2853,  748, 1159,  741,  741,  741,  741,
+      741,  741,  741,  741,  741,  741,  759,  759,  759,  759,
+      759,  759,  759,  759,  759,  759,  907, 2844, 1090,  342,
+      342,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+
+      342,  342,  342,  342,  342,  342,  342,  342,  765,  765,
+      765,  765,  765,  765,  765,  765,  765,  765,  342,  342,
+      347,  771,  771,  771,  771,  771,  771,  771,  771,  771,
+      771,  779,  779,  779,  779,  779,  779,  779,  779,  779,
+      779,  787,  787,  787,  787,  787,  787,  787,  787,  787,
+      787,  795,  795,  795,  795,  795,  795,  795,  795,  795,
+      795, 1184, 1252, 2775, 2775, 2777, 2777, 1252, 1184,  347,
+      347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
+      347,  347,  347,  347,  347,  347,  347,  347,  801,  801,
+      801,  801,  801,  801,  801,  801,  801,  801,  347,  347,
+
+      352,  807,  807,  807,  807,  807,  807,  807,  807,  807,
+      807,  817,  817,  817,  817,  817,  817,  817,  817,  817,
+      817,  823,  823,  823,  823,  823,  823,  823,  823,  823,
+      823,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829, 1227, 1268, 2842, 2841, 2839, 2831, 1227, 1268,  352,
+      352,  352,  352,  352,  352,  352,  352,  352,  352,  352,
+      352,  352,  352,  352,  352,  352,  352,  352,  838,  838,
+      838,  838,  838,  838,  838,  838,  838,  838,  352,  352,
+      357,  844,  844,  844,  844,  844,  844,  844,  844,  844,
+      844,  850,  850,  850,  850,  850,  850,  850,  850,  850,
+
+      850,  856,  856,  856,  856,  856,  856,  856,  856,  856,
+      856, 1095, 1096, 2823, 1110, 2822, 1118, 1119, 1096,  892,
+     1165, 1095, 1096,  892, 1110, 1096, 1118, 1119, 1165,  357,
+      357,  357,  357,  357,  357,  357,  357,  357,  357,  357,
+      357,  357,  357,  357,  357,  357,  357,  357,  868,  870,
+      881,  882,  868,  870,  881,  882,  892,  898,  357,  357,
+      370,  898,  892, 2799, 1155,  906, 2797,  904,  868,  906,
+      870,  904,  925,  882,  954, 1155,  925, 1107,  954,  881,
+     1085, 1107, 1168, 2796, 1085,  868,  898,  881,  882,  904,
+      870, 1168, 1229,  925,  898,  954,  904, 1189,  906,  912,
+
+      925, 1085,  906,  912,  904, 1229, 2795, 1189, 1107,  370,
+      370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
+      370,  370,  370,  370,  370,  370,  370,  370,  908,  909,
+      910,  911,  908,  909,  910,  911,  912, 2794,  370,  370,
+      379,  913,  914,  916,  919,  913,  914,  916,  919,  908,
+      921, 2793, 1113,  911,  921,  910, 1113,  914,  909, 1164,
+     1164, 1164,  913, 1173, 1173,  908,  909,  910,  911, 2792,
+     1220, 1164, 1374,  938, 1173, 1270, 1374,  938,  913,  914,
+      916,  919, 1220, 1113,  926, 2770, 1270,  921,  926,  379,
+      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
+
+      379,  379,  379,  379,  379,  379,  379,  379,  917,  924,
+      938,  932,  917,  924, 2769,  932,  926,  938,  379,  379,
+      388,  926,  933, 1274,  934,  944,  933,  941,  934,  944,
+      935,  941, 1191, 1274,  935,  917,  917,  924, 1381,  932,
+     1191, 2768, 1381,  917, 2767,  917,  924,  917,  932,  917,
+      917,  933,  917,  934,  917,  935,  947,  941,  944,  933,
+      947,  934,  944,  944,  941, 2766, 2757,  935, 2756,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  918, 2749,
+      950, 1382,  918,  947,  950, 1382, 2747,  947,  388,  388,
+
+      393,  930,  936,  966,  946,  930,  936,  966,  946,  918,
+     1114,  950,  950, 1382, 1114,  918,  918, 1116, 2745, 2743,
+     2465, 1116,  936,  918,  966,  918,  930,  918,  930,  918,
+      918, 1114,  918,  952,  918, 2465,  930,  952,  930,  936,
+      930,  946,  930,  930,  930,  966, 2742,  946, 1116,  393,
+      393,  393,  393,  393,  393,  393,  393,  393,  393,  393,
+      393,  393,  393,  393,  393,  393,  393,  393,  931,  949,
+      952, 1903,  931,  949, 2741,  952, 2739, 1903,  393,  393,
+      398,  945, 2737,  953,  955,  945,  965,  953,  955,  931,
+      965,  949, 1383,  931, 1134,  931, 1383, 2736, 1134, 2719,
+
+     2710, 1204,  945,  931,  975, 1204,  949,  931,  975,  931,
+      931,  931,  968,  972,  945, 1134,  968,  972,  945,  945,
+      953,  955, 1204,  965,  975,  975, 2709,  955,  965,  398,
+      398,  398,  398,  398,  398,  398,  398,  398,  398,  398,
+      398,  398,  398,  398,  398,  398,  398,  398,  971,  968,
+      972,  972,  971,  979, 2708, 2707, 2706,  979,  398,  398,
+      411,  987,  988,  989, 2704,  987,  988,  989,  991,  993,
+     1387, 2699,  991,  993, 1387,  979, 1213,  971, 2695, 1217,
+     1213, 1250,  979, 1217,  989,  971, 1024,  988,  989, 2694,
+      979,  990, 2691, 1250, 2689,  990, 1213, 1213,  987,  988,
+
+     1217,  988,  989, 1025, 1086,  991,  993,  993, 1086,  411,
+      411,  411,  411,  411,  411,  411,  411,  411,  411,  411,
+      411,  411,  411,  411,  411,  411,  411,  411,  990,  992,
+     2685, 2683, 1388,  992,  990, 1086, 1388, 1273,  411,  411,
+      416, 1369, 1101, 1086, 1121, 1369, 1101, 2681, 1121, 1273,
+      992, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
+     1024, 2679, 1026, 1101, 2678, 1121,  992, 1026, 1025, 1025,
+     1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1027, 1101,
+     2677, 1121, 1401, 1027, 1369, 2676, 1401, 2675, 1043,  416,
+      416,  416,  416,  416,  416,  416,  416,  416,  416,  416,
+
+      416,  416,  416,  416,  416,  416,  416,  416, 1043, 1043,
+     1043, 1043, 1043, 1043, 1043, 1043, 1043, 1043,  416,  416,
+      421, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058,
+     1058, 2674, 1026, 1026, 1026, 1026, 1026, 1026, 1026, 1026,
+     1026, 1026, 1028, 2673, 2672, 2654, 2648, 1028, 1027, 1027,
+     1027, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 1029, 2647,
+     1409, 1410, 1392, 1029, 1409, 1410, 1392, 2646, 1044,  421,
+      421,  421,  421,  421,  421,  421,  421,  421,  421,  421,
+      421,  421,  421,  421,  421,  421,  421,  421, 1044, 1044,
+     1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044,  421,  421,
+
+      431, 2645, 1368, 1089, 1392, 1157, 1368, 1089, 2644, 1157,
+     2643, 2641, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,
+     1028, 1028, 1031, 1089, 1089, 1089, 1157, 1031, 1029, 1029,
+     1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1032, 2637,
+     1368, 1102, 1127, 1032, 1097, 1102, 1127, 1157, 1097,  431,
+      431,  431,  431,  431,  431,  431,  431,  431,  431,  431,
+      431,  431,  431,  431,  431,  431,  431,  431, 2635, 1097,
+     1127, 2633, 1102, 1127, 2631, 1097, 2630, 1418,  431,  431,
+      436, 1418, 1102, 1104, 1395, 1141, 1389, 1104, 1395, 1141,
+     1389, 2627, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031,
+
+     1031, 1031, 1033, 2625, 1104, 1104, 1141, 1033, 1032, 1032,
+     1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1034, 1389,
+     1099, 1122, 1141, 1034, 1099, 1122, 2621, 1395, 2614,  436,
+      436,  436,  436,  436,  436,  436,  436,  436,  436,  436,
+      436,  436,  436,  436,  436,  436,  436,  436, 2612, 1129,
+     1422, 1099, 1122, 1129, 1422, 2611, 2610, 1099,  436,  436,
+      441, 1427, 1122, 2609, 1150, 1427, 1129, 1129, 1150, 2608,
+     1129, 1129, 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033,
+     1033, 1033, 1036, 2607, 2606, 1150, 1150, 1036, 1034, 1034,
+     1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1037, 2605,
+
+     1100, 1130, 1145, 1037, 1100, 1130, 1145, 2588, 2584,  441,
+      441,  441,  441,  441,  441,  441,  441,  441,  441,  441,
+      441,  441,  441,  441,  441,  441,  441,  441, 2577, 2576,
+     1147, 1100, 1130, 1145, 1147, 2575, 2574, 1100,  441,  441,
+      446, 1219, 1179, 1210, 1207, 1219, 1179, 1210, 1207, 2573,
+     2572, 1147, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036,
+     1036, 1036, 1219, 1179, 1210, 1207, 2566, 1147, 1037, 1037,
+     1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1038, 1179,
+     1120, 1207, 1396, 1038, 1120, 1210, 1396, 2562, 1045,  446,
+      446,  446,  446,  446,  446,  446,  446,  446,  446,  446,
+
+      446,  446,  446,  446,  446,  446,  446,  446, 1125, 1128,
+     1376, 1120, 1125, 1128, 1376, 2560, 2558, 1120,  446,  446,
+      450, 1396, 2557, 2556,  450, 1385, 1128, 1128, 1125, 1385,
+     1376, 1128, 1376, 1400, 2555, 2552, 1046, 1400, 1045, 1125,
+     1128,  450, 1140, 1146, 2550, 2537, 1140, 1146, 1038, 1038,
+     1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1045, 1045,
+     1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1047, 1400,
+     1385, 1183, 1202, 1140, 1146, 1183, 1202, 1430, 1048, 1140,
+     1146, 1430, 2532, 1223, 1393, 1154, 1046, 1223, 1393, 1154,
+     2530,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+
+      450,  451, 1183, 1202, 1223,  451, 1046, 1046, 1046, 1046,
+     1046, 1046, 1046, 1046, 1046, 1046, 1154, 2529, 1047, 1050,
+     1223, 1393,  451, 2528, 1154, 1429, 2527, 1148, 1048, 1429,
+     1178, 1148, 1203, 1051, 1178, 2526, 1203, 2525, 1047, 1047,
+     1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1048, 1048,
+     1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1148, 2524,
+     2523, 1178, 1429, 1203, 1235, 2499, 2496, 1178, 1235, 1050,
+     1148, 2486,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  451,  454, 1051, 2485, 1235,  454, 2476,  454, 1050,
+     1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 2473,
+
+     2466, 2464, 1052, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
+     1051, 1051, 1051, 2463, 2460, 1431, 1443, 1442, 1434, 1431,
+     1443, 1442, 1434, 1156, 1176, 1208, 1447, 1156, 1176, 1208,
+     1447, 2453, 2450,  454,  454,  454,  454,  454,  454,  454,
+      454,  454,  454,  454,  454,  454,  454,  454,  454,  454,
+      454,  454, 1052, 1180, 1156, 1176, 1208, 1180, 1431, 1434,
+     1442, 2448,  454,  454,  457, 1156, 1208, 1176,  457, 2435,
+     2434, 2433, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052,
+     1052, 1052, 1180, 1391, 1180, 2431, 2430, 1391, 2429,  457,
+      457,  457,  457,  457,  457, 2428,  457,  457, 2427,  457,
+
+      457,  457,  457,  457,  457,  457,  457,  457,  457,  457,
+      457, 2403, 1391,  457,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  543,  543,
+      543,  543,  543,  543,  543,  543,  543,  543,  560,  560,
 
-      552,  552,  552,  552,  552,  552,  552,  552,  552,  552,
-      552,  552,  552,  552,  552,  552,  552,  552,  557, 1156,
-     1191, 1185, 1212, 1156, 1191, 1185, 1212, 1218, 1430, 2479,
-     2478, 1218, 1430, 1235, 1241, 2477, 2476, 1235, 1241, 1156,
-     1191, 2475, 2451, 1451, 2448, 1430, 1430, 1451, 1218, 1218,
-     1156, 1191, 1185, 1212, 1235, 1241, 2439, 1156, 1185,  557,
-      557,  557,  557,  557,  557,  557,  557,  557,  557,  557,
-      557,  557,  557,  557,  557,  557,  557,  557,  558,  558,
-      558,  558,  558,  558,  558,  558,  558,  558,  558,  558,
-      558,  558,  558,  558,  558,  558,  558,  559,  559,  559,
-
-      559,  559,  559,  559,  559,  559,  559,  559,  559,  559,
-      559,  559,  559,  559,  559,  559,  561,  561,  561,  561,
-      561,  561,  561,  561,  561,  561,  561,  561,  561,  561,
-      561,  561,  561,  561,  561,  563, 1179, 1190, 2438, 1201,
-     1179, 1190, 1203, 1201, 1202, 1369, 1203, 2429, 1202, 1369,
-     2426, 1213, 1485, 1037, 1435, 1213, 1485, 2419, 1435, 2417,
-     1488, 1179, 2416, 1179, 1488, 1202, 1039, 1179, 1190, 1435,
-     1201, 1179, 1203, 1203, 1369, 1179, 1201, 1179, 1179, 1179,
-     1190, 1202, 1213, 1040,  563,  563,  563,  563,  563,  563,
-      563,  563,  563,  563,  563,  563,  563,  563,  563,  563,
-
-      563,  563,  563, 1037, 1219, 1375, 1412, 1373, 1219, 1375,
-     1412, 1373, 2413,  563,  563,  569, 1039, 1225, 1226, 2406,
-     2403, 1225, 1226, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
-     1037, 1037, 1037, 1040, 1375, 1219, 1039, 1039, 1039, 1039,
-     1039, 1039, 1039, 1039, 1039, 1039, 1225, 1412, 1225, 1226,
-     1373, 2390, 2389, 1040, 1040, 1040, 1040, 1040, 1040, 1040,
-     1040, 1040, 1040, 1298,  569,  569,  569,  569,  569,  569,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  560,  560,  560,  560,  560,  560,  560,  560,
+      560,  560,  565, 1177, 1185, 1206, 1212, 1177, 1185, 1206,
+     1212, 1239, 1451, 2402, 2397, 1239, 1451, 1256, 1262, 2395,
+
+     2383, 1256, 1262, 1177, 1185, 1454, 1212, 1455, 2382, 1454,
+     2381, 1455, 1239, 1239, 1177, 1185, 1206, 1212, 1256, 1262,
+     2378, 1177, 1206,  565,  565,  565,  565,  565,  565,  565,
+      565,  565,  565,  565,  565,  565,  565,  565,  565,  565,
+      565,  565,  566,  566,  566,  566,  566,  566,  566,  566,
+      566,  566,  566,  566,  566,  566,  566,  566,  566,  566,
+      566,  567,  567,  567,  567,  567,  567,  567,  567,  567,
+      567,  567,  567,  567,  567,  567,  567,  567,  567,  567,
       569,  569,  569,  569,  569,  569,  569,  569,  569,  569,
-      569,  569,  569, 1298, 1298, 1298, 1298, 1298, 1298, 1298,
-     1298, 1298, 1298,  569,  569,  574,  574,  574,  574,  574,
-
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  574,  577,
-     1180, 1215, 1217, 1222, 1180, 1215, 1217, 1222, 1376, 1227,
-     1492, 2388, 1376, 1227, 1492, 1232, 1234, 2386,  577, 1232,
-
-     1234, 1180, 1444, 2385, 1217, 1180, 1444, 1180, 1215, 1227,
-     1041, 1222, 1215, 1217, 1222, 1180, 2384, 1376, 2383, 1180,
-     1227, 1180, 1180, 1180, 1444, 1222, 1232, 1234,  577,  577,
-      577,  577,  577,  577,  577,  577,  577,  577,  577,  577,
+      569,  569,  569,  569,  569,  569,  569,  569,  569,  571,
+
+     1131, 1200, 1214, 1209, 1131, 1200, 1214, 1209, 1216, 1445,
+     2377, 2368, 1216, 1445, 1367, 1221, 1272, 1053, 1367, 1221,
+     1272, 1472, 1131, 1473, 2367, 1472, 1200, 1473, 1200, 1445,
+     1055, 1131, 1200, 1214, 1209, 1367, 1200, 1272, 1272, 1216,
+     1200, 1131, 1200, 1200, 1200, 1209, 1221, 1056,  571,  571,
+      571,  571,  571,  571,  571,  571,  571,  571,  571,  571,
+      571,  571,  571,  571,  571,  571,  571, 1053, 1205, 1457,
+     1490, 1390, 1205, 1457, 1490, 1390, 2364,  571,  571,  577,
+     1055, 1224, 1215, 2357, 1457, 1224, 1215, 1053, 1053, 1053,
+     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1056, 1390, 1205,
+
+     1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055,
+     1215, 1224, 1224, 1215, 2356, 1205, 1490, 1056, 1056, 1056,
+     1056, 1056, 1056, 1056, 1056, 1056, 1056, 1319,  577,  577,
       577,  577,  577,  577,  577,  577,  577,  577,  577,  577,
-      577,  577,  577,  577,  577,  577,  577,  577,  577,  581,
-     1041, 1224, 2382, 1236, 1237, 1224, 1239, 1236, 1237, 1238,
-     1239, 1244, 1410, 1238, 1246, 1244, 1410, 2358, 1246, 2357,
-     1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
-     1238, 2352, 1224, 1236, 1236, 1237, 1374, 1239, 2350, 1410,
-
-     1374, 1237, 1244, 1239, 1224, 1246, 1238, 2339,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581, 1223, 1242, 1245,
-     1248, 1223, 1242, 1245, 1248, 1374, 1243,  581,  581,  589,
-     1243, 2338, 2337, 1251, 2335, 1242, 1242, 1251, 1223, 2334,
-     1242, 1245, 1256, 1243, 1243, 1223, 1256, 1243, 1243, 1242,
-     1245, 1248, 1261, 2325, 1251, 1251, 2324, 1409, 2321, 1223,
-     1245, 1409, 1411, 1415, 1262, 2314, 1411, 1415, 2313, 1263,
-     2311, 1256, 1417, 1256, 1263, 2310, 1417, 2307,  589,  589,
+      577,  577,  577,  577,  577,  577,  577, 1319, 1319, 1319,
+     1319, 1319, 1319, 1319, 1319, 1319, 1319,  577,  577,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  585, 1201, 1211, 1233, 1222, 1201, 1211,
+     1233, 1222, 1259, 1432, 1384, 2354, 1259, 1432, 1384, 1234,
+     1238, 2353,  585, 1234, 1238, 1201, 1509, 2350, 1512, 1201,
+     1509, 1201, 1512, 1259, 1057, 1384, 1211, 1233, 1222, 1201,
+     1432, 2338, 1238, 1201, 1222, 1201, 1201, 1201, 1211, 1259,
+     1234, 1238,  585,  585,  585,  585,  585,  585,  585,  585,
+
+      585,  585,  585,  585,  585,  585,  585,  585,  585,  585,
+      585,  585,  585,  585,  585,  585,  585,  585,  585,  585,
+      585,  585,  585,  589, 1057, 1240, 1245, 1236, 1247, 1240,
+     1245, 1236, 1247, 1246, 1253, 1248, 1483, 1246, 1253, 1248,
+     1483, 2333, 2331, 2325, 1057, 1057, 1057, 1057, 1057, 1057,
+     1057, 1057, 1057, 1057, 1236, 1248, 1240, 1245, 1236, 1247,
+     2322, 2309, 1246, 1243, 1246, 1253, 1248, 1243, 2308, 1245,
+     2307, 1483,  589,  589,  589,  589,  589,  589,  589,  589,
       589,  589,  589,  589,  589,  589,  589,  589,  589,  589,
-
-      589,  589,  589,  589,  589,  589,  589, 1259, 1411, 1498,
-     1409, 1259, 2295, 1498, 2290, 1415, 1346,  589,  589,  595,
-     1346, 1422, 1259, 2284, 1417, 1422, 2281, 1261, 1261, 1261,
-     1261, 1261, 1261, 1261, 1261, 1261, 1261, 1346, 1259, 1262,
-     1262, 1262, 1262, 1262, 1262, 1262, 1262, 1262, 1262, 1263,
-     1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1264,
-     2268, 1472, 1422, 2267, 1264, 1472, 2266, 1299,  595,  595,
-      595,  595,  595,  595,  595,  595,  595,  595,  595,  595,
-      595,  595,  595,  595,  595,  595,  595, 1299, 1299, 1299,
-     1299, 1299, 1299, 1299, 1299, 1299, 1299,  595,  595,  601,
-
-     1472, 1351, 1420, 2265, 1355, 1351, 1420, 1363, 1355, 2264,
-     1265, 1363, 1416, 1418, 1436, 1265, 1416, 1418, 1436, 2263,
-     1266, 1351, 1351, 1351, 1355, 1266, 1355, 2262, 1363, 1264,
-     1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1267,
-     2261, 1416, 1418, 1436, 1267, 1420, 2260, 2237,  601,  601,
-      601,  601,  601,  601,  601,  601,  601,  601,  601,  601,
-      601,  601,  601,  601,  601,  601,  601, 1512, 1438, 1519,
-     1520, 1512, 1438, 1519, 1520, 2233, 2221,  601,  601,  607,
-     1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265,
-     1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266, 1266,
-
-     1268, 1438, 1390, 1467, 1386, 1268, 1390, 1467, 1386, 1267,
-     1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1269,
-     2220, 2217, 2214, 1390, 1269, 1386, 1386, 2209,  607,  607,
-      607,  607,  607,  607,  607,  607,  607,  607,  607,  607,
-      607,  607,  607,  607,  607,  607,  607, 1359, 1524, 1467,
-     1468, 1359, 1524, 2194, 1468, 2192, 2191,  607,  607,  613,
-     1426, 1398, 1406, 2190, 1426, 1398, 1406, 1359, 1359, 1359,
-     1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268,
-     1270, 1398, 1398, 1406, 1445, 1270, 1468, 1426, 1445, 1269,
-     1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1271,
-
-     2188, 1427, 1426, 1439, 1271, 1427, 1445, 1439,  613,  613,
-      613,  613,  613,  613,  613,  613,  613,  613,  613,  613,
-      613,  613,  613,  613,  613,  613,  613, 1372, 1434, 1427,
-     1470, 1372, 1434, 2187, 1470, 2181, 2174,  613,  613,  619,
-     1440, 1424, 2173, 1427, 1440, 1424, 1439, 2170, 1372, 1434,
-     1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
-     1272, 1424, 1424, 1535, 1372, 1272, 2168, 1535, 1470, 1271,
-     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1273,
-     2165, 1441, 1443, 1440, 1273, 1441, 1443, 2163,  619,  619,
-      619,  619,  619,  619,  619,  619,  619,  619,  619,  619,
-
-      619,  619,  619,  619,  619,  619,  619, 2162, 1453, 1502,
-     1441, 1443, 1453, 1502, 2156, 2151, 2146,  619,  619,  625,
-     1428, 1446, 1447, 1459, 1428, 1446, 1447, 1459, 2143, 1453,
-     1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272,
-     1274, 1428, 1501, 1446, 1447, 1274, 1501, 1502, 1428, 1273,
-     1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1275,
-     2141, 1461, 1428, 1462, 1275, 1461, 1459, 1462,  625,  625,
-      625,  625,  625,  625,  625,  625,  625,  625,  625,  625,
-      625,  625,  625,  625,  625,  625,  625, 1448, 1486, 1501,
-     1503, 1448, 1486, 2130, 1503, 2128, 1461,  625,  625,  631,
-
-     1449, 1464, 2124, 1466, 1449, 1464, 1462, 1466, 1486, 1448,
-     1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274,
-     1276, 1503, 1449, 1544, 1469, 1276, 1464, 1544, 1469, 1275,
-     1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1278,
-     2123, 1465, 2118, 1493, 1278, 1465, 1466, 1493,  631,  631,
-      631,  631,  631,  631,  631,  631,  631,  631,  631,  631,
-      631,  631,  631,  631,  631,  631,  631, 1469, 2108, 2100,
-     1495, 1465, 1471, 1493, 1495, 2097, 1471,  631,  631,  637,
-     2096, 1487, 1499, 1500, 1496, 1487, 1499, 1500, 1496, 2095,
-     1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276,
-
-     1279, 1487, 1487, 1471, 1496, 1279, 1495, 2094, 1500, 1278,
-     1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1280,
-     2093, 1471, 1490, 1509, 1280, 1499, 1490, 1509,  637,  637,
-      637,  637,  637,  637,  637,  637,  637,  637,  637,  637,
-      637,  637,  637,  637,  637,  637,  637, 2092, 1497, 1525,
-     2091, 1490, 1497, 1525, 1509, 2090, 1504,  637,  637,  643,
-     1504, 1521, 1527, 1546, 2089, 1521, 1527, 1546, 1497, 1497,
-     1279, 1279, 1279, 1279, 1279, 1279, 1279, 1279, 1279, 1279,
-     1282, 2072, 1521, 1527, 1516, 1282, 1525, 2071, 1516, 1280,
-     1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1280, 1283,
-
-     2068, 1513, 1515, 1504, 1283, 1513, 1515, 2057,  643,  643,
-      643,  643,  643,  643,  643,  643,  643,  643,  643,  643,
-      643,  643,  643,  643,  643,  643,  643, 1516, 2055, 1534,
-     1513, 1553, 1518, 1534, 2049, 1553, 1518,  643,  643,  649,
-     2048, 1536, 1531, 1558, 1515, 1536, 1531, 1558, 2045, 2039,
-     1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282,
-     1284, 1518, 1545, 1531, 1534, 1284, 1545, 1553, 2035, 1283,
-     1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1285,
-     1536, 1522, 1529, 1545, 1285, 1522, 1529, 1531,  649,  649,
-      649,  649,  649,  649,  649,  649,  649,  649,  649,  649,
-
-      649,  649,  649,  649,  649,  649,  649, 2016, 2013, 1522,
-     1547, 1529, 1549, 2011, 1547, 2010, 1549,  649,  649,  657,
-     1523, 2009, 1556, 1522, 1523, 1547, 1556, 2003, 2002, 1995,
-     1284, 1284, 1284, 1284, 1284, 1284, 1284, 1284, 1284, 1284,
-     1286, 1523, 1556, 1561, 1966, 1286, 1965, 1561, 1523, 1285,
-     1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1287,
-     1549, 1532, 1523, 1537, 1287, 1532, 1958, 1537,  657,  657,
+      589, 1243, 1244, 1255, 1243, 1257, 1244, 1255, 2306, 1257,
+
+     1258,  589,  589,  597, 1258, 1243, 2305, 1260, 2304, 2303,
+     1263, 1260, 1265, 1244, 1263, 1267, 1265, 1269, 1264, 1267,
+     1244, 1269, 1264, 2302, 1255, 1257, 1257, 1263, 1263, 1461,
+     2301, 1258, 1263, 1461, 1244, 1264, 1264, 1258, 1260, 1264,
+     1264, 1263, 2278, 1265, 1260, 1277, 1267, 1460, 1269, 1277,
+     1282, 1460,  597,  597,  597,  597,  597,  597,  597,  597,
+      597,  597,  597,  597,  597,  597,  597,  597,  597,  597,
+      597, 1266, 1461, 1280, 1277, 1266, 1277, 1280, 2274, 2262,
+     1460,  597,  597,  603, 2261, 1397, 1283, 1372, 1280, 1397,
+     2258, 1372, 1394, 1266, 1284, 2255, 1394, 1398, 2250, 1284,
+
+     2234, 1398, 1266, 2232, 1280, 1285, 2231, 1372, 1372, 1372,
+     1285, 2229, 1266, 1394, 1397, 1282, 1282, 1282, 1282, 1282,
+     1282, 1282, 1282, 1282, 1282, 1286, 1398, 1516, 2227, 1394,
+     1286, 1516,  603,  603,  603,  603,  603,  603,  603,  603,
+      603,  603,  603,  603,  603,  603,  603,  603,  603,  603,
+      603, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283,
+     1283,  603,  603,  609, 1284, 1284, 1284, 1284, 1284, 1284,
+     1284, 1284, 1284, 1284, 2226, 1285, 1285, 1285, 1285, 1285,
+     1285, 1285, 1285, 1285, 1285, 1287, 2220, 1380, 1522, 1536,
+     1287, 1380, 1522, 1536, 2212, 1286, 1286, 1286, 1286, 1286,
+
+     1286, 1286, 1286, 1286, 1286, 1288, 2211, 1380, 1380, 1380,
+     1288, 1320,  609,  609,  609,  609,  609,  609,  609,  609,
+      609,  609,  609,  609,  609,  609,  609,  609,  609,  609,
+      609, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320,
+     1320,  609,  609,  615, 2208, 1408, 2206, 1412, 1428, 1408,
+     1433, 1412, 1428, 2203, 1433, 1287, 1287, 1287, 1287, 1287,
+     1287, 1287, 1287, 1287, 1287, 1289, 1408, 1408, 1412, 1428,
+     1289, 2201, 2200, 2194, 2189, 1288, 1288, 1288, 1288, 1288,
+     1288, 1288, 1288, 1288, 1288, 1290, 1433, 1437, 2184, 2181,
+     1290, 1437,  615,  615,  615,  615,  615,  615,  615,  615,
+
+      615,  615,  615,  615,  615,  615,  615,  615,  615,  615,
+      615, 1420, 1439, 1446, 1543, 1420, 1439, 1446, 1543, 2179,
+     1438,  615,  615,  621, 1438, 2168, 1448, 2166, 2164, 1437,
+     1448, 1420, 1420, 1446, 1446, 1289, 1289, 1289, 1289, 1289,
+     1289, 1289, 1289, 1289, 1289, 1291, 2160, 1544, 1456, 1438,
+     1291, 1544, 1456, 1448, 1439, 1290, 1290, 1290, 1290, 1290,
+     1290, 1290, 1290, 1290, 1290, 1292, 2159, 1440, 1448, 1456,
+     1292, 1440,  621,  621,  621,  621,  621,  621,  621,  621,
+      621,  621,  621,  621,  621,  621,  621,  621,  621,  621,
+      621, 1444, 2154, 1475, 1452, 1444, 1440, 1475, 1452, 2144,
+
+     1458,  621,  621,  627, 1458, 1449, 1450, 2136, 2133, 1449,
+     1450, 1452, 1452, 2132, 1475, 1291, 1291, 1291, 1291, 1291,
+     1291, 1291, 1291, 1291, 1291, 1293, 2131, 1450, 2130, 1458,
+     1293, 2129, 1444, 1449, 1450, 1292, 1292, 1292, 1292, 1292,
+     1292, 1292, 1292, 1292, 1292, 1294, 2128, 1449, 1450, 2127,
+     1294, 2126,  627,  627,  627,  627,  627,  627,  627,  627,
+      627,  627,  627,  627,  627,  627,  627,  627,  627,  627,
+      627, 1462, 1466, 1493, 1495, 1462, 1466, 1493, 1495, 2125,
+     1463,  627,  627,  633, 1463, 1467, 1468, 1487, 1526, 1467,
+     1468, 1487, 1526, 2108, 1466, 1293, 1293, 1293, 1293, 1293,
+
+     1293, 1293, 1293, 1293, 1293, 1295, 2107, 1467, 1468, 1463,
+     1295, 1493, 1487, 1495, 1462, 1294, 1294, 1294, 1294, 1294,
+     1294, 1294, 1294, 1294, 1294, 1296, 1526, 1465, 2104, 2093,
+     1296, 1465,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633, 1469, 2091, 1548, 1510, 1469, 1465, 1548, 1510, 2085,
+     2084,  633,  633,  639, 1470, 1471, 1481, 1484, 1470, 1471,
+     1481, 1484, 2081, 1469, 1510, 1295, 1295, 1295, 1295, 1295,
+     1295, 1295, 1295, 1295, 1295, 1297, 1470, 1471, 1485, 1484,
+     1297, 2075, 1485, 2071, 2052, 1296, 1296, 1296, 1296, 1296,
+
+     1296, 1296, 1296, 1296, 1296, 1299, 2049, 1488, 2047, 1481,
+     1299, 1488,  639,  639,  639,  639,  639,  639,  639,  639,
+      639,  639,  639,  639,  639,  639,  639,  639,  639,  639,
+      639, 1485, 1491, 2046, 1520, 1519, 1491, 1488, 1520, 1519,
+     2045,  639,  639,  645, 1489, 1492, 1511, 1524, 1489, 1492,
+     1511, 1524, 2044, 2038, 1520, 1297, 1297, 1297, 1297, 1297,
+     1297, 1297, 1297, 1297, 1297, 1300, 1511, 1511, 1491, 1523,
+     1300, 1519, 1524, 1523, 2037, 1299, 1299, 1299, 1299, 1299,
+     1299, 1299, 1299, 1299, 1299, 1301, 2030, 1489, 1492, 1998,
+     1301, 1997,  645,  645,  645,  645,  645,  645,  645,  645,
+
+      645,  645,  645,  645,  645,  645,  645,  645,  645,  645,
+      645, 1521, 1523, 1545, 1559, 1521, 1990, 1545, 1559, 1985,
+     1494,  645,  645,  651, 1494, 1514, 1539, 1982, 1981, 1514,
+     1539, 1521, 1521, 1974, 1545, 1300, 1300, 1300, 1300, 1300,
+     1300, 1300, 1300, 1300, 1300, 1303, 1968, 1965, 1525, 1540,
+     1303, 1494, 1525, 1540, 1514, 1301, 1301, 1301, 1301, 1301,
+     1301, 1301, 1301, 1301, 1301, 1304, 1962, 1517, 1539, 1494,
+     1304, 1517,  651,  651,  651,  651,  651,  651,  651,  651,
+      651,  651,  651,  651,  651,  651,  651,  651,  651,  651,
+      651, 1959, 1540, 1956, 1549, 1525, 1527, 1517, 1549, 1953,
+
+     1527,  651,  651,  657, 1528, 1537, 1951, 1551, 1528, 1537,
+     1560, 1551, 1949, 1944, 1560, 1303, 1303, 1303, 1303, 1303,
+     1303, 1303, 1303, 1303, 1303, 1305, 1943, 1527, 1551, 1561,
+     1305, 1549, 1942, 1561, 1537, 1304, 1304, 1304, 1304, 1304,
+     1304, 1304, 1304, 1304, 1304, 1306, 1934, 1920, 1914, 1560,
+     1306, 1528,  657,  657,  657,  657,  657,  657,  657,  657,
       657,  657,  657,  657,  657,  657,  657,  657,  657,  657,
-      657,  657,  657,  657,  657,  657,  657, 1557, 1953, 1552,
-     1532, 1557, 1542, 1552, 1950, 1949, 1542,  657,  657,  663,
-
-     1538, 1559, 1942, 1936, 1538, 1559, 1537, 1557, 1557, 1933,
-     1286, 1286, 1286, 1286, 1286, 1286, 1286, 1286, 1286, 1286,
-     1289, 1542, 1552, 1566, 1570, 1289, 1559, 1566, 1570, 1287,
-     1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1290,
-     1930, 1543, 1548, 1538, 1290, 1543, 1548, 1927,  663,  663,
-      663,  663,  663,  663,  663,  663,  663,  663,  663,  663,
-      663,  663,  663,  663,  663,  663,  663, 1924, 1563, 1543,
-     1568, 1548, 1563, 1921, 1568, 1919, 1562,  663,  663,  669,
-     1562, 1571, 1572, 1914, 1913, 1571, 1572, 1568, 1568, 1912,
-     1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289,
-
-     1291, 1563, 1577, 1572, 1562, 1291, 1577, 1904, 1890, 1290,
-     1290, 1290, 1290, 1290, 1290, 1290, 1290, 1290, 1290, 1292,
-     1884, 1564, 1577, 1574, 1292, 1564, 1880, 1574,  669,  669,
-      669,  669,  669,  669,  669,  669,  669,  669,  669,  669,
-      669,  669,  669,  669,  669,  669,  669, 1573, 1580, 1576,
-     1564, 1573, 1580, 1576, 1874, 1872, 1871,  669,  669,  675,
-     1574, 1578, 1573, 1575, 1591, 1578, 1870, 1575, 1591, 1869,
-     1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291,
-     1294, 1859, 1578, 1578, 1575, 1294, 1576, 1858, 1852, 1292,
-     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1295,
-
-     1575, 1595, 1667, 1850, 1295, 1595, 1667, 1591,  675,  675,
-      675,  675,  675,  675,  675,  675,  675,  675,  675,  675,
-      675,  675,  675,  675,  675,  675,  675, 1579, 1592, 1668,
-     1669, 1579, 1592, 1668, 1669, 1843, 1829,  675,  675,  682,
-     1582, 1585, 1598, 1694, 1582, 1585, 1598, 1694, 1825, 1579,
-     1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294,
-     1296, 1582, 1582, 1585, 1589, 1296, 1592, 1824, 1589, 1295,
-     1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1300,
-     1596, 1598, 1819, 1816, 1596, 1589, 1589, 1629,  682,  682,
-      682,  682,  682,  682,  682,  682,  682,  682,  682,  682,
-
-      682,  682,  682,  682,  682,  682,  682, 1629, 1629, 1629,
-     1629, 1629, 1629, 1629, 1629, 1629, 1629,  682,  682,  688,
-     1590, 1695, 1666, 1596, 1590, 1695, 1666, 1814, 1813, 1300,
-     1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296, 1296,
-     1301, 1696, 1590, 1666, 1698, 1696, 1810, 1809, 1698, 1300,
-     1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1300, 1302,
-     1663, 1808, 1696, 1729, 1663, 1698, 1797, 1729,  688,  688,
-      688,  688,  688,  688,  688,  688,  688,  688,  688,  688,
-      688,  688,  688,  688,  688,  688,  688, 1701, 1663, 1741,
-     1301, 1701, 1791, 1741, 1789, 1788, 1663,  688,  688,  694,
-
-     1787, 1673, 1663, 1676, 1663, 1673, 1786, 1676, 1701, 1302,
-     1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
-     1303, 1731, 1673, 1749, 1676, 1731, 1785, 1749, 1783, 1302,
-     1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1304,
-     1672, 1780, 1731, 1673, 1672, 1676, 1779, 1771,  694,  694,
-      694,  694,  694,  694,  694,  694,  694,  694,  694,  694,
-      694,  694,  694,  694,  694,  694,  694, 1679, 1672, 1750,
-     1303, 1679, 1752, 1750, 1744, 1738, 1672,  694,  694,  700,
-     1737, 1740, 1672, 1758, 1672, 1740, 1724, 1758, 1679, 1304,
-     1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
-
-     1305, 1747, 1740, 1757, 1679, 1747, 1717, 1757, 1716, 1304,
-     1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1304, 1764,
-     1674, 1697, 1747, 1764, 1674, 1757, 1692, 1685,  700,  700,
-      700,  700,  700,  700,  700,  700,  700,  700,  700,  700,
-      700,  700,  700,  700,  700,  700,  700, 1414, 1674, 1765,
-     1305, 1414, 1671, 1765, 1597, 1594, 1674,  700,  700,  726,
-     1593, 1489, 1682, 1567, 1674, 1489, 1682, 1674, 1414, 1565,
-     1305, 1305, 1305, 1305, 1305, 1305, 1305, 1305, 1305, 1305,
-     1306, 1489, 1414, 1682, 1792, 1801, 1560, 1811, 1792, 1801,
-     1307, 1811, 1489, 1414, 1551, 1550,  726,  726,  726, 1682,
-
-      726,  726,  726,  726,  726,  726,  726,  726,  726,  726,
-      726,  726,  726,  726,  726,  726,  726,  726,  726,  726,
-      726,  726,  726,  726,  746, 1755, 1541, 1760, 1807, 1755,
-     1306, 1760, 1807, 1540, 1821, 1876, 1539, 1799, 1821, 1876,
-     1307, 1799, 1308, 1533, 1528, 1526, 1755, 1755, 1807, 1760,
-     1306, 1306, 1306, 1306, 1306, 1306, 1306, 1306, 1306, 1306,
-     1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307,
-     1799, 1517, 1309,  746,  746,  746,  746,  746,  746,  746,
-      746,  746,  746,  746,  746,  746,  746,  746,  746,  746,
-      746,  746, 1308, 1514, 1885, 1554, 1900, 1812, 1885, 1554,
-
-     1900, 1812,  746,  746,  752, 1762, 1841, 1763, 1763, 1762,
-     1841, 1763, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308,
-     1308, 1308, 1309, 1310, 1554, 1554, 1812, 1762, 1554, 1763,
-     1554, 1841, 1554, 1511, 1901, 1311, 1903, 1554, 1901, 1554,
-     1903, 1510, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309,
-     1309, 1309, 1599,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752, 1961, 1310, 1984, 1985, 1961, 2017, 1984, 1985,
-     1508, 2017,  752,  752,  758, 1311, 2025, 2028, 2034, 1507,
-     2025, 2028, 2034, 1310, 1310, 1310, 1310, 1310, 1310, 1310,
-
-     1310, 1310, 1310, 1312, 1506, 1311, 1311, 1311, 1311, 1311,
-     1311, 1311, 1311, 1311, 1311, 1313, 1505, 1599, 1599, 1599,
-     1599, 1599, 1599, 1599, 1599, 1599, 1599, 1494, 2053, 1491,
-     1484, 1600, 2053,  758,  758,  758,  758,  758,  758,  758,
-      758,  758,  758,  758,  758,  758,  758,  758,  758,  758,
-      758,  758, 2033, 1312, 2062, 2098, 2033, 2112, 2062, 2098,
-     1483, 2112,  758,  758,  764, 1313, 2063, 2059, 1482, 1480,
-     2063, 2059, 2033, 1312, 1312, 1312, 1312, 1312, 1312, 1312,
-     1312, 1312, 1312, 1315, 1479, 1313, 1313, 1313, 1313, 1313,
-     1313, 1313, 1313, 1313, 1313, 1316, 1600, 1600, 1600, 1600,
-
-     1600, 1600, 1600, 1600, 1600, 1600, 1601, 2063, 1478, 1477,
-     1476, 1601, 2059,  764,  764,  764,  764,  764,  764,  764,
-      764,  764,  764,  764,  764,  764,  764,  764,  764,  764,
-      764,  764, 2036, 1315, 2195, 2201, 2036, 2213, 2195, 2201,
-     1475, 2213,  764,  764,  772, 1316, 2224, 2230, 1474, 2195,
-     2224, 2230, 2036, 1315, 1315, 1315, 1315, 1315, 1315, 1315,
-     1315, 1315, 1315, 1317, 1473, 1316, 1316, 1316, 1316, 1316,
-     1316, 1316, 1316, 1316, 1316, 1319, 1601, 1601, 1601, 1601,
-     1601, 1601, 1601, 1601, 1601, 1601, 1602, 1463, 2077, 1460,
-     1442, 1602, 2077,  772,  772,  772,  772,  772,  772,  772,
-
+      657, 1910, 1561, 1568, 1570, 1533, 1904, 1568, 1570, 1533,
+     1542,  657,  657,  665, 1542, 1546, 1547, 1582, 1562, 1546,
+     1547, 1582, 1562, 1902, 1901, 1305, 1305, 1305, 1305, 1305,
+
+     1305, 1305, 1305, 1305, 1305, 1307, 1533, 1547, 1555, 1542,
+     1307, 1900, 1555, 1546, 1547, 1306, 1306, 1306, 1306, 1306,
+     1306, 1306, 1306, 1306, 1306, 1308, 1899, 1546, 1547, 1555,
+     1308, 1562,  665,  665,  665,  665,  665,  665,  665,  665,
+      665,  665,  665,  665,  665,  665,  665,  665,  665,  665,
+      665, 1558, 1569, 1555, 1576, 1558, 1569, 1889, 1576, 1888,
+     1553,  665,  665,  671, 1553, 1556, 1882, 1583, 1580, 1556,
+     1577, 1583, 1580, 1569, 1577, 1307, 1307, 1307, 1307, 1307,
+     1307, 1307, 1307, 1307, 1307, 1310, 1558, 1576, 1580, 1553,
+     1310, 1880, 1583, 1873, 1556, 1308, 1308, 1308, 1308, 1308,
+
+     1308, 1308, 1308, 1308, 1308, 1311, 1577, 1566, 1859, 1855,
+     1311, 1566,  671,  671,  671,  671,  671,  671,  671,  671,
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+      671, 1571, 1854, 1581, 1585, 1571, 1566, 1581, 1585, 1849,
+     1567,  671,  671,  677, 1567, 1572, 1571, 1590, 1594, 1572,
+     1846, 1590, 1594, 1581, 1581, 1310, 1310, 1310, 1310, 1310,
+     1310, 1310, 1310, 1310, 1310, 1312, 1844, 1573, 1567, 1595,
+     1312, 1573, 1843, 1595, 1572, 1311, 1311, 1311, 1311, 1311,
+     1311, 1311, 1311, 1311, 1311, 1313, 1840, 1588, 1839, 1838,
+     1313, 1588,  677,  677,  677,  677,  677,  677,  677,  677,
+
+      677,  677,  677,  677,  677,  677,  677,  677,  677,  677,
+      677, 1827, 1821, 1587, 1592, 1573, 1588, 1587, 1592, 1819,
+     1586,  677,  677,  683, 1586, 1818, 1596, 1817, 1816, 1598,
+     1596, 1592, 1592, 1598, 1815, 1312, 1312, 1312, 1312, 1312,
+     1312, 1312, 1312, 1312, 1312, 1315, 1587, 1596, 1586, 1601,
+     1315, 1814, 1812, 1601, 1809, 1313, 1313, 1313, 1313, 1313,
+     1313, 1313, 1313, 1313, 1313, 1316, 1598, 1600, 1808, 1601,
+     1316, 1600,  683,  683,  683,  683,  683,  683,  683,  683,
+      683,  683,  683,  683,  683,  683,  683,  683,  683,  683,
+      683, 1597, 1599, 1604, 1619, 1597, 1599, 1604, 1619, 1800,
+
+     1778,  683,  683,  690, 1600, 1602, 1597, 1615, 1616, 1602,
+     1603, 1615, 1616, 1599, 1603, 1315, 1315, 1315, 1315, 1315,
+     1315, 1315, 1315, 1315, 1315, 1317, 1602, 1602, 1770, 1599,
+     1317, 1764, 1603, 1763, 1750, 1316, 1316, 1316, 1316, 1316,
+     1316, 1316, 1316, 1316, 1316, 1620, 1616, 1691, 1743, 1620,
+     1615, 1691,  690,  690,  690,  690,  690,  690,  690,  690,
+      690,  690,  690,  690,  690,  690,  690,  690,  690,  690,
+      690, 1436, 1606, 1622, 1692, 1436, 1606, 1622, 1692, 1742,
+     1693,  690,  690,  696, 1693, 1720, 1609, 1513, 1620, 1720,
+     1609, 1513, 1436, 1606, 1606, 1317, 1317, 1317, 1317, 1317,
+
+     1317, 1317, 1317, 1317, 1317, 1321, 1436, 1513, 1609, 1613,
+     1721, 1723, 1622, 1613, 1721, 1322, 1755, 1436, 1513, 1767,
+     1755, 1775, 1776, 1767, 1784, 1775, 1776, 1718, 1784, 1711,
+     1613, 1613,  696,  696,  696,  696,  696,  696,  696,  696,
+      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
+      696, 1695, 1614, 1790, 1791, 1321, 1614, 1790, 1791, 1621,
+     1822,  696,  696,  702, 1822, 1322, 1623, 1578, 1829, 1831,
+     1618, 1578, 1829, 1831, 1614, 1321, 1321, 1321, 1321, 1321,
+     1321, 1321, 1321, 1321, 1321, 1322, 1322, 1322, 1322, 1322,
+     1322, 1322, 1322, 1322, 1322, 1323, 1578, 1578, 1617, 1841,
+
+     1578, 1829, 1578, 1841, 1578, 1324, 1851, 1591, 1589, 1578,
+     1851, 1578,  702,  702,  702,  702,  702,  702,  702,  702,
+      702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
+      702, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
+     1623,  702,  702,  708, 1837, 1323, 1906, 1915, 1837, 1930,
+     1906, 1915, 1584, 1930, 1931, 1324, 1842, 1575, 1931, 1933,
+     1842, 1325, 1574, 1933, 1837, 1323, 1323, 1323, 1323, 1323,
+     1323, 1323, 1323, 1323, 1323, 1324, 1324, 1324, 1324, 1324,
+     1324, 1324, 1324, 1324, 1324, 1842, 1993, 1871, 1565, 1564,
+     1993, 1871,  708,  708,  708,  708,  708,  708,  708,  708,
+
+      708,  708,  708,  708,  708,  708,  708,  708,  708,  708,
+      708, 1325, 1871, 2016, 1687, 2017, 2026, 2016, 1687, 2017,
+     2026,  708,  708,  734, 1690, 1722, 1705, 1563, 1690, 1722,
+     1705, 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325, 1325,
+     1325, 1326, 1687, 1557, 2053, 1690, 1722, 1705, 2053, 2061,
+     1687, 1327, 1552, 2061, 1550, 2062, 1687, 1541, 1687, 2062,
+      734,  734,  734, 1705,  734,  734,  734,  734,  734,  734,
+      734,  734,  734,  734,  734,  734,  734,  734,  734,  734,
+      734,  734,  734,  734,  734,  734,  734,  734,  754, 1697,
+     2064, 1326, 2062, 1697, 2064, 2070, 2089, 1538, 2098, 2070,
+
+     2089, 1327, 2098, 2134, 2148, 2218, 1328, 2134, 2148, 2218,
+     1697, 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326, 1326,
+     1326, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327,
+     1327, 1697, 1535, 1534, 1532, 1531, 1329,  754,  754,  754,
+      754,  754,  754,  754,  754,  754,  754,  754,  754,  754,
+      754,  754,  754,  754,  754,  754, 1328, 2074, 2095, 2099,
+     2235, 2074, 2095, 2099, 2235, 1530,  754,  754,  760, 1653,
+     2241, 1529, 1518, 1515, 2241, 2235, 1328, 1328, 1328, 1328,
+     1328, 1328, 1328, 1328, 1328, 1328, 1329, 1330, 1508, 1653,
+     1653, 1653, 1653, 1653, 1653, 1653, 1653, 1653, 1653, 1331,
+
+     2099, 2254, 1507, 2095, 2074, 2254, 1329, 1329, 1329, 1329,
+     1329, 1329, 1329, 1329, 1329, 1329, 1624,  760,  760,  760,
+      760,  760,  760,  760,  760,  760,  760,  760,  760,  760,
+      760,  760,  760,  760,  760,  760, 2069, 1330, 2265, 2243,
+     2069, 2271, 2265, 2243, 1506, 2271,  760,  760,  766, 1331,
+     2268, 2287, 1504, 1503, 2268, 2287, 2069, 1330, 1330, 1330,
+     1330, 1330, 1330, 1330, 1330, 1330, 1330, 1332, 2243, 1331,
+     1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1333,
+     1502, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624,
+     1624, 1625, 1501, 1500, 1499, 2268, 1625,  766,  766,  766,
+
+      766,  766,  766,  766,  766,  766,  766,  766,  766,  766,
+      766,  766,  766,  766,  766,  766, 2072, 1332, 2289, 2318,
+     2072, 2326, 2289, 2318, 1498, 2326,  766,  766,  772, 1333,
+     2334, 2362, 1497, 1496, 2334, 2362, 2072, 1332, 1332, 1332,
+     1332, 1332, 1332, 1332, 1332, 1332, 1332, 1334, 1486, 1333,
+     1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1336,
+     1482, 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625,
+     1625, 1626, 1464, 1459, 1441, 1399, 1626,  772,  772,  772,
       772,  772,  772,  772,  772,  772,  772,  772,  772,  772,
-      772,  772, 2040, 1317, 2246, 2203, 2040, 1437, 2246, 2203,
-     1419, 2077,  772,  772,  780, 1319, 2248, 2277, 1377, 1365,
-     2248, 2277, 2040, 1317, 1317, 1317, 1317, 1317, 1317, 1317,
-     1317, 1317, 1317, 1320, 2203, 1319, 1319, 1319, 1319, 1319,
-     1319, 1319, 1319, 1319, 1319, 1321, 1602, 1602, 1602, 1602,
-     1602, 1602, 1602, 1602, 1602, 1602, 1603, 1334, 2078, 1330,
-     1325, 1603, 2078,  780,  780,  780,  780,  780,  780,  780,
+      772,  772,  772,  772,  772,  772, 2076, 1334, 2409, 2416,
+
+     2076, 2440, 2409, 2416, 1386, 2440,  772,  772,  780, 1336,
+     2445, 2451, 1355, 1351, 2445, 2451, 2076, 1334, 1334, 1334,
+     1334, 1334, 1334, 1334, 1334, 1334, 1334, 1337, 2416, 1336,
+     1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1338,
+     1346, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,
+     1626, 1627, 1339, 1335, 1314, 1309, 1627,  780,  780,  780,
       780,  780,  780,  780,  780,  780,  780,  780,  780,  780,
-      780,  780, 2125, 1320, 2078, 2285, 2125, 2291, 1318, 2285,
-
-     1314, 2291,  780,  780,  788, 1321, 2319, 2227, 1293, 1288,
-     2319, 2227, 2125, 1320, 1320, 1320, 1320, 1320, 1320, 1320,
-     1320, 1320, 1320, 1322, 1281, 1321, 1321, 1321, 1321, 1321,
-     1321, 1321, 1321, 1321, 1321, 1323, 1603, 1603, 1603, 1603,
-     1603, 1603, 1603, 1603, 1603, 1603, 1604, 1277, 1258, 1255,
-     1254, 1604, 2227,  788,  788,  788,  788,  788,  788,  788,
+      780,  780,  780,  780,  780,  780, 2161, 1337, 2471, 2477,
+     2161, 2484, 2471, 2477, 1302, 2484,  780,  780,  788, 1338,
+     2484, 2489, 2484, 1298, 1279, 2489, 2161, 1337, 1337, 1337,
+
+     1337, 1337, 1337, 1337, 1337, 1337, 1337, 1340, 1276, 1338,
+     1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1341,
+     1275, 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627, 1627,
+     1627, 1628, 1261, 1251, 1249, 1232, 1628,  788,  788,  788,
       788,  788,  788,  788,  788,  788,  788,  788,  788,  788,
-      788,  788, 2135, 1322, 2364, 2371, 2135, 2395, 2364, 2371,
-     1240, 2395,  788,  788,  794, 1323, 2400, 2404, 1230, 1228,
-     2400, 2404, 2135, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
-
-     1322, 1322, 1322, 1324, 2371, 1323, 1323, 1323, 1323, 1323,
-     1323, 1323, 1323, 1323, 1323, 1326, 1604, 1604, 1604, 1604,
-     1604, 1604, 1604, 1604, 1604, 1604, 1605, 1211, 2231, 1210,
-     1209, 1605, 2231,  794,  794,  794,  794,  794,  794,  794,
-      794,  794,  794,  794,  794,  794,  794,  794,  794,  794,
-      794,  794, 2210, 1324, 2424, 2430, 2210, 1205, 2424, 2430,
-     1178, 2231,  794,  794,  800, 1326, 2442, 2459, 1177, 1176,
-     2442, 2459, 2210, 1324, 1324, 1324, 1324, 1324, 1324, 1324,
-     1324, 1324, 1324, 1327, 1175, 1326, 1326, 1326, 1326, 1326,
-     1326, 1326, 1326, 1326, 1326, 1328, 1605, 1605, 1605, 1605,
-
-     1605, 1605, 1605, 1605, 1605, 1605, 1606, 1174, 2249, 1173,
-     1172, 1606, 2249,  800,  800,  800,  800,  800,  800,  800,
-      800,  800,  800,  800,  800,  800,  800,  800,  800,  800,
-      800,  800, 2211, 1327, 2465, 2517, 2211, 2544, 2465, 2517,
-     1161, 2544,  800,  800,  810, 1328, 2249, 2587, 1154, 1153,
-     1151, 2587, 2211, 1327, 1327, 1327, 1327, 1327, 1327, 1327,
-     1327, 1327, 1327, 1329, 1149, 1328, 1328, 1328, 1328, 1328,
-     1328, 1328, 1328, 1328, 1328, 1331, 1606, 1606, 1606, 1606,
-     1606, 1606, 1606, 1606, 1606, 1606, 1607, 1147, 2456, 1135,
-     1126, 1607, 2456,  810,  810,  810,  810,  810,  810,  810,
-
-      810,  810,  810,  810,  810,  810,  810,  810,  810,  810,
-      810,  810, 2215, 1329, 2456, 2602, 2215, 2648, 1119, 2602,
-     1114, 2648,  810,  810,  816, 1331, 2672, 2671, 1075, 1043,
-     2672, 2671, 2215, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
-     1329, 1329, 1329, 1332, 1033, 1331, 1331, 1331, 1331, 1331,
-     1331, 1331, 1331, 1331, 1331, 1333, 1607, 1607, 1607, 1607,
-     1607, 1607, 1607, 1607, 1607, 1607, 1608, 1014, 2606, 2671,
-      957, 1608, 2606,  816,  816,  816,  816,  816,  816,  816,
-      816,  816,  816,  816,  816,  816,  816,  816,  816,  816,
-      816,  816, 2212, 1332, 2704, 2707, 2212, 2606, 2704, 2707,
-
-      953,  947,  816,  816,  822, 1333, 2696, 2344,  946,  945,
-     2696, 2344, 2212, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
-     1332, 1332, 1332, 2212,  944, 1333, 1333, 1333, 1333, 1333,
-     1333, 1333, 1333, 1333, 1333, 2344, 1608, 1608, 1608, 1608,
-     1608, 1608, 1608, 1608, 1608, 1608, 2729, 1609, 2696,  943,
-     2729,  942, 1609,  822,  822,  822,  822,  822,  822,  822,
-      822,  822,  822,  822,  822,  822,  822,  822,  822,  822,
-      822,  822, 1555, 1688, 2362, 1720, 1555, 1688, 2362, 1720,
-      907, 1781,  822,  822,  831, 1781, 2747, 1734, 2751,  906,
-     2747, 1734, 2751, 1555, 1688, 1610, 1720,  876,  871, 2362,
-
-     1610, 1555, 1555, 1781,  868, 1555, 1611, 1555, 1734, 1555,
-     1688, 1611, 1720,  857, 1555, 1734, 1555, 1609, 1609, 1609,
-     1609, 1609, 1609, 1609, 1609, 1609, 1609, 1612,  808, 1734,
-      786,  778, 1612,  831,  831,  831,  831,  831,  831,  831,
-      831,  831,  831,  831,  831,  831,  831,  831,  831,  831,
-      831,  831, 2026, 2763, 1766, 2770, 2026, 2763, 1766, 2770,
-      729,  556,  831,  831,  837, 1610, 1610, 1610, 1610, 1610,
-     1610, 1610, 1610, 1610, 1610, 1766, 1611, 1611, 1611, 1611,
-     1611, 1611, 1611, 1611, 1611, 1611, 1613,  554, 1784, 2026,
-     1794, 1613, 1784,  539, 1794,  538,  536, 1612, 1612, 1612,
-
-     1612, 1612, 1612, 1612, 1612, 1612, 1612, 1614,  533,  531,
-     1784, 1794, 1614,  837,  837,  837,  837,  837,  837,  837,
-      837,  837,  837,  837,  837,  837,  837,  837,  837,  837,
-      837,  837, 1803, 1827, 2340, 2771, 1803, 1827, 2340, 2771,
-      529, 2038,  837,  837,  843, 2038, 1630,  528,  524,  523,
-      521, 2340, 2340, 1803, 1827, 1827, 1613, 1613, 1613, 1613,
-     1613, 1613, 1613, 1613, 1613, 1613, 1630, 1630, 1630, 1630,
-     1630, 1630, 1630, 1630, 1630, 1630,  516, 1614, 1614, 1614,
-     1614, 1614, 1614, 1614, 1614, 1614, 1614, 2772, 2038,  515,
-      514, 2772,  511,  843,  843,  843,  843,  843,  843,  843,
-
-      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
-      843,  843, 1615,  507, 1662, 1664, 1670, 1615, 1662, 1664,
-     1670,  503,  843,  843,  848, 1675,  502, 1782,  848, 1675,
-     1664, 1782,  500, 2372, 1727, 1662, 1677, 2372, 1727,  498,
-     1677, 1616, 1662, 1664, 1670,  848, 1616,  496,  495, 1782,
-     1662, 1664, 1670, 1675, 1670, 1727, 1782, 1617, 1662, 1664,
-     1670, 1675, 1617,  848, 1677,  494,  493, 1675, 2372, 1675,
-     1892, 1727, 1677, 1618, 1892,  491,  489, 2773, 1618, 1677,
-     1677, 2773, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
-     1615, 1615, 1892,  488,  487,  848,  848,  848,  848,  848,
-
-      848,  848,  848,  848,  848,  849, 2790,  484,  482,  849,
-     2790, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
-     1616, 2541,  481,  480,  478, 2541,  849, 1617, 1617, 1617,
-     1617, 1617, 1617, 1617, 1617, 1617, 1617, 1790,  477,  475,
-      472, 1790,  849, 1618, 1618, 1618, 1618, 1618, 1618, 1618,
-     1618, 1618, 1618, 1830, 1878,  470, 2541, 1830, 1878, 1790,
-     2793, 2811,  465, 2822, 2793, 2811, 1790, 2822, 2832, 2840,
-      463,  457, 2832, 2840, 1830, 1878,  849,  849,  849,  849,
-      849,  849,  849,  849,  849,  849,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      890,  890,  890,  890,  890,  890,  890,  890,  890,  890,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
-      958,  958,  958,  958,  964, 1680,  453, 1678,  964, 1680,
-      964, 1678, 1988,  406,  383, 1899, 1988, 1619,  374, 1899,
-      325,  175, 1619,  172, 1893, 2464,  164, 1620, 1893, 2464,
-      153,  151, 1620, 1680, 1988, 1678, 1899, 1621,  146,  144,
-      138, 1680, 1621, 1678, 1678, 1893, 1893, 1622, 1680, 1680,
-
-      134, 1678, 1622, 2464,  121,  964,  964,  964,  964,  964,
-      964,  964,  964,  964,  964,  964,  964,  964,  964,  964,
-      964,  964,  964,  964,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  964,  964,  983, 1619, 1619, 1619,
-     1619, 1619, 1619, 1619, 1619, 1619, 1619, 1620, 1620, 1620,
-     1620, 1620, 1620, 1620, 1620, 1620, 1620, 1621, 1621, 1621,
-     1621, 1621, 1621, 1621, 1621, 1621, 1621, 1622, 1622, 1622,
-     1622, 1622, 1622, 1622, 1622, 1622, 1622,  983,  983,  983,
-      983,  983,  983,  983,  983,  983,  983,  983,  983,  983,
-      983,  983,  983,  983,  983,  983, 1064, 1681,    0, 1683,
-
-     1064, 1681, 1684, 1683,    0, 2247, 1684,    0, 1840, 2247,
-        0, 1917, 1840, 1623,    0, 1917, 1715, 1064, 1623, 1686,
-     1715,    0, 1690, 1686,    0, 1681, 1690, 1683, 1683, 1840,
-     1684, 1684, 1917, 1681, 1681, 1683, 2286, 1715, 1684, 1624,
-     2286, 1681, 2247, 1683, 1624,    0, 1684, 1686, 1686, 1625,
-     1690, 1715,    0, 1840, 1625, 1686, 2286, 1846, 1690, 1626,
-        0, 1846, 1715, 1686, 1626,    0, 1690, 1064, 1064, 1064,
-     1064, 1064, 1064, 1064, 1064, 1064, 1064, 1065, 1846,    0,
-        0, 1065,    0, 1623, 1623, 1623, 1623, 1623, 1623, 1623,
-     1623, 1623, 1623,    0, 1846,    0,    0,    0, 1065,    0,
-
-        0,    0,    0,    0,    0,    0,    0,    0, 1065, 1624,
-     1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1624, 1625,
-     1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1625, 1626,
-     1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626, 1626,    0,
-        0,    0,    0,    0,    0,    0,    0,    0, 1065, 1065,
-     1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-
-     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1088, 1088, 1088, 1088, 1088, 1088,
+      788,  788,  788,  788,  788,  788, 2173, 1340, 2507, 2513,
+     2173, 2567, 2507, 2513, 1231, 2567,  788,  788,  796, 1341,
+     2596, 2639, 1230, 1226, 2596, 2639, 2173, 1340, 1340, 1340,
+     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1342, 1199, 1341,
+     1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1343,
+
+     1198, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628,
+     1628, 1629, 1197, 1196, 1195, 1194, 1629,  796,  796,  796,
+      796,  796,  796,  796,  796,  796,  796,  796,  796,  796,
+      796,  796,  796,  796,  796,  796, 2251, 1342, 2656, 2660,
+     2251, 2702, 2656, 2660, 1193, 2702,  796,  796,  802, 1343,
+     2726, 2727, 1182, 1175, 2726, 2727, 2251, 1342, 1342, 1342,
+     1342, 1342, 1342, 1342, 1342, 1342, 1342, 1344, 2660, 1343,
+     1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1345,
+     1174, 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629, 1629,
+     1629, 1630, 2726, 1172, 1171, 1169, 1630,  802,  802,  802,
+
+      802,  802,  802,  802,  802,  802,  802,  802,  802,  802,
+      802,  802,  802,  802,  802,  802, 2252, 1344, 2751, 2759,
+     2252, 2762, 2751, 2759, 1167, 2762,  802,  802,  808, 1345,
+     2785, 2803, 1153, 1144, 2785, 2803, 2252, 1344, 1344, 1344,
+     1344, 1344, 1344, 1344, 1344, 1344, 1344, 1347, 1137, 1345,
+     1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1345, 1348,
+     2751, 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630, 1630,
+     1630, 1631, 1132, 1092, 1059, 1049, 1631,  808,  808,  808,
+      808,  808,  808,  808,  808,  808,  808,  808,  808,  808,
+      808,  808,  808,  808,  808,  808, 2256, 1347, 2807, 2819,
+
+     2256, 2826, 2807, 2819, 1030, 2826,  808,  808,  818, 1348,
+     2827, 2829,  973,  969, 2827, 2829, 2256, 1347, 1347, 1347,
+     1347, 1347, 1347, 1347, 1347, 1347, 1347, 1349,  963, 1348,
+     1348, 1348, 1348, 1348, 1348, 1348, 1348, 1348, 1348, 1350,
+      962, 1631, 1631, 1631, 1631, 1631, 1631, 1631, 1631, 1631,
+     1631, 1632,  961,  960,  959,  958, 1632,  818,  818,  818,
+      818,  818,  818,  818,  818,  818,  818,  818,  818,  818,
+      818,  818,  818,  818,  818,  818, 2327, 1349, 2830, 2847,
+     2327, 2850, 2830, 2847,  923, 2850,  818,  818,  824, 1350,
+     2868, 2879,  922,  891, 2868, 2879, 2327, 1349, 1349, 1349,
+
+     1349, 1349, 1349, 1349, 1349, 1349, 1349, 1352,  886, 1350,
+     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1353,
+      883, 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,
+     1632, 1633,  871,  816,  794,  786, 1633,  824,  824,  824,
+      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
+      824,  824,  824,  824,  824,  824, 2335, 1352, 2889, 2897,
+     2335, 2290, 2889, 2897,  737, 2290,  824,  824,  830, 1353,
+      564,  562,  547,  546,  544,  541, 2335, 1352, 1352, 1352,
+     1352, 1352, 1352, 1352, 1352, 1352, 1352, 1354,  539, 1353,
+     1353, 1353, 1353, 1353, 1353, 1353, 1353, 1353, 1353, 2290,
+
+      537, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633,
+     1633, 2113, 2114,  536,  532, 2113, 2114,  830,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  830,  830, 2272, 1354, 2114, 2288,
+     2272,  531,  529, 2288, 2113,  524,  830,  830,  839, 1579,
+     1699, 2504, 1702, 1579, 1699, 2504, 1702, 1354, 1354, 1354,
+     1354, 1354, 1354, 1354, 1354, 1354, 1354, 1634,  523, 2272,
+     1579, 1699, 1634, 1702,  522,  519, 2288, 2504, 1579, 1579,
+     1635,  515, 1579,  514, 1579, 1635, 1579,  510,  509,  507,
+     1636, 1579, 1699, 1579, 1702, 1636, 1654,  839,  839,  839,
+
+      839,  839,  839,  839,  839,  839,  839,  839,  839,  839,
+      839,  839,  839,  839,  839,  839, 1654, 1654, 1654, 1654,
+     1654, 1654, 1654, 1654, 1654, 1654,  839,  839,  845, 2396,
+     2384,  505,  503, 2396, 2384,  502,  501, 1634, 1634, 1634,
+     1634, 1634, 1634, 1634, 1634, 1634, 1634, 2384, 2384, 2396,
+     1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
+     1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636,
+     1637,  500,  498,  496,  495, 1637,  494,  845,  845,  845,
+      845,  845,  845,  845,  845,  845,  845,  845,  845,  845,
+      845,  845,  845,  845,  845,  845, 1708, 1724,  491, 1714,
+
+     1708, 1724,  489, 1714,  487, 1727,  845,  845,  851, 1727,
+     1757, 1760, 2407,  485, 1757, 1760, 2407, 1708, 1724, 1638,
+     1714, 2417,  484, 2388, 1638, 2417, 1727, 2388,  482, 1639,
+      479, 1757, 1760, 1708, 1639,  477, 1714, 2407,  472, 1760,
+     1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637, 1637,
+     1640, 2388,  470, 1760,  464, 1640, 2417,  851,  851,  851,
+      851,  851,  851,  851,  851,  851,  851,  851,  851,  851,
+      851,  851,  851,  851,  851,  851,  460,  408,  385,  376,
+      327,  177,  174,  166,  155,  153,  851,  851,  857, 1638,
+     1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1639,
+
+     1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1641,
+      148, 1766, 1773, 1781, 1641, 1766, 1773, 1781,  146,  140,
+     1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640,
+      136,  123, 1766, 1773, 1781, 1781,    0,  857,  857,  857,
+      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
+      857,  857,  857,  857,  857,  857, 1642,    0, 2593, 2855,
+        0, 1642, 2593, 2855,    0,    0,  857,  857,  862, 1696,
+        0, 1746,  862, 1696, 1694, 1746, 2855, 2855, 1694, 1641,
+     1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641,  862,
+     1643,    0, 1746, 2593, 1783, 1643,    0, 1696, 1783, 1753,
+
+     1792, 1644, 1694, 1753, 1792, 1696, 1644,  862, 1746,    0,
+     1694, 1696, 1694, 1696,    0, 1786, 1783, 1645, 1694, 1786,
+     1753, 1792, 1645,    0,    0,    0, 1642, 1642, 1642, 1642,
+     1642, 1642, 1642, 1642, 1642, 1642, 1753, 1786,    0,  862,
+      862,  862,  862,  862,  862,  862,  862,  862,  862,  863,
+        0,    0,    0,  863, 2512,    0,    0,    0, 2512,    0,
+     1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
+      863, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644,
+     1644, 1788, 2512,    0,    0, 1788,  863, 1645, 1645, 1645,
+     1645, 1645, 1645, 1645, 1645, 1645, 1645, 1789, 1789,    0,
+
+     2856, 1789,    0, 1788, 2856,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0, 2856, 2856, 1789,
+      863,  863,  863,  863,  863,  863,  863,  863,  863,  863,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+
+      905,  905,  905,  905,  905,  905,  905,  905,  905,  905,
+      905,  905,  905,  905,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  974,  974,
+      974,  974,  974,  974,  974,  974,  974,  974,  980, 1686,
+
+        0, 1700,  980, 1686,  980, 1700, 1810,    0, 1813,    0,
+     1810, 1646, 1813, 1824,    0, 2857, 1646, 1824, 1797, 2857,
+     1686, 1647, 1797,    0,    0,    0, 1647, 1686, 1810, 1700,
+     1813, 1648, 2857, 2857, 1824, 1686, 1648, 1700,    0, 1797,
+     1797, 1649,    0, 1686,    0, 1700, 1649,    0, 1700,  980,
+      980,  980,  980,  980,  980,  980,  980,  980,  980,  980,
+      980,  980,  980,  980,  980,  980,  980,  980,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  980,  980,
+      999, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
+     1646, 1647, 1647, 1647, 1647, 1647, 1647, 1647, 1647, 1647,
 
+     1647, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
+     1648, 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649,
+     1649,  999,  999,  999,  999,  999,  999,  999,  999,  999,
+      999,  999,  999,  999,  999,  999,  999,  999,  999,  999,
+     1081, 1688, 1698, 1811, 1081, 1688, 1698, 1811,    0,    0,
+     1833, 1820,    0,    0, 1833, 1820, 1688, 1650,    0, 1701,
+        0, 1081, 1650, 1701, 1703, 1811,    0,    0, 1703, 1688,
+     1698, 1833, 1811, 1820,    0, 1857,    0, 1688, 1698, 1857,
+     1820,    0,    0, 1651, 1698, 1688, 1698, 1701, 1651,    0,
+     2444,    0, 1703, 1652, 2444, 1701, 1857, 1857, 1652,    0,
+
+     1703, 1701, 1741, 1701,    0, 1860, 1741, 1703, 1703, 1860,
+     2444, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081, 1081,
+     1081, 1082,    0, 1741,    0, 1082, 1860, 1650, 1650, 1650,
+     1650, 1650, 1650, 1650, 1650, 1650, 1650, 1741,    0,    0,
+        0,    0, 1082,    0,    0, 1704,    0, 1706, 1741, 1704,
+        0, 1706, 1082, 1651, 1651, 1651, 1651, 1651, 1651, 1651,
+     1651, 1651, 1651, 1652, 1652, 1652, 1652, 1652, 1652, 1652,
+     1652, 1652, 1652, 1704,    0, 1706,    0,    0,    0,    0,
+        0, 1704, 1704, 1706,    0,    0,    0,    0,    0, 1704,
+     1706, 1706, 1082, 1082, 1082, 1082, 1082, 1082, 1082, 1082,
+
+     1082, 1082, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1088, 1088, 1088, 1088,
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
+
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
      1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
-     1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1099, 1687,
-        0, 1689, 1099, 1687, 1099, 1689,    0, 1887,    0, 1894,
-     2004, 1887, 1945, 1894, 2004,    0, 1945, 1968,    0, 1978,
-
-        0, 1968, 2008, 1978, 1887, 1887, 2008, 1687, 1887, 1689,
-     1894, 1894, 2004, 1945,    0, 1687, 1687, 1689, 1968, 1945,
-     1978,    0, 1689, 1687, 2008, 1689,    0,    0,    0, 1099,
-     1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099,
-     1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0, 1099, 1099,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1115, 1115, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1133, 1133,
-     1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
+     1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
+     1103, 1103, 1103, 1103, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+     1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1117, 1707,    0, 1709, 1117, 1707, 1117, 1709,
+        0, 1876,    0,    0, 1908, 1876, 1922, 2495, 1908,    0,
+     1922, 2495,    0, 1923,    0, 1917,    0, 1923,    0, 1917,
+        0, 1707, 1876, 1709, 1709, 1908,    0, 2495, 1922, 1707,
+     1707, 1709, 1917, 1917, 1923, 1923, 1917, 1707, 1876, 1709,
+        0,    0,    0, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
+     1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
+     1117, 1117,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0, 1117, 1117, 1133, 1133, 1133, 1133, 1133, 1133,
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
-
      1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
-     1133, 1133, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250, 1250,
-     1250, 1250, 1250, 1250, 1250, 1250, 1337, 1699,    0,    0,
-
-     1337, 1699, 1691, 1693, 2018, 2117, 1691, 1693, 2018, 2117,
-        0,    0,    0, 1627,    0, 2006, 1700, 1337, 1627, 2006,
-     1700,    0, 1699,    0, 2018, 1699, 2018, 2117, 1960, 1628,
-     1691, 1693, 1960, 1699, 1628,    0, 1693, 2006, 1691, 1693,
-     1337, 1699,    0, 1631, 1700, 1691, 1691, 1693,    0, 1960,
-        0,    0, 1700,    0,    0,    0, 2006,    0, 2019, 1632,
-     1700, 2023, 2019,    0, 1960, 2023,    0, 1337, 1337, 1337,
-     1337, 1337, 1337, 1337, 1337, 1337, 1337, 1338, 2019, 2019,
-     2019, 1338, 2023, 1627, 1627, 1627, 1627, 1627, 1627, 1627,
-     1627, 1627, 1627, 1631,    0,    0,    0,    0, 1338, 1628,
-
-     1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1632,
-        0,    0,    0, 1631, 1631, 1631, 1631, 1631, 1631, 1631,
-     1631, 1631, 1631, 1896, 2189,    0,    0, 1896, 2189, 1632,
-     1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1632,    0,
-     1896, 1896,    0,    0, 1896, 1896, 2189,    0, 1338, 1338,
-     1338, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340, 1340,
-     1340, 1340, 1343, 1702,    0, 1703, 1343, 1702, 1343, 1703,
-     2005,    0, 2014,    0, 2005, 2030, 2014,    0, 2196, 2030,
-     2798, 2051, 2196,    0, 2798, 2051,    0, 2005, 2005, 2014,
-     2014, 1702, 2005, 1703, 2014, 2030, 2030, 2798, 2798, 1702,
-     2196, 1703, 2051, 2051,    0,    0,    0, 1702, 1703, 1703,
-        0,    0,    0, 1343, 1343, 1343, 1343, 1343, 1343, 1343,
-
-     1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343,
-     1343, 1343,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0, 1343, 1343, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
-
-     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380,
-     1380, 1380, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389,
-     1389, 1389, 1389, 1389, 1389, 1389, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413,
-     1413, 1413, 1413, 1413, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452,
-     1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-
-     1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
-     1530, 1530, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581,
-     1581, 1581, 1581, 1581, 1581, 1581, 1633, 1704, 1705, 1706,
-
-        0, 1704, 1705, 1706, 1710,    0, 1634, 2056, 1710, 2060,
-        0, 2056,    0, 2060,    0,    0, 1718, 1719, 2114,    0,
-     1718, 1719, 2114, 1704,    0, 1704, 1705, 1706, 2056,    0,
-     2060, 1705, 1710, 1704, 1705, 1706, 1635, 1710,    0, 2114,
-     1710, 1704, 1705, 1706, 1718, 1719, 1633, 1636, 1710,    0,
-        0,    0, 1718, 1719, 1719,    0, 1634,    0,    0, 1718,
-     1718, 1719,    0,    0,    0,    0, 1633, 1633, 1633, 1633,
-     1633, 1633, 1633, 1633, 1633, 1633, 1634, 1634, 1634, 1634,
-     1634, 1634, 1634, 1634, 1634, 1634, 1635, 1637,    0,    0,
-        0,    0,    0,    0,    0,    0, 2037, 1636, 1638, 1721,
-
-     2037,    0,    0, 1721,    0,    0, 1635, 1635, 1635, 1635,
-     1635, 1635, 1635, 1635, 1635, 1635, 2037, 1636, 1636, 1636,
-     1636, 1636, 1636, 1636, 1636, 1636, 1636, 1721, 1639, 2115,
-        0,    0, 2133, 2115, 2037, 1721, 2133, 1637, 1640,    0,
-        0,    0,    0, 1721,    0, 2015,    0,    0, 1638, 2015,
-     2115,    0, 2133, 2133,    0,    0,    0, 1637, 1637, 1637,
-     1637, 1637, 1637, 1637, 1637, 1637, 1637, 2015, 1638, 1638,
-     1638, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 1639, 1641,
-        0,    0,    0,    0,    0,    0, 2015,    0, 1640, 1642,
-     1723,    0, 1722,    0, 1723,    0, 1722,    0, 1639, 1639,
-
-     1639, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 1640, 1640,
-     1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1723, 1643,
-     1722, 1722,    0, 2160,    0,    0, 1723, 2160, 1722, 1641,
-     1644,    0,    0, 1723, 1723,    0, 1722,    0,    0, 1642,
-        0,    0,    0, 1725, 2160,    0,    0, 1725,    0, 1641,
-     1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1642,
-     1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1643,
-     1645, 1725,    0,    0,    0,    0,    0,    0,    0, 1725,
-     1644, 1646, 1726,    0,    0,    0, 1726, 1725,    0, 1643,
-     1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,    0,
-
-     1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644, 1644,
-     1726, 1647, 2178, 2223,    0,    0, 2178, 2223, 1726, 1726,
-     1645, 1648,    0,    0,    0,    0, 1726,    0, 2279,    0,
-        0, 1646, 2279, 2178, 2223,    0,    0,    0,    0,    0,
-     1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,
-     2279, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646, 1646,
-     1646, 1647, 1649,    0,    0,    0,    0,    0,    0,    0,
-        0, 1648, 1650, 1728,    0, 1730,    0, 1728,    0, 1730,
-        0, 1647, 1647, 1647, 1647, 1647, 1647, 1647, 1647, 1647,
-     1647, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
-
-     1648, 1728, 1651, 1730, 2228,    0, 2241,    0, 2228, 1728,
-     2241, 1730, 1649, 1652,    0,    0,    0, 1728,    0, 1730,
-        0,    0, 1650,    0,    0, 2228, 1732, 2241,    0,    0,
-     1732,    0, 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1649,
-     1649, 1649, 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650,
-     1650, 1650, 1651, 1653, 1732, 1732,    0,    0,    0,    0,
-        0,    0, 1732, 1652, 1654, 1733,    0,    0,    0, 1733,
-     1732,    0, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651,
-     1651, 1651,    0, 1652, 1652, 1652, 1652, 1652, 1652, 1652,
-     1652, 1652, 1652, 1733, 1655, 2197,    0,    0, 2198, 2197,
-
-        0, 1733, 2198, 1653, 1656,    0,    0, 1733,    0, 1733,
-        0,    0, 2244,    0, 1654, 2197, 2244, 2197, 2198, 2198,
-     2198,    0,    0, 1653, 1653, 1653, 1653, 1653, 1653, 1653,
-     1653, 1653, 1653, 2244, 1654, 1654, 1654, 1654, 1654, 1654,
-     1654, 1654, 1654, 1654, 1655, 1657,    0,    0,    0,    0,
-        0,    0,    0,    0, 1656, 1658, 1735,    0, 1736,    0,
-     1735,    0, 1736,    0, 1655, 1655, 1655, 1655, 1655, 1655,
-     1655, 1655, 1655, 1655, 1656, 1656, 1656, 1656, 1656, 1656,
-     1656, 1656, 1656, 1656, 1735, 1735, 1736, 2292,    0, 2280,
-        0, 2292, 1735, 2280, 1736, 1657,    0,    0,    0,    0,
-
-     1735, 1736, 1736,    0,    0, 1658,    0, 2292,    0, 1739,
-        0, 2280,    0, 1739,    0, 1657, 1657, 1657, 1657, 1657,
-     1657, 1657, 1657, 1657, 1657, 1658, 1658, 1658, 1658, 1658,
-     1658, 1658, 1658, 1658, 1658, 1660, 1711, 1739, 1743, 1660,
-     1711,    0, 1743, 1742,    0, 1739,    0, 1742, 1745,    0,
-     1746,    0, 1745, 1739, 1746, 1748, 1660,    0,    0, 1748,
-        0, 1711,    0,    0, 1711, 1742, 1743,    0,    0,    0,
-        0, 1742, 1711, 1660, 1743,    0, 1745,    0, 1746, 1742,
-     1711, 1743, 1743, 1748, 1745, 1742, 1746, 1742,    0, 1742,
-        0, 1748, 1745,    0, 1746,    0, 1751, 1745, 1753, 1748,
-
-     1751,    0, 1753,    0,    0,    0, 1660, 1660, 1660, 1660,
-     1660, 1660, 1660, 1660, 1660, 1660, 1661,    0, 1767, 1754,
-     1661, 1759, 1767, 1754, 1751, 1759, 1753,    0,    0, 2293,
-        0, 1769, 1751, 2293, 1753, 1769,    0, 1661,    0, 1751,
-     1751, 1754, 1753, 1759, 1661,    0, 1767, 1754,    0, 1759,
-     2293,    0, 1661,    0, 1767, 1754,    0, 1759,    0, 1769,
-     1661,    0, 1767, 1754, 2200, 1759,    0, 1769, 2200,    0,
-        0,    0,    0,    0,    0, 1769,    0,    0,    0,    0,
-        0,    0,    0,    0, 2200, 2200, 2200, 1661, 1661, 1661,
-     1661, 1661, 1661, 1661, 1661, 1661, 1661, 1665, 1665, 1665,
-
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
-     1665, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707,
-     1707, 1707, 1707, 1707, 1707, 1712, 1770,    0, 1772, 1712,
-     1770, 1712, 1772,    0,    0, 2351,    0,    0, 2452, 2351,
-        0, 2342, 2452,    0, 2392, 2342, 2399,    0, 2392,    0,
-     2399, 1770,    0, 2336, 1770, 2351, 1772, 2336, 2342, 2342,
-
-     2452,    0, 1770, 2342, 1772, 2392, 2399,    0,    0,    0,
-     1770, 1772, 1772,    0, 2392, 2336, 1712, 1712, 1712, 1712,
-     1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
-     1712, 1712, 1712, 1712, 1712,    0,    0,    0,    0, 2336,
-        0,    0,    0,    0,    0, 1712, 1712, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
-     1756, 1761, 1761, 1773,    0, 1761, 1761, 1773, 1761, 2421,
-        0, 2411, 2423, 2421, 2447, 2411, 2423, 2458, 2447,    0,
-     2487, 2458, 1761, 2490, 2487, 2531,    0, 2490,    0, 2531,
-     2421, 1773, 2411, 2423, 2447,    0, 1773,    0, 2458, 1773,
-        0, 2411, 2487, 2490,    0, 2531, 2421, 1773,    0,    0,
-        0,    0,    0, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
-     1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
-
-     1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761, 1761,
-     1761, 1761, 1761, 1761, 1774,    0, 1775,    0, 1774, 1777,
-     1775, 1776,    0, 1777, 2537, 1776, 2341,    0, 2537,    0,
-     2341, 1793,    0, 1795, 2566, 1793, 1774, 1795, 2566,    0,
-        0,    0, 1774, 1774, 1775, 1775, 2537, 1777, 2341, 1776,
-     1774,    0, 1775, 1795,    0, 1777, 2566, 1776, 1774, 1793,
-     1775, 1795, 1776, 1777, 1778, 1776, 1796, 1793, 1778, 1795,
-     1796,    0, 2341,    0,    0, 1793, 1800, 1795, 1798, 1802,
-     1800,    0, 1798, 1802,    0, 1804, 1778,    0,    0, 1804,
-        0, 1800, 1778, 1778, 1796,    0,    0, 1805,    0, 1806,
-
-     1778, 1805, 1796, 1806, 1800, 1804, 1798, 1802, 1778, 1796,
-     1796, 1798, 1800, 1804, 1798, 1802,    0,    0,    0,    0,
-     1800, 1804, 1798, 1802, 1815, 1805, 1817, 1806, 1815, 1804,
-     1817,    0,    0, 1805, 1806, 1806,    0,    0, 1818,    0,
-     1805, 1805, 1818, 1806, 1820,    0,    0, 1822, 1820, 1823,
-        0, 1822, 1815, 1823, 1817, 1817,    0,    0,    0,    0,
-     1815, 1828, 1817, 1818,    0, 1828, 1818, 1815, 1815,    0,
-     1817,    0, 1820,    0, 1818, 1822, 1822, 1823,    0,    0,
-     1820,    0, 1818, 1822,    0, 1823, 1826,    0, 1820, 1828,
-     1826, 1822, 1823, 1823, 2158, 1831, 1832, 1828, 2158, 1831,
-
-     1832,    0,    0,    0, 1828, 1828, 2515, 2535, 1826,    0,
-     2515, 2535, 2567, 2667, 1826, 2158, 2567, 2667,    0, 2158,
-        0,    0, 1826, 1831, 1832,    0,    0, 2515, 2535, 2535,
-     1826, 1831, 1832,    0, 2567, 2667,    0, 1831, 2158, 1831,
-     1832, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833,
-     1833, 1833, 1833, 1833, 1833, 1836,    0, 1842, 1844, 1836,
-     1845, 1842, 1844,    0, 1845,    0,    0, 1847, 2521, 2722,
-     1848, 1847, 2521, 2722, 1848,    0,    0, 1849,    0,    0,
-     1836, 1849,    0, 1836,    0, 1842, 1844, 1844, 1845, 2722,
-     2521, 1836,    0, 1842, 1844, 1847, 1845, 1845, 1848, 1836,
-     1842, 1842, 1844, 1847, 1845, 1849, 1848,    0, 1853, 2521,
-        0, 1847, 1853, 1849, 1848, 1854, 1849,    0, 1855, 1854,
-     1856, 1849, 1855,    0, 1856, 1857,    0, 1860,    0, 1857,
-
-     1854, 1860,    0,    0,    0, 2527, 1853, 1861, 1862, 2527,
-        0, 1861, 1862, 1854, 1853, 2436, 1855,    0, 1856, 2436,
-     1856, 1854, 1853, 1857, 1855, 1860, 1856, 2527,    0, 1854,
-     1855, 1857, 1855, 1860, 1856, 1861, 1862, 2436, 1863, 1857,
-     1860, 1860, 1863, 1861, 1862, 1864, 2527,    0, 1862, 1864,
-     1865, 1861, 1862, 2436, 1865, 1866, 1867, 2698, 2440, 1866,
-     1867, 2698, 2440,    0,    0, 2651, 1863, 1868, 2710, 2651,
-        0, 1868, 2710, 1864, 1863,    0,    0,    0, 1865, 2698,
-     2440, 1864, 1863, 1866, 1867, 1867, 1865, 2651, 1865, 1864,
-     2710, 1866, 1867, 1866, 1865, 1868, 2440, 1877, 1881, 1866,
-
-     1867, 1877, 1881, 1868, 1868,    0, 1868, 2651, 1879, 1882,
-     2519, 1868, 1879, 1882, 2519, 1883,    0, 2633, 2564, 1883,
-     1889, 2633, 2564,    0, 1889, 1877, 1881, 1881,    0,    0,
-        0, 2519,    0, 1877, 1881, 1879, 1879, 1882, 2633, 2564,
-        0, 1877, 1881, 1883, 1879, 1882, 1882, 2519, 1889, 1889,
-     1886, 1883, 1879, 1882, 1886, 2564, 1889, 1888, 1883, 1883,
-        0, 1888, 1891,    0, 1889, 2657, 1891, 1886, 1886, 2657,
-        0,    0,    0,    0,    0,    0, 1897, 2775, 1886, 1888,
-     1897, 2775,    0,    0,    0, 1888, 1886, 2657, 1902,    0,
-     1891, 1895, 1902, 1888, 1886, 1895, 2647, 2775, 1891, 1888,
-
-     2647, 1888,    0, 1888, 1897, 1891, 1891, 2657, 1895, 1895,
-     2608, 2715, 1897, 1895, 2608, 2715, 1902, 2647,    0, 1895,
-     1897,    0,    0, 1902, 1902,    0,    0, 1895,    0,    0,
-     2608, 2608, 1902, 2715,    0, 1895, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
-     1905,    0, 1907, 1908, 1905, 1909, 1907, 1908, 2674, 1909,
-        0, 2706, 2674,    0, 2749, 2706,    0, 1911, 2749, 2398,
-     2725, 1911, 1910, 2398, 2725,    0, 1910,    0, 1905, 2674,
-     1907, 1908, 2706, 1909,    0, 2749, 1905, 1907, 1907, 1908,
-     2398, 1909, 2725, 1909, 1905, 1911, 1907, 1908, 1915, 1909,
-     1910, 1910, 1915, 1911,    0, 1916, 1911,    0, 1910, 1916,
-     1918, 1911,    0, 2398, 1918, 2758, 1910, 1920, 2659, 2758,
-        0, 1920, 2659, 2769,    0,    0, 1915, 2769, 2590,    0,
-
-        0,    0, 2590, 1916, 1915, 2659, 2659, 2758, 1918, 2659,
-        0, 1916, 1915, 1918, 2769, 1920, 1918, 1916,    0, 1916,
-     2590,    0,    0, 1920, 1918,    0, 2590,    0,    0,    0,
-     1920, 1920, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-
-     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,
-     1922, 1922, 1922, 1922, 1922, 1922, 1923, 1925, 1926, 2762,
-     1923, 1925, 1926, 2762,    0,    0,    0, 1928, 2791, 1929,
-     2789, 1928, 2791, 1929, 2789,    0, 1931,    0, 1932, 1934,
-     1931, 2762, 1932, 1934, 1923, 1925, 1926, 1926,    0, 1923,
-     2791, 2789, 1923, 1925, 1926, 1928, 1928, 1929, 1929,    0,
-     1923, 1925, 1926, 1928, 1931, 1929, 1932, 1934,    0,    0,
-        0, 1928, 1931, 1929, 1932, 1934, 1934,    0,    0,    0,
-     1931, 1932, 1932, 1934, 1935,    0, 1937, 1938, 1935, 1939,
-     1937, 1938, 2799, 1939,    0,    0, 2799,    0, 1941, 2596,
-
-        0, 1943, 1941, 2596,    0, 1943,    0,    0,    0, 2799,
-     2799,    0, 1935, 1935, 1937, 1938,    0, 1939,    0,    0,
-     1935, 2596, 1937, 1938, 1937, 1939, 1941, 2596, 1935, 1943,
-     1937, 1938, 1944, 1939, 1941, 1941, 1944, 1943,    0, 1946,
-        0,    0, 1941, 1946, 1943, 1943, 1947,    0,    0, 1948,
-     1947, 1951, 1952, 1948,    0, 1951, 1952, 2792, 1955, 1944,
-     1944, 2792, 1955,    0,    0,    0,    0, 1946, 1944,    0,
-        0,    0,    0,    0, 1947, 1946, 1944, 1948, 2792, 1951,
-     1952, 1952, 1947, 1946, 1951, 1948, 1955, 1951, 1952,    0,
-     1947,    0,    0, 1948, 1955, 1951, 1952, 1954, 1948, 1957,
-
-        0, 1954, 1955, 1957, 1959,    0, 1962,    0, 1959, 1963,
-     1962,    0, 2800, 1963,    0,    0, 2800,    0, 1967, 1964,
-        0,    0, 1967, 1964, 1954, 1954,    0, 1957, 1957, 2800,
-     2800,    0, 1959, 1954, 1962, 1957,    0, 1963,    0, 1963,
-     1959, 1954, 1962, 1957, 1964, 1963, 1967, 1964, 1959,    0,
-     1962,    0, 1969, 1963, 1967, 1964, 1969,    0,    0,    0,
-        0, 1970, 1967, 1964, 1971, 1970, 1973,    0, 1971,    0,
-     1973,    0,    0, 1974,    0, 1976,    0, 1974, 1993, 1976,
-     1969,    0, 1993, 1970,    0, 1969,    0, 1996, 1969, 1970,
-        0, 1996, 1971,    0, 1973, 1973, 1969, 1970,    0, 1970,
-
-     1971, 1974, 1973, 1976,    0, 1970, 1993,    0, 1971, 1974,
-     1973, 1976, 1994,    0, 1993, 1996, 1994, 1974,    0, 1976,
-     1993, 1997, 1993, 1996,    0, 1997,    0,    0, 1996,    0,
-        0, 1996, 1998, 1999, 2000,    0, 1998, 1999, 2000, 1994,
-     1994,    0,    0, 2020,    0,    0, 2022, 2020, 1994, 1997,
-     2022,    0,    0,    0, 1998,    0, 1994, 1997, 1997, 2000,
-     1998, 1999, 2000, 2001,    0, 1997,    0, 2001, 1998, 1999,
-     2000, 2020,    0, 1998, 2022,    0, 1998, 1999, 2000, 2020,
-     2024,    0, 2022,    0, 2024, 2001,    0, 2020,    0,    0,
-     2022, 2001, 2027, 2029,    0,    0, 2027, 2029, 2031, 2001,
-
-        0,    0, 2031,    0, 2001, 2032,    0, 2001, 2024, 2032,
-        0,    0,    0, 2029,    0,    0, 2024, 2024, 2041, 2043,
-     2027, 2029, 2041, 2043, 2024, 2032, 2031, 2027, 2027, 2029,
-        0, 2044,    0, 2032, 2031, 2044, 2027, 2029, 2027, 2031,
-     2046, 2032, 2031, 2032, 2046,    0, 2041, 2043,    0, 2032,
-        0,    0, 2047,    0, 2041, 2043, 2047, 2050, 2044, 2044,
-     2666, 2050, 2041, 2043, 2666,    0,    0, 2044, 2046, 2052,
-     2046,    0,    0, 2052, 2054, 2044, 2046, 2047, 2054, 2050,
-     2047, 2666, 2666, 2058, 2046, 2050,    0, 2058, 2047,    0,
-        0,    0,    0, 2050, 2061, 2064, 2047, 2052, 2061, 2064,
-
-     2066, 2050, 2054,    0, 2066, 2052,    0, 2054,    0,    0,
-     2054, 2058, 2067, 2052,    0,    0, 2067, 2069, 2054, 2058,
-        0, 2069, 2061, 2064,    0,    0, 2058, 2058, 2066, 2070,
-     2061, 2064,    0, 2070,    0, 2061, 2066,    0, 2061, 2064,
-     2067, 2067, 2073, 2074, 2066, 2069, 2073, 2074, 2067,    0,
-        0,    0,    0, 2069, 2076, 2075, 2067, 2070, 2076, 2075,
-     2069, 2069,    0,    0, 2079, 2070,    0,    0, 2079,    0,
-     2073, 2074,    0, 2070,    0,    0, 2074, 2080, 2073, 2074,
-     2076, 2080, 2076, 2075,    0, 2073, 2073, 2074, 2075, 2081,
-     2076, 2075, 2079, 2081,    0,    0,    0,    0, 2076, 2075,
-
-     2079,    0, 2082,    0,    0, 2080, 2082, 2083, 2079,    0,
-        0, 2083, 2084, 2080, 2087,    0, 2084, 2081, 2087, 2085,
-        0, 2080,    0, 2085, 2086, 2081, 2081,    0, 2086,    0,
-     2082, 2082,    0, 2081,    0, 2083,    0, 2088, 2082, 2087,
-     2084, 2088, 2087, 2083,    0,    0, 2082, 2085, 2084, 2084,
-     2087, 2083, 2086, 2083, 2085, 2085, 2084, 2099, 2087,    0,
-     2086, 2099, 2101, 2085, 2086, 2088, 2101, 2102, 2086,    0,
-        0, 2102,    0, 2088, 2103,    0, 2088,    0, 2103, 2105,
-        0, 2088,    0, 2105,    0, 2099,    0,    0, 2107,    0,
-     2101, 2099, 2107, 2099,    0, 2102, 2102,    0, 2101,    0,
-
-     2106, 2099, 2103, 2102, 2106, 2109, 2101, 2105,    0, 2109,
-     2103, 2102, 2105,    0,    0, 2105, 2107,    0, 2103,    0,
-        0,    0, 2106, 2105, 2107,    0,    0,    0, 2106,    0,
-     2110, 2107, 2107, 2109, 2110, 2113, 2106,    0, 2106, 2113,
-        0, 2109, 2116,    0, 2106,    0, 2116, 2110, 2110, 2109,
-        0,    0,    0, 2109,    0, 2119, 2120, 2121, 2110, 2119,
-     2120, 2121,    0, 2113,    0,    0, 2110,    0, 2724,    0,
-     2116, 2113, 2724, 2755, 2110,    0,    0, 2755, 2116, 2113,
-     2116,    0,    0, 2119, 2120, 2121, 2116,    0,    0, 2724,
-     2724, 2119, 2120, 2121, 2755, 2755,    0,    0, 2120, 2119,
-
-     2120, 2121,    0, 2121, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122,
-     2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2126, 2127,
-     2129, 2131, 2126, 2127, 2129, 2131,    0,    0,    0,    0,
-
-        0, 2144,    0,    0,    0, 2144,    0,    0, 2140,    0,
-     2142,    0, 2140,    0, 2142, 2129, 2126, 2127, 2129, 2131,
-        0,    0,    0,    0, 2126, 2127, 2129, 2131,    0, 2144,
-     2127, 2126, 2126, 2127, 2129, 2131, 2140, 2144, 2142, 2140,
-        0,    0,    0, 2145, 2140, 2144, 2142, 2145,    0,    0,
-        0,    0, 2140, 2142, 2142, 2147, 2149,    0,    0, 2147,
-     2149, 2150, 2152,    0,    0, 2150, 2152,    0,    0,    0,
-        0, 2145,    0, 2155, 2153,    0,    0, 2155, 2153, 2145,
-        0, 2149,    0, 2147, 2149,    0, 2145, 2145,    0, 2150,
-     2152, 2147, 2149,    0,    0,    0,    0, 2150, 2152, 2147,
-
-     2149, 2155, 2153,    0, 2150, 2150, 2152, 2153, 2154, 2155,
-     2153,    0, 2154,    0,    0, 2157,    0, 2155, 2153, 2157,
-     2159, 2161,    0,    0, 2159, 2161, 2164,    0,    0,    0,
-     2164,    0,    0,    0,    0, 2166, 2154, 2154, 2167, 2166,
-     2157,    0, 2167, 2157, 2154,    0,    0,    0, 2159, 2161,
-     2161, 2157, 2154,    0, 2164,    0, 2159, 2161,    0, 2157,
-        0,    0, 2164, 2166, 2159, 2161, 2167,    0, 2169, 2164,
-     2164, 2166, 2169, 2171, 2167,    0,    0, 2171, 2166, 2166,
-     2172, 2167, 2167, 2175, 2172, 2177, 2179, 2175,    0, 2177,
-     2179,    0,    0, 2169,    0,    0, 2169,    0, 2176,    0,
-
-        0, 2171, 2176,    0, 2169,    0, 2171, 2172, 2172, 2171,
-        0, 2175, 2169, 2177, 2179,    0, 2172, 2171,    0, 2175,
-     2176, 2177, 2179,    0, 2172,    0, 2176, 2175, 2180, 2177,
-     2179, 2183, 2180, 2182, 2176, 2183,    0, 2182,    0, 2176,
-     2184,    0, 2176, 2185, 2184, 2199,    0, 2185,    0, 2199,
-     2186,    0,    0,    0, 2186, 2184, 2180,    0,    0, 2183,
-     2183, 2182, 2180,    0, 2180, 2186, 2182, 2183, 2184, 2182,
-     2202, 2185, 2180, 2199, 2202, 2183, 2184, 2182, 2186, 2185,
-        0, 2199,    0,    0, 2184,    0, 2186, 2185, 2204, 2199,
-        0, 2205, 2204, 2206, 2186, 2205,    0, 2206, 2202, 2202,
-
-     2207,    0,    0,    0, 2207,    0, 2202,    0,    0,    0,
-        0, 2216,    0,    0, 2202, 2216, 2204,    0, 2208, 2205,
-        0, 2206, 2208,    0, 2204,    0, 2204, 2205, 2207, 2206,
-     2205, 2206, 2204, 2207,    0, 2205, 2207, 2206, 2208, 2216,
-        0,    0,    0,    0, 2207, 2216, 2208, 2216, 2218, 2208,
-        0,    0, 2218,    0, 2208, 2216,    0, 2222,    0, 2219,
-     2226, 2222, 2208, 2219, 2226,    0, 2225,    0,    0, 2232,
-     2225,    0,    0, 2232,    0, 2226, 2218,    0, 2229, 2234,
-        0, 2218, 2229, 2234, 2218, 2222, 2219, 2219, 2226,    0,
-        0, 2225, 2218, 2222, 2225, 2219, 2226, 2232,    0,    0,
-
-        0, 2222, 2225, 2219, 2226, 2232, 2229, 2234,    0,    0,
-     2225, 2229, 2232, 2232, 2229, 2234, 2235, 2238,    0,    0,
-     2235, 2238, 2229, 2234,    0,    0, 2239, 2240, 2242,    0,
-     2239, 2240, 2242,    0,    0,    0,    0,    0, 2243,    0,
-        0,    0, 2243,    0, 2235, 2238, 2238,    0,    0,    0,
-        0,    0, 2235, 2238, 2239, 2240, 2242,    0,    0, 2235,
-     2235, 2238, 2239, 2240, 2242, 2242, 2243,    0,    0, 2245,
-     2239, 2240, 2242, 2245, 2243, 2239, 2250,    0,    0,    0,
-     2250, 2251, 2243,    0,    0, 2251,    0,    0, 2252,    0,
-     2253,    0, 2252,    0, 2253,    0,    0, 2245,    0,    0,
-
-        0,    0, 2254,    0, 2250, 2245, 2254, 2245,    0, 2251,
-        0,    0, 2250, 2245, 2251, 2252, 2252, 2251, 2253, 2250,
-     2250,    0,    0,    0, 2252, 2251, 2253, 2253,    0, 2255,
-     2254, 2254, 2252, 2255, 2253, 2256, 2257,    0, 2254, 2256,
-     2257, 2258,    0,    0, 2255, 2258, 2254, 2259,    0,    0,
-     2269, 2259,    0,    0, 2269,    0, 2271, 2255,    0,    0,
-     2271,    0, 2272, 2256, 2257, 2255, 2272,    0,    0, 2258,
-     2256, 2256, 2257, 2255,    0, 2259, 2259, 2258, 2269, 2256,
-     2257,    0,    0, 2259, 2271, 2258, 2269,    0,    0, 2273,
-     2272, 2259, 2271, 2273, 2269,    0,    0,    0, 2272, 2274,
-
-     2271, 2275,    0, 2274,    0, 2275, 2272,    0, 2278,    0,
-        0,    0, 2278,    0, 2282,    0,    0, 2273, 2282, 2283,
-        0, 2274,    0, 2283,    0, 2273, 2287, 2274,    0, 2275,
-     2287,    0,    0, 2273,    0, 2274, 2278, 2275,    0, 2278,
-     2274,    0, 2282, 2274, 2278, 2275,    0, 2283,    0, 2289,
-     2282, 2287, 2278, 2289, 2287, 2283, 2282,    0, 2282,    0,
-     2294, 2296, 2287, 2283, 2294, 2296,    0, 2298,    0,    0,
-     2287, 2298,    0,    0, 2300,    0, 2289, 2289, 2300, 2301,
-     2303,    0,    0, 2301, 2303, 2289, 2304,    0, 2294, 2296,
-     2304,    0,    0, 2289,    0, 2298, 2294, 2296,    0,    0,
-
-        0,    0, 2300, 2298, 2294, 2296,    0, 2301, 2303, 2305,
-     2300, 2298,    0, 2305, 2304, 2301, 2303, 2300, 2300,    0,
-        0, 2306, 2304, 2301, 2303, 2306,    0, 2308,    0,    0,
-     2304, 2308, 2309,    0, 2312, 2304, 2309, 2305, 2312, 2315,
-        0,    0,    0, 2315, 2317, 2305, 2306,    0, 2317, 2306,
-        0,    0,    0, 2305, 2318, 2308,    0, 2306, 2318,    0,
-     2309,    0, 2312, 2308,    0, 2306,    0, 2315, 2309, 2309,
-     2312, 2308, 2317, 2320,    0, 2315, 2309, 2320, 2312,    0,
-     2317,    0, 2318, 2315,    0, 2322,    0,    0, 2317, 2322,
-     2318, 2323, 2327,    0,    0, 2323, 2327,    0, 2318,    0,
-
-     2320, 2320, 2326,    0, 2328,    0, 2326,    0, 2328, 2320,
-        0, 2330,    0, 2322, 2327, 2330,    0, 2320,    0, 2323,
-     2327, 2322, 2322,    0,    0, 2323,    0, 2323, 2327, 2322,
-     2326, 2326, 2328, 2331,    0, 2323, 2327, 2331, 2326, 2330,
-     2328,    0,    0,    0,    0, 2332, 2326, 2330, 2328, 2332,
-     2333,    0,    0,    0, 2333, 2330, 2343,    0, 2330, 2345,
-     2343, 2331, 2346, 2345,    0,    0, 2346, 2332,    0, 2331,
-        0, 2347, 2333, 2332,    0, 2347,    0, 2331, 2333,    0,
-        0, 2332,    0,    0, 2343,    0, 2333, 2345,    0, 2332,
-     2346, 2332, 2343, 2348, 2333, 2345, 2333, 2348, 2346, 2347,
-
-     2343, 2346,    0, 2345,    0, 2345, 2346, 2347,    0,    0,
-     2349,    0, 2347, 2353, 2349, 2347, 2355, 2353,    0,    0,
-     2355, 2348, 2356,    0,    0,    0, 2356, 2359,    0, 2348,
-     2349, 2359,    0,    0,    0,    0,    0, 2348, 2349, 2360,
-     2348, 2353,    0, 2360, 2355,    0, 2349,    0,    0, 2353,
-     2356,    0, 2355, 2355, 2349, 2359, 2356, 2353, 2356,    0,
-     2355, 2361, 2359, 2359, 2363, 2361, 2356, 2360, 2363,    0,
-     2365, 2359,    0, 2367, 2365, 2360,    0, 2367, 2661,    0,
-        0, 2360, 2661, 2360,    0,    0, 2361, 2368,    0, 2361,
-     2369, 2368, 2363,    0, 2369, 2661, 2661, 2361, 2365, 2661,
-
-     2363, 2367,    0,    0,    0, 2361, 2365, 2370, 2363, 2367,
-        0, 2370,    0,    0, 2365, 2368, 2368, 2367, 2369, 2369,
-     2367, 2373,    0, 2368, 2374, 2373, 2369,    0, 2374,    0,
-        0, 2368,    0,    0, 2369, 2370, 2375,    0,    0,    0,
-     2375,    0, 2370, 2370,    0,    0,    0,    0,    0, 2373,
-     2373, 2370, 2374,    0, 2376, 2377,    0, 2373, 2376, 2377,
-     2374,    0,    0,    0, 2375, 2373, 2378,    0, 2374, 2374,
-     2378,    0, 2375,    0,    0,    0,    0, 2379,    0, 2375,
-     2375, 2379, 2376, 2377,    0,    0,    0,    0, 2380, 2381,
-     2376, 2377, 2380, 2381, 2378,    0, 2377, 2376, 2376, 2377,
-
-     2393,    0, 2378, 2378, 2393, 2379, 2379, 2391,    0,    0,
-     2378, 2391,    0, 2379, 2380,    0, 2380, 2381, 2394, 2396,
-        0, 2379, 2394, 2396, 2380, 2381,    0,    0, 2393, 2393,
-     2381,    0, 2380, 2381,    0, 2391, 2393, 2391, 2397,    0,
-     2394, 2401, 2397, 2391, 2393, 2401, 2394, 2396,    0,    0,
-        0, 2391, 2402, 2405, 2394, 2396, 2402, 2405,    0,    0,
-        0,    0, 2394, 2396,    0,    0, 2397,    0, 2401, 2401,
-        0, 2407,    0,    0, 2397, 2407,    0, 2401, 2405,    0,
-     2402, 2405, 2397, 2408,    0, 2401, 2402, 2408, 2402, 2405,
-        0,    0,    0,    0, 2409,    0, 2402, 2405, 2409, 2407,
-
-     2407, 2410,    0,    0, 2412, 2410,    0, 2407, 2412,    0,
-     2408, 2408,    0, 2414,    0, 2407, 2420, 2414,    0, 2408,
-     2420,    0, 2409, 2409,    0,    0,    0, 2408,    0, 2410,
-     2409, 2410, 2412,    0,    0,    0,    0, 2410, 2409, 2414,
-     2412, 2414, 2415,    0, 2420, 2410, 2415, 2412, 2412, 2414,
-        0, 2422, 2420, 2420, 2427, 2422,    0, 2414, 2427,    0,
-     2420, 2425,    0,    0, 2428, 2425,    0, 2415, 2428,    0,
-     2415, 2431,    0,    0,    0, 2431, 2433,    0, 2415, 2422,
-     2433, 2432, 2427, 2427,    0, 2432, 2415, 2422,    0, 2425,
-     2427,    0, 2428, 2425,    0, 2422,    0, 2425, 2427, 2431,
-
-     2428,    0, 2441, 2432, 2433, 2425, 2441, 2431, 2428, 2432,
-        0,    0, 2433,    0, 2443, 2431,    0, 2432, 2443,    0,
-     2433,    0,    0, 2432, 2444, 2432,    0, 2445, 2444,    0,
-     2441, 2445,    0, 2449,    0,    0,    0, 2449, 2441,    0,
-        0,    0, 2443, 2443, 2450, 2453, 2441, 2454, 2450, 2453,
-     2443, 2454, 2444, 2444,    0, 2445,    0,    0, 2443,    0,
-     2444, 2449, 2449, 2445,    0,    0, 2450,    0, 2444, 2449,
-     2455, 2445, 2450, 2453, 2455, 2454,    0, 2449, 2453,    0,
-     2450, 2453, 2457, 2454,    0,    0, 2457,    0, 2450, 2453,
-     2454, 2454,    0, 2460,    0, 2461, 2455, 2460, 2455, 2461,
-
-        0,    0,    0,    0, 2462, 2463, 2455, 2466, 2462, 2463,
-     2457, 2466,    0,    0, 2455,    0,    0,    0, 2457,    0,
-        0, 2460,    0, 2461, 2468,    0, 2457,    0, 2468, 2460,
-     2467, 2461, 2462, 2463, 2467, 2466, 2460, 2460,    0, 2461,
-     2462, 2463, 2469, 2466,    0,    0, 2469,    0, 2462, 2463,
-        0, 2466, 2468,    0,    0, 2467,    0, 2468, 2467, 2471,
-     2468, 2470,    0, 2471,    0, 2470, 2467, 2663, 2468,    0,
-     2469, 2663,    0, 2472, 2467, 2469, 2470, 2472, 2469, 2473,
-        0,    0,    0, 2473, 2663, 2663, 2469, 2471, 2663, 2470,
-     2483,    0,    0,    0, 2483, 2471, 2474, 2470,    0,    0,
-
-     2474, 2472, 2485, 2471,    0, 2470, 2485, 2473,    0, 2472,
-     2472, 2474, 2473,    0,    0, 2473, 2491, 2472, 2483,    0,
-     2491,    0,    0, 2473, 2474, 2483, 2483, 2486,    0, 2488,
-     2485, 2486, 2474, 2488, 2483,    0,    0,    0, 2485, 2492,
-     2474,    0,    0, 2492, 2491,    0, 2485,    0,    0, 2486,
-     2491,    0, 2491,    0, 2494, 2486,    0, 2488, 2494,    0,
-     2491,    0,    0, 2486,    0, 2488, 2496, 2492, 2488, 2486,
-     2496, 2486, 2497, 2488,    0, 2492, 2497, 2498,    0,    0,
-        0, 2498, 2494, 2492, 2499,    0,    0,    0, 2499, 2501,
-     2494,    0,    0, 2501, 2496,    0,    0,    0, 2494, 2503,
-
-     2497,    0, 2496, 2503,    0, 2498,    0,    0, 2497,    0,
-     2496,    0, 2499, 2498, 2504, 2497, 2497, 2501, 2504, 2499,
-     2499, 2498,    0,    0,    0, 2501,    0, 2503, 2499,    0,
-     2501,    0, 2503, 2501, 2509, 2503, 2511, 2513, 2509,    0,
-     2511, 2513, 2504, 2503,    0,    0,    0, 2514, 2518,    0,
-     2504, 2514, 2518,    0,    0,    0,    0,    0, 2504,    0,
-        0,    0, 2509, 2509, 2511, 2513,    0, 2520,    0, 2511,
-     2509, 2520, 2511, 2513,    0, 2514, 2518,    0, 2509,    0,
-     2511, 2513, 2528, 2514, 2518, 2518, 2528,    0,    0, 2520,
-        0, 2514, 2518, 2529, 2530, 2520, 2533, 2529, 2530,    0,
-
-     2533,    0,    0, 2520,    0, 2534,    0,    0,    0, 2534,
-     2528, 2520,    0,    0,    0, 2538, 2539,    0, 2528, 2538,
-     2539, 2529, 2530, 2528, 2533,    0, 2528, 2534,    0, 2529,
-     2530,    0, 2533, 2534, 2529, 2540, 2530, 2529, 2530, 2540,
-     2533, 2534,    0, 2538, 2539,    0, 2542,    0,    0, 2534,
-     2542, 2538, 2539,    0,    0,    0,    0, 2539, 2543, 2538,
-     2539, 2545, 2543, 2540, 2538, 2545, 2542,    0,    0,    0,
-     2540, 2540, 2546,    0, 2542,    0, 2546,    0,    0, 2540,
-        0, 2547, 2542, 2548, 2551, 2547, 2543, 2548, 2551, 2545,
-     2542,    0,    0,    0, 2543, 2549, 2545, 2545,    0, 2549,
-
-     2546,    0, 2543,    0,    0, 2545,    0,    0, 2546, 2547,
-     2546, 2548, 2551,    0, 2550, 2551, 2546, 2547, 2550, 2548,
-     2551,    0,    0, 2549, 2547, 2547,    0, 2548, 2551,    0,
-     2549, 2549, 2552,    0, 2561,    0, 2552, 2563, 2561, 2549,
-        0, 2563, 2550, 2568, 2565,    0,    0, 2568, 2565, 2570,
-     2550,    0,    0, 2570,    0,    0,    0, 2550, 2550, 2561,
-     2552,    0, 2561, 2571,    0, 2563, 2565, 2571, 2552,    0,
-     2561, 2568, 2565, 2563, 2563,    0, 2552, 2570, 2561, 2568,
-     2565, 2563, 2568,    0,    0, 2570, 2572, 2568, 2565,    0,
-     2572, 2571, 2574, 2570,    0,    0, 2574,    0, 2576, 2571,
-
-        0,    0, 2576,    0, 2582, 2577,    0, 2571, 2582, 2577,
-        0, 2572,    0,    0, 2572, 2584,    0, 2586,    0, 2584,
-     2574, 2586, 2572,    0,    0, 2574, 2576,    0, 2574, 2576,
-     2572, 2577, 2582, 2577, 2576, 2588, 2574,    0,    0, 2588,
-     2582, 2577, 2576, 2584,    0, 2586, 2597, 2582, 2582, 2577,
-     2597, 2584, 2584, 2586,    0,    0, 2598,    0, 2599, 2584,
-     2598, 2586, 2599, 2588, 2588, 2601,    0,    0, 2603, 2601,
-        0, 2588, 2603,    0, 2597,    0,    0, 2604,    0, 2588,
-        0, 2604, 2597,    0, 2598,    0, 2599, 2605,    0,    0,
-     2597, 2605, 2598, 2601, 2599,    0, 2603, 2603,    0, 2607,
-
-     2598, 2601, 2599, 2607, 2603, 2604,    0,    0,    0, 2601,
-     2604,    0, 2603, 2604, 2609, 2605, 2605,    0, 2609, 2607,
-     2610, 2604,    0, 2605, 2610, 2611,    0, 2607,    0, 2611,
-        0, 2605, 2612,    0,    0, 2607, 2612, 2613,    0,    0,
-        0, 2613, 2609, 2607,    0,    0,    0, 2614, 2610, 2610,
-     2609, 2614,    0, 2611,    0,    0, 2610,    0, 2609, 2615,
-     2612, 2611, 2611, 2615, 2610, 2613, 2616,    0, 2612, 2611,
-     2616,    0,    0, 2613, 2613, 2614, 2612,    0,    0,    0,
-     2612, 2613, 2614, 2614, 2617,    0, 2626, 2615, 2617,    0,
-     2626, 2614, 2615,    0, 2616, 2615, 2628,    0,    0,    0,
-
-     2628,    0, 2616, 2615,    0, 2630,    0, 2632,    0, 2630,
-     2616, 2632, 2617,    0, 2626,    0,    0, 2626,    0, 2634,
-     2617, 2617, 2626, 2634, 2628, 2628,    0,    0, 2617,    0,
-     2626,    0, 2628, 2630, 2630, 2632,    0,    0, 2636,    0,
-     2628, 2630, 2636, 2632, 2638,    0,    0, 2634, 2638, 2630,
-     2634, 2632,    0, 2639,    0, 2634, 2642, 2639,    0,    0,
-     2642,    0,    0, 2634,    0, 2644, 2636, 2646,    0, 2644,
-        0, 2646, 2638,    0, 2636,    0,    0,    0,    0, 2649,
-     2638, 2639, 2636, 2649, 2642, 2636, 2639,    0, 2638, 2639,
-        0,    0, 2642, 2644, 2644, 2646,    0, 2639,    0,    0,
-
-     2642, 2644, 2658, 2646,    0,    0, 2658, 2649, 2660, 2644,
-        0, 2646, 2660, 2665, 2662, 2649,    0, 2665, 2662, 2658,
-     2658,    0, 2649, 2649,    0, 2660, 2660,    0,    0,    0,
-     2658, 2662, 2662, 2668,    0, 2665, 2660, 2668, 2658, 2669,
-        0, 2665, 2662, 2669, 2660,    0, 2658,    0,    0, 2665,
-     2662, 2670, 2660,    0,    0, 2670, 2673, 2665, 2662,    0,
-     2673, 2668, 2675,    0,    0,    0, 2675, 2669, 2677, 2668,
-        0,    0, 2677,    0,    0, 2669, 2669, 2668,    0, 2670,
-        0,    0, 2676, 2669, 2673, 2679, 2676, 2670,    0, 2679,
-     2675,    0, 2673, 2670,    0, 2670, 2677,    0, 2675, 2675,
-
-     2673, 2677,    0,    0, 2677, 2678, 2675, 2676,    0, 2678,
-     2676, 2680, 2677, 2679,    0, 2680,    0,    0, 2676,    0,
-     2689, 2679,    0, 2679, 2689,    0, 2676,    0,    0, 2679,
-     2678,    0, 2691, 2678,    0, 2689, 2691,    0, 2693, 2680,
-        0, 2678, 2693,    0, 2680,    0,    0, 2680, 2689, 2678,
-     2695,    0,    0,    0, 2695, 2680, 2689,    0,    0,    0,
-     2691,    0,    0,    0, 2689,    0, 2693,    0, 2691,    0,
-        0,    0,    0,    0, 2693, 2691, 2691,    0, 2695, 2693,
-        0,    0, 2693,    0,    0,    0, 2695,    0,    0,    0,
-        0,    0, 2695,    0, 2695, 2697, 2697, 2697, 2697, 2697,
-
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697,
-     2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2697, 2699,
-     2700,    0, 2703, 2699, 2700, 2705, 2703,    0,    0, 2705,
-        0, 2708,    0,    0,    0, 2708,    0,    0,    0,    0,
-
-        0,    0,    0,    0,    0,    0,    0, 2699, 2700,    0,
-     2703, 2700,    0, 2705,    0, 2699, 2700, 2699, 2703, 2708,
-        0, 2705,    0, 2699, 2700,    0, 2703, 2708, 2716, 2705,
-     2718,    0, 2716, 2720, 2718, 2708,    0, 2720,    0, 2726,
-     2723,    0,    0, 2726, 2723, 2716, 2716, 2718, 2718,    0,
-     2720, 2720,    0, 2727,    0,    0, 2716, 2727, 2718, 2730,
-        0, 2720, 2723, 2730, 2716,    0, 2718, 2726, 2723, 2720,
-     2726,    0, 2716,    0, 2718, 2726, 2723, 2720, 2731,    0,
-        0, 2727, 2731, 2726, 2723,    0,    0, 2730, 2732, 2727,
-     2733,    0, 2732,    0, 2733, 2730,    0, 2727,    0,    0,
-
-     2734, 2735, 2730, 2730, 2734, 2735, 2731, 2742,    0,    0,
-        0, 2742,    0, 2731, 2731,    0, 2732,    0, 2733, 2744,
-        0,    0, 2731, 2744, 2732, 2733, 2733,    0, 2734, 2735,
-        0,    0, 2732, 2732, 2733, 2742, 2734, 2735, 2746,    0,
-        0,    0, 2746, 2742, 2734, 2735, 2735, 2744, 2748, 2750,
-     2753, 2742, 2748, 2750, 2753, 2744,    0,    0,    0,    0,
-     2764, 2765,    0, 2744, 2764, 2765, 2746, 2768,    0,    0,
-        0, 2768,    0,    0, 2746,    0, 2748, 2750, 2753,    0,
-        0,    0, 2746,    0, 2748, 2750, 2753, 2776, 2764, 2765,
-        0, 2776, 2748, 2750, 2753, 2768, 2764, 2765,    0,    0,
-
-        0,    0, 2776, 2768, 2764, 2765, 2777,    0,    0, 2778,
-     2777, 2768, 2779, 2778,    0, 2776, 2779,    0,    0,    0,
-        0, 2786,    0, 2776, 2788, 2786,    0,    0, 2788,    0,
-        0, 2776,    0,    0, 2777, 2777,    0, 2778,    0, 2794,
-     2779, 2779, 2777, 2794,    0, 2778,    0,    0, 2779, 2786,
-     2777, 2778, 2788, 2778, 2786,    0, 2779, 2786, 2795, 2802,
-     2788,    0, 2795, 2802,    0, 2786,    0, 2794, 2788, 2803,
-     2804,    0,    0, 2803, 2804, 2794,    0,    0,    0,    0,
-     2810, 2794,    0, 2794, 2810,    0, 2795, 2802,    0,    0,
-        0,    0,    0,    0, 2795, 2802, 2795, 2803, 2804,    0,
-
-     2808, 2802, 2795, 2802, 2808, 2803, 2804, 2814, 2810,    0,
-     2803, 2814, 2804, 2803, 2804,    0, 2810, 2815,    0,    0,
-        0, 2815, 2816,    0, 2810, 2808, 2816, 2819, 2808,    0,
-        0, 2819,    0,    0, 2821, 2814, 2808, 2825, 2821,    0,
-     2814, 2825,    0, 2814, 2808, 2815,    0, 2816,    0,    0,
-     2816, 2814, 2826, 2815, 2819, 2819, 2826,    0, 2816, 2815,
-        0, 2815, 2821, 2819, 2827, 2825, 2816,    0, 2827,    0,
-     2821, 2819,    0, 2825,    0, 2830, 2821, 2826, 2821, 2830,
-     2826, 2825,    0,    0,    0, 2834, 2825, 2835, 2826, 2834,
-        0, 2835, 2827,    0,    0,    0, 2826, 2838,    0, 2827,
-
-     2827, 2838,    0, 2830,    0,    0, 2843,    0, 2827,    0,
-     2843, 2830,    0, 2834, 2834, 2835, 2830,    0,    0, 2830,
-     2846, 2834, 2835, 2835, 2846, 2838,    0,    0,    0, 2834,
-     2838, 2835, 2849, 2838, 2843, 2852, 2849,    0,    0, 2852,
-        0, 2838, 2843,    0,    0,    0,    0,    0, 2846, 2843,
-     2843,    0,    0, 2846,    0,    0, 2846,    0,    0, 2849,
-     2849,    0,    0, 2852, 2846,    0,    0,    0, 2849,    0,
-        0, 2852,    0,    0,    0,    0, 2849, 2852,    0, 2852,
-     2856, 2856, 2856, 2856, 2856, 2856, 2856, 2856, 2856, 2856,
-     2856, 2856, 2856, 2857, 2857, 2857, 2857, 2857, 2857, 2857,
-
-     2857, 2857, 2857, 2857, 2857, 2857, 2858, 2858, 2858, 2858,
-     2858, 2858, 2858, 2858, 2858, 2858, 2858, 2858, 2858, 2859,
-     2859, 2859, 2859, 2859, 2859, 2859, 2859, 2859, 2859, 2859,
-     2859, 2859, 2860, 2860, 2860, 2860, 2860, 2860, 2860, 2860,
-     2860, 2860, 2860, 2860, 2860, 2861, 2861, 2861, 2861, 2861,
-     2861, 2861, 2861, 2861, 2861, 2861, 2861, 2861, 2862, 2862,
-     2862, 2862, 2862, 2862, 2862, 2862, 2862, 2862, 2862, 2862,
-     2862, 2863, 2863, 2863, 2863, 2863, 2863, 2863, 2863, 2863,
-     2863, 2863, 2863, 2863, 2864, 2864, 2864, 2864, 2864, 2864,
-     2864, 2864, 2864, 2864, 2864, 2864, 2864, 2865, 2865, 2865,
-
-     2865, 2865, 2865, 2865, 2865, 2865, 2865, 2865, 2865, 2865,
-     2866, 2866, 2866, 2866, 2866, 2866, 2866, 2866, 2866, 2866,
-     2866, 2866, 2866, 2867, 2867, 2867, 2867, 2867, 2867, 2867,
-     2867, 2867, 2867, 2867, 2867, 2867, 2868, 2868, 2868, 2868,
-     2868, 2868, 2868, 2868, 2868, 2868, 2868, 2868, 2868, 2869,
-     2869,    0, 2869, 2869, 2869, 2869, 2869, 2869, 2869, 2869,
-     2869, 2869, 2870, 2870, 2870, 2870, 2870,    0, 2870, 2870,
-     2870, 2870, 2871, 2871,    0, 2871, 2871, 2871, 2871, 2871,
-     2871, 2871, 2871, 2871, 2871, 2872, 2872,    0, 2872, 2872,
-     2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2873, 2873,
-
-     2873, 2873, 2873, 2873, 2873, 2873, 2873, 2873, 2874, 2874,
-        0, 2874, 2874, 2874, 2874, 2874, 2874, 2874, 2874, 2874,
-     2874, 2875, 2875,    0, 2875, 2875, 2875, 2875, 2875, 2875,
-     2875, 2875, 2875, 2875, 2876, 2876,    0, 2876, 2876, 2876,
-     2876, 2876, 2876, 2876, 2876, 2876, 2876, 2877,    0, 2877,
-     2877,    0, 2877, 2877, 2877, 2877, 2877, 2877, 2877, 2877,
-     2878, 2878,    0,    0, 2878, 2878, 2878, 2878, 2878, 2878,
-     2879, 2879,    0, 2879, 2879, 2879, 2879, 2879, 2879, 2879,
-     2879, 2879, 2879, 2880, 2880,    0, 2880, 2880, 2880, 2880,
-     2880, 2880, 2880, 2880, 2880, 2880, 2881, 2881,    0,    0,
-
-     2881, 2881, 2881, 2881, 2881, 2881, 2882, 2882,    0, 2882,
-     2882, 2882, 2882, 2882, 2882, 2882, 2882, 2882, 2882, 2883,
-     2883,    0, 2883, 2883, 2883, 2883, 2883, 2883, 2883, 2883,
-     2883, 2883, 2884, 2884, 2884, 2884, 2884, 2884, 2884, 2884,
-        0, 2884, 2884, 2884, 2884, 2885, 2885,    0,    0, 2885,
-     2885, 2885, 2885, 2885, 2885, 2886, 2886, 2886, 2886, 2886,
-     2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2887, 2887,
-     2887, 2887, 2887, 2887, 2887, 2887, 2887, 2887, 2887, 2887,
-     2887, 2888, 2888,    0,    0, 2888, 2888, 2888, 2888, 2888,
-     2888, 2889, 2889,    0, 2889, 2889, 2889, 2889, 2889, 2889,
-
-     2889, 2889, 2889, 2889, 2890, 2890,    0, 2890, 2890, 2890,
-     2890, 2890, 2890, 2890, 2890, 2890, 2890, 2891, 2891,    0,
-        0, 2891, 2891, 2891, 2891, 2891, 2891, 2892, 2892,    0,
-     2892, 2892, 2892, 2892, 2892, 2892, 2892, 2892, 2892, 2892,
-     2893, 2893,    0, 2893, 2893, 2893, 2893, 2893, 2893, 2893,
-     2893, 2893, 2893, 2894, 2894,    0,    0, 2894, 2894, 2894,
-     2894, 2894, 2894, 2895, 2895,    0, 2895, 2895, 2895, 2895,
-     2895, 2895, 2895, 2895, 2895, 2895, 2896, 2896,    0, 2896,
-     2896, 2896, 2896, 2896, 2896, 2896, 2896, 2896, 2896, 2897,
-     2897,    0,    0, 2897, 2897, 2897, 2897, 2897, 2897, 2898,
-
-     2898,    0, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898,
-     2898, 2898, 2899, 2899,    0, 2899, 2899, 2899, 2899, 2899,
-     2899, 2899, 2899, 2899, 2899, 2900, 2900,    0,    0, 2900,
-     2900, 2900, 2900, 2900, 2900, 2901, 2901,    0, 2901, 2901,
-     2901, 2901, 2901, 2901, 2901, 2901, 2901, 2901, 2902, 2902,
-        0, 2902, 2902, 2902, 2902, 2902, 2902, 2902, 2902, 2902,
-     2902, 2903, 2903,    0,    0, 2903, 2903, 2903, 2903, 2903,
-     2903, 2904, 2904,    0, 2904, 2904, 2904, 2904, 2904, 2904,
-     2904, 2904, 2904, 2904, 2905, 2905,    0, 2905, 2905, 2905,
-     2905, 2905, 2905, 2905, 2905, 2905, 2905, 2906, 2906,    0,
-
-        0, 2906, 2906, 2906, 2906, 2906, 2906, 2907, 2907,    0,
-     2907, 2907, 2907, 2907, 2907, 2907, 2907, 2907, 2907, 2907,
-     2908, 2908,    0, 2908, 2908, 2908, 2908, 2908, 2908, 2908,
-     2908, 2908, 2908, 2909, 2909,    0,    0, 2909, 2909, 2909,
-     2909, 2909, 2909, 2910, 2910,    0, 2910, 2910, 2910, 2910,
-     2910, 2910, 2910, 2910, 2910, 2910, 2911, 2911,    0, 2911,
-     2911, 2911, 2911, 2911, 2911, 2911, 2911, 2911, 2911, 2912,
-     2912,    0,    0, 2912, 2912, 2912, 2912, 2912, 2912, 2913,
-     2913,    0, 2913, 2913, 2913, 2913, 2913, 2913, 2913, 2913,
-     2913, 2913, 2914, 2914,    0, 2914, 2914, 2914, 2914, 2914,
-
-     2914, 2914, 2914, 2914, 2914, 2915, 2915,    0,    0, 2915,
-     2915, 2915, 2915, 2915, 2915, 2916, 2916,    0, 2916, 2916,
-     2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2917, 2917,
-        0, 2917, 2917, 2917, 2917, 2917, 2917, 2917, 2917, 2917,
-     2917, 2918, 2918,    0,    0, 2918, 2918, 2918, 2918, 2918,
-     2918, 2919, 2919,    0, 2919, 2919, 2919, 2919, 2919, 2919,
-     2919, 2919, 2919, 2919, 2920, 2920,    0, 2920, 2920, 2920,
-     2920, 2920, 2920, 2920, 2920, 2920, 2920, 2921, 2921, 2921,
-     2921,    0, 2921, 2921, 2921, 2921, 2921, 2921, 2921, 2921,
-     2922, 2922,    0, 2922,    0, 2922, 2922, 2922, 2922, 2922,
-
-     2922, 2922, 2922, 2923, 2923,    0,    0, 2923, 2923, 2923,
-     2923, 2923, 2923, 2924, 2924,    0, 2924, 2924, 2924, 2924,
-     2924, 2924, 2924, 2924, 2924, 2924, 2925, 2925,    0, 2925,
-     2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2926,
-     2926,    0,    0, 2926, 2926, 2926, 2926, 2926, 2926, 2927,
-     2927,    0, 2927, 2927, 2927, 2927, 2927, 2927, 2927, 2927,
-     2927, 2927, 2928, 2928,    0, 2928, 2928, 2928, 2928, 2928,
-     2928, 2928, 2928, 2928, 2928, 2929, 2929,    0,    0, 2929,
-     2929, 2929, 2929, 2929, 2929, 2930, 2930,    0, 2930, 2930,
-     2930, 2930, 2930, 2930, 2930, 2930, 2930, 2930, 2931, 2931,
-
-        0, 2931, 2931, 2931, 2931, 2931, 2931, 2931, 2931, 2931,
-     2931, 2932, 2932,    0,    0, 2932, 2932, 2932, 2932, 2932,
-     2932, 2933, 2933,    0, 2933, 2933, 2933, 2933, 2933, 2933,
-     2933, 2933, 2933, 2933, 2934, 2934,    0, 2934, 2934, 2934,
-     2934, 2934, 2934, 2934, 2934, 2934, 2934, 2935, 2935, 2935,
-     2935, 2935, 2935,    0, 2935, 2935, 2935, 2935, 2935, 2935,
-     2936, 2936,    0,    0, 2936, 2936, 2936, 2936, 2936, 2936,
-     2937, 2937,    0, 2937, 2937, 2937, 2937, 2937, 2937, 2937,
-     2937, 2937, 2937, 2938, 2938,    0, 2938, 2938, 2938, 2938,
-     2938, 2938, 2938, 2938, 2938, 2938, 2939, 2939,    0,    0,
-
-     2939, 2939, 2939, 2939, 2939, 2939, 2940, 2940,    0, 2940,
-     2940, 2940, 2940, 2940, 2940, 2940, 2940, 2940, 2940, 2941,
-     2941,    0, 2941, 2941, 2941, 2941, 2941, 2941, 2941, 2941,
-     2941, 2941, 2942, 2942,    0,    0, 2942, 2942, 2942, 2942,
-     2942, 2942, 2943, 2943,    0, 2943, 2943, 2943, 2943, 2943,
-     2943, 2943, 2943, 2943, 2943, 2944, 2944,    0, 2944, 2944,
-     2944, 2944, 2944, 2944, 2944, 2944, 2944, 2944, 2945, 2945,
-        0,    0, 2945, 2945, 2945, 2945, 2945, 2945, 2946, 2946,
-        0, 2946, 2946, 2946, 2946, 2946, 2946, 2946, 2946, 2946,
-     2946, 2947, 2947,    0, 2947, 2947, 2947, 2947, 2947, 2947,
-
-     2947, 2947, 2947, 2947, 2948, 2948, 2948, 2948, 2948, 2948,
-     2948, 2948, 2948, 2948, 2948, 2948, 2948, 2949, 2949, 2949,
-     2949, 2949, 2949,    0, 2949, 2949, 2949, 2949, 2949, 2949,
-     2950, 2950, 2950, 2950, 2950, 2950, 2950, 2950, 2950, 2950,
-     2952, 2952, 2952, 2952, 2952, 2952, 2952, 2952, 2952,    0,
-     2952, 2952, 2952, 2953, 2953,    0, 2953, 2953, 2953, 2953,
-     2953, 2953, 2953, 2953, 2953, 2953, 2954, 2954,    0, 2954,
-     2954, 2954, 2954, 2954, 2954, 2954, 2954, 2954, 2954, 2955,
-     2955, 2955, 2955, 2955, 2955, 2955, 2955, 2955, 2955, 2955,
-        0, 2955, 2956, 2956,    0, 2956, 2956, 2956, 2956, 2956,
-
-     2956, 2956, 2956, 2956, 2956, 2957, 2957,    0, 2957, 2957,
-     2957, 2957, 2957, 2957, 2957, 2957, 2957, 2957, 2958, 2958,
-        0,    0, 2958, 2958, 2958, 2958, 2958, 2958, 2959, 2959,
-        0, 2959, 2959, 2959, 2959, 2959, 2959, 2959, 2959, 2959,
-     2959, 2960, 2960,    0, 2960, 2960, 2960, 2960, 2960, 2960,
-     2960, 2960, 2960, 2960, 2961, 2961,    0,    0, 2961, 2961,
-     2961, 2961, 2961, 2961, 2962, 2962,    0, 2962, 2962, 2962,
-     2962, 2962, 2962, 2962, 2962, 2962, 2962, 2963, 2963,    0,
-     2963, 2963, 2963, 2963, 2963, 2963, 2963, 2963, 2963, 2963,
-     2964, 2964,    0,    0, 2964, 2964, 2964, 2964, 2964, 2964,
-
-     2965, 2965,    0, 2965, 2965, 2965, 2965, 2965, 2965, 2965,
-     2965, 2965, 2965, 2966, 2966,    0, 2966, 2966, 2966, 2966,
-     2966, 2966, 2966, 2966, 2966, 2966, 2967, 2967,    0,    0,
-     2967, 2967, 2967, 2967, 2967, 2967, 2968, 2968,    0, 2968,
-     2968, 2968, 2968, 2968, 2968, 2968, 2968, 2968, 2968, 2969,
-     2969,    0, 2969, 2969, 2969, 2969, 2969, 2969, 2969, 2969,
-     2969, 2969, 2970,    0, 2970, 2970,    0, 2970, 2970, 2970,
-     2970, 2970, 2970, 2970, 2970, 2971,    0, 2971, 2971,    0,
-     2971, 2971, 2971,    0, 2971, 2971, 2971, 2971, 2972, 2972,
-        0,    0, 2972, 2972, 2972, 2972, 2972, 2972, 2973, 2973,
-
-        0, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973,
-     2973, 2974, 2974,    0, 2974, 2974, 2974, 2974, 2974, 2974,
-     2974, 2974, 2974, 2974, 2975,    0, 2975, 2975,    0, 2975,
-     2975, 2975, 2975, 2975, 2975, 2975, 2975, 2976, 2976,    0,
-        0, 2976, 2976, 2976, 2976, 2976, 2976, 2977, 2977,    0,
-     2977, 2977, 2977, 2977, 2977, 2977, 2977, 2977, 2977, 2977,
-     2978, 2978,    0, 2978, 2978, 2978, 2978, 2978, 2978, 2978,
-     2978, 2978, 2978, 2979,    0, 2979, 2979,    0, 2979, 2979,
-     2979, 2979, 2979, 2979, 2979, 2979, 2980, 2980,    0,    0,
-     2980, 2980, 2980, 2980, 2980, 2980, 2981, 2981,    0, 2981,
-
-     2981, 2981, 2981, 2981, 2981, 2981, 2981, 2981, 2981, 2982,
-     2982,    0, 2982, 2982, 2982, 2982, 2982, 2982, 2982, 2982,
-     2982, 2982, 2983, 2983,    0,    0, 2983, 2983, 2983, 2983,
-     2983, 2983, 2984, 2984,    0, 2984, 2984, 2984, 2984, 2984,
-     2984, 2984, 2984, 2984, 2984, 2985, 2985,    0, 2985, 2985,
-     2985, 2985, 2985, 2985, 2985, 2985, 2985, 2985, 2986, 2986,
-        0,    0, 2986, 2986, 2986, 2986, 2986, 2986, 2987, 2987,
-        0, 2987, 2987, 2987, 2987, 2987, 2987, 2987, 2987, 2987,
-     2987, 2988, 2988,    0, 2988, 2988, 2988, 2988, 2988, 2988,
-     2988, 2988, 2988, 2988, 2989, 2989,    0, 2989, 2989, 2989,
-
-     2989, 2989, 2989, 2989, 2989, 2989, 2989, 2990, 2990,    0,
-     2990, 2990, 2990, 2990, 2990, 2990, 2990, 2990, 2990, 2990,
-     2991, 2991,    0, 2991, 2991, 2991, 2991, 2991, 2991, 2991,
-     2991, 2991, 2991, 2992, 2992,    0,    0, 2992, 2992, 2992,
-     2992, 2992, 2992, 2993, 2993,    0, 2993, 2993, 2993, 2993,
-     2993, 2993, 2993, 2993, 2993, 2993, 2994, 2994,    0, 2994,
-     2994, 2994, 2994, 2994, 2994, 2994, 2994, 2994, 2994, 2995,
-     2995,    0,    0, 2995, 2995, 2995, 2995, 2995, 2995, 2996,
-     2996,    0, 2996, 2996, 2996, 2996, 2996, 2996, 2996, 2996,
-     2996, 2996, 2997, 2997,    0, 2997, 2997, 2997, 2997, 2997,
-
-     2997, 2997, 2997, 2997, 2997, 2998, 2998,    0,    0, 2998,
-     2998, 2998, 2998, 2998, 2998, 2999, 2999,    0, 2999, 2999,
-     2999, 2999, 2999, 2999, 2999, 2999, 2999, 2999, 3000, 3000,
-        0, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000,
-     3000, 3001, 3001,    0, 3001, 3001, 3001, 3001, 3001, 3001,
-     3001, 3001, 3001, 3001, 3002, 3002,    0, 3002, 3002, 3002,
-     3002, 3002, 3002, 3002, 3002, 3002, 3002, 3003, 3003,    0,
-     3003, 3003, 3003, 3003, 3003, 3003, 3003, 3003, 3003, 3003,
-     3004, 3004,    0,    0, 3004, 3004, 3004, 3004, 3004, 3004,
-     3005, 3005,    0, 3005, 3005, 3005, 3005, 3005, 3005, 3005,
-
-     3005, 3005, 3005, 3006, 3006,    0, 3006, 3006, 3006, 3006,
-     3006, 3006, 3006, 3006, 3006, 3006, 3007, 3007,    0,    0,
-     3007, 3007, 3007, 3007, 3007, 3007, 3008, 3008,    0, 3008,
-     3008, 3008, 3008, 3008, 3008, 3008, 3008, 3008, 3008, 3009,
-     3009,    0, 3009, 3009, 3009, 3009, 3009, 3009, 3009, 3009,
-     3009, 3009, 3010, 3010,    0,    0, 3010, 3010, 3010, 3010,
-     3010, 3010, 3011, 3011,    0, 3011, 3011, 3011, 3011, 3011,
-     3011, 3011, 3011, 3011, 3011, 3012, 3012,    0, 3012, 3012,
-     3012, 3012, 3012, 3012, 3012, 3012, 3012, 3012, 3013, 3013,
-        0, 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3013, 3013,
-
-     3013, 3014, 3014, 3014, 3014, 3014,    0, 3014, 3014, 3014,
-     3014, 3015, 3015,    0, 3015, 3015, 3015, 3015, 3015, 3015,
-     3015, 3015, 3015, 3015, 3016, 3016,    0, 3016, 3016, 3016,
-     3016, 3016, 3016, 3016, 3016, 3016, 3016, 3017, 3017,    0,
-     3017, 3017, 3017, 3017, 3017, 3017, 3017, 3017, 3017, 3017,
-     3018, 3018,    0, 3018, 3018, 3018, 3018, 3018, 3018, 3018,
-     3018, 3018, 3018, 3019, 3019,    0, 3019, 3019, 3019, 3019,
-     3019, 3019, 3019, 3019, 3019, 3019, 3020, 3020,    0, 3020,
-     3020, 3020, 3020, 3020, 3020, 3020, 3020, 3020, 3020, 3021,
-     3021,    0, 3021, 3021, 3021, 3021, 3021, 3021, 3021, 3021,
+     1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+     1149, 1149, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
 
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271,
+     1358, 1710,    0, 1712, 1358, 1710, 1713, 1712, 2538,    0,
+     1713,    0, 2538, 1715, 1929, 1870, 1655, 1715, 1929, 1870,
+     1716, 1358,    0, 1726, 1716,    0,    0, 1726, 2538, 1710,
+     1710, 1712, 1712, 1656, 1713, 1929, 1870, 1710,    0, 1712,
+        0, 1715, 1713, 1713, 1358, 1710, 1657, 1712, 1716, 1715,
+     1713, 1726,    0,    0, 1715,    0, 1716, 1715,    0, 1726,
+
+     1870, 1947,    0, 1658, 1716, 1947, 1655, 1726,    0,    0,
+        0, 1358, 1358, 1358, 1358, 1358, 1358, 1358, 1358, 1358,
+     1358, 1359, 1947, 1656,    0, 1359, 1655, 1655, 1655, 1655,
+     1655, 1655, 1655, 1655, 1655, 1655, 1657,    0,    0,    0,
+        0,    0, 1359, 1656, 1656, 1656, 1656, 1656, 1656, 1656,
+     1656, 1656, 1656, 1658,    0,    0, 1657, 1657, 1657, 1657,
+     1657, 1657, 1657, 1657, 1657, 1657, 1924,    0, 1926,    0,
+     1924,    0, 1926, 1658, 1658, 1658, 1658, 1658, 1658, 1658,
+     1658, 1658, 1658,    0,    0, 1926, 1926, 1924, 1924, 1926,
+     1926,    0, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359,
+
+     1359, 1359, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361,
+     1361, 1361, 1361, 1361, 1361, 1361, 1364, 1717,    0, 1719,
+     1364, 1717, 1364, 1719,    0, 2000,    0, 1977, 1992, 2000,
+
+     2010, 1977, 1992,    0, 2010, 2020,    0, 2028, 2059, 2020,
+     2039, 2028, 2059,    0, 2039, 1717, 2000, 1719, 1977, 1992,
+        0, 2010, 1719, 1717, 1977, 1719,    0, 2020, 2028, 2059,
+     1717, 1717, 2039, 1719, 1992,    0,    0, 1364, 1364, 1364,
+     1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364,
+     1364, 1364, 1364, 1364, 1364, 1364,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0, 1364, 1364, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371,
+     1371, 1371, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402,
+     1402, 1402, 1402, 1402, 1402, 1402, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+     1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
+
+     1419, 1419, 1419, 1419, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435,
+     1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474,
+     1474, 1474, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554,
+     1554, 1554, 1554, 1554, 1554, 1554, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605, 1605,
+     1659, 1725, 1728, 2583,    0, 1725, 1728, 2583, 1730,    0,
+     1660, 1729, 1730, 1732, 2092, 1729,    0, 1732, 2092,    0,
+     1731, 2041,    0, 2583, 1731, 2041, 1725,    0,    0, 1725,
+     1728,    0,    0,    0, 1730, 2092, 1730, 1725, 1728, 1729,
+     1661, 1732,    0, 2041, 1730, 1725, 1728, 1729, 1731, 1732,
+     1659, 1662, 1730, 1731, 1729, 1729, 1731, 1732,    0,    0,
+
+     1660,    0, 2041,    0, 1731,    0,    0,    0,    0,    0,
+     1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659,
+     1660, 1660, 1660, 1660, 1660, 1660, 1660, 1660, 1660, 1660,
+     1661, 1663,    0,    0,    0,    0,    0,    0,    0,    0,
+     2778, 1662, 1664, 1736, 2778,    0,    0, 1736,    0,    0,
+     1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661,
+     2778, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662, 1662,
+     1662, 1736, 1665, 2040, 2043,    0, 1736, 2040, 2043, 1736,
+     2832, 1663, 1666,    0, 2832,    0,    0, 1736,    0, 2051,
+     2040, 2040, 1664, 2051,    0, 2040, 2043,    0,    0,    0,
+
+     2832, 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663,
+     1663, 2051, 1664, 1664, 1664, 1664, 1664, 1664, 1664, 1664,
+     1664, 1664, 1665, 1667,    0,    0,    0,    0,    0,    0,
+     2051,    0, 1666, 1668, 1744,    0, 1747,    0, 1744,    0,
+     1747,    0, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665,
+     1665, 1665, 1666, 1666, 1666, 1666, 1666, 1666, 1666, 1666,
+     1666, 1666, 1744, 1669, 1747, 2096,    0, 2050,    0, 2096,
+     1744, 2050, 1747, 1667, 1670,    0,    0, 1744, 1744,    0,
+     1747,    0,    0, 1668, 2050, 2050, 2096, 1748,    0, 2050,
+        0, 1748,    0, 1667, 1667, 1667, 1667, 1667, 1667, 1667,
+
+     1667, 1667, 1667, 1668, 1668, 1668, 1668, 1668, 1668, 1668,
+     1668, 1668, 1668, 1669, 1671, 1748, 1748,    0,    0,    0,
+        0,    0,    0, 1748, 1670, 1672, 1745,    0,    0,    0,
+     1745, 1748,    0, 1669, 1669, 1669, 1669, 1669, 1669, 1669,
+     1669, 1669, 1669,    0, 1670, 1670, 1670, 1670, 1670, 1670,
+     1670, 1670, 1670, 1670, 1745, 1673, 2054, 2153,    0,    0,
+     2054, 2153, 1745, 1745, 1671, 1674,    0,    0,    0,    0,
+     1745,    0,    0, 2150,    0, 1672, 2054, 2150, 2054, 2153,
+        0,    0,    0,    0, 1671, 1671, 1671, 1671, 1671, 1671,
+     1671, 1671, 1671, 1671, 2150, 1672, 1672, 1672, 1672, 1672,
+
+     1672, 1672, 1672, 1672, 1672, 1673, 1675,    0,    0,    0,
+        0,    0,    0,    0,    0, 1674, 1676, 1749,    0, 1751,
+        0, 1749,    0, 1751,    0, 1673, 1673, 1673, 1673, 1673,
+     1673, 1673, 1673, 1673, 1673, 1674, 1674, 1674, 1674, 1674,
+     1674, 1674, 1674, 1674, 1674, 1749, 1677, 1751, 2066,    0,
+     2087,    0, 2066, 1749, 2087, 1751, 1675, 1678,    0,    0,
+     1749, 1749,    0, 1751,    0,    0, 1676,    0, 2066, 2066,
+     1754, 2087, 2087,    0, 1754,    0, 1675, 1675, 1675, 1675,
+     1675, 1675, 1675, 1675, 1675, 1675, 1676, 1676, 1676, 1676,
+     1676, 1676, 1676, 1676, 1676, 1676, 1677, 1679, 1754,    0,
+
+        0,    0,    0,    0,    0,    0, 1754, 1678, 1680, 1752,
+        0,    0,    0, 1752, 1754,    0, 1677, 1677, 1677, 1677,
+     1677, 1677, 1677, 1677, 1677, 1677,    0, 1678, 1678, 1678,
+     1678, 1678, 1678, 1678, 1678, 1678, 1678, 1752, 1681, 2073,
+     2228,    0,    0, 2073, 2228, 1752, 1752, 1679, 1682,    0,
+        0,    0,    0, 1752,    0,    0,    0,    0, 1680, 2073,
+        0, 1756, 2228,    0,    0, 1756,    0, 1679, 1679, 1679,
+     1679, 1679, 1679, 1679, 1679, 1679, 1679, 2073, 1680, 1680,
+     1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1681, 1756,
+        0,    0,    0,    0,    0,    0,    0, 1756, 1682,    0,
+
+        0,    0, 1758,    0,    0, 1756, 1758,    0, 1681, 1681,
+     1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1682, 1682,
+     1682, 1682, 1682, 1682, 1682, 1682, 1682, 1682, 1684, 1737,
+     1758, 1758, 1684, 1737,    0, 1759,    0, 2151, 1758, 1759,
+     1761, 2151,    0,    0, 1761,    0, 1758, 1762,    0, 1684,
+        0, 1762, 1765,    0, 1737,    0, 1765, 1737, 2151,    0,
+     2198,    0,    0, 1759, 2198, 1737, 1684,    0, 1761, 1761,
+        0, 1759,    0, 1737, 2171, 1762, 1761, 1759, 2171, 1759,
+     1765, 2198,    0, 1762, 1761,    0,    0,    0, 1765, 1768,
+     1762, 1762,    0, 1768, 2171, 2171, 1765,    0,    0, 1684,
+
+     1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1685,
+     1771, 1768, 1769, 1685, 1771, 2216, 1769, 1768,    0, 2216,
+        0,    0, 1772, 2264, 1774, 1768, 1772, 2264, 1774,    0,
+     1685, 1768,    0, 1768,    0, 1768, 2216, 1685, 1771,    0,
+     1769,    0,    0, 2055, 2264, 1685, 1771, 2055, 1769,    0,
+     1772,    0, 1774, 1685, 1771, 1769, 1769, 2230, 1772, 1771,
+     1774, 2230,    0, 2055, 2055, 2055, 1772,    0, 1774,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0, 2230,
+     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
+     1689, 1689, 1689, 1689, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733,
+     1733, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1738, 1777,
+        0, 1779, 1738, 1777, 1738, 1779, 2236,    0,    0,    0,
+     2236, 2237,    0, 2269,    0, 2237,    0, 2269, 2238,    0,
+     2282,    0, 2238,    0, 2282,    0, 2240, 1777, 2236, 1779,
+     2240, 2237,    0, 2237, 2269, 1777,    0, 1779, 2238, 2238,
+
+     2238, 2282, 1777, 1777,    0, 1779, 2240, 2240, 2240, 1738,
+     1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738,
+     1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1780, 2253,
+     2285, 2320, 1780, 2253, 2285, 2320, 2321,    0, 1738, 1738,
+     2321, 2336, 2470, 2380, 2500, 2336, 2470, 2380, 2500, 2253,
+     1780, 2285,    0, 2320,    0,    0, 1780,    0, 2321,    0,
+     2253,    0, 2336, 2470, 1780, 2380, 2500,    0,    0,    0,
+        0,    0, 1780, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
+     1782, 1782, 1782, 1782, 1782, 1782, 1782, 1785,    0, 2437,
+     1793, 1785, 2458, 2437, 1793,    0, 2458,    0,    0, 1795,
+        0,    0, 1796, 1795,    0,    0, 1796, 2443,    0, 1785,
+     2437, 2443, 1798, 2458,    0, 1785, 1798,    0, 1793, 2437,
+        0, 1801, 2458, 1785, 1796, 1801, 1793, 1795, 2443,    0,
+
+     1796, 1785, 1787, 1787, 1793, 1795, 1787, 1787, 1796, 1787,
+     1798, 2386,    0, 1795,    0, 2386, 1796,    0, 1798, 1801,
+     2506, 2443,    0, 1787, 2506,    0, 1798, 1801, 2386, 2386,
+        0,    0, 2565, 2386, 1801, 1801, 2565,    0,    0,    0,
+        0, 2506,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0, 2565, 1787, 1787, 1787, 1787, 1787, 1787,
+     1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787,
+     1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787, 1787,
+     1787, 1787, 1787, 1787, 1787, 1799, 1802, 1803,    0, 1799,
+     1802, 1803,    0,    0,    0,    0, 1804, 2662, 1805, 1806,
+
+     1804, 2662, 1805, 1806,    0,    0,    0, 2687, 1823, 1803,
+     1799, 2687, 1823, 1799, 1802, 1803, 1803, 2662, 2662, 1802,
+        0, 1799, 1802, 1803, 1804, 1804, 1805, 1806, 2687, 1799,
+     1802, 1803, 1804, 1807, 1805, 1806, 1823, 1807,    0, 1805,
+     1804,    0, 1805, 1806, 1823, 1825,    0, 1826,    0, 1825,
+     1832, 1826, 1823,    0, 1832, 1807,    0,    0,    0, 1828,
+     1834, 1807, 1807, 1828, 1834, 1825,    0,    0,    0, 1807,
+     1830,    0, 1835, 1825, 1830, 1826, 1835, 1807, 1832,    0,
+     1834, 1825,    0, 1826,    0, 1830, 1832, 1828, 1834, 1825,
+     1826, 1826, 1828, 1836, 1832, 1828, 1834, 1836, 1830,    0,
+
+     1835,    0,    0, 1828, 1834, 1845, 1830, 1847, 1835, 1845,
+        0, 1847,    0,    0, 1830, 1835, 1835,    0, 1850, 1848,
+        0, 1836, 1850, 1848,    0,    0,    0,    0, 1836, 1836,
+     1852,    0,    0, 1845, 1852, 1847, 1847, 1836, 2379,    0,
+        0, 1845, 2379, 1847, 1848,    0, 1850, 1848, 1845, 1845,
+        0, 1847, 1853, 1856, 1850, 1848, 1853, 1856, 1852, 1852,
+     2379,    0, 1850, 1848, 1858, 2385, 1852,    0, 1858, 2385,
+        0,    0, 2483, 1861, 1852, 1856, 2483, 1861, 1862,    0,
+     1853, 1856, 1862,    0, 2379,    0,    0, 2385, 1853, 1856,
+        0,    0, 1858,    0, 2483, 1853, 1853, 1856, 2535, 2589,
+
+     1858, 1861, 2535, 2589,    0,    0, 1862, 1858, 1858, 1861,
+     2483, 2385,    0,    0, 1862, 1861,    0, 1861,    0,    0,
+     2535, 2589, 1862, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863,
+
+     1863, 1863, 1863, 1863, 1863, 1863, 1863, 1866,    0, 1872,
+     1874, 1866, 1875, 1872, 1874,    0, 1875,    0,    0, 1877,
+     2571,    0, 1878, 1877, 2571,    0, 1878,    0,    0, 1879,
+        0,    0, 1866, 1879,    0, 1866,    0, 1872, 1874, 1874,
+     1875,    0, 2571, 1866,    0, 1872, 1874, 1877, 1875, 1875,
+     1878, 1866, 1872, 1872, 1874, 1877, 1875, 1879, 1878,    0,
+     1883, 2571,    0, 1877, 1883, 1879, 1878, 1884, 1879,    0,
+     1885, 1884, 1886, 1879, 1885,    0, 1886, 1887,    0, 1890,
+        0, 1887, 1884, 1890,    0,    0,    0, 2578, 1883, 1891,
+     1892, 2578,    0, 1891, 1892, 1884, 1883, 2487, 1885,    0,
+
+     1886, 2487, 1886, 1884, 1883, 1887, 1885, 1890, 1886, 2578,
+        0, 1884, 1885, 1887, 1885, 1890, 1886, 1891, 1892, 2487,
+     1893, 1887, 1890, 1890, 1893, 1891, 1892, 1894, 2578,    0,
+     1892, 1894, 1895, 1891, 1892, 2487, 1895, 1896, 1897,    0,
+     2587, 1896, 1897,    0, 2587,    0,    0, 2618, 1893, 1898,
+     2619, 2618,    0, 1898, 2619, 1894, 1893,    0,    0,    0,
+     1895, 2587, 2587, 1894, 1893, 1896, 1897, 1897, 1895, 2618,
+     1895, 1894, 2619, 1896, 1897, 1896, 1895, 1898,    0, 1907,
+     1911, 1896, 1897, 1907, 1911, 1898, 1898,    0, 1898,    0,
+     1909, 1912, 2468, 1898, 1909, 1912, 2468, 1913,    0, 2701,
+
+     2569, 1913, 1919, 2701, 2569,    0, 1919, 1907, 1911, 1911,
+        0,    0,    0, 2468,    0, 1907, 1911, 1909, 1909, 1912,
+     2701, 2569,    0, 1907, 1911, 1913, 1909, 1912, 1912, 2468,
+     1919, 1919, 1916, 1913, 1909, 1912, 1916, 2569, 1919, 1918,
+     1913, 1913,    0, 1918, 1921,    0, 1919, 2705, 1921, 1916,
+     1916, 2705,    0,    0,    0,    0,    0,    0, 1927,    0,
+     1916, 1918, 1927,    0,    0,    0,    0, 1918, 1916, 2705,
+     1932,    0, 1921, 1925, 1932, 1918, 1916, 1925, 2616,    0,
+     1921, 1918, 2616, 1918,    0, 1918, 1927, 1921, 1921, 2705,
+     1925, 1925, 2729,    0, 1927, 1925, 2729,    0, 1932, 2616,
+
+        0, 1925, 1927,    0,    0, 1932, 1932,    0,    0, 1925,
+        0,    0,    0, 2729, 1932, 2616,    0, 1925, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+     1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928, 1928,
+
+     1928, 1928, 1935,    0, 1937, 1938, 1935, 1939, 1937, 1938,
+        0, 1939, 2722,    0, 2642,    0, 2722,    0, 2642, 1941,
+        0,    0, 2712, 1941, 1940,    0, 2712,    0, 1940,    0,
+     1935,    0, 1937, 1938, 2722, 1939, 2642,    0, 1935, 1937,
+     1937, 1938, 2642, 1939, 2712, 1939, 1935, 1941, 1937, 1938,
+     1945, 1939, 1940, 1940, 1945, 1941,    0, 1946, 1941,    0,
+     1940, 1946, 1948, 1941, 2712,    0, 1948, 2721, 1940, 1950,
+     2753, 2721,    0, 1950, 2753, 1952,    0,    0, 1945, 1952,
+     2765,    0,    0,    0, 2765, 1946, 1945, 2649, 2721, 2721,
+     1948, 2649, 2753, 1946, 1945, 1948, 2761, 1950, 1948, 1946,
+
+     2761, 1946, 2765, 1952,    0, 1950, 1948,    0, 1952, 2649,
+        0, 1952, 1950, 1950,    0, 2649,    0, 2761,    0, 1952,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+     1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954, 1954,
+
+     1954, 1954, 1954, 1954, 1955, 1957, 1958, 2771, 1955, 1957,
+     1958, 2771,    0,    0, 2781, 1960, 2814, 1961, 2781, 1960,
+     2814, 1961,    0,    0, 1963,    0, 1964, 1966, 1963, 2771,
+     1964, 1966, 1955, 1957, 1958, 1958, 2781, 1955, 2814,    0,
+     1955, 1957, 1958, 1960, 1960, 1961, 1961,    0, 1955, 1957,
+     1958, 1960, 1963, 1961, 1964, 1966,    0,    0,    0, 1960,
+     1963, 1961, 1964, 1966, 1966,    0,    0,    0, 1963, 1964,
+     1964, 1966, 1967,    0, 1969, 1970, 1967, 1971, 1969, 1970,
+        0, 1971,    0, 2805, 2818,    0, 1973, 2805, 2818, 1975,
+     1973,    0,    0, 1975, 2825,    0,    0,    0, 2825,    0,
+
+     1967, 1967, 1969, 1970, 2805, 1971, 2818,    0, 1967,    0,
+     1969, 1970, 1969, 1971, 1973, 2825, 1967, 1975, 1969, 1970,
+     1976, 1971, 1973, 1973, 1976, 1975,    0, 1978,    0,    0,
+     1973, 1978, 1975, 1975, 1979,    0,    0, 1980, 1979, 1983,
+     1984, 1980,    0, 1983, 1984, 2846, 1987, 1976, 1976, 2846,
+     1987,    0,    0,    0,    0, 1978, 1976, 2848,    0,    0,
+        0, 2848, 1979, 1978, 1976, 1980, 2846, 1983, 1984, 1984,
+     1979, 1978, 1983, 1980, 1987, 1983, 1984,    0, 1979, 2848,
+        0, 1980, 1987, 1983, 1984, 1986, 1980, 1989,    0, 1986,
+     1987, 1989, 1991,    0, 1994,    0, 1991, 1995, 1994,    0,
+
+        0, 1995,    0,    0,    0, 2849, 1999, 1996,    0, 2849,
+     1999, 1996, 1986, 1986,    0, 1989, 1989,    0,    0,    0,
+     1991, 1986, 1994, 1989,    0, 1995, 2849, 1995, 1991, 1986,
+     1994, 1989, 1996, 1995, 1999, 1996, 1991,    0, 1994,    0,
+     2001, 1995, 1999, 1996, 2001,    0,    0,    0,    0, 2002,
+     1999, 1996, 2003, 2002, 2005,    0, 2003,    0, 2005,    0,
+        0, 2006,    0, 2008,    0, 2006, 2025, 2008, 2001,    0,
+     2025, 2002,    0, 2001,    0, 2027, 2001, 2002,    0, 2027,
+     2003,    0, 2005, 2005, 2001, 2002,    0, 2002, 2003, 2006,
+     2005, 2008,    0, 2002, 2025,    0, 2003, 2006, 2005, 2008,
+
+     2029,    0, 2025, 2027, 2029, 2006,    0, 2008, 2025, 2031,
+     2025, 2027, 2032, 2031,    0,    0, 2032,    0, 2034, 2027,
+     2780,    0, 2034,    0, 2780,    0,    0, 2029, 2029, 2033,
+     2035,    0,    0, 2033, 2035,    0, 2029, 2031,    0, 2036,
+     2032, 2780, 2780, 2036, 2029, 2031, 2034,    0, 2032, 2032,
+     2031, 2033,    0, 2031, 2034, 2035, 2032, 2033, 2035, 2056,
+     2058, 2036, 2034, 2056, 2058, 2033, 2035, 2036,    0,    0,
+     2033,    0, 2060, 2033, 2035, 2036, 2060, 2196, 2063,    0,
+     2036, 2196, 2063, 2036,    0,    0,    0, 2056, 2058,    0,
+     2065,    0,    0,    0, 2065, 2056, 2058, 2067, 2196,    0,
+
+     2060, 2067, 2196, 2056, 2058,    0, 2063, 2068, 2060, 2060,
+     2065, 2068,    0, 2063, 2063,    0, 2060, 2063, 2065, 2077,
+        0, 2196, 2063, 2077, 2063, 2067, 2065, 2068, 2079,    0,
+        0,    0, 2079, 2067, 2065, 2068,    0,    0, 2067,    0,
+     2080, 2067,    0, 2068, 2080, 2068, 2083, 2077, 2811, 2082,
+     2083, 2068, 2811, 2082,    0, 2077, 2079,    0, 2086,    0,
+        0, 2088, 2086, 2077, 2079, 2088,    0, 2080, 2080, 2811,
+     2811, 2083, 2079,    0, 2083,    0, 2080, 2082,    0, 2082,
+     2086,    0, 2083, 2090, 2080, 2082, 2086, 2090,    0, 2088,
+     2083,    0, 2094, 2082, 2086,    0, 2094, 2088,    0,    0,
+
+        0,    0, 2086, 2097, 2100, 2088, 2102, 2097, 2100, 2103,
+     2102, 2090,    0, 2103,    0,    0, 2090,    0, 2105, 2090,
+     2094, 2106, 2105,    0,    0, 2106,    0, 2090, 2094,    0,
+        0, 2097, 2100,    0, 2102, 2094, 2094, 2103, 2103, 2097,
+     2100,    0, 2102,    0, 2097, 2103, 2105, 2097, 2100, 2106,
+     2102, 2109, 2110, 2103, 2105, 2109, 2110, 2106,    0,    0,
+        0, 2105, 2105, 2112, 2111, 2106,    0, 2112, 2111,    0,
+     2115,    0,    0, 2116, 2115,    0,    0, 2116,    0, 2109,
+     2110,    0, 2117,    0,    0, 2110, 2117, 2109, 2110, 2112,
+        0, 2112, 2111,    0, 2109, 2109, 2110, 2111, 2115, 2112,
+
+     2111, 2116,    0,    0,    0,    0, 2115, 2112, 2111, 2116,
+     2117, 2118,    0,    0, 2115, 2118, 2119, 2116, 2117, 2117,
+     2119, 2120,    0,    0,    0, 2120, 2117,    0, 2121,    0,
+        0, 2122, 2121, 2714,    0, 2122,    0, 2714,    0, 2118,
+     2118, 2123, 2124,    0, 2119, 2123, 2124, 2118,    0, 2120,
+     2714, 2714, 2119,    0, 2714, 2118, 2121, 2120, 2120, 2122,
+     2119,    0, 2119, 2121, 2121, 2120, 2123, 2122,    0, 2123,
+     2124, 2122, 2121,    0,    0, 2122, 2135, 2123, 2124, 2137,
+     2135, 2124,    0, 2137,    0, 2123, 2124,    0, 2138,    0,
+     2139, 2142, 2138,    0, 2139, 2142,    0, 2141,    0,    0,
+
+        0, 2141,    0,    0, 2135,    0,    0, 2137,    0,    0,
+     2135,    0, 2135, 2142,    0, 2137, 2138, 2138, 2139, 2142,
+     2135,    0,    0, 2137, 2138, 2141, 2139, 2142,    0, 2142,
+     2141,    0, 2138, 2141, 2139, 2142, 2143,    0, 2145, 2146,
+     2143, 2141, 2145, 2146,    0, 2149,    0,    0, 2155, 2149,
+        0,    0, 2155,    0,    0,    0, 2146, 2146,    0, 2152,
+        0,    0,    0, 2152, 2143, 2156, 2145, 2146,    0, 2156,
+        0,    0, 2143, 2149, 2145, 2146, 2155,    0,    0, 2143,
+     2143, 2149, 2145, 2146, 2155,    0, 2145, 2152,    0, 2149,
+     2157,    0, 2155, 2156, 2157, 2152, 2716, 2152, 2718,    0,
+
+     2716, 2156, 2718, 2152,    0,    0,    0, 2156,    0, 2156,
+        0,    0,    0, 2716, 2716, 2718, 2718, 2716, 2157, 2718,
+        0,    0,    0,    0,    0,    0, 2157,    0,    0,    0,
+        0,    0,    0,    0, 2157,    0, 2157, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158, 2158,
+     2158, 2162, 2163, 2165, 2167, 2162, 2163, 2165, 2167,    0,
+        0,    0,    0, 2169,    0,    0,    0, 2169,    0,    0,
+        0,    0, 2178,    0,    0,    0, 2178,    0, 2165, 2162,
+     2163, 2165, 2167,    0,    0, 2167,    0, 2162, 2163, 2165,
+     2167, 2169,    0, 2163, 2162, 2162, 2163, 2165, 2167, 2169,
+     2178, 2180, 2182, 2178,    0, 2180, 2182, 2169, 2178,    0,
+        0, 2183,    0, 2185,    0, 2183, 2178, 2185,    0,    0,
+        0,    0, 2188, 2187, 2190,    0, 2188, 2187, 2190, 2180,
+
+     2182,    0,    0,    0,    0,    0, 2191, 2180, 2182, 2183,
+     2191, 2185,    0,    0, 2180, 2180, 2182, 2183, 2187, 2185,
+     2188, 2187, 2190,    0, 2183, 2183,    0, 2185, 2188, 2187,
+     2190,    0,    0,    0, 2191, 2188, 2188, 2187, 2190, 2191,
+     2192,    0, 2191, 2193, 2192, 2195,    0, 2193,    0, 2195,
+     2191,    0, 2197,    0, 2199,    0, 2197, 2202, 2199,    0,
+        0, 2202,    0, 2204,    0,    0,    0, 2204, 2192, 2192,
+     2195, 2193,    0, 2195, 2205,    0, 2192,    0, 2205, 2193,
+     2197, 2195, 2199, 2199, 2192, 2202,    0, 2193, 2197, 2195,
+     2199, 2204,    0, 2202,    0,    0, 2197,    0, 2199, 2204,
+
+     2202, 2202, 2205,    0, 2207, 2209, 2204, 2204, 2207, 2209,
+     2205,    0,    0,    0,    0, 2210, 2213, 2205, 2205, 2210,
+     2213,    0, 2215,    0,    0,    0, 2215,    0,    0, 2207,
+        0,    0, 2207, 2209,    0, 2214,    0,    0, 2209, 2214,
+     2207, 2209, 2210, 2210, 2213,    0,    0,    0, 2207, 2209,
+     2215, 2210, 2213,    0,    0,    0,    0, 2214, 2215, 2210,
+     2213, 2217,    0, 2214, 2219, 2217, 2215,    0, 2219,    0,
+        0, 2214,    0, 2221, 2222,    0, 2214, 2221, 2222, 2214,
+        0,    0,    0, 2224, 2223,    0, 2239, 2224, 2223, 2217,
+     2239,    0, 2219,    0,    0,    0,    0, 2217, 2219, 2223,
+
+     2219, 2221, 2222, 2222,    0, 2217, 2221,    0, 2219, 2221,
+     2222, 2224, 2223,    0, 2239,    0,    0, 2221, 2222, 2224,
+     2223, 2225, 2239,    0,    0, 2225,    0, 2224, 2223,    0,
+     2239, 2242,    0, 2244,    0, 2242, 2225, 2244, 2245,    0,
+     2246,    0, 2245,    0, 2246,    0,    0,    0,    0, 2225,
+     2247,    0,    0,    0, 2247,    0,    0, 2225,    0, 2242,
+     2242, 2244,    0, 2245,    0, 2225, 2245, 2242, 2246, 2244,
+        0, 2244,    0,    0, 2245, 2242, 2246, 2244, 2247, 2246,
+        0, 2248, 2245,    0, 2246, 2248, 2247, 2249, 2247,    0,
+        0, 2249, 2257,    0, 2247,    0, 2257,    0,    0, 2259,
+
+        0,    0, 2260, 2259,    0,    0, 2260, 2249,    0, 2248,
+        0,    0, 2263,    0, 2248, 2249, 2263, 2248, 2249,    0,
+     2257,    0,    0, 2249,    0, 2248, 2257, 2259, 2257, 2260,
+     2260, 2249, 2259, 2266,    0, 2259, 2257, 2266, 2260,    0,
+     2263,    0,    0, 2259,    0, 2267, 2260, 2270, 2263, 2267,
+     2273, 2270,    0,    0, 2273,    0, 2263,    0, 2266, 2275,
+     2267, 2266, 2276, 2275,    0,    0, 2276,    0, 2279, 2266,
+        0,    0, 2279, 2267,    0, 2270,    0, 2266, 2273,    0,
+     2270, 2267,    0, 2270,    0,    0, 2273, 2275, 2280, 2267,
+     2276, 2270, 2280, 2273, 2273, 2275, 2279, 2279, 2276,    0,
+
+        0,    0,    0, 2275, 2279, 2276, 2276, 2281,    0,    0,
+     2283, 2281, 2279, 2284, 2283,    0, 2280, 2284,    0,    0,
+        0,    0, 2286,    0, 2280, 2291, 2286,    0,    0, 2291,
+        0,    0, 2280,    0,    0, 2281,    0, 2280, 2283,    0,
+        0, 2284,    0, 2281, 2292,    0, 2283, 2283, 2292, 2284,
+     2286, 2281,    0, 2291, 2283, 2293,    0, 2284, 2286, 2293,
+     2286, 2291,    0,    0,    0,    0, 2286, 2294, 2291, 2291,
+        0, 2294, 2292,    0,    0,    0,    0, 2292,    0,    0,
+     2292, 2295, 2293, 2293,    0, 2295, 2296,    0, 2292,    0,
+     2296, 2293, 2297, 2298,    0, 2294, 2297, 2298, 2299, 2293,
+
+        0, 2296, 2299, 2294, 2294,    0,    0,    0,    0, 2295,
+     2295, 2294, 2300,    0, 2296, 2310, 2300, 2295,    0, 2310,
+     2297, 2298, 2296,    0,    0, 2295, 2299, 2297, 2297, 2298,
+     2296,    0,    0,    0, 2299, 2312, 2297, 2298,    0, 2312,
+     2300, 2300, 2299, 2310,    0, 2313, 2314,    0, 2300, 2313,
+     2314, 2310,    0,    0,    0,    0, 2300, 2316, 2315, 2310,
+     2319, 2316, 2315, 2312, 2319,    0,    0,    0,    0,    0,
+        0, 2312, 2323, 2313, 2314,    0, 2323,    0,    0, 2312,
+     2315, 2313, 2314, 2324,    0, 2316, 2315, 2324, 2319, 2313,
+     2314, 2319,    0, 2316, 2315,    0, 2319,    0,    0, 2315,
+
+     2323, 2316, 2315, 2328, 2319, 2330, 2332, 2328, 2323, 2330,
+     2332, 2324,    0,    0, 2323,    0, 2323, 2337, 2339, 2324,
+     2341, 2337, 2339,    0, 2341,    0,    0, 2324, 2328,    0,
+        0, 2328, 2330, 2330, 2332,    0,    0,    0,    0, 2328,
+     2343, 2330, 2332,    0, 2343, 2337, 2339, 2328, 2341, 2330,
+     2332, 2344,    0, 2337, 2339, 2344, 2341,    0,    0,    0,
+        0, 2337, 2339, 2346, 2341, 2347, 2348, 2346, 2343, 2347,
+     2348,    0,    0,    0,    0,    0, 2343,    0,    0, 2344,
+        0,    0,    0, 2343, 2343,    0,    0, 2344, 2349,    0,
+        0, 2346, 2349, 2347, 2348, 2344,    0,    0,    0, 2346,
+
+     2351, 2347, 2348,    0, 2351,    0,    0, 2346,    0, 2347,
+     2348, 2352,    0, 2349, 2347, 2352, 2349, 2355, 2358,    0,
+        0, 2355, 2358, 2360, 2349,    0,    0, 2360, 2351, 2361,
+        0,    0, 2349, 2361,    0,    0, 2351,    0, 2365, 2352,
+        0,    0, 2365,    0, 2351, 2355, 2358, 2352, 2352,    0,
+        0, 2360, 2363, 2355, 2358, 2352, 2363, 2361,    0, 2360,
+        0, 2355, 2358,    0, 2366, 2361, 2365, 2360, 2366,    0,
+        0,    0,    0, 2361, 2365, 2365,    0, 2369,    0, 2363,
+     2363, 2369, 2365,    0,    0,    0, 2371, 2370, 2363, 2373,
+     2371, 2370, 2366, 2373,    0,    0, 2363,    0, 2366, 2374,
+
+     2366,    0,    0, 2374,    0, 2369, 2369,    0, 2366, 2370,
+        0,    0, 2375, 2369, 2371, 2370, 2375, 2373,    0,    0,
+        0, 2369, 2371, 2370, 2376, 2373,    0, 2374, 2376,    0,
+     2371, 2370,    0, 2373, 2375, 2374, 2373, 2387, 2389,    0,
+     2375, 2387, 2389, 2374,    0,    0, 2376, 2390, 2375, 2391,
+     2393, 2390, 2376, 2391, 2393,    0, 2375,    0, 2375, 2392,
+     2376,    0,    0, 2392,    0, 2387, 2389,    0, 2376,    0,
+     2376,    0,    0, 2387, 2389, 2390,    0, 2391, 2393,    0,
+     2390, 2387, 2389, 2390, 2389, 2391, 2393, 2392, 2391,    0,
+        0, 2390, 2394, 2391, 2393, 2392, 2394, 2393, 2398,    0,
+
+     2392, 2400, 2398, 2392, 2404, 2400,    0, 2401, 2404,    0,
+        0, 2401, 2394,    0,    0,    0,    0,    0, 2405, 2406,
+     2394, 2408, 2405, 2406,    0, 2408, 2398,    0, 2394, 2400,
+        0,    0, 2404,    0, 2398, 2401, 2394, 2400, 2400, 2404,
+     2404, 2401, 2398, 2401, 2406, 2400, 2405, 2406, 2404, 2408,
+        0, 2401, 2410,    0, 2405, 2406, 2410, 2408,    0,    0,
+     2405,    0, 2405, 2406, 2412, 2408, 2413,    0, 2412, 2414,
+     2413, 2415,    0, 2414,    0, 2415,    0,    0,    0,    0,
+     2410,    0,    0,    0,    0,    0, 2419,    0, 2410, 2418,
+     2419,    0, 2412, 2418, 2413, 2413, 2410, 2414, 2414, 2415,
+
+     2412,    0, 2413,    0,    0, 2414, 2415, 2415, 2412,    0,
+     2413, 2412, 2420, 2414, 2419, 2415, 2420, 2418, 2418,    0,
+        0,    0, 2419, 2421, 2422, 2418,    0, 2421, 2422,    0,
+     2419, 2419,    0, 2418, 2423,    0,    0,    0, 2423,    0,
+     2420,    0,    0,    0,    0, 2424,    0,    0, 2420, 2424,
+        0, 2421, 2422,    0, 2425, 2420, 2420, 2436, 2425, 2421,
+     2422, 2436, 2423,    0,    0, 2422, 2421, 2421, 2422,    0,
+     2423, 2423, 2426, 2424, 2424, 2438, 2426,    0, 2423, 2438,
+     2425, 2424, 2425,    0, 2439, 2436,    0, 2436, 2439, 2424,
+     2425,    0,    0, 2436,    0, 2441,    0,    0, 2425, 2441,
+
+     2426, 2436,    0, 2438, 2438, 2442, 2439,    0, 2426, 2442,
+     2446, 2438, 2439, 2426, 2446,    0, 2426, 2447,    0, 2438,
+     2439, 2447, 2449, 2441,    0,    0, 2449,    0, 2439,    0,
+        0, 2441, 2452, 2442,    0,    0, 2452, 2446, 2446, 2441,
+        0, 2442,    0,    0, 2454, 2447, 2446, 2449, 2454, 2442,
+     2449, 2447,    0, 2447, 2446, 2455,    0, 2452, 2449, 2455,
+     2452, 2447,    0,    0,    0, 2456, 2449, 2457, 2452, 2456,
+     2459, 2457, 2454, 2454, 2459,    0, 2452,    0,    0,    0,
+     2454,    0, 2455, 2455,    0,    0,    0,    0, 2454,    0,
+        0, 2455, 2461, 2456, 2456, 2457, 2461, 2457, 2459, 2455,
+
+        0, 2456,    0, 2457, 2462,    0, 2459,    0, 2462, 2456,
+        0, 2457,    0, 2459, 2459, 2467,    0, 2469, 2461, 2467,
+     2461, 2469, 2472,    0,    0,    0, 2472, 2474, 2461, 2462,
+        0, 2474, 2462,    0, 2475,    0, 2461, 2478, 2475,    0,
+     2462, 2478,    0, 2467,    0, 2469,    0,    0, 2462,    0,
+     2472, 2467, 2467, 2469, 2472, 2474, 2474,    0, 2472, 2467,
+     2479, 2469, 2475, 2474, 2479, 2478, 2472,    0,    0,    0,
+     2475, 2474, 2480, 2478,    0, 2488, 2480,    0, 2475, 2488,
+        0, 2478, 2479,    0,    0, 2490,    0, 2491, 2479, 2490,
+        0, 2491,    0,    0, 2493,    0, 2479, 2492, 2493,    0,
+
+     2480, 2492, 2479, 2488, 2479,    0, 2497,    0, 2480,    0,
+     2497, 2488,    0, 2490, 2490, 2491, 2480,    0,    0, 2488,
+     2501, 2490, 2493, 2491, 2501, 2492, 2492,    0, 2491, 2490,
+     2493, 2491, 2498, 2492, 2497, 2497, 2498,    0, 2493, 2502,
+        0, 2492, 2497, 2502,    0, 2503,    0,    0, 2501, 2503,
+     2497, 2505,    0, 2501, 2498, 2505, 2501, 2508, 2509,    0,
+     2498, 2508, 2509,    0, 2501,    0,    0, 2502, 2498,    0,
+     2510, 2503,    0, 2503, 2510, 2502, 2498,    0,    0, 2505,
+     2511, 2503, 2502, 2502, 2511, 2508, 2509, 2505,    0, 2503,
+        0,    0, 2514, 2508, 2509, 2505, 2514,    0, 2510, 2516,
+
+     2508, 2508, 2509, 2516,    0, 2515, 2510,    0, 2511, 2515,
+        0, 2517,    0,    0, 2510, 2517, 2511, 2519,    0,    0,
+     2514, 2519, 2518,    0, 2511,    0, 2518, 2516, 2514,    0,
+     2515,    0, 2516, 2515, 2520, 2516, 2514, 2518, 2520, 2517,
+        0, 2515,    0, 2516, 2517, 2519,    0, 2517, 2521, 2515,
+     2518,    0, 2521, 2519,    0, 2517,    0,    0, 2518, 2522,
+     2533, 2519, 2520, 2522, 2533, 2531, 2518,    0,    0, 2531,
+     2520, 2520,    0,    0, 2522,    0, 2521,    0, 2520,    0,
+        0, 2521,    0,    0, 2521, 2534, 2536, 2522, 2533, 2534,
+     2536,    0, 2521, 2531,    0, 2522, 2533,    0, 2539,    0,
+
+     2531, 2531, 2539, 2522, 2533,    0,    0, 2534, 2540, 2531,
+        0, 2542, 2540, 2534, 2536, 2542,    0,    0,    0,    0,
+     2544, 2534, 2536,    0, 2544, 2536, 2539, 2534,    0, 2534,
+     2536, 2546, 2539, 2547, 2539, 2546, 2540, 2547,    0, 2542,
+        0,    0, 2539,    0, 2540, 2548,    0, 2542, 2544, 2548,
+     2549,    0, 2540,    0, 2549, 2542, 2544,    0,    0, 2546,
+        0, 2547, 2551,    0, 2544,    0, 2551, 2546, 2553, 2547,
+        0,    0, 2553, 2548,    0, 2546, 2547, 2547, 2549, 2554,
+     2559, 2548,    0, 2554, 2559, 2549, 2549,    0,    0, 2548,
+     2551, 2563,    0, 2561, 2549, 2563, 2553, 2561, 2551,    0,
+
+        0, 2553,    0, 2551, 2553,    0, 2551, 2554, 2559, 2559,
+     2564,    0, 2553, 2568, 2564, 2554, 2559, 2568,    0, 2563,
+        0, 2561,    0, 2554, 2559,    0, 2561, 2563, 2579, 2561,
+     2570,    0, 2579,    0, 2570, 2563,    0, 2561, 2564, 2580,
+     2582, 2568,    0, 2580, 2582,    0, 2564,    0,    0, 2568,
+     2568, 2581, 2570,    0, 2564, 2581, 2579, 2568, 2570,    0,
+        0, 2585,    0,    0, 2579, 2585, 2570, 2580, 2582, 2579,
+        0,    0, 2579,    0, 2570, 2580, 2582,    0,    0, 2581,
+        0, 2580, 2582, 2580, 2582,    0, 2586, 2581,    0, 2585,
+     2586,    0, 2581,    0,    0, 2581, 2590, 2585, 2591, 2594,
+
+     2590,    0, 2591, 2594,    0, 2585,    0,    0, 2586,    0,
+        0,    0,    0, 2592, 2586,    0, 2595, 2592,    0, 2594,
+     2595,    0, 2586,    0, 2590,    0, 2591, 2594,    0,    0,
+     2586,    0, 2590, 2597, 2591, 2594,    0, 2597,    0, 2591,
+     2590, 2592, 2591, 2594, 2595, 2590, 2598,    0, 2592, 2592,
+     2598, 2599, 2595,    0,    0, 2599,    0, 2592,    0,    0,
+     2595, 2597,    0, 2600,    0,    0,    0, 2600, 2597, 2597,
+        0,    0,    0,    0, 2598,    0, 2601, 2597,    0, 2599,
+     2601, 2602, 2598,    0, 2598, 2602,    0, 2599,    0,    0,
+     2598, 2600,    0,    0, 2599, 2599,    0,    0, 2603, 2600,
+
+        0,    0, 2603,    0, 2601,    0,    0, 2600,    0, 2602,
+     2604, 2601, 2601,    0, 2604, 2613,    0, 2602,    0, 2613,
+     2601,    0,    0,    0, 2602, 2602, 2603, 2615,    0, 2603,
+        0, 2615,    0,    0, 2603,    0,    0, 2620, 2604,    0,
+     2613, 2620, 2603, 2613, 2617,    0, 2604,    0, 2617, 2622,
+        0, 2613,    0, 2622, 2604, 2615, 2623,    0, 2624, 2613,
+     2623,    0, 2624, 2615, 2615, 2620, 2617,    0,    0,    0,
+     2626, 2615, 2617, 2620, 2626,    0, 2620, 2622,    0,    0,
+     2617, 2620,    0, 2624, 2623, 2622, 2624, 2628, 2617,    0,
+        0, 2628, 2623, 2622, 2624,    0,    0,    0, 2626,    0,
+
+     2623, 2629, 2624, 2626, 2634, 2629, 2626, 2636, 2634,    0,
+        0, 2636,    0, 2638, 2626, 2628,    0, 2638, 2628,    0,
+        0,    0, 2650, 2628, 2640,    0, 2650, 2629, 2640, 2629,
+        0, 2628, 2634,    0, 2651, 2636,    0, 2629, 2651,    0,
+     2634, 2638,    0, 2636, 2636, 2629,    0, 2634, 2634, 2638,
+     2650, 2636, 2640, 2640,    0, 2652,    0, 2638, 2650, 2652,
+     2640, 2653, 2651,    0,    0, 2653, 2650, 2655, 2640,    0,
+     2651, 2655, 2657,    0,    0,    0, 2657,    0, 2651,    0,
+        0, 2658, 2661, 2652, 2659, 2658, 2661,    0, 2659, 2653,
+        0, 2652,    0,    0, 2663, 2655,    0, 2653, 2663, 2652,
+
+     2657, 2657, 2661, 2655,    0, 2653,    0,    0, 2657, 2658,
+     2661, 2655, 2659, 2659, 2658, 2664, 2657, 2658, 2661, 2664,
+     2659,    0, 2663,    0,    0, 2658, 2661, 2665, 2659, 2666,
+     2663, 2665, 2667, 2666,    0,    0, 2667,    0, 2663,    0,
+        0,    0,    0, 2664, 2664,    0, 2668,    0,    0,    0,
+     2668, 2664, 2669,    0,    0, 2665, 2669, 2666, 2670, 2664,
+     2667,    0, 2670, 2665, 2665, 2666,    0,    0, 2667, 2667,
+        0, 2665,    0, 2666, 2668, 2671, 2667, 2666,    0, 2671,
+     2669, 2668, 2668,    0,    0, 2669, 2670, 2680, 2669,    0,
+     2668, 2680,    0, 2682, 2670,    0, 2669, 2682,    0,    0,
+
+        0,    0, 2670, 2671, 2684,    0, 2686,    0, 2684,    0,
+     2686, 2671, 2671, 2688,    0, 2680,    0, 2688, 2680, 2671,
+        0, 2682, 2682, 2680, 2690,    0, 2692,    0, 2690, 2682,
+     2692, 2680, 2684, 2684, 2686,    0,    0, 2682,    0, 2693,
+     2684, 2688, 2686, 2693, 2688,    0,    0,    0, 2684, 2688,
+     2686, 2696, 2690,    0, 2692, 2696,    0, 2688,    0,    0,
+     2690, 2698, 2692,    0,    0, 2698,    0, 2693, 2690,    0,
+     2692, 2690, 2693, 2700, 2713, 2693, 2703, 2700, 2713, 2696,
+     2703,    0,    0, 2693,    0,    0,    0, 2696,    0, 2698,
+     2698, 2713, 2713,    0, 2720, 2696, 2715, 2698, 2720, 2723,
+
+     2715, 2700, 2713, 2723, 2703, 2698,    0,    0,    0, 2700,
+     2713, 2717, 2703, 2715, 2715, 2717, 2720, 2700, 2713, 2703,
+     2703, 2724, 2720,    0, 2715, 2724,    0, 2723, 2717, 2717,
+     2720,    0, 2715, 2725,    0, 2723,    0, 2725, 2720, 2717,
+     2715,    0, 2728, 2723, 2730,    0, 2728, 2717, 2730, 2724,
+        0,    0,    0,    0,    0, 2717,    0, 2724, 2724, 2731,
+        0, 2725,    0, 2731, 2732, 2724,    0,    0, 2732, 2725,
+     2728,    0, 2730,    0,    0, 2725,    0, 2725, 2728, 2733,
+     2730, 2730,    0, 2733, 2731,    0, 2728, 2731, 2730, 2734,
+        0,    0, 2732, 2734,    0, 2731,    0, 2732, 2735,    0,
+
+     2732, 2744, 2735, 2731, 2733, 2744,    0, 2733, 2732,    0,
+     2746,    0,    0,    0, 2746, 2733, 2744, 2734,    0,    0,
+     2748,    0,    0, 2733, 2748, 2734, 2735, 2734,    0, 2744,
+        0, 2735, 2750, 2734, 2735,    0, 2750, 2744, 2746,    0,
+        0,    0, 2735,    0,    0, 2744, 2746,    0, 2748,    0,
+        0,    0,    0, 2746, 2746,    0, 2748,    0,    0,    0,
+     2750, 2748,    0,    0, 2748,    0,    0,    0, 2750,    0,
+        0,    0,    0,    0, 2750,    0, 2750, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752, 2752,
+     2752, 2754, 2755,    0, 2758, 2754, 2755, 2760, 2758,    0,
+        0, 2760,    0, 2763,    0,    0,    0, 2763,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0, 2754,
+     2755,    0, 2758, 2755,    0, 2760,    0, 2754, 2755, 2754,
+
+     2758, 2763,    0, 2760,    0, 2754, 2755,    0, 2758, 2763,
+     2772, 2760, 2774,    0, 2772, 2776, 2774, 2763,    0, 2776,
+        0, 2782, 2779,    0,    0, 2782, 2779, 2772, 2772, 2774,
+     2774,    0, 2776, 2776,    0, 2783,    0,    0, 2772, 2783,
+     2774, 2786,    0, 2776, 2779, 2786, 2772,    0, 2774, 2782,
+     2779, 2776, 2782,    0, 2772,    0, 2774, 2782, 2779, 2776,
+     2787,    0,    0, 2783, 2787, 2782, 2779,    0,    0, 2786,
+     2788, 2783, 2789,    0, 2788,    0, 2789, 2786,    0, 2783,
+        0,    0, 2790, 2791, 2786, 2786, 2790, 2791, 2787, 2798,
+        0,    0,    0, 2798,    0, 2787, 2787,    0, 2788,    0,
+
+     2789, 2800,    0,    0, 2787, 2800, 2788, 2789, 2789,    0,
+     2790, 2791,    0,    0, 2788, 2788, 2789, 2798, 2790, 2791,
+     2802,    0,    0,    0, 2802, 2798, 2790, 2791, 2791, 2800,
+     2804, 2806, 2809, 2798, 2804, 2806, 2809, 2800,    0,    0,
+        0,    0, 2820, 2821,    0, 2800, 2820, 2821, 2802, 2824,
+        0,    0,    0, 2824,    0,    0, 2802,    0, 2804, 2806,
+     2809,    0,    0,    0, 2802,    0, 2804, 2806, 2809, 2833,
+     2820, 2821,    0, 2833, 2804, 2806, 2809, 2824, 2820, 2821,
+        0,    0,    0,    0, 2833, 2824, 2820, 2821, 2834,    0,
+        0, 2835, 2834, 2824, 2836, 2835,    0, 2833, 2836,    0,
+
+        0,    0,    0, 2843,    0, 2833, 2845, 2843,    0,    0,
+     2845,    0,    0, 2833,    0,    0, 2834, 2834,    0, 2835,
+        0, 2851, 2836, 2836, 2834, 2851,    0, 2835,    0,    0,
+     2836, 2843, 2834, 2835, 2845, 2835, 2843,    0, 2836, 2843,
+     2852, 2859, 2845,    0, 2852, 2859,    0, 2843,    0, 2851,
+     2845, 2860, 2861,    0,    0, 2860, 2861, 2851,    0,    0,
+        0,    0, 2867, 2851,    0, 2851, 2867,    0, 2852, 2859,
+        0,    0,    0,    0,    0,    0, 2852, 2859, 2852, 2860,
+     2861,    0, 2865, 2859, 2852, 2859, 2865, 2860, 2861, 2871,
+     2867,    0, 2860, 2871, 2861, 2860, 2861,    0, 2867, 2872,
+
+        0,    0,    0, 2872, 2873,    0, 2867, 2865, 2873, 2876,
+     2865,    0,    0, 2876,    0,    0, 2878, 2871, 2865, 2882,
+     2878,    0, 2871, 2882,    0, 2871, 2865, 2872,    0, 2873,
+        0,    0, 2873, 2871, 2883, 2872, 2876, 2876, 2883,    0,
+     2873, 2872,    0, 2872, 2878, 2876, 2884, 2882, 2873,    0,
+     2884,    0, 2878, 2876,    0, 2882,    0, 2887, 2878, 2883,
+     2878, 2887, 2883, 2882,    0,    0,    0, 2891, 2882, 2892,
+     2883, 2891,    0, 2892, 2884,    0,    0,    0, 2883, 2895,
+        0, 2884, 2884, 2895,    0, 2887,    0,    0, 2900,    0,
+     2884,    0, 2900, 2887,    0, 2891, 2891, 2892, 2887,    0,
+
+        0, 2887, 2903, 2891, 2892, 2892, 2903, 2895,    0,    0,
+        0, 2891, 2895, 2892, 2906, 2895, 2900, 2909, 2906,    0,
+        0, 2909,    0, 2895, 2900,    0,    0,    0,    0,    0,
+     2903, 2900, 2900,    0,    0, 2903,    0,    0, 2903,    0,
+        0, 2906, 2906,    0,    0, 2909, 2903,    0,    0,    0,
+     2906,    0,    0, 2909,    0,    0,    0,    0, 2906, 2909,
+        0, 2909, 2913, 2913, 2913, 2913, 2913, 2913, 2913, 2913,
+     2913, 2913, 2913, 2913, 2913, 2914, 2914, 2914, 2914, 2914,
+     2914, 2914, 2914, 2914, 2914, 2914, 2914, 2914, 2915, 2915,
+     2915, 2915, 2915, 2915, 2915, 2915, 2915, 2915, 2915, 2915,
+
+     2915, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916, 2916,
+     2916, 2916, 2916, 2916, 2917, 2917, 2917, 2917, 2917, 2917,
+     2917, 2917, 2917, 2917, 2917, 2917, 2917, 2918, 2918, 2918,
+     2918, 2918, 2918, 2918, 2918, 2918, 2918, 2918, 2918, 2918,
+     2919, 2919, 2919, 2919, 2919, 2919, 2919, 2919, 2919, 2919,
+     2919, 2919, 2919, 2920, 2920, 2920, 2920, 2920, 2920, 2920,
+     2920, 2920, 2920, 2920, 2920, 2920, 2921, 2921, 2921, 2921,
+     2921, 2921, 2921, 2921, 2921, 2921, 2921, 2921, 2921, 2922,
+     2922, 2922, 2922, 2922, 2922, 2922, 2922, 2922, 2922, 2922,
+     2922, 2922, 2923, 2923, 2923, 2923, 2923, 2923, 2923, 2923,
+
+     2923, 2923, 2923, 2923, 2923, 2924, 2924, 2924, 2924, 2924,
+     2924, 2924, 2924, 2924, 2924, 2924, 2924, 2924, 2925, 2925,
+     2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925,
+     2925, 2926, 2926,    0, 2926, 2926, 2926, 2926, 2926, 2926,
+     2926, 2926, 2926, 2926, 2927, 2927, 2927, 2927, 2927,    0,
+     2927, 2927, 2927, 2927, 2928, 2928,    0, 2928, 2928, 2928,
+     2928, 2928, 2928, 2928, 2928, 2928, 2928, 2929, 2929,    0,
+     2929, 2929, 2929, 2929, 2929, 2929, 2929, 2929, 2929, 2929,
+     2930, 2930, 2930, 2930, 2930, 2930, 2930, 2930, 2930, 2930,
+     2931, 2931,    0, 2931, 2931, 2931, 2931, 2931, 2931, 2931,
+
+     2931, 2931, 2931, 2932, 2932,    0, 2932, 2932, 2932, 2932,
+     2932, 2932, 2932, 2932, 2932, 2932, 2933, 2933,    0, 2933,
+     2933, 2933, 2933, 2933, 2933, 2933, 2933, 2933, 2933, 2934,
+        0, 2934, 2934,    0, 2934, 2934, 2934, 2934, 2934, 2934,
+     2934, 2934, 2935, 2935,    0,    0, 2935, 2935, 2935, 2935,
+     2935, 2935, 2936, 2936,    0, 2936, 2936, 2936, 2936, 2936,
+     2936, 2936, 2936, 2936, 2936, 2937, 2937,    0, 2937, 2937,
+     2937, 2937, 2937, 2937, 2937, 2937, 2937, 2937, 2938, 2938,
+        0,    0, 2938, 2938, 2938, 2938, 2938, 2938, 2939, 2939,
+        0, 2939, 2939, 2939, 2939, 2939, 2939, 2939, 2939, 2939,
+
+     2939, 2940, 2940,    0, 2940, 2940, 2940, 2940, 2940, 2940,
+     2940, 2940, 2940, 2940, 2941, 2941, 2941, 2941, 2941, 2941,
+     2941, 2941,    0, 2941, 2941, 2941, 2941, 2942, 2942,    0,
+        0, 2942, 2942, 2942, 2942, 2942, 2942, 2943, 2943, 2943,
+     2943, 2943, 2943, 2943, 2943, 2943, 2943, 2943, 2943, 2943,
+     2944, 2944, 2944, 2944, 2944, 2944, 2944, 2944, 2944, 2944,
+     2944, 2944, 2944, 2945, 2945,    0,    0, 2945, 2945, 2945,
+     2945, 2945, 2945, 2946, 2946,    0, 2946, 2946, 2946, 2946,
+     2946, 2946, 2946, 2946, 2946, 2946, 2947, 2947,    0, 2947,
+     2947, 2947, 2947, 2947, 2947, 2947, 2947, 2947, 2947, 2948,
+
+     2948,    0,    0, 2948, 2948, 2948, 2948, 2948, 2948, 2949,
+     2949,    0, 2949, 2949, 2949, 2949, 2949, 2949, 2949, 2949,
+     2949, 2949, 2950, 2950,    0, 2950, 2950, 2950, 2950, 2950,
+     2950, 2950, 2950, 2950, 2950, 2951, 2951,    0,    0, 2951,
+     2951, 2951, 2951, 2951, 2951, 2952, 2952,    0, 2952, 2952,
+     2952, 2952, 2952, 2952, 2952, 2952, 2952, 2952, 2953, 2953,
+        0, 2953, 2953, 2953, 2953, 2953, 2953, 2953, 2953, 2953,
+     2953, 2954, 2954,    0,    0, 2954, 2954, 2954, 2954, 2954,
+     2954, 2955, 2955,    0, 2955, 2955, 2955, 2955, 2955, 2955,
+     2955, 2955, 2955, 2955, 2956, 2956,    0, 2956, 2956, 2956,
+
+     2956, 2956, 2956, 2956, 2956, 2956, 2956, 2957, 2957,    0,
+        0, 2957, 2957, 2957, 2957, 2957, 2957, 2958, 2958,    0,
+     2958, 2958, 2958, 2958, 2958, 2958, 2958, 2958, 2958, 2958,
+     2959, 2959,    0, 2959, 2959, 2959, 2959, 2959, 2959, 2959,
+     2959, 2959, 2959, 2960, 2960,    0,    0, 2960, 2960, 2960,
+     2960, 2960, 2960, 2961, 2961,    0, 2961, 2961, 2961, 2961,
+     2961, 2961, 2961, 2961, 2961, 2961, 2962, 2962,    0, 2962,
+     2962, 2962, 2962, 2962, 2962, 2962, 2962, 2962, 2962, 2963,
+     2963,    0,    0, 2963, 2963, 2963, 2963, 2963, 2963, 2964,
+     2964,    0, 2964, 2964, 2964, 2964, 2964, 2964, 2964, 2964,
+
+     2964, 2964, 2965, 2965,    0, 2965, 2965, 2965, 2965, 2965,
+     2965, 2965, 2965, 2965, 2965, 2966, 2966,    0,    0, 2966,
+     2966, 2966, 2966, 2966, 2966, 2967, 2967,    0, 2967, 2967,
+     2967, 2967, 2967, 2967, 2967, 2967, 2967, 2967, 2968, 2968,
+        0, 2968, 2968, 2968, 2968, 2968, 2968, 2968, 2968, 2968,
+     2968, 2969, 2969,    0,    0, 2969, 2969, 2969, 2969, 2969,
+     2969, 2970, 2970,    0, 2970, 2970, 2970, 2970, 2970, 2970,
+     2970, 2970, 2970, 2970, 2971, 2971,    0, 2971, 2971, 2971,
+     2971, 2971, 2971, 2971, 2971, 2971, 2971, 2972, 2972,    0,
+        0, 2972, 2972, 2972, 2972, 2972, 2972, 2973, 2973,    0,
+
+     2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973, 2973,
+     2974, 2974,    0, 2974, 2974, 2974, 2974, 2974, 2974, 2974,
+     2974, 2974, 2974, 2975, 2975,    0,    0, 2975, 2975, 2975,
+     2975, 2975, 2975, 2976, 2976,    0, 2976, 2976, 2976, 2976,
+     2976, 2976, 2976, 2976, 2976, 2976, 2977, 2977,    0, 2977,
+     2977, 2977, 2977, 2977, 2977, 2977, 2977, 2977, 2977, 2978,
+     2978, 2978, 2978,    0, 2978, 2978, 2978, 2978, 2978, 2978,
+     2978, 2978, 2979, 2979,    0, 2979,    0, 2979, 2979, 2979,
+     2979, 2979, 2979, 2979, 2979, 2980, 2980,    0,    0, 2980,
+     2980, 2980, 2980, 2980, 2980, 2981, 2981,    0, 2981, 2981,
+
+     2981, 2981, 2981, 2981, 2981, 2981, 2981, 2981, 2982, 2982,
+        0, 2982, 2982, 2982, 2982, 2982, 2982, 2982, 2982, 2982,
+     2982, 2983, 2983,    0,    0, 2983, 2983, 2983, 2983, 2983,
+     2983, 2984, 2984,    0, 2984, 2984, 2984, 2984, 2984, 2984,
+     2984, 2984, 2984, 2984, 2985, 2985,    0, 2985, 2985, 2985,
+     2985, 2985, 2985, 2985, 2985, 2985, 2985, 2986, 2986,    0,
+        0, 2986, 2986, 2986, 2986, 2986, 2986, 2987, 2987,    0,
+     2987, 2987, 2987, 2987, 2987, 2987, 2987, 2987, 2987, 2987,
+     2988, 2988,    0, 2988, 2988, 2988, 2988, 2988, 2988, 2988,
+     2988, 2988, 2988, 2989, 2989,    0,    0, 2989, 2989, 2989,
+
+     2989, 2989, 2989, 2990, 2990,    0, 2990, 2990, 2990, 2990,
+     2990, 2990, 2990, 2990, 2990, 2990, 2991, 2991,    0, 2991,
+     2991, 2991, 2991, 2991, 2991, 2991, 2991, 2991, 2991, 2992,
+     2992, 2992, 2992, 2992, 2992,    0, 2992, 2992, 2992, 2992,
+     2992, 2992, 2993, 2993,    0,    0, 2993, 2993, 2993, 2993,
+     2993, 2993, 2994, 2994,    0, 2994, 2994, 2994, 2994, 2994,
+     2994, 2994, 2994, 2994, 2994, 2995, 2995,    0, 2995, 2995,
+     2995, 2995, 2995, 2995, 2995, 2995, 2995, 2995, 2996, 2996,
+        0,    0, 2996, 2996, 2996, 2996, 2996, 2996, 2997, 2997,
+        0, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997, 2997,
+
+     2997, 2998, 2998,    0, 2998, 2998, 2998, 2998, 2998, 2998,
+     2998, 2998, 2998, 2998, 2999, 2999,    0,    0, 2999, 2999,
+     2999, 2999, 2999, 2999, 3000, 3000,    0, 3000, 3000, 3000,
+     3000, 3000, 3000, 3000, 3000, 3000, 3000, 3001, 3001,    0,
+     3001, 3001, 3001, 3001, 3001, 3001, 3001, 3001, 3001, 3001,
+     3002, 3002,    0,    0, 3002, 3002, 3002, 3002, 3002, 3002,
+     3003, 3003,    0, 3003, 3003, 3003, 3003, 3003, 3003, 3003,
+     3003, 3003, 3003, 3004, 3004,    0, 3004, 3004, 3004, 3004,
+     3004, 3004, 3004, 3004, 3004, 3004, 3005, 3005, 3005, 3005,
+     3005, 3005, 3005, 3005, 3005, 3005, 3005, 3005, 3005, 3006,
+
+     3006, 3006, 3006, 3006, 3006,    0, 3006, 3006, 3006, 3006,
+     3006, 3006, 3007, 3007, 3007, 3007, 3007, 3007, 3007, 3007,
+     3007, 3007, 3009, 3009, 3009, 3009, 3009, 3009, 3009, 3009,
+     3009,    0, 3009, 3009, 3009, 3010, 3010,    0, 3010, 3010,
+     3010, 3010, 3010, 3010, 3010, 3010, 3010, 3010, 3011, 3011,
+        0, 3011, 3011, 3011, 3011, 3011, 3011, 3011, 3011, 3011,
+     3011, 3012, 3012, 3012, 3012, 3012, 3012, 3012, 3012, 3012,
+     3012, 3012,    0, 3012, 3013, 3013,    0, 3013, 3013, 3013,
+     3013, 3013, 3013, 3013, 3013, 3013, 3013, 3014, 3014,    0,
+     3014, 3014, 3014, 3014, 3014, 3014, 3014, 3014, 3014, 3014,
+
+     3015, 3015,    0,    0, 3015, 3015, 3015, 3015, 3015, 3015,
+     3016, 3016,    0, 3016, 3016, 3016, 3016, 3016, 3016, 3016,
+     3016, 3016, 3016, 3017, 3017,    0, 3017, 3017, 3017, 3017,
+     3017, 3017, 3017, 3017, 3017, 3017, 3018, 3018,    0,    0,
+     3018, 3018, 3018, 3018, 3018, 3018, 3019, 3019,    0, 3019,
+     3019, 3019, 3019, 3019, 3019, 3019, 3019, 3019, 3019, 3020,
+     3020,    0, 3020, 3020, 3020, 3020, 3020, 3020, 3020, 3020,
+     3020, 3020, 3021, 3021,    0,    0, 3021, 3021, 3021, 3021,
      3021, 3021, 3022, 3022,    0, 3022, 3022, 3022, 3022, 3022,
-     3022, 3022, 3022, 3022, 3022, 3023,    0, 3023, 3023,    0,
+     3022, 3022, 3022, 3022, 3022, 3023, 3023,    0, 3023, 3023,
+
      3023, 3023, 3023, 3023, 3023, 3023, 3023, 3023, 3024, 3024,
         0,    0, 3024, 3024, 3024, 3024, 3024, 3024, 3025, 3025,
         0, 3025, 3025, 3025, 3025, 3025, 3025, 3025, 3025, 3025,
      3025, 3026, 3026,    0, 3026, 3026, 3026, 3026, 3026, 3026,
-     3026, 3026, 3026, 3026, 3027, 3027,    0, 3027, 3027, 3027,
-     3027, 3027, 3027, 3027, 3027, 3027, 3027, 3028, 3028,    0,
-        0, 3028, 3028, 3028, 3028, 3028, 3028, 3029, 3029,    0,
-     3029, 3029, 3029, 3029, 3029, 3029, 3029, 3029, 3029, 3029,
-
+     3026, 3026, 3026, 3026, 3027,    0, 3027, 3027,    0, 3027,
+     3027, 3027, 3027, 3027, 3027, 3027, 3027, 3028,    0, 3028,
+     3028,    0, 3028, 3028, 3028,    0, 3028, 3028, 3028, 3028,
+     3029, 3029,    0,    0, 3029, 3029, 3029, 3029, 3029, 3029,
      3030, 3030,    0, 3030, 3030, 3030, 3030, 3030, 3030, 3030,
      3030, 3030, 3030, 3031, 3031,    0, 3031, 3031, 3031, 3031,
-     3031, 3031, 3031, 3031, 3031, 3031, 3032, 3032, 3032, 3032,
-     3032, 3032, 3032, 3032,    0, 3032, 3032, 3032, 3032, 3033,
+
+     3031, 3031, 3031, 3031, 3031, 3031, 3032,    0, 3032, 3032,
+        0, 3032, 3032, 3032, 3032, 3032, 3032, 3032, 3032, 3033,
      3033,    0,    0, 3033, 3033, 3033, 3033, 3033, 3033, 3034,
-     3034, 3034, 3034, 3034, 3034, 3034, 3034, 3034, 3034, 3034,
-     3034, 3034, 3035, 3035, 3035, 3035, 3035, 3035, 3035, 3035,
-     3035, 3035, 3035, 3035, 3035, 3036, 3036,    0, 3036, 3036,
+     3034,    0, 3034, 3034, 3034, 3034, 3034, 3034, 3034, 3034,
+     3034, 3034, 3035, 3035,    0, 3035, 3035, 3035, 3035, 3035,
+     3035, 3035, 3035, 3035, 3035, 3036,    0, 3036, 3036,    0,
      3036, 3036, 3036, 3036, 3036, 3036, 3036, 3036, 3037, 3037,
-        0, 3037, 3037, 3037, 3037, 3037, 3037, 3037, 3037, 3037,
-
-     3037, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038,
-     3038, 3038, 3038, 3038, 3039, 3039,    0, 3039, 3039, 3039,
-     3039, 3039, 3039, 3039, 3039, 3039, 3039, 3040, 3040,    0,
-        0, 3040, 3040, 3040, 3040, 3040, 3040, 3041, 3041,    0,
-     3041, 3041, 3041, 3041, 3041, 3041, 3041, 3041, 3041, 3041,
-     3042, 3042,    0, 3042, 3042, 3042, 3042, 3042, 3042, 3042,
-     3042, 3042, 3042, 3043, 3043,    0, 3043, 3043, 3043, 3043,
-     3043, 3043, 3043, 3043, 3043, 3043, 3044, 3044,    0,    0,
-     3044, 3044, 3044, 3044, 3044, 3044, 3045, 3045,    0, 3045,
-     3045, 3045, 3045, 3045, 3045, 3045, 3045, 3045, 3045, 3046,
-
-     3046,    0, 3046, 3046, 3046, 3046, 3046, 3046, 3046, 3046,
-     3046, 3046, 3047, 3047,    0, 3047, 3047, 3047, 3047, 3047,
-     3047, 3047, 3047, 3047, 3047, 3048, 3048,    0,    0, 3048,
-     3048, 3048, 3048, 3048, 3048, 3049, 3049,    0, 3049, 3049,
-     3049, 3049, 3049, 3049, 3049, 3049, 3049, 3049, 3050, 3050,
-        0, 3050, 3050, 3050, 3050, 3050, 3050, 3050, 3050, 3050,
-     3050, 3051, 3051,    0, 3051, 3051, 3051, 3051, 3051, 3051,
-     3051, 3051, 3051, 3051, 3052, 3052,    0,    0, 3052, 3052,
-     3052, 3052, 3052, 3052, 3053, 3053,    0, 3053, 3053, 3053,
-     3053, 3053, 3053, 3053, 3053, 3053, 3053, 3054, 3054,    0,
-
-     3054, 3054, 3054, 3054, 3054, 3054, 3054, 3054, 3054, 3054,
-     3055, 3055,    0, 3055, 3055, 3055, 3055, 3055, 3055, 3055,
-     3055, 3055, 3055, 3056, 3056,    0,    0, 3056, 3056, 3056,
-     3056, 3056, 3056, 3057, 3057,    0, 3057, 3057, 3057, 3057,
-     3057, 3057, 3057, 3057, 3057, 3057, 3058, 3058,    0, 3058,
-     3058, 3058, 3058, 3058, 3058, 3058, 3058, 3058, 3058, 3059,
-     3059,    0, 3059, 3059, 3059, 3059, 3059, 3059, 3059, 3059,
-     3059, 3059, 3060, 3060,    0,    0, 3060, 3060, 3060, 3060,
-     3060, 3060, 3061, 3061,    0, 3061, 3061, 3061, 3061, 3061,
-     3061, 3061, 3061, 3061, 3061, 3062, 3062,    0, 3062, 3062,
-
-     3062, 3062, 3062, 3062, 3062, 3062, 3062, 3062, 3063, 3063,
-        0, 3063, 3063, 3063, 3063, 3063, 3063, 3063, 3063, 3063,
-     3063, 3064, 3064,    0,    0, 3064, 3064, 3064, 3064, 3064,
-     3064, 3065, 3065,    0, 3065, 3065, 3065, 3065, 3065, 3065,
-     3065, 3065, 3065, 3065, 3066, 3066,    0, 3066, 3066, 3066,
-     3066, 3066, 3066, 3066, 3066, 3066, 3066, 3067, 3067,    0,
-     3067, 3067, 3067, 3067, 3067, 3067, 3067, 3067, 3067, 3067,
-     3068, 3068,    0,    0, 3068, 3068, 3068, 3068, 3068, 3068,
-     3069, 3069,    0, 3069, 3069, 3069, 3069, 3069, 3069, 3069,
-     3069, 3069, 3069, 3070, 3070,    0, 3070, 3070, 3070, 3070,
-
-     3070, 3070, 3070, 3070, 3070, 3070, 3071, 3071,    0, 3071,
-     3071, 3071, 3071, 3071, 3071, 3071, 3071, 3071, 3071, 3072,
-     3072,    0,    0, 3072, 3072, 3072, 3072, 3072, 3072, 3073,
-     3073,    0, 3073, 3073, 3073, 3073, 3073, 3073, 3073, 3073,
-     3073, 3073, 3074, 3074,    0, 3074, 3074, 3074, 3074, 3074,
-     3074, 3074, 3074, 3074, 3074, 3075, 3075,    0, 3075, 3075,
-     3075, 3075, 3075, 3075, 3075, 3075, 3075, 3075, 3076, 3076,
-        0,    0, 3076, 3076, 3076, 3076, 3076, 3076, 3077, 3077,
-        0, 3077, 3077, 3077, 3077, 3077, 3077, 3077, 3077, 3077,
-     3077, 3078, 3078,    0, 3078, 3078, 3078, 3078, 3078, 3078,
-
-     3078, 3078, 3078, 3078, 3079, 3079,    0, 3079, 3079, 3079,
-     3079, 3079, 3079, 3079, 3079, 3079, 3079, 3080, 3080,    0,
-        0, 3080, 3080, 3080, 3080, 3080, 3080, 3081, 3081,    0,
+        0,    0, 3037, 3037, 3037, 3037, 3037, 3037, 3038, 3038,
+        0, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038, 3038,
+     3038, 3039, 3039,    0, 3039, 3039, 3039, 3039, 3039, 3039,
+
+     3039, 3039, 3039, 3039, 3040, 3040,    0,    0, 3040, 3040,
+     3040, 3040, 3040, 3040, 3041, 3041,    0, 3041, 3041, 3041,
+     3041, 3041, 3041, 3041, 3041, 3041, 3041, 3042, 3042,    0,
+     3042, 3042, 3042, 3042, 3042, 3042, 3042, 3042, 3042, 3042,
+     3043, 3043,    0,    0, 3043, 3043, 3043, 3043, 3043, 3043,
+     3044, 3044,    0, 3044, 3044, 3044, 3044, 3044, 3044, 3044,
+     3044, 3044, 3044, 3045, 3045,    0, 3045, 3045, 3045, 3045,
+     3045, 3045, 3045, 3045, 3045, 3045, 3046, 3046,    0, 3046,
+     3046, 3046, 3046, 3046, 3046, 3046, 3046, 3046, 3046, 3047,
+     3047,    0, 3047, 3047, 3047, 3047, 3047, 3047, 3047, 3047,
+
+     3047, 3047, 3048, 3048,    0, 3048, 3048, 3048, 3048, 3048,
+     3048, 3048, 3048, 3048, 3048, 3049, 3049,    0,    0, 3049,
+     3049, 3049, 3049, 3049, 3049, 3050, 3050,    0, 3050, 3050,
+     3050, 3050, 3050, 3050, 3050, 3050, 3050, 3050, 3051, 3051,
+        0, 3051, 3051, 3051, 3051, 3051, 3051, 3051, 3051, 3051,
+     3051, 3052, 3052,    0,    0, 3052, 3052, 3052, 3052, 3052,
+     3052, 3053, 3053,    0, 3053, 3053, 3053, 3053, 3053, 3053,
+     3053, 3053, 3053, 3053, 3054, 3054,    0, 3054, 3054, 3054,
+     3054, 3054, 3054, 3054, 3054, 3054, 3054, 3055, 3055,    0,
+        0, 3055, 3055, 3055, 3055, 3055, 3055, 3056, 3056,    0,
+
+     3056, 3056, 3056, 3056, 3056, 3056, 3056, 3056, 3056, 3056,
+     3057, 3057,    0, 3057, 3057, 3057, 3057, 3057, 3057, 3057,
+     3057, 3057, 3057, 3058, 3058,    0, 3058, 3058, 3058, 3058,
+     3058, 3058, 3058, 3058, 3058, 3058, 3059, 3059,    0, 3059,
+     3059, 3059, 3059, 3059, 3059, 3059, 3059, 3059, 3059, 3060,
+     3060,    0, 3060, 3060, 3060, 3060, 3060, 3060, 3060, 3060,
+     3060, 3060, 3061, 3061,    0,    0, 3061, 3061, 3061, 3061,
+     3061, 3061, 3062, 3062,    0, 3062, 3062, 3062, 3062, 3062,
+     3062, 3062, 3062, 3062, 3062, 3063, 3063,    0, 3063, 3063,
+     3063, 3063, 3063, 3063, 3063, 3063, 3063, 3063, 3064, 3064,
+
+        0,    0, 3064, 3064, 3064, 3064, 3064, 3064, 3065, 3065,
+        0, 3065, 3065, 3065, 3065, 3065, 3065, 3065, 3065, 3065,
+     3065, 3066, 3066,    0, 3066, 3066, 3066, 3066, 3066, 3066,
+     3066, 3066, 3066, 3066, 3067, 3067,    0,    0, 3067, 3067,
+     3067, 3067, 3067, 3067, 3068, 3068,    0, 3068, 3068, 3068,
+     3068, 3068, 3068, 3068, 3068, 3068, 3068, 3069, 3069,    0,
+     3069, 3069, 3069, 3069, 3069, 3069, 3069, 3069, 3069, 3069,
+     3070, 3070,    0,    0, 3070, 3070, 3070, 3070, 3070, 3070,
+     3071, 3071,    0, 3071, 3071, 3071, 3071, 3071, 3071, 3071,
+     3071, 3071, 3071, 3072, 3072,    0, 3072, 3072, 3072, 3072,
+
+     3072, 3072, 3072, 3072, 3072, 3072, 3073, 3073,    0, 3073,
+     3073, 3073, 3073, 3073, 3073, 3073, 3073, 3073, 3073, 3074,
+     3074, 3074, 3074, 3074,    0, 3074, 3074, 3074, 3074, 3075,
+     3075,    0, 3075, 3075, 3075, 3075, 3075, 3075, 3075, 3075,
+     3075, 3075, 3076, 3076,    0, 3076, 3076, 3076, 3076, 3076,
+     3076, 3076, 3076, 3076, 3076, 3077, 3077,    0, 3077, 3077,
+     3077, 3077, 3077, 3077, 3077, 3077, 3077, 3077, 3078, 3078,
+        0, 3078, 3078, 3078, 3078, 3078, 3078, 3078, 3078, 3078,
+     3078, 3079, 3079,    0, 3079, 3079, 3079, 3079, 3079, 3079,
+     3079, 3079, 3079, 3079, 3080, 3080,    0, 3080, 3080, 3080,
+
+     3080, 3080, 3080, 3080, 3080, 3080, 3080, 3081, 3081,    0,
      3081, 3081, 3081, 3081, 3081, 3081, 3081, 3081, 3081, 3081,
      3082, 3082,    0, 3082, 3082, 3082, 3082, 3082, 3082, 3082,
-     3082, 3082, 3082, 3083, 3083,    0, 3083, 3083, 3083, 3083,
-     3083, 3083, 3083, 3083, 3083, 3083, 3084, 3084, 3084, 3084,
-        0, 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3085,
-     3085,    0, 3085,    0, 3085, 3085, 3085, 3085, 3085, 3085,
-     3085, 3085, 3086, 3086,    0,    0, 3086, 3086, 3086, 3086,
-
+     3082, 3082, 3082, 3083,    0, 3083, 3083,    0, 3083, 3083,
+     3083, 3083, 3083, 3083, 3083, 3083, 3084, 3084,    0,    0,
+     3084, 3084, 3084, 3084, 3084, 3084, 3085, 3085,    0, 3085,
+     3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3086,
+     3086,    0, 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086,
      3086, 3086, 3087, 3087,    0, 3087, 3087, 3087, 3087, 3087,
-     3087, 3087, 3087, 3087, 3087, 3088, 3088,    0, 3088, 3088,
-     3088, 3088, 3088, 3088, 3088, 3088, 3088, 3088, 3089, 3089,
-        0, 3089, 3089, 3089, 3089, 3089, 3089, 3089, 3089, 3089,
-     3089, 3090, 3090,    0,    0, 3090, 3090, 3090, 3090, 3090,
-     3090, 3091, 3091,    0, 3091, 3091, 3091, 3091, 3091, 3091,
-     3091, 3091, 3091, 3091, 3092, 3092,    0, 3092, 3092, 3092,
-     3092, 3092, 3092, 3092, 3092, 3092, 3092, 3093, 3093,    0,
-     3093, 3093, 3093, 3093, 3093, 3093, 3093, 3093, 3093, 3093,
-     3094, 3094,    0,    0, 3094, 3094, 3094, 3094, 3094, 3094,
+     3087, 3087, 3087, 3087, 3087, 3088, 3088,    0,    0, 3088,
 
-     3095, 3095,    0, 3095, 3095, 3095, 3095, 3095, 3095, 3095,
+     3088, 3088, 3088, 3088, 3088, 3089, 3089,    0, 3089, 3089,
+     3089, 3089, 3089, 3089, 3089, 3089, 3089, 3089, 3090, 3090,
+        0, 3090, 3090, 3090, 3090, 3090, 3090, 3090, 3090, 3090,
+     3090, 3091, 3091,    0, 3091, 3091, 3091, 3091, 3091, 3091,
+     3091, 3091, 3091, 3091, 3092, 3092, 3092, 3092, 3092, 3092,
+     3092, 3092,    0, 3092, 3092, 3092, 3092, 3093, 3093,    0,
+        0, 3093, 3093, 3093, 3093, 3093, 3093, 3094, 3094, 3094,
+     3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094,
+     3095, 3095, 3095, 3095, 3095, 3095, 3095, 3095, 3095, 3095,
      3095, 3095, 3095, 3096, 3096,    0, 3096, 3096, 3096, 3096,
+
      3096, 3096, 3096, 3096, 3096, 3096, 3097, 3097,    0, 3097,
      3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3098,
-     3098,    0,    0, 3098, 3098, 3098, 3098, 3098, 3098, 3099,
-     3099,    0, 3099, 3099, 3099, 3099, 3099, 3099, 3099, 3099,
-     3099, 3099, 3100, 3100,    0, 3100, 3100, 3100, 3100, 3100,
+     3098, 3098, 3098, 3098, 3098, 3098, 3098, 3098, 3098, 3098,
+     3098, 3098, 3099, 3099,    0, 3099, 3099, 3099, 3099, 3099,
+     3099, 3099, 3099, 3099, 3099, 3100, 3100,    0,    0, 3100,
      3100, 3100, 3100, 3100, 3100, 3101, 3101,    0, 3101, 3101,
      3101, 3101, 3101, 3101, 3101, 3101, 3101, 3101, 3102, 3102,
-     3102, 3102, 3102, 3102,    0, 3102, 3102, 3102, 3102, 3102,
+        0, 3102, 3102, 3102, 3102, 3102, 3102, 3102, 3102, 3102,
+     3102, 3103, 3103,    0, 3103, 3103, 3103, 3103, 3103, 3103,
+     3103, 3103, 3103, 3103, 3104, 3104,    0,    0, 3104, 3104,
 
-     3102, 3103, 3103,    0,    0, 3103, 3103, 3103, 3103, 3103,
-     3103, 3104, 3104,    0, 3104, 3104, 3104, 3104, 3104, 3104,
      3104, 3104, 3104, 3104, 3105, 3105,    0, 3105, 3105, 3105,
      3105, 3105, 3105, 3105, 3105, 3105, 3105, 3106, 3106,    0,
      3106, 3106, 3106, 3106, 3106, 3106, 3106, 3106, 3106, 3106,
-     3107, 3107,    0,    0, 3107, 3107, 3107, 3107, 3107, 3107,
-     3108, 3108,    0, 3108, 3108, 3108, 3108, 3108, 3108, 3108,
+     3107, 3107,    0, 3107, 3107, 3107, 3107, 3107, 3107, 3107,
+     3107, 3107, 3107, 3108, 3108,    0,    0, 3108, 3108, 3108,
      3108, 3108, 3108, 3109, 3109,    0, 3109, 3109, 3109, 3109,
      3109, 3109, 3109, 3109, 3109, 3109, 3110, 3110,    0, 3110,
      3110, 3110, 3110, 3110, 3110, 3110, 3110, 3110, 3110, 3111,
+     3111,    0, 3111, 3111, 3111, 3111, 3111, 3111, 3111, 3111,
+     3111, 3111, 3112, 3112,    0,    0, 3112, 3112, 3112, 3112,
 
-     3111,    0,    0, 3111, 3111, 3111, 3111, 3111, 3111, 3112,
-     3112,    0, 3112, 3112, 3112, 3112, 3112, 3112, 3112, 3112,
      3112, 3112, 3113, 3113,    0, 3113, 3113, 3113, 3113, 3113,
      3113, 3113, 3113, 3113, 3113, 3114, 3114,    0, 3114, 3114,
      3114, 3114, 3114, 3114, 3114, 3114, 3114, 3114, 3115, 3115,
-        0,    0, 3115, 3115, 3115, 3115, 3115, 3115, 3116, 3116,
-        0, 3116, 3116, 3116, 3116, 3116, 3116, 3116, 3116, 3116,
+        0, 3115, 3115, 3115, 3115, 3115, 3115, 3115, 3115, 3115,
+     3115, 3116, 3116,    0,    0, 3116, 3116, 3116, 3116, 3116,
      3116, 3117, 3117,    0, 3117, 3117, 3117, 3117, 3117, 3117,
      3117, 3117, 3117, 3117, 3118, 3118,    0, 3118, 3118, 3118,
-     3118, 3118, 3118, 3118, 3118, 3118, 3118, 3119, 3119, 3119,
-
+     3118, 3118, 3118, 3118, 3118, 3118, 3118, 3119, 3119,    0,
      3119, 3119, 3119, 3119, 3119, 3119, 3119, 3119, 3119, 3119,
-     3120, 3120, 3120, 3120, 3120, 3120, 3120, 3120, 3120, 3120,
-     3120, 3120, 3120, 3121, 3121, 3121, 3121, 3121, 3121, 3121,
-     3121, 3121, 3121, 3121, 3121, 3121, 3122, 3122, 3122, 3122,
-     3122, 3122, 3122, 3122, 3122, 3122, 3122, 3122, 3122, 3123,
-     3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123,
-     3123, 3123, 3124, 3124,    0, 3124, 3124, 3124, 3124, 3124,
-     3124, 3124, 3124, 3124, 3124, 3125, 3125,    0, 3125, 3125,
-     3125, 3125, 3125, 3125, 3125, 3125, 3125, 3125, 3126, 3126,
-        0, 3126, 3126, 3126, 3126, 3126, 3126, 3126, 3126, 3126,
-
-     3126, 3128, 3128,    0, 3128, 3128, 3128, 3128, 3128, 3128,
-     3128, 3128, 3128, 3128, 3129, 3129,    0, 3129, 3129, 3129,
-     3129, 3129, 3129, 3129, 3129, 3129, 3129, 3130, 3130, 3130,
-     3130, 3130, 3130, 3130, 3130, 3130, 3130, 3130,    0, 3130,
-     3131, 3131,    0, 3131, 3131, 3131, 3131, 3131, 3131, 3131,
-     3131, 3131, 3131, 3132, 3132,    0, 3132, 3132, 3132, 3132,
-     3132, 3132, 3132, 3132, 3132, 3132, 3133, 3133, 3133, 3133,
-     3133, 3133, 3133, 3133, 3133, 3133, 3133, 3133, 3133, 3134,
-     3134, 3134, 3134, 3134, 3134, 3134, 3134, 3134, 3134, 3134,
-     3134, 3134, 3135, 3135, 3135, 3135, 3135, 3135, 3135, 3135,
-
-     3135, 3135, 3135, 3135, 3135, 3136, 3136, 3136, 3136, 3136,
-     3136, 3136, 3136, 3136, 3136, 3136, 3136, 3136, 3137, 3137,
-     3137, 3137, 3137, 3137, 3137, 3137, 3137, 3137, 3137, 3137,
-     3137, 3138, 3138, 3138, 3138, 3138, 3138, 3138, 3138, 3138,
-     3138, 3138, 3138, 3138, 3139, 3139,    0, 3139, 3139, 3139,
-     3139, 3139, 3139, 3139, 3139, 3139, 3139, 3140, 3140,    0,
-        0, 3140, 3140, 3140, 3140, 3140, 3140, 3141, 3141,    0,
-     3141, 3141, 3141, 3141, 3141, 3141, 3141, 3141, 3141, 3141,
-     3142, 3142,    0, 3142, 3142, 3142, 3142, 3142, 3142, 3142,
-     3142, 3142, 3142, 3143, 3143,    0, 3143, 3143, 3143, 3143,
-
-     3143, 3143, 3143, 3143, 3143, 3143, 3144, 3144,    0,    0,
-     3144, 3144, 3144, 3144, 3144, 3144, 3145, 3145,    0, 3145,
-     3145, 3145, 3145, 3145, 3145, 3145, 3145, 3145, 3145, 3146,
-     3146,    0, 3146, 3146, 3146, 3146, 3146, 3146, 3146, 3146,
-     3146, 3146, 3147, 3147,    0, 3147, 3147, 3147, 3147, 3147,
-     3147, 3147, 3147, 3147, 3147, 3148, 3148,    0,    0, 3148,
-     3148, 3148, 3148, 3148, 3148, 3149, 3149,    0, 3149, 3149,
-     3149, 3149, 3149, 3149, 3149, 3149, 3149, 3149, 3150, 3150,
-        0, 3150, 3150, 3150, 3150, 3150, 3150, 3150, 3150, 3150,
-     3150, 3151, 3151,    0, 3151, 3151, 3151, 3151, 3151, 3151,
-
-     3151, 3151, 3151, 3151, 3152, 3152,    0,    0, 3152, 3152,
-     3152, 3152, 3152, 3152, 3153, 3153,    0, 3153, 3153, 3153,
-     3153, 3153, 3153, 3153, 3153, 3153, 3153, 3154, 3154,    0,
-     3154, 3154, 3154, 3154, 3154, 3154, 3154, 3154, 3154, 3154,
-     3155, 3155,    0, 3155, 3155, 3155, 3155, 3155, 3155, 3155,
-     3155, 3155, 3155, 3156,    0, 3156, 3156,    0, 3156, 3156,
-     3156, 3156, 3156, 3156, 3156, 3156, 3157,    0, 3157, 3157,
-        0, 3157, 3157, 3157,    0, 3157, 3157, 3157, 3157, 3158,
-     3158,    0,    0, 3158, 3158, 3158, 3158, 3158, 3158, 3159,
-     3159,    0, 3159, 3159, 3159, 3159, 3159, 3159, 3159, 3159,
-
-     3159, 3159, 3160, 3160,    0, 3160, 3160, 3160, 3160, 3160,
-     3160, 3160, 3160, 3160, 3160, 3161, 3161,    0, 3161, 3161,
-     3161, 3161, 3161, 3161, 3161, 3161, 3161, 3161, 3162,    0,
-     3162, 3162,    0, 3162, 3162, 3162, 3162, 3162, 3162, 3162,
-     3162, 3163, 3163,    0,    0, 3163, 3163, 3163, 3163, 3163,
-     3163, 3164, 3164,    0, 3164, 3164, 3164, 3164, 3164, 3164,
-     3164, 3164, 3164, 3164, 3165, 3165,    0, 3165, 3165, 3165,
-     3165, 3165, 3165, 3165, 3165, 3165, 3165, 3166, 3166,    0,
-     3166, 3166, 3166, 3166, 3166, 3166, 3166, 3166, 3166, 3166,
-     3167,    0, 3167, 3167,    0, 3167, 3167, 3167, 3167, 3167,
-
-     3167, 3167, 3167, 3168, 3168,    0,    0, 3168, 3168, 3168,
-     3168, 3168, 3168, 3169, 3169,    0, 3169, 3169, 3169, 3169,
-     3169, 3169, 3169, 3169, 3169, 3169, 3170, 3170,    0, 3170,
-     3170, 3170, 3170, 3170, 3170, 3170, 3170, 3170, 3170, 3171,
-     3171,    0, 3171, 3171, 3171, 3171, 3171, 3171, 3171, 3171,
-     3171, 3171, 3172, 3172,    0,    0, 3172, 3172, 3172, 3172,
-     3172, 3172, 3173, 3173,    0, 3173, 3173, 3173, 3173, 3173,
-     3173, 3173, 3173, 3173, 3173, 3174, 3174,    0, 3174, 3174,
-     3174, 3174, 3174, 3174, 3174, 3174, 3174, 3174, 3175, 3175,
-        0, 3175, 3175, 3175, 3175, 3175, 3175, 3175, 3175, 3175,
-
-     3175, 3176, 3176,    0,    0, 3176, 3176, 3176, 3176, 3176,
-     3176, 3177, 3177,    0, 3177, 3177, 3177, 3177, 3177, 3177,
-     3177, 3177, 3177, 3177, 3178, 3178,    0, 3178, 3178, 3178,
-     3178, 3178, 3178, 3178, 3178, 3178, 3178, 3179, 3179,    0,
-     3179, 3179, 3179, 3179, 3179, 3179, 3179, 3179, 3179, 3179,
-     3180, 3180,    0, 3180, 3180, 3180, 3180, 3180, 3180, 3180,
-     3180, 3180, 3180, 3181, 3181,    0, 3181, 3181, 3181, 3181,
-     3181, 3181, 3181, 3181, 3181, 3181, 3182, 3182,    0,    0,
-     3182, 3182, 3182, 3182, 3182, 3182, 3183, 3183,    0, 3183,
-     3183, 3183, 3183, 3183, 3183, 3183, 3183, 3183, 3183, 3184,
-
-     3184,    0, 3184, 3184, 3184, 3184, 3184, 3184, 3184, 3184,
-     3184, 3184, 3185, 3185,    0, 3185, 3185, 3185, 3185, 3185,
-     3185, 3185, 3185, 3185, 3185, 3186, 3186,    0,    0, 3186,
-     3186, 3186, 3186, 3186, 3186, 3187, 3187,    0, 3187, 3187,
-     3187, 3187, 3187, 3187, 3187, 3187, 3187, 3187, 3188, 3188,
-        0, 3188, 3188, 3188, 3188, 3188, 3188, 3188, 3188, 3188,
-     3188, 3189, 3189,    0, 3189, 3189, 3189, 3189, 3189, 3189,
-     3189, 3189, 3189, 3189, 3190, 3190,    0,    0, 3190, 3190,
-     3190, 3190, 3190, 3190, 3191, 3191,    0, 3191, 3191, 3191,
-     3191, 3191, 3191, 3191, 3191, 3191, 3191, 3192, 3192,    0,
-
-     3192, 3192, 3192, 3192, 3192, 3192, 3192, 3192, 3192, 3192,
-     3193, 3193,    0, 3193, 3193, 3193, 3193, 3193, 3193, 3193,
-     3193, 3193, 3193, 3194, 3194,    0, 3194, 3194, 3194, 3194,
-     3194, 3194, 3194, 3194, 3194, 3194, 3195, 3195,    0, 3195,
-     3195, 3195, 3195, 3195, 3195, 3195, 3195, 3195, 3195, 3196,
-     3196,    0,    0, 3196, 3196, 3196, 3196, 3196, 3196, 3197,
-     3197,    0, 3197, 3197, 3197, 3197, 3197, 3197, 3197, 3197,
-     3197, 3197, 3198, 3198,    0, 3198, 3198, 3198, 3198, 3198,
-     3198, 3198, 3198, 3198, 3198, 3199, 3199,    0, 3199, 3199,
-     3199, 3199, 3199, 3199, 3199, 3199, 3199, 3199, 3200, 3200,
-
-        0,    0, 3200, 3200, 3200, 3200, 3200, 3200, 3201, 3201,
-        0, 3201, 3201, 3201, 3201, 3201, 3201, 3201, 3201, 3201,
-     3201, 3202, 3202,    0, 3202, 3202, 3202, 3202, 3202, 3202,
-     3202, 3202, 3202, 3202, 3203, 3203,    0, 3203, 3203, 3203,
-     3203, 3203, 3203, 3203, 3203, 3203, 3203, 3204, 3204,    0,
-        0, 3204, 3204, 3204, 3204, 3204, 3204, 3205, 3205,    0,
-     3205, 3205, 3205, 3205, 3205, 3205, 3205, 3205, 3205, 3205,
-     3206, 3206,    0, 3206, 3206, 3206, 3206, 3206, 3206, 3206,
-     3206, 3206, 3206, 3207, 3207,    0, 3207, 3207, 3207, 3207,
-     3207, 3207, 3207, 3207, 3207, 3207, 3208, 3208, 3208, 3208,
-
-     3208,    0, 3208, 3208, 3208, 3208, 3209, 3209, 3209, 3209,
-     3209, 3209, 3209, 3209, 3209, 3209, 3209, 3209, 3209, 3210,
-     3210,    0, 3210, 3210, 3210, 3210, 3210, 3210, 3210, 3210,
-     3210, 3210, 3211, 3211,    0, 3211, 3211, 3211, 3211, 3211,
-     3211, 3211, 3211, 3211, 3211, 3212, 3212,    0, 3212, 3212,
-     3212, 3212, 3212, 3212, 3212, 3212, 3212, 3212, 3213, 3213,
-        0, 3213, 3213, 3213, 3213, 3213, 3213, 3213, 3213, 3213,
-     3213, 3214, 3214,    0, 3214, 3214, 3214, 3214, 3214, 3214,
-     3214, 3214, 3214, 3214, 3215,    0, 3215, 3215,    0, 3215,
-     3215, 3215, 3215, 3215, 3215, 3215, 3215, 3216, 3216,    0,
-
-     3216, 3216, 3216, 3216, 3216, 3216, 3216, 3216, 3216, 3216,
-     3217, 3217,    0, 3217, 3217, 3217, 3217, 3217, 3217, 3217,
-     3217, 3217, 3217, 3218, 3218, 3218, 3218, 3218, 3218, 3218,
-     3218, 3218, 3218, 3218, 3218, 3218, 3219, 3219,    0, 3219,
-     3219, 3219, 3219, 3219, 3219, 3219, 3219, 3219, 3219, 3220,
-     3220,    0, 3220, 3220, 3220, 3220, 3220, 3220, 3220, 3220,
-     3220, 3220, 3221, 3221,    0, 3221, 3221, 3221, 3221, 3221,
-     3221, 3221, 3221, 3221, 3221, 3222, 3222,    0, 3222, 3222,
-     3222, 3222, 3222, 3222, 3222, 3222, 3222, 3222, 3223, 3223,
-        0, 3223, 3223, 3223, 3223, 3223, 3223, 3223, 3223, 3223,
-
-     3223, 3224, 3224,    0, 3224, 3224, 3224, 3224, 3224, 3224,
-     3224, 3224, 3224, 3224, 3225, 3225,    0, 3225, 3225, 3225,
-     3225, 3225, 3225, 3225, 3225, 3225, 3225, 3226, 3226,    0,
-     3226, 3226, 3226, 3226, 3226, 3226, 3226, 3226, 3226, 3226,
+     3120, 3120,    0,    0, 3120, 3120, 3120, 3120, 3120, 3120,
+
+     3121, 3121,    0, 3121, 3121, 3121, 3121, 3121, 3121, 3121,
+     3121, 3121, 3121, 3122, 3122,    0, 3122, 3122, 3122, 3122,
+     3122, 3122, 3122, 3122, 3122, 3122, 3123, 3123,    0, 3123,
+     3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3124,
+     3124,    0,    0, 3124, 3124, 3124, 3124, 3124, 3124, 3125,
+     3125,    0, 3125, 3125, 3125, 3125, 3125, 3125, 3125, 3125,
+     3125, 3125, 3126, 3126,    0, 3126, 3126, 3126, 3126, 3126,
+     3126, 3126, 3126, 3126, 3126, 3127, 3127,    0, 3127, 3127,
+     3127, 3127, 3127, 3127, 3127, 3127, 3127, 3127, 3128, 3128,
+        0,    0, 3128, 3128, 3128, 3128, 3128, 3128, 3129, 3129,
+
+        0, 3129, 3129, 3129, 3129, 3129, 3129, 3129, 3129, 3129,
+     3129, 3130, 3130,    0, 3130, 3130, 3130, 3130, 3130, 3130,
+     3130, 3130, 3130, 3130, 3131, 3131,    0, 3131, 3131, 3131,
+     3131, 3131, 3131, 3131, 3131, 3131, 3131, 3132, 3132,    0,
+        0, 3132, 3132, 3132, 3132, 3132, 3132, 3133, 3133,    0,
+     3133, 3133, 3133, 3133, 3133, 3133, 3133, 3133, 3133, 3133,
+     3134, 3134,    0, 3134, 3134, 3134, 3134, 3134, 3134, 3134,
+     3134, 3134, 3134, 3135, 3135,    0, 3135, 3135, 3135, 3135,
+     3135, 3135, 3135, 3135, 3135, 3135, 3136, 3136,    0,    0,
+     3136, 3136, 3136, 3136, 3136, 3136, 3137, 3137,    0, 3137,
+
+     3137, 3137, 3137, 3137, 3137, 3137, 3137, 3137, 3137, 3138,
+     3138,    0, 3138, 3138, 3138, 3138, 3138, 3138, 3138, 3138,
+     3138, 3138, 3139, 3139,    0, 3139, 3139, 3139, 3139, 3139,
+     3139, 3139, 3139, 3139, 3139, 3140, 3140,    0,    0, 3140,
+     3140, 3140, 3140, 3140, 3140, 3141, 3141,    0, 3141, 3141,
+     3141, 3141, 3141, 3141, 3141, 3141, 3141, 3141, 3142, 3142,
+        0, 3142, 3142, 3142, 3142, 3142, 3142, 3142, 3142, 3142,
+     3142, 3143, 3143,    0, 3143, 3143, 3143, 3143, 3143, 3143,
+     3143, 3143, 3143, 3143, 3144, 3144, 3144, 3144,    0, 3144,
+     3144, 3144, 3144, 3144, 3144, 3144, 3144, 3145, 3145,    0,
+
+     3145,    0, 3145, 3145, 3145, 3145, 3145, 3145, 3145, 3145,
+     3146, 3146,    0,    0, 3146, 3146, 3146, 3146, 3146, 3146,
+     3147, 3147,    0, 3147, 3147, 3147, 3147, 3147, 3147, 3147,
+     3147, 3147, 3147, 3148, 3148,    0, 3148, 3148, 3148, 3148,
+     3148, 3148, 3148, 3148, 3148, 3148, 3149, 3149,    0, 3149,
+     3149, 3149, 3149, 3149, 3149, 3149, 3149, 3149, 3149, 3150,
+     3150,    0,    0, 3150, 3150, 3150, 3150, 3150, 3150, 3151,
+     3151,    0, 3151, 3151, 3151, 3151, 3151, 3151, 3151, 3151,
+     3151, 3151, 3152, 3152,    0, 3152, 3152, 3152, 3152, 3152,
+     3152, 3152, 3152, 3152, 3152, 3153, 3153,    0, 3153, 3153,
+
+     3153, 3153, 3153, 3153, 3153, 3153, 3153, 3153, 3154, 3154,
+        0,    0, 3154, 3154, 3154, 3154, 3154, 3154, 3155, 3155,
+        0, 3155, 3155, 3155, 3155, 3155, 3155, 3155, 3155, 3155,
+     3155, 3156, 3156,    0, 3156, 3156, 3156, 3156, 3156, 3156,
+     3156, 3156, 3156, 3156, 3157, 3157,    0, 3157, 3157, 3157,
+     3157, 3157, 3157, 3157, 3157, 3157, 3157, 3158, 3158,    0,
+        0, 3158, 3158, 3158, 3158, 3158, 3158, 3159, 3159,    0,
+     3159, 3159, 3159, 3159, 3159, 3159, 3159, 3159, 3159, 3159,
+     3160, 3160,    0, 3160, 3160, 3160, 3160, 3160, 3160, 3160,
+     3160, 3160, 3160, 3161, 3161,    0, 3161, 3161, 3161, 3161,
+
+     3161, 3161, 3161, 3161, 3161, 3161, 3162, 3162, 3162, 3162,
+     3162, 3162,    0, 3162, 3162, 3162, 3162, 3162, 3162, 3163,
+     3163,    0,    0, 3163, 3163, 3163, 3163, 3163, 3163, 3164,
+     3164,    0, 3164, 3164, 3164, 3164, 3164, 3164, 3164, 3164,
+     3164, 3164, 3165, 3165,    0, 3165, 3165, 3165, 3165, 3165,
+     3165, 3165, 3165, 3165, 3165, 3166, 3166,    0, 3166, 3166,
+     3166, 3166, 3166, 3166, 3166, 3166, 3166, 3166, 3167, 3167,
+        0,    0, 3167, 3167, 3167, 3167, 3167, 3167, 3168, 3168,
+        0, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168,
+     3168, 3169, 3169,    0, 3169, 3169, 3169, 3169, 3169, 3169,
+
+     3169, 3169, 3169, 3169, 3170, 3170,    0, 3170, 3170, 3170,
+     3170, 3170, 3170, 3170, 3170, 3170, 3170, 3171, 3171,    0,
+        0, 3171, 3171, 3171, 3171, 3171, 3171, 3172, 3172,    0,
+     3172, 3172, 3172, 3172, 3172, 3172, 3172, 3172, 3172, 3172,
+     3173, 3173,    0, 3173, 3173, 3173, 3173, 3173, 3173, 3173,
+     3173, 3173, 3173, 3174, 3174,    0, 3174, 3174, 3174, 3174,
+     3174, 3174, 3174, 3174, 3174, 3174, 3175, 3175,    0,    0,
+     3175, 3175, 3175, 3175, 3175, 3175, 3176, 3176,    0, 3176,
+     3176, 3176, 3176, 3176, 3176, 3176, 3176, 3176, 3176, 3177,
+     3177,    0, 3177, 3177, 3177, 3177, 3177, 3177, 3177, 3177,
+
+     3177, 3177, 3178, 3178,    0, 3178, 3178, 3178, 3178, 3178,
+     3178, 3178, 3178, 3178, 3178, 3179, 3179, 3179, 3179, 3179,
+     3179, 3179, 3179, 3179, 3179, 3179, 3179, 3179, 3180, 3180,
+     3180, 3180, 3180, 3180, 3180, 3180, 3180, 3180, 3180, 3180,
+     3180, 3181, 3181, 3181, 3181, 3181, 3181, 3181, 3181, 3181,
+     3181, 3181, 3181, 3181, 3182, 3182, 3182, 3182, 3182, 3182,
+     3182, 3182, 3182, 3182, 3182, 3182, 3182, 3183, 3183, 3183,
+     3183, 3183, 3183, 3183, 3183, 3183, 3183, 3183, 3183, 3183,
+     3184, 3184,    0, 3184, 3184, 3184, 3184, 3184, 3184, 3184,
+     3184, 3184, 3184, 3185, 3185,    0, 3185, 3185, 3185, 3185,
+
+     3185, 3185, 3185, 3185, 3185, 3185, 3186, 3186,    0, 3186,
+     3186, 3186, 3186, 3186, 3186, 3186, 3186, 3186, 3186, 3188,
+     3188,    0, 3188, 3188, 3188, 3188, 3188, 3188, 3188, 3188,
+     3188, 3188, 3189, 3189,    0, 3189, 3189, 3189, 3189, 3189,
+     3189, 3189, 3189, 3189, 3189, 3190, 3190, 3190, 3190, 3190,
+     3190, 3190, 3190, 3190, 3190, 3190,    0, 3190, 3191, 3191,
+        0, 3191, 3191, 3191, 3191, 3191, 3191, 3191, 3191, 3191,
+     3191, 3192, 3192,    0, 3192, 3192, 3192, 3192, 3192, 3192,
+     3192, 3192, 3192, 3192, 3193, 3193, 3193, 3193, 3193, 3193,
+     3193, 3193, 3193, 3193, 3193, 3193, 3193, 3194, 3194, 3194,
+
+     3194, 3194, 3194, 3194, 3194, 3194, 3194, 3194, 3194, 3194,
+     3195, 3195, 3195, 3195, 3195, 3195, 3195, 3195, 3195, 3195,
+     3195, 3195, 3195, 3196, 3196, 3196, 3196, 3196, 3196, 3196,
+     3196, 3196, 3196, 3196, 3196, 3196, 3197, 3197, 3197, 3197,
+     3197, 3197, 3197, 3197, 3197, 3197, 3197, 3197, 3197, 3198,
+     3198, 3198, 3198, 3198, 3198, 3198, 3198, 3198, 3198, 3198,
+     3198, 3198, 3199, 3199,    0, 3199, 3199, 3199, 3199, 3199,
+     3199, 3199, 3199, 3199, 3199, 3200, 3200,    0,    0, 3200,
+     3200, 3200, 3200, 3200, 3200, 3201, 3201,    0, 3201, 3201,
+     3201, 3201, 3201, 3201, 3201, 3201, 3201, 3201, 3202, 3202,
+
+        0, 3202, 3202, 3202, 3202, 3202, 3202, 3202, 3202, 3202,
+     3202, 3203, 3203,    0, 3203, 3203, 3203, 3203, 3203, 3203,
+     3203, 3203, 3203, 3203, 3204, 3204,    0,    0, 3204, 3204,
+     3204, 3204, 3204, 3204, 3205, 3205,    0, 3205, 3205, 3205,
+     3205, 3205, 3205, 3205, 3205, 3205, 3205, 3206, 3206,    0,
+     3206, 3206, 3206, 3206, 3206, 3206, 3206, 3206, 3206, 3206,
+     3207, 3207,    0, 3207, 3207, 3207, 3207, 3207, 3207, 3207,
+     3207, 3207, 3207, 3208, 3208,    0,    0, 3208, 3208, 3208,
+     3208, 3208, 3208, 3209, 3209,    0, 3209, 3209, 3209, 3209,
+     3209, 3209, 3209, 3209, 3209, 3209, 3210, 3210,    0, 3210,
+
+     3210, 3210, 3210, 3210, 3210, 3210, 3210, 3210, 3210, 3211,
+     3211,    0, 3211, 3211, 3211, 3211, 3211, 3211, 3211, 3211,
+     3211, 3211, 3212, 3212,    0,    0, 3212, 3212, 3212, 3212,
+     3212, 3212, 3213, 3213,    0, 3213, 3213, 3213, 3213, 3213,
+     3213, 3213, 3213, 3213, 3213, 3214, 3214,    0, 3214, 3214,
+     3214, 3214, 3214, 3214, 3214, 3214, 3214, 3214, 3215, 3215,
+        0, 3215, 3215, 3215, 3215, 3215, 3215, 3215, 3215, 3215,
+     3215, 3216,    0, 3216, 3216,    0, 3216, 3216, 3216, 3216,
+     3216, 3216, 3216, 3216, 3217,    0, 3217, 3217,    0, 3217,
+     3217, 3217,    0, 3217, 3217, 3217, 3217, 3218, 3218,    0,
+
+        0, 3218, 3218, 3218, 3218, 3218, 3218, 3219, 3219,    0,
+     3219, 3219, 3219, 3219, 3219, 3219, 3219, 3219, 3219, 3219,
+     3220, 3220,    0, 3220, 3220, 3220, 3220, 3220, 3220, 3220,
+     3220, 3220, 3220, 3221, 3221,    0, 3221, 3221, 3221, 3221,
+     3221, 3221, 3221, 3221, 3221, 3221, 3222,    0, 3222, 3222,
+        0, 3222, 3222, 3222, 3222, 3222, 3222, 3222, 3222, 3223,
+     3223,    0,    0, 3223, 3223, 3223, 3223, 3223, 3223, 3224,
+     3224,    0, 3224, 3224, 3224, 3224, 3224, 3224, 3224, 3224,
+     3224, 3224, 3225, 3225,    0, 3225, 3225, 3225, 3225, 3225,
+     3225, 3225, 3225, 3225, 3225, 3226, 3226,    0, 3226, 3226,
+
+     3226, 3226, 3226, 3226, 3226, 3226, 3226, 3226, 3227,    0,
      3227, 3227,    0, 3227, 3227, 3227, 3227, 3227, 3227, 3227,
-     3227, 3227, 3227, 3228, 3228,    0, 3228, 3228, 3228, 3228,
-     3228, 3228, 3228, 3228, 3228, 3228, 3229, 3229,    0, 3229,
-     3229, 3229, 3229, 3229, 3229, 3229, 3229, 3229, 3229, 3230,
-     3230,    0, 3230, 3230, 3230, 3230, 3230, 3230, 3230, 3230,
-     3230, 3230, 3231, 3231,    0, 3231, 3231, 3231, 3231, 3231,
-
-     3231, 3231, 3231, 3231, 3231, 3232, 3232,    0, 3232, 3232,
-     3232, 3232, 3232, 3232, 3232, 3232, 3232, 3232, 3233, 3233,
-        0, 3233, 3233, 3233, 3233, 3233, 3233, 3233, 3233, 3233,
-     3233, 3234, 3234,    0, 3234, 3234, 3234, 3234, 3234, 3234,
-     3234, 3234, 3234, 3234, 3235, 3235,    0, 3235, 3235, 3235,
-     3235, 3235, 3235, 3235, 3235, 3235, 3235, 3236, 3236,    0,
-     3236, 3236, 3236, 3236, 3236, 3236, 3236, 3236, 3236, 3236,
-     3237, 3237,    0, 3237, 3237, 3237, 3237, 3237, 3237, 3237,
-     3237, 3237, 3237, 3238, 3238,    0, 3238, 3238, 3238, 3238,
-     3238, 3238, 3238, 3238, 3238, 3238, 3239, 3239, 3239, 3239,
-
-     3239, 3239, 3239, 3239, 3239, 3239, 3239, 3239, 3239, 3240,
-     3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240,
-     3240, 3240, 3241, 3241, 3241, 3241, 3241, 3241, 3241, 3241,
-     3241, 3241, 3241, 3241, 3241, 3242, 3242, 3242, 3242, 3242,
-     3242, 3242, 3242, 3242, 3242, 3242, 3242, 3242, 3243, 3243,
-     3243, 3243, 3243, 3243, 3243, 3243, 3243, 3243, 3243, 3243,
-     3243, 3244, 3244, 3244, 3244, 3244, 3244, 3244, 3244, 3244,
-     3244, 3244, 3244, 3244, 3245, 3245, 3245, 3245, 3245, 3245,
-     3245, 3245, 3245, 3245, 3245, 3245, 3245, 3246, 3246, 3246,
-     3246, 3246, 3246, 3246, 3246, 3246, 3246, 3246, 3246, 3246,
-
-     3247, 3247,    0, 3247, 3247, 3247, 3247, 3247, 3247, 3247,
-     3247, 3247, 3247, 3248, 3248, 3248, 3248, 3248, 3248, 3248,
-     3248, 3248, 3248, 3248, 3248, 3248, 3249, 3249, 3249, 3249,
-     3249, 3249, 3249, 3249, 3249, 3249, 3249, 3249, 3249, 3250,
-     3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250,
+     3227, 3228, 3228,    0,    0, 3228, 3228, 3228, 3228, 3228,
+     3228, 3229, 3229,    0, 3229, 3229, 3229, 3229, 3229, 3229,
+     3229, 3229, 3229, 3229, 3230, 3230,    0, 3230, 3230, 3230,
+     3230, 3230, 3230, 3230, 3230, 3230, 3230, 3231, 3231,    0,
+     3231, 3231, 3231, 3231, 3231, 3231, 3231, 3231, 3231, 3231,
+     3232, 3232,    0,    0, 3232, 3232, 3232, 3232, 3232, 3232,
+     3233, 3233,    0, 3233, 3233, 3233, 3233, 3233, 3233, 3233,
+     3233, 3233, 3233, 3234, 3234,    0, 3234, 3234, 3234, 3234,
+
+     3234, 3234, 3234, 3234, 3234, 3234, 3235, 3235,    0, 3235,
+     3235, 3235, 3235, 3235, 3235, 3235, 3235, 3235, 3235, 3236,
+     3236,    0,    0, 3236, 3236, 3236, 3236, 3236, 3236, 3237,
+     3237,    0, 3237, 3237, 3237, 3237, 3237, 3237, 3237, 3237,
+     3237, 3237, 3238, 3238,    0, 3238, 3238, 3238, 3238, 3238,
+     3238, 3238, 3238, 3238, 3238, 3239, 3239,    0, 3239, 3239,
+     3239, 3239, 3239, 3239, 3239, 3239, 3239, 3239, 3240, 3240,
+        0, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240,
+     3240, 3241, 3241,    0, 3241, 3241, 3241, 3241, 3241, 3241,
+     3241, 3241, 3241, 3241, 3242, 3242,    0,    0, 3242, 3242,
+
+     3242, 3242, 3242, 3242, 3243, 3243,    0, 3243, 3243, 3243,
+     3243, 3243, 3243, 3243, 3243, 3243, 3243, 3244, 3244,    0,
+     3244, 3244, 3244, 3244, 3244, 3244, 3244, 3244, 3244, 3244,
+     3245, 3245,    0, 3245, 3245, 3245, 3245, 3245, 3245, 3245,
+     3245, 3245, 3245, 3246, 3246,    0,    0, 3246, 3246, 3246,
+     3246, 3246, 3246, 3247, 3247,    0, 3247, 3247, 3247, 3247,
+     3247, 3247, 3247, 3247, 3247, 3247, 3248, 3248,    0, 3248,
+     3248, 3248, 3248, 3248, 3248, 3248, 3248, 3248, 3248, 3249,
+     3249,    0, 3249, 3249, 3249, 3249, 3249, 3249, 3249, 3249,
+     3249, 3249, 3250, 3250,    0,    0, 3250, 3250, 3250, 3250,
+
      3250, 3250, 3251, 3251,    0, 3251, 3251, 3251, 3251, 3251,
      3251, 3251, 3251, 3251, 3251, 3252, 3252,    0, 3252, 3252,
      3252, 3252, 3252, 3252, 3252, 3252, 3252, 3252, 3253, 3253,
-     3253, 3253, 3253, 3253, 3253, 3253, 3253, 3253, 3253, 3253,
-     3253, 3254, 3254, 3254, 3254, 3254, 3254, 3254, 3254, 3254,
-
-     3254, 3254, 3254, 3254, 3255, 3255, 3255, 3255, 3255, 3255,
-     3255, 3255, 3255, 3255, 3255, 3255, 3255, 3256, 3256, 3256,
-     3256, 3256, 3256, 3256, 3256, 3256, 3256, 3256, 3256, 3256,
+        0, 3253, 3253, 3253, 3253, 3253, 3253, 3253, 3253, 3253,
+     3253, 3254, 3254,    0, 3254, 3254, 3254, 3254, 3254, 3254,
+     3254, 3254, 3254, 3254, 3255, 3255,    0, 3255, 3255, 3255,
+     3255, 3255, 3255, 3255, 3255, 3255, 3255, 3256, 3256,    0,
+        0, 3256, 3256, 3256, 3256, 3256, 3256, 3257, 3257,    0,
      3257, 3257, 3257, 3257, 3257, 3257, 3257, 3257, 3257, 3257,
-     3257, 3257, 3257, 3258, 3258, 3258, 3258, 3258, 3258, 3258,
-     3258, 3258, 3258, 3258, 3258, 3258, 3259, 3259, 3259, 3259,
-     3259, 3259, 3259, 3259, 3259, 3259, 3259, 3259, 3259, 3260,
-     3260, 3260, 3260, 3260, 3260, 3260, 3260, 3260, 3260, 3260,
-     3260, 3260, 3261, 3261,    0, 3261, 3261, 3261, 3261, 3261,
-     3261, 3261, 3261, 3261, 3261, 3262, 3262, 3262, 3262, 3262,
-
-     3262, 3262, 3262, 3262, 3262, 3262, 3262, 3262, 3263, 3263,
-     3263, 3263, 3263, 3263, 3263, 3263, 3263, 3263, 3263, 3263,
-     3263, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264,
-     3264, 3264, 3264, 3264, 3266, 3266,    0, 3266, 3266, 3266,
-     3266, 3266, 3266, 3266, 3266, 3266, 3266, 3267, 3267,    0,
-     3267, 3267, 3267, 3267, 3267, 3267, 3267, 3267, 3267, 3267,
-     3268, 3268,    0, 3268, 3268, 3268, 3268, 3268, 3268, 3268,
-     3268, 3268, 3268, 3269, 3269,    0, 3269, 3269, 3269, 3269,
-     3269, 3269, 3269, 3269, 3269, 3269, 3270, 3270,    0, 3270,
-     3270, 3270, 3270, 3270, 3270, 3270, 3270, 3270, 3270, 3271,
-
-     3271,    0, 3271, 3271, 3271, 3271, 3271, 3271, 3271, 3271,
-     3271, 3271, 3272, 3272,    0, 3272, 3272, 3272, 3272, 3272,
-     3272, 3272, 3272, 3272, 3272, 3273, 3273,    0, 3273, 3273,
-     3273, 3273, 3273, 3273, 3273, 3273, 3273, 3273, 3274, 3274,
-        0, 3274, 3274, 3274, 3274, 3274, 3274, 3274, 3274, 3274,
-     3274, 3275, 3275,    0, 3275, 3275, 3275, 3275, 3275, 3275,
-     3275, 3275, 3275, 3275, 3276, 3276,    0, 3276, 3276, 3276,
-     3276, 3276, 3276, 3276, 3276, 3276, 3276, 3277, 3277,    0,
-     3277, 3277, 3277, 3277, 3277, 3277, 3277, 3277, 3277, 3277,
-     3278, 3278,    0, 3278, 3278, 3278, 3278, 3278, 3278, 3278,
-
-     3278, 3278, 3278, 3279, 3279,    0, 3279, 3279, 3279, 3279,
-     3279, 3279, 3279, 3279, 3279, 3279, 3280, 3280,    0, 3280,
-     3280, 3280, 3280, 3280, 3280, 3280, 3280, 3280, 3280, 3281,
-     3281,    0, 3281, 3281, 3281, 3281, 3281, 3281, 3281, 3281,
-     3281, 3281, 3282, 3282,    0, 3282, 3282, 3282, 3282, 3282,
-     3282, 3282, 3282, 3282, 3282, 3283, 3283,    0, 3283, 3283,
-     3283, 3283, 3283, 3283, 3283, 3283, 3283, 3283, 3284, 3284,
-     3284, 3284, 3284,    0, 3284, 3284, 3284, 3284, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3286, 3286, 3286, 3286, 3286, 3286, 3286, 3286, 3286,
-
-     3286, 3286, 3286, 3286, 3287, 3287, 3287, 3287, 3287, 3287,
-     3287, 3287, 3287, 3287, 3287, 3287, 3287, 3288, 3288, 3288,
-     3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288,
-     3289, 3289,    0, 3289, 3289, 3289, 3289, 3289, 3289, 3289,
-     3289, 3289, 3289, 3290, 3290,    0, 3290, 3290, 3290, 3290,
-     3290, 3290, 3290, 3290, 3290, 3290, 3291, 3291, 3291, 3291,
-     3291, 3291, 3291, 3291, 3291, 3291, 3291, 3291, 3291, 3292,
-     3292, 3292, 3292, 3292, 3292, 3292, 3292, 3292, 3292, 3292,
-     3292, 3292, 3293, 3293, 3293, 3293, 3293, 3293, 3293, 3293,
-     3293, 3293, 3293, 3293, 3293, 3294, 3294,    0, 3294, 3294,
-
-     3294, 3294, 3294, 3294, 3294, 3294, 3294, 3294, 3295, 3295,
-     3295, 3295, 3295, 3295, 3295, 3295, 3295, 3295, 3295, 3295,
-     3295, 3296, 3296, 3296, 3296, 3296, 3296, 3296, 3296, 3296,
-     3296, 3296, 3296, 3296, 3297, 3297, 3297, 3297, 3297, 3297,
-     3297, 3297, 3297, 3297, 3297, 3297, 3297, 3298, 3298, 3298,
-     3298, 3298, 3298, 3298, 3298, 3298, 3298, 3298, 3298, 3298,
-     3299, 3299, 3299, 3299, 3299, 3299, 3299, 3299, 3299, 3299,
-     3299, 3299, 3299, 3300, 3300, 3300, 3300, 3300, 3300, 3300,
-     3300, 3300, 3300, 3300, 3300, 3300, 3301, 3301, 3301, 3301,
-     3301, 3301, 3301, 3301, 3301, 3301, 3301, 3301, 3301, 3302,
-
-     3302, 3302, 3302, 3302, 3302, 3302, 3302, 3302, 3302, 3302,
-     3302, 3302, 3303, 3303, 3303, 3303, 3303, 3303, 3303, 3303,
-     3303, 3303, 3303, 3303, 3303, 3304, 3304, 3304, 3304, 3304,
-     3304, 3304, 3304, 3304, 3304, 3304, 3304, 3304, 3305, 3305,
+     3258, 3258,    0, 3258, 3258, 3258, 3258, 3258, 3258, 3258,
+
+     3258, 3258, 3258, 3259, 3259,    0, 3259, 3259, 3259, 3259,
+     3259, 3259, 3259, 3259, 3259, 3259, 3260, 3260,    0,    0,
+     3260, 3260, 3260, 3260, 3260, 3260, 3261, 3261,    0, 3261,
+     3261, 3261, 3261, 3261, 3261, 3261, 3261, 3261, 3261, 3262,
+     3262,    0, 3262, 3262, 3262, 3262, 3262, 3262, 3262, 3262,
+     3262, 3262, 3263, 3263,    0, 3263, 3263, 3263, 3263, 3263,
+     3263, 3263, 3263, 3263, 3263, 3264, 3264,    0,    0, 3264,
+     3264, 3264, 3264, 3264, 3264, 3265, 3265,    0, 3265, 3265,
+     3265, 3265, 3265, 3265, 3265, 3265, 3265, 3265, 3266, 3266,
+        0, 3266, 3266, 3266, 3266, 3266, 3266, 3266, 3266, 3266,
+
+     3266, 3267, 3267,    0, 3267, 3267, 3267, 3267, 3267, 3267,
+     3267, 3267, 3267, 3267, 3268, 3268,    0,    0, 3268, 3268,
+     3268, 3268, 3268, 3268, 3269, 3269,    0, 3269, 3269, 3269,
+     3269, 3269, 3269, 3269, 3269, 3269, 3269, 3270, 3270,    0,
+     3270, 3270, 3270, 3270, 3270, 3270, 3270, 3270, 3270, 3270,
+     3271, 3271,    0, 3271, 3271, 3271, 3271, 3271, 3271, 3271,
+     3271, 3271, 3271, 3272, 3272, 3272, 3272, 3272,    0, 3272,
+     3272, 3272, 3272, 3273, 3273, 3273, 3273, 3273, 3273, 3273,
+     3273, 3273, 3273, 3273, 3273, 3273, 3274, 3274,    0, 3274,
+     3274, 3274, 3274, 3274, 3274, 3274, 3274, 3274, 3274, 3275,
+
+     3275,    0, 3275, 3275, 3275, 3275, 3275, 3275, 3275, 3275,
+     3275, 3275, 3276, 3276,    0, 3276, 3276, 3276, 3276, 3276,
+     3276, 3276, 3276, 3276, 3276, 3277, 3277,    0, 3277, 3277,
+     3277, 3277, 3277, 3277, 3277, 3277, 3277, 3277, 3278, 3278,
+        0, 3278, 3278, 3278, 3278, 3278, 3278, 3278, 3278, 3278,
+     3278, 3279,    0, 3279, 3279,    0, 3279, 3279, 3279, 3279,
+     3279, 3279, 3279, 3279, 3280, 3280,    0, 3280, 3280, 3280,
+     3280, 3280, 3280, 3280, 3280, 3280, 3280, 3281, 3281,    0,
+     3281, 3281, 3281, 3281, 3281, 3281, 3281, 3281, 3281, 3281,
+     3282, 3282, 3282, 3282, 3282, 3282, 3282, 3282, 3282, 3282,
+
+     3282, 3282, 3282, 3283, 3283,    0, 3283, 3283, 3283, 3283,
+     3283, 3283, 3283, 3283, 3283, 3283, 3284, 3284,    0, 3284,
+     3284, 3284, 3284, 3284, 3284, 3284, 3284, 3284, 3284, 3285,
+     3285,    0, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
+     3285, 3285, 3286, 3286,    0, 3286, 3286, 3286, 3286, 3286,
+     3286, 3286, 3286, 3286, 3286, 3287, 3287,    0, 3287, 3287,
+     3287, 3287, 3287, 3287, 3287, 3287, 3287, 3287, 3288, 3288,
+        0, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288,
+     3288, 3289, 3289,    0, 3289, 3289, 3289, 3289, 3289, 3289,
+     3289, 3289, 3289, 3289, 3290, 3290,    0, 3290, 3290, 3290,
+
+     3290, 3290, 3290, 3290, 3290, 3290, 3290, 3291, 3291,    0,
+     3291, 3291, 3291, 3291, 3291, 3291, 3291, 3291, 3291, 3291,
+     3292, 3292,    0, 3292, 3292, 3292, 3292, 3292, 3292, 3292,
+     3292, 3292, 3292, 3293, 3293,    0, 3293, 3293, 3293, 3293,
+     3293, 3293, 3293, 3293, 3293, 3293, 3294, 3294,    0, 3294,
+     3294, 3294, 3294, 3294, 3294, 3294, 3294, 3294, 3294, 3295,
+     3295,    0, 3295, 3295, 3295, 3295, 3295, 3295, 3295, 3295,
+     3295, 3295, 3296, 3296,    0, 3296, 3296, 3296, 3296, 3296,
+     3296, 3296, 3296, 3296, 3296, 3297, 3297,    0, 3297, 3297,
+     3297, 3297, 3297, 3297, 3297, 3297, 3297, 3297, 3298, 3298,
+
+        0, 3298, 3298, 3298, 3298, 3298, 3298, 3298, 3298, 3298,
+     3298, 3299, 3299,    0, 3299, 3299, 3299, 3299, 3299, 3299,
+     3299, 3299, 3299, 3299, 3300, 3300,    0, 3300, 3300, 3300,
+     3300, 3300, 3300, 3300, 3300, 3300, 3300, 3301, 3301,    0,
+     3301, 3301, 3301, 3301, 3301, 3301, 3301, 3301, 3301, 3301,
+     3302, 3302,    0, 3302, 3302, 3302, 3302, 3302, 3302, 3302,
+     3302, 3302, 3302, 3303, 3303, 3303, 3303, 3303, 3303, 3303,
+     3303, 3303, 3303, 3303, 3303, 3303, 3304, 3304, 3304, 3304,
+     3304, 3304, 3304, 3304, 3304, 3304, 3304, 3304, 3304, 3305,
      3305, 3305, 3305, 3305, 3305, 3305, 3305, 3305, 3305, 3305,
-     3305, 3306, 3306, 3306, 3306, 3306, 3306, 3306, 3306, 3306,
-     3306, 3306, 3306, 3306, 3307, 3307, 3307, 3307, 3307, 3307,
-     3307, 3307, 3307, 3307, 3307, 3307, 3307, 3308, 3308, 3308,
+
+     3305, 3305, 3306, 3306, 3306, 3306, 3306, 3306, 3306, 3306,
+     3306, 3306, 3306, 3306, 3306, 3307, 3307, 3307, 3307, 3307,
+     3307, 3307, 3307, 3307, 3307, 3307, 3307, 3307, 3308, 3308,
      3308, 3308, 3308, 3308, 3308, 3308, 3308, 3308, 3308, 3308,
-     3309, 3309, 3309, 3309, 3309, 3309, 3309, 3309, 3309, 3309,
-
-     3309, 3309, 3309, 3310, 3310, 3310, 3310, 3310, 3310, 3310,
-     3310, 3310, 3310, 3310, 3310, 3310, 3311, 3311, 3311, 3311,
-     3311, 3311, 3311, 3311, 3311, 3311, 3311, 3311, 3311, 3312,
-     3312,    0, 3312, 3312, 3312, 3312, 3312, 3312, 3312, 3312,
-     3312, 3312, 3313, 3313, 3313, 3313, 3313, 3313, 3313, 3313,
-     3313, 3313, 3313, 3313, 3313, 3314, 3314, 3314, 3314, 3314,
-     3314, 3314, 3314, 3314, 3314, 3314, 3314, 3314, 3315, 3315,
-     3315, 3315, 3315, 3315, 3315, 3315, 3315, 3315, 3315, 3315,
-     3315, 3316, 3316, 3316, 3316, 3316, 3316, 3316, 3316, 3316,
-     3316, 3316, 3316, 3316, 3317, 3317, 3317, 3317, 3317, 3317,
-
-     3317, 3317, 3317, 3317, 3317, 3317, 3317, 3318, 3318, 3318,
+     3308, 3309, 3309, 3309, 3309, 3309, 3309, 3309, 3309, 3309,
+     3309, 3309, 3309, 3309, 3310, 3310, 3310, 3310, 3310, 3310,
+     3310, 3310, 3310, 3310, 3310, 3310, 3310, 3311, 3311,    0,
+     3311, 3311, 3311, 3311, 3311, 3311, 3311, 3311, 3311, 3311,
+     3312, 3312, 3312, 3312, 3312, 3312, 3312, 3312, 3312, 3312,
+     3312, 3312, 3312, 3313, 3313, 3313, 3313, 3313, 3313, 3313,
+
+     3313, 3313, 3313, 3313, 3313, 3313, 3314, 3314, 3314, 3314,
+     3314, 3314, 3314, 3314, 3314, 3314, 3314, 3314, 3314, 3315,
+     3315,    0, 3315, 3315, 3315, 3315, 3315, 3315, 3315, 3315,
+     3315, 3315, 3316, 3316,    0, 3316, 3316, 3316, 3316, 3316,
+     3316, 3316, 3316, 3316, 3316, 3317, 3317, 3317, 3317, 3317,
+     3317, 3317, 3317, 3317, 3317, 3317, 3317, 3317, 3318, 3318,
      3318, 3318, 3318, 3318, 3318, 3318, 3318, 3318, 3318, 3318,
-     3319, 3319, 3319, 3319, 3319, 3319, 3319, 3319, 3319, 3319,
-     3319, 3319, 3319, 3320, 3320, 3320, 3320, 3320, 3320, 3320,
-     3320, 3320, 3320, 3320, 3320, 3320, 3321, 3321, 3321, 3321,
-     3321, 3321, 3321, 3321, 3321, 3321, 3321, 3321, 3321, 3322,
+     3318, 3319, 3319, 3319, 3319, 3319, 3319, 3319, 3319, 3319,
+     3319, 3319, 3319, 3319, 3320, 3320, 3320, 3320, 3320, 3320,
+     3320, 3320, 3320, 3320, 3320, 3320, 3320, 3321, 3321, 3321,
+
+     3321, 3321, 3321, 3321, 3321, 3321, 3321, 3321, 3321, 3321,
      3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
-     3322, 3322, 3323, 3323, 3323, 3323, 3323, 3323, 3323, 3323,
-     3323, 3323, 3323, 3323, 3323, 3324, 3324, 3324, 3324, 3324,
-     3324, 3324, 3324, 3324, 3324, 3324, 3324, 3324, 3325, 3325,
-
-     3325, 3325, 3325, 3325, 3325, 3325, 3325, 3325, 3325, 3325,
-     3325, 3326, 3326, 3326, 3326, 3326, 3326, 3326, 3326, 3326,
-     3326, 3326, 3326, 3326, 3327, 3327, 3327, 3327, 3327, 3327,
-     3327, 3327, 3327, 3327, 3327, 3327, 3327, 3328, 3328, 3328,
+     3322, 3322, 3322, 3323, 3323, 3323, 3323, 3323, 3323, 3323,
+     3323, 3323, 3323, 3323, 3323, 3323, 3324, 3324, 3324, 3324,
+     3324, 3324, 3324, 3324, 3324, 3324, 3324, 3324, 3324, 3325,
+     3325,    0, 3325, 3325, 3325, 3325, 3325, 3325, 3325, 3325,
+     3325, 3325, 3326, 3326, 3326, 3326, 3326, 3326, 3326, 3326,
+     3326, 3326, 3326, 3326, 3326, 3327, 3327, 3327, 3327, 3327,
+     3327, 3327, 3327, 3327, 3327, 3327, 3327, 3327, 3328, 3328,
      3328, 3328, 3328, 3328, 3328, 3328, 3328, 3328, 3328, 3328,
-     3329, 3329, 3329, 3329, 3329, 3329, 3329, 3329, 3329, 3329,
-     3329, 3329, 3329, 3330, 3330, 3330, 3330, 3330,    0, 3330,
-     3330, 3330, 3330, 3331, 3331,    0, 3331, 3331, 3331, 3331,
-     3331, 3331, 3331, 3331, 3331, 3331, 3332, 3332,    0, 3332,
-     3332, 3332, 3332, 3332, 3332, 3332, 3332, 3332, 3332, 3333,
-
-     3333, 3333, 3333, 3333, 3333, 3333, 3333, 3333, 3333, 3333,
-     3333, 3333, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 3334,
-     3334, 3334, 3334, 3334, 3334, 3335, 3335, 3335, 3335, 3335,
-     3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3336, 3336,
-     3336, 3336, 3336, 3336, 3336, 3336,    0, 3336, 3336, 3336,
-     3336, 3337, 3337, 3337, 3337, 3337, 3337, 3337, 3337, 3337,
-     3337, 3337, 3337, 3337, 3338, 3338, 3338, 3338, 3338, 3338,
-     3338, 3338, 3338, 3338, 3338, 3338, 3338, 3339, 3339, 3339,
-     3339, 3339, 3339, 3339, 3339,    0, 3339, 3339, 3339, 3339,
-     3340, 3340, 3340, 3340, 3340, 3340, 3340, 3340, 3340, 3340,
-
-     3340, 3340, 3340, 3341, 3341, 3341, 3341, 3341, 3341, 3341,
-     3341, 3341, 3341, 3341, 3341, 3341, 3342, 3342, 3342, 3342,
-     3342, 3342, 3342, 3342, 3342, 3342, 3342, 3342, 3342, 3343,
-     3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343,
-     3343, 3343, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 3344,
-     3344, 3344, 3344, 3344, 3344, 3345, 3345, 3345, 3345, 3345,
-     3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3346, 3346,
-     3346, 3346, 3346, 3346, 3346, 3346, 3346, 3346, 3346, 3346,
-     3346, 3347, 3347, 3347, 3347, 3347, 3347, 3347, 3347, 3347,
-     3347, 3347, 3347, 3347, 3348, 3348, 3348, 3348, 3348, 3348,
-
-     3348, 3348, 3348, 3348, 3348, 3348, 3348, 3349, 3349, 3349,
-     3349, 3349, 3349, 3349, 3349, 3349, 3349, 3349, 3349, 3349,
+
+     3328, 3330, 3330,    0, 3330, 3330, 3330, 3330, 3330, 3330,
+     3330, 3330, 3330, 3330, 3331, 3331,    0, 3331, 3331, 3331,
+     3331, 3331, 3331, 3331, 3331, 3331, 3331, 3332, 3332,    0,
+     3332, 3332, 3332, 3332, 3332, 3332, 3332, 3332, 3332, 3332,
+     3333, 3333,    0, 3333, 3333, 3333, 3333, 3333, 3333, 3333,
+     3333, 3333, 3333, 3334, 3334,    0, 3334, 3334, 3334, 3334,
+     3334, 3334, 3334, 3334, 3334, 3334, 3335, 3335,    0, 3335,
+     3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3336,
+     3336,    0, 3336, 3336, 3336, 3336, 3336, 3336, 3336, 3336,
+     3336, 3336, 3337, 3337,    0, 3337, 3337, 3337, 3337, 3337,
+
+     3337, 3337, 3337, 3337, 3337, 3338, 3338,    0, 3338, 3338,
+     3338, 3338, 3338, 3338, 3338, 3338, 3338, 3338, 3339, 3339,
+        0, 3339, 3339, 3339, 3339, 3339, 3339, 3339, 3339, 3339,
+     3339, 3340, 3340,    0, 3340, 3340, 3340, 3340, 3340, 3340,
+     3340, 3340, 3340, 3340, 3341, 3341,    0, 3341, 3341, 3341,
+     3341, 3341, 3341, 3341, 3341, 3341, 3341, 3342, 3342,    0,
+     3342, 3342, 3342, 3342, 3342, 3342, 3342, 3342, 3342, 3342,
+     3343, 3343,    0, 3343, 3343, 3343, 3343, 3343, 3343, 3343,
+     3343, 3343, 3343, 3344, 3344,    0, 3344, 3344, 3344, 3344,
+     3344, 3344, 3344, 3344, 3344, 3344, 3345, 3345,    0, 3345,
+
+     3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3346,
+     3346,    0, 3346, 3346, 3346, 3346, 3346, 3346, 3346, 3346,
+     3346, 3346, 3347, 3347,    0, 3347, 3347, 3347, 3347, 3347,
+     3347, 3347, 3347, 3347, 3347, 3348, 3348,    0, 3348, 3348,
+     3348, 3348, 3348, 3348, 3348, 3348, 3348, 3348, 3349, 3349,
+     3349, 3349, 3349,    0, 3349, 3349, 3349, 3349, 3350, 3350,
      3350, 3350, 3350, 3350, 3350, 3350, 3350, 3350, 3350, 3350,
-     3350, 3350, 3350, 3351, 3351, 3351, 3351, 3351, 3351, 3351,
-     3351, 3351, 3351, 3351, 3351, 3351, 3352, 3352, 3352, 3352,
-     3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3353,
+     3350, 3351, 3351, 3351, 3351, 3351, 3351, 3351, 3351, 3351,
+     3351, 3351, 3351, 3351, 3352, 3352, 3352, 3352, 3352, 3352,
+     3352, 3352, 3352, 3352, 3352, 3352, 3352, 3353, 3353, 3353,
+
      3353, 3353, 3353, 3353, 3353, 3353, 3353, 3353, 3353, 3353,
-     3353, 3353, 3354, 3354, 3354, 3354, 3354, 3354, 3354, 3354,
-     3354, 3354, 3354, 3354, 3354, 3355, 3355, 3355, 3355, 3355,
-     3355, 3355, 3355, 3355, 3355, 3355, 3355, 3355, 3356, 3356,
-
-     3356, 3356, 3356, 3356, 3356, 3356, 3356, 3356, 3356, 3356,
-     3356, 3357, 3357, 3357, 3357, 3357, 3357, 3357, 3357, 3357,
-     3357, 3357, 3357, 3357, 3358, 3358, 3358, 3358, 3358, 3358,
-     3358, 3358, 3358, 3358, 3358, 3358, 3358, 3359, 3359, 3359,
-     3359, 3359, 3359, 3359, 3359, 3359, 3359, 3359, 3359, 3359,
+     3354, 3354,    0, 3354, 3354, 3354, 3354, 3354, 3354, 3354,
+     3354, 3354, 3354, 3355, 3355,    0, 3355, 3355, 3355, 3355,
+     3355, 3355, 3355, 3355, 3355, 3355, 3356, 3356, 3356, 3356,
+     3356, 3356, 3356, 3356, 3356, 3356, 3356, 3356, 3356, 3357,
+     3357, 3357, 3357, 3357, 3357, 3357, 3357, 3357, 3357, 3357,
+     3357, 3357, 3358, 3358, 3358, 3358, 3358, 3358, 3358, 3358,
+     3358, 3358, 3358, 3358, 3358, 3359, 3359,    0, 3359, 3359,
+     3359, 3359, 3359, 3359, 3359, 3359, 3359, 3359, 3360, 3360,
      3360, 3360, 3360, 3360, 3360, 3360, 3360, 3360, 3360, 3360,
-     3360, 3360, 3360, 3361, 3361, 3361, 3361, 3361, 3361, 3361,
-     3361, 3361, 3361, 3361, 3361, 3361, 3362, 3362, 3362, 3362,
-     3362, 3362, 3362, 3362, 3362, 3362, 3362, 3362, 3362, 3363,
-     3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363,
 
-     3363, 3363, 3364, 3364, 3364, 3364, 3364, 3364, 3364, 3364,
-     3364, 3364, 3364, 3364, 3364, 3365, 3365, 3365, 3365, 3365,
-     3365, 3365, 3365, 3365, 3365, 3365, 3365, 3365, 3366, 3366,
-     3366, 3366, 3366, 3366, 3366, 3366, 3366, 3366, 3366, 3366,
-     3366, 3367, 3367, 3367, 3367, 3367, 3367, 3367, 3367, 3367,
-     3367, 3367, 3367, 3367, 3368, 3368, 3368, 3368, 3368, 3368,
-     3368, 3368, 3368, 3368, 3368, 3368, 3368, 3369, 3369, 3369,
-     3369, 3369, 3369, 3369, 3369, 3369, 3369, 3369, 3369, 3369,
+     3360, 3361, 3361, 3361, 3361, 3361, 3361, 3361, 3361, 3361,
+     3361, 3361, 3361, 3361, 3362, 3362, 3362, 3362, 3362, 3362,
+     3362, 3362, 3362, 3362, 3362, 3362, 3362, 3363, 3363, 3363,
+     3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363,
+     3364, 3364, 3364, 3364, 3364, 3364, 3364, 3364, 3364, 3364,
+     3364, 3364, 3364, 3365, 3365, 3365, 3365, 3365, 3365, 3365,
+     3365, 3365, 3365, 3365, 3365, 3365, 3366, 3366, 3366, 3366,
+     3366, 3366, 3366, 3366, 3366, 3366, 3366, 3366, 3366, 3367,
+     3367, 3367, 3367, 3367, 3367, 3367, 3367, 3367, 3367, 3367,
+     3367, 3367, 3368, 3368, 3368, 3368, 3368, 3368, 3368, 3368,
+
+     3368, 3368, 3368, 3368, 3368, 3369, 3369, 3369, 3369, 3369,
+     3369, 3369, 3369, 3369, 3369, 3369, 3369, 3369, 3370, 3370,
      3370, 3370, 3370, 3370, 3370, 3370, 3370, 3370, 3370, 3370,
-     3370, 3370, 3370, 3371, 3371, 3371, 3371, 3371, 3371, 3371,
-
-     3371, 3371, 3371, 3371, 3371, 3371, 3372, 3372, 3372, 3372,
-     3372, 3372, 3372, 3372, 3372, 3372, 3372, 3372, 3372, 3373,
+     3370, 3371, 3371, 3371, 3371, 3371, 3371, 3371, 3371, 3371,
+     3371, 3371, 3371, 3371, 3372, 3372, 3372, 3372, 3372, 3372,
+     3372, 3372, 3372, 3372, 3372, 3372, 3372, 3373, 3373, 3373,
      3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373,
-     3373, 3373, 3374, 3374, 3374, 3374, 3374, 3374, 3374, 3374,
-     3374, 3374, 3374, 3374, 3374, 3375, 3375, 3375, 3375, 3375,
-     3375, 3375, 3375, 3375, 3375, 3375, 3375, 3375, 3376, 3376,
-     3376, 3376, 3376, 3376, 3376, 3376, 3376, 3376, 3376, 3376,
-     3376, 3377, 3377, 3377, 3377, 3377, 3377, 3377, 3377, 3377,
-     3377, 3377, 3377, 3378, 3378, 3378, 3378, 3378,    0, 3378,
-     3378, 3378, 3378, 3379, 3379, 3379, 3379, 3379, 3379, 3379,
-
-     3379,    0, 3379, 3379, 3379, 3379, 3380, 3380, 3380, 3380,
-     3380, 3380, 3380, 3380,    0, 3380, 3380, 3380, 3380, 3381,
-     3381,    0, 3381, 3381, 3381, 3381, 3381, 3381, 3381, 3381,
-     3381, 3381, 3382, 3382,    0, 3382, 3382, 3382, 3382, 3382,
-     3382, 3382, 3382, 3382, 3382, 3383, 3383, 3383, 3383, 3383,
-     3383, 3383, 3383, 3383, 3383, 3383, 3383, 3383, 3384, 3384,
-     3384, 3384, 3384, 3384, 3384, 3384,    0, 3384, 3384, 3384,
-     3384, 3385, 3385,    0, 3385, 3385, 3385, 3385, 3385, 3385,
-     3385, 3385, 3385, 3385, 3386, 3386, 3386, 3386, 3386, 3386,
-     3386, 3386, 3386, 3386, 3386, 3386, 3386, 3387, 3387, 3387,
-
-     3387, 3387, 3387, 3387, 3387,    0, 3387, 3387, 3387, 3387,
-     3388, 3388, 3388, 3388, 3388, 3388, 3388, 3388, 3388, 3388,
-     3388, 3388, 3388, 3389, 3389, 3389, 3389, 3389, 3389, 3389,
-     3389, 3389, 3389, 3389, 3389, 3389, 3390, 3390, 3390, 3390,
-     3390, 3390, 3390, 3390,    0, 3390, 3390, 3390, 3390, 3391,
-     3391, 3391, 3391, 3391, 3391, 3391, 3391, 3391, 3391, 3391,
-     3391, 3391, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392,
-     3392, 3392, 3392, 3392, 3392, 3393, 3393, 3393, 3393, 3393,
-     3393, 3393, 3393, 3393, 3393, 3393, 3393, 3393, 3394, 3394,
+     3374, 3374, 3374, 3374, 3374, 3374, 3374, 3374, 3374, 3374,
+     3374, 3374, 3374, 3375, 3375, 3375, 3375, 3375, 3375, 3375,
+     3375, 3375, 3375, 3375, 3375, 3375, 3376, 3376, 3376, 3376,
+
+     3376, 3376, 3376, 3376, 3376, 3376, 3376, 3376, 3376, 3377,
+     3377,    0, 3377, 3377, 3377, 3377, 3377, 3377, 3377, 3377,
+     3377, 3377, 3378, 3378, 3378, 3378, 3378, 3378, 3378, 3378,
+     3378, 3378, 3378, 3378, 3378, 3379, 3379, 3379, 3379, 3379,
+     3379, 3379, 3379, 3379, 3379, 3379, 3379, 3379, 3380, 3380,
+     3380, 3380, 3380, 3380, 3380, 3380, 3380, 3380, 3380, 3380,
+     3380, 3381, 3381, 3381, 3381, 3381, 3381, 3381, 3381, 3381,
+     3381, 3381, 3381, 3381, 3382, 3382, 3382, 3382, 3382, 3382,
+     3382, 3382, 3382, 3382, 3382, 3382, 3382, 3383, 3383, 3383,
+     3383, 3383, 3383, 3383, 3383, 3383, 3383, 3383, 3383, 3383,
+
+     3384, 3384, 3384, 3384, 3384, 3384, 3384, 3384, 3384, 3384,
+     3384, 3384, 3384, 3385, 3385, 3385, 3385, 3385, 3385, 3385,
+     3385, 3385, 3385, 3385, 3385, 3385, 3386, 3386, 3386, 3386,
+     3386, 3386, 3386, 3386, 3386, 3386, 3386, 3386, 3386, 3387,
+     3387, 3387, 3387, 3387, 3387, 3387, 3387, 3387, 3387, 3387,
+     3387, 3387, 3388, 3388, 3388, 3388, 3388, 3388, 3388, 3388,
+     3388, 3388, 3388, 3388, 3388, 3389, 3389, 3389, 3389, 3389,
+     3389, 3389, 3389, 3389, 3389, 3389, 3389, 3389, 3390, 3390,
+     3390, 3390, 3390, 3390, 3390, 3390, 3390, 3390, 3390, 3390,
+     3390, 3391, 3391, 3391, 3391, 3391, 3391, 3391, 3391, 3391,
+
+     3391, 3391, 3391, 3391, 3392, 3392, 3392, 3392, 3392, 3392,
+     3392, 3392, 3392, 3392, 3392, 3392, 3392, 3393, 3393, 3393,
+     3393, 3393, 3393, 3393, 3393, 3393, 3393, 3393, 3393, 3393,
      3394, 3394, 3394, 3394, 3394, 3394, 3394, 3394, 3394, 3394,
-
-     3394, 3395, 3395, 3395, 3395, 3395, 3395, 3395, 3395, 3395,
-     3395, 3395, 3395, 3395, 3396, 3396, 3396, 3396, 3396, 3396,
-     3396, 3396, 3396, 3396, 3396, 3396, 3396, 3397, 3397, 3397,
-     3397, 3397, 3397, 3397, 3397, 3397, 3397, 3397, 3397, 3397,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855, 2855,
-     2855, 2855, 2855, 2855, 2855
+     3394, 3394, 3394, 3395, 3395, 3395, 3395, 3395,    0, 3395,
+     3395, 3395, 3395, 3396, 3396,    0, 3396, 3396, 3396, 3396,
+     3396, 3396, 3396, 3396, 3396, 3396, 3397, 3397,    0, 3397,
+     3397, 3397, 3397, 3397, 3397, 3397, 3397, 3397, 3397, 3398,
+     3398, 3398, 3398, 3398, 3398, 3398, 3398, 3398, 3398, 3398,
+     3398, 3398, 3399, 3399, 3399, 3399, 3399, 3399, 3399, 3399,
+
+     3399, 3399, 3399, 3399, 3399, 3400, 3400, 3400, 3400, 3400,
+     3400, 3400, 3400, 3400, 3400, 3400, 3400, 3400, 3401, 3401,
+     3401, 3401, 3401, 3401, 3401, 3401,    0, 3401, 3401, 3401,
+     3401, 3402, 3402, 3402, 3402, 3402, 3402, 3402, 3402, 3402,
+     3402, 3402, 3402, 3402, 3403, 3403, 3403, 3403, 3403, 3403,
+     3403, 3403, 3403, 3403, 3403, 3403, 3403, 3404, 3404, 3404,
+     3404, 3404, 3404, 3404, 3404,    0, 3404, 3404, 3404, 3404,
+     3405, 3405, 3405, 3405, 3405, 3405, 3405, 3405, 3405, 3405,
+     3405, 3405, 3405, 3406, 3406, 3406, 3406, 3406, 3406, 3406,
+     3406, 3406, 3406, 3406, 3406, 3406, 3407, 3407, 3407, 3407,
+
+     3407, 3407, 3407, 3407, 3407, 3407, 3407, 3407, 3407, 3408,
+     3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408,
+     3408, 3408, 3409, 3409, 3409, 3409, 3409, 3409, 3409, 3409,
+     3409, 3409, 3409, 3409, 3409, 3410, 3410, 3410, 3410, 3410,
+     3410, 3410, 3410, 3410, 3410, 3410, 3410, 3410, 3411, 3411,
+     3411, 3411, 3411, 3411, 3411, 3411, 3411, 3411, 3411, 3411,
+     3411, 3412, 3412, 3412, 3412, 3412, 3412, 3412, 3412, 3412,
+     3412, 3412, 3412, 3412, 3413, 3413, 3413, 3413, 3413, 3413,
+     3413, 3413, 3413, 3413, 3413, 3413, 3413, 3414, 3414, 3414,
+     3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414,
+
+     3415, 3415, 3415, 3415, 3415, 3415, 3415, 3415, 3415, 3415,
+     3415, 3415, 3415, 3416, 3416, 3416, 3416, 3416, 3416, 3416,
+     3416, 3416, 3416, 3416, 3416, 3416, 3417, 3417, 3417, 3417,
+     3417, 3417, 3417, 3417, 3417, 3417, 3417, 3417, 3417, 3418,
+     3418, 3418, 3418, 3418, 3418, 3418, 3418, 3418, 3418, 3418,
+     3418, 3418, 3419, 3419, 3419, 3419, 3419, 3419, 3419, 3419,
+     3419, 3419, 3419, 3419, 3419, 3420, 3420, 3420, 3420, 3420,
+     3420, 3420, 3420, 3420, 3420, 3420, 3420, 3420, 3421, 3421,
+     3421, 3421, 3421, 3421, 3421, 3421, 3421, 3421, 3421, 3421,
+     3421, 3422, 3422, 3422, 3422, 3422, 3422, 3422, 3422, 3422,
+
+     3422, 3422, 3422, 3422, 3423, 3423, 3423, 3423, 3423, 3423,
+     3423, 3423, 3423, 3423, 3423, 3423, 3423, 3424, 3424, 3424,
+     3424, 3424, 3424, 3424, 3424, 3424, 3424, 3424, 3424, 3424,
+     3425, 3425, 3425, 3425, 3425, 3425, 3425, 3425, 3425, 3425,
+     3425, 3425, 3425, 3426, 3426, 3426, 3426, 3426, 3426, 3426,
+     3426, 3426, 3426, 3426, 3426, 3426, 3427, 3427, 3427, 3427,
+     3427, 3427, 3427, 3427, 3427, 3427, 3427, 3427, 3427, 3428,
+     3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428, 3428,
+     3428, 3428, 3429, 3429, 3429, 3429, 3429, 3429, 3429, 3429,
+     3429, 3429, 3429, 3429, 3429, 3430, 3430, 3430, 3430, 3430,
+
+     3430, 3430, 3430, 3430, 3430, 3430, 3430, 3430, 3431, 3431,
+     3431, 3431, 3431, 3431, 3431, 3431, 3431, 3431, 3431, 3431,
+     3431, 3432, 3432, 3432, 3432, 3432, 3432, 3432, 3432, 3432,
+     3432, 3432, 3432, 3432, 3433, 3433, 3433, 3433, 3433, 3433,
+     3433, 3433, 3433, 3433, 3433, 3433, 3433, 3434, 3434, 3434,
+     3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434,
+     3435, 3435, 3435, 3435, 3435, 3435, 3435, 3435, 3435, 3435,
+     3435, 3435, 3435, 3436, 3436, 3436, 3436, 3436, 3436, 3436,
+     3436, 3436, 3436, 3436, 3436, 3436, 3437, 3437, 3437, 3437,
+     3437, 3437, 3437, 3437, 3437, 3437, 3437, 3437, 3437, 3438,
+
+     3438, 3438, 3438, 3438, 3438, 3438, 3438, 3438, 3438, 3438,
+     3438, 3438, 3439, 3439, 3439, 3439, 3439, 3439, 3439, 3439,
+     3439, 3439, 3439, 3439, 3439, 3440, 3440, 3440, 3440, 3440,
+     3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3441, 3441,
+     3441, 3441, 3441, 3441, 3441, 3441, 3441, 3441, 3441, 3441,
+     3441, 3442, 3442, 3442, 3442, 3442, 3442, 3442, 3442, 3442,
+     3442, 3442, 3442, 3443, 3443, 3443, 3443, 3443,    0, 3443,
+     3443, 3443, 3443, 3444, 3444, 3444, 3444, 3444, 3444, 3444,
+     3444,    0, 3444, 3444, 3444, 3444, 3445, 3445, 3445, 3445,
+     3445, 3445, 3445, 3445,    0, 3445, 3445, 3445, 3445, 3446,
+
+     3446,    0, 3446, 3446, 3446, 3446, 3446, 3446, 3446, 3446,
+     3446, 3446, 3447, 3447,    0, 3447, 3447, 3447, 3447, 3447,
+     3447, 3447, 3447, 3447, 3447, 3448, 3448, 3448, 3448, 3448,
+     3448, 3448, 3448, 3448, 3448, 3448, 3448, 3448, 3449, 3449,
+     3449, 3449, 3449, 3449, 3449, 3449,    0, 3449, 3449, 3449,
+     3449, 3450, 3450,    0, 3450, 3450, 3450, 3450, 3450, 3450,
+     3450, 3450, 3450, 3450, 3451, 3451, 3451, 3451, 3451, 3451,
+     3451, 3451, 3451, 3451, 3451, 3451, 3451, 3452, 3452, 3452,
+     3452, 3452, 3452, 3452, 3452,    0, 3452, 3452, 3452, 3452,
+     3453, 3453, 3453, 3453, 3453, 3453, 3453, 3453, 3453, 3453,
+
+     3453, 3453, 3453, 3454, 3454, 3454, 3454, 3454, 3454, 3454,
+     3454, 3454, 3454, 3454, 3454, 3454, 3455, 3455, 3455, 3455,
+     3455, 3455, 3455, 3455,    0, 3455, 3455, 3455, 3455, 3456,
+     3456, 3456, 3456, 3456, 3456, 3456, 3456, 3456, 3456, 3456,
+     3456, 3456, 3457, 3457, 3457, 3457, 3457, 3457, 3457, 3457,
+     3457, 3457, 3457, 3457, 3457, 3458, 3458, 3458, 3458, 3458,
+     3458, 3458, 3458, 3458, 3458, 3458, 3458, 3458, 3459, 3459,
+     3459, 3459, 3459, 3459, 3459, 3459, 3459, 3459, 3459, 3459,
+     3459, 3460, 3460, 3460, 3460, 3460, 3460, 3460, 3460, 3460,
+     3460, 3460, 3460, 3460, 3461, 3461, 3461, 3461, 3461, 3461,
+
+     3461, 3461, 3461, 3461, 3461, 3461, 3461, 3462, 3462, 3462,
+     3462, 3462, 3462, 3462, 3462, 3462, 3462, 3462, 3462, 3462,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+     2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912, 2912,
+
+     2912, 2912, 2912, 2912, 2912
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[208] =
+static yyconst flex_int32_t yy_rule_can_match_eol[213] =
     {   0,
-0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
-    0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 
+0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 
-    0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 
-    0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 0, 1, 0, 1, 0, 0,     };
+    0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 
+    1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,     };
 
 extern int interface_flex_debug;
 int interface_flex_debug = 0;
@@ -7596,7 +7734,7 @@ static int yy_more_len = 0;
 char *interfacetext;
 #line 1 "interface.l"
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2012 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 /*     This file is part of foma.                                            */
 /*     Foma is free software: you can redistribute it and/or modify          */
 /*     it under the terms of the GNU General Public License version 2 as     */
@@ -7638,10 +7776,10 @@ extern int promptmode;
 extern int apply_direction;
 extern int g_list_limit;
 
-extern int my_yyparse(char *my_string, int lineno);
+extern int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 extern void my_cmatrixparse(struct fsm *net, char *my_string);
 extern struct fsm *current_parse;
-extern struct fsm *fsm_lexc_parse_string(char *string, int verbose); // verbose is HFST addition
+extern struct fsm *fsm_lexc_parse_string(char *string, int verbose);
 extern int interfacelex();
 extern struct fsm *current_parse;
 extern void lexc_trim(char *s);
@@ -7677,12 +7815,12 @@ char *rep_func_arg(char *s) {
   struct func_args *fa;  
   char *argstr;
   for (fa = func_args; fa != NULL; fa = fa->next) {
-    if (strcmp(fa->arg,s) == 0) {      
+    if (strcmp(fa->arg,s) == 0) {
         argstr = xxmalloc(sizeof(char)*20);
         sprintf(argstr, "@ARGUMENT%02i@", fa->argno);
         return(argstr);
     }
-  }  
+  }
   return(strdup(s));
 }
 
@@ -7697,7 +7835,7 @@ void my_interfaceparse(char *my_string) {
 }
 
 
-#line 7701 "lex.interface.c"
+#line 7839 "lex.interface.c"
 
 #define INITIAL 0
 #define REGEX 1
@@ -7757,8 +7895,9 @@ void my_interfaceparse(char *my_string) {
 #define EXCMATRIX 55
 #define ASSERT_STACK 56
 #define WORDS_FILE 57
-#define UPPER_WORDS_FILE 58
-#define LOWER_WORDS_FILE 59
+#define PAIRS_FILE 58
+#define UPPER_WORDS_FILE 59
+#define LOWER_WORDS_FILE 60
 
 #ifndef YY_NO_UNISTD_H
 /* Special case for "unistd.h", since it is non-ANSI. We include it way
@@ -7795,7 +7934,7 @@ FILE *interfaceget_out (void );
 
 void interfaceset_out  (FILE * out_str  );
 
-yy_size_t interfaceget_leng (void );
+int interfaceget_leng (void );
 
 char *interfaceget_text (void );
 
@@ -7835,7 +7974,12 @@ static int input (void );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -7843,7 +7987,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( interfacetext, interfaceleng, 1, interfaceout )
+#define ECHO do { if (fwrite( interfacetext, interfaceleng, 1, interfaceout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -7854,7 +7998,7 @@ static int input (void );
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		yy_size_t n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( interfacein )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -7946,7 +8090,7 @@ YY_DECL
     BEGIN(INITIAL); 
 
 
-#line 7950 "lex.interface.c"
+#line 8094 "lex.interface.c"
 
 	if ( !(yy_init) )
 		{
@@ -8011,19 +8155,18 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 2856 )
+				if ( yy_current_state >= 2913 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			*(yy_state_ptr)++ = yy_current_state;
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 26441 );
+		while ( yy_base[yy_current_state] != 26921 );
 
 yy_find_action:
 		yy_current_state = *--(yy_state_ptr);
 		(yy_lp) = yy_accept[yy_current_state];
-goto find_rule; /* Shut up GCC warning -Wall */
 find_rule: /* we branch to this label when backing up */
 		for ( ; ; ) /* until we find what rule we matched */
 			{
@@ -8064,7 +8207,7 @@ find_rule: /* we branch to this label when backing up */
 
 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
 			{
-			yy_size_t yyl;
+			int yyl;
 			for ( yyl = (yy_more_len); yyl < interfaceleng; ++yyl )
 				if ( interfacetext[yyl] == '\n' )
 					   
@@ -8155,205 +8298,201 @@ YY_RULE_SETUP
 case 13:
 YY_RULE_SETUP
 #line 150 "interface.l"
-{ iface_compact(); }
+{  iface_close();}
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
 #line 151 "interface.l"
-{ iface_complete();}
+{ iface_compact(); }
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
 #line 152 "interface.l"
-{ iface_compose();}
+{ iface_complete();}
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
 #line 153 "interface.l"
-{iface_conc();}
+{ iface_compose();}
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
 #line 154 "interface.l"
-{ iface_crossproduct();}
+{iface_conc();}
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
 #line 155 "interface.l"
-{ pmode = DE; BEGIN(DEFI); }
+{ iface_crossproduct();}
 	YY_BREAK
 case 19:
-/* rule 19 can match eol */
 YY_RULE_SETUP
 #line 156 "interface.l"
-{ pmode = DE; lexc_trim(interfacetext); tempstr = xxstrdup(interfacetext); BEGIN(REGEX); }
+{ pmode = DE; BEGIN(DEFI); }
 	YY_BREAK
 case 20:
+/* rule 20 can match eol */
 YY_RULE_SETUP
 #line 157 "interface.l"
-{ iface_determinize(); }
+{ pmode = DE; lexc_trim(interfacetext); tempstr = xxstrdup(interfacetext); BEGIN(REGEX); }
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
 #line 158 "interface.l"
-{ BEGIN(ECHO); }
+{ iface_determinize(); }
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
 #line 159 "interface.l"
-{ printf("\n"); }
+{ BEGIN(ECHO); }
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
 #line 160 "interface.l"
-{ iface_eliminate_flags(); }
+{ printf("\n"); }
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
 #line 161 "interface.l"
-{ BEGIN(ELIMINATE_FLAG); }
+{ iface_eliminate_flags(); }
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
 #line 162 "interface.l"
-{ iface_print_cmatrix_att(NULL); }
+{ BEGIN(ELIMINATE_FLAG); }
 	YY_BREAK
 case 26:
-/* rule 26 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 163 "interface.l"
-{ BEGIN(EXCMATRIX);          }
+{ iface_print_cmatrix_att(NULL); }
 	YY_BREAK
 case 27:
+/* rule 27 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 164 "interface.l"
-{ iface_extract_ambiguous(); }
+{ BEGIN(EXCMATRIX);          }
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
 #line 165 "interface.l"
-{ iface_extract_unambiguous(); }
+{ iface_extract_ambiguous(); }
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
 #line 166 "interface.l"
-{ iface_factorize(); }
+{ iface_extract_unambiguous(); }
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
 #line 167 "interface.l"
-{ iface_sequentialize(); }
+{ iface_factorize(); }
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
 #line 168 "interface.l"
-{ iface_warranty(); }
+{ iface_sequentialize(); }
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
 #line 169 "interface.l"
-{ iface_help(); }
+{ iface_warranty(); }
 	YY_BREAK
 case 33:
-/* rule 33 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 170 "interface.l"
-{ BEGIN(HELP); }
+{ iface_help(); }
 	YY_BREAK
 case 34:
+/* rule 34 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 171 "interface.l"
-{ iface_ignore(); }
+{ BEGIN(HELP); }
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
 #line 172 "interface.l"
-{ iface_intersect();}
+{ iface_ignore(); }
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
 #line 173 "interface.l"
-{ iface_invert(); }
+{ iface_intersect();}
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
 #line 174 "interface.l"
-{ iface_label_net(); }
+{ iface_invert(); }
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
 #line 175 "interface.l"
-{ iface_letter_machine(); }
+{ iface_label_net(); }
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
 #line 176 "interface.l"
-{ BEGIN(LOAD_DEFINED); }
+{ iface_letter_machine(); }
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
 #line 177 "interface.l"
-{ BEGIN(LOAD_STACK); }
+{ BEGIN(LOAD_DEFINED); }
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
 #line 178 "interface.l"
-{  iface_lower_side();}
+{ BEGIN(LOAD_STACK); }
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
 #line 179 "interface.l"
-{ iface_minimize(); }
+{  iface_lower_side();}
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
 #line 180 "interface.l"
-{ BEGIN(NAME_NET); }
+{ iface_minimize(); }
 	YY_BREAK
 case 44:
 YY_RULE_SETUP
 #line 181 "interface.l"
-{ iface_negate(); }
+{ BEGIN(NAME_NET); }
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
 #line 182 "interface.l"
-{ iface_one_plus();}
+{ iface_negate(); }
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
 #line 183 "interface.l"
-{ iface_pop();}
+{ iface_one_plus();}
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
 #line 184 "interface.l"
-{ iface_print_cmatrix(); }
+{ iface_pop();}
 	YY_BREAK
 case 48:
 YY_RULE_SETUP
 #line 185 "interface.l"
-{ iface_print_defined(); }
+{ iface_print_cmatrix(); }
 	YY_BREAK
 case 49:
 YY_RULE_SETUP
 #line 186 "interface.l"
-{ iface_print_dot(NULL); }
+{ iface_print_defined(); }
 	YY_BREAK
 case 50:
-/* rule 50 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 187 "interface.l"
-{ BEGIN(PRINT_DOT_FILE); }
+{ iface_print_dot(NULL); }
 	YY_BREAK
 case 51:
 /* rule 51 can match eol */
@@ -8362,36 +8501,36 @@ case 51:
 YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 188 "interface.l"
-{ BEGIN(PRINT_DOT_NAME); }
+{ BEGIN(PRINT_DOT_FILE); }
 	YY_BREAK
 case 52:
+/* rule 52 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 189 "interface.l"
-{ iface_lower_words(-1); }
+{ BEGIN(PRINT_DOT_NAME); }
 	YY_BREAK
 case 53:
 YY_RULE_SETUP
 #line 190 "interface.l"
-{ iface_lower_words(iface_extract_number(interfacetext)); }
+{ iface_lower_words(-1); }
 	YY_BREAK
 case 54:
 YY_RULE_SETUP
 #line 191 "interface.l"
-{ iface_print_name(); }
+{ iface_lower_words(iface_extract_number(interfacetext)); }
 	YY_BREAK
 case 55:
 YY_RULE_SETUP
 #line 192 "interface.l"
-{ iface_print_net(NULL,NULL); }
+{ iface_print_name(); }
 	YY_BREAK
 case 56:
-/* rule 56 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 193 "interface.l"
-{ BEGIN(PRINT_NET_FILE);      }
+{ iface_print_net(NULL,NULL); }
 	YY_BREAK
 case 57:
 /* rule 57 can match eol */
@@ -8400,386 +8539,410 @@ case 57:
 YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 194 "interface.l"
-{ BEGIN(PRINT_NET_NAME);      }
+{ BEGIN(PRINT_NET_FILE);      }
 	YY_BREAK
 case 58:
 /* rule 58 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 195 "interface.l"
-{ BEGIN(PRINT_NET_NAME_FILE); }
+{ BEGIN(PRINT_NET_NAME);      }
 	YY_BREAK
 case 59:
+/* rule 59 can match eol */
 YY_RULE_SETUP
 #line 196 "interface.l"
-{ iface_random_lower(-1); }
+{ BEGIN(PRINT_NET_NAME_FILE); }
 	YY_BREAK
 case 60:
 YY_RULE_SETUP
 #line 197 "interface.l"
-{ iface_random_lower(iface_extract_number(interfacetext)); }
+{ iface_random_lower(-1); }
 	YY_BREAK
 case 61:
 YY_RULE_SETUP
 #line 198 "interface.l"
-{ iface_random_upper(-1); }
+{ iface_random_lower(iface_extract_number(interfacetext)); }
 	YY_BREAK
 case 62:
 YY_RULE_SETUP
 #line 199 "interface.l"
-{ iface_random_upper(iface_extract_number(interfacetext)); }
+{ iface_random_upper(-1); }
 	YY_BREAK
 case 63:
 YY_RULE_SETUP
 #line 200 "interface.l"
-{ iface_random_words(-1); }
+{ iface_random_upper(iface_extract_number(interfacetext)); }
 	YY_BREAK
 case 64:
 YY_RULE_SETUP
 #line 201 "interface.l"
-{ iface_random_words(iface_extract_number(interfacetext)); }
+{ iface_random_words(-1); }
 	YY_BREAK
 case 65:
 YY_RULE_SETUP
 #line 202 "interface.l"
-{ iface_print_sigma(); }
+{ iface_random_words(iface_extract_number(interfacetext)); }
 	YY_BREAK
 case 66:
 YY_RULE_SETUP
 #line 203 "interface.l"
-{ iface_print_stats(); }
+{ iface_print_sigma(); }
 	YY_BREAK
 case 67:
 YY_RULE_SETUP
 #line 204 "interface.l"
-{ printf("STACK SIZE: %d\n", stack_size()); }
+{ iface_print_stats(); }
 	YY_BREAK
 case 68:
 YY_RULE_SETUP
 #line 205 "interface.l"
-{ iface_upper_words(-1); }
+{ printf("STACK SIZE: %d\n", stack_size()); }
 	YY_BREAK
 case 69:
 YY_RULE_SETUP
 #line 206 "interface.l"
-{ iface_upper_words(iface_extract_number(interfacetext)); }
+{ iface_upper_words(-1); }
 	YY_BREAK
 case 70:
 YY_RULE_SETUP
 #line 207 "interface.l"
-{ iface_words(-1);}
+{ iface_upper_words(iface_extract_number(interfacetext)); }
 	YY_BREAK
 case 71:
 YY_RULE_SETUP
 #line 208 "interface.l"
-{ iface_words(iface_extract_number(interfacetext));}
+{ iface_pairs(-1);}
 	YY_BREAK
 case 72:
 YY_RULE_SETUP
 #line 209 "interface.l"
-{ BEGIN(WORDS_FILE); }
+{ iface_random_pairs(-1);}
 	YY_BREAK
 case 73:
 YY_RULE_SETUP
 #line 210 "interface.l"
-{ BEGIN(LOWER_WORDS_FILE); }
+{ iface_words(-1);}
 	YY_BREAK
 case 74:
 YY_RULE_SETUP
 #line 211 "interface.l"
-{ BEGIN(UPPER_WORDS_FILE); }
+{ iface_words(iface_extract_number(interfacetext));}
 	YY_BREAK
 case 75:
 YY_RULE_SETUP
 #line 212 "interface.l"
-{ iface_print_shortest_string();}
+{ BEGIN(WORDS_FILE); }
 	YY_BREAK
 case 76:
 YY_RULE_SETUP
 #line 213 "interface.l"
-{ iface_print_shortest_string_size();}
+{ BEGIN(PAIRS_FILE); }
 	YY_BREAK
 case 77:
 YY_RULE_SETUP
 #line 214 "interface.l"
-{ iface_prune(); }
+{ BEGIN(LOWER_WORDS_FILE); }
 	YY_BREAK
 case 78:
 YY_RULE_SETUP
 #line 215 "interface.l"
-{ BEGIN(PUSH); }
+{ BEGIN(UPPER_WORDS_FILE); }
 	YY_BREAK
 case 79:
 YY_RULE_SETUP
 #line 216 "interface.l"
-{ iface_quit(); }
+{ iface_print_shortest_string();}
 	YY_BREAK
 case 80:
 YY_RULE_SETUP
 #line 217 "interface.l"
-{ BEGIN(ATT); }
+{ iface_print_shortest_string_size();}
 	YY_BREAK
 case 81:
 YY_RULE_SETUP
 #line 218 "interface.l"
-{ printf("Missing filename.\n"); }
+{ iface_prune(); }
 	YY_BREAK
 case 82:
-/* rule 82 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 219 "interface.l"
-{ BEGIN(RCMATRIX); }
+{ BEGIN(PUSH); }
 	YY_BREAK
 case 83:
 YY_RULE_SETUP
 #line 220 "interface.l"
-{ BEGIN(RPL); }
+{ iface_quit(); }
 	YY_BREAK
 case 84:
 YY_RULE_SETUP
 #line 221 "interface.l"
-{ BEGIN(RLEXC); }
+{ BEGIN(ATT); }
 	YY_BREAK
 case 85:
 YY_RULE_SETUP
 #line 222 "interface.l"
-{ pmode = RE; BEGIN(REGEX); }
+{ printf("Missing filename.\n"); }
 	YY_BREAK
 case 86:
+/* rule 86 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 223 "interface.l"
-{ BEGIN(READ_SPACED_TEXT); }
+{ BEGIN(RCMATRIX); }
 	YY_BREAK
 case 87:
 YY_RULE_SETUP
 #line 224 "interface.l"
-{ BEGIN(READ_TEXT); }
+{ BEGIN(RPL); }
 	YY_BREAK
 case 88:
 YY_RULE_SETUP
 #line 225 "interface.l"
-{ iface_reverse(); }
+{ BEGIN(RLEXC); }
 	YY_BREAK
 case 89:
 YY_RULE_SETUP
 #line 226 "interface.l"
-{ iface_rotate();}
+{ pmode = RE; BEGIN(REGEX); }
 	YY_BREAK
 case 90:
 YY_RULE_SETUP
 #line 227 "interface.l"
-{ BEGIN(SAVE_DEFINED); }
+{ BEGIN(READ_SPACED_TEXT); }
 	YY_BREAK
 case 91:
 YY_RULE_SETUP
 #line 228 "interface.l"
-{ BEGIN(SAVE_STACK); }
+{ BEGIN(READ_TEXT); }
 	YY_BREAK
 case 92:
-/* rule 92 can match eol */
 YY_RULE_SETUP
 #line 229 "interface.l"
-{ BEGIN(SET_VAR); }
+{ iface_reverse(); }
 	YY_BREAK
 case 93:
 YY_RULE_SETUP
 #line 230 "interface.l"
-{ iface_show_variables();}
+{ iface_rotate();}
 	YY_BREAK
 case 94:
-/* rule 94 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 231 "interface.l"
-{ BEGIN(SHOW_VAR); }
+{ BEGIN(SAVE_DEFINED); }
 	YY_BREAK
 case 95:
 YY_RULE_SETUP
 #line 232 "interface.l"
-{ iface_shuffle(); }
+{ BEGIN(SAVE_STACK); }
 	YY_BREAK
 case 96:
+/* rule 96 can match eol */
 YY_RULE_SETUP
 #line 233 "interface.l"
-{ iface_sigma_net(); }
+{ BEGIN(SET_VAR); }
 	YY_BREAK
 case 97:
 YY_RULE_SETUP
 #line 234 "interface.l"
-{ iface_sort_input(); }
+{ iface_show_variables();}
 	YY_BREAK
 case 98:
+/* rule 98 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
 #line 235 "interface.l"
-{ iface_sort_output(); }
+{ BEGIN(SHOW_VAR); }
 	YY_BREAK
 case 99:
 YY_RULE_SETUP
 #line 236 "interface.l"
-{ iface_sort(); }
+{ iface_shuffle(); }
 	YY_BREAK
 case 100:
 YY_RULE_SETUP
 #line 237 "interface.l"
-{BEGIN(SOURCE);}
+{ iface_sigma_net(); }
 	YY_BREAK
 case 101:
 YY_RULE_SETUP
 #line 238 "interface.l"
-{BEGIN(SUBSTITUTE_DEFINED);}
+{ iface_sort_input(); }
 	YY_BREAK
 case 102:
 YY_RULE_SETUP
 #line 239 "interface.l"
-{BEGIN(SUBSTITUTE_SYMBOL);}
+{ iface_sort_output(); }
 	YY_BREAK
 case 103:
 YY_RULE_SETUP
 #line 240 "interface.l"
-{BEGIN(SYSTEM);}
+{ iface_sort(); }
 	YY_BREAK
 case 104:
 YY_RULE_SETUP
 #line 241 "interface.l"
-{  iface_test_unambiguous(); }
+{BEGIN(SOURCE);}
 	YY_BREAK
 case 105:
 YY_RULE_SETUP
 #line 242 "interface.l"
-{  iface_test_equivalent(); }
+{BEGIN(SUBSTITUTE_DEFINED);}
 	YY_BREAK
 case 106:
 YY_RULE_SETUP
 #line 243 "interface.l"
-{  iface_test_functional(); }
+{BEGIN(SUBSTITUTE_SYMBOL);}
 	YY_BREAK
 case 107:
 YY_RULE_SETUP
 #line 244 "interface.l"
-{  iface_test_identity(); }
+{BEGIN(SYSTEM);}
 	YY_BREAK
 case 108:
 YY_RULE_SETUP
 #line 245 "interface.l"
-{  iface_test_nonnull(); }
+{  iface_test_unambiguous(); }
 	YY_BREAK
 case 109:
 YY_RULE_SETUP
 #line 246 "interface.l"
-{  iface_test_null(); }
+{  iface_test_equivalent(); }
 	YY_BREAK
 case 110:
 YY_RULE_SETUP
 #line 247 "interface.l"
-{  iface_test_lower_universal(); }
+{  iface_test_functional(); }
 	YY_BREAK
 case 111:
 YY_RULE_SETUP
 #line 248 "interface.l"
-{  iface_test_sequential(); }
+{  iface_test_identity(); }
 	YY_BREAK
 case 112:
 YY_RULE_SETUP
 #line 249 "interface.l"
-{  iface_test_upper_universal(); }
+{  iface_test_nonnull(); }
 	YY_BREAK
 case 113:
 YY_RULE_SETUP
 #line 250 "interface.l"
-{  iface_turn(); }
+{  iface_test_null(); }
 	YY_BREAK
 case 114:
 YY_RULE_SETUP
 #line 251 "interface.l"
-{  iface_twosided_flags(); }
+{  iface_test_lower_universal(); }
 	YY_BREAK
 case 115:
 YY_RULE_SETUP
 #line 252 "interface.l"
-{BEGIN(UNDEFINE);}
+{  iface_test_sequential(); }
 	YY_BREAK
 case 116:
 YY_RULE_SETUP
 #line 253 "interface.l"
-{iface_union();}
+{  iface_test_upper_universal(); }
 	YY_BREAK
 case 117:
 YY_RULE_SETUP
 #line 254 "interface.l"
-{ iface_upper_side(); }
+{  iface_turn(); }
 	YY_BREAK
 case 118:
 YY_RULE_SETUP
-#line 255 "interface.l"
+#line 255 "interface.l"
+{  iface_twosided_flags(); }
+	YY_BREAK
+case 119:
+YY_RULE_SETUP
+#line 256 "interface.l"
+{BEGIN(UNDEFINE);}
+	YY_BREAK
+case 120:
+YY_RULE_SETUP
+#line 257 "interface.l"
+{iface_union();}
+	YY_BREAK
+case 121:
+YY_RULE_SETUP
+#line 258 "interface.l"
+{ iface_upper_side(); }
+	YY_BREAK
+case 122:
+YY_RULE_SETUP
+#line 259 "interface.l"
 { iface_view(); }
 	YY_BREAK
-case 119:
+case 123:
 YY_RULE_SETUP
-#line 256 "interface.l"
+#line 260 "interface.l"
 { iface_write_prolog(NULL); }
 	YY_BREAK
-case 120:
-/* rule 120 can match eol */
+case 124:
+/* rule 124 can match eol */
 *yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
 (yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
-#line 257 "interface.l"
+#line 261 "interface.l"
 { BEGIN(WRITE_PROLOG_FILE); }
 	YY_BREAK
-case 121:
+case 125:
 YY_RULE_SETUP
-#line 258 "interface.l"
+#line 262 "interface.l"
 { iface_write_att(NULL); }
 	YY_BREAK
-case 122:
-/* rule 122 can match eol */
+case 126:
+/* rule 126 can match eol */
 *yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
 (yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
-#line 259 "interface.l"
+#line 263 "interface.l"
 { BEGIN(WRITE_ATT_FILE); }
 	YY_BREAK
-case 123:
+case 127:
 YY_RULE_SETUP
-#line 260 "interface.l"
+#line 264 "interface.l"
 { iface_zero_plus(); }
 	YY_BREAK
-case 124:
+case 128:
 *yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
 (yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
-#line 262 "interface.l"
+#line 266 "interface.l"
 {
    tempstr = trim(strdup(interfacetext));
    BEGIN(APPLY_FILE_EATUP);
 }
 	YY_BREAK
-case 125:
-/* rule 125 can match eol */
+case 129:
+/* rule 129 can match eol */
 YY_RULE_SETUP
-#line 267 "interface.l"
+#line 271 "interface.l"
 {
    iface_apply_file(trim(interfacetext),NULL, applydir);
    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 126:
+case 130:
 YY_RULE_SETUP
-#line 271 "interface.l"
+#line 275 "interface.l"
 {
   BEGIN(APPLY_FILE_OUT);
 }
 	YY_BREAK
-case 127:
+case 131:
 YY_RULE_SETUP
-#line 274 "interface.l"
+#line 278 "interface.l"
 {
   iface_apply_file(tempstr, trim(interfacetext), applydir);
   xxfree(tempstr);
@@ -8787,76 +8950,76 @@ YY_RULE_SETUP
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 128:
+case 132:
 YY_RULE_SETUP
-#line 281 "interface.l"
+#line 285 "interface.l"
 {
    iface_apply_down(interfacetext);
    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 129:
+case 133:
 YY_RULE_SETUP
-#line 285 "interface.l"
+#line 289 "interface.l"
 {
    iface_apply_down(interfacetext);
    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 130:
+case 134:
 YY_RULE_SETUP
-#line 289 "interface.l"
+#line 293 "interface.l"
 {
    iface_apply_med(interfacetext);
    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 131:
+case 135:
 YY_RULE_SETUP
-#line 293 "interface.l"
+#line 297 "interface.l"
 {
    iface_apply_up(interfacetext);
    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 132:
+case 136:
 YY_RULE_SETUP
-#line 297 "interface.l"
+#line 301 "interface.l"
 {
   iface_name_net(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 133:
+case 137:
 YY_RULE_SETUP
-#line 302 "interface.l"
+#line 306 "interface.l"
 {
   iface_help_search(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 134:
+case 138:
 YY_RULE_SETUP
-#line 306 "interface.l"
+#line 310 "interface.l"
 {
   iface_apropos(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 135:
+case 139:
 YY_RULE_SETUP
-#line 311 "interface.l"
+#line 315 "interface.l"
 {
-  if (find_defined(interfacetext) == NULL)
-    printf("'%s' is not a defined symbol.\n",interfacetext);
-  else
-    stack_add(fsm_copy(find_defined(interfacetext)));
-  BEGIN(INITIAL);
+    if (find_defined(g_defines, interfacetext) == NULL)
+	printf("'%s' is not a defined symbol.\n",interfacetext);
+    else
+	stack_add(fsm_copy(find_defined(g_defines, interfacetext)));
+    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 136:
+case 140:
 YY_RULE_SETUP
-#line 319 "interface.l"
+#line 323 "interface.l"
 {
   if (strcmp(interfacetext,"END;") == 0) {
     promptmode = PROMPT_MAIN;
@@ -8873,53 +9036,53 @@ YY_RULE_SETUP
   }
 }
 	YY_BREAK
-case 137:
+case 141:
 YY_RULE_SETUP
-#line 336 "interface.l"
+#line 340 "interface.l"
 { yymore(); BEGIN(RCOMMENT); }
 	YY_BREAK
-case 138:
+case 142:
 YY_RULE_SETUP
-#line 338 "interface.l"
+#line 342 "interface.l"
 { }
 	YY_BREAK
-case 139:
+case 143:
 YY_RULE_SETUP
-#line 340 "interface.l"
+#line 344 "interface.l"
 { yymore();}
 	YY_BREAK
-case 140:
-/* rule 140 can match eol */
+case 144:
+/* rule 144 can match eol */
 YY_RULE_SETUP
-#line 342 "interface.l"
+#line 346 "interface.l"
 {
   yymore();
 }
 	YY_BREAK
-case 141:
-/* rule 141 can match eol */
+case 145:
+/* rule 145 can match eol */
 YY_RULE_SETUP
-#line 346 "interface.l"
+#line 350 "interface.l"
 { yymore(); BEGIN(REGEX); }
 	YY_BREAK
-case 142:
-/* rule 142 can match eol */
+case 146:
+/* rule 146 can match eol */
 YY_RULE_SETUP
-#line 347 "interface.l"
+#line 351 "interface.l"
 { yymore(); }
 	YY_BREAK
-case 143:
+case 147:
 YY_RULE_SETUP
-#line 349 "interface.l"
+#line 353 "interface.l"
 {
-    if (my_yyparse(interfacetext, interfacelineno) == 0) {
+    if (my_yyparse(interfacetext, interfacelineno, g_defines, g_defines_f) == 0) {
       /* regex xxx line */
       if (pmode == RE) {
          stack_add(fsm_topsort(fsm_minimize(current_parse)));
       /* define XXX xxx line */
       } else if (pmode == DE) {
         tempnet = fsm_topsort(fsm_minimize(current_parse));
-        olddef = add_defined(tempnet,tempstr);
+        olddef = add_defined(g_defines, tempnet,tempstr);
         if (olddef) {
           printf("redefined %s: ",tempstr);
         } else {
@@ -8933,61 +9096,61 @@ YY_RULE_SETUP
     BEGIN(INITIAL);
 }
 	YY_BREAK
-case 144:
+case 148:
 YY_RULE_SETUP
-#line 370 "interface.l"
+#line 374 "interface.l"
 {
   BEGIN(REGEXB);
   yymore();
 }
 	YY_BREAK
-case 145:
-/* rule 145 can match eol */
+case 149:
+/* rule 149 can match eol */
 YY_RULE_SETUP
-#line 374 "interface.l"
+#line 378 "interface.l"
 {
   yymore();
 }
 	YY_BREAK
-case 146:
+case 150:
 YY_RULE_SETUP
-#line 377 "interface.l"
+#line 381 "interface.l"
 {
   BEGIN(REGEX);
   yymore();
 }
 	YY_BREAK
-case 147:
+case 151:
 YY_RULE_SETUP
-#line 381 "interface.l"
+#line 385 "interface.l"
 {
   BEGIN(REGEXQ);
   yymore();
 }
 	YY_BREAK
-case 148:
-/* rule 148 can match eol */
+case 152:
+/* rule 152 can match eol */
 YY_RULE_SETUP
-#line 385 "interface.l"
+#line 389 "interface.l"
 {
   yymore();
 }
 	YY_BREAK
-case 149:
+case 153:
 YY_RULE_SETUP
-#line 388 "interface.l"
+#line 392 "interface.l"
 {
   BEGIN(REGEX);
   yymore();
 }
 	YY_BREAK
-case 150:
-/* rule 150 can match eol */
+case 154:
+/* rule 154 can match eol */
 *yy_cp = (yy_hold_char); /* undo effects of setting up interfacetext */
 (yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up interfacetext again */
 YY_RULE_SETUP
-#line 393 "interface.l"
+#line 397 "interface.l"
 {
    func_name = xxmalloc(sizeof(char)*(strlen(interfacetext)+2));
    func_name = strcpy(func_name, interfacetext);
@@ -8997,90 +9160,90 @@ YY_RULE_SETUP
 }
 	YY_BREAK
 /* Eat up parenthesis */
-case 151:
+case 155:
 YY_RULE_SETUP
-#line 402 "interface.l"
+#line 406 "interface.l"
 { BEGIN(FUNC_2); }
 	YY_BREAK
-case 152:
+case 156:
 YY_RULE_SETUP
-#line 404 "interface.l"
+#line 408 "interface.l"
 { }
 	YY_BREAK
-case 153:
-/* rule 153 can match eol */
+case 157:
+/* rule 157 can match eol */
 YY_RULE_SETUP
-#line 405 "interface.l"
+#line 409 "interface.l"
 {
   add_func_arg(interfacetext);
 }
 	YY_BREAK
-case 154:
-/* rule 154 can match eol */
+case 158:
+/* rule 158 can match eol */
 YY_RULE_SETUP
-#line 408 "interface.l"
+#line 412 "interface.l"
 {
   add_func_arg(interfacetext);
   BEGIN(FUNC_3);
 }
 	YY_BREAK
-case 155:
+case 159:
 YY_RULE_SETUP
-#line 413 "interface.l"
+#line 417 "interface.l"
 { funcdef[0] = '\0'; BEGIN(FUNC_4); }
 	YY_BREAK
-case 156:
-/* rule 156 can match eol */
+case 160:
+/* rule 160 can match eol */
 YY_RULE_SETUP
-#line 414 "interface.l"
+#line 418 "interface.l"
 { tempstr = rep_func_arg(interfacetext); strcat(funcdef, tempstr); xxfree(tempstr); tempstr = NULL;}
 	YY_BREAK
-case 157:
-/* rule 157 can match eol */
+case 161:
+/* rule 161 can match eol */
 YY_RULE_SETUP
-#line 415 "interface.l"
+#line 419 "interface.l"
 { strcat(funcdef, interfacetext); }
 	YY_BREAK
-case 158:
-/* rule 158 can match eol */
+case 162:
+/* rule 162 can match eol */
 YY_RULE_SETUP
-#line 416 "interface.l"
+#line 420 "interface.l"
 { strcat(funcdef, interfacetext); }
 	YY_BREAK
-case 159:
-/* rule 159 can match eol */
+case 163:
+/* rule 163 can match eol */
 YY_RULE_SETUP
-#line 417 "interface.l"
+#line 421 "interface.l"
 { strcat(funcdef, interfacetext); }
 	YY_BREAK
-case 160:
+case 164:
 YY_RULE_SETUP
-#line 418 "interface.l"
-{ strcat(funcdef, interfacetext); add_defined_function(func_name, funcdef, (func_arg_no-1));clear_func_args(); xxfree(func_name); BEGIN(INITIAL); }
+#line 422 "interface.l"
+{ strcat(funcdef, interfacetext); add_defined_function(g_defines_f, func_name, funcdef, (func_arg_no-1));clear_func_args(); xxfree(func_name); BEGIN(INITIAL); }
 	YY_BREAK
-case 161:
+case 165:
 YY_RULE_SETUP
-#line 419 "interface.l"
+#line 423 "interface.l"
 { strcat(funcdef, interfacetext); }
 	YY_BREAK
-case 162:
+case 166:
 YY_RULE_SETUP
-#line 422 "interface.l"
+#line 426 "interface.l"
 {
   tempstr = xxstrdup(interfacetext);
   BEGIN(REGEX);
 }
 	YY_BREAK
-case 163:
+case 167:
 YY_RULE_SETUP
-#line 427 "interface.l"
+#line 431 "interface.l"
 {
 
    tempnet = NULL;
    /* Define the top network on stack */
    if (iface_stack_check(1)) {
        tempnet = stack_pop();
-       olddef = add_defined(tempnet,remove_trailing(interfacetext,';'));
+       olddef = add_defined(g_defines, tempnet,remove_trailing(interfacetext,';'));
        if (olddef) {
          printf("redefined %s: ",interfacetext);
        } else {
@@ -9091,80 +9254,80 @@ YY_RULE_SETUP
      BEGIN(INITIAL);
 }
 	YY_BREAK
-case 164:
+case 168:
 YY_RULE_SETUP
-#line 444 "interface.l"
+#line 448 "interface.l"
 {
-  remove_defined(remove_trailing(interfacetext,';'));
+    remove_defined(g_defines, remove_trailing(interfacetext,';'));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 165:
+case 169:
 YY_RULE_SETUP
-#line 449 "interface.l"
+#line 453 "interface.l"
 {
   iface_print_net(NULL,trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 166:
+case 170:
 YY_RULE_SETUP
-#line 453 "interface.l"
+#line 457 "interface.l"
 {
   iface_print_net(trim(interfacetext), NULL);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 167:
-/* rule 167 can match eol */
+case 171:
+/* rule 171 can match eol */
 YY_RULE_SETUP
-#line 457 "interface.l"
+#line 461 "interface.l"
 {
   tempstr = strdup(trim(interfacetext));
   BEGIN(PRINT_NET_NAME_FILE2);
 }
 	YY_BREAK
-case 168:
+case 172:
 YY_RULE_SETUP
-#line 461 "interface.l"
+#line 465 "interface.l"
 { }
 	YY_BREAK
-case 169:
-/* rule 169 can match eol */
+case 173:
+/* rule 173 can match eol */
 YY_RULE_SETUP
-#line 462 "interface.l"
+#line 466 "interface.l"
 { 
   iface_print_net(tempstr, trim(interfacetext));  
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 170:
+case 174:
 YY_RULE_SETUP
-#line 466 "interface.l"
+#line 470 "interface.l"
 {
   iface_write_att(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 171:
+case 175:
 YY_RULE_SETUP
-#line 471 "interface.l"
+#line 475 "interface.l"
 {
   iface_write_prolog(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 172:
+case 176:
 YY_RULE_SETUP
-#line 476 "interface.l"
+#line 480 "interface.l"
 {
   iface_print_dot(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 173:
+case 177:
 YY_RULE_SETUP
-#line 481 "interface.l"
+#line 485 "interface.l"
 {
   if ((interfacein = fopen(trim(interfacetext), "r" )) != NULL) {
     printf("Opening file '%s'.\n", trim(interfacetext));    
@@ -9176,26 +9339,26 @@ YY_RULE_SETUP
   BEGIN(INITIAL); 
 }
 	YY_BREAK
-case 174:
+case 178:
 YY_RULE_SETUP
-#line 492 "interface.l"
+#line 496 "interface.l"
 {
   iface_show_variable(interfacetext);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 175:
-/* rule 175 can match eol */
+case 179:
+/* rule 179 can match eol */
 YY_RULE_SETUP
-#line 496 "interface.l"
+#line 500 "interface.l"
 {
   tempstr = xxstrdup(interfacetext);
   BEGIN(SET_VALUE);
 }
 	YY_BREAK
-case 176:
+case 180:
 YY_RULE_SETUP
-#line 500 "interface.l"
+#line 504 "interface.l"
 {
   iface_set_variable(tempstr,interfacetext);
   xxfree(tempstr);
@@ -9203,149 +9366,157 @@ YY_RULE_SETUP
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 177:
+case 181:
 YY_RULE_SETUP
-#line 506 "interface.l"
+#line 510 "interface.l"
 { }
 	YY_BREAK
-case 178:
+case 182:
 YY_RULE_SETUP
-#line 508 "interface.l"
+#line 512 "interface.l"
 {
   iface_read_spaced_text(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 179:
+case 183:
 YY_RULE_SETUP
-#line 513 "interface.l"
+#line 517 "interface.l"
 {
   iface_read_text(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 180:
+case 184:
 YY_RULE_SETUP
-#line 518 "interface.l"
+#line 522 "interface.l"
 {
   iface_words_file(trim(interfacetext),0);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 181:
+case 185:
 YY_RULE_SETUP
-#line 523 "interface.l"
+#line 527 "interface.l"
+{
+  iface_pairs_file(trim(interfacetext));
+  BEGIN(INITIAL);
+}
+	YY_BREAK
+case 186:
+YY_RULE_SETUP
+#line 532 "interface.l"
 {
   iface_words_file(trim(interfacetext),1);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 182:
+case 187:
 YY_RULE_SETUP
-#line 528 "interface.l"
+#line 537 "interface.l"
 {
   iface_words_file(trim(interfacetext),2);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 183:
+case 188:
 YY_RULE_SETUP
-#line 534 "interface.l"
+#line 543 "interface.l"
 {
   iface_save_defined(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 184:
+case 189:
 YY_RULE_SETUP
-#line 538 "interface.l"
+#line 547 "interface.l"
 {
   iface_save_stack(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 185:
+case 190:
 YY_RULE_SETUP
-#line 542 "interface.l"
+#line 551 "interface.l"
 {
   iface_load_stack(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 186:
+case 191:
 YY_RULE_SETUP
-#line 546 "interface.l"
+#line 555 "interface.l"
 {
   iface_load_defined(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 187:
-/* rule 187 can match eol */
+case 192:
+/* rule 192 can match eol */
 YY_RULE_SETUP
-#line 550 "interface.l"
+#line 559 "interface.l"
 { tempstr = xxstrdup(interfacetext); BEGIN(SUBSTITUTE_SYMBOL_2);}
 	YY_BREAK
-case 188:
+case 193:
 YY_RULE_SETUP
-#line 551 "interface.l"
+#line 560 "interface.l"
 {BEGIN(SUBSTITUTE_SYMBOL_3);}
 	YY_BREAK
-case 189:
+case 194:
 YY_RULE_SETUP
-#line 552 "interface.l"
+#line 561 "interface.l"
 {
   iface_substitute_symbol(interfacetext, tempstr); 
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 190:
-/* rule 190 can match eol */
+case 195:
+/* rule 195 can match eol */
 YY_RULE_SETUP
-#line 556 "interface.l"
+#line 565 "interface.l"
 { tempstr = xxstrdup(interfacetext); BEGIN(SUBSTITUTE_DEFINED_2);}
 	YY_BREAK
-case 191:
+case 196:
 YY_RULE_SETUP
-#line 557 "interface.l"
+#line 566 "interface.l"
 {BEGIN(SUBSTITUTE_DEFINED_3);}
 	YY_BREAK
-case 192:
+case 197:
 YY_RULE_SETUP
-#line 558 "interface.l"
+#line 567 "interface.l"
 {
   iface_substitute_defined(interfacetext, tempstr); 
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 193:
+case 198:
 YY_RULE_SETUP
-#line 563 "interface.l"
+#line 572 "interface.l"
 {
   iface_eliminate_flag(interfacetext);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 194:
+case 199:
 YY_RULE_SETUP
-#line 568 "interface.l"
+#line 577 "interface.l"
 {
   int ret;
   ret = system(interfacetext);
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 195:
+case 200:
 YY_RULE_SETUP
-#line 574 "interface.l"
+#line 583 "interface.l"
 {
-  printf("%s\n",interfacetext);
-  BEGIN(INITIAL);
+    printf("%s\n",interfacetext);
+    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 196:
+case 201:
 YY_RULE_SETUP
-#line 579 "interface.l"
+#line 588 "interface.l"
 {
     int level = strtoul(interfacetext, 0, 10);
     if (level != stack_size()) {
@@ -9355,28 +9526,28 @@ YY_RULE_SETUP
     BEGIN(INITIAL);
 }
 	YY_BREAK
-case 197:
+case 202:
 YY_RULE_SETUP
-#line 588 "interface.l"
+#line 597 "interface.l"
 {
   iface_read_att(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 198:
+case 203:
 YY_RULE_SETUP
-#line 593 "interface.l"
+#line 602 "interface.l"
 {
   iface_read_prolog(trim(interfacetext));
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 199:
+case 204:
 YY_RULE_SETUP
-#line 598 "interface.l"
+#line 607 "interface.l"
 {
   if ((lexcfilein = file_to_mem(trim(interfacetext))) != NULL) {
-    stack_add(fsm_lexc_parse_string(lexcfilein, 1)); // verbose parameter added in HFST
+     stack_add(fsm_lexc_parse_string(lexcfilein, 1));
      xxfree(lexcfilein); 
   } else {
     printf("Error opening file '%s'.\n", interfacetext);
@@ -9384,17 +9555,17 @@ YY_RULE_SETUP
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 200:
+case 205:
 YY_RULE_SETUP
-#line 608 "interface.l"
+#line 617 "interface.l"
 {
    iface_print_cmatrix_att(trim(interfacetext));
    BEGIN(INITIAL);
 }
 	YY_BREAK
-case 201:
+case 206:
 YY_RULE_SETUP
-#line 613 "interface.l"
+#line 622 "interface.l"
 {
   if (iface_stack_check(1)) {
     if ((cmatrixfilein = file_to_mem(trim(interfacetext))) != NULL) {
@@ -9408,26 +9579,26 @@ YY_RULE_SETUP
   BEGIN(INITIAL);
 }
 	YY_BREAK
-case 202:
+case 207:
 YY_RULE_SETUP
-#line 626 "interface.l"
+#line 635 "interface.l"
 { }
 	YY_BREAK
-case 203:
-/* rule 203 can match eol */
+case 208:
+/* rule 208 can match eol */
 YY_RULE_SETUP
-#line 628 "interface.l"
+#line 637 "interface.l"
 { }
 	YY_BREAK
-case 204:
+case 209:
 YY_RULE_SETUP
-#line 629 "interface.l"
+#line 638 "interface.l"
 { }
 	YY_BREAK
-case 205:
-/* rule 205 can match eol */
+case 210:
+/* rule 210 can match eol */
 YY_RULE_SETUP
-#line 631 "interface.l"
+#line 640 "interface.l"
 {
       if (!input_is_file)
         printf("Unknown command. Ignoring until end of line.\n");
@@ -9436,9 +9607,9 @@ YY_RULE_SETUP
       return 1;
 }
 	YY_BREAK
-case 206:
+case 211:
 YY_RULE_SETUP
-#line 639 "interface.l"
+#line 648 "interface.l"
 { BEGIN(INITIAL);  }
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
@@ -9499,22 +9670,23 @@ case YY_STATE_EOF(ATT):
 case YY_STATE_EOF(EXCMATRIX):
 case YY_STATE_EOF(ASSERT_STACK):
 case YY_STATE_EOF(WORDS_FILE):
+case YY_STATE_EOF(PAIRS_FILE):
 case YY_STATE_EOF(UPPER_WORDS_FILE):
 case YY_STATE_EOF(LOWER_WORDS_FILE):
-#line 642 "interface.l"
+#line 650 "interface.l"
 {
-  interfacepop_buffer_state();
-  if (!YY_CURRENT_BUFFER) {
-     yyterminate();
-  }
+    interfacepop_buffer_state();
+    if (!YY_CURRENT_BUFFER) {
+	yyterminate();
+    }
 }
 	YY_BREAK
-case 207:
+case 212:
 YY_RULE_SETUP
-#line 648 "interface.l"
+#line 656 "interface.l"
 ECHO;
 	YY_BREAK
-#line 9518 "lex.interface.c"
+#line 9690 "lex.interface.c"
 
 	case YY_END_OF_BUFFER:
 		{
@@ -9698,7 +9870,7 @@ static int yy_get_next_buffer (void)
 
 	else
 		{
-			yy_size_t num_to_read =
+			int num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
@@ -9714,7 +9886,7 @@ static int yy_get_next_buffer (void)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
+			(yy_n_chars), (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
@@ -9774,7 +9946,7 @@ static int yy_get_next_buffer (void)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 2856 )
+			if ( yy_current_state >= 2913 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -9797,11 +9969,11 @@ static int yy_get_next_buffer (void)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 2856 )
+		if ( yy_current_state >= 2913 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 2855);
+	yy_is_jam = (yy_current_state == 2912);
 	if ( ! yy_is_jam )
 		*(yy_state_ptr)++ = yy_current_state;
 
@@ -9832,7 +10004,7 @@ static int yy_get_next_buffer (void)
 
 		else
 			{ /* need more input */
-			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+			int offset = (yy_c_buf_p) - (yytext_ptr);
 			++(yy_c_buf_p);
 
 			switch ( yy_get_next_buffer(  ) )
@@ -9856,7 +10028,7 @@ static int yy_get_next_buffer (void)
 				case EOB_ACT_END_OF_FILE:
 					{
 					if ( interfacewrap( ) )
-						return 0;
+						return EOF;
 
 					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
@@ -10114,7 +10286,7 @@ void interfacepop_buffer_state (void)
  */
 static void interfaceensure_buffer_stack (void)
 {
-	yy_size_t num_to_alloc;
+	int num_to_alloc;
     
 	if (!(yy_buffer_stack)) {
 
@@ -10206,16 +10378,17 @@ YY_BUFFER_STATE interface_scan_string (yyconst char * yystr )
 
 /** Setup the input buffer state to scan the given bytes. The next call to interfacelex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE interface_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
+YY_BUFFER_STATE interface_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	int i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -10297,7 +10470,7 @@ FILE *interfaceget_out  (void)
 /** Get the length of the current token.
  * 
  */
-yy_size_t interfaceget_leng  (void)
+int interfaceget_leng  (void)
 {
         return interfaceleng;
 }
@@ -10456,4 +10629,4 @@ void interfacefree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 648 "interface.l"
+#line 656 "interface.l"
diff --git a/back-ends/foma/lex.lexc.c b/back-ends/foma/lex.lexc.c
index 36babcb..359e11a 100644
--- a/back-ends/foma/lex.lexc.c
+++ b/back-ends/foma/lex.lexc.c
@@ -1,9 +1,7 @@
 #line 22 "lexc.l"
 #define YY_BUF_SIZE 16777216
 
-#if defined (_MSC_VER) || (__MINGW32__)
-typedef long off_t;
-#endif
+
 
 #line 7 "lex.lexc.c"
 
@@ -71,7 +69,6 @@ typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
@@ -79,7 +76,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -110,6 +106,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -166,7 +164,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -178,12 +184,7 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t lexcleng;
+extern int lexcleng;
 
 extern FILE *lexcin, *lexcout;
 
@@ -209,6 +210,11 @@ extern FILE *lexcin, *lexcout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -226,7 +232,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	yy_size_t yy_n_chars;
+	int yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -296,8 +302,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* yy_hold_char holds the character lost when lexctext is formed. */
 static char yy_hold_char;
-static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
-yy_size_t lexcleng;
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+int lexcleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
@@ -325,7 +331,7 @@ static void lexc_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
 YY_BUFFER_STATE lexc_scan_buffer (char *base,yy_size_t size  );
 YY_BUFFER_STATE lexc_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE lexc_scan_bytes (yyconst char *bytes,yy_size_t len  );
+YY_BUFFER_STATE lexc_scan_bytes (yyconst char *bytes,int len  );
 
 void *lexcalloc (yy_size_t  );
 void *lexcrealloc (void *,yy_size_t  );
@@ -382,7 +388,7 @@ static void yy_fatal_error (yyconst char msg[]  );
 #define YY_DO_BEFORE_ACTION \
 	(yytext_ptr) = yy_bp; \
 	(yytext_ptr) -= (yy_more_len); \
-	lexcleng = (yy_size_t) (yy_cp - (yytext_ptr)); \
+	lexcleng = (size_t) (yy_cp - (yytext_ptr)); \
 	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
 	(yy_c_buf_p) = yy_cp;
@@ -1312,7 +1318,7 @@ static int yy_more_len = 0;
 char *lexctext;
 #line 1 "lexc.l"
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 /*     This file is part of foma.                                            */
 /*     Foma is free software: you can redistribute it and/or modify          */
 /*     it under the terms of the GNU General Public License version 2 as     */
@@ -1335,46 +1341,43 @@ char *lexctext;
 #define YY_USER_ACTION lexccolumn += lexcleng;
 static int lexentries;
 extern int lexclex();
-extern struct defined *defines;
-static struct defined *olddefines;
-extern int my_yyparse(char *my_string, int lineno);
+static struct defined_networks *olddefines;
+extern int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 extern struct fsm *current_parse;
 static char *tempstr;
 int lexccolumn = 0;
 
-int verbose_lexc_ = 1; // HFST addition
+#ifndef ORIGINAL
+int verbose_lexc_ = 1;
+#endif
 
-// HFST added parameter verbose
 struct fsm *fsm_lexc_parse_string(char *string, int verbose) {
 
-   olddefines = defines;
+   olddefines = g_defines;
    YY_BUFFER_STATE my_string_buffer;
-   verbose_lexc_ = verbose;
    my_string_buffer = lexc_scan_string(string);
    lexentries = -1;
    lexclineno = 1;
    lexc_init();
    if (lexclex() != 1) {
      if (lexentries != -1) {
-       if (verbose == 1)
-         fprintf(stderr, "%i\n",lexentries);   // HFST changed stdout to stderr
+         printf("%i\n",lexentries);
      }       
    } 
    lexc_delete_buffer(my_string_buffer);
-   defines = olddefines;
+   g_defines = olddefines;
    return(lexc_to_fsm());
 }
 
 struct fsm *fsm_lexc_parse_file(char *filename, int verbose) {
   char *mystring;
   mystring = file_to_mem(filename);
-  return(fsm_lexc_parse_string(mystring, verbose));					       
+  return(fsm_lexc_parse_string(mystring, verbose));
 }
 
 void lexc_trim(char *s) {
   /* Remove trailing ; and = and space and initial space */
   int i,j;
-  i = strlen(s);
   for (i = strlen(s)-1; *(s+i) == ';' || *(s+i) == '=' || *(s+i) == ' ' || *(s+i) == '\t'; i--)
     *(s+i) = '\0';  
   for (i=0; *(s+i) == ' ' || *(s+i) == '\t' || *(s+i) == '\n'; i++) {
@@ -1387,7 +1390,7 @@ void lexc_trim(char *s) {
 
 /* Nonreserved = anything except ; < > ! or space */
 
-#line 1384 "lex.lexc.c"
+#line 1394 "lex.lexc.c"
 
 #define INITIAL 0
 #define MCS 1
@@ -1438,7 +1441,7 @@ FILE *lexcget_out (void );
 
 void lexcset_out  (FILE * out_str  );
 
-yy_size_t lexcget_leng (void );
+int lexcget_leng (void );
 
 char *lexcget_text (void );
 
@@ -1478,7 +1481,12 @@ static int input (void );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -1486,7 +1494,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( lexctext, lexcleng, 1, lexcout )
+#define ECHO do { if (fwrite( lexctext, lexcleng, 1, lexcout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -1497,7 +1505,7 @@ static int input (void );
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		yy_size_t n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( lexcin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -1579,11 +1587,11 @@ YY_DECL
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
     
-#line 96 "lexc.l"
+#line 98 "lexc.l"
 
 
  /* Files begin with one of these three identifiers */
-#line 1580 "lex.lexc.c"
+#line 1595 "lex.lexc.c"
 
 	if ( !(yy_init) )
 		{
@@ -1659,7 +1667,6 @@ yy_match:
 yy_find_action:
 		yy_current_state = *--(yy_state_ptr);
 		(yy_lp) = yy_accept[yy_current_state];
-goto find_rule; /* Shut up GCC warning -Wall */
 find_rule: /* we branch to this label when backing up */
 		for ( ; ; ) /* until we find what rule we matched */
 			{
@@ -1704,14 +1711,14 @@ do_action:	/* This label is used only to access EOF actions. */
 	{ /* beginning of action switch */
 case 1:
 YY_RULE_SETUP
-#line 99 "lexc.l"
+#line 101 "lexc.l"
 {
   BEGIN(MCS);
 }
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 103 "lexc.l"
+#line 105 "lexc.l"
 {
     BEGIN(DEF);
 }
@@ -1721,20 +1728,20 @@ YY_RULE_SETUP
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 109 "lexc.l"
+#line 111 "lexc.l"
 {
   yymore();
 }
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 113 "lexc.l"
+#line 115 "lexc.l"
 { }
 	YY_BREAK
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 114 "lexc.l"
+#line 116 "lexc.l"
 { lexclineno++; lexccolumn = 1;}
 	YY_BREAK
 /* Multichar definitions */
@@ -1742,7 +1749,7 @@ YY_RULE_SETUP
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 118 "lexc.l"
+#line 120 "lexc.l"
 {
   lexc_add_mc(lexctext);
 }
@@ -1750,17 +1757,14 @@ YY_RULE_SETUP
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 122 "lexc.l"
+#line 124 "lexc.l"
 {
   lexc_trim(lexctext+8);
   if (lexentries != -1) {
-    if (verbose_lexc_ == 1)
-      fprintf(stderr, "%i, ",lexentries);   // HFST changed stdout to stderr
-  }
-  if (verbose_lexc_ == 1) {
-    fprintf(stderr, "%s...",lexctext+8);  // HFST changed stdout to stderr
-    fflush(stderr);
+    printf("%i, ",lexentries);
   }
+  printf("%s...",lexctext+8); 
+  fflush(stdout);
   lexentries = 0;
   lexc_set_current_lexicon(lexctext+8, SOURCE_LEXICON);
   BEGIN(LEXENTRIES);
@@ -1769,7 +1773,7 @@ YY_RULE_SETUP
 /* Grab info string */
 case 8:
 YY_RULE_SETUP
-#line 135 "lexc.l"
+#line 137 "lexc.l"
 {
   BEGIN(LEXENTRIES);
 }
@@ -1778,16 +1782,16 @@ YY_RULE_SETUP
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 139 "lexc.l"
+#line 141 "lexc.l"
 {
     lexc_trim(lexctext);
     lexc_set_current_lexicon(lexctext, TARGET_LEXICON);
     lexc_add_word();
     lexc_clear_current_word();
     lexentries++;
-    if (lexentries %10000 == 0 && verbose_lexc_ == 1) {
-      fprintf(stderr, "%i...",lexentries);   // HFST changed stdout to stderr
-      fflush(stderr);
+    if (lexentries %10000 == 0) {
+      printf("%i...",lexentries);
+      fflush(stdout);
     }
     BEGIN(EATUPINFO);
 }
@@ -1796,7 +1800,7 @@ YY_RULE_SETUP
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
-#line 154 "lexc.l"
+#line 156 "lexc.l"
 {
       lexc_set_current_word(lexctext);
 }
@@ -1804,7 +1808,7 @@ YY_RULE_SETUP
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
-#line 159 "lexc.l"
+#line 161 "lexc.l"
 {
     //printf("[%s]\n", lexctext);
     lexc_trim(lexctext);
@@ -1812,16 +1816,16 @@ YY_RULE_SETUP
     lexc_add_word();
     lexc_clear_current_word();
     lexentries++;
-    if (lexentries %10000 == 0 && verbose_lexc_ == 1) {
-      fprintf(stderr, "%i...",lexentries);   // HFST changed stdout to stderr
-      fflush(stderr);
+    if (lexentries %10000 == 0) {
+      printf("%i...",lexentries);
+      fflush(stdout);
     }
 }
 	YY_BREAK
 /* A REGEX entry begins and ends with a < , > */
 case 12:
 YY_RULE_SETUP
-#line 173 "lexc.l"
+#line 175 "lexc.l"
 {
   BEGIN(REGEX);
 }
@@ -1829,10 +1833,10 @@ YY_RULE_SETUP
 /* \076 = > */
 case 13:
 YY_RULE_SETUP
-#line 177 "lexc.l"
+#line 179 "lexc.l"
 {
     *(lexctext+lexcleng-1) = ';';
-    if (my_yyparse(lexctext, lexclineno) == 0) {
+    if (my_yyparse(lexctext, lexclineno, g_defines, NULL) == 0) {
        lexc_set_network(current_parse);
     }    
     BEGIN(LEXENTRIES);
@@ -1840,7 +1844,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 185 "lexc.l"
+#line 187 "lexc.l"
 {
   BEGIN(REGEXB);
   yymore();
@@ -1849,14 +1853,14 @@ YY_RULE_SETUP
 case 15:
 /* rule 15 can match eol */
 YY_RULE_SETUP
-#line 189 "lexc.l"
+#line 191 "lexc.l"
 {
   yymore();
 }
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 192 "lexc.l"
+#line 194 "lexc.l"
 {
   BEGIN(REGEX);
   yymore();
@@ -1864,7 +1868,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 196 "lexc.l"
+#line 198 "lexc.l"
 {
   BEGIN(REGEXQ);
   yymore();
@@ -1873,14 +1877,14 @@ YY_RULE_SETUP
 case 18:
 /* rule 18 can match eol */
 YY_RULE_SETUP
-#line 200 "lexc.l"
+#line 202 "lexc.l"
 {
   yymore();
 }
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 203 "lexc.l"
+#line 205 "lexc.l"
 {
   BEGIN(REGEX);
   yymore();
@@ -1889,7 +1893,7 @@ YY_RULE_SETUP
 case 20:
 /* rule 20 can match eol */
 YY_RULE_SETUP
-#line 207 "lexc.l"
+#line 209 "lexc.l"
 {
     lexc_trim(lexctext);
     tempstr = xxstrdup(lexctext);
@@ -1899,10 +1903,10 @@ YY_RULE_SETUP
 /* \073 = ; */
 case 21:
 YY_RULE_SETUP
-#line 213 "lexc.l"
+#line 215 "lexc.l"
 {
-    if (my_yyparse(lexctext, lexclineno) == 0) {
-      add_defined(fsm_topsort(fsm_minimize(current_parse)),tempstr);
+    if (my_yyparse(lexctext, lexclineno, g_defines, NULL) == 0) {
+      add_defined(g_defines, fsm_topsort(fsm_minimize(current_parse)),tempstr);
     }
     xxfree(tempstr);
     BEGIN(DEF);
@@ -1911,14 +1915,14 @@ YY_RULE_SETUP
 case 22:
 /* rule 22 can match eol */
 YY_RULE_SETUP
-#line 220 "lexc.l"
+#line 222 "lexc.l"
 {
   yymore();
 }
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 223 "lexc.l"
+#line 225 "lexc.l"
 {
   BEGIN(DEFREGEXB);
   yymore();
@@ -1927,14 +1931,14 @@ YY_RULE_SETUP
 case 24:
 /* rule 24 can match eol */
 YY_RULE_SETUP
-#line 227 "lexc.l"
+#line 229 "lexc.l"
 {
   yymore();
 }
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 230 "lexc.l"
+#line 232 "lexc.l"
 {
   BEGIN(DEFREGEX);
   yymore();
@@ -1942,7 +1946,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 234 "lexc.l"
+#line 236 "lexc.l"
 {
   BEGIN(DEFREGEXQ);
   yymore();
@@ -1951,14 +1955,14 @@ YY_RULE_SETUP
 case 27:
 /* rule 27 can match eol */
 YY_RULE_SETUP
-#line 238 "lexc.l"
+#line 240 "lexc.l"
 {
   yymore();
 }
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 241 "lexc.l"
+#line 243 "lexc.l"
 {
   BEGIN(DEFREGEX);
   yymore();
@@ -1967,20 +1971,20 @@ YY_RULE_SETUP
 case 29:
 /* rule 29 can match eol */
 YY_RULE_SETUP
-#line 245 "lexc.l"
-{ /* printf ("Comment: [%s]\n",lexctext); */ }
+#line 247 "lexc.l"
+{  /* printf ("Comment: [%s]\n",lexctext); */  }
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 247 "lexc.l"
-{ fprintf(stderr, "\n***Syntax error on line %i column %i at '%s'\n",lexclineno,lexccolumn,lexctext); return 1;}   // HFST changed stdout to stderr
+#line 249 "lexc.l"
+{ printf("\n***Syntax error on line %i column %i at '%s'\n",lexclineno,lexccolumn,lexctext); return 1;}
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 248 "lexc.l"
+#line 250 "lexc.l"
 ECHO;
 	YY_BREAK
-#line 1974 "lex.lexc.c"
+#line 1988 "lex.lexc.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(MCS):
 			case YY_STATE_EOF(LEXICON):
@@ -2178,7 +2182,7 @@ static int yy_get_next_buffer (void)
 
 	else
 		{
-			yy_size_t num_to_read =
+			int num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
@@ -2194,7 +2198,7 @@ static int yy_get_next_buffer (void)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
+			(yy_n_chars), (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
@@ -2311,7 +2315,7 @@ static int yy_get_next_buffer (void)
 
 		else
 			{ /* need more input */
-			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+			int offset = (yy_c_buf_p) - (yytext_ptr);
 			++(yy_c_buf_p);
 
 			switch ( yy_get_next_buffer(  ) )
@@ -2335,7 +2339,7 @@ static int yy_get_next_buffer (void)
 				case EOB_ACT_END_OF_FILE:
 					{
 					if ( lexcwrap( ) )
-						return 0;
+						return EOF;
 
 					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
@@ -2587,7 +2591,7 @@ void lexcpop_buffer_state (void)
  */
 static void lexcensure_buffer_stack (void)
 {
-	yy_size_t num_to_alloc;
+	int num_to_alloc;
     
 	if (!(yy_buffer_stack)) {
 
@@ -2671,7 +2675,7 @@ YY_BUFFER_STATE lexc_scan_buffer  (char * base, yy_size_t  size )
  * @note If you want to scan bytes that may contain NUL values, then use
  *       lexc_scan_bytes() instead.
  */
-YY_BUFFER_STATE lexc_scan_string (yyconst char * yystr)
+YY_BUFFER_STATE lexc_scan_string (yyconst char * yystr )
 {
     
 	return lexc_scan_bytes(yystr,strlen(yystr) );
@@ -2679,16 +2683,17 @@ YY_BUFFER_STATE lexc_scan_string (yyconst char * yystr)
 
 /** Setup the input buffer state to scan the given bytes. The next call to lexclex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE lexc_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
+YY_BUFFER_STATE lexc_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	int i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -2770,7 +2775,7 @@ FILE *lexcget_out  (void)
 /** Get the length of the current token.
  * 
  */
-yy_size_t lexcget_leng  (void)
+int lexcget_leng  (void)
 {
         return lexcleng;
 }
@@ -2926,4 +2931,4 @@ void lexcfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 248 "lexc.l"
+#line 250 "lexc.l"
diff --git a/back-ends/foma/lex.yy.c b/back-ends/foma/lex.yy.c
index c91e54c..de29b9c 100644
--- a/back-ends/foma/lex.yy.c
+++ b/back-ends/foma/lex.yy.c
@@ -1,6 +1,3 @@
-#if defined (_MSC_VER) || (__MINGW32__)
-typedef long off_t;
-#endif
 
 #line 3 "lex.yy.c"
 
@@ -49,7 +46,6 @@ typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
@@ -57,10 +53,8 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
-#ifndef _MSC_VER
 #ifndef INT8_MIN
 #define INT8_MIN               (-128)
 #endif
@@ -88,7 +82,8 @@ typedef unsigned int flex_uint32_t;
 #ifndef UINT32_MAX
 #define UINT32_MAX             (4294967295U)
 #endif
-#endif // _MSC_VER
+
+#endif /* ! C99 */
 
 #endif /* ! FLEXINT_H */
 
@@ -163,7 +158,15 @@ typedef void* yyscan_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -175,11 +178,6 @@ typedef void* yyscan_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
@@ -193,7 +191,7 @@ typedef size_t yy_size_t;
      */
     #define  YY_LESS_LINENO(n) \
             do { \
-                yy_size_t yyl;\
+                int yyl;\
                 for ( yyl = n; yyl < yyleng; ++yyl )\
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
@@ -215,6 +213,11 @@ typedef size_t yy_size_t;
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -232,7 +235,7 @@ struct yy_buffer_state
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	yy_size_t yy_n_chars;
+	int yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
@@ -311,7 +314,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
 
 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
 
 void *yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -357,13 +360,13 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
  */
 #define YY_DO_BEFORE_ACTION \
 	yyg->yytext_ptr = yy_bp; \
-	yyleng = (yy_size_t) (yy_cp - yy_bp); \
+	yyleng = (size_t) (yy_cp - yy_bp); \
 	yyg->yy_hold_char = *yy_cp; \
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 125
-#define YY_END_OF_BUFFER 126
+#define YY_NUM_RULES 128
+#define YY_END_OF_BUFFER 129
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -371,69 +374,71 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_accept[556] =
+static yyconst flex_int16_t yy_accept[573] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  126,  124,   10,  122,  123,  124,
-      124,  104,  124,  120,   43,  114,  115,  106,  105,   93,
-      101,  124,   96,   91,  118,   60,   43,   61,  124,  109,
-      100,  110,  124,   45,   86,  124,  119,   54,  124,  124,
-      124,  124,  124,  124,  124,  124,  124,  124,  125,  125,
-      125,  125,  125,   18,  125,  125,  125,  125,  125,  125,
-      125,  125,   15,   10,  122,  123,    0,  121,    0,   19,
-        0,    0,    0,  103,  102,   43,    0,    0,    0,    0,
-       43,   42,    0,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,    0,    0,    0,    0,    0,   94,   63,    0,
-        0,    0,   46,   47,    0,    0,   50,   48,  107,    0,
-        0,  108,    0,   88,    0,  117,  116,   65,   59,   79,
-       85,   75,    0,    0,   83,   71,    0,    0,    0,    0,
-       90,   89,    6,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,   87,
-       54,   92,   21,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,   17,    0,    0,    0,
-        0,    0,    0,   13,    0,    0,    0,    0,    0,    0,
-       14,    0,    0,    0,    0,    0,   16,    0,    0,   43,
-
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,   73,   44,   62,   95,   56,
-       57,   55,   58,   97,   99,   67,   77,    0,   69,   81,
-        0,    0,    0,   49,   98,    9,    8,    0,   22,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    1,    0,    1,    0,    0,    0,    0,    1,    0,
-        0,    0,    0,    1,    0,    0,    0,    0,   51,   52,
-       20,   53,  120,  119,  113,  111,  112,    0,    0,    0,
+        0,    0,    0,    0,  129,  127,   10,  125,  126,  127,
+      127,  107,  127,  123,   46,  117,  118,  109,  108,   96,
+      104,  127,   99,   94,  121,   63,   46,   64,  127,  112,
+      103,  113,  127,   48,   89,  127,  122,   57,  127,  127,
+      127,  127,  127,  127,  127,  127,  127,  127,  128,  128,
+      128,  128,  128,   18,  128,  128,  128,  128,  128,  128,
+      128,  128,   15,   10,  125,  126,    0,  124,    0,   19,
+        0,    0,    0,  106,  105,   46,    0,    0,    0,    0,
+       46,   45,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,   97,   66,    0,
+        0,    0,   49,   50,    0,    0,   53,   51,  110,    0,
+        0,  111,    0,   91,    0,  120,  119,   68,   62,   82,
+       88,   78,    0,    0,   86,   74,    0,    0,    0,    0,
+       93,   92,    6,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,   90,   57,   95,   21,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   17,    0,
+        0,    0,    0,    0,    0,   13,    0,    0,    0,    0,
+        0,    0,   14,    0,    0,    0,    0,    0,   16,    0,
 
-        0,    0,    0,    0,    0,   64,    0,   66,    0,    0,
-       80,   76,    0,   84,    0,   72,    0,    0,    2,    0,
-        0,    0,    0,    0,    0,    0,    0,   34,    0,    0,
-        0,    0,    0,   27,    0,    0,    0,    0,    0,    1,
-        0,    0,    0,    0,    1,    0,    0,    0,    0,    1,
-        0,    0,    0,    0,    1,    0,    0,    0,    0,    0,
+        0,   46,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   76,   47,   65,
+       98,   59,   60,   58,   61,  100,  102,   70,   80,    0,
+       72,   84,    0,    0,    0,   52,  101,    9,    8,    0,
+       22,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    1,    0,    1,    0,    0,
+        0,    0,    1,    0,    0,    0,    0,    1,    0,    0,
+        0,    0,   54,   55,   20,   56,  123,  122,  116,  114,
+      115,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,   67,
+        0,   69,    0,    0,   83,   79,    0,   87,    0,   75,
+        0,    0,    2,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,   34,    0,    0,    0,    0,    0,   27,    0,
+        0,    0,    0,    0,    0,    1,    0,    0,    0,    0,
         1,    0,    0,    0,    0,    1,    0,    0,    0,    0,
-        1,    0,    0,    0,    0,    0,   74,   68,   78,   70,
-       82,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        1,    0,    0,    0,    0,    0,    1,    0,    0,    0,
+        0,    1,    0,    0,    0,    0,    1,    0,    0,    0,
+        0,    0,   77,   71,   81,   73,   85,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    1,    0,    0,    0,    0,    1,    0,    0,    0,
-        0,    1,    0,    0,    0,    0,    1,    0,    0,    0,
-        0,    1,    0,    0,    0,    0,    1,    0,    0,    0,
-       11,    0,    0,   12,    0,    0,    3,    0,    0,    7,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    1,
+        0,    0,    0,    0,    1,    0,    0,    0,    0,    1,
+        0,    0,    0,    0,    1,    0,    0,    0,    0,    1,
+        0,    0,    0,    0,    1,    0,    0,    0,   11,    0,
+        0,   12,    0,    0,    3,    0,    0,    7,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    4,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,   26,    0,    5,    0,    0,    0,
-        0,    0,   33,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,    0,   38,    0,   39,    0,   32,   41,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,   30,    0,
-        0,    0,   40,    0,   35,    0,    0,    0,    0,    0,
-        0,   28,    0,   31,    0,    0,    0,   24,    0,    0,
-        0,    0,    0,    0,    0,   36,    0,   25,    0,   29,
-        0,   23,    0,   37,    0
+        0,    0,    0,    0,    0,    0,    0,   43,    0,    0,
+        0,    0,    0,    0,    0,    0,   26,    0,    0,    5,
+
+        0,    0,    0,    0,    0,   33,    0,   44,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   38,    0,
+       39,    0,   32,   41,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,   30,    0,    0,    0,   40,    0,
+       35,   42,    0,    0,    0,    0,    0,    0,   28,    0,
+       31,    0,    0,    0,   24,    0,    0,    0,    0,    0,
+        0,    0,   36,    0,   25,    0,   29,    0,   23,    0,
+       37,    0
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -484,166 +489,170 @@ static yyconst flex_int32_t yy_meta[106] =
         5,    5,    5,    5,   11
     } ;
 
-static yyconst flex_int16_t yy_base[696] =
+static yyconst flex_int16_t yy_base[713] =
     {   0,
-        0,    0,    0,    0,   99,  198, 1400, 1399,  290,  381,
-      472,  563, 1391, 1390, 1403, 4440,  105, 1398, 1396, 1396,
-      111,   90,   25, 4440,  121,  124, 4440, 4440, 4440, 1381,
-     1369,  660,   95, 4440,   89,  115,  134, 1366,  298,  117,
-      120, 4440,  285,  206, 4440,  232, 1332, 4440,    0,  138,
+        0,    0,    0,    0,   99,  198, 1516, 1515,  290,  381,
+      472,  563, 1507, 1504, 1517, 4440,  105, 1513, 1511, 1511,
+      111,   90,   25, 4440,  121,  124, 4440, 4440, 4440, 1496,
+     1484,  660,   95, 4440,   89,  115,  134, 1481,  298,  117,
+      120, 4440,  285,  206, 4440,  232, 1380, 4440,    0,  138,
       160,    0,  158,    0,    0,  653,    0,    0, 4440,  302,
       755,    0,    0, 4440,  323,  858,    0,    0,  334,  950,
-        0,    0, 4440,  106, 1391, 1389, 1389, 4440,  312, 4440,
+        0,    0, 4440,  106, 1419, 1417, 1407, 4440,  312, 4440,
      1042,    0,    0, 4440, 4440,  407,    0,    0,    0,  392,
       429, 4440,    0,  153,  162,    0,  161,    0,    0, 1080,
 
-        0,    0, 1353,  119, 1320,  120, 1274, 4440, 1318, 1328,
-     1327, 1326, 4440, 4440, 1325, 1324, 4440, 4440, 4440, 1300,
-     1299, 4440, 1288, 1286, 1285, 4440, 4440,   84, 4440, 4440,
-     4440, 4440,    0, 1276, 1285, 4440, 1258, 1244, 1239,    0,
-     4440, 1263,  136,  237,  240,  299, 1284,  295, 1242, 1246,
-     1238,  273, 1253, 1240, 1240,  514,  695,  705,  716, 4440,
-     4440, 4440, 4440,    0,    0,  224,  444, 1283,  437,    0,
-      514,  498,    0,    0,    0,  755, 4440, 1182,    0,    0,
-        0,    0,  524, 4440, 1285,    0,    0,    0,    0,  574,
-     4440, 1377,    0,    0,    0,    0, 4440,    0,    0,  675,
-
-        0,  157,  348,    0,  496,    0,    0, 1404,    0,    0,
-        0,    0,    0,  246,  440,  795,  257,  121,  507, 1271,
-     1270, 1255,   99, 1268,  178, 4440, 4440, 4440, 4440, 4440,
-     4440, 4440, 4440, 4440, 4440, 4440, 4440, 1274, 4440, 4440,
-     1273, 1219, 1221, 4440, 4440,  422,  575,  869, 4440, 1205,
-     1198, 1205, 1232, 1204,  639, 1198, 1229, 1182, 1185, 1170,
-     1175, 4440,  799,  809,  890,  911,  952,  993, 1211, 1134,
-     1213, 1225, 1236,    0, 1287, 1338, 1506, 1117, 4440, 4440,
-     4440, 4440, 4440, 4440, 4440, 4440, 4440,  511,    0,    0,
-        0,    0,    0,    0,  587,  626, 1209,  685,    0,  992,
-
-      784,    0,    0,    0,    0, 4440, 1197, 4440, 1196, 1195,
-     4440, 4440, 1194, 4440, 1193, 4440,  820,  861, 4440,    0,
-     1149, 1198,  589,  760,  655, 1159,  303, 4440, 1146, 1144,
-     1158, 1149, 1142, 4440, 1153, 1148, 1148, 1144, 1004, 1122,
-     1516, 1526, 1536, 1578, 1588, 1638, 1648, 1658, 1668, 1710,
-     1720, 1770, 1780, 1790, 1190, 1800, 1842, 1852, 1189, 1902,
-     1912, 1922, 1932, 1974, 1984, 1188, 2034, 2044, 2054, 2064,
-     1187, 2106, 2116, 2166, 1097,    0, 4440, 4440, 4440, 4440,
-     4440, 1316, 2268,    0,    0, 1328, 2360,    0,    0, 1181,
-     1180,    0,  763,  982, 1099, 1093, 1092, 1096, 1095, 1089,
-
-     1100, 1082, 1087, 1054, 1047, 1031, 1030, 1027, 1040, 1041,
-     1446, 1456, 2178, 2188, 2229, 2300, 2310, 2320, 2362, 2391,
-     2453, 2464, 2474, 2494, 2515, 2536, 2577, 2596, 2606, 2618,
-     2647, 2659, 2709, 2721, 2731, 2750, 2772, 2791, 2834, 2853,
-     4440,    0,    0, 4440,    0,    0, 4440,    0, 1069, 4440,
-     1024, 1022, 1021, 1020, 1019, 1019, 1011, 1021, 1021, 1010,
-     1010, 1014,  944,  961,  987,  946,    0,    0,  991, 4440,
-      957,  931,  938,  934,  941,  967,  922,  927,  920,  919,
-      933,  914,  921,  924, 4440,  930, 4440,  920,  955,  920,
-      953,  839, 4440,  874,  872,  832,  828,  825,  816,  817,
-
-      772,  755,  740, 4440,  737, 4440,  754, 4440, 4440,  714,
-      704,  714,  704,  662,  701,  653,  651,  662, 4440,  650,
-      638,  635, 4440,  299, 4440,  677,  637,  638,  568,  594,
-      552, 4440,  540, 4440,  532,  487,  474, 4440,  464,  464,
-      487,  446,  484,  390,  428, 4440,  344, 4440,  339, 4440,
-      296, 4440,  297, 4440, 4440, 2957, 2968, 2979, 2990, 3001,
-     3012, 3020, 3024, 3030, 3041, 3052, 3063, 3074, 3085, 3096,
-     3104, 3115, 3126, 3137, 3148, 3159, 3170, 3181, 3192, 3203,
-     3211, 3222,  249, 3233, 3244, 3255, 3266, 3270, 3276, 3287,
-     3298, 3309, 3320, 3331, 3342, 3353, 3364, 3375, 3386, 3397,
-
-     3408, 3416, 3427, 3438, 3449, 3460, 3471, 3482, 3493, 3504,
-     3515, 3526, 3537, 3548,  111, 3559, 3570, 3581, 3592, 3603,
-     3614, 3625, 3636, 3647, 3658, 3669, 3680, 3691, 3702, 3713,
-     3724, 3735, 3746, 3757, 3768, 3779, 3790, 3801, 3812, 3823,
-     3834, 3845, 3856, 3867, 3878, 3889, 3900, 3911, 3922, 3933,
-     3944, 3955, 3966, 3977, 3988, 3999, 4010, 4021, 4032, 4043,
-     4054, 4065, 4076, 4087, 4098, 4109, 4120, 4131, 4142, 4153,
-     4164, 4175, 4186, 4197, 4208, 4219, 4230, 4241, 4252, 4263,
-     4274, 4285, 4296, 4307, 4318, 4329, 4340, 4351, 4362, 4373,
-     4384, 4395, 4406, 4417, 4428
-
+        0,    0, 1381,  119, 1378,  120, 1332, 4440, 1376, 1386,
+     1385, 1384, 4440, 4440, 1382, 1381, 4440, 4440, 4440, 1380,
+     1379, 4440, 1378, 1376, 1375, 4440, 4440,   84, 4440, 4440,
+     4440, 4440,    0, 1366, 1375, 4440, 1348, 1324, 1290,    0,
+     4440, 1314,  136,  237,  299,  317, 1335,  300, 1298, 1292,
+     1296, 1288,  273, 1303, 1267, 1260, 1256,  514,  695,  705,
+      716, 4440, 4440, 4440, 4440,    0,    0,  224,  444, 1303,
+      437,    0,  514,  498,    0,    0,    0,  755, 4440, 1182,
+        0,    0,    0,    0,  524, 4440, 1285,    0,    0,    0,
+        0,  574, 4440, 1377,    0,    0,    0,    0, 4440,    0,
+
+        0,  675,    0,  157,  348,    0,  496,    0,    0, 1404,
+        0,    0,    0,    0,    0,  429,  440,  795,  512,  121,
+      507, 1291, 1290, 1275,   99, 1288,  245, 4440, 4440, 4440,
+     4440, 4440, 4440, 4440, 4440, 4440, 4440, 4440, 4440, 1294,
+     4440, 4440, 1292, 1238, 1240, 4440, 4440,  323,  422,  869,
+     4440, 1253, 1246, 1253, 1241, 1279, 1251,  639, 1241, 1272,
+     1225, 1228, 1225, 1240, 1240, 4440,  799,  809,  890,  911,
+      952,  993, 1276, 1134, 1213, 1225, 1236,    0, 1287, 1338,
+     1506, 1182, 4440, 4440, 4440, 4440, 4440, 4440, 4440, 4440,
+     4440,  258,    0,    0,    0,    0,    0,    0,  587,  626,
+
+     1245,  685,    0,  992,  784,    0,    0,    0,    0, 4440,
+     1233, 4440, 1232, 1231, 4440, 4440, 1230, 4440, 1229, 4440,
+      820,  861, 4440,    0, 1185, 1234,  682,  760,  655, 1195,
+      555, 1171, 4440, 1158, 1156, 1170, 1161, 1154, 4440, 1166,
+     1161, 1161, 1158, 1156, 1004, 1122, 1516, 1526, 1536, 1578,
+     1588, 1638, 1648, 1658, 1668, 1710, 1720, 1770, 1780, 1790,
+     1202, 1800, 1842, 1852, 1201, 1902, 1912, 1922, 1932, 1974,
+     1984, 1200, 2034, 2044, 2054, 2064, 1199, 2106, 2116, 2166,
+     1109,    0, 4440, 4440, 4440, 4440, 4440, 1316, 2268,    0,
+        0, 1328, 2360,    0,    0, 1193, 1192,    0,  763,  982,
+
+     1150, 1144, 1143, 1147, 1146, 1140, 1151, 1146, 1132, 1137,
+     1143, 1106, 1090, 1089, 1086, 1099, 1101, 1099, 1446, 1456,
+     2178, 2188, 2229, 2300, 2310, 2320, 2362, 2391, 2453, 2464,
+     2474, 2494, 2515, 2536, 2577, 2596, 2606, 2618, 2647, 2659,
+     2709, 2721, 2731, 2750, 2772, 2791, 2834, 2853, 4440,    0,
+        0, 4440,    0,    0, 4440,    0, 1132, 4440, 1087, 1046,
+     1036, 1035, 1034, 1034, 1028,  383, 1038, 1034, 1024, 1024,
+     1028, 1013, 1030, 1056, 1025, 1012,    0,    0, 1056, 4440,
+     1021, 1007, 1013,  954,  961,  987,  942, 4440,  985,  946,
+      927,  926,  941,  922,  929,  932, 4440,  934,  937, 4440,
+
+      927,  961,  926,  959,  922, 4440,  957, 4440,  956,  921,
+      920,  919,  833,  840,  836,  830,  820,  823, 4440,  820,
+     4440,  851, 4440, 4440,  769,  753,  743,  775,  713,  753,
+      748,  703,  665,  676, 4440,  663,  649,  645, 4440,  297,
+     4440, 4440,  689,  649,  644,  650,  676,  555, 4440,  553,
+     4440,  551,  544,  536, 4440,  478,  466,  507,  462,  487,
+      390,  343, 4440,  290, 4440,  301, 4440,  210, 4440,  241,
+     4440, 4440, 2957, 2968, 2979, 2990, 3001, 3012, 3020, 3024,
+     3030, 3041, 3052, 3063, 3074, 3085, 3096, 3104, 3115, 3126,
+     3137, 3148, 3159, 3170, 3181, 3192, 3203, 3211, 3222,  240,
+
+     3233, 3244, 3255, 3266, 3270, 3276, 3287, 3298, 3309, 3320,
+     3331, 3342, 3353, 3364, 3375, 3386, 3397, 3408, 3416, 3427,
+     3438, 3449, 3460, 3471, 3482, 3493, 3504, 3515, 3526, 3537,
+     3548,  111, 3559, 3570, 3581, 3592, 3603, 3614, 3625, 3636,
+     3647, 3658, 3669, 3680, 3691, 3702, 3713, 3724, 3735, 3746,
+     3757, 3768, 3779, 3790, 3801, 3812, 3823, 3834, 3845, 3856,
+     3867, 3878, 3889, 3900, 3911, 3922, 3933, 3944, 3955, 3966,
+     3977, 3988, 3999, 4010, 4021, 4032, 4043, 4054, 4065, 4076,
+     4087, 4098, 4109, 4120, 4131, 4142, 4153, 4164, 4175, 4186,
+     4197, 4208, 4219, 4230, 4241, 4252, 4263, 4274, 4285, 4296,
+
+     4307, 4318, 4329, 4340, 4351, 4362, 4373, 4384, 4395, 4406,
+     4417, 4428
     } ;
 
-static yyconst flex_int16_t yy_def[696] =
+static yyconst flex_int16_t yy_def[713] =
     {   0,
-      555,    1,  556,  556,  557,  557,  556,  556,  558,  558,
-      559,  559,  556,  556,  555,  555,  555,  555,  555,  560,
-      561,  555,  562,  555,  563,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  563,  555,  555,  555,
-      555,  555,  555,  555,  555,  564,  555,  555,  565,  565,
-      565,  565,  565,  565,  566,  567,  568,  569,  555,  570,
-      570,  571,  572,  555,  573,  573,  574,  575,  576,  576,
-      577,  578,  555,  555,  555,  555,  579,  555,  580,  555,
-      580,  581,  582,  555,  555,  583,  584,  585,  586,  587,
-      588,  555,  589,  589,  589,  589,  589,  589,  590,  591,
-
-      592,  593,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  594,  555,  555,  555,  555,  555,  555,  595,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  596,  597,  598,  599,  555,
-      555,  555,  555,  589,  589,  589,  589,  589,  589,  589,
-      589,  589,  589,  589,  600,  601,  555,  601,  602,  603,
-      178,  604,  605,  555,  605,  606,  607,  185,  608,  609,
-      555,  609,  610,  611,  192,  612,  555,  613,  614,  615,
-
-      616,  616,  616,  616,  616,  616,  617,  618,  619,  620,
-      621,  622,  623,  623,  623,  623,  623,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  624,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  625,  625,  626,  627,  628,  626,  625,  629,
-      630,  631,  632,  633,  634,  635,  636,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  623,  637,  638,
-      639,  640,  641,  641,  641,  641,  641,  641,  641,  641,
-
-      641,  641,  641,  642,  643,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  644,  645,  555,  646,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  647,  647,
-      648,  649,  650,  648,  648,  651,  652,  653,  654,  654,
-      655,  656,  657,  648,  647,  651,  652,  653,  647,  648,
-      648,  651,  652,  653,  651,  648,  658,  659,  660,  655,
-      654,  661,  662,  663,  555,  664,  555,  555,  555,  555,
-      555,  665,  665,  666,  667,  668,  668,  669,  670,  671,
-      555,  672,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      673,  673,  674,  675,  676,  674,  674,  677,  678,  679,
-      680,  680,  681,  682,  683,  674,  674,  677,  678,  679,
-      677,  677,  684,  685,  686,  681,  681,  687,  688,  689,
-      555,  690,  691,  555,  692,  693,  555,  694,  695,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  690,  692,  694,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,    0,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555
-
+      572,    1,  573,  573,  574,  574,  573,  573,  575,  575,
+      576,  576,  573,  573,  572,  572,  572,  572,  572,  577,
+      578,  572,  579,  572,  580,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  580,  572,  572,  572,
+      572,  572,  572,  572,  572,  581,  572,  572,  582,  582,
+      582,  582,  582,  582,  583,  584,  585,  586,  572,  587,
+      587,  588,  589,  572,  590,  590,  591,  592,  593,  593,
+      594,  595,  572,  572,  572,  572,  596,  572,  597,  572,
+      597,  598,  599,  572,  572,  600,  601,  602,  603,  604,
+      605,  572,  606,  606,  606,  606,  606,  606,  607,  608,
+
+      609,  610,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  611,  572,  572,  572,  572,  572,  572,  612,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  613,  614,  615,
+      616,  572,  572,  572,  572,  606,  606,  606,  606,  606,
+      606,  606,  606,  606,  606,  606,  617,  618,  572,  618,
+      619,  620,  180,  621,  622,  572,  622,  623,  624,  187,
+      625,  626,  572,  626,  627,  628,  194,  629,  572,  630,
+
+      631,  632,  633,  633,  633,  633,  633,  633,  634,  635,
+      636,  637,  638,  639,  640,  640,  640,  640,  640,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  641,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  642,  642,  643,  644,
+      645,  643,  642,  646,  647,  648,  649,  650,  651,  652,
+      653,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  640,  654,  655,  656,  657,  658,  658,  658,  658,
+
+      658,  658,  658,  658,  658,  658,  658,  659,  660,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      661,  662,  572,  663,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  664,  664,  665,  666,  667,  665,
+      665,  668,  669,  670,  671,  671,  672,  673,  674,  665,
+      664,  668,  669,  670,  664,  665,  665,  668,  669,  670,
+      668,  665,  675,  676,  677,  672,  671,  678,  679,  680,
+      572,  681,  572,  572,  572,  572,  572,  682,  682,  683,
+      684,  685,  685,  686,  687,  688,  572,  689,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  690,  690,
+      691,  692,  693,  691,  691,  694,  695,  696,  697,  697,
+      698,  699,  700,  691,  691,  694,  695,  696,  694,  694,
+      701,  702,  703,  698,  698,  704,  705,  706,  572,  707,
+      708,  572,  709,  710,  572,  711,  712,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  707,  709,  711,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,    0,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572
     } ;
 
 static yyconst flex_int16_t yy_nxt[4546] =
@@ -660,11 +669,11 @@ static yyconst flex_int16_t yy_nxt[4546] =
        16,   16,   16,   16,   49,   50,   51,   52,   53,   54,
 
        55,   56,   57,   58,   16,   59,   74,   74,   84,   74,
-       74,  236,  314,  237,  124,  200,  315,   80,   85,   87,
+       74,  238,  318,  239,  124,  202,  319,   80,   85,   87,
        87,   87,   87,   87,   87,   88,   88,   88,   89,  125,
-       90,  126,  128,   92,  306,  140,  219,  222,  127,  141,
-       91,  103,  129,   90,  130,  223,   92,  224,  220,  104,
-      307,  105,   80,  106,  142,   91,  143,  143,  143,  200,
+       90,  126,  128,   92,  310,  140,  221,  224,  127,  141,
+       91,  103,  129,   90,  130,  225,   92,  226,  222,  104,
+      311,  105,   80,  106,  142,   91,  143,  143,  143,  202,
        91,  131,   91,   91,   91,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
@@ -672,307 +681,307 @@ static yyconst flex_int16_t yy_nxt[4546] =
 
        62,   62,   63,   59,   59,   81,   81,   81,   81,   81,
        81,   82,   82,   82,   83,   93,   94,   95,   96,   97,
-       98,   99,  100,  101,  102,  107,   91,  161,   93,   94,
-       95,   96,   97,   98,   99,  100,  101,  102,  147,  162,
-      163,  555,  555,  555,  317,  148,  555,  318,   80,  149,
-      150,  555,  151,  200,  152,  153,  154,  246,  246,  246,
-      247,  247,  247,  155,   59,   59,   59,   59,   59,   59,
+       98,   99,  100,  101,  102,  107,   91,  163,   93,   94,
+       95,   96,   97,   98,   99,  100,  101,  102,  147,  164,
+      165,  572,  572,  572,  202,  148,  572,  149,   80,  150,
+      151,  572,  152,  571,  153,  154,  155,  248,  248,  248,
+      572,  156,  570,  157,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   61,   61,   61,   61,   61,   61,   62,   62,
 
-       62,   63,   59,   59,  133,  143,  143,  143,  177,  554,
-      144,  532,  145,  555,  555,  134,  256,  278,  197,  248,
-      248,  248,  257,  135,  258,  136,  157,  157,  157,  157,
-      157,  157,  158,  158,  158,  159,  184,  250,  555,   91,
-      555,  555,  533,  251,  252,  400,  146,  191,  553,  555,
-      200,  552,  137,  138,  139,  401,   59,   59,   59,   59,
+       62,   63,   59,   59,  133,  143,  143,  143,  179,  549,
+      144,  321,  145,  569,  322,  134,  259,  282,  199,  249,
+      249,  249,  260,  135,  261,  136,  159,  159,  159,  159,
+      159,  159,  160,  160,  160,  161,  186,  250,  250,  250,
+      550,  568,  252,  248,  248,  248,  146,  193,  253,  254,
+      202,   91,  137,  138,  139,  567,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   66,   66,   66,   66,   66,   66,
-       67,   67,   67,   68,   59,  551,  178,  178,  178,  178,
+       67,   67,   67,   68,   59,  488,  180,  180,  180,  180,
 
-      178,  178,  179,  179,  179,  180,   81,   81,   81,   81,
-       81,   81,   82,   82,   82,   83,   90,  185,  185,  185,
-      185,  185,  185,  186,  186,  186,  187,  555,  192,  192,
-      192,  192,  192,  192,  193,  193,  193,  194,   90,   91,
-      550,   92,  246,  246,  246,  549,   91,   59,   59,   59,
+      180,  180,  181,  181,  181,  182,   81,   81,   81,   81,
+       81,   81,   82,   82,   82,   83,   90,  187,  187,  187,
+      187,  187,  187,  188,  188,  188,  189,  572,  194,  194,
+      194,  194,  194,  194,  195,  195,  195,  196,   90,   91,
+      489,   92,  249,  249,  249,  566,   91,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   66,   66,   66,   66,   66,
        66,   67,   67,   67,   68,   59,   87,   87,   87,   87,
-       87,   87,   88,   88,   88,   89,  548,  547,  200,  546,
+       87,   87,   88,   88,   88,   89,  572,  572,  202,  565,
 
-       91,  201,  202,  203,  204,  205,  206,  207,  208,  209,
-      210,  113,  114,  555,  279,  280,   91,  555,  555,  545,
-      308,  544,  543,   93,   94,   95,   96,   97,   98,   99,
-      100,  101,  102,   91,  309,  542,  310,  184,   59,   59,
+       91,  203,  204,  205,  206,  207,  208,  209,  210,  211,
+      212,  113,  114,  564,  283,  284,   91,  572,  572,  563,
+      312,  562,   91,   93,   94,   95,   96,   97,   98,   99,
+      100,  101,  102,   91,  313,  561,  314,  186,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   70,   70,   70,   70,
-       70,   70,   71,   71,   71,   72,   59,  262,  555,  285,
-      555,  555,  555,  555,  541,  281,  555,  191,  282,  200,
-      286,  287,  540,  323,  232,  247,  247,  247,  129,  283,
+       70,   70,   71,   71,   71,   72,   59,  266,  572,  289,
+      572,  572,  572,  572,  560,  285,  572,  193,  286,  202,
+      290,  291,  559,  572,  234,  572,  572,  406,  129,  287,
 
-      284,  283,  284,  539,   91,  324,  538,  537,  157,  157,
-      157,  157,  157,  157,  158,  158,  158,  159,  185,  185,
-      185,  185,  185,  185,  186,  186,  186,  187,  200,   59,
+      288,  287,  288,  558,  572,  557,  556,  407,  159,  159,
+      159,  159,  159,  159,  160,  160,  160,  161,  187,  187,
+      187,  187,  187,  187,  188,  188,  188,  189,  202,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   70,   70,   70,
-       70,   70,   70,   71,   71,   71,   72,  110,  192,  192,
-      192,  192,  192,  192,  193,  193,  193,  194,  111,  112,
-      555,  113,  114,  330,   90,  331,  536,  200,  535,  534,
-      115,  116,  531,  555,  555,  117,  332,  156,  530,  395,
-
-      529,  528,  527,  396,  118,  397,  119,  156,  114,  526,
-      398,  120,  121,  525,  122,  524,  523,  113,  156,  123,
-      166,  167,  168,  168,  168,  169,  170,  171,  172,  173,
-      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
-      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
-      173,  173,  173,  173,  173,  173,  173,  555,  264,  522,
-      521,  177,  555,  555,  393,  520,  519,  393,  269,  201,
-      202,  203,  204,  205,  206,  207,  208,  209,  210,  274,
-      394,  394,  394,  394,  394,  394,  200,  518,  517,  265,
-      265,  265,  265,  265,  265,  266,  266,  266,  267,  270,
-
-      270,  270,  270,  270,  270,  271,  271,  271,  272,  516,
-      275,  275,  275,  275,  275,  275,  276,  276,  276,  277,
-      515,  176,  176,  176,  176,  176,  176,  176,  176,  176,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  178,
-      178,  178,  178,  178,  178,  179,  179,  179,  180,  176,
-      555,  555,  262,  514,  555,  555,  555,  555,  555,  555,
-      513,  512,  262,  323,  511,  555,  555,  555,  510,  555,
-      555,  555,  555,  555,  509,  324,  508,  507,   91,  248,
-      248,  248,  156,  157,  157,  157,  157,  157,  157,  158,
-
-      158,  158,  159,  157,  157,  157,  157,  157,  157,  158,
-      158,  158,  159,  156,  383,  383,  383,  383,  383,  383,
-      384,  384,  384,  385,  183,  183,  183,  183,  183,  183,
-      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
-      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
-      183,  183,  555,  264,  156,  387,  387,  387,  387,  387,
-      387,  388,  388,  388,  389,  506,  505,  504,  503,  502,
-      501,  500,  499,  498,  269,  497,  496,  495,  494,  493,
-      492,  491,  490,  489,  265,  265,  265,  265,  265,  265,
-      266,  266,  266,  267,  200,  156,  488,  487,  486,  485,
-
-      484,  483,  394,  394,  394,  270,  270,  270,  270,  270,
-      270,  271,  271,  271,  272,  274,  190,  190,  190,  190,
-      190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
-      190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
-      190,  190,  190,  190,  555,  450,  275,  275,  275,  275,
-      275,  275,  276,  276,  276,  277,  264,  482,  555,  481,
-      480,  555,  479,  555,  478,  477,  555,  262,  476,  475,
-      474,  473,  555,  472,  471,  470,  555,  555,  555,  555,
-      555,  466,  465,  464,  463,  462,  461,  265,  265,  265,
-      265,  265,  265,  266,  266,  266,  267,  460,  157,  157,
-
-      157,  157,  157,  157,  158,  158,  158,  159,   79,   79,
+       70,   70,   70,   71,   71,   71,   72,  110,  194,  194,
+      194,  194,  194,  194,  195,  195,  195,  196,  111,  112,
+      572,  113,  114,  335,   90,  336,  327,  202,  555,  554,
+      115,  116,  553,  572,  572,  117,  337,  158,  328,  401,
+
+      552,  551,  548,  402,  118,  403,  119,  158,  114,  547,
+      404,  120,  121,  546,  122,  545,  544,  113,  158,  123,
+      168,  169,  170,  170,  170,  171,  172,  173,  174,  175,
+      175,  175,  175,  175,  175,  175,  175,  175,  175,  175,
+      175,  175,  175,  175,  175,  175,  175,  175,  175,  175,
+      175,  175,  175,  175,  175,  175,  175,  572,  268,  543,
+      542,  179,  572,  572,  399,  541,  540,  399,  273,  203,
+      204,  205,  206,  207,  208,  209,  210,  211,  212,  278,
+      400,  400,  400,  400,  400,  400,  202,  539,  538,  269,
+      269,  269,  269,  269,  269,  270,  270,  270,  271,  274,
+
+      274,  274,  274,  274,  274,  275,  275,  275,  276,  537,
+      279,  279,  279,  279,  279,  279,  280,  280,  280,  281,
+      536,  178,  178,  178,  178,  178,  178,  178,  178,  178,
+      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
+      178,  178,  178,  178,  178,  178,  178,  178,  178,  180,
+      180,  180,  180,  180,  180,  181,  181,  181,  182,  178,
+      572,  572,  266,  535,  572,  572,  572,  572,  572,  572,
+      534,  533,  266,  327,  532,  572,  572,  572,  531,  572,
+      572,  572,  572,  572,  530,  328,  529,  528,   91,  250,
+      250,  250,  158,  159,  159,  159,  159,  159,  159,  160,
+
+      160,  160,  161,  159,  159,  159,  159,  159,  159,  160,
+      160,  160,  161,  158,  389,  389,  389,  389,  389,  389,
+      390,  390,  390,  391,  185,  185,  185,  185,  185,  185,
+      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  185,  572,  268,  158,  393,  393,  393,  393,  393,
+      393,  394,  394,  394,  395,  527,  526,  525,  524,  523,
+      522,  521,  520,  519,  273,  518,  517,  516,  515,  514,
+      513,  512,  511,  510,  269,  269,  269,  269,  269,  269,
+      270,  270,  270,  271,  202,  158,  509,  508,  507,  506,
+
+      505,  504,  400,  400,  400,  274,  274,  274,  274,  274,
+      274,  275,  275,  275,  276,  278,  192,  192,  192,  192,
+      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,  192,  572,  458,  279,  279,  279,  279,
+      279,  279,  280,  280,  280,  281,  268,  503,  572,  502,
+      501,  572,  500,  572,  499,  498,  572,  266,  497,  496,
+      495,  494,  572,  493,  492,  491,  572,  572,  572,  572,
+      572,  490,  487,  486,  485,  484,  483,  269,  269,  269,
+      269,  269,  269,  270,  270,  270,  271,  482,  159,  159,
+
+      159,  159,  159,  159,  160,  160,  160,  161,   79,   79,
        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
        79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-       79,   79,   79,   79,   79,   79,  156,  459,  458,  457,
-      456,  455,  454,  453,  452,  451,   79,  213,  214,  168,
-      168,  168,  215,  170,  216,  217,  173,  173,  173,  173,
-      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
-      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
-      173,  173,  173,  173,  555,  262,  448,  447,  119,  555,
-      555,  555,  555,  410,  409,  408,  407,  340,  406,  405,
-
-      404,  403,  402,  399,  392,  391,  381,  380,  379,  378,
-      377,  200,  375,  555,  338,  156,  157,  157,  157,  157,
-      157,  157,  158,  158,  158,  159,  337,  156,  341,  341,
-      341,  341,  341,  341,  342,  342,  342,  343,  156,  336,
-      335,  334,  333,  329,  328,  327,  326,  325,  176,  176,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
-      176,  176,  176,  176,  176,  176,  345,  322,  321,  320,
-      319,  316,  313,  312,  311,   91,  176,  555,  350,  156,
-      261,  260,  259,  255,  254,  253,  249,  245,  243,  355,
-
-      242,  241,  240,  239,  235,  234,  162,  346,  346,  346,
-      346,  346,  346,  347,  347,  347,  348,  233,  232,  351,
-      351,  351,  351,  351,  351,  352,  352,  352,  353,  441,
-      356,  356,  356,  356,  356,  356,  357,  357,  357,  358,
-      156,  444,  231,  230,  229,  228,  227,  226,  225,  221,
-      361,  183,  183,  183,  183,  183,  183,  183,  183,  183,
-      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
-      183,  183,  183,  183,  183,  183,  183,  183,  183,  555,
-      218,  362,  362,  362,  362,  362,  362,  363,  363,  363,
-      364,   78,   76,   75,  160,  132,  109,  108,   78,   76,
-
-       75,  366,  555,   73,   73,   64,   64,  555,  555,  555,
-      383,  383,  383,  383,  383,  383,  384,  384,  384,  385,
-      555,  555,  387,  387,  387,  387,  387,  387,  388,  388,
-      388,  389,  367,  367,  367,  367,  367,  367,  368,  368,
-      368,  369,  555,  190,  190,  190,  190,  190,  190,  190,
-      190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
-      190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
-      190,  295,  296,  297,  297,  297,  298,  299,  300,  301,
-      302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
-      302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
-
-      302,  302,  302,  302,  302,  302,  302,  302,  156,  262,
-      555,  555,  555,  555,  555,  555,  555,  555,  156,  262,
-      555,  555,  555,  555,  555,  555,  555,  555,  156,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  156,  555,
-      157,  157,  157,  157,  157,  157,  158,  158,  158,  159,
-      157,  157,  157,  157,  157,  157,  158,  158,  158,  159,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  371,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  264,
-      156,  555,  555,  555,  555,  555,  555,  555,  555,  269,
-      156,  555,  555,  555,  555,  555,  555,  555,  555,  274,
-
-      372,  372,  372,  372,  372,  372,  373,  373,  373,  374,
-      265,  265,  265,  265,  265,  265,  266,  266,  266,  267,
-      270,  270,  270,  270,  270,  270,  271,  271,  271,  272,
-      275,  275,  275,  275,  275,  275,  276,  276,  276,  277,
-      156,  264,  555,  555,  555,  555,  555,  555,  555,  555,
-      156,  264,  555,  555,  555,  555,  555,  555,  555,  555,
-      156,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      156,  555,  265,  265,  265,  265,  265,  265,  266,  266,
-      266,  267,  265,  265,  265,  265,  265,  265,  266,  266,
-      266,  267,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  340,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  345,  156,  555,  555,  555,  555,  555,  555,  555,
-      555,  350,  156,  555,  555,  555,  555,  555,  555,  555,
-      555,  355,  341,  341,  341,  341,  341,  341,  342,  342,
-      342,  343,  346,  346,  346,  346,  346,  346,  347,  347,
-      347,  348,  351,  351,  351,  351,  351,  351,  352,  352,
-      352,  353,  356,  356,  356,  356,  356,  356,  357,  357,
-      357,  358,  156,  355,  555,  555,  555,  555,  555,  555,
-      555,  555,  156,  361,  555,  555,  555,  555,  555,  555,
-      555,  555,  156,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  156,  555,  356,  356,  356,  356,  356,  356,
-      357,  357,  357,  358,  362,  362,  362,  362,  362,  362,
-      363,  363,  363,  364,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  366,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  371,  156,  555,  555,  555,  555,  555,
-      555,  555,  555,  264,  156,  555,  555,  555,  555,  555,
-      555,  555,  555,  340,  367,  367,  367,  367,  367,  367,
-      368,  368,  368,  369,  372,  372,  372,  372,  372,  372,
-      373,  373,  373,  374,  265,  265,  265,  265,  265,  265,
-      266,  266,  266,  267,  341,  341,  341,  341,  341,  341,
-
-      342,  342,  342,  343,  156,  345,  555,  555,  555,  555,
-      555,  555,  555,  555,  156,  350,  555,  555,  555,  555,
-      555,  555,  555,  555,  156,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  156,  555,  346,  346,  346,  346,
-      346,  346,  347,  347,  347,  348,  351,  351,  351,  351,
-      351,  351,  352,  352,  352,  353,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  264,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  264,  156,  555,  555,  555,
-      555,  555,  555,  555,  555,  340,  156,  555,  555,  555,
-      555,  555,  555,  555,  555,  345,  265,  265,  265,  265,
-
-      265,  265,  266,  266,  266,  267,  265,  265,  265,  265,
-      265,  265,  266,  266,  266,  267,  341,  341,  341,  341,
-      341,  341,  342,  342,  342,  343,  346,  346,  346,  346,
-      346,  346,  347,  347,  347,  348,  156,  350,  555,  555,
-      555,  555,  555,  555,  555,  555,  156,  340,  555,  555,
-      555,  555,  555,  555,  555,  555,  156,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  156,  555,  351,  351,
-      351,  351,  351,  351,  352,  352,  352,  353,  341,  341,
-      341,  341,  341,  341,  342,  342,  342,  343,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  412,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  417,  156,  555,
-      555,  555,  555,  555,  555,  555,  555,  422,  156,  555,
-      555,  555,  555,  555,  555,  555,  555,  361,  413,  413,
-      413,  413,  413,  413,  414,  414,  414,  415,  418,  418,
-      418,  418,  418,  418,  419,  419,  419,  420,  423,  423,
-      423,  423,  423,  423,  424,  424,  424,  425,  362,  362,
-      362,  362,  362,  362,  363,  363,  363,  364,  156,  427,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  432,
-      156,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      156,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      428,  428,  428,  428,  428,  428,  429,  429,  429,  430,
-      433,  433,  433,  433,  433,  433,  434,  434,  434,  435,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  437,
-      555,  156,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  264,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  269,  555,  555,  555,  555,  555,  555,  555,  555,
-      438,  438,  438,  438,  438,  438,  439,  439,  439,  440,
-      555,  555,  265,  265,  265,  265,  265,  265,  266,  266,
-      266,  267,  270,  270,  270,  270,  270,  270,  271,  271,
-      271,  272,  274,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  156,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  156,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  156,  275,  275,  275,  275,  275,  275,  276,
-      276,  276,  277,  555,  382,  382,  382,  382,  382,  382,
-      382,  382,  382,  382,  382,  382,  382,  382,  382,  382,
-      382,  382,  382,  382,  382,  382,  382,  382,  382,  382,
-      382,  382,  555,  264,  156,  555,  555,  555,  555,  555,
-      555,  555,  555,  264,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  340,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  156,  265,  265,  265,  265,  265,  265,
-
-      266,  266,  266,  267,  265,  265,  265,  265,  265,  265,
-      266,  266,  266,  267,  341,  341,  341,  341,  341,  341,
-      342,  342,  342,  343,  555,  345,  386,  386,  386,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  386,  386,  350,  156,  346,  346,  346,  346,
-      346,  346,  347,  347,  347,  348,  156,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  156,  555,  555,  555,
-      555,  555,  555,  555,  555,  351,  351,  351,  351,  351,
-      351,  352,  352,  352,  353,  555,  156,  555,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  355,  156,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  355,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  361,  156,  555,
-      555,  555,  555,  555,  555,  555,  555,  356,  356,  356,
-      356,  356,  356,  357,  357,  357,  358,  366,  356,  356,
-      356,  356,  356,  356,  357,  357,  357,  358,  362,  362,
-      362,  362,  362,  362,  363,  363,  363,  364,  371,  156,
-      555,  555,  555,  555,  555,  555,  555,  555,  367,  367,
-      367,  367,  367,  367,  368,  368,  368,  369,  156,  264,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  156,  372,
-      372,  372,  372,  372,  372,  373,  373,  373,  374,  555,
-      156,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      265,  265,  265,  265,  265,  265,  266,  266,  266,  267,
-      264,  555,  555,  555,  555,  555,  555,  555,  555,  156,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  340,
-      555,  156,  555,  555,  555,  555,  555,  555,  555,  345,
-      555,  265,  265,  265,  265,  265,  265,  266,  266,  266,
-      267,  350,  555,  555,  555,  555,  555,  555,  555,  555,
-      341,  341,  341,  341,  341,  341,  342,  342,  342,  343,
-
-      346,  346,  346,  346,  346,  346,  347,  347,  347,  348,
-      340,  156,  351,  351,  351,  351,  351,  351,  352,  352,
-      352,  353,  340,  156,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  156,  555,  555,  555,  555,  555,  555,
-      555,  341,  341,  341,  341,  341,  341,  342,  342,  342,
-      343,  555,  156,  341,  341,  341,  341,  341,  341,  342,
-      342,  342,  343,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  412,  555,  156,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  417,  555,  555,  555,  555,  555,
-      555,  555,  555,  156,  422,  555,  555,  555,  555,  555,
-
-      555,  555,  555,  413,  413,  413,  413,  413,  413,  414,
-      414,  414,  415,  361,  555,  418,  418,  418,  418,  418,
-      418,  419,  419,  419,  420,  423,  423,  423,  423,  423,
-      423,  424,  424,  424,  425,  361,  156,  555,  555,  555,
-      555,  555,  555,  555,  362,  362,  362,  362,  362,  362,
-      363,  363,  363,  364,  427,  156,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  362,  362,  362,  362,
-      362,  362,  363,  363,  363,  364,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  428,  428,  428,  428,  428,
-      428,  429,  429,  429,  430,  555,  555,  432,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  437,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  433,  433,
-      433,  433,  433,  433,  434,  434,  434,  435,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  438,  438,  438,
-      438,  438,  438,  439,  439,  439,  440,   59,   59,   59,
+       79,   79,   79,   79,   79,   79,  158,  481,  480,  476,
+      475,  474,  473,  472,  471,  470,   79,  215,  216,  170,
+      170,  170,  217,  172,  218,  219,  175,  175,  175,  175,
+      175,  175,  175,  175,  175,  175,  175,  175,  175,  175,
+      175,  175,  175,  175,  175,  175,  175,  175,  175,  175,
+      175,  175,  175,  175,  572,  266,  469,  468,  467,  466,
+      465,  464,  463,  462,  461,  460,  459,  346,  456,  455,
+
+      119,  572,  572,  572,  572,  418,  417,  416,  415,  414,
+      413,  412,  411,  410,  409,  158,  159,  159,  159,  159,
+      159,  159,  160,  160,  160,  161,  408,  158,  347,  347,
+      347,  347,  347,  347,  348,  348,  348,  349,  158,  405,
+      398,  397,  387,  386,  385,  384,  383,  202,  178,  178,
+      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
+      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
+      178,  178,  178,  178,  178,  178,  351,  381,  572,  344,
+      343,  342,  341,  340,  339,  338,  178,  572,  356,  158,
+      334,  333,  332,  331,  330,  329,  326,  325,  324,  361,
+
+      323,  320,  317,  316,  315,   91,  265,  352,  352,  352,
+      352,  352,  352,  353,  353,  353,  354,  264,  263,  357,
+      357,  357,  357,  357,  357,  358,  358,  358,  359,  449,
+      362,  362,  362,  362,  362,  362,  363,  363,  363,  364,
+      158,  452,  262,  258,  257,  256,  255,  251,  247,  245,
+      367,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  185,  185,  185,  185,  185,  185,  185,  185,  572,
+      244,  368,  368,  368,  368,  368,  368,  369,  369,  369,
+      370,  243,  242,  241,  237,  236,  164,  235,  234,  233,
+
+      232,  372,  231,  230,  229,  228,  227,  223,  220,   78,
+      389,  389,  389,  389,  389,  389,  390,  390,  390,  391,
+       76,   75,  393,  393,  393,  393,  393,  393,  394,  394,
+      394,  395,  373,  373,  373,  373,  373,  373,  374,  374,
+      374,  375,  162,  192,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
+      192,  299,  300,  301,  301,  301,  302,  303,  304,  305,
+      306,  306,  306,  306,  306,  306,  306,  306,  306,  306,
+      306,  306,  306,  306,  306,  306,  306,  306,  306,  306,
+
+      306,  306,  306,  306,  306,  306,  306,  306,  158,  266,
+      132,  109,  108,   78,   76,   75,  572,   73,  158,  266,
+       73,   64,   64,  572,  572,  572,  572,  572,  158,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  158,  572,
+      159,  159,  159,  159,  159,  159,  160,  160,  160,  161,
+      159,  159,  159,  159,  159,  159,  160,  160,  160,  161,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  377,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  268,
+      158,  572,  572,  572,  572,  572,  572,  572,  572,  273,
+      158,  572,  572,  572,  572,  572,  572,  572,  572,  278,
+
+      378,  378,  378,  378,  378,  378,  379,  379,  379,  380,
+      269,  269,  269,  269,  269,  269,  270,  270,  270,  271,
+      274,  274,  274,  274,  274,  274,  275,  275,  275,  276,
+      279,  279,  279,  279,  279,  279,  280,  280,  280,  281,
+      158,  268,  572,  572,  572,  572,  572,  572,  572,  572,
+      158,  268,  572,  572,  572,  572,  572,  572,  572,  572,
+      158,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      158,  572,  269,  269,  269,  269,  269,  269,  270,  270,
+      270,  271,  269,  269,  269,  269,  269,  269,  270,  270,
+      270,  271,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  346,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  351,  158,  572,  572,  572,  572,  572,  572,  572,
+      572,  356,  158,  572,  572,  572,  572,  572,  572,  572,
+      572,  361,  347,  347,  347,  347,  347,  347,  348,  348,
+      348,  349,  352,  352,  352,  352,  352,  352,  353,  353,
+      353,  354,  357,  357,  357,  357,  357,  357,  358,  358,
+      358,  359,  362,  362,  362,  362,  362,  362,  363,  363,
+      363,  364,  158,  361,  572,  572,  572,  572,  572,  572,
+      572,  572,  158,  367,  572,  572,  572,  572,  572,  572,
+      572,  572,  158,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  158,  572,  362,  362,  362,  362,  362,  362,
+      363,  363,  363,  364,  368,  368,  368,  368,  368,  368,
+      369,  369,  369,  370,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  372,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  377,  158,  572,  572,  572,  572,  572,
+      572,  572,  572,  268,  158,  572,  572,  572,  572,  572,
+      572,  572,  572,  346,  373,  373,  373,  373,  373,  373,
+      374,  374,  374,  375,  378,  378,  378,  378,  378,  378,
+      379,  379,  379,  380,  269,  269,  269,  269,  269,  269,
+      270,  270,  270,  271,  347,  347,  347,  347,  347,  347,
+
+      348,  348,  348,  349,  158,  351,  572,  572,  572,  572,
+      572,  572,  572,  572,  158,  356,  572,  572,  572,  572,
+      572,  572,  572,  572,  158,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  158,  572,  352,  352,  352,  352,
+      352,  352,  353,  353,  353,  354,  357,  357,  357,  357,
+      357,  357,  358,  358,  358,  359,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  268,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  268,  158,  572,  572,  572,
+      572,  572,  572,  572,  572,  346,  158,  572,  572,  572,
+      572,  572,  572,  572,  572,  351,  269,  269,  269,  269,
+
+      269,  269,  270,  270,  270,  271,  269,  269,  269,  269,
+      269,  269,  270,  270,  270,  271,  347,  347,  347,  347,
+      347,  347,  348,  348,  348,  349,  352,  352,  352,  352,
+      352,  352,  353,  353,  353,  354,  158,  356,  572,  572,
+      572,  572,  572,  572,  572,  572,  158,  346,  572,  572,
+      572,  572,  572,  572,  572,  572,  158,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  158,  572,  357,  357,
+      357,  357,  357,  357,  358,  358,  358,  359,  347,  347,
+      347,  347,  347,  347,  348,  348,  348,  349,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  420,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  425,  158,  572,
+      572,  572,  572,  572,  572,  572,  572,  430,  158,  572,
+      572,  572,  572,  572,  572,  572,  572,  367,  421,  421,
+      421,  421,  421,  421,  422,  422,  422,  423,  426,  426,
+      426,  426,  426,  426,  427,  427,  427,  428,  431,  431,
+      431,  431,  431,  431,  432,  432,  432,  433,  368,  368,
+      368,  368,  368,  368,  369,  369,  369,  370,  158,  435,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  440,
+      158,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      158,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      436,  436,  436,  436,  436,  436,  437,  437,  437,  438,
+      441,  441,  441,  441,  441,  441,  442,  442,  442,  443,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  445,
+      572,  158,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  268,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  273,  572,  572,  572,  572,  572,  572,  572,  572,
+      446,  446,  446,  446,  446,  446,  447,  447,  447,  448,
+      572,  572,  269,  269,  269,  269,  269,  269,  270,  270,
+      270,  271,  274,  274,  274,  274,  274,  274,  275,  275,
+      275,  276,  278,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  158,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  158,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  158,  279,  279,  279,  279,  279,  279,  280,
+      280,  280,  281,  572,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  572,  268,  158,  572,  572,  572,  572,  572,
+      572,  572,  572,  268,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  346,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  158,  269,  269,  269,  269,  269,  269,
+
+      270,  270,  270,  271,  269,  269,  269,  269,  269,  269,
+      270,  270,  270,  271,  347,  347,  347,  347,  347,  347,
+      348,  348,  348,  349,  572,  351,  392,  392,  392,  392,
+      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
+      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
+      392,  392,  392,  392,  356,  158,  352,  352,  352,  352,
+      352,  352,  353,  353,  353,  354,  158,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  158,  572,  572,  572,
+      572,  572,  572,  572,  572,  357,  357,  357,  357,  357,
+      357,  358,  358,  358,  359,  572,  158,  572,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  361,  158,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  361,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  367,  158,  572,
+      572,  572,  572,  572,  572,  572,  572,  362,  362,  362,
+      362,  362,  362,  363,  363,  363,  364,  372,  362,  362,
+      362,  362,  362,  362,  363,  363,  363,  364,  368,  368,
+      368,  368,  368,  368,  369,  369,  369,  370,  377,  158,
+      572,  572,  572,  572,  572,  572,  572,  572,  373,  373,
+      373,  373,  373,  373,  374,  374,  374,  375,  158,  268,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  158,  378,
+      378,  378,  378,  378,  378,  379,  379,  379,  380,  572,
+      158,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      269,  269,  269,  269,  269,  269,  270,  270,  270,  271,
+      268,  572,  572,  572,  572,  572,  572,  572,  572,  158,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  346,
+      572,  158,  572,  572,  572,  572,  572,  572,  572,  351,
+      572,  269,  269,  269,  269,  269,  269,  270,  270,  270,
+      271,  356,  572,  572,  572,  572,  572,  572,  572,  572,
+      347,  347,  347,  347,  347,  347,  348,  348,  348,  349,
+
+      352,  352,  352,  352,  352,  352,  353,  353,  353,  354,
+      346,  158,  357,  357,  357,  357,  357,  357,  358,  358,
+      358,  359,  346,  158,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  158,  572,  572,  572,  572,  572,  572,
+      572,  347,  347,  347,  347,  347,  347,  348,  348,  348,
+      349,  572,  158,  347,  347,  347,  347,  347,  347,  348,
+      348,  348,  349,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  420,  572,  158,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  425,  572,  572,  572,  572,  572,
+      572,  572,  572,  158,  430,  572,  572,  572,  572,  572,
+
+      572,  572,  572,  421,  421,  421,  421,  421,  421,  422,
+      422,  422,  423,  367,  572,  426,  426,  426,  426,  426,
+      426,  427,  427,  427,  428,  431,  431,  431,  431,  431,
+      431,  432,  432,  432,  433,  367,  158,  572,  572,  572,
+      572,  572,  572,  572,  368,  368,  368,  368,  368,  368,
+      369,  369,  369,  370,  435,  158,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  368,  368,  368,  368,
+      368,  368,  369,  369,  369,  370,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  436,  436,  436,  436,  436,
+      436,  437,  437,  437,  438,  572,  572,  440,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  445,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  441,  441,
+      441,  441,  441,  441,  442,  442,  442,  443,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  446,  446,  446,
+      446,  446,  446,  447,  447,  447,  448,   59,   59,   59,
        59,   59,   59,   59,   59,   59,   59,   59,   60,   60,
        60,   60,   60,   60,   60,   60,   60,   60,   60,   65,
        65,   65,   65,   65,   65,   65,   65,   65,   65,   65,
@@ -981,173 +990,173 @@ static yyconst flex_int16_t yy_nxt[4546] =
        69,   77,   77,   77,   77,   77,   77,   77,   77,   77,
        77,   77,   79,   79,   79,   79,   79,   79,   79,   79,
        86,   86,   86,   86,   86,   86,   86,   86,   91,   91,
-      156,  156,  156,  156,  156,  156,  156,  555,  156,  156,
-      156,   91,  555,   91,   91,   91,   91,   91,   91,   91,
-       91,   91,  164,  555,  164,  164,  164,  164,  164,  164,
-      164,  164,  164,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  174,  555,  174,  174,  174,  174,
-      174,  174,  174,  174,  174,  175,  555,  175,  175,  175,
-      175,  175,  175,  175,  175,  175,  176,  176,  176,  176,
-
-      176,  176,  176,  176,  181,  555,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  182,  555,  182,  182,  182,
-      182,  182,  182,  182,  182,  182,  183,  183,  183,  183,
-      183,  183,  183,  183,  555,  555,  183,  188,  555,  188,
-      188,  188,  188,  188,  188,  188,  188,  188,  189,  555,
-      189,  189,  189,  189,  189,  189,  189,  189,  189,  190,
-      190,  190,  190,  190,  190,  190,  190,  555,  555,  190,
-      195,  555,  195,  195,  195,  195,  195,  195,  195,  195,
-      195,  196,  555,  196,  196,  196,  196,  196,  196,  196,
-      196,  196,   77,   77,   77,   77,   77,   77,   77,   77,
+      158,  158,  158,  158,  158,  158,  158,  572,  158,  158,
+      158,   91,  572,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,  166,  572,  166,  166,  166,  166,  166,  166,
+      166,  166,  166,  167,  167,  167,  167,  167,  167,  167,
+      167,  167,  167,  167,  176,  572,  176,  176,  176,  176,
+      176,  176,  176,  176,  176,  177,  572,  177,  177,  177,
+      177,  177,  177,  177,  177,  177,  178,  178,  178,  178,
+
+      178,  178,  178,  178,  183,  572,  183,  183,  183,  183,
+      183,  183,  183,  183,  183,  184,  572,  184,  184,  184,
+      184,  184,  184,  184,  184,  184,  185,  185,  185,  185,
+      185,  185,  185,  185,  572,  572,  185,  190,  572,  190,
+      190,  190,  190,  190,  190,  190,  190,  190,  191,  572,
+      191,  191,  191,  191,  191,  191,  191,  191,  191,  192,
+      192,  192,  192,  192,  192,  192,  192,  572,  572,  192,
+      197,  572,  197,  197,  197,  197,  197,  197,  197,  197,
+      197,  198,  572,  198,  198,  198,  198,  198,  198,  198,
+      198,  198,   77,   77,   77,   77,   77,   77,   77,   77,
 
        77,   77,   77,   79,   79,   79,   79,   79,   79,   79,
-       79,  198,  555,  198,  198,  198,  198,  198,  198,  198,
-      198,  198,  199,  555,  199,  199,  199,  199,  199,  199,
-      199,  199,  199,   86,  555,   86,   86,   86,   86,   86,
-       86,   86,   86,   86,  211,  555,  211,  211,  211,  211,
-      211,  211,  211,  211,  211,  212,  555,  212,  212,  212,
-      212,  212,  212,  212,  212,  212,   86,   86,   86,   86,
-       86,   86,   86,   86,   91,   91,   91,  555,   91,   91,
-       91,   91,   91,   91,   91,   91,   91,  164,  555,  164,
-      164,  164,  164,  164,  164,  164,  164,  164,  165,  165,
-
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  174,
-      555,  174,  174,  174,  174,  174,  174,  174,  174,  174,
-      175,  555,  175,  175,  175,  175,  175,  175,  175,  175,
-      175,  238,  238,  555,  238,  238,  238,  238,  238,  238,
-      238,  238,  244,  244,  244,  555,  244,  244,  244,  244,
-      244,  244,  244,  156,  156,  156,  156,  156,  156,  156,
-      156,  156,  156,  156,  263,  263,  263,  263,  263,  263,
-      263,  263,  263,  263,  263,  268,  268,  268,  268,  268,
-      268,  268,  268,  268,  268,  268,  273,  273,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  288,  555,  288,
-
-      288,  288,  288,  288,  288,  288,  288,  288,  176,  176,
-      176,  176,  176,  176,  176,  176,  181,  555,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  182,  555,  182,
-      182,  182,  182,  182,  182,  182,  182,  182,  289,  555,
-      289,  289,  289,  289,  289,  289,  289,  289,  289,  183,
-      183,  183,  183,  183,  183,  183,  183,  555,  555,  183,
-      188,  555,  188,  188,  188,  188,  188,  188,  188,  188,
-      188,  189,  555,  189,  189,  189,  189,  189,  189,  189,
-      189,  189,  290,  555,  290,  290,  290,  290,  290,  290,
-      290,  290,  290,  190,  190,  190,  190,  190,  190,  190,
-
-      190,  555,  555,  190,  195,  555,  195,  195,  195,  195,
-      195,  195,  195,  195,  195,  196,  555,  196,  196,  196,
-      196,  196,  196,  196,  196,  196,  291,  555,  291,  291,
-      291,  291,  291,  291,  291,  291,  291,   79,  555,   79,
-       79,   79,   79,   79,   79,   79,   79,   79,  292,  555,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  200,
-      555,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-      293,  555,  293,  293,  293,  293,  293,  293,  293,  293,
-      293,  294,  294,  294,  294,  294,  294,  294,  294,  294,
-      294,  294,  303,  555,  303,  303,  303,  303,  303,  303,
-
-      303,  303,  303,  304,  555,  304,  304,  304,  304,  304,
-      304,  304,  304,  304,   86,  555,   86,   86,   86,   86,
-       86,   86,   86,   86,   86,  305,  555,  305,  305,  305,
-      305,  305,  305,  305,  305,  305,   91,   91,   91,   91,
-       91,   91,   91,   91,   91,  555,   91,  238,  238,  238,
-      238,  238,  238,  238,  238,  238,  238,  238,  156,  156,
-      156,  156,  156,  156,  156,  156,  156,  156,  156,  263,
-      263,  263,  263,  263,  263,  263,  263,  263,  263,  263,
-      268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
-      268,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-
-      273,  273,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  344,  344,  344,  344,  344,  344,  344,
-      344,  344,  344,  344,  349,  349,  349,  349,  349,  349,
-      349,  349,  349,  349,  349,  354,  354,  354,  354,  354,
-      354,  354,  354,  354,  354,  354,  359,  555,  359,  359,
-      359,  359,  359,  359,  359,  359,  359,  360,  360,  360,
-      360,  360,  360,  360,  360,  360,  360,  360,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  370,
-      370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
-      176,  555,  176,  176,  176,  176,  176,  176,  176,  176,
-
-      176,  183,  555,  183,  183,  183,  183,  183,  183,  183,
-      183,  183,  190,  555,  190,  190,  190,  190,  190,  190,
-      190,  190,  190,   79,  555,   79,   79,   79,   79,   79,
-       79,   79,   79,   79,  200,  555,  200,  200,  200,  200,
-      200,  200,  200,  200,  200,  376,  555,  376,  376,  376,
-      376,  376,  376,  376,  376,  376,   86,  555,   86,   86,
-       86,   86,   86,   86,   86,   86,   86,  382,  382,  382,
-      382,  382,  382,  555,  382,  555,  555,  382,  386,  386,
-      386,  386,  386,  386,  555,  386,  555,  555,  386,  390,
-      390,  555,  390,  390,  390,  390,  390,  390,  390,  390,
-
-      156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
-      156,  263,  263,  263,  263,  263,  263,  263,  263,  263,
-      263,  263,  268,  268,  268,  268,  268,  268,  268,  268,
-      268,  268,  268,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  339,  344,  344,  344,  344,  344,
-      344,  344,  344,  344,  344,  344,  349,  349,  349,  349,
-      349,  349,  349,  349,  349,  349,  349,  354,  354,  354,
-      354,  354,  354,  354,  354,  354,  354,  354,  360,  360,
-      360,  360,  360,  360,  360,  360,  360,  360,  360,  365,
-
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-      370,  370,  370,  370,  370,  370,  370,  370,  370,  370,
-      370,  411,  411,  411,  411,  411,  411,  411,  411,  411,
-      411,  411,  416,  416,  416,  416,  416,  416,  416,  416,
-      416,  416,  416,  421,  421,  421,  421,  421,  421,  421,
-      421,  421,  421,  421,  426,  426,  426,  426,  426,  426,
-      426,  426,  426,  426,  426,  431,  431,  431,  431,  431,
-      431,  431,  431,  431,  431,  431,  436,  436,  436,  436,
-      436,  436,  436,  436,  436,  436,  436,  200,  555,  200,
-      200,  200,  200,  200,  200,  200,  200,  200,  382,  382,
-
-      382,  382,  382,  382,  382,  382,  555,  555,  382,  442,
-      555,  442,  442,  442,  442,  442,  442,  442,  442,  442,
-      443,  555,  443,  443,  443,  443,  443,  443,  443,  443,
-      443,  386,  386,  386,  386,  386,  386,  386,  386,  555,
-      555,  386,  445,  555,  445,  445,  445,  445,  445,  445,
-      445,  445,  445,  446,  555,  446,  446,  446,  446,  446,
-      446,  446,  446,  446,  390,  390,  390,  390,  390,  390,
-      390,  390,  390,  390,  390,  449,  449,  555,  449,  449,
-      449,  449,  449,  449,  449,  449,  156,  156,  156,  156,
-      156,  156,  156,  156,  156,  156,  156,  263,  263,  263,
-
-      263,  263,  263,  263,  263,  263,  263,  263,  268,  268,
-      268,  268,  268,  268,  268,  268,  268,  268,  268,  273,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  344,  344,  344,  344,  344,  344,  344,  344,  344,
-      344,  344,  349,  349,  349,  349,  349,  349,  349,  349,
-      349,  349,  349,  354,  354,  354,  354,  354,  354,  354,
-      354,  354,  354,  354,  360,  360,  360,  360,  360,  360,
-      360,  360,  360,  360,  360,  365,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  370,  370,  370,  370,
-
-      370,  370,  370,  370,  370,  370,  370,  411,  411,  411,
-      411,  411,  411,  411,  411,  411,  411,  411,  416,  416,
-      416,  416,  416,  416,  416,  416,  416,  416,  416,  421,
-      421,  421,  421,  421,  421,  421,  421,  421,  421,  421,
-      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
-      426,  431,  431,  431,  431,  431,  431,  431,  431,  431,
-      431,  431,  436,  436,  436,  436,  436,  436,  436,  436,
-      436,  436,  436,  382,  555,  382,  382,  382,  382,  382,
-      382,  382,  382,  382,  467,  555,  467,  467,  467,  467,
-      467,  467,  467,  467,  467,  386,  555,  386,  386,  386,
-
-      386,  386,  386,  386,  386,  386,  468,  555,  468,  468,
-      468,  468,  468,  468,  468,  468,  468,  469,  469,  555,
-      469,  469,  469,  469,  469,  469,  469,  469,  449,  449,
-      449,  449,  449,  449,  449,  449,  449,  449,  449,   15,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555
+       79,  200,  572,  200,  200,  200,  200,  200,  200,  200,
+      200,  200,  201,  572,  201,  201,  201,  201,  201,  201,
+      201,  201,  201,   86,  572,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,  213,  572,  213,  213,  213,  213,
+      213,  213,  213,  213,  213,  214,  572,  214,  214,  214,
+      214,  214,  214,  214,  214,  214,   86,   86,   86,   86,
+       86,   86,   86,   86,   91,   91,   91,  572,   91,   91,
+       91,   91,   91,   91,   91,   91,   91,  166,  572,  166,
+      166,  166,  166,  166,  166,  166,  166,  166,  167,  167,
+
+      167,  167,  167,  167,  167,  167,  167,  167,  167,  176,
+      572,  176,  176,  176,  176,  176,  176,  176,  176,  176,
+      177,  572,  177,  177,  177,  177,  177,  177,  177,  177,
+      177,  240,  240,  572,  240,  240,  240,  240,  240,  240,
+      240,  240,  246,  246,  246,  572,  246,  246,  246,  246,
+      246,  246,  246,  158,  158,  158,  158,  158,  158,  158,
+      158,  158,  158,  158,  267,  267,  267,  267,  267,  267,
+      267,  267,  267,  267,  267,  272,  272,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  277,  277,  277,  277,
+      277,  277,  277,  277,  277,  277,  277,  292,  572,  292,
+
+      292,  292,  292,  292,  292,  292,  292,  292,  178,  178,
+      178,  178,  178,  178,  178,  178,  183,  572,  183,  183,
+      183,  183,  183,  183,  183,  183,  183,  184,  572,  184,
+      184,  184,  184,  184,  184,  184,  184,  184,  293,  572,
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  185,
+      185,  185,  185,  185,  185,  185,  185,  572,  572,  185,
+      190,  572,  190,  190,  190,  190,  190,  190,  190,  190,
+      190,  191,  572,  191,  191,  191,  191,  191,  191,  191,
+      191,  191,  294,  572,  294,  294,  294,  294,  294,  294,
+      294,  294,  294,  192,  192,  192,  192,  192,  192,  192,
+
+      192,  572,  572,  192,  197,  572,  197,  197,  197,  197,
+      197,  197,  197,  197,  197,  198,  572,  198,  198,  198,
+      198,  198,  198,  198,  198,  198,  295,  572,  295,  295,
+      295,  295,  295,  295,  295,  295,  295,   79,  572,   79,
+       79,   79,   79,   79,   79,   79,   79,   79,  296,  572,
+      296,  296,  296,  296,  296,  296,  296,  296,  296,  202,
+      572,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      297,  572,  297,  297,  297,  297,  297,  297,  297,  297,
+      297,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  298,  307,  572,  307,  307,  307,  307,  307,  307,
+
+      307,  307,  307,  308,  572,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,   86,  572,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,  309,  572,  309,  309,  309,
+      309,  309,  309,  309,  309,  309,   91,   91,   91,   91,
+       91,   91,   91,   91,   91,  572,   91,  240,  240,  240,
+      240,  240,  240,  240,  240,  240,  240,  240,  158,  158,
+      158,  158,  158,  158,  158,  158,  158,  158,  158,  267,
+      267,  267,  267,  267,  267,  267,  267,  267,  267,  267,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+
+      277,  277,  345,  345,  345,  345,  345,  345,  345,  345,
+      345,  345,  345,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  350,  350,  355,  355,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  360,  360,  360,  360,  360,
+      360,  360,  360,  360,  360,  360,  365,  572,  365,  365,
+      365,  365,  365,  365,  365,  365,  365,  366,  366,  366,
+      366,  366,  366,  366,  366,  366,  366,  366,  371,  371,
+      371,  371,  371,  371,  371,  371,  371,  371,  371,  376,
+      376,  376,  376,  376,  376,  376,  376,  376,  376,  376,
+      178,  572,  178,  178,  178,  178,  178,  178,  178,  178,
+
+      178,  185,  572,  185,  185,  185,  185,  185,  185,  185,
+      185,  185,  192,  572,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,   79,  572,   79,   79,   79,   79,   79,
+       79,   79,   79,   79,  202,  572,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  382,  572,  382,  382,  382,
+      382,  382,  382,  382,  382,  382,   86,  572,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,  388,  388,  388,
+      388,  388,  388,  572,  388,  572,  572,  388,  392,  392,
+      392,  392,  392,  392,  572,  392,  572,  572,  392,  396,
+      396,  572,  396,  396,  396,  396,  396,  396,  396,  396,
+
+      158,  158,  158,  158,  158,  158,  158,  158,  158,  158,
+      158,  267,  267,  267,  267,  267,  267,  267,  267,  267,
+      267,  267,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  272,  272,  277,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  277,  345,  345,  345,  345,  345,  345,
+      345,  345,  345,  345,  345,  350,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  350,  355,  355,  355,  355,
+      355,  355,  355,  355,  355,  355,  355,  360,  360,  360,
+      360,  360,  360,  360,  360,  360,  360,  360,  366,  366,
+      366,  366,  366,  366,  366,  366,  366,  366,  366,  371,
+
+      371,  371,  371,  371,  371,  371,  371,  371,  371,  371,
+      376,  376,  376,  376,  376,  376,  376,  376,  376,  376,
+      376,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  429,  429,  429,  429,  429,  429,  429,
+      429,  429,  429,  429,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  439,  439,  439,  439,  439,
+      439,  439,  439,  439,  439,  439,  444,  444,  444,  444,
+      444,  444,  444,  444,  444,  444,  444,  202,  572,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  388,  388,
+
+      388,  388,  388,  388,  388,  388,  572,  572,  388,  450,
+      572,  450,  450,  450,  450,  450,  450,  450,  450,  450,
+      451,  572,  451,  451,  451,  451,  451,  451,  451,  451,
+      451,  392,  392,  392,  392,  392,  392,  392,  392,  572,
+      572,  392,  453,  572,  453,  453,  453,  453,  453,  453,
+      453,  453,  453,  454,  572,  454,  454,  454,  454,  454,
+      454,  454,  454,  454,  396,  396,  396,  396,  396,  396,
+      396,  396,  396,  396,  396,  457,  457,  572,  457,  457,
+      457,  457,  457,  457,  457,  457,  158,  158,  158,  158,
+      158,  158,  158,  158,  158,  158,  158,  267,  267,  267,
+
+      267,  267,  267,  267,  267,  267,  267,  267,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  277,
+      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      345,  345,  345,  345,  345,  345,  345,  345,  345,  345,
+      345,  350,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  355,  355,  355,  355,  355,  355,  355,  355,
+      355,  355,  355,  360,  360,  360,  360,  360,  360,  360,
+      360,  360,  360,  360,  366,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  366,  371,  371,  371,  371,  371,
+      371,  371,  371,  371,  371,  371,  376,  376,  376,  376,
+
+      376,  376,  376,  376,  376,  376,  376,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  424,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  429,
+      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  439,  439,  439,  439,  439,  439,  439,  439,  439,
+      439,  439,  444,  444,  444,  444,  444,  444,  444,  444,
+      444,  444,  444,  388,  572,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  477,  572,  477,  477,  477,  477,
+      477,  477,  477,  477,  477,  392,  572,  392,  392,  392,
+
+      392,  392,  392,  392,  392,  392,  478,  572,  478,  478,
+      478,  478,  478,  478,  478,  478,  478,  479,  479,  572,
+      479,  479,  479,  479,  479,  479,  479,  479,  457,  457,
+      457,  457,  457,  457,  457,  457,  457,  457,  457,   15,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572
     } ;
 
 static yyconst flex_int16_t yy_chk[4546] =
@@ -1164,11 +1173,11 @@ static yyconst flex_int16_t yy_chk[4546] =
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
         1,    1,    1,    1,    1,    5,   17,   74,   22,   17,
-       74,  128,  223,  128,   33,  615,  223,   21,   22,   23,
+       74,  128,  225,  128,   33,  632,  225,   21,   22,   23,
        23,   23,   23,   23,   23,   23,   23,   23,   23,   33,
-       25,   35,   36,   25,  218,   40,  104,  106,   35,   41,
+       25,   35,   36,   25,  220,   40,  104,  106,   35,   41,
        50,   26,   36,   37,   36,  106,   37,  106,  104,   26,
-      218,   26,   40,   26,   41,   94,  143,  143,  143,  202,
+      220,   26,   40,   26,   41,   94,  143,  143,  143,  204,
        53,   37,   51,   97,   95,    5,    5,    5,    5,    5,
         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
@@ -1176,494 +1185,494 @@ static yyconst flex_int16_t yy_chk[4546] =
 
         5,    5,    5,    5,    6,   21,   21,   21,   21,   21,
        21,   21,   21,   21,   21,   25,   25,   25,   25,   25,
-       25,   25,   25,   25,   25,   26,  166,   50,   37,   37,
+       25,   25,   25,   25,   25,   26,  168,   50,   37,   37,
        37,   37,   37,   37,   37,   37,   37,   37,   44,   51,
-       53,   95,   94,   97,  225,   44,  202,  225,   53,   44,
-       44,   97,   44,  583,   44,   44,   44,  144,  144,  144,
-      145,  145,  145,   44,    6,    6,    6,    6,    6,    6,
+       53,   95,   94,   97,  600,   44,  204,   44,   53,   44,
+       44,   97,   44,  570,   44,   44,   44,  144,  144,  144,
+      292,   44,  568,   44,    6,    6,    6,    6,    6,    6,
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
 
-        6,    6,    6,    9,   39,   43,   43,   43,   60,  553,
-       43,  524,   43,  214,  214,   39,  152,  166,   79,  146,
-      146,  146,  152,   39,  152,   39,   46,   46,   46,   46,
-       46,   46,   46,   46,   46,   46,   65,  148,  217,  214,
-      217,  217,  524,  148,  148,  327,   43,   69,  551,  217,
-      203,  549,   39,   39,   39,  327,    9,    9,    9,    9,
+        6,    6,    6,    9,   39,   43,   43,   43,   60,  540,
+       43,  227,   43,  566,  227,   39,  153,  168,   79,  145,
+      145,  145,  153,   39,  153,   39,   46,   46,   46,   46,
+       46,   46,   46,   46,   46,   46,   65,  146,  146,  146,
+      540,  564,  148,  248,  248,  248,   43,   69,  148,  148,
+      205,  292,   39,   39,   39,  562,    9,    9,    9,    9,
         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
-        9,    9,    9,    9,   10,  547,   60,   60,   60,   60,
+        9,    9,    9,    9,   10,  466,   60,   60,   60,   60,
 
        60,   60,   60,   60,   60,   60,   79,   79,   79,   79,
        79,   79,   79,   79,   79,   79,   86,   65,   65,   65,
-       65,   65,   65,   65,   65,   65,   65,  203,   69,   69,
-       69,   69,   69,   69,   69,   69,   69,   69,   91,  169,
-      545,   91,  246,  246,  246,  544,  167,   10,   10,   10,
+       65,   65,   65,   65,   65,   65,   65,  205,   69,   69,
+       69,   69,   69,   69,   69,   69,   69,   69,   91,  171,
+      466,   91,  249,  249,  249,  561,  169,   10,   10,   10,
        10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
        10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
        10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
        10,   10,   10,   10,   10,   11,   90,   90,   90,   90,
-       90,   90,   90,   90,   90,   90,  543,  542,  205,  541,
+       90,   90,   90,   90,   90,   90,  216,  216,  207,  560,
 
-      172,   86,   86,   86,   86,   86,   86,   86,   86,   86,
-       86,  167,  167,  288,  169,  169,  171,  215,  215,  540,
-      219,  539,  537,   91,   91,   91,   91,   91,   91,   91,
-       91,   91,   91,  215,  219,  536,  219,  183,   11,   11,
+      174,   86,   86,   86,   86,   86,   86,   86,   86,   86,
+       86,  169,  169,  559,  171,  171,  173,  217,  217,  558,
+      221,  557,  216,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,   91,  217,  221,  556,  221,  185,   11,   11,
        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
-       11,   11,   11,   11,   11,   11,   12,  156,  205,  172,
-      171,  172,  172,  171,  535,  171,  205,  190,  171,  295,
-      172,  172,  533,  323,  171,  247,  247,  247,  171,  171,
+       11,   11,   11,   11,   11,   11,   12,  158,  207,  174,
+      173,  174,  174,  173,  554,  173,  207,  192,  173,  299,
+      174,  174,  553,  219,  173,  219,  219,  331,  173,  173,
 
-      171,  171,  171,  531,  288,  323,  530,  529,  156,  156,
-      156,  156,  156,  156,  156,  156,  156,  156,  183,  183,
-      183,  183,  183,  183,  183,  183,  183,  183,  296,   12,
+      173,  173,  173,  552,  219,  550,  548,  331,  158,  158,
+      158,  158,  158,  158,  158,  158,  158,  158,  185,  185,
+      185,  185,  185,  185,  185,  185,  185,  185,  300,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,   12,   32,  190,  190,
-      190,  190,  190,  190,  190,  190,  190,  190,   32,   32,
-      295,   32,   32,  255,  200,  255,  528,  298,  527,  526,
-       32,   32,  522,  296,  296,   32,  255,  157,  521,  325,
+       12,   12,   12,   12,   12,   12,   12,   32,  192,  192,
+      192,  192,  192,  192,  192,  192,  192,  192,   32,   32,
+      299,   32,   32,  258,  202,  258,  327,  302,  547,  546,
+       32,   32,  545,  300,  300,   32,  258,  159,  327,  329,
 
-      520,  518,  517,  325,   32,  325,   32,  158,   32,  516,
-      325,   32,   32,  515,   32,  514,  513,   32,  159,   32,
+      544,  543,  538,  329,   32,  329,   32,  160,   32,  537,
+      329,   32,   32,  536,   32,  534,  533,   32,  161,   32,
        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
-       56,   56,   56,   56,   56,   56,   56,   61,  157,  512,
-      511,  176,  298,  298,  324,  510,  507,  393,  158,  200,
-      200,  200,  200,  200,  200,  200,  200,  200,  200,  159,
-      324,  324,  324,  393,  393,  393,  301,  505,  503,  157,
-      157,  157,  157,  157,  157,  157,  157,  157,  157,  158,
-
-      158,  158,  158,  158,  158,  158,  158,  158,  158,  502,
-      159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
-      501,   61,   61,   61,   61,   61,   61,   61,   61,   61,
+       56,   56,   56,   56,   56,   56,   56,   61,  159,  532,
+      531,  178,  302,  302,  328,  530,  529,  399,  160,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  161,
+      328,  328,  328,  399,  399,  399,  305,  528,  527,  159,
+      159,  159,  159,  159,  159,  159,  159,  159,  159,  160,
+
+      160,  160,  160,  160,  160,  160,  160,  160,  160,  526,
+      161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
+      525,   61,   61,   61,   61,   61,   61,   61,   61,   61,
        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,  176,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,   61,
-       66,  216,  263,  500,  216,  301,  216,  301,  301,  216,
-      499,  498,  264,  248,  497,  216,  301,  301,  496,  216,
-      216,  216,  216,  216,  495,  248,  494,  492,  216,  248,
-      248,  248,  265,  263,  263,  263,  263,  263,  263,  263,
-
-      263,  263,  263,  264,  264,  264,  264,  264,  264,  264,
-      264,  264,  264,  266,  317,  317,  317,  317,  317,  317,
-      317,  317,  317,  317,   66,   66,   66,   66,   66,   66,
+       61,   61,   61,   61,   61,   61,   61,   61,   61,  178,
+      178,  178,  178,  178,  178,  178,  178,  178,  178,   61,
+       66,  218,  267,  522,  218,  305,  218,  305,  305,  218,
+      520,  518,  268,  250,  517,  218,  305,  305,  516,  218,
+      218,  218,  218,  218,  515,  250,  514,  513,  218,  250,
+      250,  250,  269,  267,  267,  267,  267,  267,  267,  267,
+
+      267,  267,  267,  268,  268,  268,  268,  268,  268,  268,
+      268,  268,  268,  270,  321,  321,  321,  321,  321,  321,
+      321,  321,  321,  321,   66,   66,   66,   66,   66,   66,
        66,   66,   66,   66,   66,   66,   66,   66,   66,   66,
        66,   66,   66,   66,   66,   66,   66,   66,   66,   66,
-       66,   66,   70,  265,  267,  318,  318,  318,  318,  318,
-      318,  318,  318,  318,  318,  491,  490,  489,  488,  486,
-      484,  483,  482,  481,  266,  480,  479,  478,  477,  476,
-      475,  474,  473,  472,  265,  265,  265,  265,  265,  265,
-      265,  265,  265,  265,  300,  268,  471,  469,  466,  465,
-
-      464,  463,  394,  394,  394,  266,  266,  266,  266,  266,
-      266,  266,  266,  266,  266,  267,   70,   70,   70,   70,
+       66,   66,   70,  269,  271,  322,  322,  322,  322,  322,
+      322,  322,  322,  322,  322,  512,  511,  510,  509,  507,
+      505,  504,  503,  502,  270,  501,  499,  498,  496,  495,
+      494,  493,  492,  491,  269,  269,  269,  269,  269,  269,
+      269,  269,  269,  269,  304,  272,  490,  489,  487,  486,
+
+      485,  484,  400,  400,  400,  270,  270,  270,  270,  270,
+      270,  270,  270,  270,  270,  271,   70,   70,   70,   70,
        70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
        70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
-       70,   70,   70,   70,   81,  394,  267,  267,  267,  267,
-      267,  267,  267,  267,  267,  267,  268,  462,  300,  461,
-      460,  300,  459,  300,  458,  457,  300,  339,  456,  455,
-      454,  453,  300,  452,  451,  449,  300,  300,  300,  300,
-      300,  410,  409,  408,  407,  406,  405,  268,  268,  268,
-      268,  268,  268,  268,  268,  268,  268,  404,  339,  339,
-
-      339,  339,  339,  339,  339,  339,  339,  339,   81,   81,
+       70,   70,   70,   70,   81,  400,  271,  271,  271,  271,
+      271,  271,  271,  271,  271,  271,  272,  483,  304,  482,
+      481,  304,  479,  304,  476,  475,  304,  345,  474,  473,
+      472,  471,  304,  470,  469,  468,  304,  304,  304,  304,
+      304,  467,  465,  464,  463,  462,  461,  272,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  460,  345,  345,
+
+      345,  345,  345,  345,  345,  345,  345,  345,   81,   81,
        81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
        81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
-       81,   81,   81,   81,   81,   81,  270,  403,  402,  401,
-      400,  399,  398,  397,  396,  395,   81,  100,  100,  100,
+       81,   81,   81,   81,   81,   81,  274,  459,  457,  418,
+      417,  416,  415,  414,  413,  412,   81,  100,  100,  100,
       100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
       100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
       100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
-      100,  100,  100,  100,  178,  340,  391,  390,  375,  371,
-      366,  359,  355,  338,  337,  336,  335,  270,  333,  332,
-
-      331,  330,  329,  326,  322,  321,  315,  313,  310,  309,
-      307,  297,  278,  269,  261,  271,  340,  340,  340,  340,
-      340,  340,  340,  340,  340,  340,  260,  272,  270,  270,
-      270,  270,  270,  270,  270,  270,  270,  270,  273,  259,
-      258,  257,  256,  254,  253,  252,  251,  250,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  271,  243,  242,  241,
-      238,  224,  222,  221,  220,  168,  178,  185,  272,  275,
-      155,  154,  153,  151,  150,  149,  147,  142,  139,  273,
-
-      138,  137,  135,  134,  125,  124,  123,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  121,  120,  272,
-      272,  272,  272,  272,  272,  272,  272,  272,  272,  382,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      276,  386,  116,  115,  112,  111,  110,  109,  107,  105,
-      275,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  192,
-      103,  275,  275,  275,  275,  275,  275,  275,  275,  275,
-      275,   77,   76,   75,   47,   38,   31,   30,   20,   19,
-
-       18,  276,   15,   14,   13,    8,    7,    0,    0,    0,
-      382,  382,  382,  382,  382,  382,  382,  382,  382,  382,
-        0,    0,  386,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  276,  276,  276,  276,  276,  276,  276,  276,
-      276,  276,    0,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  208,  208,  208,  208,  208,  208,  208,  208,  208,
-      208,  208,  208,  208,  208,  208,  208,  208,  208,  208,
-      208,  208,  208,  208,  208,  208,  208,  208,  208,  208,
-
-      208,  208,  208,  208,  208,  208,  208,  208,  277,  411,
-        0,    0,    0,    0,    0,    0,    0,    0,  341,  412,
-        0,    0,    0,    0,    0,    0,    0,    0,  342,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  343,    0,
-      411,  411,  411,  411,  411,  411,  411,  411,  411,  411,
-      412,  412,  412,  412,  412,  412,  412,  412,  412,  412,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  277,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  341,
-      344,    0,    0,    0,    0,    0,    0,    0,    0,  342,
-      345,    0,    0,    0,    0,    0,    0,    0,    0,  343,
-
+      100,  100,  100,  100,  180,  346,  411,  410,  409,  408,
+      407,  406,  405,  404,  403,  402,  401,  274,  397,  396,
+
+      381,  377,  372,  365,  361,  344,  343,  342,  341,  340,
+      338,  337,  336,  335,  334,  275,  346,  346,  346,  346,
+      346,  346,  346,  346,  346,  346,  332,  276,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  277,  330,
+      326,  325,  319,  317,  314,  313,  311,  301,  180,  180,
+      180,  180,  180,  180,  180,  180,  180,  180,  180,  180,
+      180,  180,  180,  180,  180,  180,  180,  180,  180,  180,
+      180,  180,  180,  180,  180,  180,  275,  282,  273,  265,
+      264,  263,  262,  261,  260,  259,  180,  187,  276,  279,
+      257,  256,  255,  254,  253,  252,  245,  244,  243,  277,
+
+      240,  226,  224,  223,  222,  170,  157,  275,  275,  275,
+      275,  275,  275,  275,  275,  275,  275,  156,  155,  276,
+      276,  276,  276,  276,  276,  276,  276,  276,  276,  388,
       277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
-      341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
-      342,  342,  342,  342,  342,  342,  342,  342,  342,  342,
-      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
-      346,  344,    0,    0,    0,    0,    0,    0,    0,    0,
-      347,  345,    0,    0,    0,    0,    0,    0,    0,    0,
-      348,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      349,    0,  344,  344,  344,  344,  344,  344,  344,  344,
-      344,  344,  345,  345,  345,  345,  345,  345,  345,  345,
-      345,  345,    0,    0,    0,    0,    0,    0,    0,    0,
-
-        0,  346,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  347,  350,    0,    0,    0,    0,    0,    0,    0,
-        0,  348,  351,    0,    0,    0,    0,    0,    0,    0,
-        0,  349,  346,  346,  346,  346,  346,  346,  346,  346,
-      346,  346,  347,  347,  347,  347,  347,  347,  347,  347,
-      347,  347,  348,  348,  348,  348,  348,  348,  348,  348,
-      348,  348,  349,  349,  349,  349,  349,  349,  349,  349,
-      349,  349,  352,  350,    0,    0,    0,    0,    0,    0,
-        0,    0,  353,  351,    0,    0,    0,    0,    0,    0,
-        0,    0,  354,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,  356,    0,  350,  350,  350,  350,  350,  350,
-      350,  350,  350,  350,  351,  351,  351,  351,  351,  351,
-      351,  351,  351,  351,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  352,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  353,  357,    0,    0,    0,    0,    0,
-        0,    0,    0,  354,  358,    0,    0,    0,    0,    0,
-        0,    0,    0,  356,  352,  352,  352,  352,  352,  352,
-      352,  352,  352,  352,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  353,  354,  354,  354,  354,  354,  354,
-      354,  354,  354,  354,  356,  356,  356,  356,  356,  356,
-
-      356,  356,  356,  356,  360,  357,    0,    0,    0,    0,
-        0,    0,    0,    0,  361,  358,    0,    0,    0,    0,
-        0,    0,    0,    0,  362,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  363,    0,  357,  357,  357,  357,
-      357,  357,  357,  357,  357,  357,  358,  358,  358,  358,
-      358,  358,  358,  358,  358,  358,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  360,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  361,  364,    0,    0,    0,
-        0,    0,    0,    0,    0,  362,  365,    0,    0,    0,
-        0,    0,    0,    0,    0,  363,  360,  360,  360,  360,
-
-      360,  360,  360,  360,  360,  360,  361,  361,  361,  361,
-      361,  361,  361,  361,  361,  361,  362,  362,  362,  362,
-      362,  362,  362,  362,  362,  362,  363,  363,  363,  363,
-      363,  363,  363,  363,  363,  363,  367,  364,    0,    0,
-        0,    0,    0,    0,    0,    0,  368,  365,    0,    0,
-        0,    0,    0,    0,    0,    0,  369,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  370,    0,  364,  364,
-      364,  364,  364,  364,  364,  364,  364,  364,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  367,    0,    0,
-
-        0,    0,    0,    0,    0,    0,    0,  368,  372,    0,
-        0,    0,    0,    0,    0,    0,    0,  369,  373,    0,
-        0,    0,    0,    0,    0,    0,    0,  370,  367,  367,
-      367,  367,  367,  367,  367,  367,  367,  367,  368,  368,
-      368,  368,  368,  368,  368,  368,  368,  368,  369,  369,
-      369,  369,  369,  369,  369,  369,  369,  369,  370,  370,
-      370,  370,  370,  370,  370,  370,  370,  370,  374,  372,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  373,
-      413,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      414,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-
-      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
-      373,  373,  373,  373,  373,  373,  373,  373,  373,  373,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  374,
-        0,  415,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  413,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  414,    0,    0,    0,    0,    0,    0,    0,    0,
-      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
-      383,    0,  413,  413,  413,  413,  413,  413,  413,  413,
-      413,  413,  414,  414,  414,  414,  414,  414,  414,  414,
-      414,  414,  415,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,  416,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  417,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  418,  415,  415,  415,  415,  415,  415,  415,
-      415,  415,  415,    0,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
-      383,  383,  387,  416,  419,    0,    0,    0,    0,    0,
-        0,    0,    0,  417,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  418,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  420,  416,  416,  416,  416,  416,  416,
-
-      416,  416,  416,  416,  417,  417,  417,  417,  417,  417,
-      417,  417,  417,  417,  418,  418,  418,  418,  418,  418,
-      418,  418,  418,  418,    0,  419,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  420,  421,  419,  419,  419,  419,
-      419,  419,  419,  419,  419,  419,  422,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  423,    0,    0,    0,
-        0,    0,    0,    0,    0,  420,  420,  420,  420,  420,
-      420,  420,  420,  420,  420,    0,  424,    0,    0,    0,
+      280,  392,  154,  152,  151,  150,  149,  147,  142,  139,
+      279,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  194,
+      138,  279,  279,  279,  279,  279,  279,  279,  279,  279,
+      279,  137,  135,  134,  125,  124,  123,  121,  120,  116,
+
+      115,  280,  112,  111,  110,  109,  107,  105,  103,   77,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+       76,   75,  392,  392,  392,  392,  392,  392,  392,  392,
+      392,  392,  280,  280,  280,  280,  280,  280,  280,  280,
+      280,  280,   47,  194,  194,  194,  194,  194,  194,  194,
+      194,  194,  194,  194,  194,  194,  194,  194,  194,  194,
+      194,  194,  194,  194,  194,  194,  194,  194,  194,  194,
+      194,  210,  210,  210,  210,  210,  210,  210,  210,  210,
+      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
+      210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
+
+      210,  210,  210,  210,  210,  210,  210,  210,  281,  419,
+       38,   31,   30,   20,   19,   18,   15,   14,  347,  420,
+       13,    8,    7,    0,    0,    0,    0,    0,  348,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  349,    0,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  281,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  347,
+      350,    0,    0,    0,    0,    0,    0,    0,    0,  348,
+      351,    0,    0,    0,    0,    0,    0,    0,    0,  349,
+
+      281,  281,  281,  281,  281,  281,  281,  281,  281,  281,
+      347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
+      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
+      349,  349,  349,  349,  349,  349,  349,  349,  349,  349,
+      352,  350,    0,    0,    0,    0,    0,    0,    0,    0,
+      353,  351,    0,    0,    0,    0,    0,    0,    0,    0,
+      354,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      355,    0,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  351,  351,  351,  351,  351,  351,  351,  351,
+      351,  351,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,  352,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  353,  356,    0,    0,    0,    0,    0,    0,    0,
+        0,  354,  357,    0,    0,    0,    0,    0,    0,    0,
+        0,  355,  352,  352,  352,  352,  352,  352,  352,  352,
+      352,  352,  353,  353,  353,  353,  353,  353,  353,  353,
+      353,  353,  354,  354,  354,  354,  354,  354,  354,  354,
+      354,  354,  355,  355,  355,  355,  355,  355,  355,  355,
+      355,  355,  358,  356,    0,    0,    0,    0,    0,    0,
+        0,    0,  359,  357,    0,    0,    0,    0,    0,    0,
+        0,    0,  360,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,  362,    0,  356,  356,  356,  356,  356,  356,
+      356,  356,  356,  356,  357,  357,  357,  357,  357,  357,
+      357,  357,  357,  357,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  358,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  359,  363,    0,    0,    0,    0,    0,
+        0,    0,    0,  360,  364,    0,    0,    0,    0,    0,
+        0,    0,    0,  362,  358,  358,  358,  358,  358,  358,
+      358,  358,  358,  358,  359,  359,  359,  359,  359,  359,
+      359,  359,  359,  359,  360,  360,  360,  360,  360,  360,
+      360,  360,  360,  360,  362,  362,  362,  362,  362,  362,
+
+      362,  362,  362,  362,  366,  363,    0,    0,    0,    0,
+        0,    0,    0,    0,  367,  364,    0,    0,    0,    0,
+        0,    0,    0,    0,  368,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  369,    0,  363,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  364,  364,  364,  364,
+      364,  364,  364,  364,  364,  364,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  366,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  367,  370,    0,    0,    0,
+        0,    0,    0,    0,    0,  368,  371,    0,    0,    0,
+        0,    0,    0,    0,    0,  369,  366,  366,  366,  366,
+
+      366,  366,  366,  366,  366,  366,  367,  367,  367,  367,
+      367,  367,  367,  367,  367,  367,  368,  368,  368,  368,
+      368,  368,  368,  368,  368,  368,  369,  369,  369,  369,
+      369,  369,  369,  369,  369,  369,  373,  370,    0,    0,
+        0,    0,    0,    0,    0,    0,  374,  371,    0,    0,
+        0,    0,    0,    0,    0,    0,  375,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  376,    0,  370,  370,
+      370,  370,  370,  370,  370,  370,  370,  370,  371,  371,
+      371,  371,  371,  371,  371,  371,  371,  371,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  373,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,  374,  378,    0,
+        0,    0,    0,    0,    0,    0,    0,  375,  379,    0,
+        0,    0,    0,    0,    0,    0,    0,  376,  373,  373,
+      373,  373,  373,  373,  373,  373,  373,  373,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  374,  375,  375,
+      375,  375,  375,  375,  375,  375,  375,  375,  376,  376,
+      376,  376,  376,  376,  376,  376,  376,  376,  380,  378,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  379,
+      421,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      422,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+      378,  378,  378,  378,  378,  378,  378,  378,  378,  378,
+      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  380,
+        0,  423,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  421,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  422,    0,    0,    0,    0,    0,    0,    0,    0,
+      380,  380,  380,  380,  380,  380,  380,  380,  380,  380,
+      389,    0,  421,  421,  421,  421,  421,  421,  421,  421,
+      421,  421,  422,  422,  422,  422,  422,  422,  422,  422,
+      422,  422,  423,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,  424,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  425,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  426,  423,  423,  423,  423,  423,  423,  423,
+      423,  423,  423,    0,  389,  389,  389,  389,  389,  389,
+      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
+      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
+      389,  389,  393,  424,  427,    0,    0,    0,    0,    0,
+        0,    0,    0,  425,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  426,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  428,  424,  424,  424,  424,  424,  424,
+
+      424,  424,  424,  424,  425,  425,  425,  425,  425,  425,
+      425,  425,  425,  425,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,    0,  427,  393,  393,  393,  393,
+      393,  393,  393,  393,  393,  393,  393,  393,  393,  393,
+      393,  393,  393,  393,  393,  393,  393,  393,  393,  393,
+      393,  393,  393,  393,  428,  429,  427,  427,  427,  427,
+      427,  427,  427,  427,  427,  427,  430,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  431,    0,    0,    0,
+        0,    0,    0,    0,    0,  428,  428,  428,  428,  428,
+      428,  428,  428,  428,  428,    0,  432,    0,    0,    0,
 
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  421,  425,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  422,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  423,  426,    0,
-        0,    0,    0,    0,    0,    0,    0,  421,  421,  421,
-      421,  421,  421,  421,  421,  421,  421,  424,  422,  422,
-      422,  422,  422,  422,  422,  422,  422,  422,  423,  423,
-      423,  423,  423,  423,  423,  423,  423,  423,  425,  427,
-        0,    0,    0,    0,    0,    0,    0,    0,  424,  424,
-      424,  424,  424,  424,  424,  424,  424,  424,  428,  426,
-
-        0,    0,    0,    0,    0,    0,    0,    0,  429,  425,
-      425,  425,  425,  425,  425,  425,  425,  425,  425,    0,
-      430,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
-      427,    0,    0,    0,    0,    0,    0,    0,    0,  431,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  428,
-        0,  432,    0,    0,    0,    0,    0,    0,    0,  429,
-        0,  427,  427,  427,  427,  427,  427,  427,  427,  427,
-      427,  430,    0,    0,    0,    0,    0,    0,    0,    0,
-      428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
-
-      429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
-      431,  433,  430,  430,  430,  430,  430,  430,  430,  430,
-      430,  430,  432,  434,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  435,    0,    0,    0,    0,    0,    0,
-        0,  431,  431,  431,  431,  431,  431,  431,  431,  431,
-      431,    0,  436,  432,  432,  432,  432,  432,  432,  432,
-      432,  432,  432,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  433,    0,  437,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  434,    0,    0,    0,    0,    0,
-        0,    0,    0,  438,  435,    0,    0,    0,    0,    0,
-
-        0,    0,    0,  433,  433,  433,  433,  433,  433,  433,
-      433,  433,  433,  436,    0,  434,  434,  434,  434,  434,
-      434,  434,  434,  434,  434,  435,  435,  435,  435,  435,
-      435,  435,  435,  435,  435,  437,  439,    0,    0,    0,
-        0,    0,    0,    0,  436,  436,  436,  436,  436,  436,
-      436,  436,  436,  436,  438,  440,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  437,  437,  437,  437,
-      437,  437,  437,  437,  437,  437,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  438,  438,  438,  438,  438,
-      438,  438,  438,  438,  438,    0,    0,  439,    0,    0,
+        0,    0,    0,    0,    0,    0,  429,  433,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  430,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  431,  434,    0,
+        0,    0,    0,    0,    0,    0,    0,  429,  429,  429,
+      429,  429,  429,  429,  429,  429,  429,  432,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  431,  431,
+      431,  431,  431,  431,  431,  431,  431,  431,  433,  435,
+        0,    0,    0,    0,    0,    0,    0,    0,  432,  432,
+      432,  432,  432,  432,  432,  432,  432,  432,  436,  434,
+
+        0,    0,    0,    0,    0,    0,    0,    0,  437,  433,
+      433,  433,  433,  433,  433,  433,  433,  433,  433,    0,
+      438,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      435,    0,    0,    0,    0,    0,    0,    0,    0,  439,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  436,
+        0,  440,    0,    0,    0,    0,    0,    0,    0,  437,
+        0,  435,  435,  435,  435,  435,  435,  435,  435,  435,
+      435,  438,    0,    0,    0,    0,    0,    0,    0,    0,
+      436,  436,  436,  436,  436,  436,  436,  436,  436,  436,
+
+      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,
+      439,  441,  438,  438,  438,  438,  438,  438,  438,  438,
+      438,  438,  440,  442,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  443,    0,    0,    0,    0,    0,    0,
+        0,  439,  439,  439,  439,  439,  439,  439,  439,  439,
+      439,    0,  444,  440,  440,  440,  440,  440,  440,  440,
+      440,  440,  440,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  441,    0,  445,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  442,    0,    0,    0,    0,    0,
+        0,    0,    0,  446,  443,    0,    0,    0,    0,    0,
+
+        0,    0,    0,  441,  441,  441,  441,  441,  441,  441,
+      441,  441,  441,  444,    0,  442,  442,  442,  442,  442,
+      442,  442,  442,  442,  442,  443,  443,  443,  443,  443,
+      443,  443,  443,  443,  443,  445,  447,    0,    0,    0,
+        0,    0,    0,    0,  444,  444,  444,  444,  444,  444,
+      444,  444,  444,  444,  446,  448,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  445,  445,  445,  445,
+      445,  445,  445,  445,  445,  445,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  446,  446,  446,  446,  446,
+      446,  446,  446,  446,  446,    0,    0,  447,    0,    0,
 
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  440,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  439,  439,
-      439,  439,  439,  439,  439,  439,  439,  439,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  440,  440,  440,
-      440,  440,  440,  440,  440,  440,  440,  556,  556,  556,
-      556,  556,  556,  556,  556,  556,  556,  556,  557,  557,
-      557,  557,  557,  557,  557,  557,  557,  557,  557,  558,
-      558,  558,  558,  558,  558,  558,  558,  558,  558,  558,
-      559,  559,  559,  559,  559,  559,  559,  559,  559,  559,
-
-      559,  560,  560,  560,  560,  560,  560,  560,  560,  560,
-      560,  560,  561,  561,  561,  561,  561,  561,  561,  561,
-      562,  562,  562,  562,  562,  562,  562,  562,  563,  563,
-      564,  564,  564,  564,  564,  564,  564,    0,  564,  564,
-      564,  565,    0,  565,  565,  565,  565,  565,  565,  565,
-      565,  565,  566,    0,  566,  566,  566,  566,  566,  566,
-      566,  566,  566,  567,  567,  567,  567,  567,  567,  567,
-      567,  567,  567,  567,  568,    0,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  569,    0,  569,  569,  569,
-      569,  569,  569,  569,  569,  569,  570,  570,  570,  570,
-
-      570,  570,  570,  570,  571,    0,  571,  571,  571,  571,
-      571,  571,  571,  571,  571,  572,    0,  572,  572,  572,
-      572,  572,  572,  572,  572,  572,  573,  573,  573,  573,
-      573,  573,  573,  573,    0,    0,  573,  574,    0,  574,
-      574,  574,  574,  574,  574,  574,  574,  574,  575,    0,
-      575,  575,  575,  575,  575,  575,  575,  575,  575,  576,
-      576,  576,  576,  576,  576,  576,  576,    0,    0,  576,
-      577,    0,  577,  577,  577,  577,  577,  577,  577,  577,
-      577,  578,    0,  578,  578,  578,  578,  578,  578,  578,
-      578,  578,  579,  579,  579,  579,  579,  579,  579,  579,
-
-      579,  579,  579,  580,  580,  580,  580,  580,  580,  580,
-      580,  581,    0,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  582,    0,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  584,    0,  584,  584,  584,  584,  584,
+        0,    0,    0,    0,    0,    0,  448,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  447,  447,
+      447,  447,  447,  447,  447,  447,  447,  447,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  448,  448,  448,
+      448,  448,  448,  448,  448,  448,  448,  573,  573,  573,
+      573,  573,  573,  573,  573,  573,  573,  573,  574,  574,
+      574,  574,  574,  574,  574,  574,  574,  574,  574,  575,
+      575,  575,  575,  575,  575,  575,  575,  575,  575,  575,
+      576,  576,  576,  576,  576,  576,  576,  576,  576,  576,
+
+      576,  577,  577,  577,  577,  577,  577,  577,  577,  577,
+      577,  577,  578,  578,  578,  578,  578,  578,  578,  578,
+      579,  579,  579,  579,  579,  579,  579,  579,  580,  580,
+      581,  581,  581,  581,  581,  581,  581,    0,  581,  581,
+      581,  582,    0,  582,  582,  582,  582,  582,  582,  582,
+      582,  582,  583,    0,  583,  583,  583,  583,  583,  583,
+      583,  583,  583,  584,  584,  584,  584,  584,  584,  584,
       584,  584,  584,  584,  585,    0,  585,  585,  585,  585,
       585,  585,  585,  585,  585,  586,    0,  586,  586,  586,
       586,  586,  586,  586,  586,  586,  587,  587,  587,  587,
-      587,  587,  587,  587,  588,  588,  589,    0,  589,  589,
-      589,  589,  589,  589,  589,  589,  589,  590,    0,  590,
-      590,  590,  590,  590,  590,  590,  590,  590,  591,  591,
-
-      591,  591,  591,  591,  591,  591,  591,  591,  591,  592,
-        0,  592,  592,  592,  592,  592,  592,  592,  592,  592,
-      593,    0,  593,  593,  593,  593,  593,  593,  593,  593,
-      593,  594,  594,    0,  594,  594,  594,  594,  594,  594,
-      594,  594,  595,  595,  595,    0,  595,  595,  595,  595,
-      595,  595,  595,  596,  596,  596,  596,  596,  596,  596,
-      596,  596,  596,  596,  597,  597,  597,  597,  597,  597,
-      597,  597,  597,  597,  597,  598,  598,  598,  598,  598,
-      598,  598,  598,  598,  598,  598,  599,  599,  599,  599,
-      599,  599,  599,  599,  599,  599,  599,  600,    0,  600,
-
-      600,  600,  600,  600,  600,  600,  600,  600,  601,  601,
-      601,  601,  601,  601,  601,  601,  602,    0,  602,  602,
-      602,  602,  602,  602,  602,  602,  602,  603,    0,  603,
-      603,  603,  603,  603,  603,  603,  603,  603,  604,    0,
-      604,  604,  604,  604,  604,  604,  604,  604,  604,  605,
-      605,  605,  605,  605,  605,  605,  605,    0,    0,  605,
-      606,    0,  606,  606,  606,  606,  606,  606,  606,  606,
-      606,  607,    0,  607,  607,  607,  607,  607,  607,  607,
-      607,  607,  608,    0,  608,  608,  608,  608,  608,  608,
-      608,  608,  608,  609,  609,  609,  609,  609,  609,  609,
-
-      609,    0,    0,  609,  610,    0,  610,  610,  610,  610,
-      610,  610,  610,  610,  610,  611,    0,  611,  611,  611,
-      611,  611,  611,  611,  611,  611,  612,    0,  612,  612,
-      612,  612,  612,  612,  612,  612,  612,  613,    0,  613,
-      613,  613,  613,  613,  613,  613,  613,  613,  614,    0,
-      614,  614,  614,  614,  614,  614,  614,  614,  614,  616,
-        0,  616,  616,  616,  616,  616,  616,  616,  616,  616,
-      617,    0,  617,  617,  617,  617,  617,  617,  617,  617,
-      617,  618,  618,  618,  618,  618,  618,  618,  618,  618,
-      618,  618,  619,    0,  619,  619,  619,  619,  619,  619,
-
-      619,  619,  619,  620,    0,  620,  620,  620,  620,  620,
-      620,  620,  620,  620,  621,    0,  621,  621,  621,  621,
-      621,  621,  621,  621,  621,  622,    0,  622,  622,  622,
-      622,  622,  622,  622,  622,  622,  623,  623,  623,  623,
-      623,  623,  623,  623,  623,    0,  623,  624,  624,  624,
-      624,  624,  624,  624,  624,  624,  624,  624,  625,  625,
-      625,  625,  625,  625,  625,  625,  625,  625,  625,  626,
-      626,  626,  626,  626,  626,  626,  626,  626,  626,  626,
-      627,  627,  627,  627,  627,  627,  627,  627,  627,  627,
-      627,  628,  628,  628,  628,  628,  628,  628,  628,  628,
-
-      628,  628,  629,  629,  629,  629,  629,  629,  629,  629,
-      629,  629,  629,  630,  630,  630,  630,  630,  630,  630,
-      630,  630,  630,  630,  631,  631,  631,  631,  631,  631,
-      631,  631,  631,  631,  631,  632,  632,  632,  632,  632,
-      632,  632,  632,  632,  632,  632,  633,    0,  633,  633,
-      633,  633,  633,  633,  633,  633,  633,  634,  634,  634,
-      634,  634,  634,  634,  634,  634,  634,  634,  635,  635,
-      635,  635,  635,  635,  635,  635,  635,  635,  635,  636,
-      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
-      637,    0,  637,  637,  637,  637,  637,  637,  637,  637,
-
-      637,  638,    0,  638,  638,  638,  638,  638,  638,  638,
-      638,  638,  639,    0,  639,  639,  639,  639,  639,  639,
-      639,  639,  639,  640,    0,  640,  640,  640,  640,  640,
-      640,  640,  640,  640,  641,    0,  641,  641,  641,  641,
-      641,  641,  641,  641,  641,  642,    0,  642,  642,  642,
-      642,  642,  642,  642,  642,  642,  643,    0,  643,  643,
-      643,  643,  643,  643,  643,  643,  643,  644,  644,  644,
-      644,  644,  644,    0,  644,    0,    0,  644,  645,  645,
-      645,  645,  645,  645,    0,  645,    0,    0,  645,  646,
-      646,    0,  646,  646,  646,  646,  646,  646,  646,  646,
-
-      647,  647,  647,  647,  647,  647,  647,  647,  647,  647,
-      647,  648,  648,  648,  648,  648,  648,  648,  648,  648,
-      648,  648,  649,  649,  649,  649,  649,  649,  649,  649,
-      649,  649,  649,  650,  650,  650,  650,  650,  650,  650,
-      650,  650,  650,  650,  651,  651,  651,  651,  651,  651,
-      651,  651,  651,  651,  651,  652,  652,  652,  652,  652,
-      652,  652,  652,  652,  652,  652,  653,  653,  653,  653,
-      653,  653,  653,  653,  653,  653,  653,  654,  654,  654,
-      654,  654,  654,  654,  654,  654,  654,  654,  655,  655,
-      655,  655,  655,  655,  655,  655,  655,  655,  655,  656,
-
-      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
-      657,  657,  657,  657,  657,  657,  657,  657,  657,  657,
-      657,  658,  658,  658,  658,  658,  658,  658,  658,  658,
-      658,  658,  659,  659,  659,  659,  659,  659,  659,  659,
-      659,  659,  659,  660,  660,  660,  660,  660,  660,  660,
-      660,  660,  660,  660,  661,  661,  661,  661,  661,  661,
-      661,  661,  661,  661,  661,  662,  662,  662,  662,  662,
-      662,  662,  662,  662,  662,  662,  663,  663,  663,  663,
-      663,  663,  663,  663,  663,  663,  663,  664,    0,  664,
-      664,  664,  664,  664,  664,  664,  664,  664,  665,  665,
-
-      665,  665,  665,  665,  665,  665,    0,    0,  665,  666,
-        0,  666,  666,  666,  666,  666,  666,  666,  666,  666,
-      667,    0,  667,  667,  667,  667,  667,  667,  667,  667,
-      667,  668,  668,  668,  668,  668,  668,  668,  668,    0,
-        0,  668,  669,    0,  669,  669,  669,  669,  669,  669,
-      669,  669,  669,  670,    0,  670,  670,  670,  670,  670,
-      670,  670,  670,  670,  671,  671,  671,  671,  671,  671,
-      671,  671,  671,  671,  671,  672,  672,    0,  672,  672,
-      672,  672,  672,  672,  672,  672,  673,  673,  673,  673,
-      673,  673,  673,  673,  673,  673,  673,  674,  674,  674,
-
-      674,  674,  674,  674,  674,  674,  674,  674,  675,  675,
-      675,  675,  675,  675,  675,  675,  675,  675,  675,  676,
-      676,  676,  676,  676,  676,  676,  676,  676,  676,  676,
-      677,  677,  677,  677,  677,  677,  677,  677,  677,  677,
-      677,  678,  678,  678,  678,  678,  678,  678,  678,  678,
-      678,  678,  679,  679,  679,  679,  679,  679,  679,  679,
-      679,  679,  679,  680,  680,  680,  680,  680,  680,  680,
-      680,  680,  680,  680,  681,  681,  681,  681,  681,  681,
-      681,  681,  681,  681,  681,  682,  682,  682,  682,  682,
-      682,  682,  682,  682,  682,  682,  683,  683,  683,  683,
-
-      683,  683,  683,  683,  683,  683,  683,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  685,  685,
-      685,  685,  685,  685,  685,  685,  685,  685,  685,  686,
-      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  688,  688,  688,  688,  688,  688,  688,  688,  688,
-      688,  688,  689,  689,  689,  689,  689,  689,  689,  689,
-      689,  689,  689,  690,    0,  690,  690,  690,  690,  690,
-      690,  690,  690,  690,  691,    0,  691,  691,  691,  691,
-      691,  691,  691,  691,  691,  692,    0,  692,  692,  692,
-
-      692,  692,  692,  692,  692,  692,  693,    0,  693,  693,
-      693,  693,  693,  693,  693,  693,  693,  694,  694,    0,
-      694,  694,  694,  694,  694,  694,  694,  694,  695,  695,
-      695,  695,  695,  695,  695,  695,  695,  695,  695,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
-      555,  555,  555,  555,  555
+
+      587,  587,  587,  587,  588,    0,  588,  588,  588,  588,
+      588,  588,  588,  588,  588,  589,    0,  589,  589,  589,
+      589,  589,  589,  589,  589,  589,  590,  590,  590,  590,
+      590,  590,  590,  590,    0,    0,  590,  591,    0,  591,
+      591,  591,  591,  591,  591,  591,  591,  591,  592,    0,
+      592,  592,  592,  592,  592,  592,  592,  592,  592,  593,
+      593,  593,  593,  593,  593,  593,  593,    0,    0,  593,
+      594,    0,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  595,    0,  595,  595,  595,  595,  595,  595,  595,
+      595,  595,  596,  596,  596,  596,  596,  596,  596,  596,
+
+      596,  596,  596,  597,  597,  597,  597,  597,  597,  597,
+      597,  598,    0,  598,  598,  598,  598,  598,  598,  598,
+      598,  598,  599,    0,  599,  599,  599,  599,  599,  599,
+      599,  599,  599,  601,    0,  601,  601,  601,  601,  601,
+      601,  601,  601,  601,  602,    0,  602,  602,  602,  602,
+      602,  602,  602,  602,  602,  603,    0,  603,  603,  603,
+      603,  603,  603,  603,  603,  603,  604,  604,  604,  604,
+      604,  604,  604,  604,  605,  605,  606,    0,  606,  606,
+      606,  606,  606,  606,  606,  606,  606,  607,    0,  607,
+      607,  607,  607,  607,  607,  607,  607,  607,  608,  608,
+
+      608,  608,  608,  608,  608,  608,  608,  608,  608,  609,
+        0,  609,  609,  609,  609,  609,  609,  609,  609,  609,
+      610,    0,  610,  610,  610,  610,  610,  610,  610,  610,
+      610,  611,  611,    0,  611,  611,  611,  611,  611,  611,
+      611,  611,  612,  612,  612,    0,  612,  612,  612,  612,
+      612,  612,  612,  613,  613,  613,  613,  613,  613,  613,
+      613,  613,  613,  613,  614,  614,  614,  614,  614,  614,
+      614,  614,  614,  614,  614,  615,  615,  615,  615,  615,
+      615,  615,  615,  615,  615,  615,  616,  616,  616,  616,
+      616,  616,  616,  616,  616,  616,  616,  617,    0,  617,
+
+      617,  617,  617,  617,  617,  617,  617,  617,  618,  618,
+      618,  618,  618,  618,  618,  618,  619,    0,  619,  619,
+      619,  619,  619,  619,  619,  619,  619,  620,    0,  620,
+      620,  620,  620,  620,  620,  620,  620,  620,  621,    0,
+      621,  621,  621,  621,  621,  621,  621,  621,  621,  622,
+      622,  622,  622,  622,  622,  622,  622,    0,    0,  622,
+      623,    0,  623,  623,  623,  623,  623,  623,  623,  623,
+      623,  624,    0,  624,  624,  624,  624,  624,  624,  624,
+      624,  624,  625,    0,  625,  625,  625,  625,  625,  625,
+      625,  625,  625,  626,  626,  626,  626,  626,  626,  626,
+
+      626,    0,    0,  626,  627,    0,  627,  627,  627,  627,
+      627,  627,  627,  627,  627,  628,    0,  628,  628,  628,
+      628,  628,  628,  628,  628,  628,  629,    0,  629,  629,
+      629,  629,  629,  629,  629,  629,  629,  630,    0,  630,
+      630,  630,  630,  630,  630,  630,  630,  630,  631,    0,
+      631,  631,  631,  631,  631,  631,  631,  631,  631,  633,
+        0,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      634,    0,  634,  634,  634,  634,  634,  634,  634,  634,
+      634,  635,  635,  635,  635,  635,  635,  635,  635,  635,
+      635,  635,  636,    0,  636,  636,  636,  636,  636,  636,
+
+      636,  636,  636,  637,    0,  637,  637,  637,  637,  637,
+      637,  637,  637,  637,  638,    0,  638,  638,  638,  638,
+      638,  638,  638,  638,  638,  639,    0,  639,  639,  639,
+      639,  639,  639,  639,  639,  639,  640,  640,  640,  640,
+      640,  640,  640,  640,  640,    0,  640,  641,  641,  641,
+      641,  641,  641,  641,  641,  641,  641,  641,  642,  642,
+      642,  642,  642,  642,  642,  642,  642,  642,  642,  643,
+      643,  643,  643,  643,  643,  643,  643,  643,  643,  643,
+      644,  644,  644,  644,  644,  644,  644,  644,  644,  644,
+      644,  645,  645,  645,  645,  645,  645,  645,  645,  645,
+
+      645,  645,  646,  646,  646,  646,  646,  646,  646,  646,
+      646,  646,  646,  647,  647,  647,  647,  647,  647,  647,
+      647,  647,  647,  647,  648,  648,  648,  648,  648,  648,
+      648,  648,  648,  648,  648,  649,  649,  649,  649,  649,
+      649,  649,  649,  649,  649,  649,  650,    0,  650,  650,
+      650,  650,  650,  650,  650,  650,  650,  651,  651,  651,
+      651,  651,  651,  651,  651,  651,  651,  651,  652,  652,
+      652,  652,  652,  652,  652,  652,  652,  652,  652,  653,
+      653,  653,  653,  653,  653,  653,  653,  653,  653,  653,
+      654,    0,  654,  654,  654,  654,  654,  654,  654,  654,
+
+      654,  655,    0,  655,  655,  655,  655,  655,  655,  655,
+      655,  655,  656,    0,  656,  656,  656,  656,  656,  656,
+      656,  656,  656,  657,    0,  657,  657,  657,  657,  657,
+      657,  657,  657,  657,  658,    0,  658,  658,  658,  658,
+      658,  658,  658,  658,  658,  659,    0,  659,  659,  659,
+      659,  659,  659,  659,  659,  659,  660,    0,  660,  660,
+      660,  660,  660,  660,  660,  660,  660,  661,  661,  661,
+      661,  661,  661,    0,  661,    0,    0,  661,  662,  662,
+      662,  662,  662,  662,    0,  662,    0,    0,  662,  663,
+      663,    0,  663,  663,  663,  663,  663,  663,  663,  663,
+
+      664,  664,  664,  664,  664,  664,  664,  664,  664,  664,
+      664,  665,  665,  665,  665,  665,  665,  665,  665,  665,
+      665,  665,  666,  666,  666,  666,  666,  666,  666,  666,
+      666,  666,  666,  667,  667,  667,  667,  667,  667,  667,
+      667,  667,  667,  667,  668,  668,  668,  668,  668,  668,
+      668,  668,  668,  668,  668,  669,  669,  669,  669,  669,
+      669,  669,  669,  669,  669,  669,  670,  670,  670,  670,
+      670,  670,  670,  670,  670,  670,  670,  671,  671,  671,
+      671,  671,  671,  671,  671,  671,  671,  671,  672,  672,
+      672,  672,  672,  672,  672,  672,  672,  672,  672,  673,
+
+      673,  673,  673,  673,  673,  673,  673,  673,  673,  673,
+      674,  674,  674,  674,  674,  674,  674,  674,  674,  674,
+      674,  675,  675,  675,  675,  675,  675,  675,  675,  675,
+      675,  675,  676,  676,  676,  676,  676,  676,  676,  676,
+      676,  676,  676,  677,  677,  677,  677,  677,  677,  677,
+      677,  677,  677,  677,  678,  678,  678,  678,  678,  678,
+      678,  678,  678,  678,  678,  679,  679,  679,  679,  679,
+      679,  679,  679,  679,  679,  679,  680,  680,  680,  680,
+      680,  680,  680,  680,  680,  680,  680,  681,    0,  681,
+      681,  681,  681,  681,  681,  681,  681,  681,  682,  682,
+
+      682,  682,  682,  682,  682,  682,    0,    0,  682,  683,
+        0,  683,  683,  683,  683,  683,  683,  683,  683,  683,
+      684,    0,  684,  684,  684,  684,  684,  684,  684,  684,
+      684,  685,  685,  685,  685,  685,  685,  685,  685,    0,
+        0,  685,  686,    0,  686,  686,  686,  686,  686,  686,
+      686,  686,  686,  687,    0,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  688,  688,  688,  688,  688,  688,
+      688,  688,  688,  688,  688,  689,  689,    0,  689,  689,
+      689,  689,  689,  689,  689,  689,  690,  690,  690,  690,
+      690,  690,  690,  690,  690,  690,  690,  691,  691,  691,
+
+      691,  691,  691,  691,  691,  691,  691,  691,  692,  692,
+      692,  692,  692,  692,  692,  692,  692,  692,  692,  693,
+      693,  693,  693,  693,  693,  693,  693,  693,  693,  693,
+      694,  694,  694,  694,  694,  694,  694,  694,  694,  694,
+      694,  695,  695,  695,  695,  695,  695,  695,  695,  695,
+      695,  695,  696,  696,  696,  696,  696,  696,  696,  696,
+      696,  696,  696,  697,  697,  697,  697,  697,  697,  697,
+      697,  697,  697,  697,  698,  698,  698,  698,  698,  698,
+      698,  698,  698,  698,  698,  699,  699,  699,  699,  699,
+      699,  699,  699,  699,  699,  699,  700,  700,  700,  700,
+
+      700,  700,  700,  700,  700,  700,  700,  701,  701,  701,
+      701,  701,  701,  701,  701,  701,  701,  701,  702,  702,
+      702,  702,  702,  702,  702,  702,  702,  702,  702,  703,
+      703,  703,  703,  703,  703,  703,  703,  703,  703,  703,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  705,  705,  705,  705,  705,  705,  705,  705,  705,
+      705,  705,  706,  706,  706,  706,  706,  706,  706,  706,
+      706,  706,  706,  707,    0,  707,  707,  707,  707,  707,
+      707,  707,  707,  707,  708,    0,  708,  708,  708,  708,
+      708,  708,  708,  708,  708,  709,    0,  709,  709,  709,
+
+      709,  709,  709,  709,  709,  709,  710,    0,  710,  710,
+      710,  710,  710,  710,  710,  710,  710,  711,  711,    0,
+      711,  711,  711,  711,  711,  711,  711,  711,  712,  712,
+      712,  712,  712,  712,  712,  712,  712,  712,  712,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
+      572,  572,  572,  572,  572
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[126] =
+static yyconst flex_int32_t yy_rule_can_match_eol[129] =
     {   0,
 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 1, 1, 0, 0, 0,     };
+    0, 0, 0, 0, 1, 1, 0, 0, 0,     };
 
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
@@ -1674,7 +1683,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[126] =
 #define YY_RESTORE_YY_MORE_OFFSET
 #line 1 "regex.l"
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2010 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 /*     This file is part of foma.                                            */
 /*     Foma is free software: you can redistribute it and/or modify          */
 /*     it under the terms of the GNU General Public License version 2 as     */
@@ -1688,8 +1697,16 @@ static yyconst flex_int32_t yy_rule_can_match_eol[126] =
 #define YY_NO_INPUT 1
 #line 23 "regex.l"
 #include <stdio.h>
-#include "regex.h"
 #include "foma.h"
+#include "regex.h"
+
+struct defs {
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
+};
+
+#define YY_EXTRA_TYPE struct defs *
+
 #define YY_USER_ACTION yylloc->first_line = yylloc->last_line = yylineno; yylloc->first_column = yycolumn; yylloc->last_column = yycolumn+yyleng-1; yycolumn += yyleng;
 
 #define MAX_PARSE_DEPTH 100
@@ -1719,93 +1736,93 @@ extern struct fsm *current_parse;
 char *yyget_text(yyscan_t yyscanner);
 char *tempstr, *tempstr2;
 int yylex_init (yyscan_t* scanner);
+int yylex_init_extra (struct defs *defptr, yyscan_t *scanner);
 int yylex_destroy (yyscan_t scanner);
-int my_yyparse(char *my_string, int lineno);
+int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 
 int yywrap(yyscan_t scanner) {return 1; }
 
 int yyerror(YYLTYPE* yylloc, yyscan_t scanner, char *msg) {
    if(yylloc->first_line)
-     fprintf(stderr, "%d.%d-%d.%d: error: ", yylloc->first_line, yylloc->first_column, yylloc->last_line, yylloc->last_column);
-   printf("%s%s at '%s'.\n", "***", msg, yyget_text(scanner));
+       fprintf(stderr, "%d.%d-%d.%d: error: ", yylloc->first_line, yylloc->first_column, yylloc->last_line, yylloc->last_column);
+   fprintf(stderr, "%s%s at '%s'.\n", "***", msg, yyget_text(scanner));
    return 1;
 }
 
-struct fsm *fsm_parse_regex(char *regex) {
-  char *newregex;
-  current_parse = NULL;
-  newregex = xxmalloc(sizeof(char)*(strlen(regex)+2));
-  strcpy(newregex, regex);
-  strcat(newregex, ";");
-  if (my_yyparse(newregex,1) == 0) {
-    xxfree(newregex);
-    return(fsm_minimize(current_parse));
-  } else {
-    xxfree(newregex);
-    return(NULL);
-  }
+struct fsm *fsm_parse_regex(char *regex, struct defined_networks *defined_nets, struct defined_functions *defined_funcs) {
+    char *newregex;
+    current_parse = NULL;
+    newregex = xxmalloc(sizeof(char)*(strlen(regex)+2));
+    strcpy(newregex, regex);
+    strcat(newregex, ";");
+    if (my_yyparse(newregex, 1, defined_nets, defined_funcs) == 0) {
+	xxfree(newregex);
+	return(fsm_minimize(current_parse));
+    } else {
+	xxfree(newregex);
+	return(NULL);
+    }
 }
 
+/* Only used when reading regex from file */
 struct fsm *fsm_parse_regex_string(char *regex) {
-  current_parse = NULL;
-  if (my_yyparse(regex,1) == 0) {
-    xxfree(regex);
-    return(fsm_minimize(current_parse));
-  } else {
-    xxfree(regex);
-    return(NULL);
-  }
+    current_parse = NULL;
+    if (my_yyparse(regex,1,g_defines,g_defines_f) == 0) {
+	xxfree(regex);
+	return(fsm_minimize(current_parse));
+    } else {
+	xxfree(regex);
+	return(NULL);
+    }
 }
 
-void yyset_lineno (int line_number, yyscan_t yyscanner);
+void yyset_lineno(int line_number,yyscan_t yyscanner);
 
-int my_yyparse(char *my_string, int lineno) {
-   int yyp;
-   yyscan_t scanner;
-#ifdef _MSC_VER
-   YY_BUFFER_STATE my_string_buffer = NULL; // initialization must be done here for cl.exe   
-#endif
+int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs) {
+    int yyp;
+    yyscan_t scanner;
+    struct defs defsptr[1];
+    YY_BUFFER_STATE my_string_buffer;
 
-   yylex_init(&scanner);
-#ifndef _MSC_VER
-   YY_BUFFER_STATE my_string_buffer;  // see above ifdef
-#endif
-   my_string_buffer = yy_scan_string(my_string,scanner);
-   yyset_lineno(lineno,scanner);
-   if (g_parse_depth > 0) {
-      if (g_parse_depth >= MAX_PARSE_DEPTH) {
-        fprintf(stderr,"Exceeded parser stack depth.  Self-recursive call?\n");
-        return 1;
-      }
-      /* Save variables on stack */
-      parservarstack[g_parse_depth].rewrite = rewrite;
-      parservarstack[g_parse_depth].rule_direction = rule_direction;
-      parservarstack[g_parse_depth].contexts = contexts;
-      parservarstack[g_parse_depth].rules = rules;
-      parservarstack[g_parse_depth].rewrite_rules = rewrite_rules;     
-   }
-   g_parse_depth++;
-   yyp = yyparse(scanner);
-   g_parse_depth--;
-   if (g_parse_depth > 0) {
-     /* Restore parse variables */
-     rewrite        = parservarstack[g_parse_depth].rewrite;
-     rule_direction = parservarstack[g_parse_depth].rule_direction;
-     contexts       = parservarstack[g_parse_depth].contexts;
-     rules          = parservarstack[g_parse_depth].rules;
-     rewrite_rules  = parservarstack[g_parse_depth].rewrite_rules;
-   }
-   yy_delete_buffer(my_string_buffer,scanner);
-   yylex_destroy(scanner);
-   return yyp;
-}
+    defsptr->defined_nets = defined_nets;
+    defsptr->defined_funcs = defined_funcs;
+    yylex_init_extra(defsptr,&scanner);
 
+    my_string_buffer = yy_scan_string(my_string,scanner);
+    yyset_lineno(lineno,scanner);
+    if (g_parse_depth > 0) {
+	if (g_parse_depth >= MAX_PARSE_DEPTH) {
+	    fprintf(stderr,"Exceeded parser stack depth.  Self-recursive call?\n");
+	    return 1;
+	}
+	/* Save variables on stack */
+	parservarstack[g_parse_depth].rewrite = rewrite;
+	parservarstack[g_parse_depth].rule_direction = rule_direction;
+	parservarstack[g_parse_depth].contexts = contexts;
+	parservarstack[g_parse_depth].rules = rules;
+	parservarstack[g_parse_depth].rewrite_rules = rewrite_rules;
+    }
+    g_parse_depth++;
+    yyp = yyparse(scanner, defined_nets, defined_funcs);
+    g_parse_depth--;
+    if (g_parse_depth > 0) {
+	/* Restore parse variables */
+	rewrite        = parservarstack[g_parse_depth].rewrite;
+	rule_direction = parservarstack[g_parse_depth].rule_direction;
+	contexts       = parservarstack[g_parse_depth].contexts;
+	rules          = parservarstack[g_parse_depth].rules;
+	rewrite_rules  = parservarstack[g_parse_depth].rewrite_rules;
+    }
+    yy_delete_buffer(my_string_buffer,scanner);
+    yylex_destroy(scanner);
+    return yyp;
+}
 
 /* Reserved multicharacter symbols are a little tricky to define */
 /* what we're doing is excluding some combinations of multibyte sequences */
 /* using the {-} construct in flex */
 
-#line 1799 "lex.yy.c"
+#line 1826 "lex.yy.c"
 
 #define INITIAL 0
 #define DEFI 1
@@ -1820,9 +1837,7 @@ int my_yyparse(char *my_string, int lineno) {
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
-#ifndef _MSC_VER
 #include <unistd.h>
-#endif // _MSC_VER
 #endif
 
 #ifndef YY_EXTRA_TYPE
@@ -1842,8 +1857,8 @@ struct yyguts_t
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    yy_size_t yy_n_chars;
-    yy_size_t yyleng_r;
+    int yy_n_chars;
+    int yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -1900,7 +1915,7 @@ FILE *yyget_out (yyscan_t yyscanner );
 
 void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-yy_size_t yyget_leng (yyscan_t yyscanner );
+int yyget_leng (yyscan_t yyscanner );
 
 char *yyget_text (yyscan_t yyscanner );
 
@@ -1950,7 +1965,12 @@ static int input (yyscan_t yyscanner );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -1958,7 +1978,7 @@ static int input (yyscan_t yyscanner );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -1969,7 +1989,7 @@ static int input (yyscan_t yyscanner );
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		yy_size_t n; \
+		size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
@@ -2054,12 +2074,12 @@ YY_DECL
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 143 "regex.l"
+#line 156 "regex.l"
 
 
  /* we're matching braced strings */
 
-#line 2051 "lex.yy.c"
+#line 2083 "lex.yy.c"
 
     yylval = yylval_param;
 
@@ -2116,7 +2136,7 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 556 )
+				if ( yy_current_state >= 573 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2137,7 +2157,7 @@ yy_find_action:
 
 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
 			{
-			yy_size_t yyl;
+			int yyl;
 			for ( yyl = 0; yyl < yyleng; ++yyl )
 				if ( yytext[yyl] == '\n' )
 					   
@@ -2161,110 +2181,110 @@ do_action:	/* This label is used only to access EOF actions. */
 case 1:
 /* rule 1 can match eol */
 YY_RULE_SETUP
-#line 147 "regex.l"
+#line 160 "regex.l"
 {
-  yylval_param->net = fsm_explode(yytext);
-  return NET;
+    yylval_param->net = fsm_explode(yytext);
+    return NET;
 }
 	YY_BREAK
 /* Read binary file */
 case 2:
 /* rule 2 can match eol */
 YY_RULE_SETUP
-#line 153 "regex.l"
+#line 166 "regex.l"
 {
-  tempstr = xxstrndup(yytext+2,yyleng-3);
-  yylval_param->net = fsm_read_binary_file(tempstr);
-  xxfree(tempstr);
-  if (yylval_param->net != NULL) {
-    return NET;
-  }
+    tempstr = xxstrndup(yytext+2,yyleng-3);
+    yylval_param->net = fsm_read_binary_file(tempstr);
+    xxfree(tempstr);
+    if (yylval_param->net != NULL) {
+	return NET;
+    }
 }
 	YY_BREAK
 /* Read regex from file */
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 163 "regex.l"
+#line 176 "regex.l"
 {
-  tempstr = xxstrndup(yytext+4,yyleng-5);
-  tempstr2 = file_to_mem(tempstr);
-  xxfree(tempstr);
-  if (tempstr2 != NULL) {
-    yylval_param->net = fsm_parse_regex_string(tempstr2);
-    if (yylval_param->net != NULL) {
-       return NET;
-     }  
-  }
+    tempstr = xxstrndup(yytext+4,yyleng-5);
+    tempstr2 = file_to_mem(tempstr);
+    xxfree(tempstr);
+    if (tempstr2 != NULL) {
+	yylval_param->net = fsm_parse_regex_string(tempstr2);
+	if (yylval_param->net != NULL) {
+	    return NET;
+	}  
+    }
 }
 	YY_BREAK
 /* Read text file */
 case 4:
 /* rule 4 can match eol */
 YY_RULE_SETUP
-#line 176 "regex.l"
+#line 189 "regex.l"
 {
-  tempstr = xxstrndup(yytext+5,yyleng-6);
-  yylval_param->net = fsm_read_text_file(tempstr);
-  xxfree(tempstr);
-  if (yylval_param->net != NULL) {
-    return NET;
-  }
+    tempstr = xxstrndup(yytext+5,yyleng-6);
+    yylval_param->net = fsm_read_text_file(tempstr);
+    xxfree(tempstr);
+    if (yylval_param->net != NULL) {
+	return NET;
+    }
 }
 	YY_BREAK
 /* Read spaced text file */
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 186 "regex.l"
+#line 199 "regex.l"
 {
-  tempstr = xxstrndup(yytext+6,yyleng-7);
-  yylval_param->net = fsm_read_spaced_text_file(tempstr);
-  xxfree(tempstr);
-  if (yylval_param->net != NULL) {
-    return NET;
-  }
+    tempstr = xxstrndup(yytext+6,yyleng-7);
+    yylval_param->net = fsm_read_spaced_text_file(tempstr);
+    xxfree(tempstr);
+    if (yylval_param->net != NULL) {
+	return NET;
+    }
 }
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 195 "regex.l"
+#line 208 "regex.l"
 {
-  //yylval_param->string = xxstrdup(yytext+1);
-  yylval_param->string = yytext+1;
-  return NCONCAT;
+    //yylval_param->string = xxstrdup(yytext+1);
+    yylval_param->string = yytext+1;
+    return NCONCAT;
 }
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 201 "regex.l"
+#line 214 "regex.l"
 {
-  //yylval_param->string = xxstrdup(yytext+2);
-  yylval_param->string = yytext+2;
-  return MNCONCAT;
+    //yylval_param->string = xxstrdup(yytext+2);
+    yylval_param->string = yytext+2;
+    return MNCONCAT;
 }
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 206 "regex.l"
+#line 219 "regex.l"
 {
-  yylval_param->string = yytext+2;
+    yylval_param->string = yytext+2;
 //  yylval_param->string = xxstrdup(yytext+2);
-  return MORENCONCAT;
+    return MORENCONCAT;
 }
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 211 "regex.l"
+#line 224 "regex.l"
 {
-  //  yylval_param->string = xxstrdup(yytext+2);
- yylval_param->string = yytext+2;
-  return LESSNCONCAT;
+    //  yylval_param->string = xxstrdup(yytext+2);
+    yylval_param->string = yytext+2;
+    return LESSNCONCAT;
 }
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 217 "regex.l"
+#line 230 "regex.l"
 {
 
 }
@@ -2276,9 +2296,9 @@ case 11:
 yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 222 "regex.l"
+#line 235 "regex.l"
 {
- BEGIN(UQ);
+    BEGIN(UQ);
 }
 	YY_BREAK
 /* Start of existential quantifier */
@@ -2288,9 +2308,9 @@ case 12:
 yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 227 "regex.l"
+#line 240 "regex.l"
 {
- BEGIN(EQ);
+    BEGIN(EQ);
 }
 	YY_BREAK
 case 13:
@@ -2299,15 +2319,15 @@ case 13:
 yyg->yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 232 "regex.l"
+#line 245 "regex.l"
 {
  /* Add quantifier to quantifier symbol table */
 
  //yylval_param->string = xxstrdup(yytext);
- yylval_param->string = yytext;
- add_quantifier(yytext);
- BEGIN(ENDQ);
- return(UQUANT);
+    yylval_param->string = yytext;
+    add_quantifier(yytext);
+    BEGIN(ENDQ);
+    return(UQUANT);
 }
 	YY_BREAK
 case 14:
@@ -2316,19 +2336,19 @@ case 14:
 yyg->yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 242 "regex.l"
+#line 255 "regex.l"
 {
- /* Add quantifier to quantifier symbol table */
- //yylval_param->string = xxstrdup(yytext);
- yylval_param->string = yytext;
- add_quantifier(yytext);
- BEGIN(ENDQ);
- return(EQUANT);
+    /* Add quantifier to quantifier symbol table */
+    //yylval_param->string = xxstrdup(yytext);
+    yylval_param->string = yytext;
+    add_quantifier(yytext);
+    BEGIN(ENDQ);
+    return(EQUANT);
 }
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 251 "regex.l"
+#line 264 "regex.l"
 {BEGIN(INITIAL);}
 	YY_BREAK
 /* Start of a quoted sequence of symbols */
@@ -2338,9 +2358,9 @@ case 16:
 yyg->yy_c_buf_p = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 254 "regex.l"
+#line 267 "regex.l"
 {
-  BEGIN(QTD);
+    BEGIN(QTD);
 }
 	YY_BREAK
 /* Stuff that goes inside " ", including UTF8 \uHHHH sequences */
@@ -2350,24 +2370,24 @@ case 17:
 yyg->yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 259 "regex.l"
+#line 272 "regex.l"
 {
-  decode_quoted(yytext);										  
-  yylval_param->net = fsm_symbol(yytext);
-  BEGIN(QTDEND);
-  return NET;
+    decode_quoted(yytext);										  
+    yylval_param->net = fsm_symbol(yytext);
+    BEGIN(QTDEND);
+    return NET;
 }
 	YY_BREAK
 /* Disregard end quote */
 case 18:
 YY_RULE_SETUP
-#line 267 "regex.l"
+#line 280 "regex.l"
 { BEGIN(INITIAL);}
 	YY_BREAK
 /* Different epsilon variants: "" or [] or \epsilon */
 case 19:
 YY_RULE_SETUP
-#line 270 "regex.l"
+#line 283 "regex.l"
 {
   yylval_param->net = fsm_empty_string();
   return NET;
@@ -2376,7 +2396,7 @@ YY_RULE_SETUP
 /* The empty set */
 case 20:
 YY_RULE_SETUP
-#line 275 "regex.l"
+#line 288 "regex.l"
 {
    yylval_param->net = fsm_empty_set();
    return NET;
@@ -2385,7 +2405,7 @@ YY_RULE_SETUP
 /* Sigma */
 case 21:
 YY_RULE_SETUP
-#line 281 "regex.l"
+#line 294 "regex.l"
 {
   yylval_param->net = fsm_identity();  
   return NET;
@@ -2393,108 +2413,123 @@ YY_RULE_SETUP
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 286 "regex.l"
+#line 299 "regex.l"
 { return SUCCESSOR_OF; }
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 288 "regex.l"
+#line 301 "regex.l"
 { return ISUNAMBIGUOUS;   }
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 289 "regex.l"
+#line 302 "regex.l"
 { return ISIDENTITY;      } 
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 290 "regex.l"
+#line 303 "regex.l"
 { return ISFUNCTIONAL;    }
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 291 "regex.l"
+#line 304 "regex.l"
 { return NOTID;           }
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 292 "regex.l"
+#line 305 "regex.l"
 { return LETTERMACHINE;   }
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 293 "regex.l"
+#line 306 "regex.l"
 { return LOWERUNIQ;       }
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 294 "regex.l"
+#line 307 "regex.l"
 { return LOWERUNIQEPS;    }
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 295 "regex.l"
+#line 308 "regex.l"
 { return ALLFINAL;        }
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 296 "regex.l"
+#line 309 "regex.l"
 { return UNAMBIGUOUSPART; }
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 297 "regex.l"
+#line 310 "regex.l"
 { return AMBIGUOUSPART;   }
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 298 "regex.l"
+#line 311 "regex.l"
 { return AMBIGUOUSDOMAIN; }
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 299 "regex.l"
+#line 312 "regex.l"
 { return EQSUBSTRINGS;    }
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 300 "regex.l"
+#line 313 "regex.l"
 { return MARKFSMTAIL;     }
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 301 "regex.l"
+#line 314 "regex.l"
 { return MARKFSMTAILLOOP; }
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 302 "regex.l"
+#line 315 "regex.l"
 { return MARKFSMMIDLOOP;  }
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 303 "regex.l"
+#line 316 "regex.l"
 { return MARKFSMLOOP;     }
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 304 "regex.l"
+#line 317 "regex.l"
 { return ADDSINK;         }
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 305 "regex.l"
+#line 318 "regex.l"
 { return LEFTREWR;        }
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 306 "regex.l"
+#line 319 "regex.l"
 { return FLATTEN;         }
 	YY_BREAK
 case 42:
-/* rule 42 can match eol */
 YY_RULE_SETUP
-#line 308 "regex.l"
+#line 320 "regex.l"
+{ return SUBLABEL;        }
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 321 "regex.l"
+{ return CLOSESIGMA;      }
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 322 "regex.l"
+{ return CLOSESIGMAUNK;   }
+	YY_BREAK
+case 45:
+/* rule 45 can match eol */
+YY_RULE_SETUP
+#line 324 "regex.l"
 {
    yylval_param->string = xxstrdup(yytext);
    //yylval_param->string = yytext;
@@ -2502,10 +2537,10 @@ YY_RULE_SETUP
 }
 	YY_BREAK
 /* The set of nonreserved symbols, or % followed by any UTF8 character */
-case 43:
-/* rule 43 can match eol */
+case 46:
+/* rule 46 can match eol */
 YY_RULE_SETUP
-#line 316 "regex.l"
+#line 332 "regex.l"
 {
   int i,j, skip, escaped;
   if ((strncmp(yytext,"=",1) == 0) && (count_quantifiers() > 0)) {
@@ -2537,8 +2572,8 @@ YY_RULE_SETUP
   }
   //  yylval_param->string = xxstrdup(yytext);
   yylval_param->string = yytext;
-  if(find_defined(yytext) != NULL) {
-    yylval_param->net = fsm_copy(find_defined(yytext));
+  if(find_defined(yyextra->defined_nets, yytext) != NULL) {
+    yylval_param->net = fsm_copy(find_defined(yyextra->defined_nets, yytext));
   } else if (find_quantifier(yytext) != NULL) {
       return VAR;
   } else {
@@ -2552,423 +2587,423 @@ YY_RULE_SETUP
   return NET;
 }
 	YY_BREAK
-case 44:
+case 47:
 YY_RULE_SETUP
-#line 362 "regex.l"
+#line 378 "regex.l"
 { yylval_param->net = fsm_symbol(".#."); return NET;    }
 	YY_BREAK
-case 45:
+case 48:
 YY_RULE_SETUP
-#line 363 "regex.l"
+#line 379 "regex.l"
 { return CONTEXT;             }
 	YY_BREAK
-case 46:
+case 49:
 YY_RULE_SETUP
-#line 364 "regex.l"
+#line 380 "regex.l"
 { return XUPPER;              }
 	YY_BREAK
-case 47:
+case 50:
 YY_RULE_SETUP
-#line 365 "regex.l"
+#line 381 "regex.l"
 { return XLOWER;              }
 	YY_BREAK
-case 48:
+case 51:
 YY_RULE_SETUP
-#line 366 "regex.l"
+#line 382 "regex.l"
 { return FLAG_ELIMINATE;      }
 	YY_BREAK
-case 49:
-/* rule 49 can match eol */
+case 52:
+/* rule 52 can match eol */
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 2;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 367 "regex.l"
+#line 383 "regex.l"
 { return LDOT;                }
 	YY_BREAK
-case 50:
+case 53:
 YY_RULE_SETUP
-#line 368 "regex.l"
+#line 384 "regex.l"
 { return RDOT;                }
 	YY_BREAK
-case 51:
+case 54:
 YY_RULE_SETUP
-#line 369 "regex.l"
+#line 385 "regex.l"
 { return IMPLIES;             }
 	YY_BREAK
-case 52:
+case 55:
 YY_RULE_SETUP
-#line 370 "regex.l"
+#line 386 "regex.l"
 { return BICOND;              }
 	YY_BREAK
-case 53:
+case 56:
 YY_RULE_SETUP
-#line 371 "regex.l"
+#line 387 "regex.l"
 { return IN;                  }
 	YY_BREAK
-case 54:
+case 57:
 YY_RULE_SETUP
-#line 372 "regex.l"
+#line 388 "regex.l"
 { return COMPLEMENT;          }
 	YY_BREAK
-case 55:
+case 58:
 YY_RULE_SETUP
-#line 373 "regex.l"
+#line 389 "regex.l"
 { return COMPOSE;             }
 	YY_BREAK
-case 56:
+case 59:
 YY_RULE_SETUP
-#line 374 "regex.l"
+#line 390 "regex.l"
 { return LENIENT_COMPOSE;     }
 	YY_BREAK
-case 57:
+case 60:
 YY_RULE_SETUP
-#line 375 "regex.l"
+#line 391 "regex.l"
 { return PRIORITY_UNION_U;    }
 	YY_BREAK
-case 58:
+case 61:
 YY_RULE_SETUP
-#line 376 "regex.l"
+#line 392 "regex.l"
 { return PRIORITY_UNION_L;    }
 	YY_BREAK
-case 59:
+case 62:
 YY_RULE_SETUP
-#line 377 "regex.l"
+#line 393 "regex.l"
 { return SHUFFLE;             }
 	YY_BREAK
-case 60:
+case 63:
 YY_RULE_SETUP
-#line 378 "regex.l"
+#line 394 "regex.l"
 { return PRECEDES;            }
 	YY_BREAK
-case 61:
+case 64:
 YY_RULE_SETUP
-#line 379 "regex.l"
+#line 395 "regex.l"
 { return FOLLOWS;             }
 	YY_BREAK
-case 62:
+case 65:
 YY_RULE_SETUP
-#line 380 "regex.l"
+#line 396 "regex.l"
 { return TRIPLE_DOT;          }
 	YY_BREAK
-case 63:
+case 66:
 YY_RULE_SETUP
-#line 381 "regex.l"
+#line 397 "regex.l"
 {                     yylval_param->type = ARROW_RIGHT; return ARROW;}
 	YY_BREAK
-case 64:
+case 67:
 YY_RULE_SETUP
-#line 382 "regex.l"
+#line 398 "regex.l"
 {                 yylval_param->type = ARROW_RIGHT | ARROW_OPTIONAL; return ARROW;}
 	YY_BREAK
-case 65:
+case 68:
 YY_RULE_SETUP
-#line 383 "regex.l"
+#line 399 "regex.l"
 {                     yylval_param->type = ARROW_LEFT; return ARROW;}
 	YY_BREAK
-case 66:
+case 69:
 YY_RULE_SETUP
-#line 384 "regex.l"
+#line 400 "regex.l"
 {                 yylval_param->type = ARROW_LEFT | ARROW_OPTIONAL; return ARROW;}
 	YY_BREAK
-case 67:
+case 70:
 YY_RULE_SETUP
-#line 385 "regex.l"
+#line 401 "regex.l"
 {                   yylval_param->type = ARROW_LEFT|ARROW_RIGHT; return ARROW;}
 	YY_BREAK
-case 68:
+case 71:
 YY_RULE_SETUP
-#line 386 "regex.l"
+#line 402 "regex.l"
 {               yylval_param->type = ARROW_LEFT|ARROW_RIGHT|ARROW_OPTIONAL; return ARROW;}
 	YY_BREAK
-case 69:
+case 72:
 YY_RULE_SETUP
-#line 387 "regex.l"
+#line 403 "regex.l"
 { yylval_param->type = ARROW_RIGHT|ARROW_LONGEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 70:
+case 73:
 YY_RULE_SETUP
-#line 388 "regex.l"
+#line 404 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_RIGHT|ARROW_LONGEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 71:
+case 74:
 YY_RULE_SETUP
-#line 389 "regex.l"
+#line 405 "regex.l"
 { yylval_param->type = ARROW_RIGHT|ARROW_SHORTEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 72:
+case 75:
 YY_RULE_SETUP
-#line 390 "regex.l"
+#line 406 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_RIGHT|ARROW_SHORTEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 73:
+case 76:
 YY_RULE_SETUP
-#line 391 "regex.l"
+#line 407 "regex.l"
 { yylval_param->type = ARROW_RIGHT|ARROW_LONGEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 74:
+case 77:
 YY_RULE_SETUP
-#line 392 "regex.l"
+#line 408 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_RIGHT|ARROW_LONGEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 75:
+case 78:
 YY_RULE_SETUP
-#line 393 "regex.l"
+#line 409 "regex.l"
 { yylval_param->type = ARROW_RIGHT|ARROW_SHORTEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 76:
+case 79:
 YY_RULE_SETUP
-#line 394 "regex.l"
+#line 410 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_RIGHT|ARROW_SHORTEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 77:
+case 80:
 YY_RULE_SETUP
-#line 395 "regex.l"
+#line 411 "regex.l"
 { yylval_param->type = ARROW_LEFT|ARROW_LONGEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 78:
+case 81:
 YY_RULE_SETUP
-#line 396 "regex.l"
+#line 412 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_LEFT|ARROW_LONGEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 79:
+case 82:
 YY_RULE_SETUP
-#line 397 "regex.l"
+#line 413 "regex.l"
 { yylval_param->type = ARROW_LEFT|ARROW_SHORTEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 80:
+case 83:
 YY_RULE_SETUP
-#line 398 "regex.l"
+#line 414 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_LEFT|ARROW_SHORTEST_MATCH|ARROW_LEFT_TO_RIGHT; return ARROW;}
 	YY_BREAK
-case 81:
+case 84:
 YY_RULE_SETUP
-#line 399 "regex.l"
+#line 415 "regex.l"
 { yylval_param->type = ARROW_LEFT|ARROW_LONGEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 82:
+case 85:
 YY_RULE_SETUP
-#line 400 "regex.l"
+#line 416 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_LEFT|ARROW_LONGEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 83:
+case 86:
 YY_RULE_SETUP
-#line 401 "regex.l"
+#line 417 "regex.l"
 { yylval_param->type = ARROW_LEFT|ARROW_SHORTEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 84:
+case 87:
 YY_RULE_SETUP
-#line 402 "regex.l"
+#line 418 "regex.l"
 { yylval_param->type = ARROW_OPTIONAL|ARROW_RIGHT|ARROW_SHORTEST_MATCH|ARROW_RIGHT_TO_LEFT; return ARROW;}
 	YY_BREAK
-case 85:
+case 88:
 YY_RULE_SETUP
-#line 404 "regex.l"
+#line 420 "regex.l"
 {                     return CRESTRICT;           }
 	YY_BREAK
-case 86:
+case 89:
 YY_RULE_SETUP
-#line 405 "regex.l"
+#line 421 "regex.l"
 {                   return SUBSTITUTE;          }
 	YY_BREAK
-case 87:
+case 90:
 YY_RULE_SETUP
-#line 406 "regex.l"
+#line 422 "regex.l"
 {                     yylval_param->type = OP_UPWARD_REPLACE;    return DIRECTION; }
 	YY_BREAK
-case 88:
+case 91:
 YY_RULE_SETUP
-#line 407 "regex.l"
+#line 423 "regex.l"
 {                     yylval_param->type = OP_RIGHTWARD_REPLACE; return DIRECTION; }
 	YY_BREAK
-case 89:
+case 92:
 YY_RULE_SETUP
-#line 408 "regex.l"
+#line 424 "regex.l"
 {                     yylval_param->type = OP_LEFTWARD_REPLACE;  return DIRECTION; }
 	YY_BREAK
-case 90:
+case 93:
 YY_RULE_SETUP
-#line 409 "regex.l"
+#line 425 "regex.l"
 {                     yylval_param->type = OP_DOWNWARD_REPLACE;  return DIRECTION; }
 	YY_BREAK
-case 91:
+case 94:
 YY_RULE_SETUP
-#line 410 "regex.l"
+#line 426 "regex.l"
 {                        return HIGH_CROSS_PRODUCT;  }
 	YY_BREAK
-case 92:
+case 95:
 YY_RULE_SETUP
-#line 411 "regex.l"
+#line 427 "regex.l"
 {       return CROSS_PRODUCT;       }
 	YY_BREAK
-case 93:
+case 96:
 YY_RULE_SETUP
-#line 412 "regex.l"
+#line 428 "regex.l"
 {                        return COMMA;               }
 	YY_BREAK
-case 94:
+case 97:
 YY_RULE_SETUP
-#line 413 "regex.l"
+#line 429 "regex.l"
 {                       return DOUBLE_COMMA;        }
 	YY_BREAK
-case 95:
+case 98:
 YY_RULE_SETUP
-#line 414 "regex.l"
+#line 430 "regex.l"
 {                   return IGNORE_INTERNAL;     }
 	YY_BREAK
-case 96:
+case 99:
 YY_RULE_SETUP
-#line 415 "regex.l"
+#line 431 "regex.l"
 {                       return IGNORE_ALL;          }
 	YY_BREAK
-case 97:
+case 100:
 YY_RULE_SETUP
-#line 416 "regex.l"
+#line 432 "regex.l"
 {                   return RIGHT_QUOTIENT;      }
 	YY_BREAK
-case 98:
+case 101:
 YY_RULE_SETUP
-#line 417 "regex.l"
+#line 433 "regex.l"
 {                   return LEFT_QUOTIENT;       }
 	YY_BREAK
-case 99:
+case 102:
 YY_RULE_SETUP
-#line 418 "regex.l"
+#line 434 "regex.l"
 {                   return INTERLEAVE_QUOTIENT; }
 	YY_BREAK
-case 100:
+case 103:
 YY_RULE_SETUP
-#line 419 "regex.l"
+#line 435 "regex.l"
 {                       return TERM_NEGATION;       }
 	YY_BREAK
-case 101:
+case 104:
 YY_RULE_SETUP
-#line 420 "regex.l"
+#line 436 "regex.l"
 {                       return MINUS;               }
 	YY_BREAK
-case 102:
+case 105:
 YY_RULE_SETUP
-#line 421 "regex.l"
+#line 437 "regex.l"
 {                     return CONTAINS_OPT_ONE;    }
 	YY_BREAK
-case 103:
+case 106:
 YY_RULE_SETUP
-#line 422 "regex.l"
+#line 438 "regex.l"
 {                     return CONTAINS_ONE;        }
 	YY_BREAK
-case 104:
+case 107:
 YY_RULE_SETUP
-#line 423 "regex.l"
+#line 439 "regex.l"
 {                       return CONTAINS;            }
 	YY_BREAK
-case 105:
+case 108:
 YY_RULE_SETUP
-#line 424 "regex.l"
+#line 440 "regex.l"
 {                       return KLEENE_PLUS;         }
 	YY_BREAK
-case 106:
+case 109:
 YY_RULE_SETUP
-#line 425 "regex.l"
+#line 441 "regex.l"
 {                       return KLEENE_STAR;         }
 	YY_BREAK
-case 107:
+case 110:
 YY_RULE_SETUP
-#line 426 "regex.l"
+#line 442 "regex.l"
 { return INVERSE;     }
 	YY_BREAK
-case 108:
+case 111:
 YY_RULE_SETUP
-#line 427 "regex.l"
+#line 443 "regex.l"
 {                      return REVERSE;             }
 	YY_BREAK
-case 109:
+case 112:
 YY_RULE_SETUP
-#line 428 "regex.l"
+#line 444 "regex.l"
 {                       return LBRACKET;            }
 	YY_BREAK
-case 110:
+case 113:
 YY_RULE_SETUP
-#line 429 "regex.l"
+#line 445 "regex.l"
 {                       return RBRACKET;            }
 	YY_BREAK
-case 111:
+case 114:
 YY_RULE_SETUP
-#line 430 "regex.l"
+#line 446 "regex.l"
 {         return PRECEDES;            }
 	YY_BREAK
-case 112:
+case 115:
 YY_RULE_SETUP
-#line 431 "regex.l"
+#line 447 "regex.l"
 {         return FOLLOWS;             }
 	YY_BREAK
-case 113:
+case 116:
 YY_RULE_SETUP
-#line 432 "regex.l"
+#line 448 "regex.l"
 {         return NEQ;                 }
 	YY_BREAK
-case 114:
+case 117:
 YY_RULE_SETUP
-#line 433 "regex.l"
+#line 449 "regex.l"
 {                       return LPAREN;              }
 	YY_BREAK
-case 115:
+case 118:
 YY_RULE_SETUP
-#line 434 "regex.l"
+#line 450 "regex.l"
 {                       return RPAREN;              }
 	YY_BREAK
-case 116:
+case 119:
 YY_RULE_SETUP
-#line 435 "regex.l"
+#line 451 "regex.l"
 {                       return ENDM;                } 
 	YY_BREAK
-case 117:
+case 120:
 YY_RULE_SETUP
-#line 436 "regex.l"
+#line 452 "regex.l"
 {                       return ENDD;                }
 	YY_BREAK
-case 118:
+case 121:
 YY_RULE_SETUP
-#line 437 "regex.l"
+#line 453 "regex.l"
 {                       return END;                 }
 	YY_BREAK
-case 119:
+case 122:
 YY_RULE_SETUP
-#line 438 "regex.l"
+#line 454 "regex.l"
 { return UNION;     }
 	YY_BREAK
-case 120:
+case 123:
 YY_RULE_SETUP
-#line 439 "regex.l"
+#line 455 "regex.l"
 { return INTERSECT; }
 	YY_BREAK
-case 121:
-/* rule 121 can match eol */
+case 124:
+/* rule 124 can match eol */
 YY_RULE_SETUP
-#line 441 "regex.l"
+#line 457 "regex.l"
 { yycolumn = 1; }
 	YY_BREAK
-case 122:
-/* rule 122 can match eol */
+case 125:
+/* rule 125 can match eol */
 YY_RULE_SETUP
-#line 442 "regex.l"
+#line 458 "regex.l"
 {  }
 	YY_BREAK
-case 123:
+case 126:
 YY_RULE_SETUP
-#line 443 "regex.l"
+#line 459 "regex.l"
 {  }
 	YY_BREAK
-case 124:
+case 127:
 YY_RULE_SETUP
-#line 444 "regex.l"
+#line 460 "regex.l"
 { }
 	YY_BREAK
-case 125:
+case 128:
 YY_RULE_SETUP
-#line 445 "regex.l"
+#line 461 "regex.l"
 ECHO;
 	YY_BREAK
-#line 2960 "lex.yy.c"
+#line 3007 "lex.yy.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(DEFI):
 case YY_STATE_EOF(QTD):
@@ -3161,7 +3196,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 	else
 		{
-			yy_size_t num_to_read =
+			int num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
@@ -3175,7 +3210,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 			if ( b->yy_is_our_buffer )
 				{
-				yy_size_t new_size = b->yy_buf_size * 2;
+				int new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
 					b->yy_buf_size += b->yy_buf_size / 8;
@@ -3206,7 +3241,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, num_to_read );
+			yyg->yy_n_chars, (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
@@ -3268,7 +3303,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 556 )
+			if ( yy_current_state >= 573 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -3297,11 +3332,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 556 )
+		if ( yy_current_state >= 573 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 555);
+	yy_is_jam = (yy_current_state == 572);
 
 	return yy_is_jam ? 0 : yy_current_state;
 }
@@ -3319,7 +3354,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 		{ /* need to shift things up to make room */
 		/* +2 for EOB chars. */
-		register yy_size_t number_to_move = yyg->yy_n_chars + 2;
+		register int number_to_move = yyg->yy_n_chars + 2;
 		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
 					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
 		register char *source =
@@ -3373,7 +3408,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 
 		else
 			{ /* need more input */
-			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
@@ -3397,7 +3432,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 				case EOB_ACT_END_OF_FILE:
 					{
 					if ( yywrap(yyscanner ) )
-						return 0;
+						return EOF;
 
 					if ( ! yyg->yy_did_buffer_switch_on_eof )
 						YY_NEW_FILE;
@@ -3664,7 +3699,7 @@ void yypop_buffer_state (yyscan_t yyscanner)
  */
 static void yyensure_buffer_stack (yyscan_t yyscanner)
 {
-	yy_size_t num_to_alloc;
+	int num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
@@ -3757,16 +3792,17 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
 
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	int i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
@@ -3876,7 +3912,7 @@ FILE *yyget_out  (yyscan_t yyscanner)
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-yy_size_t yyget_leng  (yyscan_t yyscanner)
+int yyget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
@@ -4163,4 +4199,4 @@ void yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 445 "regex.l"
+#line 461 "regex.l"
diff --git a/back-ends/foma/lexc.l b/back-ends/foma/lexc.l
index 48450c3..b844c0e 100644
--- a/back-ends/foma/lexc.l
+++ b/back-ends/foma/lexc.l
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -31,44 +31,43 @@
 #define YY_USER_ACTION lexccolumn += lexcleng;
 static int lexentries;
 extern int lexclex();
-extern struct defined *defines;
-static struct defined *olddefines;
-extern int my_yyparse(char *my_string, int lineno);
+static struct defined_networks *olddefines;
+extern int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 extern struct fsm *current_parse;
 static char *tempstr;
 int lexccolumn = 0;
 
-// verbose parameter added in HFST
+#ifndef ORIGINAL
+int verbose_lexc_ = 1;
+#endif
+
 struct fsm *fsm_lexc_parse_string(char *string, int verbose) {
 
-   olddefines = defines;
+   olddefines = g_defines;
    YY_BUFFER_STATE my_string_buffer;
-   my_string_buffer = lexc_scan_string(string, verbose);
+   my_string_buffer = lexc_scan_string(string);
    lexentries = -1;
    lexclineno = 1;
    lexc_init();
    if (lexclex() != 1) {
      if (lexentries != -1) {
-         if (verbose == 1)
-           printf("%i\n",lexentries);
+         printf("%i\n",lexentries);
      }       
    } 
    lexc_delete_buffer(my_string_buffer);
-   defines = olddefines;
+   g_defines = olddefines;
    return(lexc_to_fsm());
 }
 
-// verbose parameter added in HFST
 struct fsm *fsm_lexc_parse_file(char *filename, int verbose) {
   char *mystring;
   mystring = file_to_mem(filename);
-  return(fsm_lexc_parse_string(mystring, verbose));					       
+  return(fsm_lexc_parse_string(mystring, verbose));
 }
 
 void lexc_trim(char *s) {
   /* Remove trailing ; and = and space and initial space */
   int i,j;
-  i = strlen(s);
   for (i = strlen(s)-1; *(s+i) == ';' || *(s+i) == '=' || *(s+i) == ' ' || *(s+i) == '\t'; i--)
     *(s+i) = '\0';  
   for (i=0; *(s+i) == ' ' || *(s+i) == '\t' || *(s+i) == '\n'; i++) {
@@ -179,7 +178,7 @@ ANY    [\001-\177]|[\300-\337][\200-\277]|[\340-\357][\200-\277][\200-\277]|[\36
  /* \076 = > */
 <REGEX>[\076] {
     *(lexctext+lexcleng-1) = ';';
-    if (my_yyparse(lexctext, lexclineno) == 0) {
+    if (my_yyparse(lexctext, lexclineno, g_defines, NULL) == 0) {
        lexc_set_network(current_parse);
     }    
     BEGIN(LEXENTRIES);
@@ -214,8 +213,8 @@ ANY    [\001-\177]|[\300-\337][\200-\277]|[\340-\357][\200-\277][\200-\277]|[\36
 }
  /* \073 = ; */
 <DEFREGEX>[\073] {
-    if (my_yyparse(lexctext, lexclineno) == 0) {
-      add_defined(fsm_topsort(fsm_minimize(current_parse)),tempstr);
+    if (my_yyparse(lexctext, lexclineno, g_defines, NULL) == 0) {
+      add_defined(g_defines, fsm_topsort(fsm_minimize(current_parse)),tempstr);
     }
     xxfree(tempstr);
     BEGIN(DEF);
@@ -245,6 +244,6 @@ ANY    [\001-\177]|[\300-\337][\200-\277]|[\340-\357][\200-\277][\200-\277]|[\36
   BEGIN(DEFREGEX);
   yymore();
 }
-<*>((!).*[\015]?(\n)) { /* printf ("Comment: [%s]\n",lexctext); */ }
+<*>((!).*[\015]?(\n)) {  /* printf ("Comment: [%s]\n",lexctext); */  }
 
 <*>(.) { printf("\n***Syntax error on line %i column %i at '%s'\n",lexclineno,lexccolumn,lexctext); return 1;}
diff --git a/back-ends/foma/lexcread.c b/back-ends/foma/lexcread.c
index a92609c..3535dc4 100644
--- a/back-ends/foma/lexcread.c
+++ b/back-ends/foma/lexcread.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -26,7 +26,11 @@
 #define WORD_ENTRY 1
 #define REGEX_ENTRY 2
 
+#ifndef ORIGINAL
 extern int verbose_lexc_;
+#endif
+
+extern int g_lexc_align;
 
 struct multichar_symbols {
     char *symbol;
@@ -80,13 +84,14 @@ static struct sigma *lexsigma = NULL;
 static struct lexc_hashtable *hashtable;
 static struct fsm *current_regex_network;
 
-static int cwordin[1000], cwordout[1000], carity, lexc_statecount, maxlen, hasfinal, current_entry, net_has_unknown;
+static int cwordin[1000], cwordout[1000], medcwordin[2000], medcwordout[2000], carity, lexc_statecount, maxlen, hasfinal, current_entry, net_has_unknown;
 static _Bool *mchash;
 static struct lexstates *clexicon, *ctarget;
 
 static char *mystrncpy(char *dest, char *src, int len);
 static void lexc_string_to_tokens(char *string, int *intarr);
 static void lexc_pad();
+static void lexc_medpad();
 static void lexc_number_states();
 static void lexc_cleanup();
 static unsigned int lexc_suffix_hash(int offset);
@@ -109,11 +114,10 @@ static unsigned int lexc_suffix_hash(int offset) {
 
 static unsigned int lexc_symbol_hash(char *s) {
     register unsigned int hash;
-    hash = 0;
-
-    while (*s != '\0') {
-        hash = hash * 101  +  *s++;
-    }
+    int c;
+    hash = 5381;
+    while ((c = *s++))
+	hash = ((hash << 5) + hash) + c;
     return (hash % SIGMA_HASH_TABLESIZE);
 }
 
@@ -229,16 +233,15 @@ void lexc_add_network() {
     struct states **slist, *sourcestate, *deststate, *newstate;
     struct statelist *s;
     struct trans *newtrans;
-    int i, j, *sigreplace, signumber, maxstate, *finals, maxsigma, unknown_symbols, first_new_sigma, last_new_sigma, *unk = NULL;
+    int i, j, *sigreplace, signumber, maxstate, *finals, unknown_symbols, first_new_sigma, *unk = NULL;
 
     unknown_symbols = 0;
-    first_new_sigma = last_new_sigma = 0;
+    first_new_sigma = 0;
     sourcestate = clexicon->state;
     deststate = ctarget->state;
 
     net = current_regex_network;
     fsm = net->states;
-    maxsigma = sigma_max(net->sigma);
 
     sigreplace = xxcalloc(sigma_max(net->sigma)+1,sizeof(int));
 
@@ -247,7 +250,6 @@ void lexc_add_network() {
             /* Add to existing lexc sigma */
             signumber = sigma_add(sigma->symbol, lexsigma);
             first_new_sigma = first_new_sigma > 0 ? first_new_sigma : signumber;
-            last_new_sigma = signumber;
             lexc_add_sigma_hash(sigma->symbol, signumber);
             *(sigreplace+sigma->number) = signumber;
         } else {
@@ -365,11 +367,11 @@ void lexc_set_current_lexicon(char *name, int which) {
     for (l = lexstates; l != NULL; l = l->next) {
         if (strcmp(name,l->name) == 0) {
             if (which == 0) {
-                l->has_outgoing = 1;
+		l->has_outgoing = 1;
                 clexicon = l;
-            } else {
+	    } else {
                 ctarget = l;
-            }
+	    }
             return;
         }
     }
@@ -388,7 +390,7 @@ void lexc_set_current_lexicon(char *name, int which) {
     l->state = newstate;
     if (which == 0) {
         clexicon = l;
-        l->has_outgoing = 1;
+	l->has_outgoing = 1;
     } else { 
         ctarget = l;
     }
@@ -397,10 +399,10 @@ void lexc_set_current_lexicon(char *name, int which) {
 char *lexc_find_delim(char *name, char delimiter, char escape) {
     int i;
     for (i=0; *(name+i) != '\0'; i++) {
-        if (*(name+i) == escape && *(name+i+1) != '\0') {
-            i++;
-            continue;
-        }
+	if (*(name+i) == escape && *(name+i+1) != '\0') {
+	    i++;
+	    continue;
+	}
         if (*(name+i) == delimiter) {
             return name+i;
         }
@@ -418,12 +420,12 @@ void lexc_deescape_string(char *name, char escape, int mode) {
             i++;
             continue;
         }
-        else if (mode == 1 && *(name+i) == '0') {
-            /* Marks alignment EPSILON */
-            *(name+j) = (unsigned char) 0xff;
-            j++;
-            continue;
-        }
+	else if (mode == 1 && *(name+i) == '0') {
+	    /* Marks alignment EPSILON */
+	    *(name+j) = (unsigned char) 0xff;
+	    j++;
+	    continue;
+	}
         else if (*(name+i) != escape && *(name+i) != '0') {
             j++;
             continue;
@@ -454,25 +456,123 @@ void lexc_set_current_word(char *name) {
     lexc_string_to_tokens(instring, cwordin);
     if (carity == 2) {
         lexc_string_to_tokens(outstring, cwordout);
-        lexc_pad();
+	if (g_lexc_align)
+	    lexc_medpad();
+	else
+	    lexc_pad();
     } else {
         for (i=0; *(cwordin+i) != -1; i++) {
             *(cwordout+i) = *(cwordin+i);
         }
         *(cwordout+i) = -1;
+
     }
     current_entry = WORD_ENTRY;
 }
 
+
+#define LEV_DOWN 0
+#define LEV_LEFT 1
+#define LEV_DIAG 2
+    
+void lexc_medpad() {
+    int i, j, x, y, s1len, s2len, left, down, diag, dir;
+
+    if (*cwordin == -1 && *cwordout == -1) {
+	*cwordin = *cwordout = EPSILON;
+	*(cwordin+1) = *(cwordout+1) = -1;
+	return;
+    }
+    
+    for (i = 0, j = 0; cwordin[i] != -1; i++) {
+    	if (cwordin[i] == EPSILON) {
+    	    continue;
+    	}
+    	cwordin[j] = cwordin[i];
+    	j++;
+    }
+    cwordin[j] = -1;
+
+    for (i = 0, j = 0; cwordout[i] != -1; i++) {
+    	if (cwordout[i] == EPSILON) {
+    	    continue;
+    	}
+    	cwordout[j] = cwordout[i];
+    	j++;
+    }
+    cwordout[j] = -1;
+    
+    for (i = 0; cwordin[i] != -1; i++) { }
+    s1len = i;
+    for (i = 0; cwordout[i] != -1; i++) { }
+    s2len = i;
+    
+    int matrix[s1len+2][s2len+2];
+    int dirmatrix[s1len+2][s2len+2];
+
+    matrix[0][0] = 0;
+    dirmatrix[0][0] = 0;
+    for (x = 1; x <= s1len; x++) {
+        matrix[x][0] = matrix[x-1][0] + 1;
+	dirmatrix[x][0] = LEV_LEFT;
+    }
+    for (y = 1; y <= s2len; y++) {
+        matrix[0][y] = matrix[0][y-1] + 1;
+	dirmatrix[0][y] = LEV_DOWN;
+    }
+    for (x = 1; x <= s1len; x++) {
+        for (y = 1; y <= s2len; y++) {
+    	    diag = matrix[x-1][y-1] + (cwordin[x-1] == cwordout[y-1] ? 0 : 100);
+    	    down =  matrix[x][y-1] + 1;
+    	    left = matrix[x-1][y] + 1;
+    	    if (diag <= left && diag <= down) {
+    		matrix[x][y] = diag;
+    		dirmatrix[x][y] = LEV_DIAG;
+    	    } else if (left <= diag && left <= down) {
+    		matrix[x][y] = left;
+    		dirmatrix[x][y] = LEV_LEFT;
+    	    } else {
+    		matrix[x][y] = down ;
+    		dirmatrix[x][y] = LEV_DOWN;
+    	    }
+    	}
+    }
+
+    for (x = s1len, y = s2len, i = 0; (x > 0) || (y > 0); i++) {
+	dir = dirmatrix[x][y];
+    	if (dir == LEV_DIAG) {
+    	    medcwordin[i] = cwordin[x-1];
+    	    medcwordout[i] = cwordout[y-1];
+    	    x--;
+    	    y--;
+    	}
+    	else if (dir == LEV_DOWN) {
+    	    medcwordin[i] = EPSILON;
+    	    medcwordout[i] = cwordout[y-1];
+    	    y--;
+    	}
+    	else {
+    	    medcwordin[i] = cwordin[x-1];
+	    medcwordout[i] = EPSILON;
+    	    x--;
+    	}
+    }
+    for (j = 0, i-= 1; i >= 0; j++, i--) {
+    	cwordin[j] = medcwordin[i];
+    	cwordout[j] = medcwordout[i];
+    }
+    cwordin[j] = -1;
+    cwordout[j] = -1;
+}
+
 void lexc_pad() {
     int i, pad;
     /* Pad the shorter of current in, out words in cwordin, cwordout with EPSILON */
-    /* A MED option would be nice here to minimize different symbol pairs */
 
     if (*cwordin == -1 && *cwordout == -1) {
-        *cwordin = *cwordout = EPSILON;
-        *(cwordin+1) = *(cwordout+1) = -1;
-        return;
+	*cwordin = *cwordout = EPSILON;
+	*(cwordin+1) = *(cwordout+1) = -1;
+	return;
     }
 
     for (i=0, pad = 0; ;i++) {
@@ -509,13 +609,13 @@ void lexc_string_to_tokens(char *string, int *intarr) {
     len = strlen(string);
     for (i=0, pos = 0; i < len; ) {
 
-        /* EPSILON for alignment is marked as 0xff */
-        if ((unsigned char) string[i] == 0xff) {
-            *(intarr+pos) = EPSILON;
-            pos++;
-            i++;
-            continue;
-        }
+	/* EPSILON for alignment is marked as 0xff */
+	if ((unsigned char) string[i] == 0xff) {
+	    *(intarr+pos) = EPSILON;
+	    pos++;
+	    i++;
+	    continue;
+	}
 
         multi = 0;
         mchashval = (unsigned int) ((unsigned char) *(string+i)) * 256 + (unsigned int) ((unsigned char) *(string+i+1));
@@ -698,7 +798,15 @@ void lexc_number_states() {
         for (s = statelist; s != NULL; s = s->next) {        
             if (s->next == NULL) {
                 s->state->number = 0;
-                fprintf(stderr, "*Warning: no Root lexicon, using '%s' as Root.\n",s->state->lexstate->name); // HFST changed from stdout to stderr
+#ifdef ORIGINAL 
+                fprintf(stderr,"*Warning: no Root lexicon, using '%s' as Root.\n",s->state->lexstate->name);
+#else
+                if (verbose_lexc_ == 1)
+                  {
+                    fprintf(stderr,"*Warning: no Root lexicon, using '%s' as Root.\n",s->state->lexstate->name);
+                    fflush(stderr);
+                  }
+#endif
                 s->start = 1;
                 n++;
             }
@@ -711,9 +819,9 @@ void lexc_number_states() {
             s->final = 1;
             hasfinal = 1;
         } else if (s->state->lexstate != NULL && strcmp(s->state->lexstate->name, "#") != 0 && s->state->lexstate->has_outgoing == 0) {
-            /* Also mark uncontinued states as final (this is warned about elsewhere) */
+	    /* Also mark uncontinued states as final (this is warned about elsewhere) */
             s->final = 1;
-        }
+	}
     }
 
     for (s = statelist; s != NULL; s = s->next) { 
@@ -725,12 +833,29 @@ void lexc_number_states() {
     lexc_statecount = n+1;
     for (l = lexstates; l != NULL ; l = l->next) {
         if (l->targeted == 0 && l->state->number != 0) {
-	  fprintf(stderr, "*Warning: lexicon '%s' defined but not used\n",l->name);  // HFST changed from stdout to stderr
-            fflush(stderr);
+#ifdef ORIGINAL
+	    fprintf(stderr,"*Warning: lexicon '%s' defined but not used\n",l->name);
+            fflush(stdout);
+#else
+            if (verbose_lexc_) 
+              {
+                fprintf(stderr,"*Warning: lexicon '%s' defined but not used\n",l->name);
+                fflush(stderr);
+              }            
+#endif
         }
         if (l->has_outgoing == 0 && strcmp(l->name, "#") != 0) {
-	  fprintf(stderr, "***Warning: lexicon '%s' used but never defined\n",l->name);  // HFST changed from stdout to stderr
-            fflush(stderr);
+#ifdef ORIGINAL
+	    fprintf(stderr,"***Warning: lexicon '%s' used but never defined\n",l->name);
+            fflush(stdout);
+#else
+            if (verbose_lexc_)
+              {
+            fprintf(stderr,"***Warning: lexicon '%s' used but never defined\n",l->name);
+                fflush(stderr);
+              }
+
+#endif
         }
     }
 }
@@ -890,18 +1015,32 @@ struct fsm *lexc_to_fsm() {
     struct trans *t;
     int i, j,  linecount;
 
-    if (verbose_lexc_ == 1) {
-      fprintf(stderr, "Building lexicon...\n");  // HFST changed from stdout to stderr
-      fflush(stderr);
-    }
+#ifdef ORIGINAL
+    fprintf(stderr,"Building lexicon...\n");
+    fflush(stdout);
+#else
+    if (verbose_lexc_) 
+      {
+        fprintf(stderr,"Building lexicon...\n");
+        fflush(stderr);
+      }
+#endif
     lexc_merge_states();
     net = fsm_create("");
     xxfree(net->sigma);
     net->sigma = lexsigma;
     lexc_number_states();
     if (hasfinal == 0) {
-      fprintf(stderr, "Warning: # is never reached!!!\n");  // HFST changed from stdout to stderr
-      return(fsm_empty_set());
+#ifdef ORIGINAL
+        fprintf(stderr,"Warning: # is never reached!!!\n");
+#else
+        if (verbose_lexc_)
+          {
+            fprintf(stderr,"Warning: # is never reached!!!\n");
+            fflush(stderr);
+          }
+#endif
+        return(fsm_empty_set());
     }
     sa = xxmalloc(sizeof(struct statelist)*lexc_statecount);
     for (s = statelist; s != NULL; s = s->next) {
@@ -938,19 +1077,37 @@ struct fsm *lexc_to_fsm() {
     sigma_cleanup(net,0);
     sigma_sort(net);
     
-    if (verbose_lexc_ == 1) {
-      fprintf(stderr, "Determinizing...\n"); // HFST changed from stdout to stderr
-      fflush(stderr);
-    }
+#ifdef ORIGINAL
+    fprintf(stderr,"Determinizing...\n");
+    fflush(stdout);
+#else
+    if (verbose_lexc_)
+      {
+        fprintf(stderr,"Determinizing...\n");
+        fflush(stderr);
+      }
+#endif
     net = fsm_determinize(net);
-    if (verbose_lexc_ == 1) {
-      fprintf(stderr, "Minimizing...\n"); // HFST changed from stdout to stderr
-      fflush(stderr);
-    }
+#ifdef ORIGINAL
+    fprintf(stderr,"Minimizing...\n");
+    fflush(stdout);
+#else
+    if (verbose_lexc_)
+      {
+        fprintf(stderr,"Minimizing...\n");
+        fflush(stderr);
+      }
+#endif
     net = fsm_topsort(fsm_minimize(net));
-    if (verbose_lexc_ == 1) {
-      fprintf(stderr, "Done!\n"); // HFST changed from stdout to stderr
-    }
+#ifdef ORIGINAL
+    fprintf(stderr,"Done!\n");
+#else
+    if (verbose_lexc_)
+      {
+        fprintf(stderr,"Done!\n");
+        fflush(stderr);
+      }
+#endif
     return(net);
 }
 
@@ -975,7 +1132,7 @@ void lexc_cleanup() {
     xxfree(hashtable);
     for (mcs = mc ; mcs != NULL ; mcs = mcsn) {
         mcsn = mcs->next;
-        xxfree(mcs->symbol);
+	xxfree(mcs->symbol);
         xxfree(mcs);
     }
     for (l = lexstates ; l != NULL ; l = ln) {
diff --git a/back-ends/foma/mem.c b/back-ends/foma/mem.c
index 4087ead..02ac396 100644
--- a/back-ends/foma/mem.c
+++ b/back-ends/foma/mem.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -20,6 +20,9 @@
 #include <string.h>
 
 /* Global variables */
+// HFST MODIFICATIONS: Defined here, declared extern in foma.h
+struct defined_networks   *g_defines;
+struct defined_functions  *g_defines_f;
 int g_show_flags = 0;
 int g_obey_flags = 1;
 int g_flag_is_epsilon = 0;
@@ -39,6 +42,7 @@ int g_list_limit = 100;
 int g_list_random_limit = 15;
 int g_med_limit  = 3;
 int g_med_cutoff = 15;
+int g_lexc_align = 0;
 char *g_att_epsilon = "@0@";
 
 char *xxstrndup(const char *s, size_t n) {
diff --git a/back-ends/foma/minimize.c b/back-ends/foma/minimize.c
index 6032337..20e5df4 100644
--- a/back-ends/foma/minimize.c
+++ b/back-ends/foma/minimize.c
@@ -66,18 +66,21 @@ struct agenda {
   _Bool index;
 };
 
-struct trans_list_ {
+// HFST MODIFICATIONS: struct trans_list -> struct trans_list_struct
+//                     struct trans_array -> struct trans_list_array
+// because some compilers complain about struct and variable having the same name
+
+static struct trans_list_struct {
     int inout;
     int source;
-} *trans_list_;
+} *trans_list;
+
 
-struct trans_array_ {
-    struct trans_list_ *transitions;
+static struct trans_array_struct {
+    struct trans_list_struct *transitions;
     unsigned int size;
     unsigned int tail;
-} *trans_array_;
-
-
+} *trans_array;
 
 static struct p *P, *Phead, *Pnext, *current_w;
 static struct e *E;
@@ -119,15 +122,15 @@ static struct fsm *fsm_minimize_brz(struct fsm *net) {
 static struct fsm *fsm_minimize_hop(struct fsm *net) {
 
     struct e *temp_E;
-    struct trans_array_ *tptr;
-    struct trans_list_ *transitions;
+    struct trans_array_struct *tptr;
+    struct trans_list_struct *transitions;
     int i,j,minsym,next_minsym,current_i, stateno, thissize, source;  
     unsigned int tail;
 
     fsm_count(net);
     if (net->finalcount == 0)  {
-        fsm_destroy(net);
-        return(fsm_empty_set());
+	fsm_destroy(net);
+	return(fsm_empty_set());
     }
 
     num_states = net->statecount;
@@ -174,7 +177,7 @@ static struct fsm *fsm_minimize_hop(struct fsm *net) {
             stateno = temp_E - E;
             *(temp_group+thissize) = stateno;
             thissize++;
-            tptr = trans_array_+stateno;
+            tptr = trans_array+stateno;
             /* Clear tails if symloop should start from 0 */
             if (current_i == 0)
                 tptr->tail = 0;
@@ -190,7 +193,7 @@ static struct fsm *fsm_minimize_hop(struct fsm *net) {
 
             /* Add states to temp_move */
             for (i = 0, j = 0; i < thissize; i++) {
-                tptr = trans_array_+*(temp_group+i);
+                tptr = trans_array+*(temp_group+i);
                 tail = tptr->tail;
                 transitions = (tptr->transitions)+tail;
                 while (tail < tptr->size && transitions->inout == minsym) {
@@ -223,8 +226,8 @@ static struct fsm *fsm_minimize_hop(struct fsm *net) {
 
     net = rebuild_machine(net);
 
-    xxfree(trans_array_);
-    xxfree(trans_list_);
+    xxfree(trans_array);
+    xxfree(trans_list);
 
  bail:
     
@@ -276,11 +279,11 @@ static struct fsm *rebuild_machine(struct fsm *net) {
     if (thise->group->first_e == thise) {
       new_linecount++;
       if ((fsm+i)->start_state == 1) {
-        thise->group->t_count = 0;
-        thise->group->count = 1;
+	thise->group->t_count = 0;
+	thise->group->count = 1;
       } else if (thise->group->count == 0) {
-        thise->group->t_count = group_num++;
-        thise->group->count = 1;
+	thise->group->t_count = group_num++;
+	thise->group->count = 1;
       }
     }
   }
@@ -529,18 +532,18 @@ static void init_PE() {
       (E+i)->group = FP;
       (E+i)->left = last_f;
       if (i > 0 && last_f != NULL)
-        last_f->right = (E+i);
+	last_f->right = (E+i);
       if (last_f == NULL)
-        FP->first_e = (E+i);
+	FP->first_e = (E+i);
       last_f = (E+i);
       FP->last_e = (E+i);
     } else {
       (E+i)->group = nonFP;
       (E+i)->left = last_nonf;
       if (i > 0 && last_nonf != NULL)
-        last_nonf->right = (E+i);
+	last_nonf->right = (E+i);
       if (last_nonf == NULL)
-        nonFP->first_e = (E+i);
+	nonFP->first_e = (E+i);
       last_nonf = (E+i);
       nonFP->last_e = (E+i);
     }
@@ -554,19 +557,19 @@ static void init_PE() {
 }
 
 static int trans_sort_cmp(const void *a, const void *b) {
-  return (((const struct trans_list_ *)a)->inout - ((const struct trans_list_ *)b)->inout);
+  return (((const struct trans_list_struct *)a)->inout - ((const struct trans_list_struct *)b)->inout);
 }
 
 static void generate_inverse(struct fsm *net) {
     
     struct fsm_state *fsm;
-    struct trans_array_ *tptr;
-    struct trans_list_ *listptr;
+    struct trans_array_struct *tptr;
+    struct trans_list_struct *listptr;
 
     int i, source, target, offsetcount, symbol, size;
     fsm = net->states;
-    trans_array_ = xxcalloc(net->statecount, sizeof(struct trans_array_));
-    trans_list_ = xxcalloc(net->arccount, sizeof(struct trans_list_));
+    trans_array = xxcalloc(net->statecount, sizeof(struct trans_array_struct));
+    trans_list = xxcalloc(net->arccount, sizeof(struct trans_list_struct));
 
     /* Figure out the number of transitions each one has */
     for (i=0; (fsm+i)->state_no != -1; i++) {
@@ -576,12 +579,12 @@ static void generate_inverse(struct fsm *net) {
         target = (fsm+i)->target;
         (E+target)->inv_count++;
         (E+target)->group->inv_count++;
-        (trans_array_+target)->size++;
+        (trans_array+target)->size++;
     }
     offsetcount = 0;
     for (i=0; i < net->statecount; i++) {
-        (trans_array_+i)->transitions = trans_list_ + offsetcount;
-        offsetcount += (trans_array_+i)->size;
+        (trans_array+i)->transitions = trans_list + offsetcount;
+        offsetcount += (trans_array+i)->size;
     }
     for (i=0; (fsm+i)->state_no != -1; i++) {
         if ((fsm+i)->target == -1) {
@@ -590,17 +593,17 @@ static void generate_inverse(struct fsm *net) {
         symbol = symbol_pair_to_single_symbol((fsm+i)->in,(fsm+i)->out);        
         source = (fsm+i)->state_no;
         target = (fsm+i)->target;
-        tptr = trans_array_ + target;
+        tptr = trans_array + target;
         ((tptr->transitions)+(tptr->tail))->inout = symbol;
         ((tptr->transitions)+(tptr->tail))->source = source;
         tptr->tail++;
     }
     /* Sort arcs */
     for (i=0; i < net->statecount; i++) {
-        listptr = (trans_array_+i)->transitions;
-        size = (trans_array_+i)->size;
+        listptr = (trans_array+i)->transitions;
+        size = (trans_array+i)->size;
         if (size > 1)
-            qsort(listptr, size, sizeof(struct trans_list_), trans_sort_cmp);
+            qsort(listptr, size, sizeof(struct trans_list_struct), trans_sort_cmp);
     }
 }
 
@@ -660,7 +663,7 @@ static void sigma_to_pairs(struct fsm *net) {
       *(single_sigma_array+next_x) = z;
       next_x++;
       if (y == EPSILON && z == EPSILON) {
-        epsilon_symbol = x;
+	epsilon_symbol = x;
       }
       x++;
     }
diff --git a/back-ends/foma/regex.c b/back-ends/foma/regex.c
index 0ec3d4e..4606c96 100644
--- a/back-ends/foma/regex.c
+++ b/back-ends/foma/regex.c
@@ -1,24 +1,21 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+/* Bison implementation for Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +26,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -47,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.5"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -55,187 +52,20 @@
 /* Pure parsers.  */
 #define YYPURE 1
 
-/* Using locations.  */
-#define YYLSP_NEEDED 1
-
+/* Push parsers.  */
+#define YYPUSH 0
 
+/* Pull parsers.  */
+#define YYPULL 1
 
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     NET = 258,
-     END = 259,
-     LBRACKET = 260,
-     RBRACKET = 261,
-     LPAREN = 262,
-     RPAREN = 263,
-     ENDM = 264,
-     ENDD = 265,
-     CRESTRICT = 266,
-     CONTAINS = 267,
-     CONTAINS_OPT_ONE = 268,
-     CONTAINS_ONE = 269,
-     XUPPER = 270,
-     XLOWER = 271,
-     FLAG_ELIMINATE = 272,
-     IGNORE_ALL = 273,
-     IGNORE_INTERNAL = 274,
-     CONTEXT = 275,
-     NCONCAT = 276,
-     MNCONCAT = 277,
-     MORENCONCAT = 278,
-     LESSNCONCAT = 279,
-     DOUBLE_COMMA = 280,
-     COMMA = 281,
-     SHUFFLE = 282,
-     PRECEDES = 283,
-     FOLLOWS = 284,
-     RIGHT_QUOTIENT = 285,
-     LEFT_QUOTIENT = 286,
-     INTERLEAVE_QUOTIENT = 287,
-     UQUANT = 288,
-     EQUANT = 289,
-     VAR = 290,
-     IN = 291,
-     IMPLIES = 292,
-     BICOND = 293,
-     EQUALS = 294,
-     NEQ = 295,
-     SUBSTITUTE = 296,
-     SUCCESSOR_OF = 297,
-     PRIORITY_UNION_U = 298,
-     PRIORITY_UNION_L = 299,
-     LENIENT_COMPOSE = 300,
-     TRIPLE_DOT = 301,
-     LDOT = 302,
-     RDOT = 303,
-     FUNCTION = 304,
-     SUBVAL = 305,
-     ISUNAMBIGUOUS = 306,
-     ISIDENTITY = 307,
-     ISFUNCTIONAL = 308,
-     NOTID = 309,
-     LOWERUNIQ = 310,
-     LOWERUNIQEPS = 311,
-     ALLFINAL = 312,
-     UNAMBIGUOUSPART = 313,
-     AMBIGUOUSPART = 314,
-     AMBIGUOUSDOMAIN = 315,
-     EQSUBSTRINGS = 316,
-     LETTERMACHINE = 317,
-     MARKFSMTAIL = 318,
-     MARKFSMTAILLOOP = 319,
-     MARKFSMMIDLOOP = 320,
-     MARKFSMLOOP = 321,
-     ADDSINK = 322,
-     LEFTREWR = 323,
-     FLATTEN = 324,
-     ARROW = 325,
-     DIRECTION = 326,
-     HIGH_CROSS_PRODUCT = 327,
-     CROSS_PRODUCT = 328,
-     COMPOSE = 329,
-     MINUS = 330,
-     INTERSECT = 331,
-     UNION = 332,
-     COMPLEMENT = 333,
-     INVERSE = 334,
-     REVERSE = 335,
-     KLEENE_PLUS = 336,
-     KLEENE_STAR = 337,
-     TERM_NEGATION = 338
-   };
-#endif
-/* Tokens.  */
-#define NET 258
-#define END 259
-#define LBRACKET 260
-#define RBRACKET 261
-#define LPAREN 262
-#define RPAREN 263
-#define ENDM 264
-#define ENDD 265
-#define CRESTRICT 266
-#define CONTAINS 267
-#define CONTAINS_OPT_ONE 268
-#define CONTAINS_ONE 269
-#define XUPPER 270
-#define XLOWER 271
-#define FLAG_ELIMINATE 272
-#define IGNORE_ALL 273
-#define IGNORE_INTERNAL 274
-#define CONTEXT 275
-#define NCONCAT 276
-#define MNCONCAT 277
-#define MORENCONCAT 278
-#define LESSNCONCAT 279
-#define DOUBLE_COMMA 280
-#define COMMA 281
-#define SHUFFLE 282
-#define PRECEDES 283
-#define FOLLOWS 284
-#define RIGHT_QUOTIENT 285
-#define LEFT_QUOTIENT 286
-#define INTERLEAVE_QUOTIENT 287
-#define UQUANT 288
-#define EQUANT 289
-#define VAR 290
-#define IN 291
-#define IMPLIES 292
-#define BICOND 293
-#define EQUALS 294
-#define NEQ 295
-#define SUBSTITUTE 296
-#define SUCCESSOR_OF 297
-#define PRIORITY_UNION_U 298
-#define PRIORITY_UNION_L 299
-#define LENIENT_COMPOSE 300
-#define TRIPLE_DOT 301
-#define LDOT 302
-#define RDOT 303
-#define FUNCTION 304
-#define SUBVAL 305
-#define ISUNAMBIGUOUS 306
-#define ISIDENTITY 307
-#define ISFUNCTIONAL 308
-#define NOTID 309
-#define LOWERUNIQ 310
-#define LOWERUNIQEPS 311
-#define ALLFINAL 312
-#define UNAMBIGUOUSPART 313
-#define AMBIGUOUSPART 314
-#define AMBIGUOUSDOMAIN 315
-#define EQSUBSTRINGS 316
-#define LETTERMACHINE 317
-#define MARKFSMTAIL 318
-#define MARKFSMTAILLOOP 319
-#define MARKFSMMIDLOOP 320
-#define MARKFSMLOOP 321
-#define ADDSINK 322
-#define LEFTREWR 323
-#define FLATTEN 324
-#define ARROW 325
-#define DIRECTION 326
-#define HIGH_CROSS_PRODUCT 327
-#define CROSS_PRODUCT 328
-#define COMPOSE 329
-#define MINUS 330
-#define INTERSECT 331
-#define UNION 332
-#define COMPLEMENT 333
-#define INVERSE 334
-#define REVERSE 335
-#define KLEENE_PLUS 336
-#define KLEENE_STAR 337
-#define TERM_NEGATION 338
-
+/* Using locations.  */
+#define YYLSP_NEEDED 1
 
 
 
 /* Copy the first part of user declarations.  */
+
+/* Line 268 of yacc.c  */
 #line 18 "regex.y"
 
 #include <stdio.h>
@@ -245,7 +75,7 @@
 #define MAX_F_RECURSION 100
 extern int yyerror();
 extern int yylex();
-extern int my_yyparse(char *my_string);
+extern int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 struct fsm *current_parse;
 int rewrite, rule_direction;
 int substituting = 0;
@@ -274,15 +104,14 @@ void declare_function_name(char *s) {
     xxfree(s);
 }
 
-struct fsm *function_apply(void) {
+struct fsm *function_apply(struct defined_networks *defined_nets, struct defined_functions *defined_funcs) {
     int i, mygsym, myfargptr;
     char *regex;
     char repstr[13], oldstr[13];
-    if ((regex = find_defined_function(fname[frec],fargptr[frec])) == NULL) {
-        printf("***Error: function %s@%i) not defined!\n",fname[frec], fargptr[frec]);
+    if ((regex = find_defined_function(defined_funcs, fname[frec],fargptr[frec])) == NULL) {
+        fprintf(stderr, "***Error: function %s@%i) not defined!\n",fname[frec], fargptr[frec]);
         return NULL;
     }
-
     regex = xxstrdup(regex);
     mygsym = g_internal_sym;
     myfargptr = fargptr[frec];
@@ -290,19 +119,18 @@ struct fsm *function_apply(void) {
     /* and parse that */
     for (i = 0; i < fargptr[frec]; i++) {
         sprintf(repstr,"%012X",g_internal_sym);
-        sprintf(oldstr, "@ARGUMENT%02i@", (i+1));       
+        sprintf(oldstr, "@ARGUMENT%02i@", (i+1));
         streqrep(regex, oldstr, repstr);
         /* We temporarily define a network and save argument there */
         /* The name is a running counter g_internal_sym */
-        add_defined(fargs[i][frec], repstr);
+        add_defined(defined_nets, fargs[i][frec], repstr);
         g_internal_sym++;
     }
-    
-    my_yyparse(regex);
+    my_yyparse(regex,1,defined_nets, defined_funcs);
     for (i = 0; i < myfargptr; i++) {
         sprintf(repstr,"%012X",mygsym);
         /* Remove the temporarily defined network */
-        remove_defined(repstr);
+        remove_defined(defined_nets, repstr);
         mygsym++;
     }
     xxfree(fname[frec]);
@@ -407,9 +235,12 @@ void add_rule(struct fsm *L, struct fsm *R, struct fsm *R2, int type) {
 
 
 
+/* Line 268 of yacc.c  */
+#line 240 "regex.c"
+
 /* Enabling traces.  */
 #ifndef YYDEBUG
-# define YYDEBUG 1
+# define YYDEBUG 0
 #endif
 
 /* Enabling verbose error messages.  */
@@ -425,20 +256,121 @@ void add_rule(struct fsm *L, struct fsm *R, struct fsm *R2, int type) {
 # define YYTOKEN_TABLE 0
 #endif
 
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     NET = 258,
+     END = 259,
+     LBRACKET = 260,
+     RBRACKET = 261,
+     LPAREN = 262,
+     RPAREN = 263,
+     ENDM = 264,
+     ENDD = 265,
+     CRESTRICT = 266,
+     CONTAINS = 267,
+     CONTAINS_OPT_ONE = 268,
+     CONTAINS_ONE = 269,
+     XUPPER = 270,
+     XLOWER = 271,
+     FLAG_ELIMINATE = 272,
+     IGNORE_ALL = 273,
+     IGNORE_INTERNAL = 274,
+     CONTEXT = 275,
+     NCONCAT = 276,
+     MNCONCAT = 277,
+     MORENCONCAT = 278,
+     LESSNCONCAT = 279,
+     DOUBLE_COMMA = 280,
+     COMMA = 281,
+     SHUFFLE = 282,
+     PRECEDES = 283,
+     FOLLOWS = 284,
+     RIGHT_QUOTIENT = 285,
+     LEFT_QUOTIENT = 286,
+     INTERLEAVE_QUOTIENT = 287,
+     UQUANT = 288,
+     EQUANT = 289,
+     VAR = 290,
+     IN = 291,
+     IMPLIES = 292,
+     BICOND = 293,
+     EQUALS = 294,
+     NEQ = 295,
+     SUBSTITUTE = 296,
+     SUCCESSOR_OF = 297,
+     PRIORITY_UNION_U = 298,
+     PRIORITY_UNION_L = 299,
+     LENIENT_COMPOSE = 300,
+     TRIPLE_DOT = 301,
+     LDOT = 302,
+     RDOT = 303,
+     FUNCTION = 304,
+     SUBVAL = 305,
+     ISUNAMBIGUOUS = 306,
+     ISIDENTITY = 307,
+     ISFUNCTIONAL = 308,
+     NOTID = 309,
+     LOWERUNIQ = 310,
+     LOWERUNIQEPS = 311,
+     ALLFINAL = 312,
+     UNAMBIGUOUSPART = 313,
+     AMBIGUOUSPART = 314,
+     AMBIGUOUSDOMAIN = 315,
+     EQSUBSTRINGS = 316,
+     LETTERMACHINE = 317,
+     MARKFSMTAIL = 318,
+     MARKFSMTAILLOOP = 319,
+     MARKFSMMIDLOOP = 320,
+     MARKFSMLOOP = 321,
+     ADDSINK = 322,
+     LEFTREWR = 323,
+     FLATTEN = 324,
+     SUBLABEL = 325,
+     CLOSESIGMA = 326,
+     CLOSESIGMAUNK = 327,
+     ARROW = 328,
+     DIRECTION = 329,
+     HIGH_CROSS_PRODUCT = 330,
+     CROSS_PRODUCT = 331,
+     COMPOSE = 332,
+     MINUS = 333,
+     INTERSECT = 334,
+     UNION = 335,
+     COMPLEMENT = 336,
+     INVERSE = 337,
+     REVERSE = 338,
+     KLEENE_PLUS = 339,
+     KLEENE_STAR = 340,
+     TERM_NEGATION = 341
+   };
+#endif
+
+
+
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 188 "regex.y"
 {
+
+/* Line 293 of yacc.c  */
+#line 186 "regex.y"
+
      char *string;
      struct fsm *net;
      int  type;
-}
-/* Line 193 of yacc.c.  */
-#line 438 "regex.tab.c"
-	YYSTYPE;
+
+
+
+/* Line 293 of yacc.c  */
+#line 370 "regex.c"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
@@ -458,8 +390,8 @@ typedef struct YYLTYPE
 /* Copy the second part of user declarations.  */
 
 
-/* Line 216 of yacc.c.  */
-#line 463 "regex.tab.c"
+/* Line 343 of yacc.c  */
+#line 395 "regex.c"
 
 #ifdef short
 # undef short
@@ -534,14 +466,14 @@ typedef short int yytype_int16;
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static int
-YYID (int i)
+YYID (int yyi)
 #else
 static int
-YYID (i)
-    int i;
+YYID (yyi)
+    int yyi;
 #endif
 {
-  return i;
+  return yyi;
 }
 #endif
 
@@ -562,11 +494,11 @@ YYID (i)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
 #     endif
 #    endif
 #   endif
@@ -589,24 +521,24 @@ YYID (i)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
 	     && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
 #   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -623,9 +555,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-    YYLTYPE yyls;
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+  YYLTYPE yyls_alloc;
 };
 
 /* The size of the maximum gap between one aligned stack and the next.  */
@@ -637,6 +569,27 @@ union yyalloc
      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
       + 2 * YYSTACK_GAP_MAXIMUM)
 
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
+	Stack = &yyptr->Stack_alloc;					\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
@@ -654,42 +607,25 @@ union yyalloc
       while (YYID (0))
 #  endif
 # endif
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack)					\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack, Stack, yysize);				\
-	Stack = &yyptr->Stack;						\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
-
-#endif
+#endif /* !YYCOPY_NEEDED */
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  99
+#define YYFINAL  105
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   1161
+#define YYLAST   1207
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  84
+#define YYNTOKENS  87
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  23
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  133
+#define YYNRULES  136
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  278
+#define YYNSTATES  291
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   338
+#define YYMAXUTOK   341
 
 #define YYTRANSLATE(YYX)						\
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -730,7 +666,8 @@ static const yytype_uint8 yytranslate[] =
       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
-      75,    76,    77,    78,    79,    80,    81,    82,    83
+      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
+      85,    86
 };
 
 #if YYDEBUG
@@ -750,68 +687,70 @@ static const yytype_uint16 yyprhs[] =
      365,   368,   371,   374,   376,   379,   381,   383,   388,   391,
      395,   399,   405,   411,   417,   420,   425,   430,   432,   436,
      440,   444,   448,   452,   456,   460,   464,   468,   472,   476,
-     482,   488,   494,   500,   504,   510,   516,   524,   528,   531,
-     535,   539,   543,   547
+     482,   488,   494,   500,   504,   510,   516,   524,   528,   532,
+     540,   544,   547,   551,   555,   559,   563
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      85,     0,    -1,    86,    -1,    86,    85,    -1,    87,     4,
-      -1,    88,    -1,    87,    74,    88,    -1,    87,    45,    88,
-      -1,    87,    73,    88,    -1,    89,    -1,    90,    -1,    89,
-      20,    89,    -1,    89,    20,    -1,    89,    20,    26,    89,
-      -1,    20,    -1,    20,    25,    89,    -1,    89,    20,    25,
-      89,    -1,    20,    26,    89,    -1,    20,    89,    -1,    20,
-      89,    26,    89,    -1,    89,    20,    89,    26,    89,    -1,
-      89,    11,    89,    -1,    89,    70,    89,    -1,    89,    70,
-      -1,    47,    89,    48,    70,    89,    -1,    47,    48,    70,
-      89,    -1,    47,    89,    48,    70,    89,    26,    89,    -1,
-      47,    48,    70,    89,    26,    89,    -1,    47,    89,    48,
-      70,    89,    71,    89,    -1,    47,    48,    70,    89,    71,
-      89,    -1,    89,    70,    89,    26,    89,    -1,    89,    70,
-      26,    89,    -1,    89,    70,    89,    71,    89,    -1,    89,
-      70,    71,    89,    -1,    89,    25,    89,    -1,    89,    70,
-      46,    -1,    89,    70,    46,    89,    -1,    89,    70,    89,
-      46,    -1,    89,    70,    89,    46,    89,    -1,    89,    70,
-      89,    46,    89,    26,    89,    -1,    89,    70,    89,    46,
-      26,    89,    -1,    89,    70,    46,    89,    26,    89,    -1,
-      89,    70,    46,    26,    89,    -1,    89,    70,    89,    46,
-      89,    71,    89,    -1,    89,    70,    46,    89,    71,    89,
-      -1,    89,    70,    89,    46,    71,    89,    -1,    89,    70,
-      46,    71,    89,    -1,    91,    -1,    90,    27,    91,    -1,
-      90,    28,    91,    -1,    90,    29,    91,    -1,    92,    -1,
-      93,    -1,    94,    -1,    93,    77,    94,    -1,    93,    43,
-      94,    -1,    93,    44,    94,    -1,    93,    76,    94,    -1,
-      93,    75,    94,    -1,    93,    37,    94,    -1,    93,    38,
-      94,    -1,    95,    -1,    94,    95,    -1,    35,    36,    94,
+      88,     0,    -1,    89,    -1,    89,    88,    -1,    90,     4,
+      -1,    91,    -1,    90,    77,    91,    -1,    90,    45,    91,
+      -1,    90,    76,    91,    -1,    92,    -1,    93,    -1,    92,
+      20,    92,    -1,    92,    20,    -1,    92,    20,    26,    92,
+      -1,    20,    -1,    20,    25,    92,    -1,    92,    20,    25,
+      92,    -1,    20,    26,    92,    -1,    20,    92,    -1,    20,
+      92,    26,    92,    -1,    92,    20,    92,    26,    92,    -1,
+      92,    11,    92,    -1,    92,    73,    92,    -1,    92,    73,
+      -1,    47,    92,    48,    73,    92,    -1,    47,    48,    73,
+      92,    -1,    47,    92,    48,    73,    92,    26,    92,    -1,
+      47,    48,    73,    92,    26,    92,    -1,    47,    92,    48,
+      73,    92,    74,    92,    -1,    47,    48,    73,    92,    74,
+      92,    -1,    92,    73,    92,    26,    92,    -1,    92,    73,
+      26,    92,    -1,    92,    73,    92,    74,    92,    -1,    92,
+      73,    74,    92,    -1,    92,    25,    92,    -1,    92,    73,
+      46,    -1,    92,    73,    46,    92,    -1,    92,    73,    92,
+      46,    -1,    92,    73,    92,    46,    92,    -1,    92,    73,
+      92,    46,    92,    26,    92,    -1,    92,    73,    92,    46,
+      26,    92,    -1,    92,    73,    46,    92,    26,    92,    -1,
+      92,    73,    46,    26,    92,    -1,    92,    73,    92,    46,
+      92,    74,    92,    -1,    92,    73,    46,    92,    74,    92,
+      -1,    92,    73,    92,    46,    74,    92,    -1,    92,    73,
+      46,    74,    92,    -1,    94,    -1,    93,    27,    94,    -1,
+      93,    28,    94,    -1,    93,    29,    94,    -1,    95,    -1,
+      96,    -1,    97,    -1,    96,    80,    97,    -1,    96,    43,
+      97,    -1,    96,    44,    97,    -1,    96,    79,    97,    -1,
+      96,    78,    97,    -1,    96,    37,    97,    -1,    96,    38,
+      97,    -1,    98,    -1,    97,    98,    -1,    35,    36,    97,
       -1,    35,    39,    35,    -1,    35,    40,    35,    -1,    35,
-      28,    35,    -1,    35,    29,    35,    -1,    96,    -1,    95,
-      18,    96,    -1,    95,    19,    96,    -1,    95,    30,    96,
-      -1,    95,    31,    96,    -1,    95,    32,    96,    -1,    97,
-      -1,    78,    96,    -1,    12,    96,    -1,    14,    96,    -1,
-      13,    96,    -1,    98,    -1,    99,    -1,    98,    82,    -1,
-      98,    81,    -1,    98,    80,    -1,    98,    79,    -1,    98,
-      15,    -1,    98,    16,    -1,    98,    17,    -1,    98,    72,
-      99,    -1,    98,    21,    -1,    98,    23,    -1,    98,    24,
-      -1,    98,    22,    -1,   100,    -1,    83,    99,    -1,     3,
-      -1,   103,    -1,    33,     7,    87,     8,    -1,    34,    87,
-      -1,     7,    87,     8,    -1,     5,    87,     6,    -1,    42,
-      35,    26,    35,     8,    -1,    42,    35,    26,    87,     8,
-      -1,    42,    87,    26,    35,     8,    -1,   101,   102,    -1,
-      41,     5,    87,    26,    -1,    50,    26,    50,     6,    -1,
-     106,    -1,    52,    87,     8,    -1,    53,    87,     8,    -1,
-      51,    87,     8,    -1,    54,    87,     8,    -1,    55,    87,
-       8,    -1,    56,    87,     8,    -1,    57,    87,     8,    -1,
-      58,    87,     8,    -1,    59,    87,     8,    -1,    60,    87,
-       8,    -1,    62,    87,     8,    -1,    63,    87,    26,    87,
-       8,    -1,    64,    87,    26,    87,     8,    -1,    65,    87,
-      26,    87,     8,    -1,    66,    87,    26,    87,     8,    -1,
-      67,    87,     8,    -1,    68,    87,    26,    87,     8,    -1,
-      69,    87,    26,    87,     8,    -1,    61,    87,    26,    87,
-      26,    87,     8,    -1,    49,    87,    26,    -1,    49,    87,
-      -1,   104,    87,    26,    -1,   105,    87,    26,    -1,   105,
-      87,     8,    -1,   104,    87,     8,    -1,   104,     8,    -1
+      28,    35,    -1,    35,    29,    35,    -1,    99,    -1,    98,
+      18,    99,    -1,    98,    19,    99,    -1,    98,    30,    99,
+      -1,    98,    31,    99,    -1,    98,    32,    99,    -1,   100,
+      -1,    81,    99,    -1,    12,    99,    -1,    14,    99,    -1,
+      13,    99,    -1,   101,    -1,   102,    -1,   101,    85,    -1,
+     101,    84,    -1,   101,    83,    -1,   101,    82,    -1,   101,
+      15,    -1,   101,    16,    -1,   101,    17,    -1,   101,    75,
+     102,    -1,   101,    21,    -1,   101,    23,    -1,   101,    24,
+      -1,   101,    22,    -1,   103,    -1,    86,   102,    -1,     3,
+      -1,   106,    -1,    33,     7,    90,     8,    -1,    34,    90,
+      -1,     7,    90,     8,    -1,     5,    90,     6,    -1,    42,
+      35,    26,    35,     8,    -1,    42,    35,    26,    90,     8,
+      -1,    42,    90,    26,    35,     8,    -1,   104,   105,    -1,
+      41,     5,    90,    26,    -1,    50,    26,    50,     6,    -1,
+     109,    -1,    52,    90,     8,    -1,    53,    90,     8,    -1,
+      51,    90,     8,    -1,    54,    90,     8,    -1,    55,    90,
+       8,    -1,    56,    90,     8,    -1,    57,    90,     8,    -1,
+      58,    90,     8,    -1,    59,    90,     8,    -1,    60,    90,
+       8,    -1,    62,    90,     8,    -1,    63,    90,    26,    90,
+       8,    -1,    64,    90,    26,    90,     8,    -1,    65,    90,
+      26,    90,     8,    -1,    66,    90,    26,    90,     8,    -1,
+      67,    90,     8,    -1,    68,    90,    26,    90,     8,    -1,
+      69,    90,    26,    90,     8,    -1,    70,    90,    26,    90,
+      26,    90,     8,    -1,    71,    90,     8,    -1,    72,    90,
+       8,    -1,    61,    90,    26,    90,    26,    90,     8,    -1,
+      49,    90,    26,    -1,    49,    90,    -1,   107,    90,    26,
+      -1,   108,    90,    26,    -1,   108,    90,     8,    -1,   107,
+      90,     8,    -1,   107,     8,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@ -829,8 +768,8 @@ static const yytype_uint16 yyrline[] =
      348,   349,   350,   352,   353,   355,   356,   357,   358,   359,
      360,   361,   362,   363,   364,   366,   367,   369,   370,   371,
      372,   373,   374,   375,   376,   377,   378,   379,   380,   381,
-     382,   383,   384,   385,   386,   387,   388,   390,   392,   395,
-     396,   398,   400,   402
+     382,   383,   384,   385,   386,   387,   388,   389,   390,   391,
+     393,   395,   398,   399,   401,   403,   405
 };
 #endif
 
@@ -852,7 +791,8 @@ static const char *const yytname[] =
   "ISFUNCTIONAL", "NOTID", "LOWERUNIQ", "LOWERUNIQEPS", "ALLFINAL",
   "UNAMBIGUOUSPART", "AMBIGUOUSPART", "AMBIGUOUSDOMAIN", "EQSUBSTRINGS",
   "LETTERMACHINE", "MARKFSMTAIL", "MARKFSMTAILLOOP", "MARKFSMMIDLOOP",
-  "MARKFSMLOOP", "ADDSINK", "LEFTREWR", "FLATTEN", "ARROW", "DIRECTION",
+  "MARKFSMLOOP", "ADDSINK", "LEFTREWR", "FLATTEN", "SUBLABEL",
+  "CLOSESIGMA", "CLOSESIGMAUNK", "ARROW", "DIRECTION",
   "HIGH_CROSS_PRODUCT", "CROSS_PRODUCT", "COMPOSE", "MINUS", "INTERSECT",
   "UNION", "COMPLEMENT", "INVERSE", "REVERSE", "KLEENE_PLUS",
   "KLEENE_STAR", "TERM_NEGATION", "$accept", "start", "regex", "network",
@@ -875,27 +815,27 @@ static const yytype_uint16 yytoknum[] =
      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
-     335,   336,   337,   338
+     335,   336,   337,   338,   339,   340,   341
 };
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    84,    85,    85,    86,    87,    87,    87,    87,    88,
-      89,    89,    89,    89,    89,    89,    89,    89,    89,    89,
-      89,    89,    89,    89,    89,    89,    89,    89,    89,    89,
-      89,    89,    89,    89,    89,    89,    89,    89,    89,    89,
-      89,    89,    89,    89,    89,    89,    89,    90,    90,    90,
-      90,    91,    92,    93,    93,    93,    93,    93,    93,    93,
-      93,    94,    94,    94,    94,    94,    94,    94,    95,    95,
-      95,    95,    95,    95,    96,    96,    96,    96,    96,    97,
-      98,    98,    98,    98,    98,    98,    98,    98,    98,    98,
-      98,    98,    98,    99,    99,   100,   100,   100,   100,   100,
-     100,   100,   100,   100,   100,   101,   102,   103,   103,   103,
-     103,   103,   103,   103,   103,   103,   103,   103,   103,   103,
-     103,   103,   103,   103,   103,   103,   103,   104,   104,   105,
-     105,   106,   106,   106
+       0,    87,    88,    88,    89,    90,    90,    90,    90,    91,
+      92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
+      92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
+      92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
+      92,    92,    92,    92,    92,    92,    92,    93,    93,    93,
+      93,    94,    95,    96,    96,    96,    96,    96,    96,    96,
+      96,    97,    97,    97,    97,    97,    97,    97,    98,    98,
+      98,    98,    98,    98,    99,    99,    99,    99,    99,   100,
+     101,   101,   101,   101,   101,   101,   101,   101,   101,   101,
+     101,   101,   101,   102,   102,   103,   103,   103,   103,   103,
+     103,   103,   103,   103,   103,   104,   105,   106,   106,   106,
+     106,   106,   106,   106,   106,   106,   106,   106,   106,   106,
+     106,   106,   106,   106,   106,   106,   106,   106,   106,   106,
+     107,   107,   108,   108,   109,   109,   109
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -913,341 +853,358 @@ static const yytype_uint8 yyr2[] =
        2,     2,     2,     1,     2,     1,     1,     4,     2,     3,
        3,     5,     5,     5,     2,     4,     4,     1,     3,     3,
        3,     3,     3,     3,     3,     3,     3,     3,     3,     5,
-       5,     5,     5,     3,     5,     5,     7,     3,     2,     3,
-       3,     3,     3,     2
+       5,     5,     5,     3,     5,     5,     7,     3,     3,     7,
+       3,     2,     3,     3,     3,     3,     2
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
        0,    95,     0,     0,     0,     0,     0,    14,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     2,     0,     5,
-       9,    10,    47,    51,    52,    53,    61,    68,    74,    79,
-      80,    93,     0,    96,     0,     0,   107,     0,     0,    76,
-      78,    77,     0,     0,    18,     0,    98,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   128,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,    75,    94,     1,
-       3,     4,     0,     0,     0,     0,    12,     0,    23,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,    62,
-       0,     0,     0,     0,     0,    85,    86,    87,    89,    92,
-      90,    91,     0,    84,    83,    82,    81,     0,   104,   133,
-       0,     0,   100,    99,    15,    17,     0,     0,    66,    67,
-      63,    64,    65,     0,     0,     0,     0,     0,   127,   110,
-     108,   109,   111,   112,   113,   114,   115,   116,   117,     0,
-     118,     0,     0,     0,     0,   123,     0,     0,     7,     8,
-       6,    21,     0,     0,    11,    34,     0,    35,     0,    22,
-      48,    49,    50,    59,    60,    55,    56,    58,    57,    54,
-      69,    70,    71,    72,    73,    88,     0,   132,   129,   131,
-     130,    19,    97,   105,     0,     0,     0,    25,     0,     0,
+       2,     0,     5,     9,    10,    47,    51,    52,    53,    61,
+      68,    74,    79,    80,    93,     0,    96,     0,     0,   107,
+       0,     0,    76,    78,    77,     0,     0,    18,     0,    98,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+     131,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,    75,    94,     1,     3,     4,     0,     0,
+       0,     0,    12,     0,    23,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,    62,     0,     0,     0,     0,
+       0,    85,    86,    87,    89,    92,    90,    91,     0,    84,
+      83,    82,    81,     0,   104,   136,     0,     0,   100,    99,
+      15,    17,     0,     0,    66,    67,    63,    64,    65,     0,
+       0,     0,     0,     0,   130,   110,   108,   109,   111,   112,
+     113,   114,   115,   116,   117,     0,   118,     0,     0,     0,
+       0,   123,     0,     0,     0,   127,   128,     7,     8,     6,
+      21,     0,     0,    11,    34,     0,    35,     0,    22,    48,
+      49,    50,    59,    60,    55,    56,    58,    57,    54,    69,
+      70,    71,    72,    73,    88,     0,   135,   132,   134,   133,
+      19,    97,   105,     0,     0,     0,    25,     0,     0,     0,
        0,     0,     0,     0,     0,     0,    16,    13,     0,    31,
        0,     0,    36,    33,     0,    37,     0,     0,   101,   102,
      103,     0,     0,    24,     0,   119,   120,   121,   122,   124,
-     125,    20,    42,    46,     0,     0,    30,     0,     0,    38,
-      32,   106,    27,    29,     0,     0,     0,    41,    44,    40,
-      45,     0,     0,    26,    28,   126,    39,    43
+     125,     0,    20,    42,    46,     0,     0,    30,     0,     0,
+      38,    32,   106,    27,    29,     0,     0,     0,     0,    41,
+      44,    40,    45,     0,     0,    26,    28,   129,   126,    39,
+      43
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
-      -1,    36,    37,    38,    39,    40,    41,    42,    43,    44,
-      45,    46,    47,    48,    49,    50,    51,    52,   138,    53,
-      54,    55,    56
+      -1,    39,    40,    41,    42,    43,    44,    45,    46,    47,
+      48,    49,    50,    51,    52,    53,    54,    55,   144,    56,
+      57,    58,    59
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -46
+#define YYPACT_NINF -42
 static const yytype_int16 yypact[] =
 {
-     718,   -46,   718,   718,   986,   986,   986,   316,     0,   718,
-     909,     5,   785,   584,   718,   718,   718,   718,   718,   718,
-     718,   718,   718,   718,   718,   718,   718,   718,   718,   718,
-     718,   718,   718,   718,   986,  1026,     9,   718,     4,   -46,
-       1,    35,   -46,   -46,  1084,   986,   188,   -46,   -46,    36,
-     -46,   -46,   -37,   -46,   651,   718,   -46,    16,    20,   -46,
-     -46,   -46,   718,   718,   206,   718,    40,   -19,   -16,   919,
-     -15,   -12,   718,   -25,    50,   -45,   609,   453,    60,    67,
-      84,    98,   120,   122,   129,   140,   165,   170,   654,   197,
-     721,   788,   855,   921,   200,   989,  1071,   -46,   -46,   -46,
-     -46,   -46,   718,   718,   718,   718,   383,   718,   249,   919,
-     919,   919,   919,   919,   919,   919,   919,   919,   919,   188,
-     986,   986,   986,   986,   986,   -46,   -46,   -46,   -46,   -46,
-     -46,   -46,  1026,   -46,   -46,   -46,   -46,    24,   -46,   -46,
-      46,    58,   -46,   -46,     1,     1,   718,   204,   -46,   -46,
-     986,   -46,   -46,  1073,   852,    32,   718,     3,   -46,   -46,
-     -46,   -46,   -46,   -46,   -46,   -46,   -46,   -46,   -46,   718,
-     -46,   718,   718,   718,   718,   -46,   718,   718,   -46,   -46,
-     -46,     1,   718,   718,   602,     1,   718,   450,   718,  1085,
-     -46,   -46,   -46,   986,   986,   986,   986,   986,   986,   986,
-     -46,   -46,   -46,   -46,   -46,   -46,    29,   -46,   -46,   -46,
-     -46,     1,   -46,   -46,   982,   252,    66,   470,   718,  1075,
-     279,   286,   346,   348,   353,   415,     1,     1,   718,     1,
-     718,   718,   535,     1,   718,   517,   718,    80,   -46,   -46,
-     -46,   718,   718,   537,   718,   -46,   -46,   -46,   -46,   -46,
-     -46,     1,     1,     1,   718,   718,     1,   718,   718,   590,
-       1,   -46,     1,     1,   718,   718,   420,     1,     1,     1,
-       1,   718,   718,     1,     1,   -46,     1,     1
+     750,   -42,   750,   750,    68,    68,    68,   330,     2,   750,
+     207,     5,   820,   610,   750,   750,   750,   750,   750,   750,
+     750,   750,   750,   750,   750,   750,   750,   750,   750,   750,
+     750,   750,   750,   750,   750,   750,   750,    68,  1001,    12,
+     750,     0,   -42,   133,    60,   -42,   -42,  1127,    68,   413,
+     -42,   -42,   200,   -42,   -42,   -12,   -42,   680,   750,   -42,
+      66,   142,   -42,   -42,   -42,   750,   750,    43,   750,   -40,
+       8,     9,   960,    15,    20,   750,    13,   333,   -33,  1090,
+     403,   152,   263,   291,   361,   431,   501,   571,   641,   711,
+     781,   473,   851,   543,   683,   753,   823,   921,  1057,  1066,
+    1069,   962,  1002,   -42,   -42,   -42,   -42,   -42,   750,   750,
+     750,   750,   400,   750,   260,   960,   960,   960,   960,   960,
+     960,   960,   960,   960,   960,   413,    68,    68,    68,    68,
+      68,   -42,   -42,   -42,   -42,   -42,   -42,   -42,  1001,   -42,
+     -42,   -42,   -42,    35,   -42,   -42,   149,   165,   -42,   -42,
+     133,   133,   750,  1029,   -42,   -42,    68,   -42,   -42,  1073,
+     890,    27,   750,    -9,   -42,   -42,   -42,   -42,   -42,   -42,
+     -42,   -42,   -42,   -42,   -42,   750,   -42,   750,   750,   750,
+     750,   -42,   750,   750,   750,   -42,   -42,   -42,   -42,   -42,
+     133,   750,   750,   350,   133,   750,   470,   750,    40,   -42,
+     -42,   -42,    68,    68,    68,    68,    68,    68,    68,   -42,
+     -42,   -42,   -42,   -42,   -42,    28,   -42,   -42,   -42,   -42,
+     133,   -42,   -42,  1158,  1032,    62,    73,   750,  1096,  1036,
+    1040,  1043,  1076,  1078,  1081,  1099,   133,   133,   750,   133,
+     750,   750,   175,   133,   750,   540,   750,    77,   -42,   -42,
+     -42,   750,   750,   182,   750,   -42,   -42,   -42,   -42,   -42,
+     -42,   750,   133,   133,   133,   750,   750,   133,   750,   750,
+     278,   133,   -42,   133,   133,   750,   750,  1083,  1085,   133,
+     133,   133,   133,   750,   750,   133,   133,   -42,   -42,   133,
+     133
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-     -46,    59,   -46,    15,    23,    -7,   -46,    51,   -46,   -46,
-     627,   -43,    77,   -46,   -46,   -30,   -46,   -46,   -46,   -46,
-     -46,   -46,   -46
+     -42,    45,   -42,    -1,   -18,    -7,   -42,   -21,   -42,   -42,
+     513,   -41,    42,   -42,   -42,   -35,   -42,   -42,   -42,   -42,
+     -42,   -42,   -42
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
 static const yytype_uint16 yytable[] =
 {
-      64,   154,   119,    67,    68,    98,    76,    65,   101,    99,
-      72,    69,   105,   137,    70,    71,   148,    57,    58,   149,
-     151,   106,   142,   152,    66,   156,   107,    74,   143,    77,
-      78,    79,    80,    81,    82,    83,    84,    85,    86,    87,
-      88,    89,    90,    91,    92,    93,    94,    95,    96,   102,
-     206,   125,   126,   127,   207,   144,   145,   128,   129,   130,
-     131,   102,   109,   110,   111,   102,   209,   216,   159,   140,
-     141,   108,   208,   218,   240,   160,   155,   103,   104,   237,
-     147,    59,    60,    61,   210,   102,   261,   153,     0,   103,
-     104,   102,   161,   103,   104,   102,   100,     0,   181,   184,
-     185,   189,   205,   102,     0,   102,   162,   119,   132,     0,
-       0,    97,   102,   103,   104,   133,   134,   135,   136,   103,
-     104,     0,     0,   103,   104,   178,   179,   180,   163,   102,
-     164,   103,   104,   103,   104,     0,     0,   165,     0,   211,
-     103,   104,     0,   102,     0,     0,     0,     0,   166,   217,
-     119,   119,   119,   119,   119,   119,   119,   103,   104,     0,
-     190,   191,   192,     0,     0,   102,     0,   102,     0,   215,
-       0,   103,   104,   167,   102,   226,   227,     0,   168,   229,
-     232,   233,     0,     0,   219,   102,   220,   221,   222,   223,
-       0,   224,   225,   103,   104,   103,   104,   200,   201,   202,
-     203,   204,   103,   104,     0,   170,   120,   121,   175,     0,
-     102,   243,   212,   103,   104,   102,     0,   105,   122,   123,
-     124,   251,     0,   252,   253,     0,   106,   256,   259,   260,
-       0,   107,   146,     0,   262,   263,     0,     0,   103,   104,
-       0,     0,   102,   103,   104,   102,     0,   267,   268,   102,
-     269,   270,     1,     0,     2,     0,     3,   273,   274,   266,
-     239,     4,     5,     6,   276,   277,     0,     0,     0,     7,
-     103,   104,     0,   103,   104,   186,   108,   103,   104,     0,
-       0,     0,     8,     9,    10,     0,     0,   245,     0,     0,
-      11,    12,     0,     0,   246,   187,    13,   102,    14,     0,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,     1,
-     188,     2,     0,     3,   102,   103,   104,    34,     4,     5,
-       6,   102,    35,     0,     0,     0,     7,     0,     0,     0,
-       0,    62,    63,     0,     0,     0,     0,     0,     0,     8,
-       9,    10,   103,   104,   247,     0,   248,    11,    12,   103,
-     104,   249,     0,    13,     0,    14,     0,    15,    16,    17,
-      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
-      28,    29,    30,    31,    32,    33,     1,     0,     2,     0,
-       3,   102,     0,   102,    34,     4,     5,     6,   102,    35,
-       0,     0,     0,     7,     0,     0,     0,     0,   182,   183,
-       0,     0,     0,     0,     0,     0,     8,     9,    10,   103,
-     104,   103,   104,   250,    11,    12,   103,   104,   275,     0,
-      13,     0,    14,     0,    15,    16,    17,    18,    19,    20,
-      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
-      31,    32,    33,     1,     0,     2,     0,     3,     0,     0,
-     102,    34,     4,     5,     6,   102,    35,     0,     0,     0,
-       7,     0,     0,     0,     0,     0,   230,     0,     0,   158,
-       0,   105,     0,     8,     9,    10,     0,     0,   103,   104,
-     106,    11,    12,   103,   104,   107,   241,    13,   102,    14,
+      67,    60,    61,   104,   107,   108,    79,   125,    69,    68,
+      75,    77,   105,    80,    81,    82,    83,    84,    85,    86,
+      87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
+      97,    98,    99,   100,   101,   102,   109,   110,   143,   160,
+     162,    70,    71,   154,   155,   108,    62,    63,    64,    72,
+     157,   111,    73,    74,   111,   158,   146,   147,   150,   151,
+     112,   215,   225,   112,   227,   113,   244,   153,   113,   152,
+     250,     1,   148,     2,   159,     3,   109,   110,   247,   103,
+       4,     5,     6,   272,   111,   106,   245,   115,   116,   117,
+     187,   188,   189,   112,   199,   200,   201,     0,   113,   251,
+       0,     8,     9,   214,   190,   193,   194,   198,     0,    11,
+      12,   108,     0,   114,   246,   125,   114,    14,     0,    15,
+      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
+      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
+      36,     0,   109,   110,   111,   220,   114,   252,     0,    37,
+     149,     0,     0,   112,    38,   226,     0,   216,   113,   224,
+     165,   125,   125,   125,   125,   125,   125,   125,   209,   210,
+     211,   212,   213,   218,   228,   217,   229,   230,   231,   232,
+       0,   233,   234,   235,   236,   237,   111,   108,   239,   242,
+     243,   219,     0,   111,   108,   112,     0,   108,     0,     0,
+     113,   265,   112,     0,     0,     0,   114,   113,   275,     0,
+     108,     0,     0,     0,     0,   131,   132,   133,   109,   110,
+     253,   134,   135,   136,   137,   109,   110,     0,   109,   110,
+       0,   262,     0,   263,   264,    70,    71,   267,   270,   271,
+       0,   109,   110,    72,   273,   274,    73,    74,   114,   266,
+       0,     0,     0,   277,     0,   114,   276,     0,   279,   280,
+     278,   281,   282,     1,     0,     2,     0,     3,   285,   286,
+       0,   166,     4,     5,     6,   138,   289,   290,     0,     0,
+       7,     0,   139,   140,   141,   142,   195,     0,     0,   111,
+       0,     0,     0,     8,     9,    10,     0,     0,   112,   167,
+       0,    11,    12,   113,   283,     0,   196,    13,   108,    14,
        0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
       24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
-       1,   231,     2,     0,     3,     0,   103,   104,    34,     4,
-       5,     6,     0,    35,     0,     0,     0,     7,     0,     0,
-     108,   242,     0,   257,     0,     0,   105,     0,   105,     0,
-       8,     9,    10,     0,     0,   106,     0,   106,    11,    12,
-     107,   254,   107,   264,    13,     0,    14,     0,    15,    16,
-      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-      27,    28,    29,    30,    31,    32,    33,     1,   258,     2,
-       0,     3,     0,     0,     0,    34,     4,     5,     6,     0,
-      35,   105,     0,     0,     7,   108,   255,   108,   265,     0,
-     106,     0,     0,   105,     0,   107,   271,     8,     9,    10,
-     105,     0,   106,     0,     0,    11,    12,   107,   228,   106,
-       0,    13,    75,    14,   107,    15,    16,    17,    18,    19,
-      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
-      30,    31,    32,    33,     1,     0,     2,   157,     3,   139,
-     108,   272,    34,     4,     5,     6,     0,    35,     0,     0,
-       0,     7,   108,     0,     0,     0,     0,     0,     0,   108,
-     169,     0,     0,     0,     8,     9,    10,     0,     0,     0,
-       0,     0,    11,    12,     0,     0,   150,     0,    13,   102,
-      14,     0,    15,    16,    17,    18,    19,    20,    21,    22,
+      34,    35,    36,     1,   197,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,   114,   284,     0,     0,    65,    66,     0,     0,   161,
+       0,   111,     0,     8,     9,    10,     0,   109,   110,   168,
+     112,    11,    12,     0,     0,   113,   238,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,   114,     0,   191,   192,     0,     0,   164,
+       0,   126,   127,     8,     9,    10,     0,   109,   110,   169,
+       0,    11,    12,   128,   129,   130,     0,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,     0,     0,     0,   240,     0,     0,   175,
+       0,     0,     0,     8,     9,    10,     0,   109,   110,   170,
+       0,    11,    12,     0,     0,     0,     0,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,   241,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,     0,     0,     0,   268,     0,     0,   177,
+       0,     0,     0,     8,     9,    10,     0,   109,   110,   171,
+       0,    11,    12,     0,     0,   156,     0,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,   269,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,   202,   203,   204,   205,   206,   207,   208,     0,     0,
+       0,     0,     0,     8,     9,    10,     0,   109,   110,   172,
+       0,    11,    12,     0,     0,     0,     0,    13,    78,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,   145,     0,
+       0,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,     0,     0,     0,     0,     0,     0,   178,
+       0,     0,     0,     8,     9,    10,     0,   109,   110,   173,
+       0,    11,    12,     0,     0,     0,     0,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,     0,     0,     0,     0,     0,     0,   179,
+       0,     0,     0,     8,     9,    10,     0,   109,   110,   174,
+       0,    11,    12,     0,     0,     0,     0,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,     0,     0,     0,     0,     0,     0,   180,
+       0,     0,     0,     8,     9,    76,     0,   109,   110,   176,
+       0,    11,    12,     0,     0,     0,     0,    13,   108,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,     0,   109,
+     110,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       7,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     8,     9,   223,     0,   109,   110,   181,
+       0,    11,    12,     0,     0,     0,     0,    13,     0,    14,
+       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     1,     0,     2,   108,     3,     0,     0,
+     185,    37,     4,     5,     6,     0,    38,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     8,     9,    10,     0,   109,   110,     0,
+       0,    11,    12,     0,     1,     0,     2,   108,     3,    14,
+     186,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    35,    36,     0,     8,     9,     0,   221,   109,   110,
+     249,    37,    11,    12,   255,     0,    38,   108,   256,     0,
+      14,   257,    15,    16,    17,    18,    19,    20,    21,    22,
       23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
-      33,     1,     0,     2,     0,     3,     0,   103,   104,    34,
-       4,     5,     6,     0,    35,     0,     0,     0,     7,   193,
-     194,   195,   196,   197,   198,   199,     0,   171,     0,     0,
-       0,     8,     9,    10,     0,     0,     0,     0,     0,    11,
-      12,     0,     0,     0,     0,    13,   102,    14,     0,    15,
-      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
-      26,    27,    28,    29,    30,    31,    32,    33,     1,     0,
-       2,     0,     3,     0,   103,   104,    34,     4,     5,     6,
-       0,    35,     0,     0,     0,     7,     0,     0,     0,     0,
-       0,     0,     0,     0,   172,     0,     0,     0,     8,     9,
-      73,     0,     0,     0,     0,     0,    11,    12,     0,     0,
-       0,     0,    13,   102,    14,     0,    15,    16,    17,    18,
-      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
-      29,    30,    31,    32,    33,     1,     0,     2,     0,     3,
-       0,   103,   104,    34,     4,     5,     6,     0,    35,     0,
-       0,     0,     7,     0,     0,     0,     0,     0,     0,     0,
-       0,   173,     0,     0,     0,     8,     9,   214,     0,     0,
-       0,     0,     0,    11,    12,     0,     0,     0,     0,    13,
-     102,    14,     0,    15,    16,    17,    18,    19,    20,    21,
-      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
-      32,    33,     1,     0,     2,     0,     3,     0,   103,   104,
-      34,     4,     5,     6,     0,    35,     0,    67,    68,     0,
-       0,     0,     0,     0,     0,    69,     0,   174,    70,    71,
-       0,     0,     8,     9,    10,     0,     0,     0,     0,     0,
-      11,    12,     0,     0,     0,     0,   102,     0,    14,     0,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,     1,
-     238,     2,     0,     3,   103,   104,     0,    34,     4,     5,
-       6,     0,    35,     0,     0,     0,     0,     0,     0,     0,
-      67,    68,     0,     0,     0,   176,     0,     0,    69,     8,
-       9,    70,    71,     0,     0,     0,     0,    11,    12,     1,
-       0,     2,     0,     3,   102,    14,     0,    15,    16,    17,
-      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
-      28,    29,    30,    31,    32,    33,     0,     0,     0,     8,
-       9,     0,   103,   104,    34,     0,     0,    11,    12,    35,
-       0,     0,     0,     0,     0,    14,     0,    15,    16,    17,
-      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
-      28,    29,    30,    31,    32,    33,   105,   177,     0,   213,
-       0,   244,     0,     0,     0,   106,     0,     0,     0,    35,
-     107,   234,     0,     0,     0,     0,   102,     0,   102,     0,
-     102,   112,   113,     0,     0,     0,     0,   114,   115,     0,
-       0,   235,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   103,   104,   103,   104,   103,   104,
-       0,     0,     0,     0,     0,   108,   236,     0,     0,   116,
-     117,   118
+      33,    34,    35,    36,   108,     0,     0,   108,   109,   110,
+       0,   108,     0,   182,   258,   108,   259,    38,   108,   260,
+       0,   287,   183,   288,     0,   184,     0,     0,     0,   222,
+       0,   111,   108,     0,     0,   109,   110,     0,   109,   110,
+     112,   108,   109,   110,   108,   113,   109,   110,   108,   109,
+     110,   108,   254,   108,     0,   261,   108,     0,   108,     0,
+     108,     0,     0,   109,   110,     0,     0,     0,   163,     0,
+       0,   108,   109,   110,   108,   109,   110,     0,     0,   109,
+     110,     0,   109,   110,   109,   110,     0,   109,   110,   109,
+     110,   109,   110,   114,   118,   119,   248,     0,     0,     0,
+     120,   121,   109,   110,     0,   109,   110,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,    70,    71,     0,     0,
+       0,     0,     0,     0,    72,     0,     0,    73,    74,     0,
+       0,     0,     0,     0,     0,   122,   123,   124
 };
 
+#define yypact_value_is_default(yystate) \
+  ((yystate) == (-42))
+
+#define yytable_value_is_error(yytable_value) \
+  YYID (0)
+
 static const yytype_int16 yycheck[] =
 {
-       7,    26,    45,    28,    29,    35,    13,     7,     4,     0,
-       5,    36,    11,    50,    39,    40,    35,     2,     3,    35,
-      35,    20,     6,    35,     9,    70,    25,    12,     8,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,    45,
-      26,    15,    16,    17,     8,    62,    63,    21,    22,    23,
-      24,    45,    27,    28,    29,    45,     8,    35,     8,    54,
-      55,    70,    26,    70,     8,     8,    26,    73,    74,    50,
-      65,     4,     5,     6,    26,    45,     6,    72,    -1,    73,
-      74,    45,     8,    73,    74,    45,    37,    -1,   105,   106,
-     107,   108,   132,    45,    -1,    45,     8,   150,    72,    -1,
-      -1,    34,    45,    73,    74,    79,    80,    81,    82,    73,
-      74,    -1,    -1,    73,    74,   102,   103,   104,     8,    45,
-       8,    73,    74,    73,    74,    -1,    -1,     8,    -1,   146,
-      73,    74,    -1,    45,    -1,    -1,    -1,    -1,     8,   156,
-     193,   194,   195,   196,   197,   198,   199,    73,    74,    -1,
-     109,   110,   111,    -1,    -1,    45,    -1,    45,    -1,   154,
-      -1,    73,    74,     8,    45,   182,   183,    -1,     8,   186,
-     187,   188,    -1,    -1,   169,    45,   171,   172,   173,   174,
-      -1,   176,   177,    73,    74,    73,    74,   120,   121,   122,
-     123,   124,    73,    74,    -1,     8,    18,    19,     8,    -1,
-      45,   218,     8,    73,    74,    45,    -1,    11,    30,    31,
-      32,   228,    -1,   230,   231,    -1,    20,   234,   235,   236,
-      -1,    25,    26,    -1,   241,   242,    -1,    -1,    73,    74,
-      -1,    -1,    45,    73,    74,    45,    -1,   254,   255,    45,
-     257,   258,     3,    -1,     5,    -1,     7,   264,   265,   244,
-       8,    12,    13,    14,   271,   272,    -1,    -1,    -1,    20,
-      73,    74,    -1,    73,    74,    26,    70,    73,    74,    -1,
-      -1,    -1,    33,    34,    35,    -1,    -1,     8,    -1,    -1,
-      41,    42,    -1,    -1,     8,    46,    47,    45,    49,    -1,
-      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
-      61,    62,    63,    64,    65,    66,    67,    68,    69,     3,
-      71,     5,    -1,     7,    45,    73,    74,    78,    12,    13,
-      14,    45,    83,    -1,    -1,    -1,    20,    -1,    -1,    -1,
-      -1,    25,    26,    -1,    -1,    -1,    -1,    -1,    -1,    33,
-      34,    35,    73,    74,     8,    -1,     8,    41,    42,    73,
-      74,     8,    -1,    47,    -1,    49,    -1,    51,    52,    53,
-      54,    55,    56,    57,    58,    59,    60,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,     3,    -1,     5,    -1,
-       7,    45,    -1,    45,    78,    12,    13,    14,    45,    83,
-      -1,    -1,    -1,    20,    -1,    -1,    -1,    -1,    25,    26,
-      -1,    -1,    -1,    -1,    -1,    -1,    33,    34,    35,    73,
-      74,    73,    74,     8,    41,    42,    73,    74,     8,    -1,
-      47,    -1,    49,    -1,    51,    52,    53,    54,    55,    56,
-      57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
-      67,    68,    69,     3,    -1,     5,    -1,     7,    -1,    -1,
-      45,    78,    12,    13,    14,    45,    83,    -1,    -1,    -1,
+       7,     2,     3,    38,     4,    45,    13,    48,     9,     7,
+       5,    12,     0,    14,    15,    16,    17,    18,    19,    20,
+      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    36,    76,    77,    50,    26,
+      73,    28,    29,    35,    35,    45,     4,     5,     6,    36,
+      35,    11,    39,    40,    11,    35,    57,    58,    65,    66,
+      20,    26,    35,    20,    73,    25,    26,    68,    25,    26,
+       8,     3,     6,     5,    75,     7,    76,    77,    50,    37,
+      12,    13,    14,     6,    11,    40,    46,    27,    28,    29,
+     108,   109,   110,    20,   115,   116,   117,    -1,    25,    26,
+      -1,    33,    34,   138,   111,   112,   113,   114,    -1,    41,
+      42,    45,    -1,    73,    74,   156,    73,    49,    -1,    51,
+      52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
+      62,    63,    64,    65,    66,    67,    68,    69,    70,    71,
+      72,    -1,    76,    77,    11,   152,    73,    74,    -1,    81,
+       8,    -1,    -1,    20,    86,   162,    -1,     8,    25,   160,
+       8,   202,   203,   204,   205,   206,   207,   208,   126,   127,
+     128,   129,   130,     8,   175,    26,   177,   178,   179,   180,
+      -1,   182,   183,   184,   191,   192,    11,    45,   195,   196,
+     197,    26,    -1,    11,    45,    20,    -1,    45,    -1,    -1,
+      25,    26,    20,    -1,    -1,    -1,    73,    25,    26,    -1,
+      45,    -1,    -1,    -1,    -1,    15,    16,    17,    76,    77,
+     227,    21,    22,    23,    24,    76,    77,    -1,    76,    77,
+      -1,   238,    -1,   240,   241,    28,    29,   244,   245,   246,
+      -1,    76,    77,    36,   251,   252,    39,    40,    73,    74,
+      -1,    -1,    -1,   254,    -1,    73,    74,    -1,   265,   266,
+     261,   268,   269,     3,    -1,     5,    -1,     7,   275,   276,
+      -1,     8,    12,    13,    14,    75,   283,   284,    -1,    -1,
+      20,    -1,    82,    83,    84,    85,    26,    -1,    -1,    11,
+      -1,    -1,    -1,    33,    34,    35,    -1,    -1,    20,     8,
+      -1,    41,    42,    25,    26,    -1,    46,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    74,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    73,    74,    -1,    -1,    25,    26,    -1,    -1,    26,
+      -1,    11,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      20,    41,    42,    -1,    -1,    25,    26,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    -1,    -1,    73,    -1,    25,    26,    -1,    -1,    26,
+      -1,    18,    19,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    30,    31,    32,    -1,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
       20,    -1,    -1,    -1,    -1,    -1,    26,    -1,    -1,    26,
-      -1,    11,    -1,    33,    34,    35,    -1,    -1,    73,    74,
-      20,    41,    42,    73,    74,    25,    26,    47,    45,    49,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    -1,    -1,    47,    45,    49,
       -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
       60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
-       3,    71,     5,    -1,     7,    -1,    73,    74,    78,    12,
-      13,    14,    -1,    83,    -1,    -1,    -1,    20,    -1,    -1,
-      70,    71,    -1,    26,    -1,    -1,    11,    -1,    11,    -1,
-      33,    34,    35,    -1,    -1,    20,    -1,    20,    41,    42,
-      25,    26,    25,    26,    47,    -1,    49,    -1,    51,    52,
-      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
-      63,    64,    65,    66,    67,    68,    69,     3,    71,     5,
-      -1,     7,    -1,    -1,    -1,    78,    12,    13,    14,    -1,
-      83,    11,    -1,    -1,    20,    70,    71,    70,    71,    -1,
-      20,    -1,    -1,    11,    -1,    25,    26,    33,    34,    35,
-      11,    -1,    20,    -1,    -1,    41,    42,    25,    26,    20,
-      -1,    47,    48,    49,    25,    51,    52,    53,    54,    55,
-      56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
-      66,    67,    68,    69,     3,    -1,     5,    48,     7,     8,
-      70,    71,    78,    12,    13,    14,    -1,    83,    -1,    -1,
-      -1,    20,    70,    -1,    -1,    -1,    -1,    -1,    -1,    70,
-      26,    -1,    -1,    -1,    33,    34,    35,    -1,    -1,    -1,
-      -1,    -1,    41,    42,    -1,    -1,    69,    -1,    47,    45,
-      49,    -1,    51,    52,    53,    54,    55,    56,    57,    58,
+      70,    71,    72,     3,    74,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    -1,    -1,    -1,    -1,    -1,    26,    -1,    -1,    26,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    72,    -1,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    74,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,   118,   119,   120,   121,   122,   123,   124,    -1,    -1,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    -1,    -1,    47,    48,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,     8,    -1,
+      -1,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    26,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    -1,    -1,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    26,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    -1,    -1,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    26,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    -1,    -1,    47,    45,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,    -1,    76,
+      77,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,     8,
+      -1,    41,    42,    -1,    -1,    -1,    -1,    47,    -1,    49,
+      -1,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,     3,    -1,     5,    45,     7,    -1,    -1,
+       8,    81,    12,    13,    14,    -1,    86,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    33,    34,    35,    -1,    76,    77,    -1,
+      -1,    41,    42,    -1,     3,    -1,     5,    45,     7,    49,
+       8,    51,    52,    53,    54,    55,    56,    57,    58,    59,
+      60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+      70,    71,    72,    -1,    33,    34,    -1,     8,    76,    77,
+       8,    81,    41,    42,     8,    -1,    86,    45,     8,    -1,
+      49,     8,    51,    52,    53,    54,    55,    56,    57,    58,
       59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
-      69,     3,    -1,     5,    -1,     7,    -1,    73,    74,    78,
-      12,    13,    14,    -1,    83,    -1,    -1,    -1,    20,   112,
-     113,   114,   115,   116,   117,   118,    -1,    26,    -1,    -1,
-      -1,    33,    34,    35,    -1,    -1,    -1,    -1,    -1,    41,
-      42,    -1,    -1,    -1,    -1,    47,    45,    49,    -1,    51,
-      52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
-      62,    63,    64,    65,    66,    67,    68,    69,     3,    -1,
-       5,    -1,     7,    -1,    73,    74,    78,    12,    13,    14,
-      -1,    83,    -1,    -1,    -1,    20,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    26,    -1,    -1,    -1,    33,    34,
-      35,    -1,    -1,    -1,    -1,    -1,    41,    42,    -1,    -1,
-      -1,    -1,    47,    45,    49,    -1,    51,    52,    53,    54,
-      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
-      65,    66,    67,    68,    69,     3,    -1,     5,    -1,     7,
-      -1,    73,    74,    78,    12,    13,    14,    -1,    83,    -1,
-      -1,    -1,    20,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    26,    -1,    -1,    -1,    33,    34,    35,    -1,    -1,
-      -1,    -1,    -1,    41,    42,    -1,    -1,    -1,    -1,    47,
-      45,    49,    -1,    51,    52,    53,    54,    55,    56,    57,
-      58,    59,    60,    61,    62,    63,    64,    65,    66,    67,
-      68,    69,     3,    -1,     5,    -1,     7,    -1,    73,    74,
-      78,    12,    13,    14,    -1,    83,    -1,    28,    29,    -1,
-      -1,    -1,    -1,    -1,    -1,    36,    -1,    26,    39,    40,
-      -1,    -1,    33,    34,    35,    -1,    -1,    -1,    -1,    -1,
-      41,    42,    -1,    -1,    -1,    -1,    45,    -1,    49,    -1,
-      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
-      61,    62,    63,    64,    65,    66,    67,    68,    69,     3,
-       8,     5,    -1,     7,    73,    74,    -1,    78,    12,    13,
-      14,    -1,    83,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      28,    29,    -1,    -1,    -1,    26,    -1,    -1,    36,    33,
-      34,    39,    40,    -1,    -1,    -1,    -1,    41,    42,     3,
-      -1,     5,    -1,     7,    45,    49,    -1,    51,    52,    53,
-      54,    55,    56,    57,    58,    59,    60,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,    -1,    -1,    -1,    33,
-      34,    -1,    73,    74,    78,    -1,    -1,    41,    42,    83,
-      -1,    -1,    -1,    -1,    -1,    49,    -1,    51,    52,    53,
-      54,    55,    56,    57,    58,    59,    60,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,    11,    26,    -1,    26,
-      -1,    26,    -1,    -1,    -1,    20,    -1,    -1,    -1,    83,
-      25,    26,    -1,    -1,    -1,    -1,    45,    -1,    45,    -1,
-      45,    37,    38,    -1,    -1,    -1,    -1,    43,    44,    -1,
-      -1,    46,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    73,    74,    73,    74,    73,    74,
-      -1,    -1,    -1,    -1,    -1,    70,    71,    -1,    -1,    75,
-      76,    77
+      69,    70,    71,    72,    45,    -1,    -1,    45,    76,    77,
+      -1,    45,    -1,    26,     8,    45,     8,    86,    45,     8,
+      -1,     8,    26,     8,    -1,    26,    -1,    -1,    -1,    26,
+      -1,    11,    45,    -1,    -1,    76,    77,    -1,    76,    77,
+      20,    45,    76,    77,    45,    25,    76,    77,    45,    76,
+      77,    45,    26,    45,    -1,    26,    45,    -1,    45,    -1,
+      45,    -1,    -1,    76,    77,    -1,    -1,    -1,    48,    -1,
+      -1,    45,    76,    77,    45,    76,    77,    -1,    -1,    76,
+      77,    -1,    76,    77,    76,    77,    -1,    76,    77,    76,
+      77,    76,    77,    73,    37,    38,     8,    -1,    -1,    -1,
+      43,    44,    76,    77,    -1,    76,    77,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    28,    29,    -1,    -1,
+      -1,    -1,    -1,    -1,    36,    -1,    -1,    39,    40,    -1,
+      -1,    -1,    -1,    -1,    -1,    78,    79,    80
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1257,31 +1214,33 @@ static const yytype_uint8 yystos[] =
        0,     3,     5,     7,    12,    13,    14,    20,    33,    34,
       35,    41,    42,    47,    49,    51,    52,    53,    54,    55,
       56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
-      66,    67,    68,    69,    78,    83,    85,    86,    87,    88,
+      66,    67,    68,    69,    70,    71,    72,    81,    86,    88,
       89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-      99,   100,   101,   103,   104,   105,   106,    87,    87,    96,
-      96,    96,    25,    26,    89,     7,    87,    28,    29,    36,
-      39,    40,     5,    35,    87,    48,    89,    87,    87,    87,
-      87,    87,    87,    87,    87,    87,    87,    87,    87,    87,
-      87,    87,    87,    87,    87,    87,    87,    96,    99,     0,
-      85,     4,    45,    73,    74,    11,    20,    25,    70,    27,
-      28,    29,    37,    38,    43,    44,    75,    76,    77,    95,
-      18,    19,    30,    31,    32,    15,    16,    17,    21,    22,
-      23,    24,    72,    79,    80,    81,    82,    50,   102,     8,
-      87,    87,     6,     8,    89,    89,    26,    87,    35,    35,
-      94,    35,    35,    87,    26,    26,    70,    48,    26,     8,
-       8,     8,     8,     8,     8,     8,     8,     8,     8,    26,
-       8,    26,    26,    26,    26,     8,    26,    26,    88,    88,
-      88,    89,    25,    26,    89,    89,    26,    46,    71,    89,
-      91,    91,    91,    94,    94,    94,    94,    94,    94,    94,
-      96,    96,    96,    96,    96,    99,    26,     8,    26,     8,
-      26,    89,     8,    26,    35,    87,    35,    89,    70,    87,
-      87,    87,    87,    87,    87,    87,    89,    89,    26,    89,
-      26,    71,    89,    89,    26,    46,    71,    50,     8,     8,
-       8,    26,    71,    89,    26,     8,     8,     8,     8,     8,
-       8,    89,    89,    89,    26,    71,    89,    26,    71,    89,
-      89,     6,    89,    89,    26,    71,    87,    89,    89,    89,
-      89,    26,    71,    89,    89,     8,    89,    89
+      99,   100,   101,   102,   103,   104,   106,   107,   108,   109,
+      90,    90,    99,    99,    99,    25,    26,    92,     7,    90,
+      28,    29,    36,    39,    40,     5,    35,    90,    48,    92,
+      90,    90,    90,    90,    90,    90,    90,    90,    90,    90,
+      90,    90,    90,    90,    90,    90,    90,    90,    90,    90,
+      90,    90,    90,    99,   102,     0,    88,     4,    45,    76,
+      77,    11,    20,    25,    73,    27,    28,    29,    37,    38,
+      43,    44,    78,    79,    80,    98,    18,    19,    30,    31,
+      32,    15,    16,    17,    21,    22,    23,    24,    75,    82,
+      83,    84,    85,    50,   105,     8,    90,    90,     6,     8,
+      92,    92,    26,    90,    35,    35,    97,    35,    35,    90,
+      26,    26,    73,    48,    26,     8,     8,     8,     8,     8,
+       8,     8,     8,     8,     8,    26,     8,    26,    26,    26,
+      26,     8,    26,    26,    26,     8,     8,    91,    91,    91,
+      92,    25,    26,    92,    92,    26,    46,    74,    92,    94,
+      94,    94,    97,    97,    97,    97,    97,    97,    97,    99,
+      99,    99,    99,    99,   102,    26,     8,    26,     8,    26,
+      92,     8,    26,    35,    90,    35,    92,    73,    90,    90,
+      90,    90,    90,    90,    90,    90,    92,    92,    26,    92,
+      26,    74,    92,    92,    26,    46,    74,    50,     8,     8,
+       8,    26,    74,    92,    26,     8,     8,     8,     8,     8,
+       8,    26,    92,    92,    92,    26,    74,    92,    26,    74,
+      92,    92,     6,    92,    92,    26,    74,    90,    90,    92,
+      92,    92,    92,    26,    74,    92,    92,     8,     8,    92,
+      92
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1296,9 +1255,18 @@ static const yytype_uint8 yystos[] =
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
 
 #define YYFAIL		goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -1308,13 +1276,12 @@ do								\
     {								\
       yychar = (Token);						\
       yylval = (Value);						\
-      yytoken = YYTRANSLATE (yychar);				\
       YYPOPSTACK (1);						\
       goto yybackup;						\
     }								\
   else								\
     {								\
-      yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
+      yyerror (&yylloc, scanner, defined_nets, defined_funcs, YY_("syntax error: cannot back up")); \
       YYERROR;							\
     }								\
 while (YYID (0))
@@ -1394,7 +1361,7 @@ do {									  \
     {									  \
       YYFPRINTF (stderr, "%s ", Title);					  \
       yy_symbol_print (stderr,						  \
-		  Type, Value, Location, scanner); \
+		  Type, Value, Location, scanner, defined_nets, defined_funcs); \
       YYFPRINTF (stderr, "\n");						  \
     }									  \
 } while (YYID (0))
@@ -1408,21 +1375,25 @@ do {									  \
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void     *scanner)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, struct defined_networks *defined_nets, struct defined_functions *defined_funcs)
 #else
 static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner, defined_nets, defined_funcs)
     FILE *yyoutput;
     int yytype;
     YYSTYPE const * const yyvaluep;
     YYLTYPE const * const yylocationp;
-    void     *scanner;
+    void *scanner;
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
 #endif
 {
   if (!yyvaluep)
     return;
   YYUSE (yylocationp);
   YYUSE (scanner);
+  YYUSE (defined_nets);
+  YYUSE (defined_funcs);
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
@@ -1444,15 +1415,17 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void     *scanner)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, struct defined_networks *defined_nets, struct defined_functions *defined_funcs)
 #else
 static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
+yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner, defined_nets, defined_funcs)
     FILE *yyoutput;
     int yytype;
     YYSTYPE const * const yyvaluep;
     YYLTYPE const * const yylocationp;
-    void     *scanner;
+    void *scanner;
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
 #endif
 {
   if (yytype < YYNTOKENS)
@@ -1462,7 +1435,7 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
 
   YY_LOCATION_PRINT (yyoutput, *yylocationp);
   YYFPRINTF (yyoutput, ": ");
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner);
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner, defined_nets, defined_funcs);
   YYFPRINTF (yyoutput, ")");
 }
 
@@ -1474,17 +1447,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 #else
 static void
-yy_stack_print (bottom, top)
-    yytype_int16 *bottom;
-    yytype_int16 *top;
+yy_stack_print (yybottom, yytop)
+    yytype_int16 *yybottom;
+    yytype_int16 *yytop;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
   YYFPRINTF (stderr, "\n");
 }
 
@@ -1502,14 +1478,16 @@ do {								\
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void     *scanner)
+yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner, struct defined_networks *defined_nets, struct defined_functions *defined_funcs)
 #else
 static void
-yy_reduce_print (yyvsp, yylsp, yyrule, scanner)
+yy_reduce_print (yyvsp, yylsp, yyrule, scanner, defined_nets, defined_funcs)
     YYSTYPE *yyvsp;
     YYLTYPE *yylsp;
     int yyrule;
-    void     *scanner;
+    void *scanner;
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
 #endif
 {
   int yynrhs = yyr2[yyrule];
@@ -1520,18 +1498,18 @@ yy_reduce_print (yyvsp, yylsp, yyrule, scanner)
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      fprintf (stderr, "   $%d = ", yyi + 1);
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       , &(yylsp[(yyi + 1) - (yynrhs)])		       , scanner);
-      fprintf (stderr, "\n");
+		       , &(yylsp[(yyi + 1) - (yynrhs)])		       , scanner, defined_nets, defined_funcs);
+      YYFPRINTF (stderr, "\n");
     }
 }
 
 # define YY_REDUCE_PRINT(Rule)		\
 do {					\
   if (yydebug)				\
-    yy_reduce_print (yyvsp, yylsp, Rule, scanner); \
+    yy_reduce_print (yyvsp, yylsp, Rule, scanner, defined_nets, defined_funcs); \
 } while (YYID (0))
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
@@ -1561,7 +1539,6 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-

 
 #if YYERROR_VERBOSE
 
@@ -1664,115 +1641,142 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
 
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  YYSIZE_T yysize1;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = 0;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - Assume YYFAIL is not used.  It's too flawed to consider.  See
+       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+       for details.  YYERROR is fine as it does not invoke this
+       function.
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
     {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-	 constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-		    + sizeof yyexpecting - 1
-		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-		       * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-	 YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-	  {
-	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-	      {
-		yycount = 1;
-		yysize = yysize0;
-		yyformat[sizeof yyunexpected - 1] = '\0';
-		break;
-	      }
-	    yyarg[yycount++] = yytname[yyx];
-	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-	    yysize_overflow |= (yysize1 < yysize);
-	    yysize = yysize1;
-	    yyfmt = yystpcpy (yyfmt, yyprefix);
-	    yyprefix = yyor;
-	  }
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+                if (! (yysize <= yysize1
+                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  return 2;
+                yysize = yysize1;
+              }
+        }
+    }
 
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
 
-      if (yysize_overflow)
-	return YYSIZE_MAXIMUM;
+  yysize1 = yysize + yystrlen (yyformat);
+  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    return 2;
+  yysize = yysize1;
 
-      if (yyresult)
-	{
-	  /* Avoid sprintf, as that infringes on the user's name space.
-	     Don't have undefined behavior even if the translation
-	     produced a string with the wrong number of "%s"s.  */
-	  char *yyp = yyresult;
-	  int yyi = 0;
-	  while ((*yyp = *yyf) != '\0')
-	    {
-	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-		{
-		  yyp += yytnamerr (yyp, yyarg[yyi++]);
-		  yyf += 2;
-		}
-	      else
-		{
-		  yyp++;
-		  yyf++;
-		}
-	    }
-	}
-      return yysize;
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
     }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
 }
 #endif /* YYERROR_VERBOSE */
-

 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -1782,20 +1786,24 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void     *scanner)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner, struct defined_networks *defined_nets, struct defined_functions *defined_funcs)
 #else
 static void
-yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner)
+yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner, defined_nets, defined_funcs)
     const char *yymsg;
     int yytype;
     YYSTYPE *yyvaluep;
     YYLTYPE *yylocationp;
-    void     *scanner;
+    void *scanner;
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
 #endif
 {
   YYUSE (yyvaluep);
   YYUSE (yylocationp);
   YYUSE (scanner);
+  YYUSE (defined_nets);
+  YYUSE (defined_funcs);
 
   if (!yymsg)
     yymsg = "Deleting";
@@ -1808,10 +1816,9 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner)
 	break;
     }
 }
-

 
-/* Prevent warnings from -Wmissing-prototypes.  */
 
+/* Prevent warnings from -Wmissing-prototypes.  */
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
@@ -1820,17 +1827,13 @@ int yyparse ();
 #endif
 #else /* ! YYPARSE_PARAM */
 #if defined __STDC__ || defined __cplusplus
-int yyparse (void     *scanner);
+int yyparse (void *scanner, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 #else
 int yyparse ();
 #endif
 #endif /* ! YYPARSE_PARAM */
 
 
-
-
-
-
 /*----------.
 | yyparse.  |
 `----------*/
@@ -1849,100 +1852,112 @@ yyparse (YYPARSE_PARAM)
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 int
-yyparse (void     *scanner)
+yyparse (void *scanner, struct defined_networks *defined_nets, struct defined_functions *defined_funcs)
 #else
 int
-yyparse (scanner)
-    void     *scanner;
+yyparse (scanner, defined_nets, defined_funcs)
+    void *scanner;
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
 #endif
 #endif
 {
-  /* The look-ahead symbol.  */
+/* The lookahead symbol.  */
 int yychar;
 
-/* The semantic value of the look-ahead symbol.  */
+/* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
-/* Number of syntax errors so far.  */
-int yynerrs;
-/* Location data for the look-ahead symbol.  */
+/* Location data for the lookahead symbol.  */
 YYLTYPE yylloc;
 
-  int yystate;
-  int yyn;
-  int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
+    /* Number of syntax errors so far.  */
+    int yynerrs;
 
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
 
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
+       `yyls': related to locations.
 
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
 
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
 
-  /* The location stack.  */
-  YYLTYPE yylsa[YYINITDEPTH];
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-  /* The locations where the error started and ended.  */
-  YYLTYPE yyerror_range[2];
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
 
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
+    /* The location stack.  */
+    YYLTYPE yylsa[YYINITDEPTH];
+    YYLTYPE *yyls;
+    YYLTYPE *yylsp;
 
-  YYSIZE_T yystacksize = YYINITDEPTH;
+    /* The locations where the error started and ended.  */
+    YYLTYPE yyerror_range[3];
 
+    YYSIZE_T yystacksize;
+
+  int yyn;
+  int yyresult;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
   YYLTYPE yyloc;
 
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
+
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yyls = yylsa;
+  yystacksize = YYINITDEPTH;
+
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yystate = 0;
   yyerrstatus = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
+  yychar = YYEMPTY; /* Cause a token to be read.  */
 
   /* Initialize stack pointers.
      Waste one element of value and location stack
      so that they stay on the same level as the state stack.
      The wasted elements are never initialized.  */
-
   yyssp = yyss;
   yyvsp = yyvs;
   yylsp = yyls;
+
 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   /* Initialize the default location before parsing starts.  */
   yylloc.first_line   = yylloc.last_line   = 1;
-  yylloc.first_column = yylloc.last_column = 0;
+  yylloc.first_column = yylloc.last_column = 1;
 #endif
 
+/* User initialization code.  */
 
-  /* User initialization code.  */
+/* Line 1590 of yacc.c  */
 #line 199 "regex.y"
 {
     clear_quantifiers();
@@ -1953,8 +1968,10 @@ YYLTYPE yylloc;
     rule_direction = 0;
     substituting = 0;
 }
-/* Line 1078 of yacc.c.  */
-#line 1958 "regex.tab.c"
+
+/* Line 1590 of yacc.c  */
+#line 1974 "regex.c"
+
   goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -1991,6 +2008,7 @@ YYLTYPE yylloc;
 		    &yyvs1, yysize * sizeof (*yyvsp),
 		    &yyls1, yysize * sizeof (*yylsp),
 		    &yystacksize);
+
 	yyls = yyls1;
 	yyss = yyss1;
 	yyvs = yyvs1;
@@ -2012,9 +2030,9 @@ YYLTYPE yylloc;
 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 	if (! yyptr)
 	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss);
-	YYSTACK_RELOCATE (yyvs);
-	YYSTACK_RELOCATE (yyls);
+	YYSTACK_RELOCATE (yyss_alloc, yyss);
+	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+	YYSTACK_RELOCATE (yyls_alloc, yyls);
 #  undef YYSTACK_RELOCATE
 	if (yyss1 != yyssa)
 	  YYSTACK_FREE (yyss1);
@@ -2035,6 +2053,9 @@ YYLTYPE yylloc;
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
   goto yybackup;
 
 /*-----------.
@@ -2043,16 +2064,16 @@ YYLTYPE yylloc;
 yybackup:
 
   /* Do appropriate processing given the current state.  Read a
-     look-ahead token if we need one and don't already have one.  */
+     lookahead token if we need one and don't already have one.  */
 
-  /* First try to decide what to do without reference to look-ahead token.  */
+  /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yypact_value_is_default (yyn))
     goto yydefault;
 
-  /* Not known => get a look-ahead token if don't already have one.  */
+  /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
@@ -2078,26 +2099,22 @@ yybackup:
   yyn = yytable[yyn];
   if (yyn <= 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-	goto yyerrlab;
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   /* Count tokens shifted since error; after three, turn off error
      status.  */
   if (yyerrstatus)
     yyerrstatus--;
 
-  /* Shift the look-ahead token.  */
+  /* Shift the lookahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
-  /* Discard the shifted token unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
 
   yystate = yyn;
   *++yyvsp = yylval;
@@ -2138,660 +2155,953 @@ yyreduce:
   switch (yyn)
     {
         case 4:
+
+/* Line 1806 of yacc.c  */
 #line 244 "regex.y"
-    { current_parse = (yyvsp[(1) - (2)].net);              ;}
+    { current_parse = (yyvsp[(1) - (2)].net);              }
     break;
 
   case 5:
+
+/* Line 1806 of yacc.c  */
 #line 246 "regex.y"
-    { ;}
+    { }
     break;
 
   case 6:
+
+/* Line 1806 of yacc.c  */
 #line 247 "regex.y"
-    { (yyval.net) = fsm_compose((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));         ;}
+    { (yyval.net) = fsm_compose((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));         }
     break;
 
   case 7:
+
+/* Line 1806 of yacc.c  */
 #line 248 "regex.y"
-    { (yyval.net) = fsm_lenient_compose((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net)); ;}
+    { (yyval.net) = fsm_lenient_compose((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net)); }
     break;
 
   case 8:
+
+/* Line 1806 of yacc.c  */
 #line 249 "regex.y"
-    { (yyval.net) = fsm_cross_product((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));   ;}
+    { (yyval.net) = fsm_cross_product((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));   }
     break;
 
   case 9:
+
+/* Line 1806 of yacc.c  */
 #line 251 "regex.y"
-    { if (rewrite) { add_rewrite_rule(); (yyval.net) = fsm_rewrite(rewrite_rules); clear_rewrite_ruleset(rewrite_rules); } rewrite = 0; contexts = NULL; rules = NULL; rewrite_rules = NULL; ;}
+    { if (rewrite) { add_rewrite_rule(); (yyval.net) = fsm_rewrite(rewrite_rules); clear_rewrite_ruleset(rewrite_rules); } rewrite = 0; contexts = NULL; rules = NULL; rewrite_rules = NULL; }
     break;
 
   case 10:
+
+/* Line 1806 of yacc.c  */
 #line 253 "regex.y"
-    { ;}
+    { }
     break;
 
   case 11:
+
+/* Line 1806 of yacc.c  */
 #line 254 "regex.y"
-    { (yyval.net) = NULL; add_context_pair((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));;}
+    { (yyval.net) = NULL; add_context_pair((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));}
     break;
 
   case 12:
+
+/* Line 1806 of yacc.c  */
 #line 255 "regex.y"
-    { add_context_pair((yyvsp[(1) - (2)].net),fsm_empty_string()); ;}
+    { add_context_pair((yyvsp[(1) - (2)].net),fsm_empty_string()); }
     break;
 
   case 13:
+
+/* Line 1806 of yacc.c  */
 #line 256 "regex.y"
-    { add_context_pair((yyvsp[(1) - (4)].net),fsm_empty_string()); ;}
+    { add_context_pair((yyvsp[(1) - (4)].net),fsm_empty_string()); }
     break;
 
   case 14:
+
+/* Line 1806 of yacc.c  */
 #line 257 "regex.y"
-    { add_context_pair(fsm_empty_string(),fsm_empty_string());;}
+    { add_context_pair(fsm_empty_string(),fsm_empty_string());}
     break;
 
   case 15:
+
+/* Line 1806 of yacc.c  */
 #line 258 "regex.y"
-    { add_rewrite_rule(); add_context_pair(fsm_empty_string(),fsm_empty_string());;}
+    { add_rewrite_rule(); add_context_pair(fsm_empty_string(),fsm_empty_string());}
     break;
 
   case 16:
+
+/* Line 1806 of yacc.c  */
 #line 259 "regex.y"
-    { add_rewrite_rule(); add_context_pair((yyvsp[(1) - (4)].net),fsm_empty_string());;}
+    { add_rewrite_rule(); add_context_pair((yyvsp[(1) - (4)].net),fsm_empty_string());}
     break;
 
   case 17:
+
+/* Line 1806 of yacc.c  */
 #line 260 "regex.y"
-    { add_context_pair(fsm_empty_string(),fsm_empty_string());;}
+    { add_context_pair(fsm_empty_string(),fsm_empty_string());}
     break;
 
   case 18:
+
+/* Line 1806 of yacc.c  */
 #line 261 "regex.y"
-    { add_context_pair(fsm_empty_string(),(yyvsp[(2) - (2)].net)); ;}
+    { add_context_pair(fsm_empty_string(),(yyvsp[(2) - (2)].net)); }
     break;
 
   case 19:
+
+/* Line 1806 of yacc.c  */
 #line 262 "regex.y"
-    { add_context_pair(fsm_empty_string(),(yyvsp[(2) - (4)].net)); ;}
+    { add_context_pair(fsm_empty_string(),(yyvsp[(2) - (4)].net)); }
     break;
 
   case 20:
+
+/* Line 1806 of yacc.c  */
 #line 263 "regex.y"
-    { add_context_pair((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net)); ;}
+    { add_context_pair((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net)); }
     break;
 
   case 21:
+
+/* Line 1806 of yacc.c  */
 #line 264 "regex.y"
-    { (yyval.net) = fsm_context_restrict((yyvsp[(1) - (3)].net),contexts); fsm_clear_contexts(contexts);;}
+    { (yyval.net) = fsm_context_restrict((yyvsp[(1) - (3)].net),contexts); fsm_clear_contexts(contexts);}
     break;
 
   case 22:
+
+/* Line 1806 of yacc.c  */
 #line 265 "regex.y"
-    { add_rule((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net),NULL,(yyvsp[(2) - (3)].type)); if ((yyvsp[(1) - (3)].net)->arity == 2) { printf("Error: LHS is transducer\n"); YYERROR;};}
+    { add_rule((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net),NULL,(yyvsp[(2) - (3)].type)); if ((yyvsp[(1) - (3)].net)->arity == 2) { printf("Error: LHS is transducer\n"); YYERROR;}}
     break;
 
   case 23:
+
+/* Line 1806 of yacc.c  */
 #line 266 "regex.y"
-    { add_rule((yyvsp[(1) - (2)].net),NULL,NULL,(yyvsp[(2) - (2)].type)); ;}
+    { add_rule((yyvsp[(1) - (2)].net),NULL,NULL,(yyvsp[(2) - (2)].type)); }
     break;
 
   case 24:
+
+/* Line 1806 of yacc.c  */
 #line 268 "regex.y"
-    { add_rule((yyvsp[(2) - (5)].net),(yyvsp[(5) - (5)].net),NULL,(yyvsp[(4) - (5)].type)|ARROW_DOTTED); if ((yyvsp[(5) - (5)].net) == NULL) { YYERROR;};}
+    { add_rule((yyvsp[(2) - (5)].net),(yyvsp[(5) - (5)].net),NULL,(yyvsp[(4) - (5)].type)|ARROW_DOTTED); if ((yyvsp[(5) - (5)].net) == NULL) { YYERROR;}}
     break;
 
   case 25:
+
+/* Line 1806 of yacc.c  */
 #line 269 "regex.y"
-    { add_rule(fsm_empty_string(),(yyvsp[(4) - (4)].net),NULL,(yyvsp[(3) - (4)].type)|ARROW_DOTTED); if ((yyvsp[(4) - (4)].net) == NULL) { YYERROR;};}
+    { add_rule(fsm_empty_string(),(yyvsp[(4) - (4)].net),NULL,(yyvsp[(3) - (4)].type)|ARROW_DOTTED); if ((yyvsp[(4) - (4)].net) == NULL) { YYERROR;}}
     break;
 
   case 26:
+
+/* Line 1806 of yacc.c  */
 #line 270 "regex.y"
-    { add_rule((yyvsp[(2) - (7)].net),(yyvsp[(5) - (7)].net),NULL,(yyvsp[(4) - (7)].type)|ARROW_DOTTED);;}
+    { add_rule((yyvsp[(2) - (7)].net),(yyvsp[(5) - (7)].net),NULL,(yyvsp[(4) - (7)].type)|ARROW_DOTTED);}
     break;
 
   case 27:
+
+/* Line 1806 of yacc.c  */
 #line 271 "regex.y"
-    { add_rule(fsm_empty_string(),(yyvsp[(4) - (6)].net),NULL,(yyvsp[(3) - (6)].type)|ARROW_DOTTED);;}
+    { add_rule(fsm_empty_string(),(yyvsp[(4) - (6)].net),NULL,(yyvsp[(3) - (6)].type)|ARROW_DOTTED);}
     break;
 
   case 28:
+
+/* Line 1806 of yacc.c  */
 #line 272 "regex.y"
-    { add_rule((yyvsp[(2) - (7)].net),(yyvsp[(5) - (7)].net),NULL,(yyvsp[(4) - (7)].type)|ARROW_DOTTED); rule_direction = (yyvsp[(6) - (7)].type);;}
+    { add_rule((yyvsp[(2) - (7)].net),(yyvsp[(5) - (7)].net),NULL,(yyvsp[(4) - (7)].type)|ARROW_DOTTED); rule_direction = (yyvsp[(6) - (7)].type);}
     break;
 
   case 29:
+
+/* Line 1806 of yacc.c  */
 #line 273 "regex.y"
-    { add_rule(fsm_empty_string(),(yyvsp[(4) - (6)].net),NULL,(yyvsp[(3) - (6)].type)|ARROW_DOTTED); rule_direction = (yyvsp[(5) - (6)].type);;}
+    { add_rule(fsm_empty_string(),(yyvsp[(4) - (6)].net),NULL,(yyvsp[(3) - (6)].type)|ARROW_DOTTED); rule_direction = (yyvsp[(5) - (6)].type);}
     break;
 
   case 30:
+
+/* Line 1806 of yacc.c  */
 #line 274 "regex.y"
-    { add_rule((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net),NULL,(yyvsp[(2) - (5)].type));;}
+    { add_rule((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net),NULL,(yyvsp[(2) - (5)].type));}
     break;
 
   case 31:
+
+/* Line 1806 of yacc.c  */
 #line 275 "regex.y"
-    { add_rule((yyvsp[(1) - (4)].net),NULL,NULL,(yyvsp[(2) - (4)].type));;}
+    { add_rule((yyvsp[(1) - (4)].net),NULL,NULL,(yyvsp[(2) - (4)].type));}
     break;
 
   case 32:
+
+/* Line 1806 of yacc.c  */
 #line 276 "regex.y"
-    { add_rule((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net),NULL,(yyvsp[(2) - (5)].type)); rule_direction = (yyvsp[(4) - (5)].type);;}
+    { add_rule((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net),NULL,(yyvsp[(2) - (5)].type)); rule_direction = (yyvsp[(4) - (5)].type);}
     break;
 
   case 33:
+
+/* Line 1806 of yacc.c  */
 #line 277 "regex.y"
-    { add_rule((yyvsp[(1) - (4)].net),NULL,NULL,(yyvsp[(2) - (4)].type)); rule_direction = (yyvsp[(3) - (4)].type);;}
+    { add_rule((yyvsp[(1) - (4)].net),NULL,NULL,(yyvsp[(2) - (4)].type)); rule_direction = (yyvsp[(3) - (4)].type);}
     break;
 
   case 34:
+
+/* Line 1806 of yacc.c  */
 #line 279 "regex.y"
-    { add_rewrite_rule();;}
+    { add_rewrite_rule();}
     break;
 
   case 35:
+
+/* Line 1806 of yacc.c  */
 #line 281 "regex.y"
-    { add_rule((yyvsp[(1) - (3)].net),fsm_empty_string(),fsm_empty_string(),(yyvsp[(2) - (3)].type));;}
+    { add_rule((yyvsp[(1) - (3)].net),fsm_empty_string(),fsm_empty_string(),(yyvsp[(2) - (3)].type));}
     break;
 
   case 36:
+
+/* Line 1806 of yacc.c  */
 #line 282 "regex.y"
-    { add_rule((yyvsp[(1) - (4)].net),fsm_empty_string(),(yyvsp[(4) - (4)].net),(yyvsp[(2) - (4)].type));;}
+    { add_rule((yyvsp[(1) - (4)].net),fsm_empty_string(),(yyvsp[(4) - (4)].net),(yyvsp[(2) - (4)].type));}
     break;
 
   case 37:
+
+/* Line 1806 of yacc.c  */
 #line 283 "regex.y"
-    { add_rule((yyvsp[(1) - (4)].net),(yyvsp[(3) - (4)].net),fsm_empty_string(),(yyvsp[(2) - (4)].type));;}
+    { add_rule((yyvsp[(1) - (4)].net),(yyvsp[(3) - (4)].net),fsm_empty_string(),(yyvsp[(2) - (4)].type));}
     break;
 
   case 38:
+
+/* Line 1806 of yacc.c  */
 #line 284 "regex.y"
-    { add_rule((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net),(yyvsp[(5) - (5)].net),(yyvsp[(2) - (5)].type));;}
+    { add_rule((yyvsp[(1) - (5)].net),(yyvsp[(3) - (5)].net),(yyvsp[(5) - (5)].net),(yyvsp[(2) - (5)].type));}
     break;
 
   case 39:
+
+/* Line 1806 of yacc.c  */
 #line 285 "regex.y"
-    { add_rule((yyvsp[(1) - (7)].net),(yyvsp[(3) - (7)].net),(yyvsp[(5) - (7)].net),(yyvsp[(2) - (7)].type));;}
+    { add_rule((yyvsp[(1) - (7)].net),(yyvsp[(3) - (7)].net),(yyvsp[(5) - (7)].net),(yyvsp[(2) - (7)].type));}
     break;
 
   case 40:
+
+/* Line 1806 of yacc.c  */
 #line 286 "regex.y"
-    { add_rule((yyvsp[(1) - (6)].net),(yyvsp[(3) - (6)].net),fsm_empty_string(),(yyvsp[(2) - (6)].type));;}
+    { add_rule((yyvsp[(1) - (6)].net),(yyvsp[(3) - (6)].net),fsm_empty_string(),(yyvsp[(2) - (6)].type));}
     break;
 
   case 41:
+
+/* Line 1806 of yacc.c  */
 #line 287 "regex.y"
-    { add_rule((yyvsp[(1) - (6)].net),fsm_empty_string(),(yyvsp[(4) - (6)].net),(yyvsp[(2) - (6)].type));;}
+    { add_rule((yyvsp[(1) - (6)].net),fsm_empty_string(),(yyvsp[(4) - (6)].net),(yyvsp[(2) - (6)].type));}
     break;
 
   case 42:
+
+/* Line 1806 of yacc.c  */
 #line 288 "regex.y"
-    { add_rule((yyvsp[(1) - (5)].net),fsm_empty_string(),fsm_empty_string(),(yyvsp[(2) - (5)].type));;}
+    { add_rule((yyvsp[(1) - (5)].net),fsm_empty_string(),fsm_empty_string(),(yyvsp[(2) - (5)].type));}
     break;
 
   case 43:
+
+/* Line 1806 of yacc.c  */
 #line 289 "regex.y"
-    { add_rule((yyvsp[(1) - (7)].net),(yyvsp[(3) - (7)].net),(yyvsp[(5) - (7)].net),(yyvsp[(2) - (7)].type)); rule_direction = (yyvsp[(6) - (7)].type);;}
+    { add_rule((yyvsp[(1) - (7)].net),(yyvsp[(3) - (7)].net),(yyvsp[(5) - (7)].net),(yyvsp[(2) - (7)].type)); rule_direction = (yyvsp[(6) - (7)].type);}
     break;
 
   case 44:
+
+/* Line 1806 of yacc.c  */
 #line 290 "regex.y"
-    { add_rule((yyvsp[(1) - (6)].net),fsm_empty_string(),(yyvsp[(4) - (6)].net),(yyvsp[(2) - (6)].type)); rule_direction = (yyvsp[(5) - (6)].type);;}
+    { add_rule((yyvsp[(1) - (6)].net),fsm_empty_string(),(yyvsp[(4) - (6)].net),(yyvsp[(2) - (6)].type)); rule_direction = (yyvsp[(5) - (6)].type);}
     break;
 
   case 45:
+
+/* Line 1806 of yacc.c  */
 #line 291 "regex.y"
-    { add_rule((yyvsp[(1) - (6)].net),(yyvsp[(3) - (6)].net),fsm_empty_string(),(yyvsp[(2) - (6)].type)); rule_direction = (yyvsp[(5) - (6)].type);;}
+    { add_rule((yyvsp[(1) - (6)].net),(yyvsp[(3) - (6)].net),fsm_empty_string(),(yyvsp[(2) - (6)].type)); rule_direction = (yyvsp[(5) - (6)].type);}
     break;
 
   case 46:
+
+/* Line 1806 of yacc.c  */
 #line 292 "regex.y"
-    { add_rule((yyvsp[(1) - (5)].net),fsm_empty_string(),fsm_empty_string(),(yyvsp[(2) - (5)].type)); rule_direction = (yyvsp[(4) - (5)].type);;}
+    { add_rule((yyvsp[(1) - (5)].net),fsm_empty_string(),fsm_empty_string(),(yyvsp[(2) - (5)].type)); rule_direction = (yyvsp[(4) - (5)].type);}
     break;
 
   case 47:
+
+/* Line 1806 of yacc.c  */
 #line 295 "regex.y"
-    { ;}
+    { }
     break;
 
   case 48:
+
+/* Line 1806 of yacc.c  */
 #line 296 "regex.y"
-    { (yyval.net) = fsm_shuffle((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));  ;}
+    { (yyval.net) = fsm_shuffle((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));  }
     break;
 
   case 49:
+
+/* Line 1806 of yacc.c  */
 #line 297 "regex.y"
-    { (yyval.net) = fsm_precedes((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net)); ;}
+    { (yyval.net) = fsm_precedes((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net)); }
     break;
 
   case 50:
+
+/* Line 1806 of yacc.c  */
 #line 298 "regex.y"
-    { (yyval.net) = fsm_follows((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));  ;}
+    { (yyval.net) = fsm_follows((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));  }
     break;
 
   case 51:
+
+/* Line 1806 of yacc.c  */
 #line 300 "regex.y"
-    { ;}
+    { }
     break;
 
   case 52:
+
+/* Line 1806 of yacc.c  */
 #line 302 "regex.y"
-    { ;}
+    { }
     break;
 
   case 53:
+
+/* Line 1806 of yacc.c  */
 #line 304 "regex.y"
-    { ;}
+    { }
     break;
 
   case 54:
+
+/* Line 1806 of yacc.c  */
 #line 305 "regex.y"
-    { (yyval.net) = fsm_union((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                     ;}
+    { (yyval.net) = fsm_union((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                     }
     break;
 
   case 55:
+
+/* Line 1806 of yacc.c  */
 #line 306 "regex.y"
-    { (yyval.net) = fsm_priority_union_upper((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));      ;}
+    { (yyval.net) = fsm_priority_union_upper((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));      }
     break;
 
   case 56:
+
+/* Line 1806 of yacc.c  */
 #line 307 "regex.y"
-    { (yyval.net) = fsm_priority_union_lower((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));      ;}
+    { (yyval.net) = fsm_priority_union_lower((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));      }
     break;
 
   case 57:
+
+/* Line 1806 of yacc.c  */
 #line 308 "regex.y"
-    { (yyval.net) = fsm_intersect((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                 ;}
+    { (yyval.net) = fsm_intersect((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                 }
     break;
 
   case 58:
+
+/* Line 1806 of yacc.c  */
 #line 309 "regex.y"
-    { (yyval.net) = fsm_minus((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                     ;}
+    { (yyval.net) = fsm_minus((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                     }
     break;
 
   case 59:
+
+/* Line 1806 of yacc.c  */
 #line 310 "regex.y"
-    { (yyval.net) = fsm_union(fsm_complement((yyvsp[(1) - (3)].net)),(yyvsp[(3) - (3)].net));     ;}
+    { (yyval.net) = fsm_union(fsm_complement((yyvsp[(1) - (3)].net)),(yyvsp[(3) - (3)].net));     }
     break;
 
   case 60:
+
+/* Line 1806 of yacc.c  */
 #line 311 "regex.y"
-    { (yyval.net) = fsm_intersect(fsm_union(fsm_complement(fsm_copy((yyvsp[(1) - (3)].net))),fsm_copy((yyvsp[(3) - (3)].net))), fsm_union(fsm_complement(fsm_copy((yyvsp[(3) - (3)].net))),fsm_copy((yyvsp[(1) - (3)].net)))); fsm_destroy((yyvsp[(1) - (3)].net)); fsm_destroy((yyvsp[(3) - (3)].net));;}
+    { (yyval.net) = fsm_intersect(fsm_union(fsm_complement(fsm_copy((yyvsp[(1) - (3)].net))),fsm_copy((yyvsp[(3) - (3)].net))), fsm_union(fsm_complement(fsm_copy((yyvsp[(3) - (3)].net))),fsm_copy((yyvsp[(1) - (3)].net)))); fsm_destroy((yyvsp[(1) - (3)].net)); fsm_destroy((yyvsp[(3) - (3)].net));}
     break;
 
   case 61:
+
+/* Line 1806 of yacc.c  */
 #line 313 "regex.y"
-    { ;}
+    { }
     break;
 
   case 62:
+
+/* Line 1806 of yacc.c  */
 #line 314 "regex.y"
-    { (yyval.net) = fsm_concat((yyvsp[(1) - (2)].net),(yyvsp[(2) - (2)].net)); ;}
+    { (yyval.net) = fsm_concat((yyvsp[(1) - (2)].net),(yyvsp[(2) - (2)].net)); }
     break;
 
   case 63:
+
+/* Line 1806 of yacc.c  */
 #line 315 "regex.y"
-    { (yyval.net) = fsm_ignore(fsm_contains(fsm_concat(fsm_symbol((yyvsp[(1) - (3)].string)),fsm_concat((yyvsp[(3) - (3)].net),fsm_symbol((yyvsp[(1) - (3)].string))))),union_quantifiers(),OP_IGNORE_ALL); ;}
+    { (yyval.net) = fsm_ignore(fsm_contains(fsm_concat(fsm_symbol((yyvsp[(1) - (3)].string)),fsm_concat((yyvsp[(3) - (3)].net),fsm_symbol((yyvsp[(1) - (3)].string))))),union_quantifiers(),OP_IGNORE_ALL); }
     break;
 
   case 64:
+
+/* Line 1806 of yacc.c  */
 #line 317 "regex.y"
-    { (yyval.net) = fsm_logical_eq((yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].string)); ;}
+    { (yyval.net) = fsm_logical_eq((yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].string)); }
     break;
 
   case 65:
+
+/* Line 1806 of yacc.c  */
 #line 318 "regex.y"
-    { (yyval.net) = fsm_complement(fsm_logical_eq((yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].string))); ;}
+    { (yyval.net) = fsm_complement(fsm_logical_eq((yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].string))); }
     break;
 
   case 66:
+
+/* Line 1806 of yacc.c  */
 #line 319 "regex.y"
-    { (yyval.net) = fsm_logical_precedence((yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].string)); ;}
+    { (yyval.net) = fsm_logical_precedence((yyvsp[(1) - (3)].string),(yyvsp[(3) - (3)].string)); }
     break;
 
   case 67:
+
+/* Line 1806 of yacc.c  */
 #line 320 "regex.y"
-    { (yyval.net) = fsm_logical_precedence((yyvsp[(3) - (3)].string),(yyvsp[(1) - (3)].string)); ;}
+    { (yyval.net) = fsm_logical_precedence((yyvsp[(3) - (3)].string),(yyvsp[(1) - (3)].string)); }
     break;
 
   case 68:
+
+/* Line 1806 of yacc.c  */
 #line 322 "regex.y"
-    { ;}
+    { }
     break;
 
   case 69:
+
+/* Line 1806 of yacc.c  */
 #line 323 "regex.y"
-    { (yyval.net) = fsm_ignore((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net), OP_IGNORE_ALL);          ;}
+    { (yyval.net) = fsm_ignore((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net), OP_IGNORE_ALL);          }
     break;
 
   case 70:
+
+/* Line 1806 of yacc.c  */
 #line 324 "regex.y"
-    { (yyval.net) = fsm_ignore((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net), OP_IGNORE_INTERNAL);     ;}
+    { (yyval.net) = fsm_ignore((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net), OP_IGNORE_INTERNAL);     }
     break;
 
   case 71:
+
+/* Line 1806 of yacc.c  */
 #line 325 "regex.y"
-    { (yyval.net) = fsm_quotient_right((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                 ;}
+    { (yyval.net) = fsm_quotient_right((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                 }
     break;
 
   case 72:
+
+/* Line 1806 of yacc.c  */
 #line 326 "regex.y"
-    { (yyval.net) = fsm_quotient_left((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                  ;}
+    { (yyval.net) = fsm_quotient_left((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));                  }
     break;
 
   case 73:
+
+/* Line 1806 of yacc.c  */
 #line 327 "regex.y"
-    { (yyval.net) = fsm_quotient_interleave((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));            ;}
+    { (yyval.net) = fsm_quotient_interleave((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net));            }
     break;
 
   case 74:
+
+/* Line 1806 of yacc.c  */
 #line 329 "regex.y"
-    { ;}
+    { }
     break;
 
   case 75:
+
+/* Line 1806 of yacc.c  */
 #line 330 "regex.y"
-    { (yyval.net) = fsm_complement((yyvsp[(2) - (2)].net));       ;}
+    { (yyval.net) = fsm_complement((yyvsp[(2) - (2)].net));       }
     break;
 
   case 76:
+
+/* Line 1806 of yacc.c  */
 #line 331 "regex.y"
-    { (yyval.net) = fsm_contains((yyvsp[(2) - (2)].net));         ;}
+    { (yyval.net) = fsm_contains((yyvsp[(2) - (2)].net));         }
     break;
 
   case 77:
+
+/* Line 1806 of yacc.c  */
 #line 332 "regex.y"
-    { (yyval.net) = fsm_contains_one((yyvsp[(2) - (2)].net));     ;}
+    { (yyval.net) = fsm_contains_one((yyvsp[(2) - (2)].net));     }
     break;
 
   case 78:
+
+/* Line 1806 of yacc.c  */
 #line 333 "regex.y"
-    { (yyval.net) = fsm_contains_opt_one((yyvsp[(2) - (2)].net)); ;}
+    { (yyval.net) = fsm_contains_opt_one((yyvsp[(2) - (2)].net)); }
     break;
 
   case 79:
+
+/* Line 1806 of yacc.c  */
 #line 335 "regex.y"
-    { ;}
+    { }
     break;
 
   case 80:
+
+/* Line 1806 of yacc.c  */
 #line 337 "regex.y"
-    { ;}
+    { }
     break;
 
   case 81:
+
+/* Line 1806 of yacc.c  */
 #line 338 "regex.y"
-    { (yyval.net) = fsm_kleene_star(fsm_minimize((yyvsp[(1) - (2)].net))); ;}
+    { (yyval.net) = fsm_kleene_star(fsm_minimize((yyvsp[(1) - (2)].net))); }
     break;
 
   case 82:
+
+/* Line 1806 of yacc.c  */
 #line 339 "regex.y"
-    { (yyval.net) = fsm_kleene_plus((yyvsp[(1) - (2)].net)); ;}
+    { (yyval.net) = fsm_kleene_plus((yyvsp[(1) - (2)].net)); }
     break;
 
   case 83:
+
+/* Line 1806 of yacc.c  */
 #line 340 "regex.y"
-    { (yyval.net) = fsm_determinize(fsm_reverse((yyvsp[(1) - (2)].net))); ;}
+    { (yyval.net) = fsm_determinize(fsm_reverse((yyvsp[(1) - (2)].net))); }
     break;
 
   case 84:
+
+/* Line 1806 of yacc.c  */
 #line 341 "regex.y"
-    { (yyval.net) = fsm_invert((yyvsp[(1) - (2)].net)); ;}
+    { (yyval.net) = fsm_invert((yyvsp[(1) - (2)].net)); }
     break;
 
   case 85:
+
+/* Line 1806 of yacc.c  */
 #line 342 "regex.y"
-    { (yyval.net) = fsm_upper((yyvsp[(1) - (2)].net)); ;}
+    { (yyval.net) = fsm_upper((yyvsp[(1) - (2)].net)); }
     break;
 
   case 86:
+
+/* Line 1806 of yacc.c  */
 #line 343 "regex.y"
-    { (yyval.net) = fsm_lower((yyvsp[(1) - (2)].net)); ;}
+    { (yyval.net) = fsm_lower((yyvsp[(1) - (2)].net)); }
     break;
 
   case 87:
+
+/* Line 1806 of yacc.c  */
 #line 344 "regex.y"
-    { (yyval.net) = flag_eliminate((yyvsp[(1) - (2)].net), NULL); ;}
+    { (yyval.net) = flag_eliminate((yyvsp[(1) - (2)].net), NULL); }
     break;
 
   case 88:
+
+/* Line 1806 of yacc.c  */
 #line 345 "regex.y"
-    { (yyval.net) = fsm_cross_product((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net)); ;}
+    { (yyval.net) = fsm_cross_product((yyvsp[(1) - (3)].net),(yyvsp[(3) - (3)].net)); }
     break;
 
   case 89:
+
+/* Line 1806 of yacc.c  */
 #line 347 "regex.y"
-    { (yyval.net) = fsm_concat_n((yyvsp[(1) - (2)].net),atoi((yyvsp[(2) - (2)].string))); ;}
+    { (yyval.net) = fsm_concat_n((yyvsp[(1) - (2)].net),atoi((yyvsp[(2) - (2)].string))); }
     break;
 
   case 90:
+
+/* Line 1806 of yacc.c  */
 #line 348 "regex.y"
-    { (yyval.net) = fsm_concat(fsm_concat_n(fsm_copy((yyvsp[(1) - (2)].net)), atoi((yyvsp[(2) - (2)].string))),fsm_kleene_plus(fsm_copy((yyvsp[(1) - (2)].net)))); fsm_destroy((yyvsp[(1) - (2)].net)); ;}
+    { (yyval.net) = fsm_concat(fsm_concat_n(fsm_copy((yyvsp[(1) - (2)].net)), atoi((yyvsp[(2) - (2)].string))),fsm_kleene_plus(fsm_copy((yyvsp[(1) - (2)].net)))); fsm_destroy((yyvsp[(1) - (2)].net)); }
     break;
 
   case 91:
+
+/* Line 1806 of yacc.c  */
 #line 349 "regex.y"
-    { (yyval.net) = fsm_concat_m_n((yyvsp[(1) - (2)].net),0,atoi((yyvsp[(2) - (2)].string))-1); ;}
+    { (yyval.net) = fsm_concat_m_n((yyvsp[(1) - (2)].net),0,atoi((yyvsp[(2) - (2)].string))-1); }
     break;
 
   case 92:
+
+/* Line 1806 of yacc.c  */
 #line 350 "regex.y"
-    { (yyval.net) = fsm_concat_m_n((yyvsp[(1) - (2)].net),atoi((yyvsp[(2) - (2)].string)),atoi(strstr((yyvsp[(2) - (2)].string),",")+1)); ;}
+    { (yyval.net) = fsm_concat_m_n((yyvsp[(1) - (2)].net),atoi((yyvsp[(2) - (2)].string)),atoi(strstr((yyvsp[(2) - (2)].string),",")+1)); }
     break;
 
   case 93:
+
+/* Line 1806 of yacc.c  */
 #line 352 "regex.y"
-    { ;}
+    { }
     break;
 
   case 94:
+
+/* Line 1806 of yacc.c  */
 #line 353 "regex.y"
-    { (yyval.net) = fsm_term_negation((yyvsp[(2) - (2)].net)); ;}
+    { (yyval.net) = fsm_term_negation((yyvsp[(2) - (2)].net)); }
     break;
 
   case 95:
+
+/* Line 1806 of yacc.c  */
 #line 355 "regex.y"
-    { (yyval.net) = (yyvsp[(1) - (1)].net);;}
+    { (yyval.net) = (yyvsp[(1) - (1)].net);}
     break;
 
   case 96:
+
+/* Line 1806 of yacc.c  */
 #line 356 "regex.y"
-    { (yyval.net) = (yyvsp[(1) - (1)].net); ;}
+    { (yyval.net) = (yyvsp[(1) - (1)].net); }
     break;
 
   case 97:
+
+/* Line 1806 of yacc.c  */
 #line 357 "regex.y"
-    { (yyval.net) = fsm_complement(fsm_substitute_symbol(fsm_intersect(fsm_quantifier((yyvsp[(1) - (4)].string)),fsm_complement((yyvsp[(3) - (4)].net))),(yyvsp[(1) - (4)].string),"@_EPSILON_SYMBOL_@")); purge_quantifier((yyvsp[(1) - (4)].string)); ;}
+    { (yyval.net) = fsm_complement(fsm_substitute_symbol(fsm_intersect(fsm_quantifier((yyvsp[(1) - (4)].string)),fsm_complement((yyvsp[(3) - (4)].net))),(yyvsp[(1) - (4)].string),"@_EPSILON_SYMBOL_@")); purge_quantifier((yyvsp[(1) - (4)].string)); }
     break;
 
   case 98:
+
+/* Line 1806 of yacc.c  */
 #line 358 "regex.y"
-    {  (yyval.net) = fsm_substitute_symbol(fsm_intersect(fsm_quantifier((yyvsp[(1) - (2)].string)),(yyvsp[(2) - (2)].net)),(yyvsp[(1) - (2)].string),"@_EPSILON_SYMBOL_@"); purge_quantifier((yyvsp[(1) - (2)].string)); ;}
+    {  (yyval.net) = fsm_substitute_symbol(fsm_intersect(fsm_quantifier((yyvsp[(1) - (2)].string)),(yyvsp[(2) - (2)].net)),(yyvsp[(1) - (2)].string),"@_EPSILON_SYMBOL_@"); purge_quantifier((yyvsp[(1) - (2)].string)); }
     break;
 
   case 99:
+
+/* Line 1806 of yacc.c  */
 #line 359 "regex.y"
-    { if (count_quantifiers()) (yyval.net) = (yyvsp[(2) - (3)].net); else {(yyval.net) = fsm_optionality((yyvsp[(2) - (3)].net));} ;}
+    { if (count_quantifiers()) (yyval.net) = (yyvsp[(2) - (3)].net); else {(yyval.net) = fsm_optionality((yyvsp[(2) - (3)].net));} }
     break;
 
   case 100:
+
+/* Line 1806 of yacc.c  */
 #line 360 "regex.y"
-    { (yyval.net) = (yyvsp[(2) - (3)].net); ;}
+    { (yyval.net) = (yyvsp[(2) - (3)].net); }
     break;
 
   case 101:
+
+/* Line 1806 of yacc.c  */
 #line 361 "regex.y"
-    {(yyval.net) = fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(union_quantifiers(),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_universal())))))))); ;}
+    {(yyval.net) = fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(union_quantifiers(),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_universal())))))))); }
     break;
 
   case 102:
+
+/* Line 1806 of yacc.c  */
 #line 362 "regex.y"
-    {(yyval.net) = fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(fsm_ignore((yyvsp[(4) - (5)].net),union_quantifiers(),OP_IGNORE_ALL),fsm_universal()))))); ;}
+    {(yyval.net) = fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(2) - (5)].string)),fsm_concat(fsm_ignore((yyvsp[(4) - (5)].net),union_quantifiers(),OP_IGNORE_ALL),fsm_universal()))))); }
     break;
 
   case 103:
+
+/* Line 1806 of yacc.c  */
 #line 363 "regex.y"
-    {(yyval.net) = fsm_concat(fsm_universal(),fsm_concat(fsm_ignore((yyvsp[(2) - (5)].net),union_quantifiers(),OP_IGNORE_ALL),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_universal()))))); ;}
+    {(yyval.net) = fsm_concat(fsm_universal(),fsm_concat(fsm_ignore((yyvsp[(2) - (5)].net),union_quantifiers(),OP_IGNORE_ALL),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_concat(fsm_universal(),fsm_concat(fsm_symbol((yyvsp[(4) - (5)].string)),fsm_universal()))))); }
     break;
 
   case 104:
+
+/* Line 1806 of yacc.c  */
 #line 364 "regex.y"
-    {(yyval.net) = fsm_substitute_symbol((yyvsp[(1) - (2)].net),subval1,subval2); substituting = 0; xxfree(subval1); xxfree(subval2); subval1 = subval2 = NULL;;}
+    {(yyval.net) = fsm_substitute_symbol((yyvsp[(1) - (2)].net),subval1,subval2); substituting = 0; xxfree(subval1); xxfree(subval2); subval1 = subval2 = NULL;}
     break;
 
   case 105:
+
+/* Line 1806 of yacc.c  */
 #line 366 "regex.y"
-    { (yyval.net) = (yyvsp[(3) - (4)].net); substituting = 1;                      ;}
+    { (yyval.net) = (yyvsp[(3) - (4)].net); substituting = 1;                      }
     break;
 
   case 106:
+
+/* Line 1806 of yacc.c  */
 #line 367 "regex.y"
-    { subval1 = (yyvsp[(2) - (4)].string); subval2 = (yyvsp[(4) - (4)].string); ;}
+    { subval1 = (yyvsp[(2) - (4)].string); subval2 = (yyvsp[(4) - (4)].string); }
     break;
 
   case 107:
+
+/* Line 1806 of yacc.c  */
 #line 369 "regex.y"
-    { (yyval.net) = (yyvsp[(1) - (1)].net); ;}
+    { (yyval.net) = (yyvsp[(1) - (1)].net); }
     break;
 
   case 108:
+
+/* Line 1806 of yacc.c  */
 #line 370 "regex.y"
-    { (yyval.net) = fsm_boolean(fsm_isidentity((yyvsp[(2) - (3)].net)));   ;}
+    { (yyval.net) = fsm_boolean(fsm_isidentity((yyvsp[(2) - (3)].net)));   }
     break;
 
   case 109:
+
+/* Line 1806 of yacc.c  */
 #line 371 "regex.y"
-    { (yyval.net) = fsm_boolean(fsm_isfunctional((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_boolean(fsm_isfunctional((yyvsp[(2) - (3)].net))); }
     break;
 
   case 110:
+
+/* Line 1806 of yacc.c  */
 #line 372 "regex.y"
-    { (yyval.net) = fsm_boolean(fsm_isunambiguous((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_boolean(fsm_isunambiguous((yyvsp[(2) - (3)].net))); }
     break;
 
   case 111:
+
+/* Line 1806 of yacc.c  */
 #line 373 "regex.y"
-    { (yyval.net) = fsm_extract_nonidentity(fsm_copy((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_extract_nonidentity(fsm_copy((yyvsp[(2) - (3)].net))); }
     break;
 
   case 112:
+
+/* Line 1806 of yacc.c  */
 #line 374 "regex.y"
-    { (yyval.net) = fsm_lowerdet(fsm_copy((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_lowerdet(fsm_copy((yyvsp[(2) - (3)].net))); }
     break;
 
   case 113:
+
+/* Line 1806 of yacc.c  */
 #line 375 "regex.y"
-    { (yyval.net) = fsm_lowerdeteps(fsm_copy((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_lowerdeteps(fsm_copy((yyvsp[(2) - (3)].net))); }
     break;
 
   case 114:
+
+/* Line 1806 of yacc.c  */
 #line 376 "regex.y"
-    { (yyval.net) = fsm_markallfinal(fsm_copy((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_markallfinal(fsm_copy((yyvsp[(2) - (3)].net))); }
     break;
 
   case 115:
+
+/* Line 1806 of yacc.c  */
 #line 377 "regex.y"
-    { (yyval.net) = fsm_extract_unambiguous(fsm_copy((yyvsp[(2) - (3)].net)));      ;}
+    { (yyval.net) = fsm_extract_unambiguous(fsm_copy((yyvsp[(2) - (3)].net)));      }
     break;
 
   case 116:
+
+/* Line 1806 of yacc.c  */
 #line 378 "regex.y"
-    { (yyval.net) = fsm_extract_ambiguous(fsm_copy((yyvsp[(2) - (3)].net)));        ;}
+    { (yyval.net) = fsm_extract_ambiguous(fsm_copy((yyvsp[(2) - (3)].net)));        }
     break;
 
   case 117:
+
+/* Line 1806 of yacc.c  */
 #line 379 "regex.y"
-    { (yyval.net) = fsm_extract_ambiguous_domain(fsm_copy((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_extract_ambiguous_domain(fsm_copy((yyvsp[(2) - (3)].net))); }
     break;
 
   case 118:
+
+/* Line 1806 of yacc.c  */
 #line 380 "regex.y"
-    { (yyval.net) = fsm_letter_machine(fsm_copy((yyvsp[(2) - (3)].net))); ;}
+    { (yyval.net) = fsm_letter_machine(fsm_copy((yyvsp[(2) - (3)].net))); }
     break;
 
   case 119:
+
+/* Line 1806 of yacc.c  */
 #line 381 "regex.y"
-    { (yyval.net) = fsm_mark_fsm_tail((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net)); ;}
+    { (yyval.net) = fsm_mark_fsm_tail((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net)); }
     break;
 
   case 120:
+
+/* Line 1806 of yacc.c  */
 #line 382 "regex.y"
-    { (yyval.net) = fsm_add_loop((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net),1); ;}
+    { (yyval.net) = fsm_add_loop((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net),1); }
     break;
 
   case 121:
+
+/* Line 1806 of yacc.c  */
 #line 383 "regex.y"
-    { (yyval.net) = fsm_add_loop((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net),0); ;}
+    { (yyval.net) = fsm_add_loop((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net),0); }
     break;
 
   case 122:
+
+/* Line 1806 of yacc.c  */
 #line 384 "regex.y"
-    { (yyval.net) = fsm_add_loop((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net),2); ;}
+    { (yyval.net) = fsm_add_loop((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net),2); }
     break;
 
   case 123:
+
+/* Line 1806 of yacc.c  */
 #line 385 "regex.y"
-    { (yyval.net) = fsm_add_sink((yyvsp[(2) - (3)].net),1); ;}
+    { (yyval.net) = fsm_add_sink((yyvsp[(2) - (3)].net),1); }
     break;
 
   case 124:
+
+/* Line 1806 of yacc.c  */
 #line 386 "regex.y"
-    { (yyval.net) = fsm_left_rewr((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net)); ;}
+    { (yyval.net) = fsm_left_rewr((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net)); }
     break;
 
   case 125:
+
+/* Line 1806 of yacc.c  */
 #line 387 "regex.y"
-    { (yyval.net) = fsm_flatten((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net)); ;}
+    { (yyval.net) = fsm_flatten((yyvsp[(2) - (5)].net),(yyvsp[(4) - (5)].net)); }
     break;
 
   case 126:
+
+/* Line 1806 of yacc.c  */
 #line 388 "regex.y"
-    { (yyval.net) = fsm_equal_substrings((yyvsp[(2) - (7)].net),(yyvsp[(4) - (7)].net),(yyvsp[(6) - (7)].net)); ;}
+    { (yyval.net) = fsm_substitute_label((yyvsp[(2) - (7)].net), fsm_network_to_char((yyvsp[(4) - (7)].net)), (yyvsp[(6) - (7)].net)); }
     break;
 
   case 127:
-#line 391 "regex.y"
-    { frec++; fargptr[frec] = 0 ;declare_function_name((yyvsp[(1) - (3)].string)) ; add_function_argument((yyvsp[(2) - (3)].net)); ;}
+
+/* Line 1806 of yacc.c  */
+#line 389 "regex.y"
+    { (yyval.net) = fsm_close_sigma(fsm_copy((yyvsp[(2) - (3)].net)), 0); }
     break;
 
   case 128:
-#line 393 "regex.y"
-    { frec++; fargptr[frec] = 0 ;declare_function_name((yyvsp[(1) - (2)].string)) ; add_function_argument((yyvsp[(2) - (2)].net)); ;}
+
+/* Line 1806 of yacc.c  */
+#line 390 "regex.y"
+    { (yyval.net) = fsm_close_sigma(fsm_copy((yyvsp[(2) - (3)].net)), 1); }
     break;
 
   case 129:
-#line 395 "regex.y"
-    { add_function_argument((yyvsp[(2) - (3)].net)); ;}
+
+/* Line 1806 of yacc.c  */
+#line 391 "regex.y"
+    { (yyval.net) = fsm_equal_substrings((yyvsp[(2) - (7)].net),(yyvsp[(4) - (7)].net),(yyvsp[(6) - (7)].net)); }
     break;
 
   case 130:
-#line 396 "regex.y"
-    { add_function_argument((yyvsp[(2) - (3)].net)); ;}
+
+/* Line 1806 of yacc.c  */
+#line 394 "regex.y"
+    { frec++; fargptr[frec] = 0 ;declare_function_name((yyvsp[(1) - (3)].string)) ; add_function_argument((yyvsp[(2) - (3)].net)); }
     break;
 
   case 131:
-#line 399 "regex.y"
-    { add_function_argument((yyvsp[(2) - (3)].net)); if (((yyval.net) = function_apply()) == NULL) YYERROR; ;}
+
+/* Line 1806 of yacc.c  */
+#line 396 "regex.y"
+    { frec++; fargptr[frec] = 0 ;declare_function_name((yyvsp[(1) - (2)].string)) ; add_function_argument((yyvsp[(2) - (2)].net)); }
     break;
 
   case 132:
-#line 401 "regex.y"
-    { add_function_argument((yyvsp[(2) - (3)].net)); if (((yyval.net) = function_apply()) == NULL) YYERROR; ;}
+
+/* Line 1806 of yacc.c  */
+#line 398 "regex.y"
+    { add_function_argument((yyvsp[(2) - (3)].net)); }
     break;
 
   case 133:
-#line 403 "regex.y"
-    { if (((yyval.net) = function_apply()) == NULL) YYERROR;;}
+
+/* Line 1806 of yacc.c  */
+#line 399 "regex.y"
+    { add_function_argument((yyvsp[(2) - (3)].net)); }
+    break;
+
+  case 134:
+
+/* Line 1806 of yacc.c  */
+#line 402 "regex.y"
+    { add_function_argument((yyvsp[(2) - (3)].net)); if (((yyval.net) = function_apply(defined_nets, defined_funcs)) == NULL) YYERROR; }
     break;
 
+  case 135:
+
+/* Line 1806 of yacc.c  */
+#line 404 "regex.y"
+    { add_function_argument((yyvsp[(2) - (3)].net)); if (((yyval.net) = function_apply(defined_nets, defined_funcs)) == NULL) YYERROR; }
+    break;
 
-/* Line 1267 of yacc.c.  */
-#line 2793 "regex.tab.c"
+  case 136:
+
+/* Line 1806 of yacc.c  */
+#line 406 "regex.y"
+    { if (((yyval.net) = function_apply(defined_nets, defined_funcs)) == NULL) YYERROR;}
+    break;
+
+
+
+/* Line 1806 of yacc.c  */
+#line 3092 "regex.c"
       default: break;
     }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
@@ -2820,52 +3130,55 @@ yyreduce:
 | yyerrlab -- here on detecting error |
 `------------------------------------*/
 yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
       ++yynerrs;
 #if ! YYERROR_VERBOSE
-      yyerror (&yylloc, scanner, YY_("syntax error"));
+      yyerror (&yylloc, scanner, defined_nets, defined_funcs, YY_("syntax error"));
 #else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
       {
-	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-	  {
-	    YYSIZE_T yyalloc = 2 * yysize;
-	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
-	    if (yymsg != yymsgbuf)
-	      YYSTACK_FREE (yymsg);
-	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-	    if (yymsg)
-	      yymsg_alloc = yyalloc;
-	    else
-	      {
-		yymsg = yymsgbuf;
-		yymsg_alloc = sizeof yymsgbuf;
-	      }
-	  }
-
-	if (0 < yysize && yysize <= yymsg_alloc)
-	  {
-	    (void) yysyntax_error (yymsg, yystate, yychar);
-	    yyerror (&yylloc, scanner, yymsg);
-	  }
-	else
-	  {
-	    yyerror (&yylloc, scanner, YY_("syntax error"));
-	    if (yysize != 0)
-	      goto yyexhaustedlab;
-	  }
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (&yylloc, scanner, defined_nets, defined_funcs, yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
       }
+# undef YYSYNTAX_ERROR
 #endif
     }
 
-  yyerror_range[0] = yylloc;
+  yyerror_range[1] = yylloc;
 
   if (yyerrstatus == 3)
     {
-      /* If just tried and failed to reuse look-ahead token after an
+      /* If just tried and failed to reuse lookahead token after an
 	 error, discard it.  */
 
       if (yychar <= YYEOF)
@@ -2877,12 +3190,12 @@ yyerrlab:
       else
 	{
 	  yydestruct ("Error: discarding",
-		      yytoken, &yylval, &yylloc, scanner);
+		      yytoken, &yylval, &yylloc, scanner, defined_nets, defined_funcs);
 	  yychar = YYEMPTY;
 	}
     }
 
-  /* Else will try to reuse look-ahead token after shifting the error
+  /* Else will try to reuse lookahead token after shifting the error
      token.  */
   goto yyerrlab1;
 
@@ -2898,7 +3211,7 @@ yyerrorlab:
   if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
 
-  yyerror_range[0] = yylsp[1-yylen];
+  yyerror_range[1] = yylsp[1-yylen];
   /* Do not reclaim the symbols of the rule which action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -2917,7 +3230,7 @@ yyerrlab1:
   for (;;)
     {
       yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
+      if (!yypact_value_is_default (yyn))
 	{
 	  yyn += YYTERROR;
 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2932,23 +3245,20 @@ yyerrlab1:
       if (yyssp == yyss)
 	YYABORT;
 
-      yyerror_range[0] = *yylsp;
+      yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp, yylsp, scanner);
+		  yystos[yystate], yyvsp, yylsp, scanner, defined_nets, defined_funcs);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   *++yyvsp = yylval;
 
-  yyerror_range[1] = yylloc;
+  yyerror_range[2] = yylloc;
   /* Using YYLLOC is tempting, but would change the location of
-     the look-ahead.  YYLOC is available though.  */
-  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+     the lookahead.  YYLOC is available though.  */
+  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
   *++yylsp = yyloc;
 
   /* Shift the error token.  */
@@ -2972,20 +3282,25 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
 yyexhaustedlab:
-  yyerror (&yylloc, scanner, YY_("memory exhausted"));
+  yyerror (&yylloc, scanner, defined_nets, defined_funcs, YY_("memory exhausted"));
   yyresult = 2;
   /* Fall through.  */
 #endif
 
 yyreturn:
-  if (yychar != YYEOF && yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-		 yytoken, &yylval, &yylloc, scanner);
+  if (yychar != YYEMPTY)
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval, &yylloc, scanner, defined_nets, defined_funcs);
+    }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
@@ -2993,7 +3308,7 @@ yyreturn:
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp, yylsp, scanner);
+		  yystos[*yyssp], yyvsp, yylsp, scanner, defined_nets, defined_funcs);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
@@ -3009,6 +3324,8 @@ yyreturn:
 }
 
 
-#line 405 "regex.y"
+
+/* Line 2067 of yacc.c  */
+#line 408 "regex.y"
 
 
diff --git a/back-ends/foma/regex.h b/back-ends/foma/regex.h
index da6d741..841056c 100644
--- a/back-ends/foma/regex.h
+++ b/back-ends/foma/regex.h
@@ -1,24 +1,21 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* Skeleton interface for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+/* Bison interface for Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -29,10 +26,11 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -106,122 +104,47 @@
      ADDSINK = 322,
      LEFTREWR = 323,
      FLATTEN = 324,
-     ARROW = 325,
-     DIRECTION = 326,
-     HIGH_CROSS_PRODUCT = 327,
-     CROSS_PRODUCT = 328,
-     COMPOSE = 329,
-     MINUS = 330,
-     INTERSECT = 331,
-     UNION = 332,
-     COMPLEMENT = 333,
-     INVERSE = 334,
-     REVERSE = 335,
-     KLEENE_PLUS = 336,
-     KLEENE_STAR = 337,
-     TERM_NEGATION = 338
+     SUBLABEL = 325,
+     CLOSESIGMA = 326,
+     CLOSESIGMAUNK = 327,
+     ARROW = 328,
+     DIRECTION = 329,
+     HIGH_CROSS_PRODUCT = 330,
+     CROSS_PRODUCT = 331,
+     COMPOSE = 332,
+     MINUS = 333,
+     INTERSECT = 334,
+     UNION = 335,
+     COMPLEMENT = 336,
+     INVERSE = 337,
+     REVERSE = 338,
+     KLEENE_PLUS = 339,
+     KLEENE_STAR = 340,
+     TERM_NEGATION = 341
    };
 #endif
-/* Tokens.  */
-#define NET 258
-#define END 259
-#define LBRACKET 260
-#define RBRACKET 261
-#define LPAREN 262
-#define RPAREN 263
-#define ENDM 264
-#define ENDD 265
-#define CRESTRICT 266
-#define CONTAINS 267
-#define CONTAINS_OPT_ONE 268
-#define CONTAINS_ONE 269
-#define XUPPER 270
-#define XLOWER 271
-#define FLAG_ELIMINATE 272
-#define IGNORE_ALL 273
-#define IGNORE_INTERNAL 274
-#define CONTEXT 275
-#define NCONCAT 276
-#define MNCONCAT 277
-#define MORENCONCAT 278
-#define LESSNCONCAT 279
-#define DOUBLE_COMMA 280
-#define COMMA 281
-#define SHUFFLE 282
-#define PRECEDES 283
-#define FOLLOWS 284
-#define RIGHT_QUOTIENT 285
-#define LEFT_QUOTIENT 286
-#define INTERLEAVE_QUOTIENT 287
-#define UQUANT 288
-#define EQUANT 289
-#define VAR 290
-#define IN 291
-#define IMPLIES 292
-#define BICOND 293
-#define EQUALS 294
-#define NEQ 295
-#define SUBSTITUTE 296
-#define SUCCESSOR_OF 297
-#define PRIORITY_UNION_U 298
-#define PRIORITY_UNION_L 299
-#define LENIENT_COMPOSE 300
-#define TRIPLE_DOT 301
-#define LDOT 302
-#define RDOT 303
-#define FUNCTION 304
-#define SUBVAL 305
-#define ISUNAMBIGUOUS 306
-#define ISIDENTITY 307
-#define ISFUNCTIONAL 308
-#define NOTID 309
-#define LOWERUNIQ 310
-#define LOWERUNIQEPS 311
-#define ALLFINAL 312
-#define UNAMBIGUOUSPART 313
-#define AMBIGUOUSPART 314
-#define AMBIGUOUSDOMAIN 315
-#define EQSUBSTRINGS 316
-#define LETTERMACHINE 317
-#define MARKFSMTAIL 318
-#define MARKFSMTAILLOOP 319
-#define MARKFSMMIDLOOP 320
-#define MARKFSMLOOP 321
-#define ADDSINK 322
-#define LEFTREWR 323
-#define FLATTEN 324
-#define ARROW 325
-#define DIRECTION 326
-#define HIGH_CROSS_PRODUCT 327
-#define CROSS_PRODUCT 328
-#define COMPOSE 329
-#define MINUS 330
-#define INTERSECT 331
-#define UNION 332
-#define COMPLEMENT 333
-#define INVERSE 334
-#define REVERSE 335
-#define KLEENE_PLUS 336
-#define KLEENE_STAR 337
-#define TERM_NEGATION 338
-
 
 
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 188 "regex.y"
 {
+
+/* Line 2068 of yacc.c  */
+#line 186 "regex.y"
+
      char *string;
      struct fsm *net;
      int  type;
-}
-/* Line 1529 of yacc.c.  */
-#line 221 "regex.h"
-        YYSTYPE;
+
+
+
+/* Line 2068 of yacc.c  */
+#line 144 "regex.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
@@ -240,3 +163,4 @@ typedef struct YYLTYPE
 #endif
 
 
+
diff --git a/back-ends/foma/regex.l b/back-ends/foma/regex.l
index 17de8b1..bb8c08e 100644
--- a/back-ends/foma/regex.l
+++ b/back-ends/foma/regex.l
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2010 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -21,8 +21,16 @@
 %option yylineno
 %{
 #include <stdio.h>
-#include "regex.h"
 #include "foma.h"
+#include "regex.h"
+
+struct defs {
+    struct defined_networks *defined_nets;
+    struct defined_functions *defined_funcs;
+};
+
+#define YY_EXTRA_TYPE struct defs *
+
 #define YY_USER_ACTION yylloc->first_line = yylloc->last_line = yylineno; yylloc->first_column = yycolumn; yylloc->last_column = yycolumn+yyleng-1; yycolumn += yyleng;
 
 #define MAX_PARSE_DEPTH 100
@@ -52,83 +60,88 @@ extern struct fsm *current_parse;
 char *yyget_text(yyscan_t yyscanner);
 char *tempstr, *tempstr2;
 int yylex_init (yyscan_t* scanner);
+int yylex_init_extra (struct defs *defptr, yyscan_t *scanner);
 int yylex_destroy (yyscan_t scanner);
-int my_yyparse(char *my_string, int lineno);
+int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 
 int yywrap(yyscan_t scanner) {return 1; }
 
 int yyerror(YYLTYPE* yylloc, yyscan_t scanner, char *msg) {
    if(yylloc->first_line)
-     fprintf(stderr, "%d.%d-%d.%d: error: ", yylloc->first_line, yylloc->first_column, yylloc->last_line, yylloc->last_column);
-   printf("%s%s at '%s'.\n", "***", msg, yyget_text(scanner));
+       fprintf(stderr, "%d.%d-%d.%d: error: ", yylloc->first_line, yylloc->first_column, yylloc->last_line, yylloc->last_column);
+   fprintf(stderr, "%s%s at '%s'.\n", "***", msg, yyget_text(scanner));
    return 1;
 }
 
-struct fsm *fsm_parse_regex(char *regex) {
-  char *newregex;
-  current_parse = NULL;
-  newregex = xxmalloc(sizeof(char)*(strlen(regex)+2));
-  strcpy(newregex, regex);
-  strcat(newregex, ";");
-  if (my_yyparse(newregex,1) == 0) {
-    xxfree(newregex);
-    return(fsm_minimize(current_parse));
-  } else {
-    xxfree(newregex);
-    return(NULL);
-  }
+struct fsm *fsm_parse_regex(char *regex, struct defined_networks *defined_nets, struct defined_functions *defined_funcs) {
+    char *newregex;
+    current_parse = NULL;
+    newregex = xxmalloc(sizeof(char)*(strlen(regex)+2));
+    strcpy(newregex, regex);
+    strcat(newregex, ";");
+    if (my_yyparse(newregex, 1, defined_nets, defined_funcs) == 0) {
+	xxfree(newregex);
+	return(fsm_minimize(current_parse));
+    } else {
+	xxfree(newregex);
+	return(NULL);
+    }
 }
 
+/* Only used when reading regex from file */
 struct fsm *fsm_parse_regex_string(char *regex) {
-  current_parse = NULL;
-  if (my_yyparse(regex,1) == 0) {
-    xxfree(regex);
-    return(fsm_minimize(current_parse));
-  } else {
-    xxfree(regex);
-    return(NULL);
-  }
+    current_parse = NULL;
+    if (my_yyparse(regex,1,g_defines,g_defines_f) == 0) {
+	xxfree(regex);
+	return(fsm_minimize(current_parse));
+    } else {
+	xxfree(regex);
+	return(NULL);
+    }
 }
 
-void yyset_lineno (int line_number, yyscan_t yyscanner);
-
-int my_yyparse(char *my_string, int lineno) {
-   int yyp;
-   yyscan_t scanner;
-   
-   yylex_init(&scanner);
-   YY_BUFFER_STATE my_string_buffer;
-   my_string_buffer = yy_scan_string(my_string, scanner);
-   yyset_lineno(lineno, scanner);
-   if (g_parse_depth > 0) {
-      if (g_parse_depth >= MAX_PARSE_DEPTH) {
-        fprintf(stderr,"Exceeded parser stack depth.  Self-recursive call?\n");
-        return 1;
-      }
-      /* Save variables on stack */
-      parservarstack[g_parse_depth].rewrite = rewrite;
-      parservarstack[g_parse_depth].rule_direction = rule_direction;
-      parservarstack[g_parse_depth].contexts = contexts;
-      parservarstack[g_parse_depth].rules = rules;
-      parservarstack[g_parse_depth].rewrite_rules = rewrite_rules;     
-   }
-   g_parse_depth++;
-   yyp = yyparse(scanner);
-   g_parse_depth--;
-   if (g_parse_depth > 0) {
-     /* Restore parse variables */
-     rewrite        = parservarstack[g_parse_depth].rewrite;
-     rule_direction = parservarstack[g_parse_depth].rule_direction;
-     contexts       = parservarstack[g_parse_depth].contexts;
-     rules          = parservarstack[g_parse_depth].rules;
-     rewrite_rules  = parservarstack[g_parse_depth].rewrite_rules;
-   }
-   yy_delete_buffer(my_string_buffer, scanner);
-   yylex_destroy(scanner);
-   return yyp;
+void yyset_lineno(int line_number, yyscan_t yyscanner);
+
+int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs) {
+    int yyp;
+    yyscan_t scanner;
+    struct defs defsptr[1];
+    YY_BUFFER_STATE my_string_buffer;
+
+    defsptr->defined_nets = defined_nets;
+    defsptr->defined_funcs = defined_funcs;
+    yylex_init_extra(defsptr, &scanner);
+
+    my_string_buffer = yy_scan_string(my_string, scanner);
+    yyset_lineno(lineno, scanner);
+    if (g_parse_depth > 0) {
+	if (g_parse_depth >= MAX_PARSE_DEPTH) {
+	    fprintf(stderr,"Exceeded parser stack depth.  Self-recursive call?\n");
+	    return 1;
+	}
+	/* Save variables on stack */
+	parservarstack[g_parse_depth].rewrite = rewrite;
+	parservarstack[g_parse_depth].rule_direction = rule_direction;
+	parservarstack[g_parse_depth].contexts = contexts;
+	parservarstack[g_parse_depth].rules = rules;
+	parservarstack[g_parse_depth].rewrite_rules = rewrite_rules;
+    }
+    g_parse_depth++;
+    yyp = yyparse(scanner, defined_nets, defined_funcs);
+    g_parse_depth--;
+    if (g_parse_depth > 0) {
+	/* Restore parse variables */
+	rewrite        = parservarstack[g_parse_depth].rewrite;
+	rule_direction = parservarstack[g_parse_depth].rule_direction;
+	contexts       = parservarstack[g_parse_depth].contexts;
+	rules          = parservarstack[g_parse_depth].rules;
+	rewrite_rules  = parservarstack[g_parse_depth].rewrite_rules;
+    }
+    yy_delete_buffer(my_string_buffer, scanner);
+    yylex_destroy(scanner);
+    return yyp;
 }
 
-
 %}
 
 ANYUTF      [\001-\177]|[\300-\337].|[\340-\357]..|[\360-\367]...
@@ -145,73 +158,73 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
  /* we're matching braced strings */
 
 {BRACED} {
-  yylval_param->net = fsm_explode(yytext);
-  return NET;
+    yylval_param->net = fsm_explode(yytext);
+    return NET;
 }
 
  /* Read binary file */
 ([\100]["][^"]+[\042]) {
-  tempstr = xxstrndup(yytext+2,yyleng-3);
-  yylval_param->net = fsm_read_binary_file(tempstr);
-  xxfree(tempstr);
-  if (yylval_param->net != NULL) {
-    return NET;
-  }
+    tempstr = xxstrndup(yytext+2,yyleng-3);
+    yylval_param->net = fsm_read_binary_file(tempstr);
+    xxfree(tempstr);
+    if (yylval_param->net != NULL) {
+	return NET;
+    }
 }
 
  /* Read regex from file */
 ([\100]re["][^"]+[\042]) {
-  tempstr = xxstrndup(yytext+4,yyleng-5);
-  tempstr2 = file_to_mem(tempstr);
-  xxfree(tempstr);
-  if (tempstr2 != NULL) {
-    yylval_param->net = fsm_parse_regex_string(tempstr2);
-    if (yylval_param->net != NULL) {
-       return NET;
-     }  
-  }
+    tempstr = xxstrndup(yytext+4,yyleng-5);
+    tempstr2 = file_to_mem(tempstr);
+    xxfree(tempstr);
+    if (tempstr2 != NULL) {
+	yylval_param->net = fsm_parse_regex_string(tempstr2);
+	if (yylval_param->net != NULL) {
+	    return NET;
+	}  
+    }
 }
 
  /* Read text file */
 ([\100]txt["][^"]+[\042]) {
-  tempstr = xxstrndup(yytext+5,yyleng-6);
-  yylval_param->net = fsm_read_text_file(tempstr);
-  xxfree(tempstr);
-  if (yylval_param->net != NULL) {
-    return NET;
-  }
+    tempstr = xxstrndup(yytext+5,yyleng-6);
+    yylval_param->net = fsm_read_text_file(tempstr);
+    xxfree(tempstr);
+    if (yylval_param->net != NULL) {
+	return NET;
+    }
 }
 
  /* Read spaced text file */
 ([\100]stxt["][^"]+[\042]) {
-  tempstr = xxstrndup(yytext+6,yyleng-7);
-  yylval_param->net = fsm_read_spaced_text_file(tempstr);
-  xxfree(tempstr);
-  if (yylval_param->net != NULL) {
-    return NET;
-  }
+    tempstr = xxstrndup(yytext+6,yyleng-7);
+    yylval_param->net = fsm_read_spaced_text_file(tempstr);
+    xxfree(tempstr);
+    if (yylval_param->net != NULL) {
+	return NET;
+    }
 }
 
 (\^[0-9]+) {
-  //yylval_param->string = xxstrdup(yytext+1);
-  yylval_param->string = yytext+1;
-  return NCONCAT;
+    //yylval_param->string = xxstrdup(yytext+1);
+    yylval_param->string = yytext+1;
+    return NCONCAT;
 }
 
 (\^\{[0-9]+[ ]*,[ ]*[0-9]+\}) {
-  //yylval_param->string = xxstrdup(yytext+2);
-  yylval_param->string = yytext+2;
-  return MNCONCAT;
+    //yylval_param->string = xxstrdup(yytext+2);
+    yylval_param->string = yytext+2;
+    return MNCONCAT;
 }
 (\^\>[0-9]+) {
-  yylval_param->string = yytext+2;
+    yylval_param->string = yytext+2;
 //  yylval_param->string = xxstrdup(yytext+2);
-  return MORENCONCAT;
+    return MORENCONCAT;
 }
 (\^\<[0-9]+) {
-  //  yylval_param->string = xxstrdup(yytext+2);
- yylval_param->string = yytext+2;
-  return LESSNCONCAT;
+    //  yylval_param->string = xxstrdup(yytext+2);
+    yylval_param->string = yytext+2;
+    return LESSNCONCAT;
 }
 
 ((\ |\t)+) {
@@ -220,12 +233,12 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
 
  /* Start of universal quantifier */
 [\050][\342][\210][\200]/(([\000-\177]{-}[\051])|[\300-\337].|[\340-\357]..|[\360-\367]...)+[\051] {
- BEGIN(UQ);
+    BEGIN(UQ);
 }
  
  /* Start of existential quantifier */
 [\050][\342][\210][\203]/(([\000-\177]{-}[\051])|[\300-\337].|[\340-\357]..|[\360-\367]...)+[\051] {
- BEGIN(EQ);
+    BEGIN(EQ);
 }
 
 
@@ -233,34 +246,34 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
  /* Add quantifier to quantifier symbol table */
 
  //yylval_param->string = xxstrdup(yytext);
- yylval_param->string = yytext;
- add_quantifier(yytext);
- BEGIN(ENDQ);
- return(UQUANT);
+    yylval_param->string = yytext;
+    add_quantifier(yytext);
+    BEGIN(ENDQ);
+    return(UQUANT);
 }
 
 <EQ>(([\000-\177]{-}[\051])|[\300-\337].|[\340-\357]..|[\360-\367]...)+/[\051] {
- /* Add quantifier to quantifier symbol table */
- //yylval_param->string = xxstrdup(yytext);
- yylval_param->string = yytext;
- add_quantifier(yytext);
- BEGIN(ENDQ);
- return(EQUANT);
+    /* Add quantifier to quantifier symbol table */
+    //yylval_param->string = xxstrdup(yytext);
+    yylval_param->string = yytext;
+    add_quantifier(yytext);
+    BEGIN(ENDQ);
+    return(EQUANT);
 }
 
 <ENDQ>[\051] {BEGIN(INITIAL);}
 
  /* Start of a quoted sequence of symbols */
 [\042]/([\300-\337].|[\340-\357]..|[\360-\367]...|[\001-\041]|[\043-\177])+[\042] {
-  BEGIN(QTD);
+    BEGIN(QTD);
 }
 
  /* Stuff that goes inside " ", including UTF8 \uHHHH sequences */
 <QTD>([\300-\337].|[\340-\357]..|[\360-\367]...|[\001-\041]|[\043-\177])+/[\042] {
-  decode_quoted(yytext);										  
-  yylval_param->net = fsm_symbol(yytext);
-  BEGIN(QTDEND);
-  return NET;
+    decode_quoted(yytext);										  
+    yylval_param->net = fsm_symbol(yytext);
+    BEGIN(QTDEND);
+    return NET;
 }
 
  /* Disregard end quote */
@@ -304,6 +317,9 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
 (_addsink\()         { return ADDSINK;         }
 (_leftrewr\()        { return LEFTREWR;        }
 (_flatten\()         { return FLATTEN;         }
+(_sublabel\()        { return SUBLABEL;        }
+(_close\()           { return CLOSESIGMA;      }
+(_closeu\()           { return CLOSESIGMAUNK;   }
 
 ({NONRESERVED}+\() {
    yylval_param->string = xxstrdup(yytext);
@@ -344,8 +360,8 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
   }
   //  yylval_param->string = xxstrdup(yytext);
   yylval_param->string = yytext;
-  if(find_defined(yytext) != NULL) {
-    yylval_param->net = fsm_copy(find_defined(yytext));
+  if(find_defined(yyextra->defined_nets, yytext) != NULL) {
+    yylval_param->net = fsm_copy(find_defined(yyextra->defined_nets, yytext));
   } else if (find_quantifier(yytext) != NULL) {
       return VAR;
   } else {
diff --git a/back-ends/foma/regex.y b/back-ends/foma/regex.y
index 75f00fb..0e65af9 100644
--- a/back-ends/foma/regex.y
+++ b/back-ends/foma/regex.y
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2011 Mans Hulden                                     */
+/*     Copyright © 2008-2014 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -23,7 +23,7 @@
 #define MAX_F_RECURSION 100
 extern int yyerror();
 extern int yylex();
-extern int my_yyparse(char *my_string);
+extern int my_yyparse(char *my_string, int lineno, struct defined_networks *defined_nets, struct defined_functions *defined_funcs);
 struct fsm *current_parse;
 int rewrite, rule_direction;
 int substituting = 0;
@@ -52,15 +52,14 @@ void declare_function_name(char *s) {
     xxfree(s);
 }
 
-struct fsm *function_apply(void) {
+struct fsm *function_apply(struct defined_networks *defined_nets, struct defined_functions *defined_funcs) {
     int i, mygsym, myfargptr;
     char *regex;
     char repstr[13], oldstr[13];
-    if ((regex = find_defined_function(fname[frec],fargptr[frec])) == NULL) {
-        printf("***Error: function %s@%i) not defined!\n",fname[frec], fargptr[frec]);
+    if ((regex = find_defined_function(defined_funcs, fname[frec],fargptr[frec])) == NULL) {
+        fprintf(stderr, "***Error: function %s@%i) not defined!\n",fname[frec], fargptr[frec]);
         return NULL;
     }
-
     regex = xxstrdup(regex);
     mygsym = g_internal_sym;
     myfargptr = fargptr[frec];
@@ -68,19 +67,18 @@ struct fsm *function_apply(void) {
     /* and parse that */
     for (i = 0; i < fargptr[frec]; i++) {
         sprintf(repstr,"%012X",g_internal_sym);
-        sprintf(oldstr, "@ARGUMENT%02i@", (i+1));       
+        sprintf(oldstr, "@ARGUMENT%02i@", (i+1));
         streqrep(regex, oldstr, repstr);
         /* We temporarily define a network and save argument there */
         /* The name is a running counter g_internal_sym */
-        add_defined(fargs[i][frec], repstr);
+        add_defined(defined_nets, fargs[i][frec], repstr);
         g_internal_sym++;
     }
-    
-    my_yyparse(regex);
+    my_yyparse(regex,1,defined_nets, defined_funcs);
     for (i = 0; i < myfargptr; i++) {
         sprintf(repstr,"%012X",mygsym);
         /* Remove the temporarily defined network */
-        remove_defined(repstr);
+        remove_defined(defined_nets, repstr);
         mygsym++;
     }
     xxfree(fname[frec]);
@@ -192,9 +190,11 @@ void add_rule(struct fsm *L, struct fsm *R, struct fsm *R2, int type) {
 }
 
 %pure-parser
-%expect 644
-%parse-param {void     *scanner } /* Assume yyparse is called with this argument */
-%lex-param   {yyscan_t *scanner } /* Call flex functions with this argument      */
+%expect 686
+%parse-param { void *scanner }
+%parse-param { struct defined_networks *defined_nets }
+%parse-param { struct defined_functions *defined_funcs } /* Assume yyparse is called with this argument */
+%lex-param   { yyscan_t *scanner } /* Call flex functions with this argument      */
 %locations
 %initial-action {
     clear_quantifiers();
@@ -222,7 +222,7 @@ void add_rule(struct fsm *L, struct fsm *R, struct fsm *R2, int type) {
 */
 
 %token <net> NET
-%token <string> END LBRACKET RBRACKET LPAREN RPAREN ENDM ENDD CRESTRICT CONTAINS CONTAINS_OPT_ONE CONTAINS_ONE XUPPER XLOWER FLAG_ELIMINATE IGNORE_ALL IGNORE_INTERNAL CONTEXT NCONCAT MNCONCAT MORENCONCAT LESSNCONCAT DOUBLE_COMMA COMMA SHUFFLE PRECEDES FOLLOWS RIGHT_QUOTIENT LEFT_QUOTIENT INTERLEAVE_QUOTIENT UQUANT EQUANT VAR IN IMPLIES BICOND EQUALS NEQ SUBSTITUTE SUCCESSOR_OF PRIORITY_UNION_U PRIORITY_UNION_L LENIENT_COMPOSE TRIPLE_DOT LDOT RDOT FUNCTION SUBVAL ISUNAMBIGUOUS ISIDENTITY  [...]
+%token <string> END LBRACKET RBRACKET LPAREN RPAREN ENDM ENDD CRESTRICT CONTAINS CONTAINS_OPT_ONE CONTAINS_ONE XUPPER XLOWER FLAG_ELIMINATE IGNORE_ALL IGNORE_INTERNAL CONTEXT NCONCAT MNCONCAT MORENCONCAT LESSNCONCAT DOUBLE_COMMA COMMA SHUFFLE PRECEDES FOLLOWS RIGHT_QUOTIENT LEFT_QUOTIENT INTERLEAVE_QUOTIENT UQUANT EQUANT VAR IN IMPLIES BICOND EQUALS NEQ SUBSTITUTE SUCCESSOR_OF PRIORITY_UNION_U PRIORITY_UNION_L LENIENT_COMPOSE TRIPLE_DOT LDOT RDOT FUNCTION SUBVAL ISUNAMBIGUOUS ISIDENTITY  [...]
 
 %token <type> ARROW DIRECTION
 
@@ -385,7 +385,10 @@ network12: fend    { $$ = $1; } |
          ADDSINK network RPAREN { $$ = fsm_add_sink($2,1); } |
          LEFTREWR network COMMA network RPAREN { $$ = fsm_left_rewr($2,$4); } |
          FLATTEN network COMMA network RPAREN { $$ = fsm_flatten($2,$4); } |
-         EQSUBSTRINGS network COMMA network COMMA network RPAREN { $$ = fsm_equal_substrings($2,$4,$6); } 
+         SUBLABEL network COMMA network COMMA network RPAREN { $$ = fsm_substitute_label($2, fsm_network_to_char($4), $6); } |
+         CLOSESIGMA    network RPAREN { $$ = fsm_close_sigma(fsm_copy($2), 0); } |
+         CLOSESIGMAUNK network RPAREN { $$ = fsm_close_sigma(fsm_copy($2), 1); } |
+         EQSUBSTRINGS network COMMA network COMMA network RPAREN { $$ = fsm_equal_substrings($2,$4,$6); }
       
 fstart: FUNCTION network COMMA
 { frec++; fargptr[frec] = 0 ;declare_function_name($1) ; add_function_argument($2); }
@@ -396,10 +399,10 @@ fmid:   fstart network COMMA   { add_function_argument($2); }
 |       fmid   network COMMA   { add_function_argument($2); }
 
 fend:   fmid   network RPAREN  
-{ add_function_argument($2); if (($$ = function_apply()) == NULL) YYERROR; }
+{ add_function_argument($2); if (($$ = function_apply(defined_nets, defined_funcs)) == NULL) YYERROR; }
 |       fstart network RPAREN  
-{ add_function_argument($2); if (($$ = function_apply()) == NULL) YYERROR; }
+{ add_function_argument($2); if (($$ = function_apply(defined_nets, defined_funcs)) == NULL) YYERROR; }
 |       fstart         RPAREN  
-{ if (($$ = function_apply()) == NULL) YYERROR;}
+{ if (($$ = function_apply(defined_nets, defined_funcs)) == NULL) YYERROR;}
 
 %%
diff --git a/back-ends/foma/reverse.c b/back-ends/foma/reverse.c
index 194dc36..eb9f1c3 100644
--- a/back-ends/foma/reverse.c
+++ b/back-ends/foma/reverse.c
@@ -29,14 +29,14 @@ struct fsm *fsm_reverse(struct fsm *net) {
     fsm_construct_copy_sigma(revh, net->sigma);
 
     while (fsm_get_next_arc(inh)) {
-        fsm_construct_add_arc_nums(revh, fsm_get_arc_target(inh)+1, fsm_get_arc_source(inh)+1, fsm_get_arc_num_in(inh), fsm_get_arc_num_out(inh));
+	fsm_construct_add_arc_nums(revh, fsm_get_arc_target(inh)+1, fsm_get_arc_source(inh)+1, fsm_get_arc_num_in(inh), fsm_get_arc_num_out(inh));
     }
 
     while ((i = fsm_get_next_final(inh)) != -1) {
-        fsm_construct_add_arc_nums(revh, 0, i+1, EPSILON, EPSILON);
+	fsm_construct_add_arc_nums(revh, 0, i+1, EPSILON, EPSILON);
     }
     while ((i = fsm_get_next_initial(inh)) != -1) {
-        fsm_construct_set_final(revh, i+1);
+	fsm_construct_set_final(revh, i+1);
     }
     fsm_construct_set_initial(revh, 0);
     fsm_read_done(inh);
diff --git a/back-ends/foma/rewrite.c b/back-ends/foma/rewrite.c
index 64a3137..a4304d8 100644
--- a/back-ends/foma/rewrite.c
+++ b/back-ends/foma/rewrite.c
@@ -631,7 +631,7 @@ void fsm_clear_contexts(struct fsmcontexts *contexts) {
 struct fsm *rewrite_pad(struct fsm *net) {
     struct fsm *pad;
     /* [? 0:"@>@" ? 0:"@<@"]* [? 0:"@>@" ?] */
-    pad = fsm_minimize(fsm_parse_regex("[? 0:\"@>@\" ? 0:\"@<@\"]* [? 0:\"@>@\" ?]"));
+    pad = fsm_minimize(fsm_parse_regex("[? 0:\"@>@\" ? 0:\"@<@\"]* [? 0:\"@>@\" ?]", NULL, NULL));
     return(fsm_minimize(fsm_lower(fsm_compose(net,pad))));
 }
 
@@ -710,11 +710,11 @@ struct fsm *rewrite_cp_to_fst(struct fsm *net, char *lower_symbol, char *zero_sy
         _Bool crowded;
     } *state_link;
     
-    int i, j, t, lower, zero, mark_count, *targets, linecount, in, out, has_unk;
+    int i, j, t, lower, zero, *targets, linecount, in, out, has_unk;
     _Bool *useless_states;
     struct fsm_state *fsm, *fsm2, *tempfsm;
 
-    mark_count = 0; has_unk = 0;
+    has_unk = 0;
 
     if ((lower = sigma_find(lower_symbol, net->sigma)) == -1)
         return(net);
diff --git a/back-ends/foma/sigma.c b/back-ends/foma/sigma.c
index 2ac8a81..3d58608 100644
--- a/back-ends/foma/sigma.c
+++ b/back-ends/foma/sigma.c
@@ -336,16 +336,15 @@ struct ssort {
   int number;
 };
 
-
-#ifdef _MSC_VER
+#ifdef ORIGINAL
+int ssortcmp(struct ssort *a, struct ssort *b) {
+  return(strcmp(a->symbol, b->symbol));
+}
+#else
   int ssortcmp(const void *a, const void *b) {
     return(strcmp(((struct ssort*)a)->symbol, ((struct ssort*)b)->symbol));
   }
-#else
-  int ssortcmp(struct ssort *a, struct ssort *b) {
-    return(strcmp(a->symbol, b->symbol));
-  }
-#endif // _MSC_VER
+#endif
 
 struct sigma *sigma_copy(struct sigma *sigma) {
     int f = 0;
@@ -374,11 +373,11 @@ struct sigma *sigma_copy(struct sigma *sigma) {
 /* and sorts the sigma based on the symbol string contents        */
 
 int sigma_sort(struct fsm *net) {
-#ifdef _MSC_VER
-  int(*comp)(const void*, const void*) = ssortcmp;
-#else
+#ifdef ORIGINAL
   int(*comp)() = ssortcmp;
-#endif // _MSC_VER
+#else
+  int(*comp)(const void*, const void*) = ssortcmp;
+#endif
   int size, i, max, *replacearray;
   struct ssort *ssort;
   struct sigma *sigma;
diff --git a/back-ends/foma/spelling.c b/back-ends/foma/spelling.c
index f5c6227..426eab4 100644
--- a/back-ends/foma/spelling.c
+++ b/back-ends/foma/spelling.c
@@ -34,7 +34,7 @@
 #define BITCLEAR(a,b) ((a)[BITSLOT(b)] &= ~BITMASK(b))
 #define BITTEST(a,b) ((a)[BITSLOT(b)] & BITMASK(b))
 #define BITNSLOTS(nb) ((nb + CHAR_BIT - 1) / CHAR_BIT)
-#define min_(X, Y)  ((X) < (Y) ? (X) : (Y))  // HFST modification: msvc compiler complains about macro redefinition if 'min' is used
+#define min_(X, Y)  ((X) < (Y) ? (X) : (Y))
 
 static int calculate_h(struct apply_med_handle *medh, int *intword, int currpos, int state);
 static struct astarnode *node_delete_min();
@@ -314,7 +314,6 @@ char *apply_med(struct apply_med_handle *medh, char *word) {
                 break;
             }
             medh->lines++;
-            target = medh->curr_ptr->target;
             if (medh->curr_ptr->final_state && medh->curr_pos == medh->utf8len) {
                 if (medh->curr_node_has_match == 0) {
                     /* Found a match */
@@ -731,11 +730,10 @@ void fsm_create_letter_lookup(struct apply_med_handle *medh, struct fsm *net) {
 }
 
 void cmatrix_print_att(struct fsm *net, FILE *outfile) {
-    int lsymbol, i, j, *cm, maxsigma;
+    int i, j, *cm, maxsigma;
     maxsigma = sigma_max(net->sigma) + 1;
     cm = net->medlookup->confusion_matrix;
 
-    lsymbol = 0 ;
 
     for (i = 0; i < maxsigma ; i++) {        
         for (j = 0; j < maxsigma ; j++) {
diff --git a/back-ends/foma/stringhash.c b/back-ends/foma/stringhash.c
index 604782c..fa13331 100644
--- a/back-ends/foma/stringhash.c
+++ b/back-ends/foma/stringhash.c
@@ -32,15 +32,15 @@ void sh_done(struct sh_handle *sh) {
     int i;
     struct sh_hashtable *hash, *hashp;
     for (i=0; i < STRING_HASH_SIZE; i++) {
-        hash = sh->hash + i;
-        if (hash->string != NULL)
-            xxfree(hash->string);
-        for (hash=hash->next ; hash != NULL ; hash = hashp) {
-            hashp = hash->next;
-            if (hash->string != NULL)
-                xxfree(hash->string);
-            xxfree(hash);
-        }
+	hash = sh->hash + i;
+	if (hash->string != NULL)
+	    xxfree(hash->string);
+	for (hash=hash->next ; hash != NULL ; hash = hashp) {
+	    hashp = hash->next;
+	    if (hash->string != NULL)
+		xxfree(hash->string);
+	    xxfree(hash);
+	}
     }
     xxfree(sh->hash);
     xxfree(sh);
@@ -53,12 +53,12 @@ int sh_get_value(struct sh_handle *sh) {
 char *sh_find_string(struct sh_handle *sh, char *string) {
     struct sh_hashtable *hash;
     for (hash = sh->hash + sh_hashf(string) ; hash != NULL; hash = hash->next) {
-        if (hash->string == NULL)
-            return NULL;
-        if (strcmp(hash->string, string) == 0) {
-            sh->lastvalue = hash->value;
-            return(hash->string);
-        }
+	if (hash->string == NULL)
+	    return NULL;
+	if (strcmp(hash->string, string) == 0) {
+	    sh->lastvalue = hash->value;
+	    return(hash->string);
+	}
     }
     return NULL;
 }
@@ -67,9 +67,9 @@ char *sh_find_add_string(struct sh_handle *sh, char *string, int value) {
     char *s;
     s = sh_find_string(sh, string);
     if (s == NULL)
-        return (sh_add_string(sh, string, value));
+	return (sh_add_string(sh, string, value));
     else
-        return(s);
+	return(s);
 }
 
 char *sh_add_string(struct sh_handle *sh, char *string, int value) {
@@ -77,16 +77,16 @@ char *sh_add_string(struct sh_handle *sh, char *string, int value) {
     
     hash = sh->hash + sh_hashf(string);
     if (hash->string == NULL) {
-        hash->string = xxstrdup(string);
-        hash->value = value;
-        return(hash->string);
+	hash->string = xxstrdup(string);
+	hash->value = value;
+	return(hash->string);
     } else {
-        newhash = xxmalloc(sizeof(struct sh_hashtable));
-        newhash->string = xxstrdup(string);
-        newhash->value = value;
-        newhash->next = hash->next;
-        hash->next = newhash;
-        return(newhash->string);
+	newhash = xxmalloc(sizeof(struct sh_hashtable));
+	newhash->string = xxstrdup(string);
+	newhash->value = value;
+	newhash->next = hash->next;
+	hash->next = newhash;
+	return(newhash->string);
     }
 }
 
diff --git a/back-ends/foma/structures.c b/back-ends/foma/structures.c
index d6e78f8..2a17ec9 100644
--- a/back-ends/foma/structures.c
+++ b/back-ends/foma/structures.c
@@ -18,7 +18,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#ifndef _MSC_VER
+#if defined(ORIGINAL) || ! defined(_MSC_VER)
   #include <sys/time.h>
 #endif
 #include "foma.h"
@@ -31,68 +31,67 @@ char *fsm_get_library_version_string() {
     return(s);
 }
 
-
-#ifdef _MSC_VER
-int linesortcompin(const void *a, const void *b) {
-  return (((struct fsm_state*)a)->in - ((struct fsm_state*)b)->in);
-}
-int linesortcompout(const void *a, const void *b) {
-  return (((struct fsm_state*)a)->out - ((struct fsm_state*)b)->out);
-}
-#else
+#ifdef ORIGINAL
 int linesortcompin(struct fsm_state *a, struct fsm_state *b) {
-  return (a->in - b->in);
+    return (a->in - b->in);
 }
+
 int linesortcompout(struct fsm_state *a, struct fsm_state *b) {
-  return (a->out - b->out);
+    return (a->out - b->out);
 }
-#endif // _MSC_VER
+#else
+  int linesortcompin(const void *a, const void *b) {
+      return (((struct fsm_state*)a)->in - ((struct fsm_state*)b)->in);
+    }
+  int linesortcompout(const void *a, const void *b) {
+      return (((struct fsm_state*)a)->out - ((struct fsm_state*)b)->out);
+    }
+#endif
+
 
 void fsm_sort_arcs(struct fsm *net, int direction) {
     /* direction 1 = in, direction = 2, out */
     struct fsm_state *fsm;
     int i, lasthead, numlines;
-
-#ifdef _MSC_VER
-    int(*scin)(const void*, const void*) = linesortcompin;
-    int(*scout)(const void*, const void*) = linesortcompout;
-#else
+#ifdef ORIGINAL
     int(*scin)() = linesortcompin;
     int(*scout)() = linesortcompout;
-#endif // _MSC_VER
-
+#else
+    int(*scin)(const void*, const void*) = linesortcompin;
+    int(*scout)(const void*, const void*) = linesortcompout;
+#endif
     fsm = net->states;
     for (i=0, numlines = 0, lasthead = 0 ; (fsm+i)->state_no != -1; i++) {
-        if ((fsm+i)->state_no != (fsm+i+1)->state_no || (fsm+i)->target == -1) {
-            numlines++;
-            if ((fsm+i)->target == -1) {
-                numlines--;
-            }
-            if (numlines > 1) {
-                /* Sort, set numlines = 0 */
-                if (direction == 1)
-                    qsort(fsm+lasthead, numlines, sizeof(struct fsm_state), scin);
-                else
-                    qsort(fsm+lasthead, numlines, sizeof(struct fsm_state), scout);             
-            }
-            numlines = 0;
-            lasthead = i + 1;
-            continue;
-        }
-        numlines++;
+	if ((fsm+i)->state_no != (fsm+i+1)->state_no || (fsm+i)->target == -1) {
+	    numlines++;
+	    if ((fsm+i)->target == -1) {
+		numlines--;
+	    }
+	    if (numlines > 1) {
+		/* Sort, set numlines = 0 */
+		if (direction == 1)
+		    qsort(fsm+lasthead, numlines, sizeof(struct fsm_state), scin);
+		else
+		    qsort(fsm+lasthead, numlines, sizeof(struct fsm_state), scout);		
+	    }
+	    numlines = 0;
+	    lasthead = i + 1;
+	    continue;
+	}
+	numlines++;
     }
     if (net->arity == 1) {
-        net->arcs_sorted_in = 1;
-        net->arcs_sorted_out = 1;
-        return;
+	net->arcs_sorted_in = 1;
+	net->arcs_sorted_out = 1;
+	return;
     }
     if (direction == 1) {
-        net->arcs_sorted_in = 1;
-        net->arcs_sorted_out = 0;
+	net->arcs_sorted_in = 1;
+	net->arcs_sorted_out = 0;
     }
     if (direction == 2) {
-        net->arcs_sorted_out = 1;
-        net->arcs_sorted_in = 0;
+	net->arcs_sorted_out = 1;
+	net->arcs_sorted_in = 0;
     }    
 }
 
@@ -126,11 +125,10 @@ struct fsm *fsm_sigma_net(struct fsm *net) {
     int pathcount;
 
     if (sigma_size(net->sigma) == 0) {
-        fsm_destroy(net);
+	fsm_destroy(net);
         return(fsm_empty_set());
     }
     
-    sig = net->sigma;
     fsm_state_init(sigma_max(net->sigma));
     fsm_state_set_current_state(0, 0, 1);
     pathcount = 0;
@@ -198,12 +196,12 @@ struct fsm *fsm_sigma_pairs_net(struct fsm *net) {
 int fsm_sigma_destroy(struct sigma *sigma) {
     struct sigma *sig, *sigp;
     for (sig = sigma, sigp = NULL; sig != NULL; sig = sigp) {
-        sigp = sig->next;
-        if (sig->symbol != NULL) {
-            xxfree(sig->symbol);
-            sig->symbol = NULL;
-        }
-        xxfree(sig);
+	sigp = sig->next;
+	if (sig->symbol != NULL) {
+	    xxfree(sig->symbol);
+	    sig->symbol = NULL;
+	}
+	xxfree(sig);
     }
     return 1;
 }
@@ -214,17 +212,17 @@ int fsm_destroy(struct fsm *net) {
     }
     if (net->medlookup != NULL && net->medlookup->confusion_matrix != NULL) {
         xxfree(net->medlookup->confusion_matrix);
-        net->medlookup->confusion_matrix = NULL;
+	net->medlookup->confusion_matrix = NULL;
     }
     if (net->medlookup != NULL) {
         xxfree(net->medlookup);
-        net->medlookup = NULL;
+	net->medlookup = NULL;
     }
     fsm_sigma_destroy(net->sigma);
     net->sigma = NULL;
     if (net->states != NULL) {
         xxfree(net->states);
-        net->states = NULL;
+	net->states = NULL;
     }
     xxfree(net);
     return(1);
@@ -338,38 +336,38 @@ int fsm_issequential(struct fsm *net) {
     struct fsm_state *fsm;
     sigtable = xxcalloc(sigma_max(net->sigma)+1,sizeof(int));
     for (i = 0 ; i < sigma_max(net->sigma)+1; i++) {
-        sigtable[i] = -2;
+	sigtable[i] = -2;
     }
     fsm = net->states;
     seentrans = epstrans = 0;
     laststate = -1;
     for (sequential = 1, i = 0; (fsm+i)->state_no != -1 ; i++) {
-        insym = (fsm+i)->in;
-        if (insym < 0) {
-            continue;
-        }
-        if ((fsm+i)->state_no != laststate) {
-            laststate = (fsm+i)->state_no;
-            epstrans = 0;
-            seentrans = 0;
-        }
-        if (*(sigtable+insym) == laststate || epstrans == 1) {
-            sequential = 0;
-            break;
-        }
-        if (insym == EPSILON) {
-            if (epstrans == 1 || seentrans == 1) {
-                sequential = 0;
-                break;
-            }
-            epstrans = 1;
-        }
-        *(sigtable+insym) = laststate;
-        seentrans = 1;
+	insym = (fsm+i)->in;
+	if (insym < 0) {
+	    continue;
+	}
+	if ((fsm+i)->state_no != laststate) {
+	    laststate = (fsm+i)->state_no;
+	    epstrans = 0;
+	    seentrans = 0;
+	}
+	if (*(sigtable+insym) == laststate || epstrans == 1) {
+	    sequential = 0;
+	    break;
+	}
+	if (insym == EPSILON) {
+	    if (epstrans == 1 || seentrans == 1) {
+		sequential = 0;
+		break;
+	    }
+	    epstrans = 1;
+	}
+	*(sigtable+insym) = laststate;
+	seentrans = 1;
     }
     xxfree(sigtable);
     if (!sequential)
-        printf("fails at state %i\n",(fsm+i)->state_no);
+	printf("fails at state %i\n",(fsm+i)->state_no);
     return(sequential);
 }
 
@@ -434,7 +432,7 @@ int fsm_isidentity(struct fsm *net) {
 
     struct state_array *state_array;
     struct fsm_state *curr_ptr;
-    int i, j, v, vp, num_states, factor = 0, newlength, startfrom;
+    int i, j, v, vp, num_states, factor = 0, newlength = 1, startfrom;
     short int in, out, *newstring;
     struct discrepancy *discrepancy, *currd, *targetd;
 
@@ -657,7 +655,7 @@ struct fsm *fsm_extract_nonidentity(struct fsm *net) {
     struct state_array *state_array;
     struct fsm_state *curr_ptr;
     struct fsm *net2;
-    int i, j, v, vp, num_states, factor = 0, newlength, startfrom, killnum;
+    int i, j, v, vp, num_states, factor = 0, newlength = 1, startfrom, killnum;
     short int in, out, *newstring;
     struct discrepancy *discrepancy, *currd, *targetd;
 
@@ -824,7 +822,7 @@ int count_quantifiers() {
     struct defined_quantifiers *q;
     int i;
     for (i = 0, q = quantifiers; q != NULL; q = q->next) {
-        i++;
+	i++;
     }
     return(i);
 }
@@ -832,14 +830,14 @@ int count_quantifiers() {
 void add_quantifier (char *string) {
     struct defined_quantifiers *q;
     if (quantifiers == NULL) {
-        q = xxmalloc(sizeof(struct defined_quantifiers));
-        quantifiers = q;
+	q = xxmalloc(sizeof(struct defined_quantifiers));
+	quantifiers = q;
     } else { 
-        for (q = quantifiers; q->next != NULL; q = q->next) {
-            
-        }
-        q->next = xxmalloc(sizeof(struct defined_quantifiers));
-        q = q->next;
+	for (q = quantifiers; q->next != NULL; q = q->next) {
+	    
+	}
+	q->next = xxmalloc(sizeof(struct defined_quantifiers));
+	q = q->next;
     }
     q->name = xxstrdup(string);
     q->next = NULL;
@@ -859,13 +857,13 @@ struct fsm *union_quantifiers() {
     for (syms = 0, symlo = 0, q = quantifiers; q != NULL; q = q->next) {
       s = sigma_add(q->name, net->sigma);
       if (symlo == 0) {
-        symlo = s;
+	symlo = s;
       }
       syms++;
     }
     net->states = xxmalloc(sizeof(struct fsm_state)*(syms+1));
     for (i = 0; i < syms; i++) {
-        add_fsm_arc(net->states, i, 0, symlo+i, symlo+i, 0, 1, 1);
+	add_fsm_arc(net->states, i, 0, symlo+i, symlo+i, 0, 1, 1);
     }
     add_fsm_arc(net->states, i, -1, -1, -1, -1 ,-1 ,-1);
     net->arccount = syms;
@@ -877,8 +875,8 @@ struct fsm *union_quantifiers() {
 char *find_quantifier (char *string) {
     struct defined_quantifiers *q;
     for (q = quantifiers; q != NULL; q = q->next) {
-        if (strcmp(string,q->name) == 0)
-            return q->name;
+	if (strcmp(string,q->name) == 0)
+	    return q->name;
     }
     return(NULL);
 }
@@ -886,13 +884,13 @@ char *find_quantifier (char *string) {
 void purge_quantifier (char *string) {
     struct defined_quantifiers *q, *q_prev;    
     for (q = quantifiers, q_prev = NULL; q != NULL; q_prev = q, q = q->next) {
-        if (strcmp(string, q->name) == 0) {
-            if (q_prev != NULL) {
-                q_prev->next = q->next;
-            } else {
-                quantifiers = q->next;
-            }
-        }
+	if (strcmp(string, q->name) == 0) {
+	    if (q_prev != NULL) {
+		q_prev->next = q->next;
+	    } else {
+		quantifiers = q->next;
+	    }
+	}
     }
 }
 
diff --git a/back-ends/foma/topsort.c b/back-ends/foma/topsort.c
index 258b0fa..3ed77b5 100644
--- a/back-ends/foma/topsort.c
+++ b/back-ends/foma/topsort.c
@@ -53,11 +53,11 @@ struct fsm *fsm_topsort (struct fsm *net) {
     treated =  xxmalloc(sizeof(unsigned char)*net->statecount);
    
     for (i=0; i < net->statecount; i++) {
-        *(statemap+i) = -1;
-        *(invcount+i) = 0;
-        *(treated+i) = 0;
-        *(order+i) = 0;
-        *(pathcount+i) = 0;
+	*(statemap+i) = -1;
+	*(invcount+i) = 0;
+	*(treated+i) = 0;
+	*(order+i) = 0;
+	*(pathcount+i) = 0;
     }
 
     for (i=0, lc=0; (fsm+i)->state_no != -1; i++) {        
@@ -71,9 +71,9 @@ struct fsm *fsm_topsort (struct fsm *net) {
                 goto cyclic;
             }
         }
-        if (*(statemap+(fsm+i)->state_no) == -1) {
-            *(statemap+(fsm+i)->state_no) = i;
-        }
+	if (*(statemap+(fsm+i)->state_no) == -1) {
+	    *(statemap+(fsm+i)->state_no) = i;
+	}
     }
 
     treatcount = net->statecount;
diff --git a/back-ends/foma/trie.c b/back-ends/foma/trie.c
index 1806e90..77d3066 100644
--- a/back-ends/foma/trie.c
+++ b/back-ends/foma/trie.c
@@ -38,32 +38,32 @@ struct fsm *fsm_trie_done(struct fsm_trie_handle *th) {
     struct trie_hash *thash, *thashp;
     struct fsm *newnet;
     struct fsm_construct_handle *newh;
-    int i;
+    unsigned int i;
 
     newh = fsm_construct_init("name");
-    for (i=0; i < THASH_TABLESIZE; i++) {
-        thash = (th->trie_hash)+i;
-        for ( ; thash != NULL; thash = thash->next) {
-            if (thash->insym != NULL) {
-                fsm_construct_add_arc(newh, thash->sourcestate, thash->targetstate, thash->insym, thash->outsym);
-            } else {
-                break;
-            }           
-        }
+    for (i = 0; i < THASH_TABLESIZE; i++) {
+	thash = (th->trie_hash)+i;
+	for ( ; thash != NULL; thash = thash->next) {
+	    if (thash->insym != NULL) {
+		fsm_construct_add_arc(newh, thash->sourcestate, thash->targetstate, thash->insym, thash->outsym);
+	    } else {
+		break;
+	    }		
+	}
     }
     for (i = 0; i <= th->used_states; i++) {
-        if ((th->trie_states+i)->is_final == 1) {
-            fsm_construct_set_final(newh, i);
-        }
+	if ((th->trie_states+i)->is_final == 1) {
+	    fsm_construct_set_final(newh, i);
+	}
     }
     fsm_construct_set_initial(newh, 0);
     newnet = fsm_construct_done(newh);
     /* Free all mem */
     for (i=0; i < THASH_TABLESIZE; i++) {
-        for (thash=((th->trie_hash)+i)->next; thash != NULL; thash = thashp) {
-            thashp = thash->next;
-            xxfree(thash);
-        }
+	for (thash=((th->trie_hash)+i)->next; thash != NULL; thash = thashp) {
+	    thashp = thash->next;
+	    xxfree(thash);
+	}
     }
     sh_done(th->sh_hash);
     xxfree(th->trie_states);
@@ -72,19 +72,15 @@ struct fsm *fsm_trie_done(struct fsm_trie_handle *th) {
     return(newnet);
 }
 
-void fsm_trie_new_word(struct fsm_trie_handle *th) {
-
-}
-
 void fsm_trie_add_word(struct fsm_trie_handle *th, char *word) {
     int i, len;
     char *wcopy;
     wcopy = xxstrdup(word);
     len = strlen(wcopy);
     for (i=0 ; *word != '\0' && i < len; word = word + utf8skip(word)+1, i++) {
-        strncpy(wcopy, word, utf8skip(word)+1);
-        *(wcopy+utf8skip(word)+1) = '\0';
-        fsm_trie_symbol(th, wcopy, wcopy);
+	strncpy(wcopy, word, utf8skip(word)+1);
+	*(wcopy+utf8skip(word)+1) = '\0';
+	fsm_trie_symbol(th, wcopy, wcopy);
     }
     xxfree(wcopy);
     fsm_trie_end_word(th);
@@ -101,13 +97,13 @@ void fsm_trie_symbol(struct fsm_trie_handle *th, char *insym, char *outsym) {
 
     h = trie_hashf(th->trie_cursor, insym, outsym);
     if ((th->trie_hash+h)->insym != NULL) {
-        for (thash = th->trie_hash+h; thash != NULL; thash = thash->next) {
-            if (strcmp(thash->insym, insym) == 0 && strcmp(thash->outsym, outsym) == 0 && thash->sourcestate == th->trie_cursor) {
-                /* Exists, move cursor */
-                th->trie_cursor = thash->targetstate;
-                return;
-            }
-        }
+	for (thash = th->trie_hash+h; thash != NULL; thash = thash->next) {
+	    if (strcmp(thash->insym, insym) == 0 && strcmp(thash->outsym, outsym) == 0 && thash->sourcestate == th->trie_cursor) {
+		/* Exists, move cursor */
+		th->trie_cursor = thash->targetstate;
+		return;
+	    }
+	}
     }
     /* Doesn't exist */
     
@@ -115,25 +111,25 @@ void fsm_trie_symbol(struct fsm_trie_handle *th, char *insym, char *outsym) {
     th->used_states++;
     thash = th->trie_hash+h;
     if (thash->insym == NULL) {
-        thash->insym = sh_find_add_string(th->sh_hash, insym,1);
-        thash->outsym = sh_find_add_string(th->sh_hash, outsym,1);
-        thash->sourcestate = th->trie_cursor;
-        thash->targetstate = th->used_states;
+	thash->insym = sh_find_add_string(th->sh_hash, insym,1);
+	thash->outsym = sh_find_add_string(th->sh_hash, outsym,1);
+	thash->sourcestate = th->trie_cursor;
+	thash->targetstate = th->used_states;
     } else {
-        newthash = xxcalloc(1, sizeof(struct trie_hash));
-        newthash->next = thash->next;
-        newthash->insym = sh_find_add_string(th->sh_hash, insym,1);
-        newthash->outsym = sh_find_add_string(th->sh_hash, outsym,1);
-        newthash->sourcestate = th->trie_cursor;
-        newthash->targetstate = th->used_states;
-        thash->next = newthash;
+	newthash = xxcalloc(1, sizeof(struct trie_hash));
+	newthash->next = thash->next;
+	newthash->insym = sh_find_add_string(th->sh_hash, insym,1);
+	newthash->outsym = sh_find_add_string(th->sh_hash, outsym,1);
+	newthash->sourcestate = th->trie_cursor;
+	newthash->targetstate = th->used_states;
+	thash->next = newthash;
     }
     th->trie_cursor = th->used_states;
 
     /* Realloc */
     if (th->used_states >= th->statesize) {
-        th->statesize = next_power_of_two(th->statesize);
-        th->trie_states = xxrealloc(th->trie_states, th->statesize * sizeof(struct trie_states));
+	th->statesize = next_power_of_two(th->statesize);
+	th->trie_states = xxrealloc(th->trie_states, th->statesize * sizeof(struct trie_states));
     }
     (th->trie_states+th->used_states)->is_final = 0;
 }
diff --git a/back-ends/foma/utf8.c b/back-ends/foma/utf8.c
index d205d4e..b8c1999 100644
--- a/back-ends/foma/utf8.c
+++ b/back-ends/foma/utf8.c
@@ -1,5 +1,5 @@
 /*     Foma: a finite-state toolkit and library.                             */
-/*     Copyright © 2008-2010 Mans Hulden                                     */
+/*     Copyright © 2008-2015 Mans Hulden                                     */
 
 /*     This file is part of foma.                                            */
 
@@ -49,8 +49,21 @@ char *trim(char *string) {
     return(string);
 }
 
+/* Reverses string in-place */
+char *xstrrev(char *str) {
+      char *p1, *p2;
+      if (! str || ! *str)
+            return str;
+      for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2) {
+            *p1 ^= *p2;
+            *p2 ^= *p1;
+            *p1 ^= *p2;
+      }
+      return str;
+}
+
 char *escape_string(char *string, char chr) {
-    int i,j;
+    size_t i,j;
     char *newstring;
     for (i=0,j=0; i < strlen(string); i++) {
         if (string[i] == chr) {
@@ -139,9 +152,9 @@ char *streqrep(char *s, char *oldstring, char *newstring) {
 int ishexstr (char *str) {
     int i;
     for (i=0; i<4; i++) {
-        if ((*(str+i) > 0x2f && *(str+i) < 0x3a) || (*(str+i) > 0x40 && *(str+i) < 0x47) || (*(str+i) > 0x60 && *(str+i) < 0x67))
-            continue;
-        return 0;
+	if ((*(str+i) > 0x2f && *(str+i) < 0x3a) || (*(str+i) > 0x40 && *(str+i) < 0x47) || (*(str+i) > 0x60 && *(str+i) < 0x67))
+	    continue;
+	return 0;
     }
     return 1;
 }
@@ -154,6 +167,42 @@ int utf8strlen(char *str) {
     return j;
 }
 
+/* Checks if the next character in the string is a combining character     */
+/* according to Unicode 7.0                                                */
+/* i.e. codepoints 0300-036F  Combining Diacritical Marks                  */
+/*                 1AB0-1ABE  Combining Diacritical Marks Extended         */
+/*                 1DC0-1DFF  Combining Diacritical Marks Supplement       */
+/*                 20D0-20F0  Combining Diacritical Marks for Symbols      */
+/*                 FE20-FE2D  Combining Half Marks                         */
+/* Returns number of bytes of char. representation, or 0 if not combining  */
+
+int utf8iscombining(unsigned char *s) {
+    if (*s == '\0' || *(s+1) == '\0')
+	return 0;
+    if (!(*s == 0xcc || *s == 0xcd || *s == 0xe1 || *s == 0xe2 || *s == 0xef))
+	return 0;
+    /* 0300-036F */
+    if (*s == 0xcc && *(s+1) >= 0x80 && *(s+1) <= 0xbf)
+	return 2;
+    if (*s == 0xcd && *(s+1) >= 0x80 && *(s+1) <= 0xaf)
+	return 2;
+    if (*(s+2) == '\0')
+	return 0;
+    /* 1AB0-1ABE */
+    if (*s == 0xe1 && *(s+1) == 0xaa && *(s+2) >= 0xb0 && *(s+2) <= 0xbe)
+	return 3;
+    /* 1DC0-1DFF */
+    if (*s == 0xe1 && *(s+1) == 0xb7 && *(s+2) >= 0x80 && *(s+2) <= 0xbf)
+	return 3;
+    /* 20D0-20F0 */
+    if (*s == 0xe2 && *(s+1) == 0x83 && *(s+2) >= 0x90 && *(s+2) <= 0xb0)
+	return 3;
+    /* FE20-FE2D */
+    if (*s == 0xef && *(s+1) == 0xb8 && *(s+2) >= 0xa0 && *(s+2) <= 0xad)
+	return 3;
+    return 0;
+}
+
 int utf8skip(char *str) {
   unsigned char s;
 
diff --git a/check_installation/check-ospell.sh b/check_installation/check-ospell.sh
new file mode 100755
index 0000000..03f70e0
--- /dev/null
+++ b/check_installation/check-ospell.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+#
+# Perform tests in ./ospell_tests.
+#
+
+PREFIX=
+
+if [ "$1" = "-h" -o "$1" = "--help" ]; then
+    echo ""
+    echo "  Usage:  "$0" [--prefix PREFIX]"
+    echo ""
+    exit 0;
+elif [ "$1" = "--prefix" ]; then
+    PREFIX=$2"/";
+fi
+
+TESTDIR=ospell_tests
+
+if [ ! -d "$TESTDIR" ]; then
+    echo "ERROR: directory" $TESTDIR "does not exist"
+    exit 1;
+fi
+
+echo "---------------------- "
+echo "Testing hfst-ospell... "
+echo "---------------------- "
+
+echo ""
+echo "Moving to directory" `pwd`"/"$TESTDIR"..."
+echo ""
+cd $TESTDIR
+
+if ! ($PREFIX/hfst-ospell --help > /dev/null 2> /dev/null); then
+    echo "FAIL: hfst-ospell tests did not pass: hfst-ospell was not found"
+    echo ""
+    echo "Exiting directory" `pwd`"..."
+    echo ""
+
+    cd ..
+    exit 1
+fi
+
+if ! (ls test.zhfst > /dev/null 2> /dev/null); then
+    echo "SKIP: file test.zhfst not found"
+    echo ""
+    echo "Exiting directory" `pwd`"..."
+    echo ""
+
+    cd ..
+    exit 1
+fi
+
+if ! (cat ospell_input.txt | $PREFIX/hfst-ospell test.zhfst --suggest --time-cutoff=1.0 > /dev/null 2> /dev/null); then
+    echo "FAIL: hfst-ospell tests did not pass:"
+    echo ""
+    echo "Exiting directory" `pwd`"..."
+    echo ""
+
+    cd ..
+    exit 1
+fi
+
+if ! (cat ospell_input.txt | $PREFIX/hfst-ospell test.zhfst --suggest > /dev/null 2> /dev/null); then
+    echo "FAIL: hfst-ospell tests did not pass:"
+    echo ""
+    echo "Exiting directory" `pwd`"..."
+    echo ""
+
+    cd ..
+    exit 1
+fi
+
+if ! (cat ospell_input.txt | $PREFIX/hfst-ospell test.zhfst > /dev/null 2> /dev/null); then
+    echo "FAIL: hfst-ospell tests did not pass:"
+    echo ""
+    echo "Exiting directory" `pwd`"..."
+    echo ""
+
+    cd ..
+    exit 1
+fi
+
+
+echo "PASS: hfst-ospell tests passed"
+echo ""
+echo "Exiting directory" `pwd`"..."
+echo ""
+
+cd ..
+
+
+
diff --git a/check_installation/check-python.sh b/check_installation/check-python.sh
new file mode 100755
index 0000000..56a3b29
--- /dev/null
+++ b/check_installation/check-python.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#
+# Perform tests in ./python_tests. Before executing this script,
+# run copy-python-tests.sh to create ./python_tests.
+#
+
+TESTDIR=python_tests
+
+if [ ! -d "$TESTDIR" ]; then
+    echo "ERROR: directory" $TESTDIR "does not exist, try running ./copy-python-tests.sh first."
+    exit 1;
+fi
+
+echo "----------------------------------- "
+echo "Testing Python bindings for HFST... "
+echo "----------------------------------- "
+
+echo ""
+echo "Moving to directory" `pwd`"/"$TESTDIR"..."
+echo ""
+cd $TESTDIR
+
+# ./test.sh --python python3
+if ! (python3 test_hfst.py > /dev/null 2> /dev/null && python3 examples.py > /dev/null 2> /dev/null); then
+    echo "FAIL: Python tests did not pass"
+    echo ""
+    echo "Exiting directory" `pwd`"..."
+    echo ""
+
+    cd ..
+    exit 1
+fi
+
+echo "PASS: Python tests passed"
+echo ""
+echo "Exiting directory" `pwd`"..."
+echo ""
+
+cd ..
+
+
+
diff --git a/check_installation/check-swig.sh b/check_installation/check-swig.sh
deleted file mode 100755
index d30a507..0000000
--- a/check_installation/check-swig.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-#
-# Perform tests in ./swig_tests. Before executing this script,
-# run copy-swig-tests.sh to create ./swig_tests.
-#
-
-TESTDIR=swig_tests
-
-if [ ! -d "$TESTDIR" ]; then
-    echo "ERROR: directory" $TESTDIR "does not exist, try running ./copy-swig-tests.sh first."
-    exit 1;
-fi
-
-echo "---------------------------------------- "
-echo "Testing SWIG/Python bindings for HFST... "
-echo "---------------------------------------- "
-
-echo ""
-echo "Moving to directory" `pwd`"/"$TESTDIR"..."
-echo ""
-cd $TESTDIR
-
-./test.sh --python python3
-
-echo ""
-echo "Exiting directory" `pwd`"..."
-echo ""
-
-cd ..
diff --git a/check_installation/copy-swig-tests.sh b/check_installation/copy-python-tests.sh
similarity index 85%
rename from check_installation/copy-swig-tests.sh
rename to check_installation/copy-python-tests.sh
index fa17293..18b9cff 100755
--- a/check_installation/copy-swig-tests.sh
+++ b/check_installation/copy-python-tests.sh
@@ -6,10 +6,10 @@
 # of swig bindings instead of the ones in ../swig.
 #
 
-TESTDIR=./swig_tests/
+TESTDIR=./python_tests/
 
 # Copy hfst3/swig/test
-cd ../swig/test
+cd ../python/test
 files_to_copy=`svn list`
 cd ../../check_installation
 
@@ -20,7 +20,7 @@ mkdir $TESTDIR
 
 for file in $files_to_copy;
 do
-    cp ../swig/test/$file $TESTDIR
+    cp ../python/test/$file $TESTDIR
 done
 
 cd $TESTDIR
diff --git a/check_installation/copy-tool-tests.sh b/check_installation/copy-tool-tests.sh
index 72881c5..4261572 100755
--- a/check_installation/copy-tool-tests.sh
+++ b/check_installation/copy-tool-tests.sh
@@ -39,7 +39,9 @@ do
     fi
 done
 # this file uses 'tooldir' instead of 'TOOLDIR'
-sed -i 's/$\tooldir\//$1/g' pmatch-tester.sh
+# sed -i 's/$\tooldir\//$1/g' pmatch-tester.sh
+
+
 
 # These tests are rewritten in directory check_installation
 rm empty-input.sh
@@ -59,6 +61,11 @@ rm lexc-compiler-flags-functionality.sh
 cp ../test-hfst-xfst.sh .
 cp ../test-hfst-twolc.sh .
 
+# TODO: add pmatch tests
+rm pmatch-tests.sh
+rm pmatch-tester.sh
+rm pmatch-functionality.sh
+
 # The tagger tools are experimental so they are not tested
 
 cd ..
diff --git a/check_installation/dist-README b/check_installation/dist-README
index 00b4d3b..4a837cb 100644
--- a/check_installation/dist-README
+++ b/check_installation/dist-README
@@ -3,15 +3,28 @@ To test that installed HFST functionalities work as they should, run one
 or more of the tests below:
 
   ./check-tools.sh             # Command line tools
-  ./check-swig.sh              # SWIG/Python bindings
+  ./check-python.sh            # Python bindings
   ./check-morphologies.sh      # Morphology scripts
+  ./check-ospell.sh            # hfst-ospell tool
 
 The tool check-tools.sh accepts the option '--prefix PREFIX' which tells
 where the HFST tools to be tested are found. 
 
-The tool check-swig.sh accepts the option '--python PYTHON' which defines
+The tool check-python.sh accepts the option '--python PYTHON' which defines
 the python program to be used (e.g. python2, python3).
 
 By default, the python program and HFST command line tools are searched
 in the locations defined the environment variable PATH.
 
+If you use check-python.sh before installation, you need to add
+'/path/to/hfst-top-dir/python/' to PYTHONPATH and 
+'/path/to/hfst-top-dir/libhfst/src/.libs/' to LD_LIBRARY_PATH. If this is
+not enough, you have to add the following lines before 'import libhst' to
+files 'test_hfst.py' and 'examples.py' in directory 'python_tests'
+
+  import sys
+  sys.path.insert(1, '/path/to/hfst-top-dir/python/')
+
+The tool check-ospell.sh accepts the option '--prefix PREFIX' which tells
+where hfst-ospell tool is found.
+
diff --git a/check_installation/make-dist.sh b/check_installation/make-dist.sh
index e78e451..20cfc73 100755
--- a/check_installation/make-dist.sh
+++ b/check_installation/make-dist.sh
@@ -17,8 +17,8 @@ fi
 
 echo "  Copying command line tool tests..."
 ./copy-tool-tests.sh
-echo "  Copying tests for swig bindings..."
-./copy-swig-tests.sh
+echo "  Copying tests for python bindings..."
+./copy-python-tests.sh
 
 if [ ! "$VERSION" = "" ]; then
     DISTDIR=check-hfst"-"$VERSION;
@@ -31,7 +31,7 @@ if [ -d "$DISTDIR" ]; then
 fi
 mkdir $DISTDIR
 
-for dir in tool_tests swig_tests morphology_tests;
+for dir in tool_tests python_tests morphology_tests ospell_tests;
 do
     if [ ! -d $dir ]; then
 	echo "ERROR: directory 'tool_tests' does not exist."
@@ -42,10 +42,12 @@ done
 cp dist-README $DISTDIR/README
 cp ./check-tools.sh $DISTDIR/
 cp --parents ./tool_tests/* $DISTDIR/
-cp ./check-swig.sh $DISTDIR/
-cp --parents ./swig_tests/* $DISTDIR/
+cp ./check-python.sh $DISTDIR/
+cp --parents ./python_tests/* $DISTDIR/
 cp ./check-morphologies.sh $DISTDIR/
 cp --parents ./morphology_tests/* $DISTDIR/
+cp ./check-ospell.sh $DISTDIR
+cp --parents ./ospell_tests/* $DISTDIR/
 
 echo "  Creating the package..." 
 tar -cvf $DISTDIR.tar $DISTDIR
diff --git a/check_installation/morphology_tests/english-analyze.output b/check_installation/morphology_tests/english-analyze.output
index 640b125..3f4c638 100644
--- a/check_installation/morphology_tests/english-analyze.output
+++ b/check_installation/morphology_tests/english-analyze.output
@@ -1,6 +1,7 @@
 All	
 All	All[ADJ]+ADJ
 All	All[ADV]+ADV
+All	All[DET]
 
 human	
 human	hum[N]+AN[N/N]+N
@@ -16,66 +17,89 @@ beings	bey[N]+ING[N/N]+N+PL
 are	
 are	A+re[N]+N
 are	are[N]+N
+are	be[V]+V+PRES
 
 born	
 born	bear+V+PPART
+born	bear[V]+V+PPART
 born	born[ADJ]+ADJ
 born	born[N]+N
+born	born[V]+V+PAST
 
 free	
 free	free[ADJ]+ADJ
 free	free[ADV]+ADV
 free	free[N]+N
+free	free[V]+V
 free	free[V]+V+INF
 
 and	
 and	A+nd[N]+N
+and	and[ADV]+ADV
+and	and[CNJ]+COORD
 
 equal	
 equal	equal[ADJ]+ADJ
 equal	equal[N]+N
+equal	equal[V]+V
 equal	equal[V]+V+INF
 
 in	
 in	in[ADJ]+ADJ
 in	in[ADV]+ADV
 in	in[N]+N
+in	in[PRP]
+in	in[V]+V+3sg+PRES
 
 dignity	
 dignity	dignity[N]+N
 
 and	
 and	A+nd[N]+N
+and	and[ADV]+ADV
+and	and[CNJ]+COORD
 
 rights	
 rights	right[N]+N+PL
 rights	right[V]+V+3sg+PRES
 
-They	+?
+.	
+.	.[PUN]
+
+They	
+They	They[PN]+PERS
 
 are	
 are	A+re[N]+N
 are	are[N]+N
+are	be[V]+V+PRES
 
 endowed	
 endowed	endow[V]+V+PAST
 endowed	endow[V]+V+PPART
 endowed	endowed[ADJ]+ADJ
 
-with	+?
+with	
+with	with[CNJ]+COORD
+with	with[PRP]
 
 reason	
 reason	reason[N]+N
+reason	reason[V]+V
 reason	reason[V]+V+INF
 
 and	
 and	A+nd[N]+N
+and	and[ADV]+ADV
+and	and[CNJ]+COORD
 
 conscience	
 conscience	conscience[N]+N
 
 and	
 and	A+nd[N]+N
+and	and[ADV]+ADV
+and	and[CNJ]+COORD
 
 should	
 should	should[V]+V+INF
@@ -83,32 +107,53 @@ should	should[V]+V+INF
 act	
 act	A+ct[N]+N
 act	act[N]+N
+act	act[V]+V
 act	act[V]+V+INF
 
-towards	+?
+towards	
+towards	towards[PRP]
 
 one	
+one	one[ADJ]
 one	one[ADJ]+ADJ
 one	one[N]+N
+one	one[PN]
+one	one[PN]+INDEF
+one	one[V]+V+INF
 
 another	
 another	another[ADJ]+ADJ
+another	another[DET]
 
 in	
 in	in[ADJ]+ADJ
 in	in[ADV]+ADV
 in	in[N]+N
+in	in[PRP]
+in	in[V]+V+3sg+PRES
 
 a	
+a	a[ADV]+ADV
+a	a[ART]
 a	a[N]+N
+a	a[PART]+INF
+a	a[PN]+PERS
+a	a[PRP]
 
 spirit	
 spirit	spirit[N]+N
+spirit	spirit[V]+V
 spirit	spirit[V]+V+INF
 
-of	+?
+of	
+of	have[V]+V+INF
+of	of[ADV]+ADV
+of	of[PRP]
 
 brotherhood	
 brotherhood	brother[N]+HOOD[N/N]+N
 brotherhood	brotherhood[N]+N
 
+.	
+.	.[PUN]
+
diff --git a/check_installation/morphology_tests/english-analyze.output b/check_installation/morphology_tests/english-analyze.output.old
similarity index 100%
copy from check_installation/morphology_tests/english-analyze.output
copy to check_installation/morphology_tests/english-analyze.output.old
diff --git a/check_installation/morphology_tests/finnish-analyze.output b/check_installation/morphology_tests/finnish-analyze.output
index 3587de5..ae5bc53 100644
--- a/check_installation/morphology_tests/finnish-analyze.output
+++ b/check_installation/morphology_tests/finnish-analyze.output
@@ -5,6 +5,7 @@ ihmiset
 ihmiset	ihminen N Nom Pl
 
 syntyvät	
+syntyvät	syntyä PrsPrc Act Pl
 syntyvät	syntyä PrsPrc Act Pos Nom Pl
 syntyvät	syntyä V Prs Act Pl3
 
@@ -13,6 +14,7 @@ vapaina	vapaa A Pos Ess Pl
 vapaina	vapaa N Ess Pl
 
 ja	
+ja	ja Adv
 ja	ja CC
 
 tasavertaisina	
@@ -23,15 +25,18 @@ arvoltaan
 arvoltaan	arvo N Abl Sg Px3
 
 ja	
+ja	ja Adv
 ja	ja CC
 
 oikeuksiltaan	
 oikeuksiltaan	oikeus N Abl Pl Px3
 
 .	
+.	. Abbr Nom Sg
 .	. Punct
 
 Heille	
+Heille	He N Prop All Pl
 Heille	He Pron Pers All Pl
 
 on	
@@ -40,22 +45,25 @@ on	olla V Prs Act Sg3
 annettu	
 annettu	annettu A Pos Nom Sg
 annettu	antaa PrfPrc Pass Pos Nom Sg
-annettu	antaa V Pst Pass ConNeg
+annettu	antaa PrfPrc Pass Sg
+annettu	antaa V Pst Pass Pe4 ConNeg
 
 järki	
 järki	järki N Nom Sg
 
 ja	
+ja	ja Adv
 ja	ja CC
 
 omatunto	
 omatunto	omatunto N Nom Sg
-omatunto	omatunto N Sg Nom
 
 ,	
+,	, Abbr Nom Sg
 ,	, Punct
 
 ja	
+ja	ja Adv
 ja	ja CC
 
 heidän	
@@ -66,17 +74,21 @@ on	olla V Prs Act Sg3
 
 toimittava	
 toimittava	toimia PrsPrc Pass Pos Nom Sg
+toimittava	toimia PrsPrc Pass Sg
 toimittava	toimittaa PrsPrc Act Pos Nom Sg
+toimittava	toimittaa PrsPrc Act Sg
 
 toisiaan	
 toisiaan	toinen N Par Pl Px3
 toisiaan	toinen Num Ord Par Pl Px3
-toisiaan	toinen Ord Par Px3#
 toisiaan	toinen Pron Par Pl Px3
+toisiaan	toinen Pron Qnt Par Pl Px3
 
 kohtaan	
 kohtaan	kohdata V Prs Act Sg1
 kohtaan	kohta N Ill Sg
+kohtaan	kohtaan Adp Po
+kohtaan	kohtaan Adp Pr
 kohtaan	kohtaan Adv
 
 veljeyden	
@@ -86,5 +98,6 @@ hengessä
 hengessä	henki N Ine Sg
 
 .	
+.	. Abbr Nom Sg
 .	. Punct
 
diff --git a/check_installation/ospell_tests/ospell_input.txt b/check_installation/ospell_tests/ospell_input.txt
new file mode 100644
index 0000000..eccf3d0
--- /dev/null
+++ b/check_installation/ospell_tests/ospell_input.txt
@@ -0,0 +1 @@
+aaamu
diff --git a/check_installation/ospell_tests/test.zhfst b/check_installation/ospell_tests/test.zhfst
new file mode 100644
index 0000000..3460521
Binary files /dev/null and b/check_installation/ospell_tests/test.zhfst differ
diff --git a/configure.ac b/configure.ac
index 7875d41..fdce722 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,8 +18,8 @@
 # Information on package
 HFST_NAME=hfst
 HFST_MAJOR=3
-HFST_MINOR=8
-HFST_EXTENSION=3
+HFST_MINOR=9
+HFST_EXTENSION=0
 HFST_VERSION=$HFST_MAJOR.$HFST_MINOR.$HFST_EXTENSION
 
 ### When the VERSION is INCREMENTED, REMEMBER to increment the LONGVERSION too.
@@ -27,11 +27,11 @@ HFST_VERSION=$HFST_MAJOR.$HFST_MINOR.$HFST_EXTENSION
 # for package-config pc file
 LIBHFST_NAME=hfst
 LIBHFST_MAJOR=3
-LIBHFST_MINOR=8
-LIBHFST_EXTENSION=3
+LIBHFST_MINOR=9
+LIBHFST_EXTENSION=0
 LIBHFST_VERSION=$LIBHFST_MAJOR.$LIBHFST_MINOR.$LIBHFST_EXTENSION
 
-AC_INIT([hfst], [3.8.3], [hfst-bugs at helsinki.fi], [hfst])
+AC_INIT([hfst], [3.9.0], [hfst-bugs at helsinki.fi], [hfst])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([-Wall std-options foreign check-news])
 
@@ -43,9 +43,9 @@ AC_CONFIG_SRCDIR([libhfst/src/HfstTransducer.h])
 AC_CONFIG_HEADERS([config.h libhfst/src/hfst.hpp])
 
 AC_SUBST([LIBHFST_MAJOR],     [3])
-AC_SUBST([LIBHFST_MINOR],     [8])
-AC_SUBST([LIBHFST_EXTENSION], [3])
-AC_SUBST([LIBHFST_VERSION],   [3.8.3])
+AC_SUBST([LIBHFST_MINOR],     [9])
+AC_SUBST([LIBHFST_EXTENSION], [0])
+AC_SUBST([LIBHFST_VERSION],   [3.9.0])
 AC_SUBST([LIBHFST_NAME],      [hfst])
 
 # long version = version vector cast in base 10000, for automatic comparisons
@@ -56,9 +56,9 @@ AC_SUBST([LIBHFST_NAME],      [hfst])
 # $LIBHFST_MINOR * 10000 + $LIBHFST_EXTENSION + "L"
 # NB! It turned out to be not portable, and can't be used!
 
-AC_DEFINE([HFST_LONGVERSION], [300080002L],
+AC_DEFINE([HFST_LONGVERSION], [300090000L],
           [Define to hfst version vector as long in base 10000])
-AC_DEFINE([HFST_REVISION], ["$Revision: 4409 $"],
+AC_DEFINE([HFST_REVISION], ["$Revision: 4580 $"],
           [Automatically substitute to configure.ac revision])
 AC_DEFINE_UNQUOTED([HFST_STRING], ["$PACKAGE_STRING"],
                    [Define to libhfst pretty name for programs to print])
@@ -759,8 +759,8 @@ AC_CONFIG_FILES([Makefile doc/Makefile test/Makefile
 		 back-ends/foma/Makefile
 		 back-ends/sfst/Makefile
 		 man/Makefile
-		 swig/Makefile
-		 swig/test/Makefile
+		 python/Makefile
+		 python/test/Makefile
 		 scripts/Makefile])
 AC_CONFIG_FILES([scripts/hfst-foma-wrapper.sh], [chmod +x scripts/hfst-foma-wrapper.sh])
 AC_CONFIG_FILES([scripts/hfst-foma], [chmod +x scripts/hfst-foma])
@@ -832,8 +832,9 @@ EOF
 dnl stick important warnings to bottom
 dnl important licensing information
 dnl according to GNU GPLv2 strict (not plus) is incompatible with Apache
-AS_IF([test "x$with_foma" != "xno" -a "x$with_openfst" != "xno"],
-      [AC_MSG_WARN([foma licensing exception is limited to HFST team’s redistribution; if you consider GPLv2 strict and Apache licence conflicting you may not _redistribute_ your binaries])])
+# No more relevant with the new version of foma
+#AS_IF([test "x$with_foma" != "xno" -a "x$with_openfst" != "xno"],
+#      [AC_MSG_WARN([foma licensing exception is limited to HFST team’s redistribution; if you consider GPLv2 strict and Apache licence conflicting you may not _redistribute_ your binaries])])
 dnl hope end users never disable ofst 
 AS_IF([test "x$with_openfst" == "xno"],
       [AC_MSG_WARN([Disabling openfst backend will severely cripple libhfst])])
diff --git a/hfst.m4 b/hfst.m4
index 48e9974..9cfe6ba 100644
--- a/hfst.m4
+++ b/hfst.m4
@@ -13,8 +13,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
diff --git a/libhfst/src/HfstExceptionDefs.cc b/libhfst/src/HfstExceptionDefs.cc
index 90378ec..17e0e79 100644
--- a/libhfst/src/HfstExceptionDefs.cc
+++ b/libhfst/src/HfstExceptionDefs.cc
@@ -17,6 +17,8 @@ HfstException::HfstException
   line(line)
 {}
 
+HfstException::~HfstException() {}
+
 std::string HfstException::operator() (void) const
 { 
   std::ostringstream o;
diff --git a/libhfst/src/HfstExceptionDefs.h b/libhfst/src/HfstExceptionDefs.h
index 7df8fe1..bd272a2 100644
--- a/libhfst/src/HfstExceptionDefs.h
+++ b/libhfst/src/HfstExceptionDefs.h
@@ -21,6 +21,7 @@ struct HfstException
   size_t line;
   HfstException(void);
   HfstException(const std::string &name,const std::string &file,size_t line);
+  ~HfstException();
   //! @brief Get the error message.
   HFSTDLL std::string operator() (void) const;
 };
diff --git a/libhfst/src/HfstFlagDiacritics.h b/libhfst/src/HfstFlagDiacritics.h
index ff9d7bd..3e6e329 100644
--- a/libhfst/src/HfstFlagDiacritics.h
+++ b/libhfst/src/HfstFlagDiacritics.h
@@ -169,7 +169,7 @@ public:
             {
                 std::string::size_type next_diacritic_pos 
                   = FdOperation::find_diacritic(remaining, length);
-                if(next_diacritic_pos == std::string::npos) // fixed
+                if(next_diacritic_pos == std::string::npos)
                     break;
         
                 std::string diacritic = remaining.substr(0, length);
diff --git a/libhfst/src/HfstInputStream.cc b/libhfst/src/HfstInputStream.cc
index 57cdd69..f2e8a01 100644
--- a/libhfst/src/HfstInputStream.cc
+++ b/libhfst/src/HfstInputStream.cc
@@ -502,8 +502,9 @@ namespace hfst
 
         if (hfst_version_2_weighted_transducer) // this should not happen
           { 
-            fprintf(stderr, "ERROR: not transducer stream\n");
-            exit(1);
+            //fprintf(stderr, "ERROR: not transducer stream\n");
+            //exit(1);
+            HFST_THROW_MESSAGE(HfstFatalException, "not transducer stream");
           }
         break;
         }
diff --git a/libhfst/src/HfstOutputStream.cc b/libhfst/src/HfstOutputStream.cc
index 313ae92..256b823 100644
--- a/libhfst/src/HfstOutputStream.cc
+++ b/libhfst/src/HfstOutputStream.cc
@@ -433,8 +433,9 @@ HfstOutputStream::append_implementation_specific_header_data(std::vector<char>&,
       // write header length using two bytes
       int header_length = (int)header.size();
       if (header_length > MAX_HEADER_LENGTH) {
-        fprintf(stderr, "ERROR: transducer header is too long\n");
-        exit(1);
+        //fprintf(stderr, "ERROR: transducer header is too long\n");
+        //exit(1);
+        HFST_THROW_MESSAGE(HfstFatalException, "transducer header is too long");
       }
 
       char first_byte = *((char*)(&header_length));
diff --git a/libhfst/src/HfstPrintDot.cc b/libhfst/src/HfstPrintDot.cc
new file mode 100644
index 0000000..726d8f2
--- /dev/null
+++ b/libhfst/src/HfstPrintDot.cc
@@ -0,0 +1,421 @@
+//! @file hfst-fst2txt.cc
+//!
+//! @brief Transducer array printing command line tool
+//!
+//! @author HFST Team
+
+
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, version 3 of the License.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include "HfstTransducer.h"
+using hfst::HfstTransducer;
+using hfst::HfstBasicTransducer;
+using hfst::implementations::HfstState;
+
+namespace hfst {
+
+void
+print_dot(FILE* out, HfstTransducer& t)
+  {
+    //fprintf(out, "// This graph generated with hfst-fst2txt\n");
+    if (t.get_name() != "")
+      {
+        fprintf(out, "digraph \"%s\" {\n", t.get_name().c_str());
+      }
+    else
+      {
+        fprintf(out, "digraph H {\n");
+      }
+    fprintf(out, "charset = UTF8;\n");
+    fprintf(out, "rankdir = LR;\n");
+    fprintf(out, "node [shape=circle,style=filled,fillcolor=yellow]\n");
+    HfstBasicTransducer* mutt = new HfstBasicTransducer(t);
+    HfstState s = 0;
+    // for some reason, dot works nicer if I first have all nodes, then arcs
+    for (HfstBasicTransducer::const_iterator state = mutt->begin();
+         state != mutt->end();
+         ++state)
+      {
+        if (mutt->is_final_state(s))
+          {
+            if (mutt->get_final_weight(s) > 0)
+              {
+                fprintf(out, "q%d [shape=doublecircle,"
+                       "label=\"q%d/\\n%.2f\"] \n",
+                        s, s, mutt->get_final_weight(s));
+              }
+            else
+              {
+                fprintf(out, "q%d [shape=doublecircle,"
+                       "label=\"q%d\"] \n",
+                        s, s);
+              }
+          }
+        else
+          {
+            fprintf(out, "q%d [label=\"q%d\"] \n", 
+                    s, s);
+          }
+        ++s;
+      } // each state
+    s = 0;
+    for (HfstBasicTransducer::const_iterator state = mutt->begin();
+         state != mutt->end();
+         ++state)
+      {
+        std::map<HfstState, std::string> target_labels;
+        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
+             state->begin();
+             arc != state->end();
+             ++arc)
+          {
+            std::string old_label = target_labels[arc->get_target_state()];
+            std::string first = arc->get_input_symbol();
+            std::string second = arc->get_output_symbol();
+            if (first == hfst::internal_epsilon)
+              {
+                first = std::string("00");
+              }
+            else if (first == hfst::internal_identity)
+              {
+                first = std::string("??");
+              }
+            else if (first == hfst::internal_unknown)
+              { 
+                first = std::string("?1");
+              }
+            if (second == hfst::internal_epsilon)
+              {
+                second = std::string("00");
+              }
+            else if (second == hfst::internal_identity)
+              {
+                second = std::string("??");
+              }
+            else if (second == hfst::internal_unknown)
+              {
+                second = std::string("?2");
+              }
+#define DOT_MAX_LABEL_SIZE 64
+            char* l = static_cast<char*>(malloc(sizeof(char) * 
+                                                DOT_MAX_LABEL_SIZE));
+            if (first == second)
+              {
+                if (arc->get_weight() > 0)
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                             "%s, %s/%.2f", old_label.c_str(),
+                             first.c_str(),
+                             arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException, "sprinting dot arc label");
+                          }
+                      }
+                    else 
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s/%.2f", first.c_str(),
+                                     arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException, "sprinting dot arc label");
+                          }
+                      }  // if old label empty
+                  } // if weighted
+                else
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                             "%s, %s", old_label.c_str(),
+                             first.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException, "sprinting dot arc label");
+                          }
+                      }
+                    else 
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s", first.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                               "sprinting dot arc label");
+                          }
+                      } // if old label empty
+                  } // if weighted 
+              } // if id pair
+            else
+              {
+                if (arc->get_weight() > 0)
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s, %s:%s/%.2f", old_label.c_str(),
+                                    first.c_str(), second.c_str(),
+                                    arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,                                                                                               
+                                  "sprinting dot arc label");
+                          }
+                      }
+                    else
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s:%s/%.2f",
+                                    first.c_str(), second.c_str(),
+                                    arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                  "sprinting dot arc label");
+                          }
+                      }  // old label empty
+                  } // if weighted
+                else
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s, %s:%s", old_label.c_str(),
+                                    first.c_str(), second.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                  "sprinting dot arc label");
+                          }
+                      }
+                    else
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s:%s",
+                                    first.c_str(), second.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                  "sprinting dot arc label");
+                          }
+                      } // if old label empty
+                  } // if weighted
+              } // if id pair
+            target_labels[arc->get_target_state()] = l;
+            free(l);
+          } // each arc
+        for (std::map<HfstState,std::string>::const_iterator tl = target_labels.begin();
+             tl != target_labels.end();
+             ++tl)
+          {
+            fprintf(out, "q%d -> q%d ", s, tl->first);
+            fprintf(out, "[label=\"%s \"];\n", tl->second.c_str());
+          }
+        ++s;
+      } // each state
+    fprintf(out, "}\n");
+  }
+
+void
+print_dot(std::ostream & out, HfstTransducer& t)
+  {
+    out.precision(2);
+
+    //out << "// This graph generated with hfst-fst2txt" << std::endl;
+    if (t.get_name() != "")
+      {
+        out << "digraph \"" << t.get_name() << "\" {" << std::endl;
+      }
+    else
+      {
+        out << "digraph H {" << std::endl;
+      }
+    out << "charset = UTF8;" << std::endl;
+    out << "rankdir = LR;" << std::endl;
+    out << "node [shape=circle,style=filled,fillcolor=yellow]" << std::endl;
+    HfstBasicTransducer* mutt = new HfstBasicTransducer(t);
+    HfstState s = 0;
+    // for some reason, dot works nicer if I first have all nodes, then arcs
+    for (HfstBasicTransducer::const_iterator state = mutt->begin();
+         state != mutt->end();
+         ++state)
+      {
+        if (mutt->is_final_state(s))
+          {
+            if (mutt->get_final_weight(s) > 0)
+              {
+                out << "q" << s << " [shape=doublecircle," << 
+                  "label=\"q" << s << "/\\n" << mutt->get_final_weight(s) << "\"] " << std::endl;
+              }
+            else
+              {
+                out << "q" << s << " [shape=doublecircle,"
+                  "label=\"q" << s << " \"] " << std::endl;
+              }
+          }
+        else
+          {
+            out << "q" << s << " [label=\"q" << s << "\"] " << std::endl;
+          }
+        ++s;
+      } // each state
+    s = 0;
+    for (HfstBasicTransducer::const_iterator state = mutt->begin();
+         state != mutt->end();
+         ++state)
+      {
+        std::map<HfstState, std::string> target_labels;
+        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
+             state->begin();
+             arc != state->end();
+             ++arc)
+          {
+            std::string old_label = target_labels[arc->get_target_state()];
+            std::string first = arc->get_input_symbol();
+            std::string second = arc->get_output_symbol();
+            if (first == hfst::internal_epsilon)
+              {
+                first = std::string("00");
+              }
+            else if (first == hfst::internal_identity)
+              {
+                first = std::string("??");
+              }
+            else if (first == hfst::internal_unknown)
+              { 
+                first = std::string("?1");
+              }
+            if (second == hfst::internal_epsilon)
+              {
+                second = std::string("00");
+              }
+            else if (second == hfst::internal_identity)
+              {
+                second = std::string("??");
+              }
+            else if (second == hfst::internal_unknown)
+              {
+                second = std::string("?2");
+              }
+#define DOT_MAX_LABEL_SIZE 64
+            char* l = static_cast<char*>(malloc(sizeof(char) * 
+                                                DOT_MAX_LABEL_SIZE));
+            if (first == second)
+              {
+                if (arc->get_weight() > 0)
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                             "%s, %s/%.2f", old_label.c_str(),
+                             first.c_str(),
+                             arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException, "sprinting dot arc label");
+                          }
+                      }
+                    else 
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s/%.2f", first.c_str(),
+                                     arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException, "sprinting dot arc label");
+                          }
+                      }  // if old label empty
+                  } // if weighted
+                else
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                             "%s, %s", old_label.c_str(),
+                             first.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException, "sprinting dot arc label");
+                          }
+                      }
+                    else 
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s", first.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                               "sprinting dot arc label");
+                          }
+                      } // if old label empty
+                  } // if weighted 
+              } // if id pair
+            else
+              {
+                if (arc->get_weight() > 0)
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s, %s:%s/%.2f", old_label.c_str(),
+                                    first.c_str(), second.c_str(),
+                                    arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,                                                                                               
+                                  "sprinting dot arc label");
+                          }
+                      }
+                    else
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s:%s/%.2f",
+                                    first.c_str(), second.c_str(),
+                                    arc->get_weight()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                  "sprinting dot arc label");
+                          }
+                      }  // old label empty
+                  } // if weighted
+                else
+                  {
+                    if (old_label != "")
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s, %s:%s", old_label.c_str(),
+                                    first.c_str(), second.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                  "sprinting dot arc label");
+                          }
+                      }
+                    else
+                      {
+                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
+                                     "%s:%s",
+                                    first.c_str(), second.c_str()) < 0)
+                          {
+                            HFST_THROW_MESSAGE(HfstException,
+                                  "sprinting dot arc label");
+                          }
+                      } // if old label empty
+                  } // if weighted
+              } // if id pair
+            target_labels[arc->get_target_state()] = l;
+            free(l);
+          } // each arc
+        for (std::map<HfstState,std::string>::const_iterator tl = target_labels.begin();
+             tl != target_labels.end();
+             ++tl)
+          {
+            out << "q" << s << " -> q" << tl->first << " ";
+            out << "[label=\"" << tl->second << " \"];" << std::endl;
+          }
+        ++s;
+      } // each state
+  out << "}" << std::endl;
+  }
+
+}
+
diff --git a/libhfst/src/HfstPrintDot.h b/libhfst/src/HfstPrintDot.h
new file mode 100644
index 0000000..ba2d822
--- /dev/null
+++ b/libhfst/src/HfstPrintDot.h
@@ -0,0 +1,8 @@
+#include "HfstTransducer.h"
+#include <iostream>
+
+namespace hfst 
+{
+  void print_dot(FILE* out, HfstTransducer& t);
+  void print_dot(std::ostream & oss, HfstTransducer& t);
+}
diff --git a/libhfst/src/HfstPrintPCKimmo.cc b/libhfst/src/HfstPrintPCKimmo.cc
new file mode 100644
index 0000000..50a73b1
--- /dev/null
+++ b/libhfst/src/HfstPrintPCKimmo.cc
@@ -0,0 +1,139 @@
+//! @file hfst-fst2txt.cc
+//!
+//! @brief Transducer array printing command line tool
+//!
+//! @author HFST Team
+
+
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, version 3 of the License.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include "HfstTransducer.h"
+using hfst::HfstTransducer;
+using hfst::HfstBasicTransducer;
+using hfst::implementations::HfstState;
+
+namespace hfst {
+
+void
+print_pckimmo(FILE* out, HfstTransducer& t)
+  {
+    HfstBasicTransducer* mutt = new HfstBasicTransducer(t);
+    HfstState s = 0;
+    HfstState last = 0;
+    std::set<std::pair<std::string,std::string> > pairs;
+    for (HfstBasicTransducer::const_iterator state = mutt->begin();
+         state != mutt->end();
+         ++state)
+      {
+        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
+             state->begin();
+             arc != state->end();
+             ++arc)
+          {
+            std::string first = arc->get_input_symbol();
+            std::string second = arc->get_output_symbol();
+            pairs.insert(pair<std::string,std::string>(first, second));
+          }
+        ++last;
+      }
+    // width of the first column
+    unsigned int numwidth = 0;
+    for (unsigned int i = 1; i < last; i *= 10, numwidth++)
+      {}
+    // first line is input symbols per pair 
+    // (left corner is digit width + 2)
+    fprintf(out, "%*s  ", numwidth, " ");
+    for (std::set<pair<std::string, std::string> >::const_iterator p = pairs.begin();
+         p != pairs.end();
+         ++p)
+      {
+        if (p->first == hfst::internal_epsilon)
+          {
+            fprintf(out, "%.*s ", numwidth, "0");
+          }
+        else if (p->first == hfst::internal_unknown)
+          {
+            fprintf(out, "%.*s ", numwidth, "@");
+          }
+        else
+          {
+            fprintf(out, "%.*s ", numwidth, p->first.c_str());
+          }
+      }
+    // second line is output symbols per pair
+    fprintf(out, "\n");
+    // (left corner is digit width + 2)
+    fprintf(out, "%*s  ", numwidth, " ");
+    for (std::set<pair<std::string, std::string> >::const_iterator p = pairs.begin();
+         p != pairs.end();
+         ++p)
+      {
+        if (p->second == hfst::internal_epsilon)
+          {
+            fprintf(out, "%.*s ", numwidth, "0");
+          }
+        else if (p->second == hfst::internal_unknown)
+          {
+            fprintf(out, "%.*s ", numwidth, "@");
+          }
+        else
+          {
+            fprintf(out, "%.*s ", numwidth, p->second.c_str());
+          }
+
+      }
+    // the transition table per state
+    fprintf(out, "\n");
+    for (HfstBasicTransducer::const_iterator state = mutt->begin();
+         state != mutt->end();
+         ++state)
+      {
+        if (mutt->is_final_state(s))
+          {
+            fprintf(out, "%.*d. ", numwidth, s + 1);
+          }
+        else
+          {
+            fprintf(out, "%.*d: ", numwidth, s + 1);
+          }
+        // map everything to sink state 0 first
+        std::map<std::pair<std::string,std::string>,HfstState> transitions;
+        for(std::set<pair<std::string,std::string> >::const_iterator p = pairs.begin();
+            p != pairs.end();
+            ++p)
+          {
+            transitions[*p] = -1;
+          }
+        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
+             state->begin();
+             arc != state->end();
+             ++arc)
+          {
+            std::string first = arc->get_input_symbol();
+            std::string second = arc->get_output_symbol();
+            transitions[pair<std::string,std::string>(first,second)] = 
+                arc->get_target_state();
+          }
+        for(std::map<std::pair<std::string,std::string>,HfstState>::const_iterator trans = 
+            transitions.begin();
+            trans != transitions.end();
+            ++trans)
+          {
+            fprintf(out, "%.*d ", numwidth, trans->second + 1);
+          }
+        fprintf(out, "\n");
+        ++s;
+      } // for each state
+  }
+
+}
diff --git a/libhfst/src/HfstPrintPCKimmo.h b/libhfst/src/HfstPrintPCKimmo.h
new file mode 100644
index 0000000..c4bf6fa
--- /dev/null
+++ b/libhfst/src/HfstPrintPCKimmo.h
@@ -0,0 +1,6 @@
+#include "HfstTransducer.h"
+
+namespace hfst 
+{
+  void print_pckimmo(FILE* out, HfstTransducer& t);
+}
diff --git a/libhfst/src/HfstRules.cc b/libhfst/src/HfstRules.cc
index 7ee3939..9d2552d 100644
--- a/libhfst/src/HfstRules.cc
+++ b/libhfst/src/HfstRules.cc
@@ -32,8 +32,9 @@ namespace hfst
       else if (repl_type == REPL_DOWN)
         t_proj.output_project();
       else {
-        fprintf(stderr, "ERROR: replace: Impossible replace type\n");
-        exit(1);
+        //fprintf(stderr, "ERROR: replace: Impossible replace type\n");
+        //exit(1);
+        HFST_THROW_MESSAGE(HfstFatalException, "impossible replace type");
       }
 
       HfstTransducer pi_star(alphabet, type, true);
diff --git a/tools/src/HfstStrings2FstTokenizer.cc b/libhfst/src/HfstStrings2FstTokenizer.cc
similarity index 100%
rename from tools/src/HfstStrings2FstTokenizer.cc
rename to libhfst/src/HfstStrings2FstTokenizer.cc
diff --git a/tools/src/HfstStrings2FstTokenizer.h b/libhfst/src/HfstStrings2FstTokenizer.h
similarity index 100%
rename from tools/src/HfstStrings2FstTokenizer.h
rename to libhfst/src/HfstStrings2FstTokenizer.h
diff --git a/libhfst/src/HfstTransducer.cc b/libhfst/src/HfstTransducer.cc
index 3a3429c..f437122 100644
--- a/libhfst/src/HfstTransducer.cc
+++ b/libhfst/src/HfstTransducer.cc
@@ -62,32 +62,6 @@ hfst::implementations::FomaTransducer HfstTransducer::foma_interface;
 // HfstTransducer::my_transducer_library_interface;
 //#endif
 
-  HfstFile::HfstFile(): file(NULL){};
-  HfstFile::~HfstFile() {};
-  void HfstFile::set_file(FILE * f) { file = f; };
-  FILE * HfstFile::get_file() { return file; };
-  void HfstFile::close() { fclose(file); };
-  void HfstFile::write(const char * str) { fprintf(file, "%s", str); };
-
-  HfstFile hfst_open(const char * filename, const char * mode) { 
-    FILE * f = fopen(filename, mode);
-    HfstFile file;
-    file.set_file(f);
-    return file;
-  };
-
-  HfstFile hfst_stdin() { 
-    HfstFile file;
-    file.set_file(stdin);
-    return file;
-  };
-
-  HfstFile hfst_stdout() { 
-    HfstFile file;
-    file.set_file(stdout);
-    return file;
-  };
-
 
 // -----------------------------------------------------------------------
 //
@@ -169,6 +143,15 @@ void set_encode_weights(bool value) {
   bool get_encode_weights(void) {
     return encode_weights; }
 
+  void set_warning_stream(std::ostream * os)
+  {
+    hfst::implementations::TropicalWeightTransducer::set_warning_stream(os);
+  }
+
+  std::ostream * get_warning_stream()
+  {
+    return hfst::implementations::TropicalWeightTransducer::get_warning_stream();
+  }
 
 void set_minimization_algorithm(MinimizationAlgorithm a) {
     minimization_algorithm=a; 
@@ -486,8 +469,12 @@ HfstTransducer * HfstTransducer::harmonize_(const HfstTransducer &another)
 
     // Prevent flag diacritics from being harmonized by inserting them to
     // the alphabet. FIX?: remove them at the end?
+    if (this->get_type() == FOMA_TYPE)
+      {
     StringSet this_alphabet    = this->get_alphabet();
     StringSet another_alphabet = another_copy.get_alphabet();
+    StringSet add_to_this;
+    StringSet add_to_another;
 
     for (StringSet::const_iterator it = another_alphabet.begin();
      it != another_alphabet.end();
@@ -495,9 +482,10 @@ HfstTransducer * HfstTransducer::harmonize_(const HfstTransducer &another)
       {
     if (FdOperation::is_diacritic(*it) && this_alphabet.count(*it) == 0)
       {
-        this->insert_to_alphabet(*it);
+        add_to_this.insert(*it);
       }
       }
+    this->insert_to_alphabet(add_to_this);
 
     for (StringSet::const_iterator it = this_alphabet.begin();
      it != this_alphabet.end();
@@ -505,8 +493,10 @@ HfstTransducer * HfstTransducer::harmonize_(const HfstTransducer &another)
       {
     if (FdOperation::is_diacritic(*it) && another_alphabet.count(*it) == 0)
       {
-        another_copy.insert_to_alphabet(*it);
+        add_to_another.insert(*it);
+      }
       }
+    another_copy.insert_to_alphabet(add_to_another);
       }
 
     switch(this->type)
@@ -514,6 +504,7 @@ HfstTransducer * HfstTransducer::harmonize_(const HfstTransducer &another)
 #if HAVE_FOMA
     case (FOMA_TYPE):
       // no need to harmonize as foma's functions take care of harmonizing
+      return new HfstTransducer(another_copy);
       return NULL;
       break;
 #endif // HAVE_FOMA
@@ -671,29 +662,32 @@ void HfstTransducer::print_alphabet()
 // -----------------------------------------------------------------------
 
 HfstOneLevelPaths * HfstTransducer::lookup(const StringVector& s,
-                ssize_t limit) const
+                                           ssize_t limit, double time_cutoff) const
 {
-    return lookup_fd(s, limit);
+    return lookup_fd(s, limit, time_cutoff);
 }
 
 HfstOneLevelPaths * HfstTransducer::lookup(const std::string & s,
-                       ssize_t limit) const
+                                           ssize_t limit, double time_cutoff) const
 {
-    return lookup_fd(s, limit);
+    return lookup_fd(s, limit, time_cutoff);
 }
 
 HfstOneLevelPaths * HfstTransducer::lookup_fd(const StringVector& s,
-                          ssize_t limit) const
+                          ssize_t limit, double time_cutoff) const
 {
     switch(this->type) {
 
     case (HFST_OL_TYPE):
     case (HFST_OLW_TYPE):
-        return this->implementation.hfst_ol->lookup_fd(s, limit);
+        return this->implementation.hfst_ol->lookup_fd(s, limit, time_cutoff);
 
     case (ERROR_TYPE):
       HFST_THROW(TransducerHasWrongTypeException);
     default:
+      HFST_THROW(FunctionNotImplementedException);
+
+      /*
       hfst::implementations::HfstBasicTransducer net(*this);    
       HfstTransducer * tmp;
       if (this->type == TROPICAL_OPENFST_TYPE) {
@@ -703,22 +697,25 @@ HfstOneLevelPaths * HfstTransducer::lookup_fd(const StringVector& s,
       HfstOneLevelPaths * retval = tmp->lookup_fd(s, limit);
       delete tmp;
       return retval;
-
+      */
     }
 }
 
 HfstOneLevelPaths * HfstTransducer::lookup_fd(const std::string & s,
-                         ssize_t limit) const
+                         ssize_t limit, double time_cutoff) const
 {
     switch(this->type) {
 
     case (HFST_OL_TYPE):
     case (HFST_OLW_TYPE):
-        return this->implementation.hfst_ol->lookup_fd(s, limit);
+        return this->implementation.hfst_ol->lookup_fd(s, limit, time_cutoff);
 
     case (ERROR_TYPE):
       HFST_THROW(TransducerHasWrongTypeException);
     default:
+      HFST_THROW(FunctionNotImplementedException);
+
+      /*
       hfst::implementations::HfstBasicTransducer net(*this);    
       HfstTransducer * tmp;
       if (this->type == TROPICAL_OPENFST_TYPE) {
@@ -728,16 +725,16 @@ HfstOneLevelPaths * HfstTransducer::lookup_fd(const std::string & s,
       HfstOneLevelPaths * retval = tmp->lookup_fd(s, limit);
       delete tmp;
       return retval;
-
+      */
     }
 }
 
 HfstOneLevelPaths * HfstTransducer::lookup(const HfstTokenizer& tok,
                        const std::string &s, 
-                       ssize_t limit) const
+                       ssize_t limit, double time_cutoff) const
 {
     StringVector sv = tok.tokenize_one_level(s);
-    return lookup(sv, limit);
+    return lookup(sv, limit, time_cutoff);
 }
 
 HfstOneLevelPaths * HfstTransducer::lookdown(const StringVector& s,
@@ -2016,6 +2013,26 @@ HfstTransducer &HfstTransducer::eliminate_flags()
 
 HfstTransducer &HfstTransducer::eliminate_flag(const std::string & flag)
 {
+
+  HfstBasicTransducer basic(*this);
+  StringSet flags = basic.get_flags();
+  bool feature_found = false;
+  for (StringSet::const_iterator it = flags.begin(); it != flags.end(); it++)
+    {
+      if (FdOperation::get_feature(*it) == flag)
+        {
+          feature_found = true;
+          break;
+        }
+    }
+  if (! feature_found)
+    {
+      if (flag.find('.') == std::string::npos)
+        HFST_THROW_MESSAGE(HfstException, "HfstTransducer::eliminate_flag: flag feature does not occur in the transducer: " + flag);
+      else
+        HFST_THROW_MESSAGE(HfstException, "HfstTransducer::eliminate_flag: only the flag feature must be given, no value or operator: " + flag);
+    }
+
 #if HAVE_FOMA
   if (type == FOMA_TYPE)
     {
@@ -2032,8 +2049,6 @@ HfstTransducer &HfstTransducer::eliminate_flag(const std::string & flag)
     }
 #endif
 
-  HfstBasicTransducer basic(*this);
-  StringSet flags = basic.get_flags();
   HfstTransducer * filter = get_flag_filter(this, flags, flag);
   if (filter != NULL) 
     {
@@ -3239,6 +3254,9 @@ bool is_flag_suffix
 void HfstTransducer::harmonize_flag_diacritics(HfstTransducer &another,
                                                bool insert_renamed_flags)
 {
+  if (this->type != another.type)
+    HFST_THROW(TransducerTypeMismatchException);
+
   bool this_has_flag_diacritics    = has_flags(*this);
   bool another_has_flag_diacritics = has_flags(another);
 
@@ -3602,6 +3620,15 @@ HfstTransducer &HfstTransducer::substitute
 
 }
 
+HfstTransducer & HfstTransducer::substitute_symbol(const std::string &old_symbol, const std::string &new_symbol, bool input_side, bool output_side)
+{ return this->substitute(old_symbol, new_symbol, input_side, output_side); }
+HfstTransducer & HfstTransducer::substitute_symbol_pair(const StringPair &old_symbol_pair, const StringPair &new_symbol_pair)
+{ return this->substitute(old_symbol_pair, new_symbol_pair); }
+HfstTransducer & HfstTransducer::substitute_symbol_pair_with_set(const StringPair &old_symbol_pair, const hfst::StringPairSet &new_symbol_pair_set)
+{ return this->substitute(old_symbol_pair, new_symbol_pair_set); }
+HfstTransducer & HfstTransducer::substitute_symbol_pair_with_transducer(const StringPair &symbol_pair, HfstTransducer &transducer, bool harmonize)
+{ return this->substitute(symbol_pair, transducer, harmonize); }
+
 HfstTransducer &HfstTransducer::substitute_symbols
 (const HfstSymbolSubstitutions &substitutions)
 { return this->substitute(substitutions); }
@@ -3901,7 +3928,7 @@ HfstTransducer &HfstTransducer::merge
   // filter non-optimal paths
   // [ ? | #V ?:? ]* %#V:V ?:0 [ ? | #V ?:? | %#V:V ?:0 ]*
   hfst::xre::XreCompiler xre_(args);
-  xre_.set_verbosity(false, NULL);
+  xre_.set_verbosity(false);
 
   for (std::set<std::string>::const_iterator it = markers_added.begin(); it != markers_added.end(); it++)
     {
@@ -3936,11 +3963,14 @@ HfstTransducer &HfstTransducer::compose
  bool harmonize)
 { is_trie = false;
 
+  if (this->type != another.type)
+    HFST_THROW(TransducerTypeMismatchException);
+
     HfstTransducer * another_copy = new HfstTransducer(another);
 
-    if (this->type != another_copy->type) {
-        another_copy->convert(this->type);
-    }
+    //if (this->type != another_copy->type) {
+    //    another_copy->convert(this->type);
+    //}
 
     /* If we want flag diacritcs to be handled in the same way as epsilons
        in composition, we substitute output flags of first transducer with
@@ -4302,7 +4332,7 @@ HfstTransducer &HfstTransducer::lenient_composition( const HfstTransducer &anoth
 
     HfstTransducer retval(*this);
     // true is a dummy variable, false means do not encode epsilons
-    retval.compose(another).minimize().priority_union(*this, true, false).minimize();
+    retval.compose(another).minimize().priority_union(*this).minimize();
 
     *this = retval;
     return *this;
@@ -4541,8 +4571,9 @@ HfstTransducer &HfstTransducer::shuffle(const HfstTransducer &another, bool)
 // ---------------------- Shuffle functions end --------------------
 
 
-
-HfstTransducer &HfstTransducer::priority_union (const HfstTransducer &another, bool, bool encode_epsilons)
+// Q .P. R = Q | [~[Q .u] .o. R ]
+// .u is input project
+HfstTransducer &HfstTransducer::priority_union (const HfstTransducer &another)
 {
 #if HAVE_XFSM
   if (this->type == XFSM_TYPE)
@@ -4555,38 +4586,21 @@ HfstTransducer &HfstTransducer::priority_union (const HfstTransducer &another, b
     }
     HfstTransducer t1(*this);
     HfstTransducer t2(another);
-    HfstTransducer retval(another);
-
-    // Invert t2, compose it with t1, invert back.
-    HfstTransducer tmp(t2);
-    tmp.invert().compose(t1).invert().minimize();
-    //  Compose t1 with the result to get the pairs which need to be filtered from t2.
-    HfstTransducer filter(t1);
-
-    // handle epsilons
-    if (encode_epsilons)
-      {
-        filter.substitute("@_EPSILON_SYMBOL_@", "@EPS@");
-        tmp.substitute("@_EPSILON_SYMBOL_@", "@EPS@");
-      }
-
-    filter.compose(tmp).minimize();
 
-    if (encode_epsilons)
-      {
-        filter.substitute("@EPS@", "@_EPSILON_SYMBOL_@");
-      }
-
-    // Subtract filter from t2
-    retval.subtract(filter).minimize();
+    HfstTransducer t1upper(t1);
+    t1upper.input_project().minimize();
+    
+    HfstTransducer complement = HfstTransducer::identity_pair( this->type );
+    complement.repeat_star().minimize();
+    complement.subtract(t1upper).prune_alphabet(false);
 
-    // Disjunct t1 with filtered t2
-    retval.disjunct(t1).minimize();
+    complement.compose(t2).minimize();
 
+    HfstTransducer retval(t1);
+    retval.disjunct(complement).minimize();
+    
     *this = retval;
-
     return *this;
-
 }
 
 HfstTransducer &HfstTransducer::compose_intersect
@@ -5304,13 +5318,6 @@ void HfstTransducer::write_in_att_format
   net.write_in_att_format(buffer, print_weights);
 }
 
-void HfstTransducer::write_in_att_format(HfstFile &ofile, bool write_weights) const {
-#if HAVE_XFSM
-  if (this->type == XFSM_TYPE)
-    HFST_THROW(FunctionNotImplementedException);
-#endif
-  this->write_in_att_format(ofile.get_file(), write_weights);
-}
 
 void HfstTransducer::write_in_att_format
 (FILE * ofile, bool print_weights) const
@@ -5522,83 +5529,6 @@ HfstTransducer::HfstTransducer(FILE * ifile,
     }
 }
 
-HfstTransducer::HfstTransducer(HfstFile & ifile, 
-                               ImplementationType type,
-                               const std::string &epsilon_symbol):
-    type(type),anonymous(false),is_trie(false), name("")
-{
-#if HAVE_XFSM
-  if (this->type == XFSM_TYPE)
-    HFST_THROW(FunctionNotImplementedException);
-#endif
-
-    if (! is_implementation_type_available(type))
-    HFST_THROW_MESSAGE(ImplementationTypeNotAvailableException,
-               "HfstTransducer::HfstTransducer"
-               "(FILE*, ImplementationType, const std::string&)");
-
-    HfstTokenizer::check_utf8_correctness(epsilon_symbol);
-
-    unsigned int foo=0;
-    // Implemented only for internal transducer format.
-    hfst::implementations::HfstBasicTransducer net =
-    hfst::implementations::HfstTransitionGraph<hfst::implementations::
-    HfstTropicalTransducerTransitionData>::
-      read_in_att_format(ifile.get_file(), std::string(epsilon_symbol), foo);
-    (void)foo;
-
-    // Conversion is done here.
-    switch (type)
-    {
-#if HAVE_SFST
-    case SFST_TYPE:
-        implementation.sfst = 
-        ConversionFunctions::hfst_basic_transducer_to_sfst(&net);
-        break;
-#endif
-#if HAVE_OPENFST
-    case TROPICAL_OPENFST_TYPE:
-        implementation.tropical_ofst 
-        = ConversionFunctions::hfst_basic_transducer_to_tropical_ofst(&net);          
-        break;
-#if HAVE_OPENFST_LOG
-    case LOG_OPENFST_TYPE:
-        implementation.log_ofst 
-        = ConversionFunctions::hfst_basic_transducer_to_log_ofst(&net);
-        break;
-#endif
-#endif
-#if HAVE_FOMA
-    case FOMA_TYPE:
-        implementation.foma = 
-        ConversionFunctions::hfst_basic_transducer_to_foma(&net);
-        break;
-#endif
-#if HAVE_HFSTOL
-    case HFST_OL_TYPE:
-    implementation.hfst_ol 
-            = ConversionFunctions::hfst_basic_transducer_to_hfst_ol
-            (&net, false);
-    break;
-    case HFST_OLW_TYPE:
-    implementation.hfst_ol 
-            = ConversionFunctions::hfst_basic_transducer_to_hfst_ol(&net, true);
-    break;
-#endif
-    /* Add here your implementation. */
-        //#if HAVE_MY_TRANSDUCER_LIBRARY
-        //case MY_TRANSDUCER_LIBRARY_TYPE:
-        //implementation.my_transducer_library = 
-        //  ConversionFunctions::
-        //    hfst_basic_transducer_to_my_transducer_library_transducer(&net);
-        //break;
-        //#endif
-    case ERROR_TYPE:
-        HFST_THROW(SpecifiedTypeRequiredException);
-    default:
-        HFST_THROW(TransducerHasWrongTypeException);
-    }
-}
 
 
 HfstTransducer &HfstTransducer::read_in_att_format
@@ -6252,10 +6182,13 @@ void priority_union_test ( ImplementationType type )
     // emptyString .P. transducer
     testTr = trEmptyString;
     assert ( testTr.priority_union( tr1 ).compare( result1 ) );
+    
+    
+    
     // normal transducer .P. normal transducer
     testTr = tr1;
 
-    // TODO the result is wrong, change it!
+    // TODO the result is wrong, change it! (wrong because of the wights shifting)
     //assert ( testTr.priority_union( tr2 ).compare( result2 ) );
 
     // normal transducer .P. normal transducer without priority string
@@ -6272,7 +6205,7 @@ void priority_union_test ( ImplementationType type )
         << std::endl;
     }
 
-    //TODO - results are worng, change them!
+    //TODO - results are worng, change them! (wrong because of the wights shifting)
     /*
     //assert ( testTr.priority_union( trIdentity ).compare( result4 ) ); // FAIL
     // identity .p. normal transducer
@@ -6467,7 +6400,7 @@ int main(int argc, char * argv[])
         HfstTransducer &substitute(const StringPair &symbol_pair,
                        HfstTransducer &transducer);
     
-        // priority_union unit tests
+        // priority_union unit tests (also tested in hfst-xfst tests)
         priority_union_test( types[i] );
 
         // lenient_composition unit tests
diff --git a/libhfst/src/HfstTransducer.h b/libhfst/src/HfstTransducer.h
index f27e5b4..d6fe257 100644
--- a/libhfst/src/HfstTransducer.h
+++ b/libhfst/src/HfstTransducer.h
@@ -115,10 +115,6 @@ namespace hfst
   //  using hfst::implementations::MyTransducerLibraryTransducer;
   //#endif // #if HAVE_MY_TRANSDUCER_LIBRARY
 
-  HFSTDLL HfstFile hfst_open(const char * filename, const char * mode);
-  HFSTDLL HfstFile hfst_stdout();
-  HFSTDLL HfstFile hfst_stdin();
-
   // *** TESTING AND OPTIMIZATION...
 
 #if HAVE_XFSM
@@ -162,6 +158,9 @@ namespace hfst
   HFSTDLL void set_unknown_symbols_in_use(bool);
   HFSTDLL bool get_unknown_symbols_in_use();
 
+  void set_warning_stream(std::ostream * os);
+  std::ostream * get_warning_stream();
+
   // *** ...TESTING AND OPTIMIZATION
 
 
@@ -356,17 +355,17 @@ An example:
        ordering of flag diacritics. */
     HfstTransducer &remove_illegal_flag_paths(void);
 
-    /* Whether the conversion requested can be done without losing 
-       any information */
-    static bool is_safe_conversion(ImplementationType original,
-                                   ImplementationType conversion);
-
 
     /* For internal use */
     static HfstTransducer &read_in_att_format
       (FILE *ifile, ImplementationType type, const std::string &epsilon_symbol);
 
   public:
+    /* Whether the conversion requested can be done without losing 
+       any information */
+    static bool is_safe_conversion(ImplementationType original,
+                                   ImplementationType conversion);
+
     /* whether HFST is linked to the transducer library 
        needed by implementation type \a type. */
     HFSTDLL static bool is_implementation_type_available(ImplementationType type);
@@ -664,9 +663,6 @@ in \a ifile.
     HFSTDLL HfstTransducer(FILE * ifile, ImplementationType type, 
                    const std::string &epsilon_symbol);
 
-    HFSTDLL HfstTransducer(HfstFile &ifile, ImplementationType type, 
-                   const std::string &epsilon_symbol);
-
 
     /** \brief Destructor. **/
     HFSTDLL virtual ~HfstTransducer(void);
@@ -859,8 +855,6 @@ This will yield a file "testfile.att" that looks as follows:
         @see HfstTransducer(FILE*, ImplementationType, const std::string&) */
     HFSTDLL void write_in_att_format(FILE * ofile, bool write_weights=true) const;
 
-    HFSTDLL void write_in_att_format(HfstFile & ofile, bool write_weights=true) const;
-
     HFSTDLL void write_in_att_format(char * buffer, bool write_weights=true) const;
 
     /* For XFSM_TYPE. */
@@ -1055,7 +1049,8 @@ ccc : ddd
     //!       lookup_fd.
     //! @sa lookup_fd
     HFSTDLL HfstOneLevelPaths * lookup(const StringVector& s,
-                   ssize_t limit = -1) const;
+                                       ssize_t limit = -1,
+                                       double time_cutoff = 0.0) const;
 
     //! @brief Lookup or apply a single string \a s and
     //! return a maximum of \a limit results.
@@ -1063,7 +1058,8 @@ ccc : ddd
     //! This is an overloaded lookup function that leaves tokenizing to the
     //! transducer.
     HFSTDLL HfstOneLevelPaths * lookup(const std::string & s,
-                   ssize_t limit = -1) const;
+                                       ssize_t limit = -1,
+                                       double time_cutoff = 0.0) const;
 
     //! @brief Lookup or apply a single string \a s minding flag diacritics
     //! properly and store a maximum of \a limit results to \a results.
@@ -1095,7 +1091,8 @@ ccc : ddd
     //! @todo Do not ignore argument \a limit.
     //!
     HFSTDLL HfstOneLevelPaths * lookup_fd(const StringVector& s,
-                  ssize_t limit = -1) const;
+                                          ssize_t limit = -1,
+                                          double time_cutoff = 0.0) const;
 
     //! @brief Lookup or apply a single string \a s minding flag diacritics
     //! properly and store a maximum of \a limit results to \a results.
@@ -1103,6 +1100,10 @@ ccc : ddd
     //! This is an overloaded lookup_fd that leaves tokenizing to the
     //! transducer.
     //!
+    //! \warning{This function will convert the transducer into
+    //! HFST_OLW_TYPE which may be very slow for large transducers. Lookup
+    //! speed can therefore be *extremely* slow.}
+    //!
     //! @param s  String to look up. The weight is ignored.
     //! @param limit  (Currently ignored.) Number of strings to look up. 
     //!               -1 tries to look up all and may get stuck 
@@ -1112,7 +1113,8 @@ ccc : ddd
     //!
     //!@sa lookup_fd
     HFSTDLL HfstOneLevelPaths * lookup_fd(const std::string& s,
-                  ssize_t limit = -1) const;
+                                          ssize_t limit = -1,
+                                          double time_cutoff = 0.0) const;
 
     //! @brief Lookup or apply a single string \a s and store a maximum of 
     //! \a limit results to \a results. \a tok defined how \a s is tokenized.
@@ -1122,8 +1124,10 @@ ccc : ddd
     //! #lookup(const StringVector&, ssize_t) const
     //! but lookup is not done using a string and a tokenizer instead of
     //! a StringVector.
-    HFSTDLL HfstOneLevelPaths * lookup(const HfstTokenizer& tok,
-                   const std::string &s, ssize_t limit = -1) const;
+      HFSTDLL HfstOneLevelPaths * lookup(const HfstTokenizer& tok,
+                                         const std::string &s,
+                                         ssize_t limit = -1,
+                                         double time_cutoff = 0.0) const;
 
     //! @brief Lookup or apply a single string \a s minding flag diacritics 
     //! properly and store a maximum of \a limit results to \a results. 
@@ -1134,8 +1138,9 @@ ccc : ddd
     //! but uses a tokenizer and a string instead of a StringVector.
     //!
     HFSTDLL HfstOneLevelPaths * lookup_fd(
-    const HfstTokenizer& tok,
-    const std::string &s, ssize_t limit = -1) const;
+        const HfstTokenizer& tok,
+        const std::string &s, ssize_t limit = -1,
+        double time_cutoff = 0.0) const;
 
     //! @brief (Not implemented) Lookdown a single string \a s and return 
     //! a maximum of \a limit results.
@@ -1340,7 +1345,7 @@ ccc : ddd
      *
      * For more information, read: www.fsmbook.com
      *  */
-    HFSTDLL HfstTransducer &priority_union(const HfstTransducer &another, bool harmonize=true, bool encode_epsilons=true);
+    HFSTDLL HfstTransducer &priority_union(const HfstTransducer &another);
 
 
     /**  \brief Make lenient composition of this transducer with \a.
@@ -1531,6 +1536,12 @@ t.substitute(&function);
     HFSTDLL HfstTransducer &substitute(const StringPair &old_symbol_pair,
                                const StringPairSet &new_symbol_pair_set);
 
+    HFSTDLL HfstTransducer & substitute_symbol(const std::string &old_symbol, const std::string &new_symbol, bool input_side=true, bool output_side=true);
+    HFSTDLL HfstTransducer & substitute_symbol_pair(const StringPair &old_symbol_pair, const StringPair &new_symbol_pair);
+    HFSTDLL HfstTransducer & substitute_symbol_pair_with_set(const StringPair &old_symbol_pair, const hfst::StringPairSet &new_symbol_pair_set);
+    HFSTDLL HfstTransducer & substitute_symbol_pair_with_transducer(const StringPair &symbol_pair, HfstTransducer &transducer, bool harmonize=true);
+
+
     /** \brief Substitute all transition symbols as defined in \a substitutions.
 
         Each symbol old_symbol is substituted with symbol new_symbol, iff 
diff --git a/libhfst/src/HfstXeroxRules.cc b/libhfst/src/HfstXeroxRules.cc
index 00d0966..b9cb4de 100644
--- a/libhfst/src/HfstXeroxRules.cc
+++ b/libhfst/src/HfstXeroxRules.cc
@@ -14,7 +14,6 @@
 
 #ifndef MAIN_TEST
 
-
 namespace hfst
 {
   namespace xeroxRules
@@ -41,6 +40,11 @@ namespace hfst
         epsilonContext.push_back(contextPair);
 
         mapping = mappingPairVector;
+              
+       // HfstTransducerPairVector tmpV = mappingPairVector;
+       // tmpV[0].first = encodeFlagDiacritics(tmpV[0].first);
+        
+        //mapping = tmpV;
         context = epsilonContext;
         replType = REPL_UP;
 
@@ -68,11 +72,26 @@ namespace hfst
             }
         }
 
+        
+          
+        //HfstTransducerPairVector tmpV = mappingPairVector;
+        //tmpV[0].first = encodeFlagDiacritics(tmpV[0].first);
+        
         mapping = mappingPairVector;
+       // mapping = tmpV                       ;
         context = a_context;
         replType = a_replType;
       }
 
+      
+       Rule::Rule ( const Rule &a_rule )
+        {
+            mapping = a_rule.get_mapping();
+            context = a_rule.get_context();
+            replType = a_rule.get_replType();
+           
+        }
+       
       HfstTransducerPairVector Rule::get_mapping() const
       {
         return mapping;
@@ -86,6 +105,31 @@ namespace hfst
       {
         return replType;
       }
+      void Rule::encodeFlags()
+      {
+        //cerr << "\n Encode flags " << endl;
+         HfstTransducerPairVector tmpM = this->mapping;
+        
+        //cerr << "\n mapping size: " << tmpM.size() << endl;
+        for ( unsigned int i = 0; i < tmpM.size(); i++ )
+        {
+            tmpM[i].first = encodeFlagDiacritics(tmpM[i].first);
+            tmpM[i].second = encodeFlagDiacritics(tmpM[i].second);
+        }
+        
+        
+        HfstTransducerPairVector tmpC = this->context;
+        
+        //cerr << "\n context size: " << tmpC.size() << endl;
+        for ( unsigned int i = 0; i < tmpC.size(); i++ )
+        {
+            tmpC[i].first = encodeFlagDiacritics(tmpC[i].first);
+            tmpC[i].second = encodeFlagDiacritics(tmpC[i].second);
+        }
+        
+        this->mapping = tmpM;  
+        this->context = tmpC;  
+      }
 
     std::ostream & operator<<(std::ostream &out, const Rule & r)
     {
@@ -136,30 +180,95 @@ namespace hfst
     }
 
 
-      ///////
+      //////////////////////////////////////
+      // In the transducer tr, change all flag diacritics to "non-special" multichar symbols
+      // It means that @ sign will be changed to $ sign
+      // ie. @P.FOO.BAR@ will be changed into $P.FOO.BAR$
+     HfstTransducer encodeFlagDiacritics( const HfstTransducer &tr )
+      { 
+        //std::cerr << "\n encodeFlagDiacritics " << endl;
+        HfstSymbolSubstitutions realFlagstoFakeFlags;
+        StringSet removeFromAlphabet;
+        //printf("alphabet lexicons: \n");
+        StringSet transducerAlphabet = tr.get_alphabet();
+        for (StringSet::const_iterator s = transducerAlphabet.begin();
+                       s != transducerAlphabet.end();
+                       ++s)
+        {
+         
+            String alph = *s;
+            String alphFirst3 = alph.substr(0,3);
+         //   String alphLast = alph.back();
 
-      MarkUpRule::MarkUpRule ( const HfstTransducerPairVector &a_mapping,
-                                       StringPair a_marks ):
-              Rule(a_mapping), marks(a_marks)
-      {
-          marks = a_marks;
-      }
-      MarkUpRule::MarkUpRule ( const HfstTransducerPairVector &a_mapping,
-                                       const HfstTransducerPairVector &a_contextVector,
-                                       ReplaceType a_replType,
-                                       StringPair a_marks  ):
-              Rule(a_mapping, a_contextVector, a_replType), marks(a_marks)
-      {
-          marks = a_marks;
-      }
+            //@operator.feature.value@ and @operator.feature@
+            
+            //std::cout << "debug: " << alphFirst3 << endl;
+            if ( alphFirst3 == "@P." || alphFirst3 == "@R." 
+                 || alphFirst3 == "@U." || alphFirst3 == "@D." 
+                 || alphFirst3 == "@C." || alphFirst3 == "@N."
+                 ||alphFirst3 == "@p." || alphFirst3 == "@r." 
+                 || alphFirst3 == "@u." || alphFirst3 == "@d." 
+                 || alphFirst3 == "@c." || alphFirst3 == "@n.")  
+            {
 
-      StringPair MarkUpRule::get_marks() const
-      {
-          return marks;
-      }
+                replace(alph.begin(), alph.end(), '@', '$');
+                //std::cout << alph << '\n';
+                realFlagstoFakeFlags.insert(StringPair(*s, alph));
+                removeFromAlphabet.insert(*s);
+            }
+        }
+    
+        HfstTransducer retval(tr);
+        retval.substitute(realFlagstoFakeFlags);
+        
+        //std::cerr << "\n flag substitute done" << endl;
+        retval.remove_from_alphabet(removeFromAlphabet);
+        //std::cerr << "\n alph substitute done" << endl;
+        return retval;
 
+      }  
+      
+       HfstTransducer decodeFlagDiacritics( const HfstTransducer &tr )
+      { 
+        //std::cerr << "\n decodeFlagDiacritics " << endl;
+        HfstSymbolSubstitutions fakeFlagsToRealFlags;
+
+        //printf("alphabet lexicons: \n");
+        StringSet transducerAlphabet = tr.get_alphabet();
+        StringSet removeFromAlphabet;
+        for (StringSet::const_iterator s = transducerAlphabet.begin();
+                       s != transducerAlphabet.end();
+                       ++s)
+        {
+         
+            String alph = *s;
+            String alphFirst3 = alph.substr(0,3);
+         //   String alphLast = alph.back();
 
-      //////////////////////////////////////
+            //@operator.feature.value@ and @operator.feature@
+            
+            //std::cout << "debug: " << alphFirst3 << endl;
+            if ( alphFirst3 == "$P." || alphFirst3 == "$R." 
+                 || alphFirst3 == "$U." || alphFirst3 == "$D." 
+                 || alphFirst3 == "$C." || alphFirst3 == "$N."
+                 || alphFirst3 == "$p." || alphFirst3 == "$r." 
+                 || alphFirst3 == "$u." || alphFirst3 == "$d." 
+                 || alphFirst3 == "$c." || alphFirst3 == "$n.")  
+            {
+
+                replace(alph.begin(), alph.end(), '$', '@');
+                //std::cout << alph << '\n';
+                fakeFlagsToRealFlags.insert(StringPair(*s, alph));
+                removeFromAlphabet.insert(*s);
+            }
+        }
+    
+        HfstTransducer retval(tr);
+        retval.substitute(fakeFlagsToRealFlags);
+        retval.remove_from_alphabet(removeFromAlphabet);
+        return retval;
+
+      }  
 
 
 
@@ -187,16 +296,6 @@ namespace hfst
         String leftMarker("@LM@");
         String rightMarker("@RM@");
 
-        /*
-        String newEpsilon("$Epsilon$");
-        HfstTokenizer TOK;
-        TOK.add_multichar_symbol(newEpsilon);
-        TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
-        TOK.add_multichar_symbol("@_IDENTITY_SYMBOL_@");
-        ImplementationType type = retval.get_type();
-
-*/
-
         retval.substitute(StringPair(leftMarker, leftMarker), StringPair("@_EPSILON_SYMBOL_@", "@_EPSILON_SYMBOL_@")).minimize();
         retval.substitute(StringPair(rightMarker, rightMarker), StringPair("@_EPSILON_SYMBOL_@", "@_EPSILON_SYMBOL_@")).minimize();
 
@@ -207,29 +306,12 @@ namespace hfst
         retval.minimize();
 
 
-        /*
+        
         //printf("tr without markers: \n");
         //retval.write_in_att_format(stdout, 1);
-
-
-        //replace tmp_epsilon with real one
-
-        HfstTransducer tmpEpsToEps(newEpsilon, "@_EPSILON_SYMBOL_@", TOK, type);
-        // Identity (normal)
-        HfstTransducer identityPair = HfstTransducer::identity_pair( type );
-        HfstTransducer identity (identityPair);
-        identity.insert_to_alphabet(newEpsilon);
-
-        tmpEpsToEps.disjunct(identity).repeat_star().minimize();
-        //identity.repeat_star().minimize();
-
-        printf("tmpEpsToEps: \n");
-        tmpEpsToEps.write_in_att_format(stdout, 1);
-
-        retval.invert().compose(tmpEpsToEps).invert().minimize();
-        printf("retval: \n");
-        retval.write_in_att_format(stdout, 1);
-        */
+        
+        retval = decodeFlagDiacritics(retval);
+        
         return retval;
       }
 
@@ -493,7 +575,7 @@ namespace hfst
        *         (same for left context, (.* Cl))
       */
 
-      HfstTransducer bracketedReplace( const Rule &rule, bool optional)
+      HfstTransducer bracketedReplace(const Rule &rule, bool optional)
       {
         //printf("bracketedReplace function..... \n");
 
@@ -505,7 +587,6 @@ namespace hfst
         String tmpMarker("@TMPM@");
         String leftMarker2("@LM2@");
         String rightMarker2("@RM2@");
-        String markupMarker("@MMM@");
         String newEpsilon("$Epsilon$");
 
         TOK.add_multichar_symbol(leftMarker);
@@ -513,15 +594,16 @@ namespace hfst
         TOK.add_multichar_symbol(leftMarker2);
         TOK.add_multichar_symbol(rightMarker2);
         TOK.add_multichar_symbol(tmpMarker);
-        TOK.add_multichar_symbol(markupMarker);
         TOK.add_multichar_symbol(newEpsilon);
         TOK.add_multichar_symbol( ".#.");
 
+        //first, encode all flag diacritics
+        Rule ruletmp(rule);
+        ruletmp.encodeFlags();
 
-
-        HfstTransducerPairVector mappingPairVector( rule.get_mapping() );
-        HfstTransducerPairVector ContextVector( rule.get_context() );
-        ReplaceType replType( rule.get_replType() );
+        HfstTransducerPairVector mappingPairVector( ruletmp.get_mapping() );
+        HfstTransducerPairVector ContextVector( ruletmp.get_context() );
+        ReplaceType replType( ruletmp.get_replType() );
 
         ImplementationType type = mappingPairVector[0].first.get_type();
 
@@ -535,43 +617,18 @@ namespace hfst
         HfstTransducer mapping(type);
         for ( unsigned int i = 0; i < mappingPairVector.size(); i++ )
         {
-
             HfstTransducer oneMappingPair(mappingPairVector[i].first);
-
-            // if it is markup rule, substitute epsilon in left mapping with marker
-            if ( mappingPairVector[i].second.get_property("isMarkup") == "yes" )
-            {
-                oneMappingPair.substitute(StringPair("@_EPSILON_SYMBOL_@", "@_EPSILON_SYMBOL_@"), StringPair(markupMarker, markupMarker) ).minimize();
-            }
-
-            oneMappingPair.cross_product(mappingPairVector[i].second);
-
-
-           //printf("aftrer cross product \n");
-           //oneMappingPair.minimize().write_in_att_format(stdout, 1);
-
-
-
-            // if it is mark up rule
-            if ( mappingPairVector[i].second.get_property("isMarkup") == "yes" )
+          
+            //markup rules are already cross product in mappingPairVector[i].first (second is empty)
+            //so the cross product should not be done for markup rules
+            if ( mappingPairVector[i].first.get_property("isMarkup") != "yes" )
             {
-                HfstTransducer identityPairTmp = HfstTransducer::identity_pair( type );
-                identityPairTmp.insert_to_alphabet(markupMarker);
-
-                // remove relations from the cross product
-                HfstTransducer tmpForIntersect(identityPairTmp);
-                HfstTransducer markupMarkToUnknown(markupMarker, "@_UNKNOWN_SYMBOL_@", TOK, type);
-                tmpForIntersect.disjunct(markupMarkToUnknown);
-                tmpForIntersect.repeat_star().minimize();
-                oneMappingPair.intersect(tmpForIntersect).minimize();
-
-                // replace temporary mark-up marker back to epsilons
-                HfstTransducer tmpForCompose("@_EPSILON_SYMBOL_@", markupMarker, TOK, type);
-                tmpForCompose.disjunct(identityPairTmp).repeat_star().minimize();
-                tmpForCompose.compose(oneMappingPair);
-                oneMappingPair = tmpForCompose;
-                oneMappingPair.remove_from_alphabet(markupMarker);
+                oneMappingPair.cross_product(mappingPairVector[i].second);
             }
+           // printf("aftrer cross product \n");
+           // oneMappingPair.write_in_att_format(stdout, 1);
+          
+          
             // for removing .#. from the center
             HfstTransducer identityWithoutBoundary(identity);
             identityWithoutBoundary.insert_to_alphabet(".#.");
@@ -582,8 +639,8 @@ namespace hfst
             //removeHash.write_in_att_format(stdout, 1);
 
 
-            //printf("oneMappingPair \n");
-            //oneMappingPair.write_in_att_format(stdout, 1);
+            // printf("oneMappingPair kkkk\n");
+            // oneMappingPair.write_in_att_format(stdout, 1);
 
 
             if ( i == 0 )
@@ -880,8 +937,11 @@ namespace hfst
         // go through vector and do everything for each rule
         for ( unsigned int i = 0; i < ruleVector.size(); i++ )
         {
+            Rule ruletmp(ruleVector[i]);
+            ruletmp.encodeFlags();
+            
           HfstTransducerPairVector mappingPairVector 
-            = ruleVector[i].get_mapping();
+            = ruletmp.get_mapping();
           HfstTransducer mapping(type);
           for ( unsigned int j = 0; j < mappingPairVector.size(); j++ )
             {
@@ -918,8 +978,8 @@ namespace hfst
             }
           
           
-          HfstTransducerPairVector contextVector = ruleVector[i].get_context();
-          //ReplaceType replaceType = ruleVector[i].get_replType();
+          HfstTransducerPairVector contextVector = ruletmp.get_context();
+          //ReplaceType replaceType = ruletmp.get_replType();
 
           // when there aren't any contexts, result is identityExpanded
           if ( contextVector.size() == 1 )
@@ -1017,9 +1077,6 @@ namespace hfst
           }
         
         // if they have contexts, process them
-        
-
-
         if ( ruleVector.size() != mappingWithBracketsVector.size() )
           {
             HFST_THROW_MESSAGE(TransducerTypeMismatchException, 
@@ -1036,6 +1093,8 @@ namespace hfst
         //HfstTransducer unionContextReplace_labels(type);
         for ( unsigned int i = 0; i < ruleVector.size(); i++ )
           {
+            Rule ruletmp(ruleVector[i]);
+            ruletmp.encodeFlags();
             
             // Surround mapping with brackets with tmp boudaries
             HfstTransducer mappingWithBracketsAndTmpBoundary(tmpBracket);
@@ -1063,9 +1122,9 @@ namespace hfst
             //
             // where the second rule yields caCac -> cbCbc and the first one
             // again cbCbc -> cbdbc.
-            HfstTransducerPairVector cont = ruleVector[i].get_context();
+            HfstTransducerPairVector cont = ruletmp.get_context();
 
-            if (ruleVector[i].get_replType() != REPL_UP)
+            if (ruletmp.get_replType() != REPL_UP)
               {
                 for (HfstTransducerPairVector::iterator cont_it = cont.begin();
                      cont_it != cont.end(); cont_it++)
@@ -1089,7 +1148,7 @@ namespace hfst
               = expandContextsWithMapping ( cont,
                                             mappingWithBracketsAndTmpBoundary,
                                             identityExpanded,
-                                            ruleVector[i].get_replType(),
+                                            ruletmp.get_replType(),
                                             optional);
             
             unionContextReplaceTmp.transform_weights(&zero_weight);
@@ -2220,10 +2279,14 @@ namespace hfst
         //---------------------------------
 
         // used by hfst-regexp parser
+        // creates markup crossproduct and sets property of the first transducer in the mapping to "isMarkup" = "yes"
+        // the other transducer in the mapping is set to epsilon transducer
         HfstTransducerPair create_mapping_for_mark_up_replace( const HfstTransducerPair &mappingPair,
                                                           const HfstTransducerPair &marks )
         {
             HfstTokenizer TOK;
+            String epsilon = "@_EPSILON_SYMBOL_@";
+            TOK.add_multichar_symbol(epsilon);
             TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
 
             ImplementationType type = mappingPair.first.get_type();
@@ -2233,189 +2296,29 @@ namespace hfst
 
             HfstTransducer epsilonToLeftMark("@_EPSILON_SYMBOL_@", TOK, type);
             epsilonToLeftMark.cross_product(leftMark).minimize();
-            //printf("epsilonToLeftMark: \n");
-            //epsilonToLeftMark.write_in_att_format(stdout, 1);
 
-            HfstTransducer epsilonToRightMark("@_EPSILON_SYMBOL_@", TOK, type);
+            HfstTransducer epsilonToRightMark(epsilon, TOK, type);
             epsilonToRightMark.cross_product(rightMark).minimize();
 
-            //printf("epsilonToRightMark: \n");
-            //epsilonToRightMark.write_in_att_format(stdout, 1);
-
             //Go through left part of every mapping pair
             // and concatenate: epsilonToLeftMark.leftMapping.epsilonToRightMark
             //then put it into right part of the new transducerPairVector
             HfstTransducer mappingCrossProduct(epsilonToLeftMark);
             mappingCrossProduct.concatenate(mappingPair.first).
-                    minimize().
                     concatenate(epsilonToRightMark).
                     minimize();
 
-            //printf("mappingCrossProduct: \n");
-            //mappingCrossProduct.write_in_att_format(stdout, 1);
-
-            HfstTransducer in(mappingCrossProduct);
-            in.input_project();
-            in.transform_weights(&zero_weight);
-            //printf("in: \n");
-            //in.write_in_att_format(stdout, 1);
-
-            //printf("out: \n");
-
-            HfstTransducer out(mappingCrossProduct);
-            out.output_project();
-            //printf("out: \n");
-            //out.write_in_att_format(stdout, 1);
-
-            out.set_property("isMarkup", "yes");
-            HfstTransducerPair retval(in, out);
-
-            return retval;
-        }
-
-
-        HfstTransducerPairVector create_mapping_for_mark_up_replace( const HfstTransducerPairVector &mappingPairVector,
-                                                          const StringPair &marks )
-        {
-            HfstTokenizer TOK;
-            TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
-
-            ImplementationType type = mappingPairVector[0].first.get_type();
-
-            HfstTransducer leftMark(marks.first, TOK, type);
-            HfstTransducer rightMark(marks.second, TOK, type);
-
-            HfstTransducer epsilonToLeftMark("@_EPSILON_SYMBOL_@", TOK, type);
-            epsilonToLeftMark.cross_product(leftMark).minimize();
-
-            //printf("epsilonToLeftMark: \n");
-            //epsilonToLeftMark.write_in_att_format(stdout, 1);
-
-
-            HfstTransducer epsilonToRightMark("@_EPSILON_SYMBOL_@", TOK, type);
-            epsilonToRightMark.cross_product(rightMark).minimize();
-
-            //printf("epsilonToRightMark: \n");
-            //epsilonToRightMark.write_in_att_format(stdout, 1);
-
-            //Go through left part of every mapping pair
-            // and concatenate: epsilonToLeftMark.leftMapping.epsilonToRightMark
-            //then put it into right part of the new transducerPairVector
-            HfstTransducerPairVector retval;
-            //HfstTransducer mapping(type);
-            for ( unsigned int i = 0; i < mappingPairVector.size(); i++ )
-            {
-
-                //printf("mapping left: \n");
-                //mappingPairVector[i].first.write_in_att_format(stdout, 1);
-
-                HfstTransducer mappingCrossProduct(epsilonToLeftMark);
-                mappingCrossProduct.concatenate(mappingPairVector[i].first).
-                        minimize().
-                        concatenate(epsilonToRightMark).
-                        minimize();
-
-                //printf("mappingCrossProduct: \n");
-                //mappingCrossProduct.write_in_att_format(stdout, 1);
-
-
-
-                HfstTransducer in(mappingCrossProduct);
-                in.input_project();
-                in.transform_weights(&zero_weight);
-                //printf("in: \n");
-                //in.write_in_att_format(stdout, 1);
-
-                //printf("out: \n");
-
-                HfstTransducer out(mappingCrossProduct);
-                out.output_project();
-                //printf("out: \n");
-                //out.write_in_att_format(stdout, 1);
-
-                out.set_property("isMarkup", "yes");
-                retval.push_back(HfstTransducerPair(in, out));
-            }
-            return retval;
-        }
-        HfstTransducerPairVector create_mapping_for_mark_up_replace( const HfstTransducerPairVector &mappingPairVector,
-                                                              const HfstTransducerPair &marks )
-        {
-            HfstTokenizer TOK;
-            TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
-
-            ImplementationType type = mappingPairVector[0].first.get_type();
-
-            HfstTransducer leftMark(marks.first);
-            HfstTransducer rightMark(marks.second);
-
-            HfstTransducer epsilonToLeftMark("@_EPSILON_SYMBOL_@", TOK, type);
-            epsilonToLeftMark.cross_product(leftMark).minimize();
-
-            //printf("epsilonToLeftMark: \n");
-            //epsilonToLeftMark.write_in_att_format(stdout, 1);
-
-
-            HfstTransducer epsilonToRightMark("@_EPSILON_SYMBOL_@", TOK, type);
-            epsilonToRightMark.cross_product(rightMark).minimize();
-
-            //printf("epsilonToRightMark: \n");
-            //epsilonToRightMark.write_in_att_format(stdout, 1);
-
-
-            //Go through left part of every mapping pair
-            // and concatenate: epsilonToLeftMark.leftMapping.epsilonToRightMark
-            //then put it into right part of the new transducerPairVector
-            HfstTransducerPairVector retval;
-            //HfstTransducer mapping(type);
-            for ( unsigned int i = 0; i < mappingPairVector.size(); i++ )
-            {
-
-                //printf("mapping left: \n");
-                //mappingPairVector[i].first.write_in_att_format(stdout, 1);
-
-                HfstTransducer mappingCrossProduct(epsilonToLeftMark);
-                mappingCrossProduct.concatenate(mappingPairVector[i].first).
-                        minimize().
-                        concatenate(epsilonToRightMark).
-                        minimize();
-
-                //printf("mappingCrossProduct: \n");
-                //mappingCrossProduct.write_in_att_format(stdout, 1);
-
-
-
-                HfstTransducer in(mappingCrossProduct);
-                in.input_project();
-                in.transform_weights(&zero_weight);
-                //printf("in: \n");
-                //in.write_in_att_format(stdout, 1);
-
-                //printf("out: \n");
-
-                HfstTransducer out(mappingCrossProduct);
-                out.output_project();
-                //printf("out: \n");
-                //out.write_in_att_format(stdout, 1);
+            mappingCrossProduct.set_property("isMarkup", "yes");
+            
+            HfstTransducer epsilonTr(epsilon, TOK, type);
+            HfstTransducerPair retval(mappingCrossProduct, epsilonTr);
 
-                out.set_property("isMarkup", "yes");
-                retval.push_back(HfstTransducerPair(in, out));
-            }
             return retval;
         }
 
 
 
 
-
-
-
-
-
-
-
-
-
       //---------------------------------
       //    REPLACE FUNCTIONS - INTERFACE
       //---------------------------------
@@ -2424,7 +2327,6 @@ namespace hfst
       // replace up, left, right, down
       HfstTransducer replace( const Rule &rule, bool optional)
       {
-
           HfstTransducer retval( bracketedReplace(rule, optional) );
 
           //printf("---bracketed replace done---: \n");
@@ -2872,39 +2774,8 @@ namespace hfst
         return retval;
     }
 
-
-
-      HfstTransducer mark_up_replace( const Rule &rule,
-                              const StringPair &marks,
-                              bool optional)
-      {
-
-        HfstTransducerPairVector new_mapping = create_mapping_for_mark_up_replace(rule.get_mapping(), marks);
-        Rule newRule(new_mapping, rule.get_context(), rule.get_replType());
-
-        HfstTransducer retval(replace(newRule, optional));
-
-        //printf("after replace: \n");
-        //retval.write_in_att_format(stdout, 1);
-        return retval;
-      }
-
-      HfstTransducer mark_up_replace( const Rule &rule,
-                                   const HfstTransducerPair &marks,
-                                   bool optional)
-      {
-          HfstTransducerPairVector new_mapping = create_mapping_for_mark_up_replace(rule.get_mapping(), marks);
-
-          Rule newRule(new_mapping, rule.get_context(), rule.get_replType());
-          //printf("epsilonToRightMark: \n");
-          //epsilonToRightMark.write_in_att_format(stdout, 1);
-
-          HfstTransducer retval(replace(newRule, optional));
-
-          return retval;
-      }
-
-
+    
+    
       // replace up, left, right, down
       HfstTransducer replace_epenthesis(    const Rule &rule, bool optional)
       {
@@ -3174,7 +3045,7 @@ int main(int argc, char * argv[])
             test2c( types[i] );
 
             // ? @-> a ... b;
-            test2d( types[i] );
+       //     test2d( types[i] );
 
             // testing unconditional replace with and without contexts
 
@@ -3191,8 +3062,9 @@ int main(int argc, char * argv[])
             test4b( types[i] );
             test4c( types[i] );
 
-            // mark up rule
-            test5( types[i] );
+            // mark up rule - doesn't have api interface anymore
+            // a | b -> %[...%] ;
+        //    test5( types[i] );
 
             // epenthesis rules
             test6a( types[i] );
@@ -3231,6 +3103,15 @@ int main(int argc, char * argv[])
             test10a( types[i] );
             // empty -> non-empty
             test10b( types[i] );
+            
+           
+            // flag diacritics
+            //a ->  "@P.FOO.BAR@" || a _ "@u.a.b@"
+            //test11 (types[i] );
+            
+            
+             //markup rules
+            //test12 (types[i] );
 
             // restriction functions =>
 
diff --git a/libhfst/src/HfstXeroxRules.h b/libhfst/src/HfstXeroxRules.h
index 236367b..dcab3af 100644
--- a/libhfst/src/HfstXeroxRules.h
+++ b/libhfst/src/HfstXeroxRules.h
@@ -26,11 +26,6 @@ namespace hfst
     {
         enum ReplaceType {REPL_UP, REPL_DOWN, REPL_RIGHT, REPL_LEFT};
 
-
-
-
-
-
         // this enum is used in xre_parse.yy for the regex2pfst tool
         // it is not in the xre_parse.yy file because we couldn't make it work there
         enum ReplaceArrow {    E_REPLACE_RIGHT,
@@ -58,40 +53,43 @@ namespace hfst
             ReplaceType replType;
 
           public:
-        //    Rule ( const HfstTransducer& ); // mapping
-        //    Rule ( const HfstTransducer&, const HfstTransducerPairVector&, ReplaceType); // mapping, context
             Rule ( const HfstTransducerPairVector& );
             Rule ( const HfstTransducerPairVector&, const HfstTransducerPairVector&, ReplaceType );
+            
+            //copy
+            Rule ( const Rule& );
 
             HfstTransducerPairVector get_mapping() const;
             HfstTransducerPairVector get_context() const;
             ReplaceType get_replType() const;
+            
+            void encodeFlags();
+             
             friend std::ostream& operator<<(std::ostream &out, const Rule &r);
         };
 
         /**
-         * \brief Mark up rule has two markers on the right side of the mapping.
-         * Mapping is only left side of the mapping.
-         */
-        class MarkUpRule : public Rule
-        {
-            StringPair marks;
-
-          public:
-            // for mark up replace
-
-        //    MarkUpRule ( const HfstTransducer&, StringPair ); // mapping
-        //    MarkUpRule ( const HfstTransducer&,  const HfstTransducerPairVector&, ReplaceType, StringPair); // mapping, context
-            MarkUpRule ( const HfstTransducerPairVector&, StringPair );
-            MarkUpRule ( const HfstTransducerPairVector&, const HfstTransducerPairVector&, ReplaceType, StringPair );
-            StringPair get_marks() const;
-        };
-
+         *  \brief  In the transducer \tr, change all flag diacritics to "non-special" multichar symbols
+         *  It means that @ sign will be changed to $ sign
+         *  ie. @P.FOO.BAR@ will be changed into $P.FOO.BAR$
+         *  */
+         HfstTransducer encodeFlagDiacritics( const HfstTransducer &tr );
+         
+         /**
+         *  \brief  In the transducer \tr, change back all "non-special" flag diacritics to normal, 
+         * functional flag diacritics
+         *  It means that $ sign will be changed to @ sign
+         *  ie. $P.FOO.BAR$ will be changed into @P.FOO.BAR@
+         *  */
+        HfstTransducer decodeFlagDiacritics( const HfstTransducer &tr );
+         
+         
         // Disjunct all transducers from TransducerVector
         HfstTransducer disjunctVectorMembers( const HfstTransducerVector &trVector );
 
         /**
          *  \brief Remove makers used in replace functions from a \a tr.
+         *  Additionally, decode flag diacritics.
          *  */
         HfstTransducer removeMarkers( const HfstTransducer &tr );
 
@@ -140,7 +138,6 @@ namespace hfst
 
 
 
-
         //---------------------------------
         //    CONSTRAINTS
         //---------------------------------
@@ -220,11 +217,11 @@ namespace hfst
         //used by hfst-regexp parser
         HfstTransducerPair create_mapping_for_mark_up_replace( const HfstTransducerPair &mappingPair,
                                                           const HfstTransducerPair &marks );
-        HfstTransducerPairVector create_mapping_for_mark_up_replace( const HfstTransducerPairVector &mappingPairVector,
-                                                                                        const StringPair &marks );
+        // HfstTransducerPairVector create_mapping_for_mark_up_replace( const HfstTransducerPairVector &mappingPairVector,
+                                                                                        // const StringPair &marks );
 
-        HfstTransducerPairVector create_mapping_for_mark_up_replace( const HfstTransducerPairVector &mappingPairVector,
-                                                                                             const HfstTransducerPair &marks );
+        // HfstTransducerPairVector create_mapping_for_mark_up_replace( const HfstTransducerPairVector &mappingPairVector,
+                                                                                             // const HfstTransducerPair &marks );
         //---------------------------------
         //    REPLACE FUNCTIONS - INTERFACE
         //---------------------------------
@@ -254,19 +251,21 @@ namespace hfst
         HfstTransducer replace_rightmost_shortest_match( const std::vector<Rule> &ruleVector );
 
 
+        // the problem is that the mark-up rules can be mixed with ordinary rules
+        // ie a -> b ... c , a -> d ; 
+        // this is why each markup mapping should be accessed seperratly
+        // HfstTransducer mark_up_replace(    const Rule &rule,
+                                // const StringPair &marks,
+                                // bool optional);
+
+        // HfstTransducer mark_up_replace(const Rule &rule,
+                                           // const HfstTransducerPair &marks,
+                                           // bool optional);
 
-        HfstTransducer mark_up_replace(    const Rule &rule,
-                                const StringPair &marks,
-                                bool optional);
 
-        HfstTransducer mark_up_replace(const Rule &rule,
-                                           const HfstTransducerPair &marks,
-                                           bool optional);
+        // HfstTransducer mark_up_replace(    const std::vector<MarkUpRule> &markUpRuleVector,
+                                // bool optional);
 
-/*
-        HfstTransducer mark_up_replace(    const std::vector<MarkUpRule> &markUpRuleVector,
-                                bool optional);
-*/
         // replace up, left, right, down
         HfstTransducer replace_epenthesis(    const Rule &rule, bool optional);
         // replace up, left, right, down
diff --git a/libhfst/src/HfstXeroxRulesTest.cc b/libhfst/src/HfstXeroxRulesTest.cc
index 4ea86f3..f0ec3ec 100644
--- a/libhfst/src/HfstXeroxRulesTest.cc
+++ b/libhfst/src/HfstXeroxRulesTest.cc
@@ -1754,52 +1754,6 @@ void test2c( ImplementationType type )
     assert(tmp2.compare(result1));
 }
 
-// ? @-> a ... b;
-void test2d( ImplementationType type )
-{
-
-    HfstTransducer identityPair = HfstTransducer::identity_pair( type );
-    HfstTransducer identityStar(identityPair);
-    identityStar.repeat_star();
-
-    HfstTokenizer TOK;
-    TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
-
-    // Mapping
-
-    HfstTransducer empty(type);
-
-    HfstTransducerPair mappingPair(identityPair, empty);
-    HfstTransducerPairVector mappingPairVector;
-    mappingPairVector.push_back(mappingPair);
-
-
-
-    StringPair marks("a","b");
-
-
-    // Context
-    HfstTransducerPair Context(HfstTransducer("@_EPSILON_SYMBOL_@", TOK, type), HfstTransducer("@_EPSILON_SYMBOL_@", TOK, type));
-
-    HfstTransducerPairVector ContextVector;
-    ContextVector.push_back(Context);
-
-    HfstTransducer input1("bb", TOK, type);
-
-    HfstTransducer result1("@_EPSILON_SYMBOL_ at b@_EPSILON_SYMBOL_@@_EPSILON_SYMBOL_ at b@_EPSILON_SYMBOL_@", "abbabb",TOK, type);
-
-
-    HfstTransducer replaceTr(type);
-    HfstTransducer tmp2(type);
-
-    Rule ruleUp(mappingPairVector, ContextVector, REPL_UP);
-
-    replaceTr = mark_up_replace(ruleUp, marks, false);
-    tmp2 = input1;
-    tmp2.compose(replaceTr).minimize();
-    assert(tmp2.compare(result1));
-}
-
 
 // test multiple contexts
 // a -> b ||  x _ x ;
@@ -2397,55 +2351,55 @@ void test4c( ImplementationType type )
 
 }
 
-// mark up rules
-void test5( ImplementationType type )
-{
-    HfstTokenizer TOK;
-    TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
+// // mark up rules
+// void test5( ImplementationType type )
+// {
+    // HfstTokenizer TOK;
+    // TOK.add_multichar_symbol("@_EPSILON_SYMBOL_@");
 
-    // Mapping
-    HfstTransducer lmtmp("b", TOK, type);
-    HfstTransducer leftMapping("a", TOK, type);
-    leftMapping.disjunct(lmtmp).minimize();
+    // // Mapping
+    // HfstTransducer lmtmp("b", TOK, type);
+    // HfstTransducer leftMapping("a", TOK, type);
+    // leftMapping.disjunct(lmtmp).minimize();
 
-    HfstTransducer empty(type);
+    // HfstTransducer empty(type);
 
-    HfstTransducerPair mappingPair(leftMapping, empty);
-    HfstTransducerPairVector mappingPairVector;
-    mappingPairVector.push_back(mappingPair);
+    // HfstTransducerPair mappingPair(leftMapping, empty);
+    // HfstTransducerPairVector mappingPairVector;
+    // mappingPairVector.push_back(mappingPair);
 
 
 
-    StringPair marks("[","]");
+    // StringPair marks("[","]");
 
 
-    // Context
-    HfstTransducerPair Context(HfstTransducer("@_EPSILON_SYMBOL_@", TOK, type), HfstTransducer("@_EPSILON_SYMBOL_@", TOK, type));
+    // // Context
+    // HfstTransducerPair Context(HfstTransducer("@_EPSILON_SYMBOL_@", TOK, type), HfstTransducer("@_EPSILON_SYMBOL_@", TOK, type));
 
-//    HfstTransducerPair Context(HfstTransducer("m", TOK, type), HfstTransducer("k", TOK, type));
+// //    HfstTransducerPair Context(HfstTransducer("m", TOK, type), HfstTransducer("k", TOK, type));
 
-    HfstTransducerPairVector ContextVector;
-    ContextVector.push_back(Context);
+    // HfstTransducerPairVector ContextVector;
+    // ContextVector.push_back(Context);
 
-    HfstTransducer input1("mba", TOK, type);
+    // HfstTransducer input1("mba", TOK, type);
 
-    HfstTransducer result1("m at _EPSILON_SYMBOL_@b at _EPSILON_SYMBOL_@@_EPSILON_SYMBOL_ at a@_EPSILON_SYMBOL_@", "m[b][a]",TOK, type);
+    // HfstTransducer result1("m at _EPSILON_SYMBOL_@b at _EPSILON_SYMBOL_@@_EPSILON_SYMBOL_ at a@_EPSILON_SYMBOL_@", "m[b][a]",TOK, type);
 
 
-    HfstTransducer replaceTr(type);
-    HfstTransducer tmp2(type);
+    // HfstTransducer replaceTr(type);
+    // HfstTransducer tmp2(type);
 
-    Rule ruleUp(mappingPairVector, ContextVector, REPL_UP);
+    // Rule ruleUp(mappingPairVector, ContextVector, REPL_UP);
 
 
-    replaceTr = mark_up_replace(ruleUp, marks, false);
-    tmp2 = input1;
-    tmp2.compose(replaceTr).minimize();
-    //printf("test5: \n");
-    //tmp2.write_in_att_format(stdout, 1);
-    assert(tmp2.compare(result1));
+    // replaceTr = mark_up_replace(ruleUp, marks, false);
+    // tmp2 = input1;
+    // tmp2.compose(replaceTr).minimize();
+    // //printf("test5: \n");
+    // //tmp2.write_in_att_format(stdout, 1);
+    // assert(tmp2.compare(result1));
 
-}
+// }
 
 
 // epenthesis rules
diff --git a/libhfst/src/Makefile.am b/libhfst/src/Makefile.am
index 83f14c2..9b3701f 100644
--- a/libhfst/src/Makefile.am
+++ b/libhfst/src/Makefile.am
@@ -29,7 +29,8 @@ HFST_SRCS=HfstApply.cc HfstInputStream.cc HfstTransducer.cc HfstOutputStream.cc\
 		  HfstFlagDiacritics.cc HfstExceptionDefs.cc \
 		  HarmonizeUnknownAndIdentitySymbols.cc \
 		  HfstLookupFlagDiacritics.cc \
-		  HfstEpsilonHandler.cc
+		  HfstEpsilonHandler.cc HfstStrings2FstTokenizer.cc \
+		  HfstPrintDot.cc HfstPrintPCKimmo.cc
 
 # libtool takes over
 libhfst_la_SOURCES = $(HFST_SRCS)
@@ -96,6 +97,9 @@ HFST_HDRS = \
 	HfstOutputStream.h \
 	HfstXeroxRules.h \
 	HfstLookupFlagDiacritics.h \
+	HfstStrings2FstTokenizer.h \
+	HfstPrintDot.h \
+	HfstPrintPCKimmo.h \
 	parsers/LexcCompiler.h parsers/XreCompiler.h parsers/PmatchCompiler.h \
 	hfstdll.h
 ### Add your library here ###
@@ -103,7 +107,7 @@ HFST_HDRS = \
 
 hfstinclude_HEADERS = $(HFST_HDRS)
 
-libhfst_la_LDFLAGS = -no-undefined -version-info 41:0:0
+libhfst_la_LDFLAGS = -no-undefined -version-info 42:0:0
 
 LIBHFST_TSTS=HfstApply HfstInputStream HfstTransducer \
 		HfstOutputStream HfstXeroxRules HfstRules HfstSymbolDefs \
diff --git a/libhfst/src/implementations/ConvertFomaTransducer.cc b/libhfst/src/implementations/ConvertFomaTransducer.cc
index b550a6c..7e18bd0 100644
--- a/libhfst/src/implementations/ConvertFomaTransducer.cc
+++ b/libhfst/src/implementations/ConvertFomaTransducer.cc
@@ -276,8 +276,8 @@ namespace hfst { namespace implementations
              tr_it != it->end(); tr_it++)
           {
             // Copy the transition
-            const char * input = tr_it->get_input_symbol().c_str();
-            const char * output = tr_it->get_output_symbol().c_str();
+            const char * input = tr_it->get_transition_data().get_input_symbol().c_str();
+            const char * output = tr_it->get_transition_data().get_output_symbol().c_str();
             fsm_construct_add_arc(h, 
                                   (int)source_state, 
                                   (int)tr_it->get_target_state(),
diff --git a/libhfst/src/implementations/ConvertTropicalWeightTransducer.cc b/libhfst/src/implementations/ConvertTropicalWeightTransducer.cc
index 88f69dc..4530c95 100644
--- a/libhfst/src/implementations/ConvertTropicalWeightTransducer.cc
+++ b/libhfst/src/implementations/ConvertTropicalWeightTransducer.cc
@@ -166,13 +166,17 @@ namespace hfst { namespace implementations
 
             if (arc.ilabel >= symbol_vector.size())
               {
-                std::cerr << "FATAL ERROR: input number " << arc.ilabel << " not in symbol_vector" << std::endl;
-                exit(1);
+                std::ostringstream oss;
+                oss << "FATAL ERROR: input number " << arc.ilabel << " not in symbol_vector" << std::endl;
+                HFST_THROW_MESSAGE(HfstFatalException, oss.str());
+                //exit(1);
               }
             if (arc.olabel >= symbol_vector.size())
               {
-                std::cerr << "FATAL ERROR: output number " << arc.olabel << " not in symbol_vector" << std::endl;
-                exit(1);
+                std::ostringstream oss;
+                oss << "FATAL ERROR: output number " << arc.olabel << " not in symbol_vector" << std::endl;
+                HFST_THROW_MESSAGE(HfstFatalException, oss.str());
+                //exit(1);
               }
 
             net->add_transition(origin, 
diff --git a/libhfst/src/implementations/HfstTransition.h b/libhfst/src/implementations/HfstTransition.h
index 558bc9a..d3f0ad9 100644
--- a/libhfst/src/implementations/HfstTransition.h
+++ b/libhfst/src/implementations/HfstTransition.h
@@ -63,6 +63,8 @@ namespace hfst {
         target_state(another.target_state), 
           transition_data(another.transition_data) 
             {}
+
+        HFSTDLL ~HfstTransition() {}
         
         /** @brief Whether this transition is less than transition \a
             another. Needed for storing transitions in a set. */
@@ -114,6 +116,11 @@ namespace hfst {
           return transition_data.get_weight();
         }
 
+       /** @brief Set the weight of the transition. */
+        HFSTDLL void set_weight(float w) {
+          transition_data.set_weight(w);
+        }
+
         friend class ComposeIntersectFst;
         friend class ComposeIntersectLexicon;
         friend class ComposeIntersectRule;
diff --git a/libhfst/src/implementations/HfstTransitionGraph.h b/libhfst/src/implementations/HfstTransitionGraph.h
index da1aba8..1e70f61 100644
--- a/libhfst/src/implementations/HfstTransitionGraph.h
+++ b/libhfst/src/implementations/HfstTransitionGraph.h
@@ -27,19 +27,6 @@
 
  namespace hfst {
 
-   class HfstFile {
-   private:
-     FILE * file;
-   public:
-     HFSTDLL HfstFile();
-     HFSTDLL ~HfstFile();
-     HFSTDLL void set_file(FILE * f);
-     HFSTDLL FILE * get_file();
-     HFSTDLL void close();
-     HFSTDLL void write(const char * str);
-   };
-
-
    /** @brief A namespace for all code that forms a bridge between
        backend libraries and HFST.
 
@@ -57,6 +44,7 @@
      typedef std::vector<HfstReplacement> HfstReplacements;
      typedef std::map<HfstState, HfstReplacements > HfstReplacementsMap;
 
+     typedef std::vector<std::vector<hfst::implementations::HfstBasicTransition> > HfstBasicStates;
 
      /** @brief A simple transition graph format that consists of
          states and transitions between those states.
@@ -131,9 +119,6 @@
      // --- Datatypes and variables ---
 
        public:
-         /** @brief Datatype for the states of a transition in a graph. */
-         typedef std::vector<HfstTransition<C> > HfstTransitions;
-
      /** @brief Datatype for a symbol in a transition. */
      typedef typename C::SymbolType HfstSymbol;
      /** @brief Datatype for a symbol pair in a transition. */
@@ -148,14 +133,18 @@
      /** @brief Datatype for the alphabet of a graph. */
          typedef std::set<HfstSymbol> HfstTransitionGraphAlphabet;
 
-       protected:
+     /** @brief Datatype for the states of a transition in a graph. */
+     typedef std::vector<HfstTransition<C> > HfstTransitions;
+
      /* Datatype for the states of a graph and their transitions.
         Each index of the vector is a state and the transitions 
         on that index are the transitions of that state. */
-         typedef std::vector<HfstTransitions> HfstStates;
+     typedef std::vector<HfstTransitions> HfstStates;
+
      /* States of the graph and their transitions. */
          HfstStates state_vector;
 
+       protected:
      /* The initial state number. */
          static const HfstState INITIAL_STATE = 0;
 
@@ -196,6 +185,11 @@
            return retval;
          }
 
+         /** @brief The states of the graph and their transitions. */
+         HfstBasicStates states_and_transitions() const {
+           return state_vector;
+         }
+
      // --------------------------------------------------------
      // --- Construction, assignment, copying and conversion ---
      // --------------------------------------------------------
@@ -216,14 +210,6 @@
          this->assign(read_in_att_format(file, "@0@", linecount));
        }
 
-       HFSTDLL HfstTransitionGraph(HfstFile &file) {
-         initialize_alphabet(alphabet);
-         HfstTransitions tr;
-         state_vector.push_back(tr);
-         unsigned int linecount=0;
-         this->assign(read_in_att_format(file.get_file(), "@0@", linecount));
-       }
-
 
      /** @brief The assignment operator. */
      HFSTDLL HfstTransitionGraph &operator=(const HfstTransitionGraph &graph)
@@ -630,6 +616,8 @@
 
          /** Get the final weight of state \a s in this graph. */
          HFSTDLL typename C::WeightType get_final_weight(HfstState s) const {
+           if (s > this->get_max_state())
+             HFST_THROW(StateIndexOutOfBoundsException);
            if (final_weight_map.find(s) != final_weight_map.end())
              return final_weight_map.find(s)->second;
            HFST_THROW(StateIsNotFinalException);
@@ -641,7 +629,7 @@
              If the state does not exist, it is created. */
          HFSTDLL void set_final_weight(HfstState s, 
                    const typename C::WeightType & weight) {
-       add_state(s);
+           add_state(s);
            final_weight_map[s] = weight;
          }
 
@@ -702,6 +690,15 @@
            return this->operator[](s);
          }
 
+         /** @brief Get mutable transitions.
+          */
+         HFSTDLL HfstTransitions & transitions(HfstState s) 
+         {
+           if (s >= state_vector.size()) { 
+             HFST_THROW(StateIndexOutOfBoundsException); }
+           return state_vector[s];
+         }
+
      // --------------------------------------------------
      // -----   Reading and writing in AT&T format   -----
      // --------------------------------------------------
@@ -1084,7 +1081,7 @@
              {
                if (symbols_used_.find(*it) == symbols_used_.end())
                  {
-                   os << "symbol(" << name << ", \"" << prologize_symbol(*it) << "\")" << std::endl;
+                   os << "symbol(" << name << ", \"" << prologize_symbol(*it) << "\")." << std::endl;
                  }
              }
 
@@ -1510,15 +1507,6 @@
               file, linecount);
          }       
 
-         HFSTDLL static HfstTransitionGraph read_in_prolog_format
-           (HfstFile &file, 
-            unsigned int & linecount)
-         {
-           return read_in_att_format(std::cin /* a dummy variable */, file.get_file(),
-                                     linecount);
-         }
-
-
 
          /** @brief Write the graph in xfst text format to FILE \a file.
              \a write_weights defines whether weights are printed (todo). */
@@ -1896,15 +1884,6 @@
               file, epsilon_symbol, linecount);
          }       
 
-         HFSTDLL static HfstTransitionGraph read_in_att_format
-           (HfstFile &file, 
-            std::string epsilon_symbol,
-            unsigned int & linecount)
-         {
-           return read_in_att_format(std::cin /* a dummy variable */, file.get_file(),
-                                     epsilon_symbol, linecount);
-         }
-
 
      // ----------------------------------------------
      // -----       Substitution functions       -----
@@ -2490,7 +2469,6 @@
 
 
 
-
          /* ----------------------------------------------------           
                Substitute string pair with a transition graph
             ---------------------------------------------------- */
@@ -3012,6 +2990,18 @@
          }
 
 
+         // aliases
+         HFSTDLL HfstTransitionGraph & substitute_symbol(const std::string &old_symbol, const std::string &new_symbol, bool input_side=true, bool output_side=true)
+           { return this->substitute(old_symbol, new_symbol, input_side, output_side); }
+
+         HFSTDLL HfstTransitionGraph & substitute_symbol_pair(const StringPair &old_symbol_pair, const StringPair &new_symbol_pair)
+           { return this->substitute(old_symbol_pair, new_symbol_pair); }
+
+         HFSTDLL HfstTransitionGraph & substitute_symbol_pair_with_set(const StringPair &old_symbol_pair, const hfst::StringPairSet &new_symbol_pair_set)
+           { return this->substitute(old_symbol_pair, new_symbol_pair_set); }
+
+         HFSTDLL HfstTransitionGraph & substitute_symbol_pair_with_transducer(const StringPair &symbol_pair, HfstTransitionGraph &transducer)
+           { return this->substitute(symbol_pair, transducer); }
 
 
          /* ----------------------------
@@ -3375,7 +3365,7 @@
                }
              // if there was previous distance defined for 'state', erase it, if needed
              int previous_distance = distance_of_state.at(state);
-             if (previous_distance != -1 && previous_distance != distance && overwrite)
+             if (previous_distance != -1 && previous_distance != (int)distance && overwrite)
                {
                  states_at_distance.at(previous_distance).erase(state);
                }
@@ -3510,6 +3500,70 @@
              return result;
            }
 
+         bool has_negative_epsilon_cycles
+           (HfstState state,
+            float total_weight,
+            std::map<HfstState, float> & state_weights)
+         {
+           std::map<HfstState, float>::const_iterator it = state_weights.find(state);
+           if (it != state_weights.end()) // cycle detected
+             {
+               if (total_weight - it->second < 0)
+                 {
+                   return true; // cycle with negative weight detected
+                 }
+               return false; // cycle with positive weight
+             }
+           state_weights[state] = total_weight;
+           
+           // Go through all transitions in this state                                 
+           const HfstBasicTransducer::HfstTransitions &transitions 
+             = this->operator[](state);
+           for (HfstBasicTransducer::HfstTransitions::const_iterator it
+                  = transitions.begin();
+                it != transitions.end(); it++)
+             {
+               if (is_epsilon(it->get_input_symbol()) && is_epsilon(it->get_output_symbol()))
+                 {
+                   if (has_negative_epsilon_cycles
+                       (it->get_target_state(), total_weight + it->get_weight(), state_weights))
+                     return true;
+                 }
+             }
+           state_weights.erase(state);
+           return false;
+         }
+
+         bool has_negative_epsilon_cycles()
+         {
+           bool has_negative_epsilon_transitions = false;
+           for (iterator it = begin(); it != end(); it++)
+             {
+               for (typename HfstTransitions::iterator tr_it
+                      = it->begin();
+                    tr_it != it->end(); tr_it++)
+                 {
+                   if (is_epsilon(tr_it->get_input_symbol()) && is_epsilon(tr_it->get_output_symbol()) && tr_it->get_weight() < 0)
+                     {
+                       has_negative_epsilon_transitions = true;
+                       break;
+                     }
+                 }
+             }
+           if (! has_negative_epsilon_transitions)
+             {
+               return false;
+             }
+
+           std::map<HfstState, float> state_weights;
+           for (unsigned int state = INITIAL_STATE; state < (this->get_max_state()+1); state++)
+             {
+               if (has_negative_epsilon_cycles(state, 0, state_weights))
+                 return true;
+             }
+           return false;           
+         }
+
          HFSTDLL bool is_infinitely_ambiguous
            (HfstState state, 
             std::set<HfstState> &epsilon_path_states,
@@ -3850,16 +3904,25 @@
          HFSTDLL void lookup_fd
            (const StringVector &lookup_path,
             HfstTwoLevelPaths &results,
-            size_t infinite_cutoff,
+            size_t * infinite_cutoff = NULL,
             float * max_weight = NULL)
          {
            HfstState state = 0;
            unsigned int lookup_index = 0;
            HfstTwoLevelPath path_so_far;
            StringSet alphabet = this->get_alphabet();
-           HfstEpsilonHandler Eh(infinite_cutoff);
-           lookup_fd(lookup_path, results, state, lookup_index, path_so_far, 
-                     alphabet, Eh, infinite_cutoff, max_weight);
+           if (infinite_cutoff != NULL)
+             {
+               HfstEpsilonHandler Eh(*infinite_cutoff);
+               lookup_fd(lookup_path, results, state, lookup_index, path_so_far, 
+                     alphabet, Eh, *infinite_cutoff, max_weight);
+             }
+           else
+             {
+               HfstEpsilonHandler Eh(100000);
+               lookup_fd(lookup_path, results, state, lookup_index, path_so_far, 
+                     alphabet, Eh, 100000, max_weight);
+             }
          }
 
 
@@ -4464,7 +4527,6 @@
     typedef HfstTransitionGraph <HfstFastTransitionData> 
       HfstFastTransducer;
 
- 
    }
    
  }
diff --git a/libhfst/src/implementations/HfstTropicalTransducerTransitionData.h b/libhfst/src/implementations/HfstTropicalTransducerTransitionData.h
index 408a459..da7c764 100644
--- a/libhfst/src/implementations/HfstTropicalTransducerTransitionData.h
+++ b/libhfst/src/implementations/HfstTropicalTransducerTransitionData.h
@@ -245,6 +245,12 @@ namespace hfst {
         return weight;
       }
 
+      /** @brief Set the weight. */
+      HFSTDLL void set_weight(WeightType w) {
+        weight = w;
+      }
+
+
       /* Are these needed? */
       HFSTDLL static bool is_epsilon(const SymbolType &symbol) {
         return (symbol.compare("@_EPSILON_SYMBOL_@") == 0);
diff --git a/libhfst/src/implementations/SfstTransducer.cc b/libhfst/src/implementations/SfstTransducer.cc
index 3b9325c..183278d 100644
--- a/libhfst/src/implementations/SfstTransducer.cc
+++ b/libhfst/src/implementations/SfstTransducer.cc
@@ -1161,14 +1161,16 @@ namespace hfst { namespace implementations {
         const char * osymbol = t->alphabet.code2symbol(it->upper_char());
 
         if (isymbol == NULL) {
-          fprintf(stderr, "ERROR: input number %i not found\n", 
-                  it->lower_char());
-          exit(1);
+          HFST_THROW_MESSAGE(HfstFatalException, "input number not found");
+          //fprintf(stderr, "ERROR: input number %i not found\n", 
+          //        it->lower_char());
+          //exit(1);
         }
         if (osymbol == NULL) {
-          fprintf(stderr, "ERROR: input number %i not found\n", 
-                  it->upper_char());
-          exit(1);
+          HFST_THROW_MESSAGE(HfstFatalException, "output number not found");
+          //fprintf(stderr, "ERROR: input number %i not found\n", 
+          //        it->upper_char());
+          //exit(1);
         }
 
         std::string istring(isymbol);
diff --git a/libhfst/src/implementations/TropicalWeightTransducer.cc b/libhfst/src/implementations/TropicalWeightTransducer.cc
index 7ce89e3..7339c8e 100644
--- a/libhfst/src/implementations/TropicalWeightTransducer.cc
+++ b/libhfst/src/implementations/TropicalWeightTransducer.cc
@@ -13,12 +13,29 @@
 #include "TropicalWeightTransducer.h"
 #include "HfstSymbolDefs.h"
 #include "HfstLookupFlagDiacritics.h"
+#include "HfstTransitionGraph.h"
+#include "ConvertTransducerFormat.h"
 
 #ifndef MAIN_TEST
+
+#define CHECK_EPSILON_CYCLES(x, y) { hfst::implementations::HfstBasicTransducer * fsm = hfst::implementations::ConversionFunctions::tropical_ofst_to_hfst_basic_transducer( x ); if (fsm->has_negative_epsilon_cycles()) { if (warning_stream != NULL) { *warning_stream << y << ": warning: transducer has epsilon cycles with a negative weight" << std::endl; } } delete fsm; }
+
 namespace hfst { 
   bool get_encode_weights();
 
   namespace implementations {
+
+    std::ostream * TropicalWeightTransducer::warning_stream = NULL;
+
+    std::ostream * TropicalWeightTransducer::get_warning_stream()
+    {
+      return warning_stream;
+    }
+
+    void TropicalWeightTransducer::set_warning_stream(std::ostream * os)
+    {
+      warning_stream = os;
+    }
     
     // This function can be moved to its own file if TropicalWeightTransducer.o
     // yields a 'File too big' error.
@@ -26,6 +43,9 @@ namespace hfst {
     (StdVectorFst * t, bool to_initial_state)
     {
       assert (t->InputSymbols() != NULL);
+
+      CHECK_EPSILON_CYCLES(t, "push_weights");
+      
       fst::StdVectorFst * retval = new fst::StdVectorFst();
       if (to_initial_state)
         fst::Push<StdArc, REWEIGHT_TO_INITIAL>(*t, retval, fst::kPushWeights);
@@ -35,12 +55,76 @@ namespace hfst {
       return retval;
     }
 
+    void TropicalWeightTransducer::add_to_weights(StdVectorFst * t, float w)
+    {
+      for (fst::StateIterator<StdVectorFst> siter(*t); 
+           ! siter.Done(); siter.Next()) 
+        {
+          StateId s = siter.Value();
+          for (fst::MutableArcIterator<fst::StdVectorFst> aiter(t,s); 
+               !aiter.Done(); aiter.Next())
+            {
+              const StdArc &arc = aiter.Value();
+
+              StdArc new_arc;
+              new_arc.ilabel = arc.ilabel;
+              new_arc.olabel = arc.olabel;
+              new_arc.nextstate = arc.nextstate;
+              new_arc.weight = arc.weight.Value() + w;
+
+              aiter.SetValue(new_arc);
+            }
+          if (t->Final(s) != TropicalWeight::Zero())
+            {
+              float old_weight = t->Final(s).Value();
+              t->SetFinal(s, old_weight + w);
+            }
+        }
+    }
+
+    float TropicalWeightTransducer::get_smallest_weight(StdVectorFst * t)
+    {
+      // in case of an empty transducer, infinity is returned
+      // (empty in the sense of having no transitions or final states)
+      float retval = std::numeric_limits<float>::infinity();
+      bool weight_found;
+      for (fst::StateIterator<StdVectorFst> siter(*t); 
+           ! siter.Done(); siter.Next()) 
+        {
+          StateId s = siter.Value();
+          for (fst::ArcIterator<StdVectorFst> aiter(*t,s); 
+               !aiter.Done(); aiter.Next())
+            {
+              const StdArc &arc = aiter.Value();
+              float w = arc.weight.Value();
+              if (w < retval)
+                retval = w;
+            }
+          if (t->Final(s) != TropicalWeight::Zero())
+            {
+              float w = t->Final(s).Value();
+              if (w < retval)
+                retval = w;
+            }
+        }
+      return retval;
+    }
+
     // This function can be moved to its own file if TropicalWeightTransducer.o
     // yields a 'File too big' error.
     StdVectorFst * TropicalWeightTransducer::minimize(StdVectorFst * t)
     {
+
+      CHECK_EPSILON_CYCLES(t, "minimize");
+
       RmEpsilon<StdArc>(t);
 
+      float w = get_smallest_weight(t); 
+      if (w < 0) 
+        { 
+          add_to_weights(t, -w); 
+        }
+
       EncodeMapper<StdArc> encode_mapper
         (hfst::get_encode_weights() ? (kEncodeLabels|kEncodeWeights) : (kEncodeLabels), ENCODE);
       Encode(t, &encode_mapper);
@@ -49,6 +133,12 @@ namespace hfst {
       Determinize<StdArc>(*t, det);
       Minimize<StdArc>(det);
       Decode(det, encode_mapper);
+
+      if (w < 0) 
+        { 
+          add_to_weights(det, w); 
+        }
+
       return det;
     }
 
@@ -1325,6 +1415,9 @@ namespace hfst {
     StdVectorFst * a = copy(a_);
     StdVectorFst * b = copy(b_);
 
+    CHECK_EPSILON_CYCLES(a, "are_equivalent");
+    CHECK_EPSILON_CYCLES(b, "are_equivalent");
+
     RmEpsilon<StdArc>(a);
     RmEpsilon<StdArc>(b);
 
@@ -1534,14 +1627,29 @@ namespace hfst {
   StdVectorFst * 
   TropicalWeightTransducer::determinize(StdVectorFst * t)
   {
+
+    CHECK_EPSILON_CYCLES(t, "determinize");
+
     RmEpsilon<StdArc>(t);
 
+    float w = get_smallest_weight(t); 
+    if (w < 0) 
+      { 
+        add_to_weights(t, -w); 
+      }
+
     EncodeMapper<StdArc> encode_mapper
       (hfst::get_encode_weights() ? (kEncodeLabels|kEncodeWeights) : (kEncodeLabels), ENCODE);
     Encode(t, &encode_mapper);
     StdVectorFst * det = new StdVectorFst();
     Determinize<StdArc>(*t, det);
     Decode(det, encode_mapper);
+
+    if (w < 0) 
+      { 
+        add_to_weights(det, w); 
+      }
+
     return det;
   }
 
@@ -1682,7 +1790,9 @@ namespace hfst {
 
   StdVectorFst * 
   TropicalWeightTransducer::remove_epsilons(StdVectorFst * t)
-  { return new StdVectorFst(RmEpsilonFst<StdArc>(*t)); }
+  {
+    CHECK_EPSILON_CYCLES(t, "remove_epsilons");
+    return new StdVectorFst(RmEpsilonFst<StdArc>(*t)); }
 
   StdVectorFst * 
   TropicalWeightTransducer::prune(StdVectorFst * t)
@@ -1694,15 +1804,29 @@ namespace hfst {
   StdVectorFst * 
   TropicalWeightTransducer::n_best(StdVectorFst * t, unsigned int n)
   { 
+    CHECK_EPSILON_CYCLES(t, "n_best");
+
     StdVectorFst * n_best_fst = new StdVectorFst(); 
+    StdVectorFst * scaled = t->Copy();
+    RmEpsilon(scaled);
+    float w = get_smallest_weight(scaled); 
+    if (w < 0) 
+      { 
+        add_to_weights(scaled, -w); 
+      }
     try 
       {
-        fst::ShortestPath(*t,n_best_fst,(size_t)n);
+        fst::ShortestPath(*scaled,n_best_fst,(size_t)n);
       }
     catch (const std::bad_alloc & e)
       {
         HFST_THROW_MESSAGE(HfstFatalException, "TropicalWeightTransducer::nbest runs out of memory");
       }
+    RmEpsilon(n_best_fst);
+    if (w < 0) 
+      { 
+        add_to_weights(n_best_fst, w); 
+      }
     return n_best_fst;
   }
 
@@ -2238,6 +2362,9 @@ namespace hfst {
   StdVectorFst * TropicalWeightTransducer::intersect(StdVectorFst * t1,
                                                      StdVectorFst * t2)
   {
+    CHECK_EPSILON_CYCLES(t1, "intersect");
+    CHECK_EPSILON_CYCLES(t2, "intersect");
+
     RmEpsilon(t1);
     RmEpsilon(t2);
 
@@ -2278,6 +2405,9 @@ namespace hfst {
     if (t2->OutputSymbols() == NULL)
       t2->SetOutputSymbols(t2->InputSymbols());
 
+    CHECK_EPSILON_CYCLES(t1, "subtract");
+    CHECK_EPSILON_CYCLES(t2, "subtract");
+
     RmEpsilon(t1);
     RmEpsilon(t2);
 
diff --git a/libhfst/src/implementations/TropicalWeightTransducer.h b/libhfst/src/implementations/TropicalWeightTransducer.h
index 8080821..9e9c2fc 100644
--- a/libhfst/src/implementations/TropicalWeightTransducer.h
+++ b/libhfst/src/implementations/TropicalWeightTransducer.h
@@ -245,6 +245,9 @@ namespace implementations
 
       static FdTable<int64>* get_flag_diacritics(StdVectorFst * t);
 
+      static void add_to_weights(StdVectorFst * t, float w);
+      static float get_smallest_weight(StdVectorFst * t);
+
       static void print_alphabet(const StdVectorFst *t);
 
       // string versions
@@ -310,11 +313,16 @@ namespace implementations
         (StdVectorFst * t, 
          std::vector<std::pair<unsigned short, std::string> > symbol_mappings);
 
+      static void set_warning_stream(std::ostream * os);
+      static std::ostream * get_warning_stream();
+
     private:
       static fst::SymbolTable create_symbol_table(std::string name);
       static void initialize_symbol_tables(StdVectorFst *t);
       static void remove_symbol_table(StdVectorFst *t);      
 
+      static std::ostream * warning_stream;
+
       /* Maps state numbers in AT&T text format to state ids used by 
          OpenFst transducers. */
       typedef std::map<int, StateId> StateMap;
diff --git a/libhfst/src/implementations/optimized-lookup/pmatch.cc b/libhfst/src/implementations/optimized-lookup/pmatch.cc
index 8518b2f..0438433 100644
--- a/libhfst/src/implementations/optimized-lookup/pmatch.cc
+++ b/libhfst/src/implementations/optimized-lookup/pmatch.cc
@@ -161,6 +161,8 @@ void PmatchAlphabet::count(SymbolNumber sym)
 PmatchContainer::PmatchContainer(std::istream & inputstream):
     verbose(false),
     locate_mode(false),
+    profile_mode(false),
+    single_codepoint_tokenization(false),
     recursion_depth_left(PMATCH_MAX_RECURSION_DEPTH),
     entry_stack()
 {
@@ -950,28 +952,47 @@ void PmatchTransducer::collect_first(TransitionTableIndex i,
 
 void PmatchContainer::initialize_input(const char * input_s)
 {
+    input.clear();
     char * input_str = const_cast<char *>(input_s);
     char ** input_str_ptr = &input_str;
     SymbolNumber k = NO_SYMBOL_NUMBER;
     SymbolNumber boundary_sym = alphabet.get_special(boundary);
-    input.clear();
+    char * single_codepoint_scratch;
+    char * single_codepoint_scratch_orig;
+    if (single_codepoint_tokenization) {
+        single_codepoint_scratch = new char[5];
+        single_codepoint_scratch_orig = single_codepoint_scratch;
+    }
     if (boundary_sym != NO_SYMBOL_NUMBER) {
         input.push_back(boundary_sym);
     }
     while (**input_str_ptr != 0) {
         char * original_input_loc = *input_str_ptr;
-        k = encoder->find_key(input_str_ptr);
+        if (single_codepoint_tokenization) {
+            int bytes_to_tokenize = nByte_utf8(**input_str_ptr);
+            if (bytes_to_tokenize > 0) {
+                single_codepoint_scratch = single_codepoint_scratch_orig;
+                memcpy(single_codepoint_scratch, *input_str_ptr, bytes_to_tokenize);
+                single_codepoint_scratch[bytes_to_tokenize] = '\0';
+                k = encoder->find_key(&single_codepoint_scratch);
+                if (k != NO_SYMBOL_NUMBER) {
+                    (*input_str_ptr) += bytes_to_tokenize;
+                }
+            }
+        } else {
+            k = encoder->find_key(input_str_ptr);
+        }
         if (k == NO_SYMBOL_NUMBER) {
+            // Regular tokenization failed
             // the encoder moves as far as it can during tokenization,
             // we want to go back to be in position to add one utf-8 char
             *input_str_ptr = original_input_loc;
-            // Regular tokenization failed
             int bytes_to_tokenize = nByte_utf8(**input_str_ptr);
             if (bytes_to_tokenize == 0) {
-                // even if it's not utf-8, tokenize a byte at a time
+                // if utf-8 tokenization fails too, just grab a byte
                 bytes_to_tokenize = 1;
             }
-            char * new_symbol = new char [bytes_to_tokenize + 1];
+            char new_symbol[5];
             memcpy(new_symbol, *input_str_ptr, bytes_to_tokenize);
             new_symbol[bytes_to_tokenize] = '\0';
             (*input_str_ptr) += bytes_to_tokenize;
@@ -979,13 +1000,15 @@ void PmatchContainer::initialize_input(const char * input_s)
             encoder->read_input_symbol(new_symbol, symbol_count);
             k = symbol_count;
             ++symbol_count;
-            delete [] new_symbol;
         }
         input.push_back(k);
     }
     if (boundary_sym != NO_SYMBOL_NUMBER) {
         input.push_back(boundary_sym);
     }
+    if (single_codepoint_tokenization) {
+        delete single_codepoint_scratch_orig;
+    }
     return;
 }
 
@@ -1168,6 +1191,7 @@ void PmatchTransducer::check_context(unsigned int input_pos,
                                      unsigned int tape_pos,
                                      TransitionTableIndex i)
 {
+//    std::cerr << local_stack.size() << std::endl;
     local_stack.top().context_placeholder = input_pos;
     if (local_stack.top().context == LC ||
         local_stack.top().context == NLC) {
@@ -1178,14 +1202,19 @@ void PmatchTransducer::check_context(unsigned int input_pos,
     // In case we have a negative context, we check to see if the context matched.
     // If it did, we schedule a passthrough arc after we've processed epsilons.
     bool schedule_passthrough = false;
+//            std::cerr << "!local_stack.top().negative_context_success is " <<
+//            !local_stack.top().negative_context_success << std::endl;
+
     if((local_stack.top().context == NLC || local_stack.top().context == NRC)
        && !local_stack.top().negative_context_success) {
         schedule_passthrough = true;
+//        std::cerr << "scheduled passthrough\n";
     }
     local_stack.pop();
     if (schedule_passthrough) {
         local_stack.top().pending_passthrough = true;
     }
+//    std::cerr << local_stack.size() << std::endl;
 }
 
 void PmatchTransducer::take_rtn(SymbolNumber input,
@@ -1297,9 +1326,9 @@ void PmatchTransducer::get_analyses(unsigned int input_pos,
         }
         return;
     }
-
     local_stack.top().default_symbol_trap = true;
     take_epsilons(input_pos, tape_pos, i + 1);
+//    std::cerr << "get_analyses local stack size is " << local_stack.size() << std::endl;
     if (local_stack.top().pending_passthrough) {
         // A negative context failed
         take_transitions(alphabet.get_special(Pmatch_passthrough),
diff --git a/libhfst/src/implementations/optimized-lookup/pmatch.h b/libhfst/src/implementations/optimized-lookup/pmatch.h
index e6ec1f3..ed1bb90 100644
--- a/libhfst/src/implementations/optimized-lookup/pmatch.h
+++ b/libhfst/src/implementations/optimized-lookup/pmatch.h
@@ -158,6 +158,7 @@ namespace hfst_ol {
         bool verbose;
         bool locate_mode;
         bool profile_mode;
+        bool single_codepoint_tokenization;
         unsigned int recursion_depth_left;
 
     public:
@@ -192,6 +193,8 @@ namespace hfst_ol {
         void set_verbose(bool b) { verbose = b; }
         void set_extract_tags_mode(bool b)
             { alphabet.extract_tags = b; }
+        void set_single_codepoint_tokenization(bool b)
+            { single_codepoint_tokenization = b; }
         void set_profile(bool b) { profile_mode = b; }
         bool try_recurse(void)
         {
diff --git a/libhfst/src/implementations/optimized-lookup/transducer.cc b/libhfst/src/implementations/optimized-lookup/transducer.cc
index b722e58..f6ad270 100644
--- a/libhfst/src/implementations/optimized-lookup/transducer.cc
+++ b/libhfst/src/implementations/optimized-lookup/transducer.cc
@@ -283,18 +283,20 @@ bool Transducer::initialize_input(const char * input)
     return true;
 }
 
-HfstOneLevelPaths * Transducer::lookup_fd(const StringVector & s, ssize_t limit)
+HfstOneLevelPaths * Transducer::lookup_fd(const StringVector & s, ssize_t limit,
+                                          double time_cutoff)
 {
     std::string input_str;
     for (StringVector::const_iterator it = s.begin(); it != s.end(); ++it) {
         input_str.append(*it);
     }
-    return lookup_fd(input_str, limit);
+    return lookup_fd(input_str, limit, time_cutoff);
 }
 
-HfstOneLevelPaths * Transducer::lookup_fd(const std::string & s, ssize_t limit)
+HfstOneLevelPaths * Transducer::lookup_fd(const std::string & s, ssize_t limit,
+                                          double time_cutoff)
 {
-    return lookup_fd(s.c_str(), limit);
+    return lookup_fd(s.c_str(), limit, time_cutoff);
 }
 
 bool Transducer::is_lookup_infinitely_ambiguous(const std::string & s)
@@ -323,9 +325,15 @@ bool Transducer::is_lookup_infinitely_ambiguous(const StringVector & s)
 }
 
 
-HfstOneLevelPaths * Transducer::lookup_fd(const char * s, ssize_t limit)
+HfstOneLevelPaths * Transducer::lookup_fd(const char * s, ssize_t limit,
+                                          double time_cutoff)
 {
     max_lookups = limit;
+    max_time = 0.0;
+    if (time_cutoff > 0.0) {
+        max_time = time_cutoff;
+        max_clock = clock() + CLOCKS_PER_SEC*max_time;
+    }
     HfstOneLevelPaths * results = new HfstOneLevelPaths;
     lookup_paths = results;
     if (!initialize_input(s)) {
@@ -340,6 +348,7 @@ HfstOneLevelPaths * Transducer::lookup_fd(const char * s, ssize_t limit)
     return results;
 }
 
+
 void Transducer::try_epsilon_transitions(unsigned int input_pos,
                                          unsigned int output_pos,
                                          TransitionTableIndex i)
@@ -363,7 +372,6 @@ void Transducer::try_epsilon_transitions(unsigned int input_pos,
             if (flag_state.apply_operation(
                     *(alphabet->get_operation(input)))) {
                 // flag diacritic allowed
-
                 TraversalState flag_reachable(target, flags);
                 if (traversal_states.count(flag_reachable) == 1) {
                     // We've been here before at this input, back out
@@ -472,6 +480,12 @@ void Transducer::get_analyses(unsigned int input_pos,
         // Back out because we have enough results already
         return;
     }
+    if (max_time > 0.0) {
+        // quit if we've overspent our time
+        if (clock() > max_clock) {
+            return;
+        }
+    }
     --recursion_depth_left;
     if (indexes_transition_table(i))
     {
@@ -666,55 +680,53 @@ Transducer::~Transducer()
     delete encoder;
 }
 
-TransducerTable<TransitionWIndex> & Transducer::copy_windex_table()
+TransducerTable<TransitionWIndex> Transducer::copy_windex_table()
 {
     if (!header->probe_flag(Weighted)) {
         HFST_THROW(TransducerHasWrongTypeException);
     }
-    TransducerTable<TransitionWIndex> * another =
-        new TransducerTable<TransitionWIndex>;
+    TransducerTable<TransitionWIndex> another;
     for (unsigned int i = 0; i < header->index_table_size(); ++i) {
-        another->append(TransitionWIndex(tables->get_index_input(i),
+        another.append(TransitionWIndex(tables->get_index_input(i),
                                          tables->get_index_target(i)));
     }
-    return *another;
+    return another;
 }
-TransducerTable<TransitionW> & Transducer::copy_transitionw_table()
+TransducerTable<TransitionW> Transducer::copy_transitionw_table()
 {
     if (!header->probe_flag(Weighted)) {
         HFST_THROW(TransducerHasWrongTypeException);
     }
-    TransducerTable<TransitionW> * another = new TransducerTable<TransitionW>;
+    TransducerTable<TransitionW> another;
     for (unsigned int i = 0; i < header->target_table_size(); ++i) {
-        another->append(TransitionW(tables->get_transition_input(i),
+        another.append(TransitionW(tables->get_transition_input(i),
                                     tables->get_transition_output(i),
                                     tables->get_transition_target(i),
                                     tables->get_weight(i)));
     }
-    return *another;
+    return another;
 }
-TransducerTable<TransitionIndex> & Transducer::copy_index_table()
+TransducerTable<TransitionIndex> Transducer::copy_index_table()
 {
     if (header->probe_flag(Weighted)) {
         HFST_THROW(TransducerHasWrongTypeException);
     }
-    TransducerTable<TransitionIndex> * another =
-        new TransducerTable<TransitionIndex>;
+    TransducerTable<TransitionIndex> another;
     for (unsigned int i = 0; i < header->index_table_size(); ++i) {
-        another->append(tables->get_index(i));
+        another.append(tables->get_index(i));
     }
-    return *another;
+    return another;
 }
-TransducerTable<Transition> & Transducer::copy_transition_table()
+TransducerTable<Transition> Transducer::copy_transition_table()
 {
     if (header->probe_flag(Weighted)) {
         HFST_THROW(TransducerHasWrongTypeException);
     }
-    TransducerTable<Transition> * another = new TransducerTable<Transition>();
+    TransducerTable<Transition> another;
     for (unsigned int i = 0; i < header->target_table_size(); ++i) {
-        another->append(tables->get_transition(i));
+        another.append(tables->get_transition(i));
     }
-    return *another;
+    return another;
 }
 
 
diff --git a/libhfst/src/implementations/optimized-lookup/transducer.h b/libhfst/src/implementations/optimized-lookup/transducer.h
index b86ecb8..e98ff52 100644
--- a/libhfst/src/implementations/optimized-lookup/transducer.h
+++ b/libhfst/src/implementations/optimized-lookup/transducer.h
@@ -32,6 +32,7 @@
 #include <deque>
 #include <queue>
 #include <stdexcept>
+#include <time.h>
 
 #include "../../HfstExceptionDefs.h"
 #include "../../HfstFlagDiacritics.h"
@@ -769,10 +770,17 @@ private:
     SymbolNumberVector symbols;
     
 public:
-    OlLetterTrie(void):
+    OlLetterTrie():
         letters(UCHAR_MAX, static_cast<OlLetterTrie*>(NULL)),
         symbols(UCHAR_MAX,NO_SYMBOL_NUMBER)
         {}
+
+    ~OlLetterTrie() {
+        for (size_t i=0 ; i<letters.size() ; ++i) {
+            delete letters[i];
+            letters[i] = 0;
+        }
+    }
     
     void add_string(const char * p,SymbolNumber symbol_key);
     bool has_key_starting_with(const char c) const;
@@ -848,6 +856,8 @@ protected:
 
     ssize_t max_lookups;
     unsigned int recursion_depth_left;
+    double max_time;
+    clock_t max_clock;
 
     void try_epsilon_transitions(unsigned int input_tape_pos,
                                  unsigned int output_tape_pos,
@@ -936,10 +946,10 @@ public:
     bool is_lookup_infinitely_ambiguous(const StringVector & s);
     bool is_lookup_infinitely_ambiguous(const std::string & input);
     
-    TransducerTable<TransitionWIndex> & copy_windex_table();
-    TransducerTable<TransitionW> & copy_transitionw_table();
-    TransducerTable<TransitionIndex> & copy_index_table();
-    TransducerTable<Transition> & copy_transition_table();
+    TransducerTable<TransitionWIndex> copy_windex_table();
+    TransducerTable<TransitionW> copy_transitionw_table();
+    TransducerTable<TransitionIndex> copy_index_table();
+    TransducerTable<Transition> copy_transition_table();
 
     // state_index must be an index to a state which is defined as either:
     // (1) the start of a set of entries in the transition index table, or
@@ -952,13 +962,16 @@ public:
 
 
     bool initialize_input(const char * input_str);
-    HfstOneLevelPaths * lookup_fd(const StringVector & s, ssize_t limit = -1);
+    HfstOneLevelPaths * lookup_fd(const StringVector & s, ssize_t limit = -1,
+        double time_cutoff = 0.0);
     /* Tokenize and lookup, accounting for flag diacritics, the surface string
        \a s. The return value, a pointer to HfstOneLevelPaths
        (which is a set) of analyses, is newly allocated.
     */
-    HfstOneLevelPaths * lookup_fd(const std::string & s, ssize_t limit = -1);
-    HfstOneLevelPaths * lookup_fd(const char * s, ssize_t limit = -1);
+    HfstOneLevelPaths * lookup_fd(const std::string & s, ssize_t limit = -1,
+                                  double time_cutoff = 0.0);
+    HfstOneLevelPaths * lookup_fd(const char * s, ssize_t limit = -1,
+                                  double time_cutoff = 0.0);
     void note_analysis(void);
 
     // Methods for supporting ospell
diff --git a/libhfst/src/parsers/LexcCompiler.cc b/libhfst/src/parsers/LexcCompiler.cc
index 9199ffb..463b86f 100644
--- a/libhfst/src/parsers/LexcCompiler.cc
+++ b/libhfst/src/parsers/LexcCompiler.cc
@@ -1,9 +1,7 @@
 //! @file LexcCompiler.cc
 //!
 //! @brief Implementation of lexc compilation.
-//! 
-//! @author Tommi A. Pirinen
-//!
+
 
 //       This program is free software: you can redistribute it and/or modify
 //       it under the terms of the GNU General Public License as published by
@@ -44,6 +42,11 @@ using std::set_difference;
 #include "HfstSymbolDefs.h"
 //#include "../../../tools/src/HfstStrings2FstTokenizer.h"
 
+#ifdef WINDOWS
+#include "../../../tools/src/hfst-string-conversions.h"
+using hfst::hfst_fprintf_console;
+#endif // WINDOWS
+
 using hfst::HfstTransducer;
 using hfst::implementations::HfstTransitionGraph;
 using hfst::implementations::HfstBasicTransducer;
@@ -87,11 +90,20 @@ LexcCompiler::LexcCompiler() :
     currentEntries_(0),
     parseErrors_(false),
     with_flags_(false),
+    align_strings_(false),
     minimize_flags_(false),
     rename_flags_(false),
-    allow_multiple_sublexicon_definitions_(false)
+    allow_multiple_sublexicon_definitions_(false),
+    error_(&std::cerr)
+#ifdef WINDOWS
+    , output_to_console_(false),
+    winoss_(std::ostringstream()),
+    redirected_stream_(NULL)
+#endif
 {
     xre_.set_expand_definitions(true);
+    xre_.set_error_stream(this->error_);
+    xre_.set_verbosity(!quiet_);
 }
 
 LexcCompiler::LexcCompiler(ImplementationType impl) :
@@ -105,9 +117,16 @@ LexcCompiler::LexcCompiler(ImplementationType impl) :
     currentEntries_(0),
     parseErrors_(false),
     with_flags_(false),
+    align_strings_(false),
     minimize_flags_(false),
     rename_flags_(false),
-    allow_multiple_sublexicon_definitions_(false)
+    allow_multiple_sublexicon_definitions_(false),
+    error_(&std::cerr)
+#ifdef WINDOWS
+    , output_to_console_(false),
+    winoss_(std::ostringstream()),
+    redirected_stream_(NULL)
+#endif
 {
     tokenizer_.add_multichar_symbol("@_EPSILON_SYMBOL_@");
     tokenizer_.add_multichar_symbol("@0@");
@@ -117,9 +136,11 @@ LexcCompiler::LexcCompiler(ImplementationType impl) :
     lexiconNames_.insert(hash);
     tokenizer_.add_multichar_symbol(joinerEncode(hash));
     xre_.set_expand_definitions(true);
+    xre_.set_error_stream(this->error_);
+    xre_.set_verbosity(!quiet_);
 }
 
-LexcCompiler::LexcCompiler(ImplementationType impl, bool withFlags) :
+LexcCompiler::LexcCompiler(ImplementationType impl, bool withFlags, bool alignStrings) :
     quiet_(false),
     verbose_(false),
     treat_warnings_as_errors_(false),
@@ -130,9 +151,16 @@ LexcCompiler::LexcCompiler(ImplementationType impl, bool withFlags) :
     currentEntries_(0),
     parseErrors_(false),
     with_flags_(withFlags),
+    align_strings_(alignStrings),
     minimize_flags_(false),
     rename_flags_(false),
-    allow_multiple_sublexicon_definitions_(false)
+    allow_multiple_sublexicon_definitions_(false),
+    error_(&std::cerr)
+#ifdef WINDOWS
+    , output_to_console_(false),
+    winoss_(std::ostringstream()),
+    redirected_stream_(NULL)
+#endif
 {
     tokenizer_.add_multichar_symbol("@_EPSILON_SYMBOL_@");
     tokenizer_.add_multichar_symbol("@0@");
@@ -142,9 +170,59 @@ LexcCompiler::LexcCompiler(ImplementationType impl, bool withFlags) :
     lexiconNames_.insert(hash);
     tokenizer_.add_multichar_symbol(joinerEncode(hash));
     xre_.set_expand_definitions(true);
+    xre_.set_error_stream(this->error_);
+    xre_.set_verbosity(!quiet_);
 }
 
 
+    std::ostream * LexcCompiler::get_stream(std::ostream * oss)
+    {
+#ifdef WINDOWS
+      if (output_to_console_ && (oss == &std::cerr || oss == &std::cout))
+        {
+          redirected_stream_ = oss;
+          return &winoss_;
+        }
+#endif
+      return oss;
+    }
+
+    void LexcCompiler::flush(std::ostream * oss)
+    {
+#ifdef WINDOWS
+      if (output_to_console_ && (oss == &winoss_))
+        {
+          if (redirected_stream_ == &std::cerr)
+            hfst_fprintf_console(stderr, winoss_.str().c_str());
+          else if (redirected_stream_ == &std::cout)
+            hfst_fprintf_console(stdout, winoss_.str().c_str());
+          else
+            ;
+          redirected_stream_ = NULL;
+          winoss_.str("");
+        }
+#endif
+    }
+
+    void LexcCompiler::setOutputToConsole(bool value)
+    {
+#ifdef WINDOWS
+      output_to_console_ = value;
+#else
+      (void)value;
+#endif
+    }
+
+    bool LexcCompiler::getOutputToConsole()
+    {
+#ifdef WINDOWS
+      return output_to_console_;
+#else
+      return false;
+#endif
+    }
+
+
 LexcCompiler& LexcCompiler::parse(FILE* infile)
 {
     lexc_ = this;
@@ -174,7 +252,10 @@ LexcCompiler& LexcCompiler::parse(const char* filename)
     hlexcin = fopen(filename, "r");
     if (hlexcin == NULL)
       {
-        fprintf(stderr, "could not open %s for reading\n", filename);
+        std::ostream * err = get_stream(error_);
+        *err << "could not open " << filename << " for reading" << std::endl;
+        flush(err);  
+        //fprintf(stderr, "could not open %s for reading\n", filename);
         parseErrors_ = true;
         return *this;
       }
@@ -191,6 +272,17 @@ bool LexcCompiler::isQuiet()
   return quiet_;
 }
 
+unsigned int LexcCompiler::getVerbosity()
+{
+  if (quiet_ && !verbose_)
+    return 0;
+  if (!quiet_ && !verbose_)
+    return 1;
+  if (!quiet_ && verbose_)
+    return 2;
+  throw "LexcCompiler::getVerbosity() failed";
+}
+
 LexcCompiler&
 LexcCompiler::setVerbosity(unsigned int verbose)
 {
@@ -211,6 +303,7 @@ LexcCompiler::setVerbosity(unsigned int verbose)
       quiet_ = false;
       verbose_ = true;
     }
+  xre_.set_verbosity(!quiet_);
   return *this;
 }
 
@@ -227,6 +320,17 @@ LexcCompiler::setTreatWarningsAsErrors(bool value)
     return *this;
 }
 
+void LexcCompiler::set_error_stream(std::ostream * os)
+{
+  error_ = os;
+  xre_.set_error_stream(this->error_);
+}
+
+std::ostream * LexcCompiler::get_error_stream()
+{
+  return error_;
+}
+
 LexcCompiler&
 LexcCompiler::setAllowMultipleSublexiconDefinitions(bool value)
 {
@@ -234,6 +338,12 @@ LexcCompiler::setAllowMultipleSublexiconDefinitions(bool value)
     return *this;
 }
 
+LexcCompiler&
+LexcCompiler::setAlignStrings(bool value)
+{
+    align_strings_ = value;
+    return *this;
+}
 
 LexcCompiler&
 LexcCompiler::setWithFlags(bool value)
@@ -327,6 +437,7 @@ LexcCompiler::addStringEntry(const string& data,
 // to handle information to warn_about_one_sided_flags_
 static bool treat_one_sided_flags_as_errors_ = false;
 static bool quiet_one_sided_flags_ = false;
+static std::ostream * errorstr_ = NULL;
 
 static void warn_about_one_sided_flags(const std::pair<std::string, std::string> & symbol_pair)
 {
@@ -338,7 +449,8 @@ static void warn_about_one_sided_flags(const std::pair<std::string, std::string>
             {
               if (true /*!quiet_one_sided_flags_*/) // error messages are always printed
                 {
-                  std::cerr << std::endl << "*** ERROR: one-sided flag diacritic: " << symbol_pair.first << ":" << symbol_pair.second << " [--Werror]" << std::endl;
+                  *errorstr_ << std::endl << "*** ERROR: one-sided flag diacritic: " << symbol_pair.first << ":" << symbol_pair.second << " [--Werror]" << std::endl;
+                  lexc_->flush(errorstr_);
                 }
               throw "one-sided flag";
             }
@@ -355,7 +467,8 @@ static void warn_about_one_sided_flags(const std::pair<std::string, std::string>
         {
           if (true /*!quiet_one_sided_flags_*/) // error messages are always printed
             {
-              std::cerr << std::endl << "*** ERROR: one-sided flag diacritic: " << symbol_pair.first << ":" << symbol_pair.second << " [--Werror]" << std::endl;
+              *hfst::lexc::errorstr_ << std::endl << "*** ERROR: one-sided flag diacritic: " << symbol_pair.first << ":" << symbol_pair.second << " [--Werror]" << std::endl;
+              lexc_->flush(errorstr_);
             }
           throw "one-sided flag";
         }
@@ -415,61 +528,105 @@ LexcCompiler::addStringPairEntry(const string& upper, const string& lower,
     }
     tokenizer_.add_multichar_symbol(joinerEnc);
 
-    StringPairVector upperV;
-    upperV = tokenizer_.tokenize(upper_string);
+    // information for function pointer &warn_about_one_sided_flags
+    treat_one_sided_flags_as_errors_ = treat_warnings_as_errors_;
+    quiet_one_sided_flags_ = quiet_;
+    errorstr_ = this->get_stream(this->error_);
+    
+    StringPairVector newVector;
 
-    StringPairVector lowerV;
-    lowerV = tokenizer_.tokenize(lower_string);
+    
+    if (align_strings_)
+    {
+        StringPairVector tmp = tokenizer_.tokenize(upper_string, lower_string);
+        vector<string> one;
+        vector<string> two;
+        
 
-    int upperSize = upperV.size();
-    int lowerSize = lowerV.size();
+        for(StringPairVector::iterator it = tmp.begin() ; it < tmp.end(); ++it)
+        {
+            if (it->first != "@_EPSILON_SYMBOL_@" )
+                one.push_back(it->first);
+            if (it->second != "@_EPSILON_SYMBOL_@" )
+                two.push_back(it->second);
+        }
+        
+        
+        pair<vector<string>, vector<string> > med_vectors = find_med_alingment(one, two);
+        
+        
+        std::stringstream ss1;
+        for(size_t i = 0; i < med_vectors.first.size(); ++i)
+        {
+          ss1 << med_vectors.first[i];
+        }
+        std::string as1 = ss1.str();
+        
+         std::stringstream ss2;
+        for(size_t i = 0; i < med_vectors.second.size(); ++i)
+        {
+          ss2 << med_vectors.second[i];
+        }
+        std::string as2 = ss2.str();
+        
+        
+        newVector = tokenizer_.tokenize(joinerEnc + as1 + encodedCont,
+                                            joinerEnc + as2 + encodedCont,
+                                            &warn_about_one_sided_flags);
+    }else
+    {
+        StringPairVector upperV;
+        upperV = tokenizer_.tokenize(upper_string);
 
-    //cout << "u: "  << upperSize << "\n";
-    //cout << "L: "  << lowerSize << "\n";
+        StringPairVector lowerV;
+        lowerV = tokenizer_.tokenize(lower_string);
 
+        int upperSize = upperV.size();
+        int lowerSize = lowerV.size();
 
+        //cout << "u: "  << upperSize << "\n";
+        //cout << "L: "  << lowerSize << "\n";
 
-    StringVector upV;
-    StringVector loV;
 
-    StringPairVector newVector;
 
-    // information for function pointer &warn_about_one_sided_flags
-    treat_one_sided_flags_as_errors_ = treat_warnings_as_errors_;
-    quiet_one_sided_flags_ = quiet_;
+        // StringVector upV;
+        // StringVector loV;
+        
 
-    if ( upperSize > lowerSize)
-    {
-        std::string epsilons = "";
-        for(int i=1; i <= upperSize-lowerSize ; i++)
+        if ( upperSize > lowerSize)
         {
-            //cout << "another epsilon \n";
-            epsilons = epsilons + string("@@ANOTHER_EPSILON@@");
+            std::string epsilons = "";
+            for(int i=1; i <= upperSize-lowerSize ; i++)
+            {
+                //cout << "another epsilon \n";
+                epsilons = epsilons + string("@@ANOTHER_EPSILON@@");
 
-        }
-        newVector = tokenizer_.tokenize(joinerEnc + upper_string + encodedCont,
-                                        joinerEnc + lower_string + epsilons + encodedCont,
-                                        &warn_about_one_sided_flags);
+            }
+            newVector = tokenizer_.tokenize(joinerEnc + upper_string + encodedCont,
+                                            joinerEnc + lower_string + epsilons + encodedCont,
+                                            &warn_about_one_sided_flags);
 
-    }
-    else if (upperSize < lowerSize)
-    {
-        std::string epsilons = "";
-        for(int i=1; i <= lowerSize-upperSize ; i++)
+        }
+        else if (upperSize < lowerSize)
         {
-            //cout << "another epsilon \n";
-            epsilons = epsilons + string("@@ANOTHER_EPSILON@@");
+            std::string epsilons = "";
+            for(int i=1; i <= lowerSize-upperSize ; i++)
+            {
+                //cout << "another epsilon \n";
+                epsilons = epsilons + string("@@ANOTHER_EPSILON@@");
 
+            }
+            newVector = tokenizer_.tokenize(joinerEnc + upper_string + epsilons + encodedCont,
+                                            joinerEnc + lower_string + encodedCont,
+                                            &warn_about_one_sided_flags);
         }
-        newVector = tokenizer_.tokenize(joinerEnc + upper_string + epsilons + encodedCont,
-                                        joinerEnc + lower_string + encodedCont,
-                                        &warn_about_one_sided_flags);
-    }
-    else
-    {
-        newVector = tokenizer_.tokenize(joinerEnc + upper_string + encodedCont,
-                                        joinerEnc + lower_string + encodedCont,
-                                        &warn_about_one_sided_flags);
+        else
+        {
+            newVector = tokenizer_.tokenize(joinerEnc + upper_string + encodedCont,
+                                            joinerEnc + lower_string + encodedCont,
+                                            &warn_about_one_sided_flags);
+        }
+        
     }
     stringsTrie_.disjunct(newVector, weight);
 
@@ -542,8 +699,12 @@ LexcCompiler::addXreEntry(const string& regexp, const string& continuation,
       {
         if ((currentEntries_ % 10000) == 0)
           {
-            fprintf(stderr, SIZE_T_SPECIFIER "...", currentEntries_);
+            std::ostream * err = get_stream(error_);
+            *err << currentEntries_ << "...";
+            flush(err);
+            //fprintf(stderr, SIZE_T_SPECIFIER "...", currentEntries_);
           }
+          
       }
 
 
@@ -581,9 +742,12 @@ LexcCompiler::addXreDefinition(const string& definition_name, const string& xre)
     xre_.define(definition_name, xre);
     if (!quiet_)
       {
-        fprintf(stderr,
-            "Defined '%s': ? Kb., ? states, ? arcs, ? paths.\n",
-            definition_name.c_str());
+        std::ostream * err = get_stream(error_);
+        *err << "Defined '" << definition_name << "': ? Kb., ? states, ? arcs, ? paths." << std::endl;
+        flush(err);
+        //fprintf(stderr,
+        //    "Defined '%s': ? Kb., ? states, ? arcs, ? paths.\n",
+        //    definition_name.c_str());
       }
     return *this;
 }
@@ -616,6 +780,7 @@ LexcCompiler::setCurrentLexiconName(const string& lexiconName)
         tokenizer_.add_multichar_symbol(encodedName);
     }
 
+    std::ostream * err = get_stream(error_);
 
     if ((firstLexicon) && (lexiconName == "Root"))
     {
@@ -623,21 +788,24 @@ LexcCompiler::setCurrentLexiconName(const string& lexiconName)
     }
     else if ((firstLexicon) && (lexiconName != "Root"))
     {
-        if (!quiet_) fprintf(stderr, "first lexicon is not named Root\n");
+      if (!quiet_) *err << "first lexicon is not named Root" << std::endl; // fprintf(stderr, "first lexicon is not named Root\n");
         setInitialLexiconName(lexiconName);
     }
     else if ((!firstLexicon) && (lexiconName == "Root"))
     {
-        if (!quiet_) fprintf(stderr, "Root is not first the first lexicon\n");
+      if (!quiet_) *err << "Root is not first the first lexicon" << std::endl; // fprintf(stderr, "Root is not first the first lexicon\n");
         setInitialLexiconName(lexiconName);
     }
     if (!firstLexicon && !quiet_)
     {
-        fprintf(stderr, SIZE_T_SPECIFIER " ", currentEntries_);
+      *err << currentEntries_ << " ";
+      // fprintf(stderr, SIZE_T_SPECIFIER " ", currentEntries_);
     }
-    if (!quiet_) fprintf(stderr, "%s...", lexiconName.c_str());
+    if (!quiet_) *err << lexiconName << "..."; // fprintf(stderr, "%s...", lexiconName.c_str());
     firstLexicon = false;
 
+    flush(err);
+
     currentEntries_ = 0;
     return *this;
 }
@@ -664,11 +832,14 @@ LexcCompiler::compileLexical()
         return 0;
       }
 
+    std::ostream * err = get_stream(error_);
+
     bool warnings_generated = false;
     printConnectedness(warnings_generated);
     if (warnings_generated && treat_warnings_as_errors_)
       {
-        if (!quiet_) fprintf(stderr, "*** ERROR: could not parse lexc file: treating warnings as errors [--Werror] ***\n");
+        if (!quiet_) *err << "*** ERROR: could not parse lexc file: treating warnings as errors [--Werror] ***" << std::endl; //fprintf(stderr, "*** ERROR: could not parse lexc file: treating warnings as errors [--Werror] ***\n");
+        flush(err);
         return 0;
       }
 
@@ -727,7 +898,9 @@ LexcCompiler::compileLexical()
         {
             if (verbose_)
             {
-                fprintf(stderr, "Morphotaxing... %s ", s->c_str());
+              *err << "Morphotaxing... " << *s << " ";
+              flush(err);
+              //  fprintf(stderr, "Morphotaxing... %s ", s->c_str());
             }
             string joinerEnc = *s;
             joinerEncode(joinerEnc);
@@ -809,7 +982,9 @@ LexcCompiler::compileLexical()
           {
             if (verbose_)
             {
-            fprintf(stderr, "Morphotaxing... %s ", s->c_str());
+              *err << "Morphotaxing... " << *s << " ";
+              flush(err);
+              //fprintf(stderr, "Morphotaxing... %s ", s->c_str());
             }
             string flagPstring = *s;
             string flagRstring = *s;
@@ -876,20 +1051,27 @@ LexcCompiler::compileLexical()
 
         if (debug) 
           {
-            fprintf(stderr, "lexicons before compose: \n");
-            lexicons.write_in_att_format(stderr, 1);
+            *err << "lexicons before compose: " << std::endl;
+            *err << lexicons;
+            //fprintf(stderr, "lexicons before compose: \n");
+            //lexicons.write_in_att_format(stderr, 1);
             
-            fprintf(stderr, "joinersAll: \n");
-            joinersAll.write_in_att_format(stderr, 1);
-            fprintf(stderr, "\n");
+            *err << "joinersAll: " << std::endl;
+            *err << joinersAll;
+            *err << std::endl;
+            //fprintf(stderr, "joinersAll: \n");
+            //joinersAll.write_in_att_format(stderr, 1);
+            //fprintf(stderr, "\n");
+            flush(err);
           }
 
         lexicons.compose(joinersAll).minimize();
 
         if (debug) 
           {
-            std::cerr << "lexicons after composition: " << std::endl;
-            std::cerr << lexicons << std::endl; 
+            *err << "lexicons after composition: " << std::endl;
+            *err << lexicons << std::endl; 
+            flush(err);
           }
 
         HfstSymbolSubstitutions allSubstitutions;
@@ -897,7 +1079,9 @@ LexcCompiler::compileLexical()
         {
             if (verbose_)
             {
-                fprintf(stderr, "\nChanging flags...\n");
+              *err << std::endl << "Changing flags..." << std::endl;
+              flush(err);
+              //  fprintf(stderr, "\nChanging flags...\n");
             }
             HfstSymbolSubstitutions fakeFlagsToRealFlags;
             // Change fake flags to real flags
@@ -910,7 +1094,9 @@ LexcCompiler::compileLexical()
             {
               if (debug) 
                 { 
-                  fprintf(stderr, "handling alpha: '%s'...\n", s->c_str()); 
+                  *err << "handling alpha: '" << *s << "'..." << std::endl;
+                  flush(err);
+                  //fprintf(stderr, "handling alpha: '%s'...\n", s->c_str()); 
                 }
                 String alph = *s;
 
@@ -920,8 +1106,9 @@ LexcCompiler::compileLexical()
                     //std::cout << alph << '\n';
                     fakeFlagsToRealFlags.insert(StringPair(*s, alph));
                     if (debug) 
-                      { 
-                        std::cerr << "debug: inserting fakeFlagsToRealFlags replacement: " << *s << " -> " << alph << std::endl; 
+                      {
+                        *err << "debug: inserting fakeFlagsToRealFlags replacement: " << *s << " -> " << alph << std::endl; 
+                        flush(err);
                       }
                     //lexicons.substitute(*s, alph).minimize();
                 }
@@ -943,14 +1130,17 @@ LexcCompiler::compileLexical()
 
         if (debug) 
           {
-            std::cerr << "lexicons after substitution: " << std::endl;
-            std::cerr << lexicons << std::endl; 
+            *err << "lexicons after substitution: " << std::endl;
+            *err << lexicons << std::endl; 
+            flush(err);
           }
         
         //replace reg exp key with transducers
         if (verbose_)
         {
-            fprintf(stderr, "\nInserting regular expressions...\n");
+          *err << std::endl << "Inserting regular expressions..." << std::endl;
+          flush(err);
+          //fprintf(stderr, "\nInserting regular expressions...\n");
         }
 
 
@@ -969,8 +1159,9 @@ LexcCompiler::compileLexical()
                 //std::cout << alph << '\n';
                 fakeRegexprToReal.insert(StringPair(it->first, alph));
                 if (debug) 
-                  { 
-                    std::cerr << "debug: inserting fakeRegexprToReal replacement: " << it->first << " -> " << alph << std::endl; 
+                  {
+                    *err << "debug: inserting fakeRegexprToReal replacement: " << it->first << " -> " << alph << std::endl; 
+                    flush(err);
                   }
 
             //    lexicons.substitute(it->first, alph).minimize();
@@ -1005,8 +1196,9 @@ LexcCompiler::compileLexical()
             regMarkToTr[alph] = btr;
             if (debug) 
               { 
-                std::cerr << "debug: regMarkToTr[" << alph << "] = " << std::endl;
-                btr.write_in_att_format(stderr); 
+                *err << "debug: regMarkToTr[" << alph << "] = " << std::endl;
+                btr.write_in_att_format(*err);
+                flush(err);
               }
             //lexicons.substitute(StringPair(alph, alph), *it->second, true).minimize();
         }
@@ -1018,8 +1210,9 @@ LexcCompiler::compileLexical()
 
         if (debug) 
           {
-            std::cerr << "lexicons_basic after regexp substitution: " << std::endl;
-            lexicons_basic.write_in_att_format(stderr); 
+            *err << "lexicons_basic after regexp substitution: " << std::endl;
+            lexicons_basic.write_in_att_format(*err);
+            flush(err);
           }
 
 
@@ -1035,126 +1228,79 @@ LexcCompiler::compileLexical()
 
     // Preserve only first flag of consecutive P and R lexname flag series, 
     // e.g. change P.LEXNAME.1 R.LEXNAME.1 P.LEXNAME.2 R.LEXNAME.2 into P.LEXNAME.1 
-    
-    if (with_flags_ && minimize_flags_)
-          {
-            // To substitute "@[P|R].LEXNAME...@" with "$[P|R].LEXNAME...$" and vice versa. 
-            std::map<String, String> flag_substitutions;             // @ -> $
-            std::map<String, String> reverse_flag_substitutions;     // $ -> @
-
-            // TEST: rename all $P$ and $R$ flags so that they have the same name
-            std::map<String, String> dollar_to_foo_substitutions;
-
-            StringSet transducerAlphabet = rv->get_alphabet();
-            for (StringSet::const_iterator s = transducerAlphabet.begin();
-                 s != transducerAlphabet.end();
-                 ++s)
+    if (with_flags_) //&& minimize_flags_)
+    {
+        StringSet transducerAlphabet = rv->get_alphabet();
+        StringSet flagD;
+        for (StringSet::const_iterator s = transducerAlphabet.begin();
+             s != transducerAlphabet.end();
+             ++s)
+        {
+            String alph = *s;
+            String alph10 = alph.substr(0,10);
+            if ( alph10 == "@P.LEXNAME" || alph10 == "@R.LEXNAME" )  
             {
-              String alph = *s;
-              String alph10 = alph.substr(0,10);
-              if ( alph10 == "@P.LEXNAME" || alph10 == "@R.LEXNAME" )  
-                {
-                  replace(alph.begin(), alph.end(), '@', '$');
-                  //fprintf(stderr, "flag found:\t\t%s\t->\t%s\n", s->c_str(), alph.c_str());
-                  flag_substitutions[*s] = alph;
-                  reverse_flag_substitutions[alph] = *s;
-                  // insert mapping: $[P|R].LEXNAME.SOMETHING$  <->  $[P|R]$.FOO.BAR$
-                  dollar_to_foo_substitutions[alph] = alph.substr(0, 2).append(".FOO.BAR$");
-                  //fprintf(stderr, "dollar_to_foo_substitutions[%s] = %s\n", alph.c_str(), (dollar_to_foo_substitutions[alph]).c_str());
-                }
-              else
-                {
-                  //fprintf(stderr, "other found:\t\t%s\n", alph.c_str());
-                }
+                flagD.insert(alph);
             }
+        }
 
-            // Substitute "@[P|R].LEXNAME...@" with "$[P|R].LEXNAME...$"
-            rv->substitute(flag_substitutions);
-
-            //fprintf(stderr, "rv:\n");
-            //rv->write_in_att_format(stderr, 1);
-            //fprintf(stderr, "--\n");
-
-            
-            // Construct a rule for consecutive flag removal: 
-            // [FLAG1 | FLAG2 ... FLAGN] -> 0 || [FLAG1 | FLAG2 ... FLAGN] _
-            // and also an inverted rule
-            std::string flag_remover_regexp("[ ");
-            bool first_flag = true;
-            for (std::map<String, String>::const_iterator it 
-                   = flag_substitutions.begin(); it != flag_substitutions.end(); it++)
-              {
-                //fprintf(stderr, "adding flag to rule:\t%s\n", it->second.c_str());
-                if (!first_flag)
-                      {
-                        flag_remover_regexp.append("| ");
-                      }
-                flag_remover_regexp.append("\"").append(it->second).append("\" ");
-                first_flag = false;
-              }
-            flag_remover_regexp.append("]");
-            std::string context_regexp(flag_remover_regexp);
-            flag_remover_regexp.append(" -> 0 || ").append(context_regexp).append(" _ ");
-            
-            if (debug) 
-              { 
-                fprintf(stderr, "flag_remover_regexp: %s\n", flag_remover_regexp.c_str()); 
-              }
-            
-            hfst::xre::XreCompiler xre_comp(format_);
-            HfstTransducer * flag_filter = xre_comp.compile(flag_remover_regexp);
-            flag_filter->minimize();
-            HfstTransducer * inverted_flag_filter = new HfstTransducer(*flag_filter);
-            inverted_flag_filter->invert().minimize();
-            
-            //fprintf(stderr, "flag_filter:\n");
-            //flag_filter->write_in_att_format(stderr, 1);
-            //fprintf(stderr, "--\n");            
-
-            //fprintf(stderr, "inverted flag_filter:\n");
-            //inverted_flag_filter->write_in_att_format(stderr, 1);
-            //fprintf(stderr, "--\n");            
-            
-
-            // [ [FLAG1 | FLAG2 ... FLAGN] -> 0 || [FLAG1 | FLAG2 ... FLAGN] _ ].inv
-            //                        .o.
-            //                       RESULT
-            //                        .o. 
-            // [FLAG1 | FLAG2 ... FLAGN] -> 0 || [FLAG1 | FLAG2 ... FLAGN] _
-            HfstTransducer filtered_lexicons(*inverted_flag_filter);
-            filtered_lexicons.harmonize_flag_diacritics(*rv);
-            filtered_lexicons.compose(*rv, true);
-            filtered_lexicons.harmonize_flag_diacritics(*flag_filter);
-            filtered_lexicons.compose(*flag_filter, true).minimize();
-
-            //fprintf(stderr, "filtered_lexicons:\n");
-            //filtered_lexicons.write_in_att_format(stderr, 1);
-            //fprintf(stderr, "--\n");                        
-
-            // TEST: Rename all $P$ and $R$ flags so that they have the same name
-            if (rename_flags_)
-              {
-                filtered_lexicons.substitute(dollar_to_foo_substitutions);
-                filtered_lexicons.substitute("$P.FOO.BAR$", "@P.FOO.BAR@");
-                filtered_lexicons.substitute("$R.FOO.BAR$", "@R.FOO.BAR@");
-              }
-            else
-              {
-                // Convert symbols "$[P|R].LEXNAME...$" back to "@[P|R].LEXNAME...@"                    
-                filtered_lexicons.substitute(reverse_flag_substitutions);
-              }
+        // Construct a rule for consecutive flag removal: 
+        // [FLAG1 | FLAG2 ... FLAGN] -> 0 || [FLAG1 | FLAG2 ... FLAGN] _
+        // and also an inverted rule
+        std::string flag_remover_regexp("[ ");
+        bool first_flag = true;
+        
+        for (StringSet::const_iterator it 
+               = flagD.begin(); it != flagD.end(); ++it)
+        {
+            if (!first_flag)
+            {
+                flag_remover_regexp.append("| ");
+            }
+            flag_remover_regexp.append("\"").append(*it).append("\" ");
+            first_flag = false;
+        }
+        flag_remover_regexp.append("]");
+        std::string context_regexp(flag_remover_regexp);
+        flag_remover_regexp.append(" -> 0 || ").append(context_regexp).append(" _ ");
 
-            rv->assign(filtered_lexicons);
-          }
+        if (debug) 
+        { 
+            fprintf(stderr, "flag_remover_regexp: %s\n", flag_remover_regexp.c_str()); 
+        }
+         
+        hfst::xre::XreCompiler xre_comp(format_);
+        
+        HfstTransducer * flag_filter = xre_comp.compile(flag_remover_regexp);
+        flag_filter->minimize();
+        HfstTransducer * inverted_flag_filter = new HfstTransducer(*flag_filter);
+        inverted_flag_filter->invert().minimize();
+
+        // [ [FLAG1 | FLAG2 ... FLAGN] -> 0 || [FLAG1 | FLAG2 ... FLAGN] _ ].inv
+        //                        .o.
+        //                       RESULT
+        //                        .o. 
+        // [FLAG1 | FLAG2 ... FLAGN] -> 0 || [FLAG1 | FLAG2 ... FLAGN] _
+        HfstTransducer filtered_lexicons(*inverted_flag_filter);
+        filtered_lexicons.compose(*rv, true);
+        filtered_lexicons.compose(*flag_filter, true).minimize();
+         
+        rv->assign(filtered_lexicons);
+    }
 
     rv->minimize();
+    
+    if(!quiet_) *err << endl;
+    
     return rv;
 }
 
 
 const LexcCompiler&
-LexcCompiler::printConnectedness(bool & warnings_generated) const
+LexcCompiler::printConnectedness(bool & warnings_generated)
 {
+  std::ostream * err = get_stream(error_);
+
   if (/* !quiet_ && */ (lexiconNames_ != continuations_))
     {
         vector<string> lexMinusCont = vector<string>(lexiconNames_.size());
@@ -1174,9 +1320,11 @@ LexcCompiler::printConnectedness(bool & warnings_generated) const
             {
               if (!quiet_)
                 {
-                  fprintf(stderr,
-                          "Warning: Sublexicon is mentioned but not defined."
-                          " (%s) \n", s->c_str());
+                  *err << "Warning: Sublexicon is mentioned but not defined. (" << *s << ") " << std::endl;
+                  flush(err);
+                  //fprintf(stderr,
+                  //        "Warning: Sublexicon is mentioned but not defined."
+                  //        " (%s) \n", s->c_str());
                 }
               warnings_generated = true;
             }
@@ -1186,13 +1334,17 @@ LexcCompiler::printConnectedness(bool & warnings_generated) const
           warnings_generated = true;
           if (!quiet_)
             {
-              fprintf(stderr, "Warning: Sublexicons defined but not used\n");
+              *err << "Warning: Sublexicons defined but not used" << std::endl;
+              //fprintf(stderr, "Warning: Sublexicons defined but not used\n");
               for (vector<string>::iterator s = lexMinusCont.begin();
                    s != lexMinusContEnd; ++s)
                 {
-                  fprintf(stderr, "%s ", s->c_str());
+                  *err << *s << " ";
+                  //fprintf(stderr, "%s ", s->c_str());
                 }
-              fprintf(stderr, "\n");
+              *err << std::endl;
+              //fprintf(stderr, "\n");
+              flush(err);
             }
         }
     }
diff --git a/libhfst/src/parsers/LexcCompiler.h b/libhfst/src/parsers/LexcCompiler.h
index fd14d60..acffcca 100644
--- a/libhfst/src/parsers/LexcCompiler.h
+++ b/libhfst/src/parsers/LexcCompiler.h
@@ -55,7 +55,7 @@ class LexcCompiler
 
   //! @brief create a lexc compiler with @c impl as transducer format and @c withFlags
   // as indicator as the trasnducer should be build with or without flags
-  LexcCompiler(hfst::ImplementationType impl, bool withFlags);
+  LexcCompiler(hfst::ImplementationType impl, bool withFlags, bool alignStrings);
 
   //! @brief compile lexc description from @c infile into current compiler
   LexcCompiler& parse(FILE* infile);
@@ -70,14 +70,30 @@ class LexcCompiler
   //! lexc compiler does.
   LexcCompiler& setVerbosity(unsigned int verbose);
 
+  unsigned int getVerbosity();
+
+  void set_error_stream(std::ostream * os);
+
+  std::ostream * get_error_stream();
+
+  void setOutputToConsole(bool);
+
+  bool getOutputToConsole();
+
   bool isQuiet();
 
+  std::ostream * get_stream(std::ostream * oss);
+
+  void flush(std::ostream * oss);
+
   LexcCompiler& setTreatWarningsAsErrors(bool value);
 
   bool areWarningsTreatedAsErrors();
 
   LexcCompiler& setAllowMultipleSublexiconDefinitions(bool value);
-
+  
+  LexcCompiler& setAlignStrings(bool value);
+  
   LexcCompiler& setWithFlags(bool value);
 
   LexcCompiler& setMinimizeFlags(bool value);
@@ -134,17 +150,23 @@ class LexcCompiler
 
   //! @brief check that current morphotax is connected and print anomalies.
   //! Works like xerox lexc, for compatibility.
-  const LexcCompiler& printConnectedness(bool & warnings_printed) const;
-
+  const LexcCompiler& printConnectedness(bool & warnings_printed);
 
   private:
   bool quiet_;
   bool verbose_;
+  bool align_strings_;
   bool with_flags_;
   bool minimize_flags_;
   bool rename_flags_;
   bool treat_warnings_as_errors_;
   bool allow_multiple_sublexicon_definitions_;
+  std::ostream * error_;
+#ifdef WINDOWS
+  bool output_to_console_;
+  std::ostringstream winoss_;
+  std::ostream * redirected_stream_;
+#endif
 
   hfst::ImplementationType format_;
   hfst::HfstTokenizer tokenizer_;
diff --git a/libhfst/src/parsers/Makefile.am b/libhfst/src/parsers/Makefile.am
index 9cd2aa9..1ef61fc 100644
--- a/libhfst/src/parsers/Makefile.am
+++ b/libhfst/src/parsers/Makefile.am
@@ -29,20 +29,26 @@ LEXC_SRCS=lexc-lexer.ll lexc-parser.yy lexc-utils.cc LexcCompiler.cc
 LEXC_HDRS=LexcCompiler.h lexc-utils.h
 LEXC_BUILT=lexc-parser.cc lexc-lexer.cc
 
-BUILT_SOURCES=$(XRE_BUILT) $(PMATCH_BUILT) $(LEXC_BUILT)
+# TODO: hfst-string-conversions.cc
+XFST_SRCS=xfst-lexer.ll xfst-parser.yy xfst-utils.cc XfstCompiler.cc xfst_help_message.cc ../../../tools/src/hfst-string-conversions.cc
+XFST_HDRS=XfstCompiler.h xfst-utils.h xfst_help_message.h
+XFST_BUILT=xfst-parser.cc xfst-lexer.cc
 
-CLEANFILES=$(XRE_BUILT) $(PMATCH_BUILT) $(LEXC_BUILT) \
-             xre_parse.hh pmatch_parse.hh lexc-parser.hh
+BUILT_SOURCES=$(XRE_BUILT) $(PMATCH_BUILT) $(LEXC_BUILT) $(XFST_BUILT)
+
+CLEANFILES=$(XRE_BUILT) $(PMATCH_BUILT) $(LEXC_BUILT) $(XFST_BUILT) \
+             xre_parse.hh pmatch_parse.hh lexc-parser.hh xfst-parser.hh
 
 AM_YFLAGS=-d
 AM_LFLAGS=--outfile=$(LEX_OUTPUT_ROOT).c
 
-CLEANFILES+=xre_parse.hh  pmatch_parse.hh  lexc-parser.hh
+CLEANFILES+=xre_parse.hh  pmatch_parse.hh  lexc-parser.hh xfst-parser.hh
 xre_lex.ll: xre_parse.hh
 pmatch_lex.ll: pmatch_parse.hh
 lexc-lexer.ll: lexc-parser.hh
+xfst-lexer.ll: xfst-parser.hh
 
-libhfstparsers_la_SOURCES=$(SFST_SRCS) $(XRE_SRCS) $(PMATCH_SRCS) $(LEXC_SRCS)
+libhfstparsers_la_SOURCES=$(SFST_SRCS) $(XRE_SRCS) $(PMATCH_SRCS) $(LEXC_SRCS) $(XFST_SRCS)
 
 AM_CPPFLAGS=-I${top_srcdir}/libhfst/src/parsers -I${top_srcdir}/libhfst/src \
 		-I${top_srcdir}/back-ends/foma -I${top_srcdir}/back-ends \
@@ -58,7 +64,7 @@ endif
 hfstincludedir = $(includedir)/hfst
 extincludedir = $(hfstincludedir)/parsers
 
-extinclude_HEADERS = $(XRE_HDRS) $(PMATCH_HDRS) $(LEXC_HDRS)
+extinclude_HEADERS = $(XRE_HDRS) $(PMATCH_HDRS) $(LEXC_HDRS) $(XFST_HDRS)
 
 LIBHFST_PARSER_TSTS=XreCompiler LexcCompiler # PmatchCompiler
 
@@ -76,4 +82,4 @@ LexcCompiler_LDADD=../libhfst.la
 
 TESTS=$(LIBHFST_PARSER_TSTS)
 
-EXTRA_DIST=xre_parse.hh pmatch_parse.hh lexc-parser.hh $(BUILT_SOURCES)
+EXTRA_DIST=xre_parse.hh pmatch_parse.hh lexc-parser.hh xfst-parser.hh $(BUILT_SOURCES)
diff --git a/tools/src/parsers/XfstCompiler.cc b/libhfst/src/parsers/XfstCompiler.cc
similarity index 67%
rename from tools/src/parsers/XfstCompiler.cc
rename to libhfst/src/parsers/XfstCompiler.cc
index 4587df0..9c173ce 100644
--- a/tools/src/parsers/XfstCompiler.cc
+++ b/libhfst/src/parsers/XfstCompiler.cc
@@ -39,13 +39,15 @@ using std::stack;
   #include <windows.h>
 #endif  // WINDOWS
 
-#include "../hfst-string-conversions.h"
+// TODO!!!
+#include "../../../tools/src/hfst-string-conversions.h"
 
 #include "XfstCompiler.h"
 #include "xfst-utils.h"
 #include "xfst-parser.hh"
 
-#include "../HfstStrings2FstTokenizer.h"
+#include "HfstStrings2FstTokenizer.h"
+#include "HfstPrintDot.h"
 
 #ifdef HAVE_READLINE
   #include <readline/readline.h>
@@ -66,15 +68,19 @@ extern void hxfst_delete_buffer(YY_BUFFER_STATE);
 
 using hfst::implementations::HfstBasicTransducer;
 using hfst::implementations::HfstBasicTransition;
-using hfst::hfst_fprintf;
+#ifdef WINDOWS
+  using hfst::hfst_fprintf_console;
+#endif
 
 #define GET_TOP(x) HfstTransducer * x = this->top(); if ((x) == NULL) { xfst_lesser_fail(); return *this; }
 #define PROMPT_AND_RETURN_THIS prompt(); return *this;
 #define PRINT_INFO_PROMPT_AND_RETURN_THIS print_transducer_info(); prompt(); return *this;
-#define IF_NULL_PROMPT_AND_RETURN_THIS(x) if (x == NULL) { if(variables_["quit-on-fail"] == "ON") { exit(EXIT_FAILURE); } prompt(); return *this; }
+#define IF_NULL_PROMPT_AND_RETURN_THIS(x) if (x == NULL) { if(variables_["quit-on-fail"] == "ON") { /*exit(EXIT_FAILURE);*/ this->fail_flag_ = true; } prompt(); return *this; }
 #define MAYBE_MINIMIZE(x) if (variables_["minimal"] == "ON") { x->minimize(); }
-#define MAYBE_ASSERT(assertion, value) if (!value && ((variables_["assert"] == "ON" || assertion) && (variables_["quit-on-fail"] == "ON"))) { exit(EXIT_FAILURE); }
-#define MAYBE_QUIT if(variables_["quit-on-fail"] == "ON") { exit(EXIT_FAILURE); }
+#define MAYBE_ASSERT(assertion, value) if (!value && ((variables_["assert"] == "ON" || assertion) && (variables_["quit-on-fail"] == "ON"))) { /*exit(EXIT_FAILURE);*/ this->fail_flag_ = true; }
+#define MAYBE_QUIT if(variables_["quit-on-fail"] == "ON") { /*exit(EXIT_FAILURE);*/ this->fail_flag_ = true; }
+
+#define EMPTY_STACK error() << "Empty stack." << std::endl; flush(&error());
 
 #define WEIGHT_PRECISION "5"
 #define LOOKUP_CYCLE_CUTOFF "5"
@@ -125,9 +131,9 @@ namespace xfst {
   }
 
   static const char * APPLY_END_STRING = "<ctrl-d>";
-  FILE * outstream_ = stdout;
-  FILE * warnstream_ = stderr;
-  FILE * errorstream_ = stderr;
+  //FILE * outstream_ = stdout;
+  //FILE * warnstream_ = stderr;
+  //FILE * errorstream_ = stderr;
   
     XfstCompiler::XfstCompiler() :
         use_readline_(false),
@@ -137,11 +143,23 @@ namespace xfst {
         lexc_(hfst::TROPICAL_OPENFST_TYPE),
         format_(hfst::TROPICAL_OPENFST_TYPE),
         verbose_(false),
-        latest_regex_compiled(NULL)
+        latest_regex_compiled(NULL),
+        quit_requested_(false),
+        fail_flag_(false),
+        output_(&std::cout),
+        error_(&std::cerr)
+#ifdef WINDOWS
+        , winoss_stderr_(std::ostringstream()),
+        winoss_stdout_(std::ostringstream())
+        //        redirected_stream_(NULL)
+#endif
     {       
         xre_.set_expand_definitions(true);
-        xre_.set_verbosity(true, stderr);
+        xre_.set_verbosity(this->verbose_);
         xre_.set_flag_harmonization(false);
+        xre_.set_error_stream(this->error_);
+        lexc_.setVerbosity(this->verbose_ ? 2 : 0);
+        lexc_.set_error_stream(this->error_);
         hfst::set_xerox_composition(true);
         variables_["assert"] = "OFF";
         variables_["att-epsilon"] = "@0@ | @_EPSILON_SYMBOL_@";
@@ -190,11 +208,23 @@ namespace xfst {
         lexc_(impl),
         format_(impl),
         verbose_(false),
-        latest_regex_compiled(NULL)
+        latest_regex_compiled(NULL),
+        quit_requested_(false),
+        fail_flag_(false),
+        output_(&std::cout),
+        error_(&std::cerr)
+#ifdef WINDOWS
+        , winoss_stderr_(std::ostringstream()),
+        winoss_stdout_(std::ostringstream())
+        //redirected_stream_(NULL)
+#endif
     {       
         xre_.set_expand_definitions(true);
-        xre_.set_verbosity(true, stderr);
+        xre_.set_verbosity(this->verbose_);
         xre_.set_flag_harmonization(false);
+        xre_.set_error_stream(this->error_);
+        lexc_.setVerbosity(this->verbose_ ? 2 : 0);
+        lexc_.set_error_stream(this->error_);
         hfst::set_xerox_composition(true);
         variables_["assert"] = "OFF";
         variables_["att-epsilon"] = "@0@ | @_EPSILON_SYMBOL_@";
@@ -235,18 +265,66 @@ namespace xfst {
         prompt();
       }
 
-  int XfstCompiler::hfst_print_weight(FILE * stream, float weight)
+  int XfstCompiler::xfst_fclose(FILE * f, const char * name)
+  {
+    int retval = fclose(f);
+    if (retval != 0)
+      {
+        error() << "could not close file " << name << std::endl;
+        flush(&error());
+        xfst_fail();
+      }
+    return retval;
+  }
+
+  FILE * XfstCompiler::xfst_fopen(const char* path, const char* mode)
+  {
+    FILE * f = fopen(path, mode);
+    if (f == NULL)
+      {
+        error() << "could not open file " << path << std::endl;
+        flush(&error());
+        xfst_fail();
+      }
+    return f;
+  }
+
+  void XfstCompiler::set_error_stream(std::ostream & os)
+  {
+    error_ = &os;
+    //this->xre_.set_error_stream(this->error_);
+    this->lexc_.set_error_stream(this->error_);
+  }
+
+  std::ostream & XfstCompiler::get_error_stream()
+  {
+    return *error_;
+  }
+
+  void XfstCompiler::set_output_stream(std::ostream & os)
+  {
+    output_ = &os;
+  }
+
+  std::ostream & XfstCompiler::get_output_stream()
+  {
+    return *output_;
+  }
+
+  int XfstCompiler::get_precision()
   {
-    std::string formatter("%.");
-    formatter = formatter + variables_["precision"] + std::string("f");
-    return hfst_fprintf(stream, formatter.c_str(), weight);
+    std::istringstream iss(variables_["precision"]);
+    int retval;
+    iss >> retval;
+    return retval;
   }
 
   void XfstCompiler::xfst_fail()
   {
     if (variables_["quit-on-fail"] == "ON") 
       {
-        exit(EXIT_FAILURE); 
+        this->fail_flag_ = true;
+        //exit(EXIT_FAILURE); 
       }
   }
 
@@ -254,7 +332,8 @@ namespace xfst {
   {
     if (variables_["quit-on-fail"] == "ON" && !read_interactive_text_from_stdin_) 
       {
-        exit(EXIT_FAILURE); 
+        this->fail_flag_ = true;
+        //exit(EXIT_FAILURE); 
       }
   }
 
@@ -275,7 +354,9 @@ namespace xfst {
         if (*p == '\0')
           {
             assert(*p != '\0');
-            hfst_fprintf(errorstream_, "no colon in line\n");
+            //hfst_fprintf(errorstream_, "no colon in line\n");
+            error() << "no colon in line" << std::endl;
+            flush(&error());
           }
         p++;
         while (isspace(*p))
@@ -414,10 +495,12 @@ namespace xfst {
   bool 
   XfstCompiler::print_paths
   (const hfst::HfstOneLevelPaths &paths, 
-   FILE* outfile /* =stdout */, 
+   std::ostream * oss_ /* =cout */, 
    int n /* = -1*/)
   {
+    std::ostream * oss = get_stream(oss_);
     bool retval = false; // if anything was printed
+    oss->precision(get_precision());
 
     // go through at most n paths
     for (hfst::HfstOneLevelPaths::const_iterator it = paths.begin();
@@ -442,10 +525,10 @@ namespace xfst {
                 something_printed &&                  // not first symbol shown 
                 strcmp(print_symbol, "") != 0)        // something to show
               {
-                hfst_fprintf(outfile, " ");
+                *oss << " "; // hfst_fprintf(outfile, " ");
               }
 
-            hfst_fprintf(outfile, "%s", print_symbol);
+            *oss << std::string(print_symbol); // hfst_fprintf(outfile, "%s", print_symbol);
 
             if (strcmp(print_symbol, "") != 0) {
               something_printed = true;
@@ -456,25 +539,31 @@ namespace xfst {
         // if needed, print the weight
         if (variables_["print-weight"] == "ON")
           {
-            hfst_fprintf(outfile, "\t");
-            hfst_print_weight(outfile, it->first);
+            //hfst_fprintf(outfile, "\t");
+            //hfst_print_weight(outfile, it->first);
+            *oss << "\t" << std::fixed << it->first;
           }
 
-        hfst_fprintf(outfile, "\n");
+        *oss << std::endl; // hfst_fprintf(outfile, "\n");
         --n;
 
       } // at most n paths gone through
 
+    //hfst_fprintf(outfile, oss->str().c_str()); // TESTING
+
+    flush(oss);
     return retval;
   }
 
   bool
   XfstCompiler::print_paths
   (const hfst::HfstTwoLevelPaths &paths, 
-   FILE* outfile /* =stdout */, 
+   std::ostream * oss_ /* =cout */, 
    int n /* = -1*/)
   { 
+    std::ostream * oss = get_stream(oss_);
     bool retval = false; // if anything was printed
+    oss->precision(get_precision());
 
     // go through at most n paths
     for (hfst::HfstTwoLevelPaths::const_iterator it = paths.begin();
@@ -503,10 +592,10 @@ namespace xfst {
                 something_printed &&                  // not first symbol shown
                 strcmp(print_symbol, "") != 0)        // something to show
               {
-                hfst_fprintf(outfile, " ");
+                *oss << " "; // hfst_fprintf(outfile, " ");
               }
 
-            hfst_fprintf(outfile, "%s", print_symbol);
+            *oss << std::string(print_symbol); // hfst_fprintf(outfile, "%s", print_symbol);
 
             if (strcmp(print_symbol, "") != 0) {
               something_printed = true;
@@ -518,7 +607,7 @@ namespace xfst {
             if (strcmp(print_symbol, "") != 0 &&   // something to show
                 p->first != p->second)             // input and output symbols differ
               {
-                hfst_fprintf(outfile, ":%s", print_symbol);
+                *oss << ":" << std::string(print_symbol); // hfst_fprintf(outfile, ":%s", print_symbol);
               }
 
           } // path gone through
@@ -526,15 +615,19 @@ namespace xfst {
         // if needed, print the weight
         if (variables_["print-weight"] == "ON")
           {
-            hfst_fprintf(outfile, "\t");
-            hfst_print_weight(outfile, it->first);
+            // hfst_fprintf(outfile, "\t");
+            // hfst_print_weight(outfile, it->first);
+            *oss << "\t" << std::fixed << it->first;
           }
 
-        hfst_fprintf(outfile, "\n");
+        *oss << std::endl; // hfst_fprintf(outfile, "\n");
         --n;
 
       } // at most n paths gone through
 
+    //hfst_fprintf(outfile, oss->str().c_str()); // TESTING
+
+    flush(oss);
     return retval;
   }
 
@@ -573,8 +666,10 @@ namespace xfst {
             cutoff = string_to_size_t(variables_["lookup-cycle-cutoff"]);
             if (verbose_)
               {
-                hfst_fprintf(warnstream_, 
-                             "warning: lookup is infinitely ambiguous, limiting the number of cycles to " SIZE_T_SPECIFIER "\n", cutoff);
+                error() << "warning: lookup is infinitely ambiguous, limiting the number of cycles to " << cutoff << std::endl;
+                flush(&error());
+            //hfst_fprintf(warnstream_, 
+            //                "warning: lookup is infinitely ambiguous, limiting the number of cycles to " SIZE_T_SPECIFIER "\n", cutoff);
               }
           }
 
@@ -583,11 +678,11 @@ namespace xfst {
         // todo: variables_["obey-flags"] == ["ON"|"OFF"]
 
         if (variables_["maximum-weight"] == "OFF")
-          t->lookup_fd(lookup_path, results, cutoff, NULL);
+          t->lookup_fd(lookup_path, results, &cutoff, NULL);
         else
           {
             float max_weight = string_to_float(variables_["maximum-weight"]);
-            t->lookup_fd(lookup_path, results, cutoff, &max_weight);
+            t->lookup_fd(lookup_path, results, &cutoff, &max_weight);
           }
 
         HfstOneLevelPaths paths = extract_output_paths(results);
@@ -595,12 +690,24 @@ namespace xfst {
         bool printed = this->print_paths(paths);
         if (!printed)
           {
-            hfst_fprintf(outstream_, "???\n");
+            output() << "???" << std::endl;
+            //hfst_fprintf(outstream_, "???\n");
           }
 
+        flush(&output());
         return *this;
       }
 
+  std::ostream & XfstCompiler::output() 
+  {
+    return *get_stream(output_);
+  }
+
+  std::ostream & XfstCompiler::error()
+  {
+    return *get_stream(error_);
+  }
+
 
     XfstCompiler&
     XfstCompiler::apply_line(char* line, const HfstTransducer * t, size_t cutoff)
@@ -618,21 +725,21 @@ namespace xfst {
         bool printed = this->print_paths(*paths);
         if (!printed)
           {
-            hfst_fprintf(outstream_, "???\n");
+            output() << "???" << std::endl; 
+            flush(&output());
+            //hfst_fprintf(outstream_, "???\n");
           }
 
         delete paths;
         return *this;
       }
 
-
-
   XfstCompiler&
   XfstCompiler::lookup_optimize()
   {
     if (stack_.size() < 1)
       {
-        hfst_fprintf(stderr, "Empty stack.\n");
+        EMPTY_STACK;
         xfst_lesser_fail();
         prompt();
         return *this;
@@ -644,7 +751,9 @@ namespace xfst {
     if (t->get_type() == hfst::HFST_OL_TYPE ||
         t->get_type() == hfst::HFST_OLW_TYPE)
       {
-        hfst_fprintf(warnstream_, "Network is already optimized for lookup.\n");
+        error() << "Network is already optimized for lookup." << std::endl;
+        flush(&error());
+        //hfst_fprintf(warnstream_, "Network is already optimized for lookup.\n");
         prompt();
         return *this;
       }
@@ -660,9 +769,12 @@ namespace xfst {
 
     if (verbose_)
       {
-        hfst_fprintf(warnstream_, "converting transducer type from %s to %s, this might take a while...\n",
-                     hfst::implementation_type_to_format(t->get_type()),
-                     hfst::implementation_type_to_format(to_format));
+        error() << "converting transducer type from " << hfst::implementation_type_to_format(t->get_type()) << " to " 
+                << hfst::implementation_type_to_format(to_format) << ", this might take a while..." << std::endl;
+        flush(&error());
+    //hfst_fprintf(warnstream_, "converting transducer type from %s to %s, this might take a while...\n",
+    //                hfst::implementation_type_to_format(t->get_type()),
+    //                hfst::implementation_type_to_format(to_format));
       }
 
     std::stack<HfstTransducer*> temp;
@@ -687,7 +799,7 @@ namespace xfst {
   {
     if (stack_.size() < 1)
       {
-        hfst_fprintf(stderr, "Empty stack.\n");
+        EMPTY_STACK;
         xfst_lesser_fail();
         prompt();
         return *this;
@@ -697,19 +809,26 @@ namespace xfst {
     if (t->get_type() != hfst::HFST_OL_TYPE &&
         t->get_type() != hfst::HFST_OLW_TYPE)
       {
-        hfst_fprintf(warnstream_, "Network is already in ordinary format.\n");
+        error() << "Network is already in ordinary format." << std::endl;
+        flush(&error());
+        //hfst_fprintf(warnstream_, "Network is already in ordinary format.\n");
         prompt();
         return *this;
       }
 
     if (verbose_)
       {
-        hfst_fprintf(warnstream_, "converting transducer type from %s to %s, this might take a while...\n",
-                     hfst::implementation_type_to_format(t->get_type()),
-                     hfst::implementation_type_to_format(format_));
+        error() << "converting transducer type from " << hfst::implementation_type_to_format(t->get_type()) << " to " 
+                << hfst::implementation_type_to_format(format_) << ", this might take a while..." << std::endl;
+        flush(&error());
+        //hfst_fprintf(warnstream_, "converting transducer type from %s to %s, this might take a while...\n",
+        //             hfst::implementation_type_to_format(t->get_type()),
+        //             hfst::implementation_type_to_format(format_));
         if (! hfst::HfstTransducer::is_safe_conversion(t->get_type(), format_))
           {
-            hfst_fprintf(warnstream_, "warning: converting from weighted to unweighted format, loss of information is possible\n");
+            error() << "warning: converting from weighted to unweighted format, loss of information is possible" << std::endl;
+            flush(&error());
+            //hfst_fprintf(warnstream_, "warning: converting from weighted to unweighted format, loss of information is possible\n");
           }
       }
 
@@ -736,7 +855,7 @@ namespace xfst {
       {
         if (stack_.size() < 1)
           {
-            hfst_fprintf(stderr, "Empty stack.\n");
+            EMPTY_STACK;
             xfst_lesser_fail();
             prompt();
             return *this;
@@ -756,8 +875,10 @@ namespace xfst {
             ol_cutoff = string_to_size_t(variables_["lookup-cycle-cutoff"]);;
             if (verbose_)
               {
-                hfst_fprintf(warnstream_, 
-                             "warning: transducer is infinitely ambiguous, limiting number of cycles to " SIZE_T_SPECIFIER "\n", ol_cutoff);
+                error() << "warning: transducer is infinitely ambiguous, limiting number of cycles to " << ol_cutoff << std::endl;
+                flush(&error());
+            //hfst_fprintf(warnstream_, 
+            //                "warning: transducer is infinitely ambiguous, limiting number of cycles to " SIZE_T_SPECIFIER "\n", ol_cutoff);
               }
           }
         
@@ -771,9 +892,12 @@ namespace xfst {
         // lookdown not yet implemented in HFST
         if (verbose_)
           {
-            hfst_fprintf(warnstream_, 
-                         "warning: lookdown not implemented, inverting transducer and performing lookup\n"
-                         "for faster performance, invert and minimize top network and do lookup instead\n\n");
+            error() << "warning: lookdown not implemented, inverting transducer and performing lookup" << std::endl
+                    << "for faster performance, invert and minimize top network and do lookup instead" << std::endl << std::endl;
+            flush(&error());
+        //hfst_fprintf(warnstream_, 
+        //                 "warning: lookdown not implemented, inverting transducer and performing lookup\n"
+        //                 "for faster performance, invert and minimize top network and do lookup instead\n\n");
           }
         t = new HfstTransducer(*(stack_.top()));
         t->invert().minimize();
@@ -789,7 +913,9 @@ namespace xfst {
     XfstCompiler&
     XfstCompiler::apply_med_line(char* /*line*/)
       {
-        hfst_fprintf(errorstream_, "Missing apply med %s:%d\n", __FILE__, __LINE__);
+        error() << "Missing apply med" << std::endl;
+        flush(&error());
+        //hfst_fprintf(errorstream_, "Missing apply med %s:%d\n", __FILE__, __LINE__);
 #if 0
         char* token = strstrip(line);
         HfstTransducer top = stack_.top();
@@ -818,7 +944,9 @@ namespace xfst {
         if (*p == '\0')
           {
             assert(*p != '\0');
-            hfst_fprintf(errorstream_, "no colon in line\n");
+            error() << "no colon in line" << std::endl;
+            flush(&error());
+            //hfst_fprintf(errorstream_, "no colon in line\n");
           }
         p++;
         while (isspace(*p))
@@ -873,13 +1001,42 @@ namespace xfst {
     return "";
   }
 
+  int XfstCompiler::unknown_command(const char * s)
+  {
+    if (this->variables_["quit-on-fail"] == "ON")
+      {
+        if (verbose_)
+          {
+            error() << "Command " << std::string(s) << " is not recognised." << std::endl;
+            flush(&error());
+            //fprintf(stderr, "Command %s is not recognised.\n", s);
+          }
+        return 1;
+      }
+    error() << "Command " << std::string(s) << " is not recognised." << std::endl;
+    flush(&error());
+    //fprintf(stderr, "Command %s is not recognised.\n", s);
+    this->prompt();
+    return 0;
+  }
+
+  bool XfstCompiler::get_fail_flag() const
+  {
+    return this->fail_flag_;
+  }
+
+  bool XfstCompiler::quit_requested() const
+  {
+    return this->quit_requested_;
+  }
+
   // HERE
   XfstCompiler&
   XfstCompiler::apply(FILE* infile, ApplyDirection direction)
       {
         if (stack_.size() < 1)
           {
-            hfst_fprintf(stderr, "Empty stack.\n");
+            EMPTY_STACK;
             xfst_lesser_fail();
             prompt();
             return *this;
@@ -895,8 +1052,10 @@ namespace xfst {
             if (t->get_type() == hfst::HFST_OL_TYPE ||
                 t->get_type() == hfst::HFST_OLW_TYPE)
               {
-                hfst_fprintf(stderr, "Operation not supported for optimized lookup format. "
-                             "Consider 'remove-optimization' to convert into ordinary format.\n");
+                error() << "Operation not supported for optimized lookup format. Consider 'remove-optimization' to convert into ordinary format." << std::endl; 
+                flush(&error());
+                //hfst_fprintf(stderr, "Operation not supported for optimized lookup format. "
+                //             "Consider 'remove-optimization' to convert into ordinary format.\n");
                 prompt();
                 return *this;
               }
@@ -904,9 +1063,12 @@ namespace xfst {
             // lookdown not yet implemented in HFST
             if (verbose_)
               {
-                hfst_fprintf(warnstream_, 
-                             "warning: lookdown not implemented, inverting transducer and performing lookup\n"
-                             "for faster performance, invert and minimize top network and do lookup instead\n\n");
+                error() << "warning: lookdown not implemented, inverting transducer and performing lookup" << std::endl
+                        << "for faster performance, invert and minimize top network and do lookup instead" << std::endl << std::endl;
+                flush(&error());
+                //hfst_fprintf(warnstream_, 
+                //             "warning: lookdown not implemented, inverting transducer and performing lookup\n"
+                //             "for faster performance, invert and minimize top network and do lookup instead\n\n");
               }
             t = new HfstTransducer(*(stack_.top()));
             t->invert().minimize();
@@ -924,8 +1086,10 @@ namespace xfst {
                 ol_cutoff = string_to_size_t(variables_["lookup-cycle-cutoff"]);
                 if (verbose_)
                   {
-                    hfst_fprintf(warnstream_, 
-                                 "warning: transducer is infinitely ambiguous, limiting number of cycles to " SIZE_T_SPECIFIER "\n", ol_cutoff);
+                    error() << "warning: transducer is infinitely ambiguous, limiting number of cycles to " << ol_cutoff << std::endl;
+                    flush(&error());
+                //hfst_fprintf(warnstream_, 
+                //                 "warning: transducer is infinitely ambiguous, limiting number of cycles to " SIZE_T_SPECIFIER "\n", ol_cutoff);
                   }
               }
           }
@@ -946,7 +1110,9 @@ namespace xfst {
               {
                 // the next command must start on a fresh line
                 if (infile == stdin) {
-                  hfst_fprintf(outstream_, "\n");
+                  output() << std::endl;
+                  flush(&output());
+                  //hfst_fprintf(outstream_, "\n");
                 }
                 break;
               }
@@ -1056,7 +1222,9 @@ namespace xfst {
       {
         if ((strlen(start) > 1) || (strlen(end) > 1))
           {
-            hfst_fprintf(errorstream_, "unsupported unicode range %s-%s\n", start, end);
+            error() << "unsupported unicode range " << std::string(start) << "-" << std::string(end) << std::endl;
+            flush(&error());
+        //hfst_fprintf(errorstream_, "unsupported unicode range %s-%s\n", start, end);
           }
         std::set<string> l;
         for (char c = *start; c < *end; c++)
@@ -1075,9 +1243,13 @@ namespace xfst {
       {
         if (definitions_.find(name) != definitions_.end())
           {
-            fprintf(warnstream_, "Error: '%s' has already been defined as a transducer variable.\n"
-                    "It cannot have an incompatible definition as a list.\n"
-                    "Please undefine the definition first.\n", name);
+            error() << "Error: '" << std::string(name) << "' has already been defined as a transducer variable." << std::endl
+                    << "It cannot have an incompatible definition as a list." << std::endl
+                    << "Please undefine the definition first." << std::endl;
+            flush(&error());
+            //fprintf(warnstream_, "Error: '%s' has already been defined as a transducer variable.\n"
+            //        "It cannot have an incompatible definition as a list.\n"
+            //        "Please undefine the definition first.\n", name);
             MAYBE_QUIT;
             PROMPT_AND_RETURN_THIS;
           }
@@ -1091,7 +1263,7 @@ namespace xfst {
           }
         free(p);
         lists_[name] = l;
-        xre_.define_list(name, l);
+        xre_.define_list(name, l); // XRE
         PROMPT_AND_RETURN_THIS;
       }
 
@@ -1101,7 +1273,7 @@ namespace xfst {
     GET_TOP(top);
     bool was_defined = xre_.is_definition(name);
     //if (!was_defined) {
-      xre_.define(name, *top);
+    xre_.define(name, *top); // XRE
       //}
     HfstTransducer * nu = new HfstTransducer(*top); 
     stack_.pop(); // todo: delete?
@@ -1113,10 +1285,11 @@ namespace xfst {
     if (verbose_) 
       {
         if (was_defined)
-          hfst_fprintf(outstream_, "Redefined");
+          output() << "Redefined"; // hfst_fprintf(outstream_, "Redefined");
         else
-          hfst_fprintf(outstream_, "Defined");
-        hfst_fprintf(outstream_, " '%s'\n", name); 
+          output() << "Defined"; // hfst_fprintf(outstream_, "Defined");
+        output() << " '" << std::string(name) << "'" << std::endl; // hfst_fprintf(outstream_, " '%s'\n", name); 
+        flush(&output());
       }          
     original_definitions_[name] = "<net taken from stack>";
     PROMPT_AND_RETURN_THIS;
@@ -1137,9 +1310,13 @@ namespace xfst {
 
         if (lists_.find(name) != lists_.end())
           {
-            fprintf(warnstream_, "Error: '%s' has already been defined as a list variable.\n"
-                    "It cannot have an incompatible definition as a transducer.\n"
-                    "Please undefine the variable first.\n", name);
+            error() << "Error: '" << std::string(name) << "' has already been defined as a list variable." << std::endl
+                    << "It cannot have an incompatible definition as a transducer." << std::endl
+                    << "Please undefine the variable first." << std::endl;
+            flush(&error());
+            //fprintf(warnstream_, "Error: '%s' has already been defined as a list variable.\n"
+            //        "It cannot have an incompatible definition as a transducer.\n"
+            //        "Please undefine the variable first.\n", name);
             MAYBE_QUIT;
             PROMPT_AND_RETURN_THIS;
           }
@@ -1148,7 +1325,15 @@ namespace xfst {
         {
           bool was_defined = xre_.is_definition(name);
           //if (!was_defined)
-            xre_.define(name, xre);
+          if (! xre_.define(name, xre))  // todo: equal to latest_regex_compiled ?  XRE
+            {
+              error() << "Could not define variable '" << std::string(name) << "'" << std::endl;
+              flush(&error());
+                //        << xre_.get_error_message() << std::endl;
+              //hfst_fprintf(errorstream_, "Could not define variable %s:\n%s\n", 
+              //             name, xre_.get_error_message().c_str());
+              xfst_fail();
+            }
           HfstTransducer * nu = new HfstTransducer(*latest_regex_compiled); 
           if (variables_["name-nets"] == "ON")
             nu->set_name(name);
@@ -1157,17 +1342,22 @@ namespace xfst {
           if (verbose_) 
             {
               if (was_defined)
-                hfst_fprintf(outstream_, "Redefined");
+                output() << "Redefined" << std::endl; // hfst_fprintf(outstream_, "Redefined");
               else
-                hfst_fprintf(outstream_, "Defined");
-              hfst_fprintf(outstream_, " '%s'\n", name); 
+                output() << "Defined" << std::endl; // hfst_fprintf(outstream_, "Defined");
+              output() << " '" << std::string(name) << "'" << std::endl; // hfst_fprintf(outstream_, " '%s'\n", name); 
+              flush(&output());
             }          
           original_definitions_[name] = xre;
         }
       else
         {
-          hfst_fprintf(errorstream_, "Could not define variable %s:\n%s\n", 
-                  name, xre_.get_error_message().c_str());
+          error() << "Could not define variable '" << std::string(name) << "'" << std::endl;
+          flush(&error());
+          //        << xre_.get_error_message() << std::endl;
+          //hfst_fprintf(errorstream_, "Could not define variable %s:\n%s\n", 
+          //        name, xre_.get_error_message().c_str());
+          xfst_fail();
         }
       PROMPT_AND_RETURN_THIS;
     }
@@ -1251,7 +1441,7 @@ namespace xfst {
       {
         std::set<unsigned int> arg_positions; 
         if (! xre_.get_positions_of_symbol_in_xre
-            (*arg, retval, arg_positions) ) 
+            (*arg, retval, arg_positions) )  // XRE
           {
             return std::string("");
           }
@@ -1315,16 +1505,20 @@ namespace xfst {
 
       if (! extract_function_name(prototype, name))
         {
-          hfst_fprintf(errorstream_, "Error extracting function name "
-                  "from prototype '%s'\n", prototype);
+          error() << "Error extracting function name from prototype '" << std::string(prototype) << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "Error extracting function name "
+          //        "from prototype '%s'\n", prototype);
           xfst_fail();
           PROMPT_AND_RETURN_THIS;
         }
 
       if (! extract_function_arguments(prototype, arguments))
         {
-          hfst_fprintf(errorstream_, "Error extracting function arguments "
-                  "from prototype '%s'\n", prototype);
+          error() << "Error extracting function arguments from prototype '" << std::string(prototype) << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "Error extracting function arguments "
+          //        "from prototype '%s'\n", prototype);
           xfst_fail();
           PROMPT_AND_RETURN_THIS;
         }
@@ -1333,16 +1527,20 @@ namespace xfst {
         = convert_argument_symbols(arguments, xre, name, xre_);
       if (xre_converted == std::string(""))
         {
-          hfst_fprintf(errorstream_, "Error parsing function definition '%s'\n", xre);
+          error() << "Error parsing function definition '" << std::string(xre) << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "Error parsing function definition '%s'\n", xre);
           xfst_fail();
           PROMPT_AND_RETURN_THIS;
         }
 
       bool was_defined = xre_.is_function_definition(name);
 
-      if (! xre_.define_function(name, arguments.size(), xre_converted))
+      if (! xre_.define_function(name, arguments.size(), xre_converted)) // XRE
         {
-          hfst_fprintf(errorstream_, "Error when defining function\n");
+          error() << "Error when defining function" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "Error when defining function\n");
           xfst_fail();
           PROMPT_AND_RETURN_THIS;
         }
@@ -1350,13 +1548,16 @@ namespace xfst {
       if (verbose_) 
         {
           if (was_defined) {
-            hfst_fprintf(stderr, "Redefined"); 
+            output() << "Redefined";
+            //hfst_fprintf(stderr, "Redefined"); 
           }
           else {
-            hfst_fprintf(stderr, "Defined"); 
+            output() << "Defined"; // hfst_fprintf(stderr, "Defined"); 
           }
-          hfst_fprintf(stderr, " function '%s@%i)'\n", 
-                  name.c_str(), (int)arguments.size()); 
+          output() << " function '" << name << "@" << (int)arguments.size() << ")" << std::endl;
+          flush(&output());
+          //hfst_fprintf(stderr, " function '%s@%i)'\n", 
+          //        name.c_str(), (int)arguments.size()); 
         }
 
       function_arguments_[name] = arguments.size();
@@ -1377,7 +1578,7 @@ namespace xfst {
           if (definitions_.find(name) != definitions_.end())
             {
               definitions_.erase(definitions_.find(name));
-              xre_.undefine(name);
+              xre_.undefine(name);  // XRE
             }
           name = strtok(NULL, " ");
         }
@@ -1471,12 +1672,15 @@ namespace xfst {
       std::string message;
       if (!get_help_message(text, message, HELP_MODE_APROPOS))
         {
-          hfst_fprintf(outstream_, "nothing found for '%s'\n", text);
+          output() << "nothing found for '" << std::string(text) << "'" << std::endl;
+          //hfst_fprintf(outstream_, "nothing found for '%s'\n", text);
         }
       else
         {
-          hfst_fprintf(outstream_, "%s", message.c_str());
+          output() << message;
+          //hfst_fprintf(outstream_, "%s", message.c_str());
         }
+      flush(&output());
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -1488,12 +1692,15 @@ namespace xfst {
       std::string message;
       if (!get_help_message(text, message, help_mode))
         {
-          hfst_fprintf(outstream_, "no help found for '%s'\n", text);
+          output() << "no help found for '" << std::string(text) << "'" << std::endl;
+          //hfst_fprintf(outstream_, "no help found for '%s'\n", text);
         }
       else
         {
-          hfst_fprintf(outstream_, "%s", message.c_str());
+          output() << message;
+          //hfst_fprintf(outstream_, "%s", message.c_str());
         }
+      flush(&output());
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -1509,8 +1716,10 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::pop()
     {
-      if (stack_.empty())
-        hfst_fprintf(outstream_, "Stack is empty.\n");
+      if (stack_.empty()) {
+        output() << "Stack is empty." << std::endl; //hfst_fprintf(outstream_, "Stack is empty.\n");
+        flush(&output());
+      }
       else // todo: delete if not definition?
         stack_.pop();
       PROMPT_AND_RETURN_THIS;
@@ -1521,7 +1730,9 @@ namespace xfst {
     {
       if (definitions_.find(name) == definitions_.end())
         {
-          hfst_fprintf(outstream_, "no such defined network: '%s'\n", name);
+          output() << "no such defined network: '" << std::string(name) << "'" << std::endl;
+          flush(&output());
+          //hfst_fprintf(outstream_, "no such defined network: '%s'\n", name);
           PROMPT_AND_RETURN_THIS;
         }
 
@@ -1593,8 +1804,10 @@ namespace xfst {
     std::string def_name = t->get_name();
     if (def_name == "")
       {
-        hfst_fprintf(warnstream_, "warning: loaded transducer definition "
-                "has no name, skipping it\n");
+        error() << "warning: loaded transducer definition has no name, skipping it" << std::endl;
+        flush(&error());
+        //hfst_fprintf(warnstream_, "warning: loaded transducer definition "
+        //        "has no name, skipping it\n");
         // xfst_lesser_fail(); ???
         return *this;
       }
@@ -1602,8 +1815,10 @@ namespace xfst {
       = definitions_.find(def_name);
     if (it != definitions_.end())
       {
-        hfst_fprintf(warnstream_, "warning: a definition named '%s' "
-                "already exists, overwriting it\n", def_name.c_str());
+        error() << "warning: a definition named '" << def_name << "' already exists, overwriting it" << std::endl;
+        flush(&error());
+        //hfst_fprintf(warnstream_, "warning: a definition named '%s' "
+        //        "already exists, overwriting it\n", def_name.c_str());
         // xfst_lesser_fail(); ???
         definitions_.erase(def_name);
       }
@@ -1622,26 +1837,36 @@ namespace xfst {
           {
             if (verbose_)
               {
-                hfst_fprintf(warnstream_, "warning: transducer is in optimized lookup format, 'apply up' is the only operation it supports\n");
+                error() << "warning: transducer is in optimized lookup format, 'apply up' is the only operation it supports" << std::endl;
+                flush(&error());
+                //hfst_fprintf(warnstream_, "warning: transducer is in optimized lookup format, 'apply up' is the only operation it supports\n");
               }
             return;
           }
 
         if (verbose_)
           {
-            hfst_fprintf(warnstream_, "warning: converting transducer type from %s to %s",
-                    hfst::implementation_type_to_format(t->get_type()),
-                    hfst::implementation_type_to_format(format_));
+            error() << "warning: converting transducer type from " << hfst::implementation_type_to_format(t->get_type()) << " to " << hfst::implementation_type_to_format(format_);
+            flush(&error());
+            //hfst_fprintf(warnstream_, "warning: converting transducer type from %s to %s",
+            //        hfst::implementation_type_to_format(t->get_type()),
+            //        hfst::implementation_type_to_format(format_));
             if (filename != NULL)
               {
-                hfst_fprintf(warnstream_, " when reading from file '%s'",
-                        to_filename(filename));
+                error() << " when reading from file '" << to_filename(filename) << "'";
+                flush(&error());
+                //hfst_fprintf(warnstream_, " when reading from file '%s'",
+                //        to_filename(filename));
               }
             if (! hfst::HfstTransducer::is_safe_conversion(t->get_type(), format_))
               {
-                hfst_fprintf(warnstream_, " (loss of information is possible)");
+                error() << " (loss of information is possible)";
+                flush(&error());
+                //hfst_fprintf(warnstream_, " (loss of information is possible)");
               }
-            hfst_fprintf(warnstream_, "\n");
+            error() << std::endl;
+            flush(&error());
+            //hfst_fprintf(warnstream_, "\n");
           }
         t->convert(format_);
       }
@@ -1652,13 +1877,21 @@ namespace xfst {
   {
     assert(infilename != NULL);
     
-    FILE * infile = hfst::xfst::xfst_fopen(infilename, "r");
+    FILE * infile = fopen(infilename, "r");
     if (infile == NULL)
       {
+        error() << "Could not open file " << infilename << std::endl;
+        flush(&error());
+        xfst_fail();
+        return NULL;
+      }
+    if (fclose(infile) != 0)
+      {
+        error() << "Could not close file " << infilename << std::endl;
+        flush(&error());
         xfst_fail();
         return NULL;
       }
-    hfst::xfst::xfst_fclose(infile, infilename);
 
     HfstInputStream* instream = 0;
     try 
@@ -1669,8 +1902,10 @@ namespace xfst {
       }
     catch (NotTransducerStreamException ntse)
       {
-        hfst_fprintf(errorstream_, "Unable to read transducers from %s\n", 
-                to_filename(infilename));
+        error() << "Unable to read transducers from " << to_filename(infilename) << std::endl;
+        flush(&error());
+        //hfst_fprintf(errorstream_, "Unable to read transducers from %s\n", 
+        //        to_filename(infilename));
         xfst_fail();
         return NULL;
       }
@@ -1699,7 +1934,9 @@ namespace xfst {
             if (t->get_type() == hfst::HFST_OL_TYPE ||
                 t->get_type() == hfst::HFST_OLW_TYPE)
               {
-                hfst_fprintf(errorstream_, "cannot load optimized lookup transducers as definitions\n");
+                error() << "cannot load optimized lookup transducers as definitions" << std::endl;
+                flush(&error());
+                //hfst_fprintf(errorstream_, "cannot load optimized lookup transducers as definitions\n");
                 break;
               }
             add_loaded_definition(t);
@@ -1726,8 +1963,10 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::collect_epsilon_loops()
     {
-      hfst_fprintf(stderr, "cannot collect epsilon loops %s:%d\n", __FILE__,
-              __LINE__);
+      error() << "cannot collect epsilon loops" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "cannot collect epsilon loops %s:%d\n", __FILE__,
+      //        __LINE__);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
@@ -1743,7 +1982,16 @@ namespace xfst {
     {
       GET_TOP(tmp);
       std::string name_(name);
-      tmp->eliminate_flag(name);
+      try 
+        {
+          tmp->eliminate_flag(name);
+        }
+      catch (HfstException & e)
+        {
+          error() << "error: could not eliminate flag '" << name << "': " << e.name << std::endl;
+          flush(&error());
+          MAYBE_QUIT;
+        }
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -1766,7 +2014,9 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::echo(const char* text)
     {
-      hfst_fprintf(outstream_, "%s\n", text);
+      output() << text << std::endl;
+      flush(&output());
+      //hfst_fprintf(outstream_, "%s\n", text);
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -1775,15 +2025,19 @@ namespace xfst {
     {
       if (verbose_ && (strcmp(message, "dodongo") == 0))
         {
-          hfst_fprintf(outstream_, "dislikes smoke.\n");
+          output() << "dislikes smoke." << std::endl;
+          flush(&output());
+          //hfst_fprintf(outstream_, "dislikes smoke.\n");
         }
       else if (verbose_)
         {
-          hfst_fprintf(outstream_, "%s.\n", message);
+          output() << message << "." << std::endl;
+          flush(&output());
+          //hfst_fprintf(outstream_, "%s.\n", message);
         }
       else
         ;
-      exit(EXIT_SUCCESS);
+      this->quit_requested_ = true;
       return *this;
     }
 
@@ -1793,7 +2047,9 @@ namespace xfst {
       int rv = ::system(command);
       if (rv != 0)
         {
-          hfst_fprintf(stderr, "system %s returned %d\n", command, rv);
+          error() << "system " << command << " returned " << rv << std::endl;
+          flush(&error());
+          //hfst_fprintf(stderr, "system %s returned %d\n", command, rv);
         }
       PROMPT_AND_RETURN_THIS;
     }
@@ -1805,17 +2061,23 @@ namespace xfst {
         {
           if (strcmp(name, "compose-flag-as-special") == 0)
             {
-              hfst_fprintf(warnstream_, "variable compose-flag-as-special not found, using flag-is-epsilon instead\n");
+              error() << "variable compose-flag-as-special not found, using flag-is-epsilon instead" << std::endl;
+              flush(&error());
+              //hfst_fprintf(warnstream_, "variable compose-flag-as-special not found, using flag-is-epsilon instead\n");
               variables_["flag-is-epsilon"] = text;
               if (verbose_)
                 {
-                  hfst_fprintf(outstream_, "variable %s = %s\n", "flag-is-epsilon", text);
+                  output() << "variable flag-is-epsilon = " << text << std::endl;
+                  flush(&output());
+                  //hfst_fprintf(outstream_, "variable %s = %s\n", "flag-is-epsilon", text);
                 }
               PROMPT_AND_RETURN_THIS;
             }              
           else
             {
-              hfst_fprintf(warnstream_, "no such variable: '%s'\n", name);
+              error() << "no such variable: '" << name << "'" << std::endl;
+              flush(&error());
+              //hfst_fprintf(warnstream_, "no such variable: '%s'\n", name);
               // xfst_lesser_fail(); ???
               PROMPT_AND_RETURN_THIS;
             }
@@ -1859,7 +2121,9 @@ namespace xfst {
 
       if (verbose_)
         {
-          hfst_fprintf(outstream_, "variable %s = %s\n", name, text);
+          output() << "variable " << name << " = " << text << std::endl;
+          flush(&output());
+          //hfst_fprintf(outstream_, "variable %s = %s\n", name, text);
         }
 
       PROMPT_AND_RETURN_THIS;
@@ -1870,7 +2134,9 @@ namespace xfst {
     {
       if (variables_.find(name) == variables_.end())
         {
-          hfst_fprintf(warnstream_, "no such variable: '%s'\n", name);
+          error() << "no such variable: '" << name << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(warnstream_, "no such variable: '%s'\n", name);
           // xfst_lesser_fail(); ???
           PROMPT_AND_RETURN_THIS;
         }
@@ -1880,16 +2146,28 @@ namespace xfst {
       PROMPT_AND_RETURN_THIS;
     }
 
+  std::string
+  XfstCompiler::get(const char* name)
+  {
+    if (variables_.find(name) == variables_.end())
+      return std::string("");
+    return std::string(variables_[name]);
+  }
+
   XfstCompiler& 
   XfstCompiler::show(const char* name)
     {
       if (variables_.find(name) == variables_.end())
         {
-          hfst_fprintf(warnstream_, "no such variable: '%s'\n", name);
+          error() << "no such variable: '" << name << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(warnstream_, "no such variable: '%s'\n", name);
           // xfst_lesser_fail(); ???
           PROMPT_AND_RETURN_THIS;
-        }        
-      hfst_fprintf(outstream_, "variable %s = %s\n", name, variables_[name].c_str());
+        }
+      output() << "variable " << name << " = " << variables_[name] << std::endl;
+      flush(&output());
+      //hfst_fprintf(outstream_, "variable %s = %s\n", name, variables_[name].c_str());
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -1900,14 +2178,26 @@ namespace xfst {
            var != variables_.end();
            var++)
         {
+          // HERE
           if (var->first == "copyright-owner")
-            hfst_fprintf(stderr, "%20s:        %s\n", var->first.c_str(),
-                    var->second.c_str());
+            {
+              output().width(20);
+              output() << var->first << ": " << var->second << std::endl;
+              //hfst_fprintf(stderr, "%20s:        %s\n", var->first.c_str(),
+              //          var->second.c_str()); 
+            }
           else
-            hfst_fprintf(stderr, "%20s:%6s: %s\n", 
-                    var->first.c_str(), var->second.c_str(),
-                    variable_explanations_[var->first].c_str());
+            {
+              output().width(20);
+              output() << var->first << ": "; 
+              output().width(6);
+              output() << var->second << ": " << variable_explanations_[var->first] << std::endl;
+              //  hfst_fprintf(stderr, "%20s:%6s: %s\n", 
+              //          var->first.c_str(), var->second.c_str(),
+              //          variable_explanations_[var->first].c_str());
+            }
         }
+      flush(&output());
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -1916,8 +2206,11 @@ namespace xfst {
     {
       if (stack_.size() < 2)
         {
-          hfst_fprintf(stderr, "Not enough networks on stack. "
-                  "Operation requires at least 2.\n");
+          error() << "Not enough networks on stack." << std::endl
+                  << "Operation requires at least 2." << std::endl;
+          flush(&error());
+          //hfst_fprintf(stderr, "Not enough networks on stack. "
+          //        "Operation requires at least 2.\n");
           xfst_lesser_fail();
           return *this;
         }
@@ -1937,7 +2230,9 @@ namespace xfst {
   XfstCompiler::print_bool(bool value)
   {
     int printval = (value)? 1 : 0; 
-    hfst_fprintf(outstream_, "%i, (1 = TRUE, 0 = FALSE)\n", printval);
+    output() << printval << ", (1 = TRUE, 0 = FALSE)" << std::endl;
+    flush(&output());
+    //hfst_fprintf(outstream_, "%i, (1 = TRUE, 0 = FALSE)\n", printval);
     return *this;
   }
   HfstTransducer *
@@ -1945,7 +2240,8 @@ namespace xfst {
   {
     if (stack_.size() < 1)
       {
-        hfst_fprintf(stderr, "Empty stack.\n");
+        EMPTY_STACK;
+        //hfst_fprintf(stderr, "Empty stack.\n");
         xfst_lesser_fail();
         prompt();
         return NULL;
@@ -1954,8 +2250,10 @@ namespace xfst {
     if (retval->get_type() == hfst::HFST_OL_TYPE ||
         retval->get_type() == hfst::HFST_OLW_TYPE)
       {
-        hfst_fprintf(stderr, "Operation not supported for optimized lookup format. "
-                     "Consider 'remove-optimization' to convert into ordinary format.\n");
+        error() << "Operation not supported for optimized lookup format. Consider 'remove-optimization' to convert into ordinary format." << std::endl;
+        flush(&error());
+        //hfst_fprintf(stderr, "Operation not supported for optimized lookup format. "
+        //             "Consider 'remove-optimization' to convert into ordinary format.\n");
         prompt();
         return NULL;
       }
@@ -1965,7 +2263,9 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::test_funct(bool assertion)
     {
-      hfst_fprintf(stderr, "test funct missing %s:%d\n", __FILE__, __LINE__);
+      error() << "test funct missing" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "test funct missing %s:%d\n", __FILE__, __LINE__);
       //MAYBE_ASSERT(assertion, result);
       PROMPT_AND_RETURN_THIS;
     }
@@ -2021,9 +2321,12 @@ namespace xfst {
         value = id.compare(tmp, false);
       else if (level == LOWER_LEVEL)
         value = ! id.compare(tmp, false);
-      else
-        hfst_fprintf(errorstream_, "ERROR: argument given to function 'test_uni'\n"
-                "not recognized\n");
+      else {
+        error() << "ERROR: argument given to function 'test_uni' not recognized" << std::endl;
+        flush(&error());
+      }
+      //hfst_fprintf(errorstream_, "ERROR: argument given to function 'test_uni'\n"
+      //          "not recognized\n");
 
       this->print_bool(value);
       MAYBE_ASSERT(assertion, value);
@@ -2084,8 +2387,10 @@ namespace xfst {
   {
     if (stack_.size() < 2)
       {
-        hfst_fprintf(stderr, "Not enough networks on stack. "
-                "Operation requires at least 2.\n");
+        error() << "Not enough networks on stack. Operation requires at least 2." << std::endl;
+        flush(&error());
+        //hfst_fprintf(stderr, "Not enough networks on stack. "
+        //        "Operation requires at least 2.\n");
         xfst_lesser_fail();
         PROMPT_AND_RETURN_THIS;
       }
@@ -2126,7 +2431,9 @@ namespace xfst {
               break;
             }
           default:
-            hfst_fprintf(errorstream_, "ERROR: unknown test operation\n");
+            error() << "ERROR: unknown test operation" << std::endl;
+            flush(&error());
+            //hfst_fprintf(errorstream_, "ERROR: unknown test operation\n");
             break;
           }
       }
@@ -2148,7 +2455,9 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::test_unambiguous(bool assertion)
     {
-      hfst_fprintf(stderr, "test unambiguous missing %s:%d\n", __FILE__, __LINE__);
+      error() << "test unambiguous missing" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "test unambiguous missing %s:%d\n", __FILE__, __LINE__);
       //MAYBE_ASSERT(assertion, result);
       PROMPT_AND_RETURN_THIS;
     }
@@ -2229,8 +2538,10 @@ namespace xfst {
         = definitions_.find(variable);
       if (it == definitions_.end())
         {
-          hfst_fprintf(errorstream_, "no such definition '%s', cannot substitute\n", 
-                  variable);
+          error() << "no such definition '" << variable << "', cannot substitute" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "no such definition '%s', cannot substitute\n", 
+          //        variable);
           MAYBE_QUIT;
           PROMPT_AND_RETURN_THIS;
         }
@@ -2244,8 +2555,10 @@ namespace xfst {
       StringSet alpha = top->get_alphabet();
       if (alpha.find(labelstr) == alpha.end())
         {
-          hfst_fprintf(errorstream_, "no occurrences of label '%s', cannot substitute\n", 
-                  label);
+          error() << "no occurrences of label '" << label << "', cannot substitute" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "no occurrences of label '%s', cannot substitute\n", 
+          //        label);
           MAYBE_QUIT;
           PROMPT_AND_RETURN_THIS;
         }
@@ -2263,8 +2576,10 @@ namespace xfst {
               if (isymbol != osymbol && 
                   (isymbol == labelstr || osymbol == labelstr))
                 {
-                  hfst_fprintf(errorstream_, "label '%s' is used as a symbol on one "
-                          "side of an arc, cannot substitute\n", label);
+                  error() << "label '" << label << "' is used as a symbol on one side of an arc, cannot substitute" << std::endl;
+                  flush(&error());
+                  //hfst_fprintf(errorstream_, "label '%s' is used as a symbol on one "
+                  //        "side of an arc, cannot substitute\n", label);
                   MAYBE_QUIT;
                   PROMPT_AND_RETURN_THIS;
                 }
@@ -2308,7 +2623,9 @@ namespace xfst {
                 }
               catch (const char * msg)
                 {
-                  hfst_fprintf(errorstream_, "error: could not substitute with '%s'\n", list);
+                  error() << "error: could not substitute with '" << list << "'" << std::endl;
+                  flush(&error());
+                  //hfst_fprintf(errorstream_, "error: could not substitute with '%s'\n", list);
                   MAYBE_QUIT;
                   PROMPT_AND_RETURN_THIS;
                 }
@@ -2340,8 +2657,10 @@ namespace xfst {
             }
           if (!target_label_found)
             {
-              hfst_fprintf(errorstream_, "no occurrences of '%s:%s', cannot substitute\n", 
-                      target_label.first.c_str(), target_label.second.c_str());
+              error() << "no occurrences of '" << target_label.first << ":" << target_label.second << "', cannot substitute" << std::endl;
+              flush(&error());
+              //hfst_fprintf(errorstream_, "no occurrences of '%s:%s', cannot substitute\n", 
+              //        target_label.first.c_str(), target_label.second.c_str());
               PROMPT_AND_RETURN_THIS;
             }
 
@@ -2349,7 +2668,9 @@ namespace xfst {
         }
       catch (const char * msg)
         {
-          hfst_fprintf(errorstream_, "error: could not substitute '%s'\n", target);
+          error() << "error: could not substitute '" << target << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "error: could not substitute '%s'\n", target);
           MAYBE_QUIT;
         }
 
@@ -2365,7 +2686,9 @@ namespace xfst {
       StringSet alpha = top->get_alphabet();
       if (alpha.find(target) == alpha.end())
         {
-          hfst_fprintf(errorstream_, "no occurrences of symbol '%s', cannot substitute\n", target);
+          error() << "no occurrences of symbol '" << target << "', cannot substitute" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "no occurrences of symbol '%s', cannot substitute\n", target);
           MAYBE_QUIT;
           PROMPT_AND_RETURN_THIS;
         }
@@ -2377,11 +2700,11 @@ namespace xfst {
         liststr = "";
 
       // use regex parser:  `[ [TR] , "s" , L ]
-      xre_.define("TempXfstTransducerName", *top);
+      xre_.define("TempXfstTransducerName", *top);  // XRE
       std::string subst_regex("`[ [TempXfstTransducerName] , ");
       subst_regex += "\"" + std::string(target) + "\" , " + liststr + " ]";
-      HfstTransducer * substituted = xre_.compile(subst_regex);
-      xre_.undefine("TempXfstTransducerName");
+      HfstTransducer * substituted = xre_.compile(subst_regex);  // XRE
+      xre_.undefine("TempXfstTransducerName");  // XRE
 
       if (substituted != NULL)
         {
@@ -2391,70 +2714,92 @@ namespace xfst {
         }
       else
         {
-          hfst_fprintf(errorstream_, "fatal error in substitution, exiting program\n");
-          exit(EXIT_FAILURE);
+          error() << "fatal error in substitution" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "fatal error in substitution\n");
+          this->fail_flag_ = true;
+          //exit(EXIT_FAILURE);
         }
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_aliases(FILE* outfile)
+  XfstCompiler::print_aliases(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       for (map<string,string>::const_iterator alias = aliases_.begin();
            alias != aliases_.end();
            ++alias)
         {
-          hfst_fprintf(outfile, "alias %10s %s", 
-                  alias->first.c_str(), alias->second.c_str());
+          // HERE
+          oss->width(10);
+          *oss << "alias " << alias->first << " " << alias->second;
+          //hfst_fprintf(outfile, "alias %10s %s", 
+          //        alias->first.c_str(), alias->second.c_str());
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
           
   XfstCompiler& 
-  XfstCompiler::print_arc_count(const char* level, FILE* outfile)
+  XfstCompiler::print_arc_count(const char* level, std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing %s arc count %s:%d\n", level,
-              __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing " << level << " arc count" << std::endl;
+      //hfst_fprintf(outfile, "missing %s arc count %s:%d\n", level,
+      //        __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_arc_count(FILE* outfile)
+  XfstCompiler::print_arc_count(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing arc count %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing arc count" << std::endl;
+      //hfst_fprintf(outfile, "missing arc count %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_defined(FILE* outfile)
+  XfstCompiler::print_defined(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       bool definitions = false;
       for (map<string,string>::const_iterator def 
              = original_definitions_.begin(); def != original_definitions_.end();
            ++def)
         {         
+          // HERE
           definitions = true;
-          hfst_fprintf(outfile, "%10s %s\n",
-                  def->first.c_str(), def->second.c_str());
+          oss->width(10);
+          *oss << def->first << " " << def->second << std::endl;
+          //hfst_fprintf(outfile, "%10s %s\n",
+          //        def->first.c_str(), def->second.c_str());
         }
       if (!definitions)
-        hfst_fprintf(outfile, "No defined symbols.\n");
+        *oss << "No defined symbols." << std::endl; // hfst_fprintf(outfile, "No defined symbols.\n");
 
       definitions = false;
       for (map<string,string>::const_iterator func = original_function_definitions_.begin();
            func != original_function_definitions_.end(); func++)
         {
+          // HERE
           definitions = true;
-          hfst_fprintf(outfile, "%10s %s\n", func->first.c_str(), 
-                  func->second.c_str());
+          oss->width(10);
+          *oss << func->first << " " << func->second << std::endl;
+          //hfst_fprintf(outfile, "%10s %s\n", func->first.c_str(), 
+          //        func->second.c_str());
         }
       if (!definitions)
-        hfst_fprintf(stderr, "No function definitions.\n");
+        *oss << "No function definitions." << std::endl; // hfst_fprintf(stderr, "No function definitions.\n");
 
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_dir(const char* globdata, FILE* outfile)
+  XfstCompiler::print_dir(const char* globdata, std::ostream * oss)
     {
 #ifndef _WIN32
       glob_t globbuf;
@@ -2464,52 +2809,63 @@ namespace xfst {
         {
           for (unsigned int i = 0; i < globbuf.gl_pathc; i++)
             {
-              hfst_fprintf(outfile, "%s\n", globbuf.gl_pathv[i]);
+              *oss << globbuf.gl_pathv[i] << std::endl;
+              //hfst_fprintf(outfile, "%s\n", globbuf.gl_pathv[i]);
             }
         }
       else
         {
-          hfst_fprintf(outfile, "glob(%s) = %d\n", globdata, rv);
+          *oss << "glob(" << globdata << ") = " << rv << std::endl;
+          //hfst_fprintf(outfile, "glob(%s) = %d\n", globdata, rv);
         }
 #else
-      hfst_fprintf(stderr, "print dir not implemented for windows\n");
+      error() << "print dir not implemented for windows" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "print dir not implemented for windows\n");
 #endif // WINDOWS
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_flags(FILE* outfile)
+  XfstCompiler::print_flags(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing print flags %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing print flags" << std::endl;
+      //hfst_fprintf(outfile, "missing print flags %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   
   XfstCompiler&
-  XfstCompiler::print_labels(FILE* outfile)
+  XfstCompiler::print_labels(std::ostream * oss)
   {
     GET_TOP(topmost);
-    return this->print_labels(outfile, topmost);
+    return this->print_labels(oss, topmost);
   }
 
   XfstCompiler& 
-  XfstCompiler::print_labels(const char* name, FILE* outfile)
+  XfstCompiler::print_labels(const char* name, std::ostream * oss_)
     { 
+      std::ostream * oss = get_stream(oss_);
       std::map<std::string, HfstTransducer*>::const_iterator it 
         = definitions_.find(name);
       if (it == definitions_.end())
         {
-          hfst_fprintf(outfile, "no such definition '%s'\n", name);
+          *oss << "no such definition '" << name << "'" << std::endl;
+          //hfst_fprintf(outfile, "no such definition '%s'\n", name);
         }
       else
         {
-          return this->print_labels(outfile, it->second);
+          return this->print_labels(oss, it->second);
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_labels(FILE* outfile, HfstTransducer* tr)
+  XfstCompiler::print_labels(std::ostream * oss_, HfstTransducer* tr)
     {
+      std::ostream * oss = get_stream(oss_);
       std::set<std::pair<std::string, std::string> > label_set;
       HfstBasicTransducer fsm(*tr);
       
@@ -2525,31 +2881,39 @@ namespace xfst {
             }
         }
         
-      hfst_fprintf(outfile, "Labels: ");
+      *oss << "Labels: ";
+      //hfst_fprintf(outfile, "Labels: ");
       for(std::set<std::pair<std::string, std::string> >::const_iterator it
             = label_set.begin(); it != label_set.end(); it++)
         {
           if (it != label_set.begin())
-            hfst_fprintf(outfile, ", ");
-          hfst_fprintf(outfile, "%s", it->first.c_str());
+            *oss << ", "; //hfst_fprintf(outfile, ", ");
+          *oss << it->first; // hfst_fprintf(outfile, "%s", it->first.c_str());
           if (it->first != it->second)
-            hfst_fprintf(outfile, ":%s", it->second.c_str());
+            *oss << ":" << it->second; //hfst_fprintf(outfile, ":%s", it->second.c_str());
         }
-      hfst_fprintf(outfile, "\n");
-      hfst_fprintf(outfile, "Size: %i\n", (int)label_set.size());
+      *oss << std::endl;
+      *oss << "Size: " << (int)label_set.size() << std::endl;
+      //hfst_fprintf(outfile, "\n");
+      //hfst_fprintf(outfile, "Size: %i\n", (int)label_set.size());
 
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_labelmaps(FILE* outfile)
+  XfstCompiler::print_labelmaps(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing label-maps %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing label-maps" << std::endl;
+      //hfst_fprintf(outfile, "missing label-maps %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_label_count(FILE* outfile)
+  XfstCompiler::print_label_count(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
     GET_TOP(topmost);
 
     std::map<std::pair<std::string, std::string>, unsigned int > label_map;
@@ -2572,60 +2936,80 @@ namespace xfst {
             it= label_map.begin(); it != label_map.end(); it++)
         {
           if (it != label_map.begin())
-            hfst_fprintf(outfile, "   ");
-          hfst_fprintf(outfile, "%i. ", index);
-          hfst_fprintf(outfile, "%s", it->first.first.c_str());
+            *oss << "   "; // hfst_fprintf(outfile, "   ");
+          *oss << index << ". "; //hfst_fprintf(outfile, "%i. ", index);
+          *oss << it->first.first; //hfst_fprintf(outfile, "%s", it->first.first.c_str());
           if (it->first.first != it->first.second)
-            hfst_fprintf(outfile, ":%s", it->first.second.c_str());
-          hfst_fprintf(outfile, " %i", it->second);
+            *oss << ":" << it->first.second; //hfst_fprintf(outfile, ":%s", it->first.second.c_str());
+          *oss << " " << it->second; //hfst_fprintf(outfile, " %i", it->second);
           index++;
         }
-      hfst_fprintf(outfile, "\n");
+      *oss << std::endl;
+      //hfst_fprintf(outfile, "\n");
 
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler&
-  XfstCompiler::print_list(const char* name, FILE* outfile)
+  XfstCompiler::print_list(const char* name, std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       if (lists_.find(name) == lists_.end())
         {
-          hfst_fprintf(outfile, "No such list defined: %s\n", name);
+          *oss << "No such list defined: " << name << std::endl;
+          //hfst_fprintf(outfile, "No such list defined: %s\n", name);
+          flush(oss);
           PROMPT_AND_RETURN_THIS;
         }
+      // HERE
       std::set<string> l = lists_[name];
-      hfst_fprintf(outfile, "%10s: ", name);
+      oss->width(10);
+      *oss << name << ": ";
+      //hfst_fprintf(outfile, "%10s: ", name);
       for (std::set<string>::const_iterator s = l.begin();
            s != l.end();
            ++s)
         {
-          hfst_fprintf(outfile, "%s ", s->c_str());
+          *oss << *s << " ";
+          //hfst_fprintf(outfile, "%s ", s->c_str());
         }
-      hfst_fprintf(outfile, "\n");
+      *oss << std::endl;
+      //hfst_fprintf(outfile, "\n");
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_list(FILE* outfile)
+  XfstCompiler::print_list(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       if (lists_.size() == 0)
         {
-          hfst_fprintf(outfile, "No lists defined.\n");
+          *oss << "No lists defined." << std::endl;
+          //hfst_fprintf(outfile, "No lists defined.\n");
+          flush(oss);
           PROMPT_AND_RETURN_THIS;
         }
       for (map<string,std::set<string> >::const_iterator l = lists_.begin();
            l != lists_.end();
            ++l)
         {
-          hfst_fprintf(outfile, "%10s: ", l->first.c_str());
+          // HERE
+          oss->width(10);
+          *oss << l->first << " ";
+          //hfst_fprintf(outfile, "%10s: ", l->first.c_str());
           for (std::set<string>::const_iterator s = l->second.begin();
                s != l->second.end();
                ++s)
             {
-              hfst_fprintf(outfile, "%s ", s->c_str());
+              *oss << *s << " ";
+              //hfst_fprintf(outfile, "%s ", s->c_str());
             }
-          hfst_fprintf(outfile, "\n");
+          *oss << std::endl;
+          //hfst_fprintf(outfile, "\n");
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -2639,8 +3023,9 @@ namespace xfst {
   }
 
   XfstCompiler& 
-  XfstCompiler::print_shortest_string(FILE* outfile)
+  XfstCompiler::print_shortest_string(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       GET_TOP(topmost);
 
       HfstTwoLevelPaths paths;
@@ -2648,51 +3033,64 @@ namespace xfst {
 
       if (paths.size() == 0)
         {
-          hfst_fprintf(outstream_, "transducer is empty\n");
+          output() << "transducer is empty" << std::endl;
+          flush(&output());
+          //hfst_fprintf(outstream_, "transducer is empty\n");
         }
       else
         {
-          print_paths(paths, outfile);
+          print_paths(paths, oss);
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_shortest_string_size(FILE* outfile)
+  XfstCompiler::print_shortest_string_size(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       GET_TOP(topmost);
 
       HfstTwoLevelPaths paths;
       this->shortest_string(topmost, paths);
 
       if (paths.size() == 0) {
-        hfst_fprintf(outstream_, "transducer is empty\n");
+        output() << "transducer is empty" << std::endl;
+        flush(&output());
+        //hfst_fprintf(outstream_, "transducer is empty\n");
       }
       else {
-        hfst_fprintf(outfile, "%i\n", (int)(paths.begin()->second.size()));
+        *oss << (int)(paths.begin()->second.size()) << std::endl;
+        //hfst_fprintf(outfile, "%i\n", (int)(paths.begin()->second.size()));
       }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler&
   XfstCompiler::print_one_string_or_its_size
-  (FILE* outfile, const HfstTwoLevelPaths & paths, const char * level, bool print_size)
+  (std::ostream * oss_, const HfstTwoLevelPaths & paths, const char * level, bool print_size)
   {
+    std::ostream * oss = get_stream(oss_);
     assert(level != NULL);
-    hfst_fprintf(outfile, "%s", level);
+    *oss << std::string(level) << ": ";
+    //hfst_fprintf(outfile, "%s: ", level);
     if (print_size)
       {
-        hfst_fprintf(outfile, "%i\n", (int)paths.begin()->second.size());
+        *oss << (int)paths.begin()->second.size() << std::endl;
+        //hfst_fprintf(outfile, "%i\n", (int)paths.begin()->second.size());
       }
     else
       {
-        print_paths(paths, outfile, 1);
+        print_paths(paths, oss, 1);
       }
+    flush(oss);
     return *this;
   }
 
   XfstCompiler&
-  XfstCompiler::print_longest_string_or_its_size(FILE* outfile, bool print_size)
+  XfstCompiler::print_longest_string_or_its_size(std::ostream * oss_, bool print_size)
   {
+    std::ostream * oss = get_stream(oss_);
     GET_TOP(topmost);
 
     // Variables needed to find out some properties about the transducer
@@ -2728,10 +3126,12 @@ namespace xfst {
     // Print the results:
     // first, the special cases,
     if (upper_is_cyclic && lower_is_cyclic) {
-      hfst_fprintf(outstream_, "transducer is cyclic\n");
+      output() << "transducer is cyclic" << std::endl; // hfst_fprintf(outstream_, "transducer is cyclic\n");
+      flush(&output());
     }
     else if (transducer_is_empty) {
-      hfst_fprintf(outstream_, "transducer is empty\n");
+      output() << "transducer is empty" << std::endl; // hfst_fprintf(outstream_, "transducer is empty\n");
+      flush(&output());
     }
     // then the usual: 
     else {
@@ -2740,47 +3140,54 @@ namespace xfst {
           (tmp_upper.has_flag_diacritics() || 
            tmp_lower.has_flag_diacritics()) )
         {
-          hfst_fprintf(warnstream_ ,"warning: longest string may have flag diacritics that are not shown\n");
-          hfst_fprintf(warnstream_, "         but are used in calculating its length (use 'eliminate flags')\n");
+          error() << "warning: longest string may have flag diacritics that are not shown" << std::endl;
+          error() << "         but are used in calculating its length (use 'eliminate flags')" << std::endl;
+          flush(&error());
+          //hfst_fprintf(warnstream_ ,"warning: longest string may have flag diacritics that are not shown\n");
+          //hfst_fprintf(warnstream_, "         but are used in calculating its length (use 'eliminate flags')\n");
         }
       
       // print one longest string of the upper level, if not cyclic
       if (upper_is_cyclic) {
-        hfst_fprintf(outfile, "Upper level is cyclic.\n"); }
+        //hfst_fprintf(outfile, "Upper level is cyclic.\n"); }
+        *oss << "Upper level is cyclic." << std::endl; }
       else {
-        print_one_string_or_its_size(outfile, paths_upper, "Upper", print_size); }
+        print_one_string_or_its_size(oss, paths_upper, "Upper", print_size); }
       
       // print one longest string of the lower level, if not cyclic
         if (lower_is_cyclic) {
-          hfst_fprintf(outfile, "Lower level is cyclic.\n"); }
+          //hfst_fprintf(outfile, "Lower level is cyclic.\n"); }
+          *oss << "Lower level is cyclic." << std::endl; }
         else {
-          print_one_string_or_its_size(outfile, paths_lower, "Lower", print_size); }
+          print_one_string_or_its_size(oss, paths_lower, "Lower", print_size); }
     }
 
+    flush(oss);
     PROMPT_AND_RETURN_THIS;
   }
 
   XfstCompiler& 
-  XfstCompiler::print_longest_string(FILE* outfile)
+  XfstCompiler::print_longest_string(std::ostream * oss)
     {
-      return print_longest_string_or_its_size(outfile, false);
+      return print_longest_string_or_its_size(oss, false);
     }
 
   XfstCompiler& 
-  XfstCompiler::print_longest_string_size(FILE* outfile)
+  XfstCompiler::print_longest_string_size(std::ostream * oss)
     {
-      return print_longest_string_or_its_size(outfile, true);
+      return print_longest_string_or_its_size(oss, true);
     }
 
   XfstCompiler& 
   XfstCompiler::print_lower_words(const char * name, unsigned int number,
-                                  FILE* outfile)
+                                  std::ostream * oss)
     {
-      return print_words(name, number, outfile, LOWER_LEVEL);
+      return print_words(name, number, oss, LOWER_LEVEL);
     }
   XfstCompiler& 
-  XfstCompiler::print_random_lower(const char * name, unsigned int number, FILE* outfile)
+  XfstCompiler::print_random_lower(const char * name, unsigned int number, std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       hfst::HfstTwoLevelPaths paths;
 
       HfstTransducer tmp(format_);
@@ -2797,7 +3204,9 @@ namespace xfst {
             = definitions_.find(name);
           if (it == definitions_.end())
             {
-              hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              //hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              *oss << "no such definition '" << std::string(name) << "'" << std::endl;
+              flush(oss);
               prompt();
               return *this;
             }
@@ -2809,18 +3218,20 @@ namespace xfst {
 
       tmp.output_project();
       tmp.extract_random_paths(paths, number);
-      print_paths(paths, outfile);
+      print_paths(paths, oss);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
   XfstCompiler::print_upper_words(const char * name, unsigned int number,
-                                  FILE* outfile)
+                                  std::ostream * oss)
     {
-      return print_words(name, number, outfile, UPPER_LEVEL);
+      return print_words(name, number, oss, UPPER_LEVEL);
     }
   XfstCompiler&
-  XfstCompiler::print_random_upper(const char * name, unsigned int number, FILE* outfile)
+  XfstCompiler::print_random_upper(const char * name, unsigned int number, std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       hfst::HfstTwoLevelPaths paths;
 
       HfstTransducer tmp(format_);
@@ -2837,7 +3248,9 @@ namespace xfst {
             = definitions_.find(name);
           if (it == definitions_.end())
             {
-              hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              *oss << "no such definition '" << std::string(name) << std::endl;
+              //hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              flush(oss);
               prompt();
               return *this;
             }
@@ -2849,21 +3262,23 @@ namespace xfst {
 
       tmp.input_project();
       tmp.extract_random_paths(paths, number);
-      print_paths(paths, outfile);
+      print_paths(paths, oss);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
   XfstCompiler::print_words(const char * name, unsigned int number,
-                            FILE* outfile)
+                            std::ostream * oss)
   {
-    return print_words(name, number, outfile, BOTH_LEVELS);
+    return print_words(name, number, oss, BOTH_LEVELS);
   }
 
   XfstCompiler& 
   XfstCompiler::print_words(const char * name, unsigned int number,
-                            FILE* outfile, Level level)
+                            std::ostream * oss_, Level level)
     {
+      std::ostream * oss = get_stream(oss_);
       HfstTransducer temp(format_);
       if (name == NULL)
         {
@@ -2878,7 +3293,9 @@ namespace xfst {
             = definitions_.find(name);
           if (it == definitions_.end())
             {
-              hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              *oss << "no such definition '" << std::string(name) << "'" << std::endl;
+              //hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              flush(oss);
               prompt();
               return *this;
             }
@@ -2899,8 +3316,11 @@ namespace xfst {
         case BOTH_LEVELS:
           break;
         default:
-          hfst_fprintf(errorstream_, "ERROR: argument given to function 'print_words'\n"
-                  "not recognized\n");
+          error() << "ERROR: argument given to function 'print_words' not recognized" << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "ERROR: argument given to function 'print_words'\n"
+          //        "not recognized\n");
+          flush(oss);
           PROMPT_AND_RETURN_THIS;
         }
 
@@ -2916,21 +3336,24 @@ namespace xfst {
       catch (const TransducerIsCyclicException & e)
         {
           int cutoff = string_to_size_t(variables_["print-words-cycle-cutoff"]);
-          hfst_fprintf(warnstream_, "warning: transducer is cyclic, limiting the number of cycles to %i\n", cutoff);
+          error() << "warning: transducer is cyclic, limiting the number of cycles to " << cutoff << std::endl;
+          flush(&error());
+          //hfst_fprintf(warnstream_, "warning: transducer is cyclic, limiting the number of cycles to %i\n", cutoff);
           if (variables_["obey-flags"] == "OFF")
             temp.extract_paths(results, number, cutoff);
           else
             temp.extract_paths_fd(results, number, cutoff);
         }
 
-      print_paths(results, outfile);
+      print_paths(results, oss);
 
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_random_words(const char * name, unsigned int number, FILE* outfile)
+  XfstCompiler::print_random_words(const char * name, unsigned int number, std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       const HfstTransducer * tmp = NULL;
       if (name == NULL)
         {
@@ -2944,7 +3367,9 @@ namespace xfst {
             = definitions_.find(name);
           if (it == definitions_.end())
             {
-              hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              *oss << "no such definition '" << std::string(name) << "'" << std::endl; 
+              //hfst_fprintf(outfile, "no such definition '%s'\n", name);
+              flush(oss);
               prompt();
               return *this;
             }
@@ -2956,12 +3381,50 @@ namespace xfst {
 
       hfst::HfstTwoLevelPaths paths;
       tmp->extract_random_paths(paths, number);
-      print_paths(paths, outfile);
+      print_paths(paths, oss);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
+
+  std::ostream * XfstCompiler::get_stream(std::ostream * oss)
+  {
+#ifdef WINDOWS
+    if (output_to_console_)
+      {
+        if (oss == &std::cerr)
+          return &winoss_stderr_;
+        if (oss == &std::cout)
+          return &winoss_stdout_;
+      }
+#endif
+    return oss;
+  }
+
+  void XfstCompiler::flush(std::ostream * oss)
+  {
+#ifdef WINDOWS
+    if (output_to_console_)
+      {
+        if (oss == &winoss_stderr_)
+          {
+            hfst_fprintf_console(stderr, winoss_stderr_.str().c_str());
+            winoss_stderr_.str("");
+            return;
+          }
+        if (oss == &winoss_stdout_)
+          {
+            hfst_fprintf_console(stdout, winoss_stdout_.str().c_str());
+            winoss_stdout_.str("");
+            return;
+          }
+      }
+#endif
+  }
+
   XfstCompiler& 
-  XfstCompiler::print_name(FILE* outfile)
+  XfstCompiler::print_name(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       GET_TOP(tmp);
 
       for (std::map<std::string, HfstTransducer*>::const_iterator it 
@@ -2969,49 +3432,94 @@ namespace xfst {
         {
           if (tmp == it->second)
             {
-              hfst_fprintf(outfile, "Name: %s\n", it->first.c_str());
+              *oss << "Name " << it->first << std::endl;
+              //hfst_fprintf(outfile, "Name: %s\n", it->first.c_str());
+              flush(oss);
               PROMPT_AND_RETURN_THIS;
             }
         }
 
-      hfst_fprintf(outfile, "No name.\n");
+      *oss << "No name." << std::endl;
+      //hfst_fprintf(outfile, "No name.\n");
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
+
+  XfstCompiler&
+  XfstCompiler::view_net()
+  {
+#ifdef WINDOWS
+    error() << "view net not implemented for windows" << std::endl;
+    flush(&error());
+    PROMPT_AND_RETURN_THIS;
+#else
+    GET_TOP(tmp);
+    char * dotfilename = tempnam(NULL, "hfst");
+    char * pngfilename = tempnam(NULL, "hfst");
+    if (false || verbose_)
+      {
+        error() << "Writing net in dot format to temporary file '" << dotfilename << "'." << std::endl;
+        flush(&error());
+      }
+    FILE * dotfile = fopen(dotfilename, "wb");
+    hfst::print_dot(dotfile, *tmp);
+    fclose(dotfile);
+    if (false || verbose_)
+      {
+        error() << "Wrote net, closing file and converting into png format." << std::endl;
+        flush(&error());
+      }
+    if (::system(("dot -Tpng " + std::string(dotfilename) + " > " + std::string(pngfilename) + " 2> /dev/null" ).c_str()) != 0)
+      {
+        error() << "Converting failed." << std::endl;
+        flush(&error());
+        xfst_lesser_fail();
+      }
+    if (false || verbose_)
+      {
+        error() << "Converted to png format, viewing the graph." << std::endl;
+        flush(&error());
+      }
+    if (::system(("/usr/bin/xdg-open " + std::string(pngfilename) + " 2> /dev/null &").c_str()) != 0)
+      {
+        error() << "Viewing failed." << std::endl;
+        flush(&error());
+        xfst_lesser_fail();
+      }
+    PROMPT_AND_RETURN_THIS;
+#endif // WINDOWS
+  }
+
   XfstCompiler& 
-  XfstCompiler::print_net(FILE* outfile)
+  XfstCompiler::print_net(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       GET_TOP(tmp);
       HfstBasicTransducer basic(*tmp);
-#ifdef WINDOWS
-      if (output_to_console_ && (outfile == stdout))
-        {
-          std::ostringstream ostr;
-          basic.write_in_xfst_format(ostr, variables_["print-weight"] == "ON");
-          hfst_fprintf(outfile, ostr.str().c_str());
-        }
-      else
-#endif
-        {
-          basic.write_in_xfst_format(outfile, variables_["print-weight"] == "ON");
-        }
+      basic.write_in_xfst_format(*oss, variables_["print-weight"] == "ON");
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_net(const char* name, FILE* outfile)
+  XfstCompiler::print_net(const char* name, std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       //hfst_fprintf(outfile, "missing print net %s:%d\n", __FILE__, __LINE__);
       std::map<std::string,hfst::HfstTransducer*>::const_iterator it =
         definitions_.find(name);
       if (it == definitions_.end())
         {
-          hfst_fprintf(stderr, "no such defined network: '%s'\n", name);
+          error() << "no such defined network: '" << name << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(stderr, "no such defined network: '%s'\n", name);
           PROMPT_AND_RETURN_THIS;
         }
       else
         {
           HfstBasicTransducer basic(*(it->second));
-          basic.write_in_xfst_format(outfile, variables_["print-weight"] == "ON");
+          basic.write_in_xfst_format(*oss, variables_["print-weight"] == "ON");
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -3025,25 +3533,27 @@ namespace xfst {
   }
 
   void XfstCompiler::print_alphabet
-  (const StringSet & alpha, bool unknown, bool identity, FILE* outfile)
+  (const StringSet & alpha, bool unknown, bool identity, std::ostream * oss_)
   {
+    std::ostream * oss = get_stream(oss_);
     unsigned int sigma_count=0;
-    hfst_fprintf(outfile, "Sigma: ");
+    *oss << "Sigma: ";
+    //hfst_fprintf(outfile, "Sigma: ");
     if (variables_["print-foma-sigma"] == "ON")
       {
         if (unknown)
-          hfst_fprintf(outfile, "?");
+          *oss << "?"; // hfst_fprintf(outfile, "?");
         if (identity)
           {
             if (unknown)
-              hfst_fprintf(outfile, ", ");
-            hfst_fprintf(outfile, "@");
+              *oss << ", "; //hfst_fprintf(outfile, ", ");
+            *oss << "@"; // hfst_fprintf(outfile, "@");
           }
       }
     else // xfst-style sigma print
       {
         if (unknown || identity)
-          hfst_fprintf(outfile, "?");
+          *oss << "?"; //hfst_fprintf(outfile, "?");
       }
 
     bool first_symbol = true;
@@ -3052,19 +3562,22 @@ namespace xfst {
         if (! is_special_symbol(*it)) 
           {
             if (!first_symbol || unknown || identity)
-              hfst_fprintf(outfile, ", ");
+              *oss << ", "; //hfst_fprintf(outfile, ", ");
             if (*it == "?")
-              hfst_fprintf(outfile, "\"?\"");
+              *oss << "\"?\""; //hfst_fprintf(outfile, "\"?\"");
             else if (*it == "@" && variables_["print-foma-sigma"] == "ON")
-              hfst_fprintf(outfile, "\"@\"");
+              *oss << "\"@\""; //hfst_fprintf(outfile, "\"@\"");
             else
-              hfst_fprintf(outfile, "%s", it->c_str());
+              *oss << *it; //hfst_fprintf(outfile, "%s", it->c_str());
             sigma_count++;
             first_symbol = false;
           }
       }
-    hfst_fprintf(outfile, "\n");
-    hfst_fprintf(outfile, "Size: %d.\n", sigma_count);
+    *oss << std::endl;
+    *oss << "Size: " << sigma_count << "." << std::endl;
+    flush(oss);
+    //hfst_fprintf(outfile, "\n");
+    //hfst_fprintf(outfile, "Size: %d.\n", sigma_count);
   }
 
   static bool is_unknown_or_identity_used_in_transducer
@@ -3102,8 +3615,9 @@ namespace xfst {
 
   // todo: flags?
   XfstCompiler& 
-  XfstCompiler::print_sigma(FILE* outfile, bool prompt)
+  XfstCompiler::print_sigma(std::ostream * oss_, bool prompt)
     {
+      std::ostream * oss = get_stream(oss_);
       GET_TOP(t);
       hfst::StringSet alpha = t->get_alphabet();
 
@@ -3112,58 +3626,83 @@ namespace xfst {
       bool identity = false;
       (void)is_unknown_or_identity_used_in_transducer(t, unknown, identity);
 
-      print_alphabet(alpha, unknown, identity, outfile);
+      print_alphabet(alpha, unknown, identity, oss);
       if (prompt) {
         this->prompt(); }
+      flush(oss);
       return *this;
     }
 
   XfstCompiler& 
-  XfstCompiler::print_sigma(const char* /*name*/, FILE* outfile)
+  XfstCompiler::print_sigma(const char* /*name*/, std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing print sigma %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing print sigma" << std::endl;
+      //hfst_fprintf(outfile, "missing print sigma %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_sigma_count(FILE* outfile)
+  XfstCompiler::print_sigma_count(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing print sigma count %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing print sigma count" << std::endl;
+      //hfst_fprintf(outfile, "missing print sigma count %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_sigma_word_count(const char* level, FILE* outfile)
+  XfstCompiler::print_sigma_word_count(const char* level, std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing %s sigma word count %s:%d\n", level,
-              __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing " << level << " sigma word count" << std::endl;
+      //hfst_fprintf(outfile, "missing %s sigma word count %s:%d\n", level,
+      //        __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_sigma_word_count(FILE* outfile)
+  XfstCompiler::print_sigma_word_count(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing sigma word count %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing sigma word count" << std::endl;
+      //hfst_fprintf(outfile, "missing sigma word count %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_size(const char* name, FILE* outfile)
-    {
-      hfst_fprintf(outfile, "%10s: ", name);
-      hfst_fprintf(outfile, "? bytes. ? states, ? arcs, ? paths.\n");
+  XfstCompiler::print_size(const char* name, std::ostream * oss_)
+    {
+      std::ostream * oss = get_stream(oss_);
+      // HERE
+      oss->width(10);
+      *oss << name << ": " << "? bytes. ? states, ? arcs, ? paths." << std::endl;
+      //hfst_fprintf(outfile, "%10s: ", name);
+      //hfst_fprintf(outfile, "? bytes. ? states, ? arcs, ? paths.\n");
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_size(FILE* outfile)
+  XfstCompiler::print_size(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "? bytes. ? states, ? arcs, ? paths.\n");
+      std::ostream * oss = get_stream(oss_);
+      *oss << "? bytes. ? states, ? arcs, ? paths." << std::endl;
+      //hfst_fprintf(outfile, "? bytes. ? states, ? arcs, ? paths.\n");
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::print_stack(FILE* outfile)
+  XfstCompiler::print_stack(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       stack<HfstTransducer*> tmp;
       int i = 0;
       while (!stack_.empty())
         {
-          hfst_fprintf(outfile, "%10d: ? bytes. ? states, ? arcs, ? paths.\n", i);
+          // HERE
+          oss->width(10);
+          *oss << i << ": ? bytes. ? states, ? arcs, ? paths." << std::endl;
+          //hfst_fprintf(outfile, "%10d: ? bytes. ? states, ? arcs, ? paths.\n", i);
           tmp.push(stack_.top());
           stack_.pop();
           i++;
@@ -3173,27 +3712,53 @@ namespace xfst {
           stack_.push(tmp.top());
           tmp.pop();
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
-        
   XfstCompiler& 
-  XfstCompiler::write_dot(FILE* outfile)
+  XfstCompiler::write_dot(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing write dot %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      if (stack_.size() < 1)
+        {
+          EMPTY_STACK;
+          xfst_lesser_fail();
+          PROMPT_AND_RETURN_THIS;
+        }
+      GET_TOP(tmp);
+      hfst::print_dot(*oss, *tmp);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler&
-  XfstCompiler::write_dot(const char* /*name*/, FILE* outfile)
-    {
-      hfst_fprintf(outfile, "missing write dot %s:%d\n", __FILE__, __LINE__);
-      PROMPT_AND_RETURN_THIS;
-    }
+  XfstCompiler::write_dot(const char* name, std::ostream * oss_)
+  {
+    if (stack_.size() < 1)
+      {
+        EMPTY_STACK;
+        xfst_lesser_fail();
+        PROMPT_AND_RETURN_THIS;
+      }
+    FILE * outfile = fopen(name, "wb");
+    if (outfile == NULL)
+      {
+        error() << "Could not open file " << name << std::endl;
+        flush(&error());
+        xfst_fail();
+        PROMPT_AND_RETURN_THIS;
+      }
+    GET_TOP(tmp);
+    hfst::print_dot(outfile, *tmp);
+    PROMPT_AND_RETURN_THIS;
+  }
   XfstCompiler& 
-  XfstCompiler::write_prolog(FILE* outfile)
+  XfstCompiler::write_prolog(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       if (stack_.size() < 1)
         {
-          hfst_fprintf(stderr, "Empty stack.\n");
+          EMPTY_STACK;
+          //hfst_fprintf(stderr, "Empty stack.\n");
           xfst_lesser_fail();
           PROMPT_AND_RETURN_THIS;
         }
@@ -3205,9 +3770,9 @@ namespace xfst {
           if (name == "")
             name = "NO_NAME";
           HfstBasicTransducer fsm(*tr);
-          fsm.write_in_prolog_format(outfile, name, variables_["print-weight"] == "ON");
+          fsm.write_in_prolog_format(*oss, name, variables_["print-weight"] == "ON");
           if (stack_.size() != 1) // separator
-            hfst_fprintf(outfile, "\n");
+            *oss << std::endl; //hfst_fprintf(outfile, "\n");
           reverse_stack.push(tr);
           stack_.pop();
         }
@@ -3217,18 +3782,25 @@ namespace xfst {
           stack_.push(tr);
           reverse_stack.pop();
         }
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::write_spaced(FILE* outfile)
+  XfstCompiler::write_spaced(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing write spaced %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing write spaced" << std::endl;
+      //hfst_fprintf(outfile, "missing write spaced %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::write_text(FILE* outfile)
+  XfstCompiler::write_text(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing write text %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing write text" << std::endl;
+      //hfst_fprintf(outfile, "missing write text %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
@@ -3245,7 +3817,9 @@ namespace xfst {
     {
       if (definitions_.find(name) == definitions_.end())
         {
-          hfst_fprintf(stderr, "no such defined network: '%s'\n", name);
+          error() << "no such defined network: '" << name << "'" << std::endl;
+          flush(&error());
+          //hfst_fprintf(stderr, "no such defined network: '%s'\n", name);
           PROMPT_AND_RETURN_THIS;
         }
 
@@ -3265,7 +3839,9 @@ namespace xfst {
     {
       if (definitions_.empty())
         {
-          hfst_fprintf(stderr, "no defined networks\n");
+          error() << "no defined networks" << std::endl;
+          flush(&error());
+          //hfst_fprintf(stderr, "no defined networks\n");
           PROMPT_AND_RETURN_THIS;
         }
 
@@ -3290,7 +3866,8 @@ namespace xfst {
     {
     if (stack_.size() < 1)
       {
-        hfst_fprintf(stderr, "Empty stack.\n");
+        EMPTY_STACK;
+        //hfst_fprintf(stderr, "Empty stack.\n");
         xfst_lesser_fail();
         return *this;
       }
@@ -3350,7 +3927,7 @@ namespace xfst {
       read = fread(file_data, sizeof(char), MAX_FILE_SIZE, infile);
       if ((read > 0) && (read < MAX_FILE_SIZE) && (feof(infile)))
         {
-          compiled = xre_.compile(file_data);
+          compiled = xre_.compile(file_data);  // XRE
           if (compiled != NULL)
             {
               MAYBE_MINIMIZE(compiled);
@@ -3358,14 +3935,18 @@ namespace xfst {
             }
           else
             {
-              hfst_fprintf(errorstream_, "Error when compiling file:\n%s\n",
-                      xre_.get_error_message().c_str());
+              *error_<< "Error when compiling regex file." << std::endl;
+              //       << xre_.get_error_message() << std::endl;
+              //hfst_fprintf(errorstream_, "Error when compiling file:\n%s\n",
+              //        xre_.get_error_message().c_str());
               xfst_fail();
             }
         }
       else if (!feof(infile))
         {
-          hfst_fprintf(stderr, "regex file longer than buffer :-(\n");
+          error() << "regex file longer than buffer :-(" << std::endl;
+          flush(&error());
+          //hfst_fprintf(stderr, "regex file longer than buffer :-(\n");
         }
       if (compiled != NULL)
         {
@@ -3381,7 +3962,7 @@ namespace xfst {
       {
         delete latest_regex_compiled;
       }
-    latest_regex_compiled = xre_.compile_first(indata, chars_read);
+    latest_regex_compiled = xre_.compile_first(indata, chars_read);  // XRE
     return *this;
   }
 
@@ -3400,8 +3981,11 @@ namespace xfst {
         }
       else
         {
-          hfst_fprintf(errorstream_, "Error reading regex '%s':\n%s\n", indata, 
-                  xre_.get_error_message().c_str());
+          error() << "Error reading regex '" << indata << "'." << std::endl;
+          flush(&error());
+          //        << xre_.get_error_message() << std::endl;
+          //hfst_fprintf(errorstream_, "Error reading regex '%s':\n%s\n", indata, 
+          //        xre_.get_error_message().c_str());
           xfst_fail();
         }
       PROMPT_AND_RETURN_THIS;
@@ -3419,14 +4003,18 @@ namespace xfst {
       } 
       catch (const NotValidPrologFormatException & e)
         {
-          hfst_fprintf(errorstream_, "%s\n", e().c_str());
+          error() << e() << std::endl;
+          flush(&error());
+          //hfst_fprintf(errorstream_, "%s\n", e().c_str());
           PROMPT_AND_RETURN_THIS;
         }
     }
   XfstCompiler& 
   XfstCompiler::read_prolog(const char* /* indata */)
     {
-      hfst_fprintf(stderr, "missing read prolog %s:%d\n", __FILE__, __LINE__);
+      error() << "missing read prolog" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "missing read prolog %s:%d\n", __FILE__, __LINE__);
       PRINT_INFO_PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
@@ -3437,16 +4025,20 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::read_spaced(const char* /* indata */)
     {
-      hfst_fprintf(stderr, "missing read spaced %s:%d\n", __FILE__, __LINE__);
+      error() << "missing read spaced" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "missing read spaced %s:%d\n", __FILE__, __LINE__);
       PRINT_INFO_PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
   XfstCompiler::read_text_or_spaced(const char * filename, bool spaces)
   {
-    FILE * infile = hfst::xfst::xfst_fopen(filename, "r");
+    FILE * infile = fopen(filename, "r");
     if (infile == NULL)
       {
-        hfst_fprintf(errorstream_, "cannot read text file\n");
+        error() << "Could not open file " << filename << std::endl;
+        flush(&error());
+        xfst_fail();
         prompt();
         return *this;
       }
@@ -3465,7 +4057,13 @@ namespace xfst {
         free(line);
       }
     
-    hfst::xfst::xfst_fclose(infile, filename);
+    if (0 != fclose(infile))
+      {
+        error() << "Could not close file " << filename << std::endl;
+        flush(&error());
+        xfst_fail();
+      }
+      
     tmp->minimize();
     stack_.push(tmp);
     PRINT_INFO_PROMPT_AND_RETURN_THIS;
@@ -3478,17 +4076,22 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::read_text(const char* /* indata */)
     {
-      hfst_fprintf(stderr, "missing read text %s:%d\n", __FILE__, __LINE__);
+      error() << "missing read text" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "missing read text %s:%d\n", __FILE__, __LINE__);
       PRINT_INFO_PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler& 
   XfstCompiler::cleanup_net()
     {
-      hfst_fprintf(stderr, "cannot cleanup net %s:%d\n", __FILE__, __LINE__);
+      error() << "cannot cleanup net" << std::endl;
+      flush(&error());
+      //hfst_fprintf(stderr, "cannot cleanup net %s:%d\n", __FILE__, __LINE__);
       if (stack_.size() < 1)
         {
-          hfst_fprintf(stderr, "Empty stack.\n");
+          EMPTY_STACK;
+          //hfst_fprintf(stderr, "Empty stack.\n");
           xfst_lesser_fail();
           return *this;
         }
@@ -3570,7 +4173,9 @@ namespace xfst {
             result->prune();
             break;
           default:
-            hfst_fprintf(errorstream_, "ERROR: unknown unary operation\n");
+            error() << "ERROR: unknown unary operation" << std::endl;
+            flush(&error());
+            //hfst_fprintf(errorstream_, "ERROR: unknown unary operation\n");
             break;
           }
 
@@ -3580,7 +4185,9 @@ namespace xfst {
       }
     catch (const FunctionNotImplementedException & e)
       {
-        hfst_fprintf(stderr, "function not available.\n");
+        error() << "function not available" << std::endl;
+        flush(&error());
+        //hfst_fprintf(stderr, "function not available.\n");
         xfst_fail();
         stack_.push(result);
       }
@@ -3593,8 +4200,10 @@ namespace xfst {
   {
       if (stack_.size() < 2)
         {
-          hfst_fprintf(stderr, "Not enough networks on stack. "
-                  "Operation requires at least 2.\n");
+          error() << "Not enough networks on stack. Operation requires at least 2." << std::endl;
+        flush(&error());
+          //hfst_fprintf(stderr, "Not enough networks on stack. "
+          //        "Operation requires at least 2.\n");
           xfst_lesser_fail();
           return *this;
         }
@@ -3619,7 +4228,9 @@ namespace xfst {
             }
           catch (const TransducersAreNotAutomataException & e)
             {
-              hfst_fprintf(stderr, "transducers are not automata\n");
+              error() << "transducers are not automata" << std::endl;
+        flush(&error());
+              //hfst_fprintf(stderr, "transducers are not automata\n");
               xfst_fail();
               stack_.push(another);
               stack_.push(result);
@@ -3628,7 +4239,9 @@ namespace xfst {
               break;
             }
         default:
-          hfst_fprintf(errorstream_, "ERROR: unknown binary operation\n");
+          error() << "ERROR: unknown binary operation" << std::endl;
+        flush(&error());
+          //hfst_fprintf(errorstream_, "ERROR: unknown binary operation\n");
           xfst_fail();
           break;
         }
@@ -3645,7 +4258,9 @@ namespace xfst {
   {
     if (stack_.size() < 2)
       {
-        hfst_fprintf(stderr, "Not enough transducers on stack, operation requires at least 2.\n");
+        error() << "Not enough networks on stack. Operation requires at least 2." << std::endl;
+        flush(&error());
+        //hfst_fprintf(stderr, "Not enough transducers on stack, operation requires at least 2.\n");
         xfst_lesser_fail();
         return *this;
       }
@@ -3659,7 +4274,9 @@ namespace xfst {
 
         if (t->get_type() != result->get_type())
           {
-            hfst_fprintf(stderr, "Stack contains transducers whose type differs.\n");
+            error() << "Stack contains transducers whose type differs." << std::endl;
+        flush(&error());
+            //hfst_fprintf(stderr, "Stack contains transducers whose type differs.\n");
             xfst_lesser_fail();
             break;
           }
@@ -3680,8 +4297,10 @@ namespace xfst {
                     {
                       if (verbose_)
                         {
-                          hfst_fprintf(warnstream_, "Both composition arguments contain flag diacritics. "
-                                       "Set harmonize-flags ON to harmonize them.\n");
+                          error() << "Both composition arguments contain flag diacritics. Set harmonize-flags ON to harmonize them." << std::endl;
+        flush(&error());
+                          //hfst_fprintf(warnstream_, "Both composition arguments contain flag diacritics. "
+                          //             "Set harmonize-flags ON to harmonize them.\n");
                           // xfst_lesser_fail(); ???
                         }
                     }
@@ -3697,9 +4316,13 @@ namespace xfst {
                 }
               catch (const FlagDiacriticsAreNotIdentitiesException & e)
                 {
-                  hfst_fprintf(outstream_, "Error: flag diacritics must be identities in composition if flag-is-epsilon is ON.\n"
-                               "I.e. only FLAG:FLAG is allowed, not FLAG1:FLAG2, FLAG:bar or foo:FLAG\n"
-                               "Apply twosided flag-diacritics (tfd) before composition.\n");
+                  error() << "Error: flag diacritics must be identities in composition if flag-is-epsilon is ON." << std::endl
+                          << "I.e. only FLAG:FLAG is allowed, not FLAG1:FLAG2, FLAG:bar or foo:FLAG" << std::endl
+                          << "Apply twosided flag-diacritics (tfd) before composition." << std::endl;
+        flush(&error());
+                  //hfst_fprintf(outstream_, "Error: flag diacritics must be identities in composition if flag-is-epsilon is ON.\n"
+                  //             "I.e. only FLAG:FLAG is allowed, not FLAG1:FLAG2, FLAG:bar or foo:FLAG\n"
+                  //             "Apply twosided flag-diacritics (tfd) before composition.\n");
                   xfst_lesser_fail();
                   prompt();
                   return *this;
@@ -3717,7 +4340,9 @@ namespace xfst {
             result->shuffle(*t);
             break;
           default:
-            hfst_fprintf(errorstream_, "ERROR: unknown binary operation\n");
+            error() << "ERROR: unknown binary operation" << std::endl;
+        flush(&error());
+            //hfst_fprintf(errorstream_, "ERROR: unknown binary operation\n");
             break;
           }
         stack_.pop();
@@ -3815,7 +4440,8 @@ namespace xfst {
     {
       if (stack_.size() < 1)
         {
-          hfst_fprintf(stderr, "Empty stack.\n");
+          EMPTY_STACK;
+          //hfst_fprintf(stderr, "Empty stack.\n");
           xfst_lesser_fail();
           return *this;
         }
@@ -3829,7 +4455,8 @@ namespace xfst {
     {
       if (stack_.size() < 1)
         {
-          hfst_fprintf(stderr, "Empty stack.\n");
+          EMPTY_STACK;
+          //hfst_fprintf(stderr, "Empty stack.\n");
           xfst_lesser_fail();
           return *this;
         }
@@ -3900,13 +4527,17 @@ namespace xfst {
   XfstCompiler& 
   XfstCompiler::sort_net()
     {
-      hfst_fprintf(stderr, "cannot sort net %s:%d\n", __FILE__, __LINE__);
+      error() << "missing sort net" << std::endl;
+        flush(&error());
+      //hfst_fprintf(stderr, "cannot sort net %s:%d\n", __FILE__, __LINE__);
       PRINT_INFO_PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
   XfstCompiler::substring_net()
     {
-      hfst_fprintf(stderr, "missing substring net %s:%d\n", __FILE__, __LINE__);
+      error() << "missing substring net" << std::endl;
+        flush(&error());
+      //hfst_fprintf(stderr, "missing substring net %s:%d\n", __FILE__, __LINE__);
       PRINT_INFO_PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler&
@@ -3916,17 +4547,21 @@ namespace xfst {
     }
 
   XfstCompiler&
-  XfstCompiler::print_file_info(FILE* outfile)
+  XfstCompiler::print_file_info(std::ostream * oss)
     {
-      hfst_fprintf(outfile, "file info not implemented (cf. summarize) %s:%d\n",
-              __FILE__, __LINE__);
+      error() << "file info not implemented (cf. summarize)" << std::endl;
+        flush(&error());
+      //hfst_fprintf(outfile, "file info not implemented (cf. summarize) %s:%d\n",
+      //        __FILE__, __LINE__);
       PROMPT_AND_RETURN_THIS;
     }
 
   XfstCompiler&
-  XfstCompiler::print_properties(const char* /* name */, FILE* outfile)
+  XfstCompiler::print_properties(const char* /* name */, std::ostream * oss)
     {
-      hfst_fprintf(outfile, "missing print properties %s:%d\n", __FILE__, __LINE__);
+      error() << "missing print properties" << std::endl;
+        flush(&error());
+      //hfst_fprintf(outfile, "missing print properties %s:%d\n", __FILE__, __LINE__);
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -3942,28 +4577,36 @@ namespace xfst {
       {
         if (first_loop) 
           {
-            hfst_fprintf(outstream_, "Arcs:");
+            output() << "Arcs:";
+            //hfst_fprintf(outstream_, "Arcs:");
             first_loop = false;
           }
         else
           {
-            hfst_fprintf(outstream_, ", ");
+            output() << ", ";
+            //hfst_fprintf(outstream_, ", ");
           }
+        flush(&output());
         std::string isymbol = it->get_input_symbol();
         std::string osymbol = it->get_output_symbol();
 
         if (isymbol == osymbol)
           {
-            hfst_fprintf(outstream_, " %i. %s", arc_number, isymbol.c_str());
+            output() << " " << arc_number << ". " << isymbol;
+            //hfst_fprintf(outstream_, " %i. %s", arc_number, isymbol.c_str());
           }
         else
           {
-            hfst_fprintf(outstream_, " %i. %s:%s", arc_number, 
-                    isymbol.c_str(), osymbol.c_str());
+            output() << " " << arc_number << ". " << isymbol << ":" << osymbol;
+            //hfst_fprintf(outstream_, " %i. %s:%s", arc_number, 
+            //        isymbol.c_str(), osymbol.c_str());
           }
+        flush(&output());
         arc_number++;
       }
-    hfst_fprintf(outstream_, "\n");
+    output() << std::endl;
+    flush(&output());
+    //hfst_fprintf(outstream_, "\n");
     return arc_number - 1;
   }
 
@@ -3972,11 +4615,14 @@ namespace xfst {
   (const std::vector<unsigned int> & whole_path,
    const std::vector<unsigned int> & shortest_path)
   {
-    hfst_fprintf(outstream_, "Level %i", (int)whole_path.size());
+    output() << "Level " << (int)whole_path.size();
+    //hfst_fprintf(outstream_, "Level %i", (int)whole_path.size());
     if (shortest_path.size() < whole_path.size())
       {
-        hfst_fprintf(outstream_, " (= %i)", (int)shortest_path.size());
+        output() << " (= " << (int)shortest_path.size() << ")";
+        //hfst_fprintf(outstream_, " (= %i)", (int)shortest_path.size());
       }
+    flush(&output());
   }
 
   // For 'inspect_net': append state \a state to paths.
@@ -4054,7 +4700,9 @@ namespace xfst {
       }
 #endif
 
-    hfst_fprintf(outstream_, "%s", promptstr.c_str());
+    output() << promptstr;
+    flush(&output());
+    //hfst_fprintf(outstream_, "%s", promptstr.c_str());
 
 #ifdef WINDOWS
     // if we are reading directly from console
@@ -4131,16 +4779,20 @@ namespace xfst {
   {
     if (number == EOF || number == 0)
       {
-        hfst_fprintf(outstream_, "could not read arc number\n");
+        output() << "could not read arc number" << std::endl;
+        flush(&output());
+        //hfst_fprintf(outstream_, "could not read arc number\n");
         return false;
       }
     else if (number < 1 || number > number_of_arcs)
       {
         if (number_of_arcs < 1) 
-          hfst_fprintf(outstream_, "state has no arcs\n");
+          output() << "state has no arcs" << std::endl; //hfst_fprintf(outstream_, "state has no arcs\n");
         else 
-          hfst_fprintf(outstream_, "arc number must be between %i and %i\n",
-                  1, number_of_arcs);
+          output() << "arc number must be between 1 and " << number_of_arcs << std::endl; 
+        // hfst_fprintf(outstream_, "arc number must be between %i and %i\n",
+        //          1, number_of_arcs);
+        flush(&output());
         return false;
       }
     return true;
@@ -4151,14 +4803,18 @@ namespace xfst {
   {
     if (level == EOF || level == 0)
       {
-        hfst_fprintf(outstream_, "could not read level number "
-                "(type '0' if you wish to exit program)\n");
+        output() << "could not read level number (type '0' if you wish to exit program)" << std::endl;
+        flush(&output());
+        //hfst_fprintf(outstream_, "could not read level number "
+        //        "(type '0' if you wish to exit program)\n");
         return false;
       }
     else if (level < 0 || level > whole_path_length)
       {
-        hfst_fprintf(outstream_, "no such level: '%i' (current level is %i)\n",
-                level, (int)whole_path_length );
+        output() << "no such level: '" << level << "' (current lievel is " << (int)whole_path_length << ")" << std::endl;
+        flush(&output());
+        //hfst_fprintf(outstream_, "no such level: '%i' (current level is %i)\n",
+        //        level, (int)whole_path_length );
         return false;
       }
     return true;
@@ -4175,7 +4831,8 @@ namespace xfst {
 
       HfstBasicTransducer net(*t);
 
-      hfst_fprintf(outstream_, "%s", inspect_net_help_msg);
+      output() << inspect_net_help_msg;
+      //hfst_fprintf(outstream_, "%s", inspect_net_help_msg);
 
       // path of states visited, can contain loops
       std::vector<unsigned int> whole_path;
@@ -4186,9 +4843,11 @@ namespace xfst {
       print_level(whole_path, shortest_path);
 
       if (net.is_final_state(0))
-        hfst_fprintf(outstream_, " (final)");
+        output() << " (final)"; //hfst_fprintf(outstream_, " (final)");
       
-      hfst_fprintf(outstream_, "\n");
+      output() << std::endl; //hfst_fprintf(outstream_, "\n");
+
+      flush(&output());
 
       // transitions of current state
       HfstBasicTransducer::HfstTransitions transitions = net[0];
@@ -4213,8 +4872,10 @@ namespace xfst {
               else if (! return_to_level(whole_path, shortest_path, 
                                          whole_path.size() - 1))
                 {
-                  hfst_fprintf(errorstream_, "FATAL ERROR: could not return to level '%i'\n", 
-                          (int)(whole_path.size() - 1));
+                  error() << "FATAL ERROR: could not return to level '" << (int)(whole_path.size() - 1) << "'" << std::endl; 
+        flush(&error());
+                  //hfst_fprintf(errorstream_, "FATAL ERROR: could not return to level '%i'\n", 
+                  //        (int)(whole_path.size() - 1));
                   ignore_history_after_index(ind);
                   PROMPT_AND_RETURN_THIS;
                 }
@@ -4229,7 +4890,9 @@ namespace xfst {
                 }
               else if (! return_to_level(whole_path, shortest_path, level))
                 {
-                  hfst_fprintf(errorstream_, "FATAL ERROR: could not return to level '%i'\n", level);
+                  error() << "FATAL ERROR: could not return to level '" << level << "'" << std::endl;
+        flush(&error());
+                  //hfst_fprintf(errorstream_, "FATAL ERROR: could not return to level '%i'\n", level);
                   ignore_history_after_index(ind);
                   PROMPT_AND_RETURN_THIS;
                 }
@@ -4251,8 +4914,9 @@ namespace xfst {
               else
                 {
                   HfstBasicTransition tr = transitions[number - 1];
-                  hfst_fprintf(outstream_, "  %s:%s --> ", tr.get_input_symbol().c_str(), 
-                          tr.get_output_symbol().c_str());
+                  output() << "  " << tr.get_input_symbol() << ":" << tr.get_output_symbol() << " --> ";
+                  //hfst_fprintf(outstream_, "  %s:%s --> ", tr.get_input_symbol().c_str(), 
+                  //        tr.get_output_symbol().c_str());
                   append_state_to_paths(whole_path, shortest_path, tr.get_target_state());
                 }
             }
@@ -4262,14 +4926,17 @@ namespace xfst {
           print_level(whole_path, shortest_path);
           if (net.is_final_state(whole_path.back()))
             {
-              hfst_fprintf(outstream_, " (final)");
+              output() << " (final)";
+              //hfst_fprintf(outstream_, " (final)");
             }
-          hfst_fprintf(outstream_, "\n");
+          output() << std::endl;
+          //hfst_fprintf(outstream_, "\n");
           number_of_arcs = print_arcs(transitions);
 
           free(line);
         } // end of while loop
 
+      flush(&output());
       ignore_history_after_index(ind);
       PROMPT_AND_RETURN_THIS;
     }
@@ -4277,8 +4944,8 @@ namespace xfst {
   // Returns an automaton that contains one ore more "^[" "^]" expressions.
   static HfstTransducer * contains_regexps(hfst::xre::XreCompiler & xre_)
   {
-    HfstTransducer * not_bracket_star = xre_.compile("[? - \"^[\" - \"^]\"]* ;");
-    xre_.define("TempNotBracketStar", *not_bracket_star);
+    HfstTransducer * not_bracket_star = xre_.compile("[? - \"^[\" - \"^]\"]* ;");  // XRE
+    xre_.define("TempNotBracketStar", *not_bracket_star);  // XRE
     // all paths that contain one or more well-formed ^[ ^] expressions
     HfstTransducer * well_formed = xre_.compile("TempNotBracketStar \"^[\" TempNotBracketStar  [ \"^]\" TempNotBracketStar \"^[\"  TempNotBracketStar ]*  \"^]\" TempNotBracketStar ;");
     xre_.undefine("TempNotBracketStar");
@@ -4286,6 +4953,7 @@ namespace xfst {
     return well_formed;
   }
 
+  // XRE
   static HfstTransducer * contains_regexp_markers_on_one_side(hfst::xre::XreCompiler & xre_, bool input_side)
   {
     HfstTransducer * retval = NULL;
@@ -4301,7 +4969,7 @@ namespace xfst {
     return retval;
   }
 
-  // @pre \a t must be an automaton
+  // @pre \a t must be an automaton  XRE
   static bool is_well_formed_for_compile_replace(const HfstTransducer * t, hfst::xre::XreCompiler & xre_)
   {
     HfstTransducer * well_formed = contains_regexps(xre_);
@@ -4363,7 +5031,7 @@ namespace xfst {
     // debug
     //std::cerr << "to_literal_transducer: compiling expression: " << pathstr << std::endl;
     char * p = strdup(pathstr.c_str());
-    HfstTransducer * retval = xre_.compile(p);
+    HfstTransducer * retval = xre_.compile(p);  // XRE
     free(p);
     return retval;
   }
@@ -4406,13 +5074,15 @@ namespace xfst {
 
       if (is_well_formed_for_compile_replace(&tmp_cp, xre_))
         {
-          if (verbose_)
-            fprintf(stderr, "Network is well-formed.\n");
+          if (verbose_) {
+            error() << "Network is well-formed." << std::endl; //fprintf(stderr, "Network is well-formed.\n");
+            flush(&error()); }
         }
       else
         {
-          if (verbose_)
-            fprintf(stderr, "Network is not well-formed.\n");
+          if (verbose_) {
+            error() << "Network is not well-formed." << std::endl; //fprintf(stderr, "Network is not well-formed.\n");
+            flush(&error()); }
           xfst_lesser_fail();
           prompt();
           return *this;
@@ -4448,10 +5118,12 @@ namespace xfst {
                    char * cpr = strdup(CPR.c_str());
                    // debug
                    //fprintf(stderr, "compiling replacement '%s'...\n", cpr);
-                   HfstTransducer * replacement = xre_.compile(cpr);
+                   HfstTransducer * replacement = xre_.compile(cpr);  // XRE
                    if (replacement == NULL)
                      {
-                       fprintf(stderr, "Could not compile regular expression in compile-replace: %s.\n", cpr);
+                       error() << "Could not compile regular expression in compile-replace: " << cpr << "." << std::endl;
+        flush(&error());
+                       //fprintf(stderr, "Could not compile regular expression in compile-replace: %s.\n", cpr);
                        xfst_lesser_fail();
                        prompt();
                        return *this;
@@ -4490,7 +5162,9 @@ namespace xfst {
         }
       catch(const char * msg)
         {
-          fprintf(stderr, "compile_replace threw an error: '%s'\n", msg);
+          error() << "compile_replace threw an error: '" << msg << "'" << std::endl;
+        flush(&error());
+          //fprintf(stderr, "compile_replace threw an error: '%s'\n", msg);
         }
       HfstTransducer * result = new HfstTransducer(fsm, format_);
 
@@ -4529,7 +5203,9 @@ namespace xfst {
   XfstCompiler&
   XfstCompiler::hfst(const char* text)
     {
-      hfst_fprintf(stderr, "HFST: %s\n", text);
+      error() << "HFST: " << text << std::endl;
+        flush(&error());
+      //hfst_fprintf(stderr, "HFST: %s\n", text);
       PROMPT_AND_RETURN_THIS;
     }
 
@@ -4551,17 +5227,24 @@ namespace xfst {
           }
       }
 
-    FILE * infile = hfst::xfst::xfst_fopen(filename, "r");
+    FILE * infile = fopen(filename, "r");
     if (infile == NULL)
       {
-        hfst_fprintf(errorstream_, "could not read lexc file\n");
+        error() << "could not read lexc file" << std::endl;
+        flush(&error());
+        //hfst_fprintf(errorstream_, "could not read lexc file\n");
         xfst_fail();
         PROMPT_AND_RETURN_THIS;
       }
 
     lexc_.parse(infile);
     t = lexc_.compileLexical();
-    hfst::xfst::xfst_fclose(infile, filename);
+    if (0 != fclose(infile))
+      {
+        error() << "Could not close file " << filename << std::endl;
+        flush(&error());
+        xfst_fail();
+      }
 
     // using foma's lexc implementation
     /*if (! HfstTransducer::is_implementation_type_available(hfst::FOMA_TYPE))
@@ -4578,7 +5261,9 @@ namespace xfst {
     
     if (t == NULL)
       {
-        hfst_fprintf(errorstream_, "error compiling file in lexc format\n");
+        error() << "error compiling file in lexc format" << std::endl;
+        flush(&error());
+        //hfst_fprintf(errorstream_, "error compiling file in lexc format\n");
         xfst_fail();
         PROMPT_AND_RETURN_THIS;
       }
@@ -4592,10 +5277,12 @@ namespace xfst {
   XfstCompiler&
   XfstCompiler::read_att_from_file(const char * filename)
     {
-      FILE * infile = hfst::xfst::xfst_fopen(filename, "r");
+      FILE * infile = fopen(filename, "r");
       if (infile == NULL)
         {
-          hfst_fprintf(errorstream_, "could not read att file\n");
+          error() << "could not read att file " << filename << std::endl;
+        flush(&error());
+          //hfst_fprintf(errorstream_, "could not read att file\n");
           xfst_fail();
           PROMPT_AND_RETURN_THIS;
         }
@@ -4613,18 +5300,31 @@ namespace xfst {
         }
       catch (const HfstException & e)
         {
-          hfst::xfst::xfst_fclose(infile, filename);
-          hfst_fprintf(errorstream_, "error reading file in att format\n");
+          if (0 != fclose(infile)) {
+            error() << "Could not close file " << filename << std::endl;
+            flush(&error()); }
+
+          error() << "error reading in att format" << std::endl;
+        flush(&error());
+          //hfst_fprintf(errorstream_, "error reading file in att format\n");
+          xfst_fail();
+        }
+      if (0 != fclose(infile))
+        {
+          error() << "could not close att file " << filename << std::endl;
+        flush(&error());
           xfst_fail();
         }
-      hfst::xfst::xfst_fclose(infile, filename);
       PROMPT_AND_RETURN_THIS;
     }
   XfstCompiler& 
-  XfstCompiler::write_att(FILE* infile)
+  XfstCompiler::write_att(std::ostream * oss_)
     {
+      std::ostream * oss = get_stream(oss_);
       GET_TOP(tmp);
-      tmp->write_in_att_format(infile, variables_["print-weight"] == "ON");
+      HfstBasicTransducer fsm(*tmp);
+      fsm.write_in_att_format(*oss, variables_["print-weight"] == "ON");
+      flush(oss);
       PROMPT_AND_RETURN_THIS;
     }
   const std::stack<HfstTransducer*>&
@@ -4646,7 +5346,9 @@ namespace xfst {
       hxfstin = fopen(filename, "r");
       if (hxfstin == NULL)
         {
-          hfst_fprintf(stderr, "could not open %s for reading\n", filename);
+          error() << "could not open " << filename << " for reading" << std::endl;
+        flush(&error());
+          //hfst_fprintf(stderr, "could not open %s for reading\n", filename);
           return -1;
         }
       xfst_ = this;
@@ -4662,10 +5364,10 @@ namespace xfst {
     YY_BUFFER_STATE bs = hxfst_scan_string(line);
     int rv = hxfstparse();
     hxfst_delete_buffer(bs);
-    if (rv != 0)
+    /*if (rv != 0)
       {
         prompt();
-      }
+        }*/
     return rv;
   }
   int
@@ -4682,9 +5384,12 @@ namespace xfst {
   }
 
   XfstCompiler&
-  XfstCompiler::print_properties(FILE* outfile)
+  XfstCompiler::print_properties(std::ostream * oss_)
     {
-      hfst_fprintf(outfile, "missing print properties %s:%d\n", __FILE__, __LINE__);
+      std::ostream * oss = get_stream(oss_);
+      *oss << "missing print properties" << std::endl;
+      //hfst_fprintf(outfile, "missing print properties %s:%d\n", __FILE__, __LINE__);
+      flush(oss);
       return *this;
     }
   XfstCompiler&
@@ -4703,7 +5408,7 @@ namespace xfst {
   XfstCompiler::setOutputToConsole(bool value)
   {
     output_to_console_ = value;
-    hfst::print_output_to_console(output_to_console_);
+    //hfst::print_output_to_console(output_to_console_);
     return *this;
   }
   bool
@@ -4725,8 +5430,8 @@ namespace xfst {
   XfstCompiler::setVerbosity(bool verbosity)
     {
       verbose_ = verbosity;
-      xre_.set_verbosity(verbosity, stderr);
-      lexc_.setVerbosity(verbosity);
+      xre_.set_verbosity(verbosity);
+      lexc_.setVerbosity(this->verbose_ ? 2 : 0);
       return *this;
     }
   XfstCompiler&
@@ -4736,17 +5441,20 @@ namespace xfst {
     return *this;
   }
 
+  // CONSOLE
   const XfstCompiler&
-  XfstCompiler::prompt() const
+  XfstCompiler::prompt()
     {
       if (verbose_prompt_ && verbose_)
         {
           // On windows, prompt is always printed to console. On other platforms,
           // this has no effect.
-          bool val = hfst::is_output_printed_to_console();
-          hfst::print_output_to_console(true);
-          hfst_fprintf(outstream_, "hfst[" SIZE_T_SPECIFIER "]: ", stack_.size());
-          hfst::print_output_to_console(val);
+          //bool val = hfst::is_output_printed_to_console();
+          //hfst::print_output_to_console(true);
+          output() << "hfst[" << stack_.size() << "]: ";
+          flush(&output());
+          //hfst_fprintf(outstream_, "hfst[" SIZE_T_SPECIFIER "]: ", stack_.size());
+          //hfst::print_output_to_console(val);
         }
       return *this;
     }
@@ -4759,8 +5467,8 @@ namespace xfst {
     return strdup(p);
   }
 
-  const XfstCompiler&
-  XfstCompiler::print_transducer_info() const
+  XfstCompiler&
+  XfstCompiler::print_transducer_info()
     {
       if (verbose_ && !stack_.empty())
         {
@@ -4769,14 +5477,16 @@ namespace xfst {
             {
               return *this;
             }
-          hfst_fprintf(outstream_, "? bytes. %i states, %i arcs, ? paths\n",
-                  top->number_of_states(), top->number_of_arcs());
+          output() << "? bytes. " << top->number_of_states() << " states, " << top->number_of_arcs() << " arcs, ? paths" << std::endl;
+          //hfst_fprintf(outstream_, "? bytes. %i states, %i arcs, ? paths\n",
+          //        top->number_of_states(), top->number_of_arcs());
           std::map<std::string,std::string>::const_iterator it = variables_.find("print-sigma");
           if (it != variables_.end() && it->second == "ON")
             {
-              (const_cast<XfstCompiler*>(this))->print_sigma(outstream_, false /* no prompt*/);
+              (const_cast<XfstCompiler*>(this))->print_sigma(output_, false /* no prompt*/);
             }
         }
+      flush(&output());
       return *this;
     }
 
diff --git a/tools/src/parsers/XfstCompiler.h b/libhfst/src/parsers/XfstCompiler.h
similarity index 80%
rename from tools/src/parsers/XfstCompiler.h
rename to libhfst/src/parsers/XfstCompiler.h
index fc8c53b..ed12fac 100644
--- a/tools/src/parsers/XfstCompiler.h
+++ b/libhfst/src/parsers/XfstCompiler.h
@@ -178,6 +178,8 @@ class XfstCompiler
   XfstCompiler& set(const char* name, const char* text);
   //! @brief Set variable @c name = @c number
   XfstCompiler& set(const char* name, unsigned int number);
+  //! @brief Get variable \a name.
+  std::string get(const char* name);
   //! @brief Show named variable
   XfstCompiler& show(const char* name);
   //! @brief Show all variables
@@ -234,97 +236,99 @@ class XfstCompiler
   XfstCompiler& substitute_symbol(const char* list, const char* target);
 
   //! @brief Print aliases
-  XfstCompiler& print_aliases(FILE* outfile);
+  XfstCompiler& print_aliases(std::ostream * oss);
   //! @brief Print arc count for @a level
-  XfstCompiler& print_arc_count(const char* level, FILE* outfile);
+  XfstCompiler& print_arc_count(const char* level, std::ostream * oss);
   //! @brief Print arc count
-  XfstCompiler& print_arc_count(FILE* outfile);
+  XfstCompiler& print_arc_count(std::ostream * oss);
   //! @brief Print definition
-  XfstCompiler& print_defined(FILE* outfile);
+  XfstCompiler& print_defined(std::ostream * oss);
   //! @brief Print directory contents
-  XfstCompiler& print_dir(const char* glob, FILE* outfile);
+  XfstCompiler& print_dir(const char* glob, std::ostream * oss);
   //! @brief Print file info
-  XfstCompiler& print_file_info(FILE* outfile);
+  XfstCompiler& print_file_info(std::ostream * oss);
   //! @brief Print flag diacritics
-  XfstCompiler& print_flags(FILE* outfile);
+  XfstCompiler& print_flags(std::ostream * oss);
 
-  XfstCompiler& print_labels(FILE* outfile, HfstTransducer* tr);
+  XfstCompiler& print_labels(std::ostream * oss, HfstTransducer* tr);
 
   //! @brief Print labels in network @a name
-  XfstCompiler& print_labels(const char* name, FILE* outfile);
+  XfstCompiler& print_labels(const char* name, std::ostream * oss);
   //! @brief Print labels
-  XfstCompiler& print_labels(FILE* outfile);
+  XfstCompiler& print_labels(std::ostream * oss);
   //! @brief Print label mappings
-  XfstCompiler& print_labelmaps(FILE* outfile);
+  XfstCompiler& print_labelmaps(std::ostream * oss);
   //! @brief Print label count
-  XfstCompiler& print_label_count(FILE* outfile);
+  XfstCompiler& print_label_count(std::ostream * oss);
   //! @brief Print list named @a name
-  XfstCompiler& print_list(const char* name, FILE* outfile);
+  XfstCompiler& print_list(const char* name, std::ostream * oss);
   //! @brief Print all lists
-  XfstCompiler& print_list(FILE* outfile);
+  XfstCompiler& print_list(std::ostream * oss);
 
   XfstCompiler& shortest_string
     (const hfst::HfstTransducer* transducer, hfst::HfstTwoLevelPaths& paths);
 
   //! @brief Print shortest string of network
-  XfstCompiler& print_shortest_string(FILE* outfile);
+  XfstCompiler& print_shortest_string(std::ostream * oss);
   //! @brief Print length of shortest string
-  XfstCompiler& print_shortest_string_size(FILE* outfile);
+  XfstCompiler& print_shortest_string_size(std::ostream * oss);
   //! @brief Print longest string in network
-  XfstCompiler& print_longest_string(FILE* outfile);
+  XfstCompiler& print_longest_string(std::ostream * oss);
   //! @brief Print length of longest string
-  XfstCompiler& print_longest_string_size(FILE* outfile);
+  XfstCompiler& print_longest_string_size(std::ostream * oss);
   //! @brief Print strings of lower language
   XfstCompiler& print_lower_words(const char * name, unsigned int number,
-                                  FILE* outfile);
+                                  std::ostream * oss);
   //! @brief Print random strings of lower language
-  XfstCompiler& print_random_lower(const char * name, unsigned int number, FILE* outfile);
+  XfstCompiler& print_random_lower(const char * name, unsigned int number, std::ostream * oss);
   //! @brief Print astrings of upper language
   XfstCompiler& print_upper_words(const char * name, unsigned int number,
-                                  FILE* outfile);
+                                  std::ostream * oss);
   //! @brief Print random strings of upper language
-  XfstCompiler& print_random_upper(const char * name, unsigned int number, FILE* outfile);
+  XfstCompiler& print_random_upper(const char * name, unsigned int number, std::ostream * oss);
   //! @brief Print pair strings of language
   XfstCompiler& print_words(const char * name, unsigned int number,
-                            FILE* outfile);
+                            std::ostream * oss);
   //! @brief Print random pair strings of language
-  XfstCompiler& print_random_words(const char * name, unsigned int number, FILE* outfile);
+  XfstCompiler& print_random_words(const char * name, unsigned int number, std::ostream * oss);
   //! @brief Print name of top network
-  XfstCompiler& print_name(FILE* outfile);
+  XfstCompiler& print_name(std::ostream * oss);
+  //! @brief View top network
+  XfstCompiler& view_net();
   //! @brief Print network
-  XfstCompiler& print_net(FILE* outfile);
+  XfstCompiler& print_net(std::ostream * oss);
   //! @brief Print network named @a name
-  XfstCompiler& print_net(const char* name, FILE* outfile);
+  XfstCompiler& print_net(const char* name, std::ostream * oss);
   //! @brief Print properties of top network
-  XfstCompiler& print_properties(FILE* outfile);
+  XfstCompiler& print_properties(std::ostream * oss);
   //! @brief Print properties of network named @a name
-  XfstCompiler& print_properties(const char* name, FILE* outfile);
+  XfstCompiler& print_properties(const char* name, std::ostream * oss);
   //! @brief Print all symbols of network named @a name
-  XfstCompiler& print_sigma(const char* name, FILE* outfile);
+  XfstCompiler& print_sigma(const char* name, std::ostream * oss);
   //! @brief Print all symbols of network
-  XfstCompiler& print_sigma(FILE* outfile, bool prompt=true);
+  XfstCompiler& print_sigma(std::ostream * oss, bool prompt=true);
   //! @brief Print nnumber of symbols in network
-  XfstCompiler& print_sigma_count(FILE* outfile);
+  XfstCompiler& print_sigma_count(std::ostream * oss);
   //! @brief Print number of paths with all symbols on @a level
-  XfstCompiler& print_sigma_word_count(const char* level, FILE* outfile);
+  XfstCompiler& print_sigma_word_count(const char* level, std::ostream * oss);
   //! @brief Print number of paths with all symbols
-  XfstCompiler& print_sigma_word_count(FILE* outfile);
+  XfstCompiler& print_sigma_word_count(std::ostream * oss);
   //! @brief Print size of network named @a name
-  XfstCompiler& print_size(const char* name, FILE* outfile);
+  XfstCompiler& print_size(const char* name, std::ostream * oss);
   //! @brief Print size of top network
-  XfstCompiler& print_size(FILE* outfile);
+  XfstCompiler& print_size(std::ostream * oss);
   //! @brief Print all networks in stack
-  XfstCompiler& print_stack(FILE* outfile);
+  XfstCompiler& print_stack(std::ostream * oss);
   //! @brief Save @a name network in dot form in @a outfile
-  XfstCompiler& write_dot(const char* name, FILE* outfile);
+  XfstCompiler& write_dot(const char* name, std::ostream * oss);
   //! @brief Save top networks dot form in @a outfile
-  XfstCompiler& write_dot(FILE* outfile);
+  XfstCompiler& write_dot(std::ostream * oss);
   //! @brief Save top networks prolog form in @a outfile
-  XfstCompiler& write_prolog(FILE* outfile);
+  XfstCompiler& write_prolog(std::ostream * oss);
   //! @brief Save top networks spaced paths form in @a outfile
-  XfstCompiler& write_spaced(FILE* outfile);
+  XfstCompiler& write_spaced(std::ostream * oss);
   //! @brief Save top networks paths form in @a outfile
-  XfstCompiler& write_text(FILE* outfile);
+  XfstCompiler& write_text(std::ostream * oss);
   //! @brief Save function @a name in @a outfile
   //! @todo HFST does not support function macros in automata
   XfstCompiler& write_function(const char* name, const char* outfilename);
@@ -369,7 +373,7 @@ class XfstCompiler
   //! @brief Read a transducer in att format from file @a filename
   XfstCompiler& read_att_from_file(const char * filename);
   //! @brief Write top transducer in att format to @a outfile
-  XfstCompiler& write_att(FILE* outfile);
+  XfstCompiler& write_att(std::ostream * oss);
 
   //! @brief do some label pushing
   //! @todo HFST automata cannot push labels
@@ -498,10 +502,53 @@ class XfstCompiler
   //! @brief Define wheter prompts are printed.
   XfstCompiler& setPromptVerbosity(bool verbosity);
   //! @brief Explicitly print the prompt to stdout.
-  const XfstCompiler& prompt() const;
+  const XfstCompiler& prompt();
   //! @brief Get the prompt string.
   char* get_prompt() const;
 
+  //! @brief Whether it has been requested to quit the program.
+  //  Needed in interactive mode where user input is read line by line.
+  bool quit_requested() const;
+  //! @brief Handle unknown command \a s.
+  //  @return Whether the parser should go on, 0 signifying true. 
+  int unknown_command(const char * s);
+  // For xfst parser.
+  bool get_fail_flag() const;
+
+  /* Set the stream where error messages and warnings are printed. */
+  void set_error_stream(std::ostream & os);
+  /* Get the stream where error messages and warnings are printed. */
+  std::ostream & get_error_stream();
+  /* Set the stream where output is printed. */
+  void set_output_stream(std::ostream & os);
+  /* Get the stream where output is printed. */
+  std::ostream & get_output_stream();
+
+  /* A wrapper around file close function. */
+  int xfst_fclose(FILE * f, const char * name);
+  /* A wrapper around file open function. */
+  FILE * xfst_fopen(const char* path, const char* mode);
+
+  /* The following three functions are wrappers around output and error streams.
+     On Unix and Mac, output() and error() just return members output_ and error_,
+     and flush(std::ostream *) does nothing. On windows, it is possible that
+     output() and error() return an ostringstream which is actually printed when
+     flush(std::ostream *) is called. 
+
+     This delayed printing is needed because Windows makes a difference between
+     standard output and error streams and console output and error streams.
+     If output_to_console_ is true and the stream where we are writing is a
+     standard stream, we first need to write everything in a ostringstream and
+     then call a specific function hfst_fprintf_console that prints the contents
+     of the ostringstream to console. */
+
+  /* Get the output stream. */
+  std::ostream & output();
+  /* Get the error stream. */
+  std::ostream & error();
+  /* Flush the stream. */
+  void flush(std::ostream * oss);
+
  protected:
   //! @brief Get the prompt that is used when applying up or down 
   //! (as specified by \a direction).
@@ -512,23 +559,23 @@ class XfstCompiler
   //! @brief Print \a n first paths (or all, if n is negative) 
   //! from \a paths to \a outfile.
   bool print_paths(const hfst::HfstTwoLevelPaths &paths, 
-                            FILE* outfile=stdout, int n=-1);
+                   std::ostream * oss = &std::cout, int n=-1);
   //! @brief Print \a n first paths (or all, if n is negative) 
   //! from \a paths to \a outfile.
   bool print_paths(const hfst::HfstOneLevelPaths &paths, 
-                            FILE* outfile=stdout, int n=-1);
+                   std::ostream * oss = &std::cout, int n=-1);
   // A method used by function print_longest_string_or_its_size.
   XfstCompiler& print_one_string_or_its_size
-    (FILE* outfile, const HfstTwoLevelPaths & paths, const char * level, bool print_size);
+    (std::ostream * oss, const HfstTwoLevelPaths & paths, const char * level, bool print_size);
   //! @brief Print the longest string of topmost transducer in the stack
   //! (if print_size is false) or the size of that string (if print_size is true) 
   //! to \a outfile.
-  XfstCompiler& print_longest_string_or_its_size(FILE* outfile, bool print_size);
+  XfstCompiler& print_longest_string_or_its_size(std::ostream * oss, bool print_size);
   //! @brief Try to extract a maximum of \a number paths from topmost
   //! transducer in the stack and print them to \a outfile. \a level
   //! defines whether the input or output level is printed or both are printed.
   XfstCompiler& print_words(const char * name, unsigned int number,
-                            FILE * outfile, Level level);
+                            std::ostream * oss, Level level);
   //! @brief Read strings (with or without spaces between the symbols,
   //! as defined by \a spaces) from \a infile, disjunct them into
   //! a single transducer and push it to the stack.
@@ -562,18 +609,18 @@ class XfstCompiler
   //! In both cases, a warning message is printed.
   XfstCompiler& add_loaded_definition(HfstTransducer * t);
 
-  //! @brief Exit with failure status if quit-on-fail is ON, 
+  //! @brief Set fail flag to true if quit-on-fail is ON, 
   //! else do nothing.
   void xfst_fail();
 
-  //! @brief Exit with failure status if quit-on-fail is ON and hfst-xfst
+  //! @brief Set fail flag to true if quit-on-fail is ON and hfst-xfst
   //! is not used in interactive mode, else do nothing.
   void xfst_lesser_fail();
 
   //! @brief Print alphabet \a alpha to \a outfile. \a unknown and \a identity
   //! define whether these symbols occur in the transitions of the transducer
   //! whose alphabet we are printing.
-  void print_alphabet(const StringSet & alpha, bool unknown, bool identity, FILE* outfile);
+  void print_alphabet(const StringSet & alpha, bool unknown, bool identity, std::ostream * oss);
 
   void print_level
     (const std::vector<unsigned int> & whole_path,
@@ -624,7 +671,7 @@ class XfstCompiler
   char * remove_newline(char * str);
 
   //! @brief Print weight.
-  int hfst_print_weight(FILE * stream, float weight);
+  //int hfst_print_weight(FILE * stream, float weight);
 
   //! @brief Get current readline history index.
   int current_history_index();
@@ -632,10 +679,13 @@ class XfstCompiler
   //! @brief Remove all readline history after \a index. 
   void ignore_history_after_index(int index);
 
+  //! @brief Get the precision that is used when printing weights.
+  int get_precision();
+
   private:
   /* */
   const XfstCompiler& error(const char* message) const;
-  const XfstCompiler& print_transducer_info() const;
+  XfstCompiler& print_transducer_info();
   XfstCompiler& add_prop_line(char* line);
 
   XfstCompiler& apply_line(char* line, const HfstTransducer * t, size_t cutoff);
@@ -648,12 +698,21 @@ class XfstCompiler
   XfstCompiler& print_bool(bool value);
   XfstCompiler& read_prop_line(char* line);
 
+  /* A wrapper around stream objects, see flush(std::ostream *) for more information. */
+  std::ostream * get_stream(std::ostream * oss);
+
+  /* Whether readline library is used when reading user input. */
   bool use_readline_;
+  /* Whether interactive text is read from standard input. */
   bool read_interactive_text_from_stdin_;
+  /* Windows-specific: whether output, error messages and warnings are printed to the console. */
   bool output_to_console_;
+  /* The regular expression compiler. */
   hfst::xre::XreCompiler xre_;
+  /* The lexc compiler. */
   hfst::lexc::LexcCompiler lexc_;
 #if HAVE_TWOLC
+  /* The twolc compiler. */
   hfst::twolc::TwolcCompiler twolc_;
 #endif
   std::map<std::string,std::string> original_definitions_;
@@ -666,7 +725,7 @@ class XfstCompiler
   std::map<std::string,std::string> aliases_;
   std::map<std::string,std::string> variables_;
   std::map<std::string,std::string> properties_;
-  std::map<std::string,std::set<string> > lists_;
+  std::map<std::string,std::set<std::string> > lists_;
   hfst::HfstTransducer* last_defined_;
   hfst::ImplementationType format_;
   bool verbose_;
@@ -676,6 +735,26 @@ class XfstCompiler
      where they end before giving them to the actual parser. By storing the result
      in this variable, there is no need to parse a regexp again on the parse level. */
   hfst::HfstTransducer * latest_regex_compiled;
+  // Whether the script has encountered the quit command ('quit', 'exit', etc.).
+  // Needed in interactive mode, where user input is read line by line.
+  bool quit_requested_;
+  // Whether the compiler has encountered an error when compiling input given to
+  // 'parse' or 'parse_line' function that should quit the compilation and make
+  // the function return a non-zero value. Note that if the variable 'quit-on-fail'
+  // is false, fail_flag_ will always be false.
+  bool fail_flag_;
+  // Where output is printed.
+  std::ostream * output_;
+  // Where error messages and warnings are printed.
+  std::ostream * error_;
+#ifdef WINDOWS
+  // On Windows: when printing to console standard output, the contents are stored here
+  // and actually written when flush(std::ostream *) is called.
+  std::ostringstream winoss_stdout_;
+  // On Windows: when printing to console standard error, the contents are stored here
+  // and actually written when flush(std::ostream *) is called.
+  std::ostringstream winoss_stderr_;
+#endif
 }
 ;
 
diff --git a/libhfst/src/parsers/XreCompiler.cc b/libhfst/src/parsers/XreCompiler.cc
index 41ce1db..78ce473 100644
--- a/libhfst/src/parsers/XreCompiler.cc
+++ b/libhfst/src/parsers/XreCompiler.cc
@@ -6,6 +6,10 @@
 #include "xre_utils.h"
 #include "HfstTransducer.h"
 
+#ifdef WINDOWS
+#include "../../../tools/src/hfst-string-conversions.h"
+#endif 
+
 #ifndef UNIT_TEST
 
 namespace hfst { namespace xre {
@@ -13,14 +17,24 @@ namespace hfst { namespace xre {
     unsigned int cr=0; // chars read from xre input
     std::set<unsigned int> positions;
     char * position_symbol = NULL;
-    std::string error_message;
+    std::ostream * error_(&std::cerr);
+#ifdef WINDOWS
+    std::ostringstream winoss_;
+    std::ostream * redirected_stream_ = NULL;
+    bool output_to_console_(false);
+#endif
+    bool verbose_(false);
 
 XreCompiler::XreCompiler() : 
     definitions_(),
     function_definitions_(),
     function_arguments_(),
     list_definitions_(),
-    format_(hfst::TROPICAL_OPENFST_TYPE)
+    format_(hfst::TROPICAL_OPENFST_TYPE),
+    verbose_(false)
+#ifdef WINDOWS
+    , output_to_console_(false)
+#endif
 {}
 
 XreCompiler::XreCompiler(hfst::ImplementationType impl) :
@@ -28,7 +42,11 @@ XreCompiler::XreCompiler(hfst::ImplementationType impl) :
     function_definitions_(),
     function_arguments_(),
     list_definitions_(),
-    format_(impl)
+    format_(impl),
+    verbose_(false)
+#ifdef WINDOWS
+    , output_to_console_(false)
+#endif
 {}
 
     XreCompiler::XreCompiler(const struct XreConstructorArguments & args) :
@@ -36,20 +54,108 @@ XreCompiler::XreCompiler(hfst::ImplementationType impl) :
     function_definitions_(args.function_definitions),
     function_arguments_(args.function_arguments),
     list_definitions_(args.list_definitions),
-    format_(args.format)
+    format_(args.format),
+    verbose_(false)
+#ifdef WINDOWS
+    , output_to_console_(false)
+#endif
 {}
 
-void
+
+    void XreCompiler::set_verbosity(bool verbose)
+    {
+      this->verbose_ = verbose;
+      hfst::xre::verbose_ = verbose; // TODO
+    }
+
+    bool XreCompiler::get_verbosity()
+    {
+      return this->verbose_;
+    }
+
+    // TODO: get rid of global variables
+    void XreCompiler::set_error_stream(std::ostream * os)
+    {
+      hfst::xre::error_ = os;
+    }
+
+    std::ostream * XreCompiler::get_error_stream()
+    {
+      return hfst::xre::error_;
+    }
+
+  XreCompiler&
+  XreCompiler::setOutputToConsole(bool value)
+  {
+#ifdef WINDOWS
+    output_to_console_ = value;
+    hfst::xre::output_to_console_ = value;
+#else
+    (void)value;
+#endif
+    //hfst::print_output_to_console(output_to_console_);
+    return *this;
+  }
+
+  bool
+  XreCompiler::getOutputToConsole()
+  {
+#ifdef WINDOWs
+    return output_to_console_;
+#else
+    return false;
+#endif
+  }
+
+    std::ostream * XreCompiler::get_stream(std::ostream * oss)
+    {
+#ifdef WINDOWS
+      if (hfst::xre::output_to_console_ && (oss == &std::cerr || oss == &std::cout))
+        {
+          hfst::xre::redirected_stream_ = oss;
+          return &hfst::xre::winoss_;
+        }
+#endif
+      return oss;
+    }
+
+    void XreCompiler::flush(std::ostream * oss)
+    {
+#ifdef WINDOWS
+      if (hfst::xre::output_to_console_ && (oss == &hfst::xre::winoss_))
+        {
+          if (hfst::xre::redirected_stream_ == &std::cerr)
+            hfst_fprintf_console(stderr, hfst::xre::winoss_.str().c_str());
+          else if (hfst::xre::redirected_stream_ == &std::cout)
+            hfst_fprintf_console(stdout, hfst::xre::winoss_.str().c_str());
+          else
+            ;
+          hfst::xre::redirected_stream_ = NULL;
+          hfst::xre::winoss_.str("");
+        }
+#endif
+    }
+
+
+bool
 XreCompiler::define(const std::string& name, const std::string& xre)
 {
   HfstTransducer* compiled = compile(xre);
   if (compiled == NULL)
     {
-      fprintf(stderr, "error in XreCompiler::define: xre '%s' could not be parsed, leaving %s undefined\n", 
-              xre.c_str(), name.c_str());
-      return;
+      //fprintf(stderr, "error in XreCompiler::define: xre '%s' could not be parsed, leaving %s undefined\n", 
+      //        xre.c_str(), name.c_str());
+      //*errorstream_ << "error in XreCompiler::define: xre '" << xre << "' could not be parsed, leaving " << name << "undefined" << std::endl;
+      if (this->verbose_)
+        {
+          std::ostream * err = get_stream(get_error_stream());
+          *err << "error: could not parse '" << xre << "', leaving '" << name << "' undefined" << std::endl; 
+          flush(err);
+        }
+      return false;
     }
   definitions_[name] = compiled;
+  return true;
 }
 
 void 
@@ -103,8 +209,8 @@ if (definitions_.find(name) != definitions_.end())
 extern bool expand_definitions;
 extern bool harmonize_;
 extern bool harmonize_flags_;
-extern bool verbose_;
-extern FILE * warning_stream;
+    //extern bool verbose_;
+    //extern FILE * warning_stream;
 
 void XreCompiler::set_expand_definitions(bool expand)
 {
@@ -121,21 +227,6 @@ void XreCompiler::set_flag_harmonization(bool harmonize_flags)
   harmonize_flags_=harmonize_flags;
 }
 
-void XreCompiler::set_verbosity(bool verbose, FILE * file)
-{
-  verbose_=verbose;
-  if (verbose)
-    {
-      warning_stream=file;
-    }
-}
-
-std::string 
-XreCompiler::get_error_message()
-{
-  return error_message;
-}
-
 bool
 XreCompiler::contained_only_comments()
 {
diff --git a/libhfst/src/parsers/XreCompiler.h b/libhfst/src/parsers/XreCompiler.h
index 665f52f..99f4ab4 100644
--- a/libhfst/src/parsers/XreCompiler.h
+++ b/libhfst/src/parsers/XreCompiler.h
@@ -77,7 +77,8 @@ class XreCompiler
   //! @brief Add a definition macro.
   //!        Compilers will replace arcs labeled @a name, with the transducer
   //!        defined by @a xre in later phases of compilation.
-  void define(const std::string& name, const std::string& xre);
+  //! @return Whether parsing \a xre was succesful.
+  bool define(const std::string& name, const std::string& xre);
 
   void define_list(const std::string& name, const std::set<std::string>& symbol_list);
 
@@ -110,7 +111,6 @@ class XreCompiler
   //! @brief Remove a definition macro.
   void undefine(const std::string& name);
 
-
   //! @brief Compile a transducer defined by @a xre.
   //!        May return a pointer to @e empty transducer on non-fatal error.
   //!        A null pointer is returned on fatal error, if abort is not called.
@@ -123,8 +123,6 @@ class XreCompiler
   //!        A null pointer is returned on fatal error, if abort is not called.
   HfstTransducer* compile_first(const std::string& xre, unsigned int & chars_read);
 
-  std::string get_error_message();
-
   //! @brief Whether the last regex compiled contained only comments.
   //!        
   //! In that case, the last call to compile ot compile_first has returned NULL,
@@ -147,9 +145,17 @@ class XreCompiler
   //!        Default is false.
   void set_flag_harmonization(bool harmonize_flags);
 
-  //! @brief Whether warning messages are printed to \a file.
-  //!        Default is false, If verbose==false, \a file is ignored.
-  void set_verbosity(bool verbose, FILE * file);
+  void set_verbosity(bool verbose);
+  bool get_verbosity();
+  void set_error_stream(std::ostream * os);
+  std::ostream * get_error_stream();
+
+  XreCompiler& setOutputToConsole(bool value);
+  bool getOutputToConsole();
+
+  // TODO get rid of global variables so these functions can be non-static
+  static std::ostream * get_stream(std::ostream * oss);
+  static void flush(std::ostream * oss);
 
   private:
   std::map<std::string,hfst::HfstTransducer*> definitions_;
@@ -157,6 +163,12 @@ class XreCompiler
   std::map<std::string, unsigned int > function_arguments_;
   std::map<std::string, std::set<std::string> > list_definitions_;
   hfst::ImplementationType format_;
+  bool verbose_;
+#ifdef WINDOWS
+  bool output_to_console_;
+  // global std::ostringstream * winoss_;
+  // global std::ostream * redirected_stream_;
+#endif
 
 }
 ;
diff --git a/libhfst/src/parsers/lexc-parser.yy b/libhfst/src/parsers/lexc-parser.yy
index 74cba6b..8ba6627 100644
--- a/libhfst/src/parsers/lexc-parser.yy
+++ b/libhfst/src/parsers/lexc-parser.yy
@@ -53,7 +53,10 @@ static
 void
 handle_noflag(const string& lexname)
 {
-    fprintf(stderr, "DEBUG: Adding %s to noflags\n", lexname.c_str());
+    //fprintf(stderr, "DEBUG: Adding %s to noflags\n", lexname.c_str());
+    std::ostream * err = hfst::lexc::lexc_->get_stream((hfst::lexc::lexc_->get_error_stream()));
+    *err << "DEBUG: Adding " << lexname << " to noflags" << std::endl;
+    hfst::lexc::lexc_->flush(err);
     hfst::lexc::lexc_->addNoFlag(lexname);
 }
 static
diff --git a/libhfst/src/parsers/lexc-utils.cc b/libhfst/src/parsers/lexc-utils.cc
index 27a41ba..e2445f3 100644
--- a/libhfst/src/parsers/lexc-utils.cc
+++ b/libhfst/src/parsers/lexc-utils.cc
@@ -1,8 +1,6 @@
 //! @file lexc-utils.cc
 //!
 //! @brief Implementation of some string handling in HFST lexc.
-//!
-//! @author Tommi A. Pirinen
 
 
 //  This program is free software: you can redistribute it and/or modify
@@ -33,6 +31,7 @@
 // for internal epsilon
 #include "HfstSymbolDefs.h"
 
+#include "LexcCompiler.h"
 #include "lexc-utils.h"
 #include "lexc-parser.hh"
 
@@ -45,6 +44,9 @@ extern char* hlexctext;
 extern YYLTYPE hlexclloc;
 
 namespace hfst { namespace lexc {
+
+extern hfst::lexc::LexcCompiler * lexc_;
+
 // string mangling
 static
 string&
@@ -370,8 +372,11 @@ strip_percents(const char* s, bool do_zeros)
     *p = '\0';
     if (escaping)
     {
-        fprintf(stderr, "Stray escape char %% in %s\n", s);
-        return NULL;
+      //fprintf(stderr, "Stray escape char %% in %s\n", s);
+      std::ostream * err = hfst::lexc::lexc_->get_stream((hfst::lexc::lexc_->get_error_stream()));
+      *err << "Stray escape char %% in " << s << std::endl;
+      hfst::lexc::lexc_->flush(err);
+      return NULL;
     }
     return rv;
 }
@@ -454,9 +459,108 @@ error_at_current_token(int, int, const char* format)
 {
     char* leader = strdup_token_positions();
     char* token = strdup_token_part();
-    fprintf(stderr, "%s: %s %s\n", leader, format, token);
+    //fprintf(stderr, "%s: %s %s\n", leader, format, token);
+      std::ostream * err = hfst::lexc::lexc_->get_stream((hfst::lexc::lexc_->get_error_stream()));
+      *err << leader << ": " << format << ": " << token << std::endl;
+      hfst::lexc::lexc_->flush(err);
     free(leader);
 }
 
+
+
+pair<vector<string>, vector<string> > find_med_alingment(const vector<string> &s1, const vector<string> &s2)
+{
+    const size_t substitution = 100;
+    const size_t deletion = 1;
+    const size_t insertion = 1;
+
+    const size_t len1 = s1.size(), len2 = s2.size();
+    vector<vector<unsigned int> > d(len1 + 1, vector<unsigned int>(len2 + 1));
+    vector<vector<unsigned int> > dir(len1 + 1, vector<unsigned int>(len2 + 1));
+    d[0][0] = 0;
+    dir[0][0] = 0;
+    for(unsigned int i = 1; i <= len1; ++i)
+    {
+        d[i][0] = deletion * i;
+        dir[i][0] = DELETE;
+        
+    }
+    for(unsigned int i = 1; i <= len2; ++i)
+    {    
+        d[0][i] = insertion * i;
+        dir[0][i] = INSERT;
+    }
+    
+    for(unsigned int i = 1; i <= len1; ++i)
+    {
+        for(unsigned int j = 1; j <= len2; ++j)
+        {
+           
+            int sub = d[i - 1][j - 1] + (s1[i - 1] == s2[j - 1] ? 0 : substitution);
+            int ins = d[i][j - 1] + insertion ;
+            int del = d[i - 1][j] + deletion ;
+            
+           
+            if ( sub <= ins &&  sub <= del )
+            {
+                d[i][j] = sub;
+                dir[i][j] = SUBSTITUTE;
+            }
+             // It's important to prioritize "del" when it has the same value as "ins"" because we want the first 
+             // string to have zeroes before the second one.
+             // For example, if we have two strings: abc and xyz, we would prefer the output 000abc:xyz000 
+             // over abc000:000xyz, because we need to invert the transducer to use it for the analysis and in lookup
+             // we want zeroes as late as possible on the upper side.
+             // Anyway, the order of this two following blocks determines the order of zeroes on upper/lower side
+            else if (del <= sub && del <= ins)
+            {
+                d[i][j] = del;
+                dir[i][j] = DELETE;
+            }
+            else
+            {
+                d[i][j] = ins;
+                dir[i][j] = INSERT;
+            }
+        }
+    }
+    
+    vector<string> medcwordin;
+    vector<string> medcwordout;
+    
+    int x, y, i ;
+    for ( x = s1.size(), y = s2.size(), i = 0; (x > 0) || (y > 0); i++)
+    {
+        int dirValue = dir[x][y];
+         
+        if (dirValue == SUBSTITUTE)
+        {
+            medcwordin.push_back(s1[x-1]) ;
+            medcwordout.push_back(s2[y-1]);
+            x--;
+            y--;
+        }
+        else if (dirValue == INSERT)
+        {
+            medcwordin.push_back(EPSILON_);
+            medcwordout.push_back(s2[y-1]);
+            y--;
+        }
+        else
+        {
+            medcwordin.push_back(s1[x-1]);
+            medcwordout.push_back(EPSILON_);
+            x--;
+        }
+    }
+
+    std::reverse(medcwordin.begin(), medcwordin.end());
+    std::reverse(medcwordout.begin(), medcwordout.end());
+    
+    pair<vector<string>, vector<string> > returnValue (medcwordin,medcwordout);
+    return returnValue;
+}
+        
+    
 } } 
 
diff --git a/libhfst/src/parsers/lexc-utils.h b/libhfst/src/parsers/lexc-utils.h
index 43c75bc..cc27bb7 100644
--- a/libhfst/src/parsers/lexc-utils.h
+++ b/libhfst/src/parsers/lexc-utils.h
@@ -1,8 +1,7 @@
 //! @file lexc-utils.h
 //!
 //! @brief Various string handling methods for HFST lexc.
-//! 
-//! @author Tommi A. Pirinen
+
 
 
 //   This program is free software: you can redistribute it and/or modify
@@ -22,8 +21,21 @@
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif
+
+
+#include <vector>
 #include <string>
 
+using namespace std;
+
+
+//for med alignment
+#define SUBSTITUTE 2 //diag
+#define DELETE 1 //left
+#define INSERT 0  //down
+#define EPSILON_ "@@ANOTHER_EPSILON@@"
+
+
 namespace hfst { namespace lexc {
 
 const char LEXC_JOINER_START[] = "$_LEXC_JOINER.";
@@ -104,6 +116,19 @@ char* strdup_nonconst_part(const char* token,
 //! @brief print error_at_line style error message for current token
 void error_at_current_token(int status, int errnum, const char* format);
 
+//! @brief Finds med alignment between two strings
+//! Given an upper-lower string lexicon entry, the upper-lower pair is aligned by minimum edit distance with the following costs:
+ //! x:x costs 0
+ //! x:y costs ∞
+ //! x:0 costs 1
+ //! 0:x costs 1
+//! This means that if we have a lexicon entry like:
+//! abc:bc
+//! As this is compiled into a transducer for the entry, we align it a:0 b:b c:c (instead of the default a:b b:c c:0).
+//! Additionally, if we have a lexicon entry like:
+//! abc:xyz
+//! we align it 0:x 0:y 0:z a:0 b:0 c:0 (instead of x:0 y:0 z:0 0:a 0:b 0:c)
+std::pair<vector<string>, vector<string> > find_med_alingment(const vector<string> &s1, const vector<string> &s2);
 
 } }
 // vim: set ft=cpp.doxygen:
diff --git a/libhfst/src/parsers/pmatch_parse.yy b/libhfst/src/parsers/pmatch_parse.yy
index 499c626..a8dfcfb 100644
--- a/libhfst/src/parsers/pmatch_parse.yy
+++ b/libhfst/src/parsers/pmatch_parse.yy
@@ -87,8 +87,8 @@ REPLACE REGEXP3 FUNCALL MAP FUNCALL_ARG
 %type <mappingWithArrow> MAPPINGPAIR
 
 %type <contextWithMark> CONTEXTS_WITH_MARK
-%type <transducerPairVector> CONTEXTS_VECTOR
-%type <transducerPair> CONTEXT
+%type <transducerPairVector> CONTEXTS_VECTOR RESTR_CONTEXTS_VECTOR
+%type <transducerPair> CONTEXT RESTR_CONTEXT
 %type <replType>  CONTEXT_MARK
 
 %type <transducer> OPTCAP TOLOWER TOUPPER INSERT ANONYMOUS_DEFINITION RIGHT_CONTEXT LEFT_CONTEXT NEGATIVE_RIGHT_CONTEXT NEGATIVE_LEFT_CONTEXT P_CONTEXT CONTEXT_CONDITION OR_CONTEXT AND_CONTEXT
@@ -662,10 +662,9 @@ REGEXP2: REPLACE
     delete $3;
  }
 | REGEXP2 LENIENT_COMPOSITION REPLACE {
-    $$ = $1;
+    $$ = &$1->lenient_composition(*$3);
     delete $3;
  }
-
 ;
 
 ////////////////////////////
@@ -959,44 +958,84 @@ REPLACE_ARROW: REPLACE_RIGHT
 
 REGEXP3: REGEXP4 { }
 | REGEXP3 SHUFFLE REGEXP4 {
-    pmatcherror("No shuffle");
-    $$ = $1;
+    try {
+        $$ = & $1->shuffle(*$3);
+    } catch (const TransducersAreNotAutomataException & e) {
+        pmatchwarning("tried to shuffle with non-automaton transducers,\n"
+                      "    shuffling with their input projection instead.");
+        $1->input_project();
+        $3->input_project();
+        $$ = & $1->shuffle(*$3);
+    }
     delete $3;
  }
 | REGEXP3 BEFORE REGEXP4 {
-    pmatcherror("No before");
-    $$ = $1;
-    delete $3;
- }
+    $$ = new HfstTransducer( before (*$1, *$3) );
+    delete $1, $3;
+}
 | REGEXP3 AFTER REGEXP4 {
-    pmatcherror("No after");
-    $$ = $1;
-    delete $3;
- }
-
+    $$ = new HfstTransducer( after (*$1, *$3) );
+    delete $1, $3;
+}
 ;
 
 REGEXP4: REGEXP5 { }
-| REGEXP4 LEFT_ARROW REGEXP5 CENTER_MARKER REGEXP5 {
-    pmatcherror("No Arrows");
-    $$ = $1;
+| REGEXP4 RIGHT_ARROW RESTR_CONTEXTS_VECTOR {
+    $$ = new HfstTransducer( restriction(*$1, *$3) ) ;
+    delete $1;
     delete $3;
-    delete $5;
- }
-| REGEXP4 RIGHT_ARROW REGEXP5 CENTER_MARKER REGEXP5 {
-    pmatcherror("No Arrows");
+}
+| REGEXP4 LEFT_ARROW REGEXP5 CENTER_MARKER REGEXP5 {
+    pmatcherror("Left arrow with contexts not implemented");
     $$ = $1;
     delete $3;
     delete $5;
  }
 | REGEXP4 LEFT_RIGHT_ARROW REGEXP5 CENTER_MARKER REGEXP5 {
-    pmatcherror("No Arrows");
+    pmatcherror("Left-right arrow with contexts not implemented");
     $$ = $1;
     delete $3;
     delete $5;
  }
 ;
 
+RESTR_CONTEXTS_VECTOR: RESTR_CONTEXT
+{
+    HfstTransducerPairVector * ContextVector = new HfstTransducerPairVector();
+    ContextVector->push_back(*$1);
+    $$ = ContextVector;
+    delete $1; 
+}
+| RESTR_CONTEXTS_VECTOR COMMA RESTR_CONTEXT
+{
+    $1->push_back(*$3);
+    $$ = $1;
+    delete $3; 
+};
+      
+RESTR_CONTEXT: REGEXP4 CENTER_MARKER REGEXP4 
+{
+    $$ = new HfstTransducerPair(*$1, *$3);
+    delete $1, $3; 
+}
+| REGEXP4 CENTER_MARKER
+{
+    HfstTransducer epsilon(hfst::internal_epsilon, hfst::pmatch::format);
+    $$ = new HfstTransducerPair(*$1, epsilon);
+    delete $1; 
+}
+| CENTER_MARKER REGEXP4
+{
+    HfstTransducer epsilon(hfst::internal_epsilon, hfst::pmatch::format);
+    $$ = new HfstTransducerPair(epsilon, *$2);
+    delete $2; 
+}
+| CENTER_MARKER
+{
+    HfstTransducer empty(hfst::pmatch::format);
+    $$ = new HfstTransducerPair(empty, empty);
+};
+
 REGEXP5: REGEXP6 { }
 | REGEXP5 UNION REGEXP6 {
     $$ = & $1->disjunct(*$3);
@@ -1021,14 +1060,16 @@ REGEXP5: REGEXP6 { }
     delete $3;
  }
 | REGEXP5 UPPER_PRIORITY_UNION REGEXP6 {
-    pmatcherror("No upper priority union");
-    $$ = $1;
+    $$ = & $1->priority_union(*$3);
     delete $3;
  }
 | REGEXP5 LOWER_PRIORITY_UNION REGEXP6 {
-    pmatcherror("No lower priority union");
-    $$ = $1;
-    delete $3;
+    HfstTransducer* left = new HfstTransducer(*$1);
+    HfstTransducer* right =  new HfstTransducer(*$3);
+    right->invert();
+    left->invert();
+    $$ = & (left->priority_union(*right).invert());
+    delete $1, $3;
  }
 ;
 
@@ -1045,9 +1086,18 @@ REGEXP7: REGEXP8 { }
     delete $3;
  }
 | REGEXP7 IGNORE_INTERNALLY REGEXP8 {
-    pmatcherror("No ignoring internally");
-    $$ = $1;
+    HfstTransducer * left = new HfstTransducer(*$1);
+    HfstTransducer * right = new HfstTransducer(*$1);
+    HfstTransducer * middle = new HfstTransducer(*$1);
+    middle->disjunct(*$3);
+    middle->repeat_star();
+    left->concatenate(*middle);
+    left->concatenate(*right);
+    $$ = left;
+    delete $1;
     delete $3;
+    delete middle;
+    delete right;
  }
 | REGEXP7 LEFT_QUOTIENT REGEXP8 {
     pmatcherror("No left quotient");
@@ -1059,53 +1109,58 @@ REGEXP7: REGEXP8 { }
 
 REGEXP8: REGEXP9 { }
 | COMPLEMENT REGEXP8 {
-    pmatcherror("No complement");
-    $$ = $2;
- }
+// Defined here only for automata, so we project to input
+    HfstTransducer * complement =
+        new HfstTransducer(hfst::internal_identity, hfst::pmatch::format);
+    complement->repeat_star();
+    complement->subtract(*$2);
+    $$ = complement;
+    delete $2;
+}
 | CONTAINMENT REGEXP8 {
-    HfstTransducer* left = new HfstTransducer(hfst::internal_unknown,
-                                              hfst::internal_unknown,
+    HfstTransducer* left = new HfstTransducer(hfst::internal_identity,
                                               hfst::pmatch::format);
-    HfstTransducer* right = new HfstTransducer(hfst::internal_unknown,
-                                               hfst::internal_unknown,
+    HfstTransducer* right = new HfstTransducer(hfst::internal_identity,
                                                hfst::pmatch::format);
     right->repeat_star();
     left->repeat_star();
-    HfstTransducer* contain_once = 
-        & ((right->concatenate(*$2).concatenate(*left)));
-    $$ = & (contain_once->repeat_star());
+    $2->repeat_star();
+    left->concatenate(*$2);
+    left->concatenate(*right);
+    $$ = left;
     delete $2;
-    delete left;
+    delete right;
  }
 | CONTAINMENT_ONCE REGEXP8 {
-    HfstTransducer* left = new HfstTransducer(hfst::internal_unknown,
-                                              hfst::internal_unknown,
+    HfstTransducer* left = new HfstTransducer(hfst::internal_identity,
                                               hfst::pmatch::format);
-    HfstTransducer* right = new HfstTransducer(hfst::internal_unknown,
-                                               hfst::internal_unknown,
+    HfstTransducer* right = new HfstTransducer(hfst::internal_identity,
                                                hfst::pmatch::format);
+    left->subtract(*$2);
+    right->subtract(*$2);
     right->repeat_star();
     left->repeat_star();
-    HfstTransducer* contain_once = 
-        & ((right->concatenate(*$2).concatenate(*left)));
-    $$ = contain_once;
+    left->concatenate(*$2);
+    left->concatenate(*right);
+    $$ = left;
     delete $2;
-    delete left;
+    delete right;
  }
 | CONTAINMENT_OPT REGEXP8 {
-    HfstTransducer* left = new HfstTransducer(hfst::internal_unknown,
-                                              hfst::internal_unknown,
+    HfstTransducer* left = new HfstTransducer(hfst::internal_identity,
                                               hfst::pmatch::format);
-    HfstTransducer* right = new HfstTransducer(hfst::internal_unknown,
-                                               hfst::internal_unknown,
+    HfstTransducer* right = new HfstTransducer(hfst::internal_identity,
                                                hfst::pmatch::format);
+    left->subtract(*$2);
+    right->subtract(*$2);
     right->repeat_star();
     left->repeat_star();
-    HfstTransducer* contain_once = 
-        & ((right->concatenate(*$2).concatenate(*left)));
-    $$ = & (contain_once->optionalize());
+    $2->optionalize();
+    left->concatenate(*$2);
+    left->concatenate(*right);
+    $$ = left;
     delete $2;
-    delete left;
+    delete right;
  }
 ;
 
@@ -1254,10 +1309,49 @@ REGEXP12: LABEL_PAIR { }
   free($1);
   }
 | READ_SPACED {
-    pmatcherror("no read spaced");
+    FILE * f = NULL;
+    f = fopen($1, "r");
+    if (f == NULL) {
+        pmatcherror("File cannot be opened.\n");
+    }
+    else {
+        HfstTokenizer tok;
+        HfstBasicTransducer tmp;
+        char line [1000];
+        
+        while( fgets(line, 1000, f) != NULL )
+        {
+            hfst::pmatch::strip_newline(line);
+            StringPairVector spv = HfstTokenizer::tokenize_space_separated(line);
+            tmp.disjunct(spv, 0);
+        }
+        fclose(f);
+        HfstTransducer * retval = new HfstTransducer(tmp, hfst::pmatch::format); 
+        retval->minimize();
+        $$ = retval;
+    }
   }
 | READ_PROLOG {
-    pmatcherror("no read prolog");
+    FILE * f = NULL;
+    f = fopen($1, "r");
+    if (f == NULL) {
+        pmatcherror("File cannot be opened.\n");
+    }
+    else {
+        try {
+            unsigned int linecount = 0;
+            HfstBasicTransducer tmp = HfstBasicTransducer::read_in_prolog_format(f, linecount);
+            fclose(f);
+            HfstTransducer * retval = new HfstTransducer(tmp, hfst::pmatch::format);
+            retval->minimize();
+            $$ = retval;
+        }
+        catch (const HfstException & e) {
+            (void) e;
+            fclose(f);
+            pmatcherror("Error reading prolog file.\n");
+        }
+    }
   }
 | READ_RE {
     pmatcherror("Definitely no read regex");
diff --git a/libhfst/src/parsers/pmatch_utils.cc b/libhfst/src/parsers/pmatch_utils.cc
index b625a29..e5615c8 100644
--- a/libhfst/src/parsers/pmatch_utils.cc
+++ b/libhfst/src/parsers/pmatch_utils.cc
@@ -45,6 +45,13 @@ pmatcherror(const char *msg)
 
 }
 
+void pmatchwarning(const char *msg)
+{
+    if (hfst::pmatch::verbose) {
+        std::cerr << "pmatch: "<< msg << std::endl;
+    }
+}
+
 namespace hfst 
 { 
 namespace pmatch 
@@ -196,6 +203,17 @@ add_percents(const char *s)
     return ns;
   }
 
+char*
+strip_newline(char *s)
+{
+  for (unsigned int pos = 0; s[pos] != '\0'; pos++)
+    {
+      if (s[pos] == '\n' || s[pos] == '\r')
+        s[pos] = '\0';
+    }
+  return s;
+}
+
 char *
 get_Ins_transition(const char *s)
 {
diff --git a/libhfst/src/parsers/pmatch_utils.h b/libhfst/src/parsers/pmatch_utils.h
index a43cb4c..b791e2c 100644
--- a/libhfst/src/parsers/pmatch_utils.h
+++ b/libhfst/src/parsers/pmatch_utils.h
@@ -14,6 +14,8 @@
 #include <iomanip>
 #include "HfstTransducer.h"
 
+void pmatchwarning(const char *msg);
+
 namespace hfst { namespace pmatch {
 
 class PmatchFunction;
@@ -72,6 +74,11 @@ char* strip_percents(const char *s);
 char* add_percents(const char* s);
 
 /**
+ * @brief remove final newline or CR.
+ */
+char* strip_newline(char *s);
+
+/**
  * @brief get a transition name for use in Ins, RC and LC statements
  */
 char* get_Ins_transition(const char *s);
diff --git a/tools/src/parsers/xfst-lexer.ll b/libhfst/src/parsers/xfst-lexer.ll
similarity index 98%
rename from tools/src/parsers/xfst-lexer.ll
rename to libhfst/src/parsers/xfst-lexer.ll
index e41a832..21643cc 100644
--- a/tools/src/parsers/xfst-lexer.ll
+++ b/libhfst/src/parsers/xfst-lexer.ll
@@ -462,7 +462,7 @@ LWSP [\t ]*
     return PUSH_DEFINED;
 }
 
-^{LWSP}("quit"|"exit"|"bye") {
+^{LWSP}("quit"|"exit"|"bye"|"stop"|"hyvästi"|"au revoir"|"näkemiin"|"viszlát"|"auf wiedersehen"|"has") {
     hxfstlval.name = strdup("");         
     return QUIT;                         
 }
@@ -736,14 +736,16 @@ LWSP [\t ]*
   FILE * tmp = NULL;
   if ((tmp = fopen(hfst::xfst::strstrip(hxfsttext), "r" )) != NULL) 
   {
-    printf("Opening file '%s'.\n", hfst::xfst::strstrip(hxfsttext));
+    //printf("Opening file '%s'.\n", hfst::xfst::strstrip(hxfsttext));
     // push the included text onto the lexer stack
     hxfstpush_buffer_state(hxfst_create_buffer(tmp, 32000));
     ++source_stack_size;
   } 
   else 
   {
-    printf("Error opening file '%s'\n",hfst::xfst::strstrip(hxfsttext));
+    char buffer [1024];
+    sprintf(buffer, "Error opening file '%s'\n",hfst::xfst::strstrip(hxfsttext));
+    hxfsterror(buffer);
   } 
   BEGIN(INITIAL); 
 }
diff --git a/tools/src/parsers/xfst-parser.yy b/libhfst/src/parsers/xfst-parser.yy
similarity index 54%
rename from tools/src/parsers/xfst-parser.yy
rename to libhfst/src/parsers/xfst-parser.yy
index 379e44c..f99c973 100644
--- a/tools/src/parsers/xfst-parser.yy
+++ b/libhfst/src/parsers/xfst-parser.yy
@@ -34,6 +34,8 @@ namespace hfst {
 #include "XfstCompiler.h"
 #include "xfst-utils.h"
 
+#define CHECK if (hfst::xfst::xfst_->get_fail_flag()) { YYABORT; }
+
 // obligatory yacc stuff
 extern int hxfstlineno;
 void hxfsterror(const char *text);
@@ -105,13 +107,13 @@ COMMAND_LIST: COMMAND_LIST COMMAND
             ;
 
 COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->add_props(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | ADD_PROPS NAMETOKEN_LIST CTRLD {
             hfst::xfst::xfst_->add_props($2);
-            free($2);
+            free($2); CHECK;
        }
        | EDIT_PROPS END_COMMAND {
             hxfsterror("NETWORK PROPERTY EDITOR unimplemented\n");
@@ -119,61 +121,61 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
        }
        // apply
        | APPLY_UP END_COMMAND {
-       	    hfst::xfst::xfst_->apply_up(stdin);
+       	    hfst::xfst::xfst_->apply_up(stdin); CHECK;
        }
        | APPLY_UP APPLY_INPUT END_COMMAND {
-       	    hfst::xfst::xfst_->apply_up($2);
+       	    hfst::xfst::xfst_->apply_up($2); CHECK;
        }
        | APPLY_UP NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->apply_up($2);
-            free($2);
+            free($2); CHECK;
        }
        | APPLY_UP REDIRECT_IN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->apply_up(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | APPLY_UP END_COMMAND NAMETOKEN_LIST END_SUB {
             hfst::xfst::xfst_->apply_up($3);
-            free($3);
+            free($3); CHECK;
        }
        | APPLY_DOWN END_COMMAND {
-            hfst::xfst::xfst_->apply_down(stdin);
+            hfst::xfst::xfst_->apply_down(stdin); CHECK;
        }
        | APPLY_DOWN APPLY_INPUT END_COMMAND {
-       	    hfst::xfst::xfst_->apply_down($2);
+       	    hfst::xfst::xfst_->apply_down($2); CHECK;
        }
        | APPLY_DOWN NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->apply_down($2);
-            free($2);
+            free($2); CHECK;
        }
        | APPLY_DOWN REDIRECT_IN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->apply_down(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | APPLY_DOWN END_COMMAND NAMETOKEN_LIST END_SUB {
             hfst::xfst::xfst_->apply_down($3);
-            free($3);
+            free($3); CHECK;
        }
        | APPLY_MED NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->apply_med($2);
-            free($2);
+            free($2); CHECK;
        }
        | APPLY_MED REDIRECT_IN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->apply_med(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | APPLY_MED END_COMMAND NAMETOKEN_LIST END_SUB {
             hfst::xfst::xfst_->apply_med($3);
-            free($3);
+            free($3); CHECK;
        }
        | LOOKUP_OPTIMIZE END_COMMAND {
-            hfst::xfst::xfst_->lookup_optimize();
+            hfst::xfst::xfst_->lookup_optimize(); CHECK;
        }
        | REMOVE_OPTIMIZATION END_COMMAND {
-            hfst::xfst::xfst_->remove_optimization();
+            hfst::xfst::xfst_->remove_optimization(); CHECK;
        }
        // ambiguous
        | AMBIGUOUS END_COMMAND {
@@ -192,114 +194,114 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
        | DEFINE_ALIAS NAMETOKEN COMMAND_SEQUENCE END_COMMAND{
             hfst::xfst::xfst_->define_alias($2, $3);
             free($2);
-            free($3);
+            free($3); CHECK;
        }
        | DEFINE_ALIAS NAMETOKEN END_COMMAND NAMETOKEN_LIST END_SUB {
             hfst::xfst::xfst_->define_alias($2, $4);
             free($2);
-            free($4);
+            free($4); CHECK;
        }
        | LIST NAMETOKEN NAMETOKEN_LIST SEMICOLON END_COMMAND {
             hfst::xfst::xfst_->define_list($2, $3);
             free($2);
-            free($3);
+            free($3); CHECK;
        }
        | LIST NAMETOKEN RANGE END_COMMAND {
             hfst::xfst::xfst_->define_list($2, $3[0], $3[1]);
             free($2);
             free($3[0]);
             free($3[1]);
-            free($3);
+            free($3); CHECK;
        }
        | DEFINE_NAME {
             hfst::xfst::xfst_->define($1);
-            free($1);
+            free($1); CHECK;
        }
        | DEFINE_NAME REGEX {
             hfst::xfst::xfst_->define($1, $2);
             free($1);
-            free($2);
+            free($2); CHECK;
        }
        | DEFINE_FUNCTION REGEX {
             hfst::xfst::xfst_->define_function($1, $2);
             free($1);
-            free($2);
+            free($2); CHECK;
        }
        | UNDEFINE NAMETOKEN_LIST END_COMMAND {
             hfst::xfst::xfst_->undefine($2);
-            free($2);
+            free($2); CHECK;
        }
        | UNLIST NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->unlist($2);
-            free($2);
+            free($2); CHECK;
        }
        | NAME NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->name_net($2);
-            free($2);
+            free($2); CHECK;
        }
        | LOADD NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->load_definitions($2);
-            free($2);
+            free($2); CHECK;
        }
        // help
        | APROPOS END_COMMAND { 
             hfst::xfst::xfst_->apropos($1);
-            free($1);
+            free($1); CHECK;
        }
        | DESCRIBE END_COMMAND { 
-            hfst::xfst::xfst_->describe($1);
+            hfst::xfst::xfst_->describe($1); CHECK;
        }
        // stack
        | CLEAR END_COMMAND {
-            hfst::xfst::xfst_->clear();
+            hfst::xfst::xfst_->clear(); CHECK;
        }
        | POP END_COMMAND {
-            hfst::xfst::xfst_->pop();
+            hfst::xfst::xfst_->pop(); CHECK;
        }
        | PUSH_DEFINED NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->push($2);
-            free($2);
+            free($2); CHECK;
        }
        | PUSH_DEFINED END_COMMAND {
-            hfst::xfst::xfst_->push();
+            hfst::xfst::xfst_->push(); CHECK;
        }
        | TURN END_COMMAND {
-            hfst::xfst::xfst_->turn();
+            hfst::xfst::xfst_->turn(); CHECK;
        }
        | ROTATE END_COMMAND {
-            hfst::xfst::xfst_->rotate();
+            hfst::xfst::xfst_->rotate(); CHECK;
        }
        | LOADS REDIRECT_IN END_COMMAND {
             hfst::xfst::xfst_->load_stack($2);
-            free($2);
+            free($2); CHECK;
        }
        | LOADS NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->load_stack($2);
-            free($2);
+            free($2); CHECK;
        }
        | LOADS NAMETOKEN SEMICOLON END_COMMAND {
             hfst::xfst::xfst_->load_stack($2);
-            free($2);
+            free($2); CHECK;
        }
        // wrobble
        | COLLECT_EPSILON_LOOPS END_COMMAND {
-            hfst::xfst::xfst_->collect_epsilon_loops();
+            hfst::xfst::xfst_->collect_epsilon_loops(); CHECK;
        }
        | COMPACT_SIGMA END_COMMAND {
-            hfst::xfst::xfst_->compact_sigma();
+            hfst::xfst::xfst_->compact_sigma(); CHECK;
        }
        // flags
        | ELIMINATE_FLAG NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->eliminate_flag($2);
-            free($2);
+            free($2); CHECK;
        }
        | ELIMINATE_ALL END_COMMAND {
-            hfst::xfst::xfst_->eliminate_flags();
+            hfst::xfst::xfst_->eliminate_flags(); CHECK;
        }
        // system
        | ECHO { 
             hfst::xfst::xfst_->echo($1);
-            free($1);
+            free($1); CHECK;
        }
        | QUIT { 
             hfst::xfst::xfst_->quit($1);
@@ -308,7 +310,7 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
        }
        | HFST {
             hfst::xfst::xfst_->hfst($1);
-            free($1);
+            free($1); CHECK;
        }
        | SOURCE NAMETOKEN END_COMMAND {
             hxfsterror("source not implemented yywrap\n");
@@ -316,11 +318,12 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
        }
        | SYSTEM {
             hfst::xfst::xfst_->system($1);
-            free($1);
+            free($1); CHECK;
        }
        | VIEW END_COMMAND {
-            hxfsterror("view not implemented\n");
-            return EXIT_FAILURE;
+            hfst::xfst::xfst_->view_net(); CHECK;
+            //hxfsterror("view not implemented\n");
+            //return EXIT_FAILURE;
        }
        // vars
        | SET NAMETOKEN NAMETOKEN END_COMMAND {
@@ -330,124 +333,124 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
             else
               hfst::xfst::xfst_->set($2, $3);
             free($2);
-            free($3);
+            free($3); CHECK;
        }
        | SHOW NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->show($2);
-            free($2);
+            free($2); CHECK;
        }
        | SHOW_ALL END_COMMAND {
-            hfst::xfst::xfst_->show();
+            hfst::xfst::xfst_->show(); CHECK;
        }
        | TWOSIDED_FLAGS END_COMMAND {
-            hfst::xfst::xfst_->twosided_flags();
+            hfst::xfst::xfst_->twosided_flags(); CHECK;
        }
        // tests
        | TEST_EQ END_COMMAND {
-            hfst::xfst::xfst_->test_eq();
+            hfst::xfst::xfst_->test_eq(); CHECK;
        }
        | TEST_FUNCT END_COMMAND {
-            hfst::xfst::xfst_->test_funct();
+            hfst::xfst::xfst_->test_funct(); CHECK;
        }
        | TEST_ID END_COMMAND {
-            hfst::xfst::xfst_->test_id();
+            hfst::xfst::xfst_->test_id(); CHECK;
        }
        | TEST_INFINITELY_AMBIGUOUS {
-            hfst::xfst::xfst_->test_infinitely_ambiguous();
+            hfst::xfst::xfst_->test_infinitely_ambiguous(); CHECK;
        }
        | TEST_LOWER_BOUNDED END_COMMAND {
-            hfst::xfst::xfst_->test_lower_bounded();
+            hfst::xfst::xfst_->test_lower_bounded(); CHECK;
        }
        | TEST_LOWER_UNI END_COMMAND {
-            hfst::xfst::xfst_->test_lower_uni();
+            hfst::xfst::xfst_->test_lower_uni(); CHECK;
        }
        | TEST_UPPER_BOUNDED END_COMMAND {
-            hfst::xfst::xfst_->test_upper_bounded();
+            hfst::xfst::xfst_->test_upper_bounded(); CHECK;
        }
        | TEST_UPPER_UNI END_COMMAND {
-            hfst::xfst::xfst_->test_upper_uni();
+            hfst::xfst::xfst_->test_upper_uni(); CHECK;
        }
        | TEST_NONNULL END_COMMAND {
-            hfst::xfst::xfst_->test_nonnull();
+            hfst::xfst::xfst_->test_nonnull(); CHECK;
        }
        | TEST_NULL END_COMMAND {
-            hfst::xfst::xfst_->test_null();
+            hfst::xfst::xfst_->test_null(); CHECK;
        }
        | TEST_OVERLAP END_COMMAND {
-            hfst::xfst::xfst_->test_overlap();
+            hfst::xfst::xfst_->test_overlap(); CHECK;
        }
        | TEST_SUBLANGUAGE END_COMMAND {
-            hfst::xfst::xfst_->test_sublanguage();
+            hfst::xfst::xfst_->test_sublanguage(); CHECK;
        }
        | TEST_UNAMBIGUOUS END_COMMAND {
-            hfst::xfst::xfst_->test_unambiguous();
+            hfst::xfst::xfst_->test_unambiguous(); CHECK;
        }
        // assertions
        | ASSERT TEST_EQ END_COMMAND {
-            hfst::xfst::xfst_->test_eq(true);
+            hfst::xfst::xfst_->test_eq(true); CHECK;
        }
        | ASSERT TEST_FUNCT END_COMMAND {
-            hfst::xfst::xfst_->test_funct(true);
+            hfst::xfst::xfst_->test_funct(true); CHECK;
        }
        | ASSERT TEST_ID END_COMMAND {
-            hfst::xfst::xfst_->test_id(true);
+            hfst::xfst::xfst_->test_id(true); CHECK;
        }
        | ASSERT TEST_LOWER_BOUNDED END_COMMAND {
-            hfst::xfst::xfst_->test_lower_bounded(true);
+            hfst::xfst::xfst_->test_lower_bounded(true); CHECK;
        }
        | ASSERT TEST_LOWER_UNI END_COMMAND {
-            hfst::xfst::xfst_->test_lower_uni(true);
+            hfst::xfst::xfst_->test_lower_uni(true); CHECK;
        }
        | ASSERT TEST_UPPER_BOUNDED END_COMMAND {
-            hfst::xfst::xfst_->test_upper_bounded(true);
+            hfst::xfst::xfst_->test_upper_bounded(true); CHECK;
        }
        | ASSERT TEST_UPPER_UNI END_COMMAND {
-            hfst::xfst::xfst_->test_upper_uni(true);
+            hfst::xfst::xfst_->test_upper_uni(true); CHECK;
        }
        | ASSERT TEST_NONNULL END_COMMAND {
-            hfst::xfst::xfst_->test_nonnull(true);
+            hfst::xfst::xfst_->test_nonnull(true); CHECK;
        }
        | ASSERT TEST_NULL END_COMMAND {
-            hfst::xfst::xfst_->test_null(true);
+            hfst::xfst::xfst_->test_null(true); CHECK;
        }
        | ASSERT TEST_OVERLAP END_COMMAND {
-            hfst::xfst::xfst_->test_overlap(true);
+            hfst::xfst::xfst_->test_overlap(true); CHECK;
        }
        | ASSERT TEST_SUBLANGUAGE END_COMMAND {
-            hfst::xfst::xfst_->test_sublanguage(true);
+            hfst::xfst::xfst_->test_sublanguage(true); CHECK;
        }
        | ASSERT TEST_UNAMBIGUOUS END_COMMAND {
-            hfst::xfst::xfst_->test_unambiguous(true);
+            hfst::xfst::xfst_->test_unambiguous(true); CHECK;
        }
        // substitutes
        | SUBSTITUTE_NAMED NAMETOKEN FOR NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->substitute_named($2, $4); // TODO!
             free($2);
-            free($4);
+            free($4); CHECK;
        }
        | SUBSTITUTE_LABEL LABEL_LIST FOR LABEL END_COMMAND {
             hfst::xfst::xfst_->substitute_label($2, $4);
             free($2);
-            free($4);
+            free($4); CHECK;
        }
        | SUBSTITUTE_SYMBOL QUOTED_NAMETOKEN_LIST FOR NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->substitute_symbol($2, $4);
             free($2);
-            free($4);
+            free($4); CHECK;
        }
        // prints
        | PRINT_ALIASES REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
-            hfst::xfst::xfst_->print_aliases(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_aliases(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_ALIASES END_COMMAND {
-            hfst::xfst::xfst_->print_aliases(stdout);
+            hfst::xfst::xfst_->print_aliases(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_ARCCOUNT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_arc_count(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_arc_count(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_ARCCOUNT NAMETOKEN END_COMMAND {
             if (strcmp($2, "upper") && strcmp($2, "lower"))
@@ -455,379 +458,459 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
                 hxfsterror("should be upper or lower");
                 return EXIT_FAILURE;
             }
-            hfst::xfst::xfst_->print_arc_count($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_arc_count($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_ARCCOUNT END_COMMAND {
-            hfst::xfst::xfst_->print_arc_count(stdout);
+            hfst::xfst::xfst_->print_arc_count(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_DEFINED REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_defined(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_defined(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_DEFINED END_COMMAND {
-            hfst::xfst::xfst_->print_defined(stdout);
+            hfst::xfst::xfst_->print_defined(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_DIR GLOB REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
-            hfst::xfst::xfst_->print_dir($2, f);
-            hfst::xfst::xfst_fclose(f, $3);
-            free($3);
+            std::ofstream oss($3);
+            hfst::xfst::xfst_->print_dir($2, &oss);
+            oss.close();
+            free($3); CHECK;
        }
        | PRINT_DIR GLOB END_COMMAND {
-            hfst::xfst::xfst_->print_dir($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_dir($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_DIR REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_dir("*", f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_dir("*", &oss);
+            oss.close(); CHECK;
        }
        | PRINT_DIR END_COMMAND {
-            hfst::xfst::xfst_->print_dir("*", stdout);
+            hfst::xfst::xfst_->print_dir("*", &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_FILE_INFO REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_file_info(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_file_info(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_FILE_INFO END_COMMAND {
-            hfst::xfst::xfst_->print_file_info(stdout);
+            hfst::xfst::xfst_->print_file_info(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_FLAGS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_flags(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_flags(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_FLAGS END_COMMAND {
-            hfst::xfst::xfst_->print_flags(stdout);
+            hfst::xfst::xfst_->print_flags(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_LABELS NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_labels($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_labels($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_LABELS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_labels(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_labels(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_LABELS END_COMMAND {
-            hfst::xfst::xfst_->print_labels(stdout);
+            hfst::xfst::xfst_->print_labels(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_LABEL_COUNT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_label_count(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_label_count(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_LABEL_COUNT END_COMMAND {
-            hfst::xfst::xfst_->print_label_count(stdout);
+            hfst::xfst::xfst_->print_label_count(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_LIST NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
-            hfst::xfst::xfst_->print_list($2, f);
-            hfst::xfst::xfst_fclose(f, $3);
-            free($2);
+            std::ofstream oss($3);
+            hfst::xfst::xfst_->print_list($2, &oss);
+            oss.close();
+            free($2); CHECK;
        }
        | PRINT_LIST NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_list($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_list($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_LISTS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_list(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_list(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_LISTS END_COMMAND {
-            hfst::xfst::xfst_->print_list(stdout);
+            hfst::xfst::xfst_->print_list(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_LONGEST_STRING REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_longest_string(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_longest_string(&oss);
+            //hfst::xfst::xfst_fclose(f, $2); 
+            oss.close();
+            CHECK;
        }
        | PRINT_LONGEST_STRING END_COMMAND {
-            hfst::xfst::xfst_->print_longest_string(stdout);
+            //hfst::xfst::xfst_->print_longest_string(&hfst::xfst::xfst_->get_output_stream()); 
+            hfst::xfst::xfst_->print_longest_string(&hfst::xfst::xfst_->get_output_stream()); 
+            CHECK;
        }
        | PRINT_LONGEST_STRING_SIZE REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_longest_string_size(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_longest_string_size(&oss);
+            //hfst::xfst::xfst_fclose(f, $2); 
+            oss.close();
+            CHECK;
        }
        | PRINT_LONGEST_STRING_SIZE END_COMMAND {
-            hfst::xfst::xfst_->print_longest_string_size(stdout);
+            //hfst::xfst::xfst_->print_longest_string_size(&hfst::xfst::xfst_->get_output_stream()); 
+            hfst::xfst::xfst_->print_longest_string_size(&hfst::xfst::xfst_->get_output_stream()); 
+            CHECK;
        }
        | PRINT_NAME REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_name(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_name(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_NAME END_COMMAND {
-            hfst::xfst::xfst_->print_name(stdout);
+            hfst::xfst::xfst_->print_name(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_SHORTEST_STRING REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_shortest_string(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_shortest_string(&oss);
+            //hfst::xfst::xfst_fclose(f, $2);
+            oss.close();
+            CHECK;
        }
        | PRINT_SHORTEST_STRING END_COMMAND {
-            hfst::xfst::xfst_->print_shortest_string(stdout);
+            //hfst::xfst::xfst_->print_shortest_string(&hfst::xfst::xfst_->get_output_stream()); 
+            hfst::xfst::xfst_->print_shortest_string(&hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_SHORTEST_STRING_SIZE REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_shortest_string_size(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_shortest_string_size(&oss);
+            //hfst::xfst::xfst_fclose(f, $2);
+            oss.close(); 
+            CHECK;
        }
        | PRINT_SHORTEST_STRING_SIZE END_COMMAND {
-            hfst::xfst::xfst_->print_shortest_string_size(stdout);
+            //hfst::xfst::xfst_->print_shortest_string_size(&hfst::xfst::xfst_->get_output_stream()); 
+            hfst::xfst::xfst_->print_shortest_string_size(&hfst::xfst::xfst_->get_output_stream()); 
+            CHECK;
        }
        | PRINT_LOWER_WORDS NAMETOKEN NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_lower_words($2, hfst::xfst::nametoken_to_number($3), stdout);
-            free($2);
+            hfst::xfst::xfst_->print_lower_words($2, hfst::xfst::nametoken_to_number($3), &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_LOWER_WORDS NAMETOKEN NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($4, "w");
-            hfst::xfst::xfst_->print_lower_words($2, hfst::xfst::nametoken_to_number($3), f);
+            //std::ofstream oss($4, "w");
+            std::ofstream oss($4);
+            hfst::xfst::xfst_->print_lower_words($2, hfst::xfst::nametoken_to_number($3), &oss);
             free($2);
-            hfst::xfst::xfst_fclose(f, $4);
+            //hfst::xfst::xfst_fclose(f, $4); 
+            oss.close();
+            CHECK;
        }
        | PRINT_LOWER_WORDS NAMETOKEN END_COMMAND {
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_lower_words(NULL, i, stdout);
+              hfst::xfst::xfst_->print_lower_words(NULL, i, &hfst::xfst::xfst_->get_output_stream());
             else
-              hfst::xfst::xfst_->print_lower_words($2, 0, stdout);
+              hfst::xfst::xfst_->print_lower_words($2, 0, &hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_LOWER_WORDS END_COMMAND {
-            hfst::xfst::xfst_->print_lower_words(NULL, 0, stdout);
+            hfst::xfst::xfst_->print_lower_words(NULL, 0, &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_LOWER_WORDS NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
+            //std::ofstream oss($3);
+            std::ofstream oss($3);
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_lower_words(NULL, i, f);
+              hfst::xfst::xfst_->print_lower_words(NULL, i, &oss);
             else
-              hfst::xfst::xfst_->print_lower_words($2, 0, f);
-            hfst::xfst::xfst_fclose(f, $3);
+              hfst::xfst::xfst_->print_lower_words($2, 0, &oss);
+            //hfst::xfst::xfst_fclose(f, $3); 
+            oss.close();
+            CHECK;
        }
        | PRINT_LOWER_WORDS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_lower_words(NULL, 0, f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_lower_words(NULL, 0, &oss);
+            //hfst::xfst::xfst_fclose(f, $2); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_LOWER NAMETOKEN NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_random_lower($2, hfst::xfst::nametoken_to_number($3), stdout);
-            free($2);
+            hfst::xfst::xfst_->print_random_lower($2, hfst::xfst::nametoken_to_number($3), &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_RANDOM_LOWER NAMETOKEN NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($4, "w");
-            hfst::xfst::xfst_->print_random_lower($2, hfst::xfst::nametoken_to_number($3), f);
+            //std::ofstream oss($4, "w");
+            std::ofstream oss($4);
+            hfst::xfst::xfst_->print_random_lower($2, hfst::xfst::nametoken_to_number($3), &oss);
             free($2);
-            hfst::xfst::xfst_fclose(f, $4);
+            oss.close();
+            //hfst::xfst::xfst_fclose(f, $4); 
+            CHECK;
        }
        | PRINT_RANDOM_LOWER NAMETOKEN END_COMMAND {
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_random_lower(NULL, i, stdout);
+              hfst::xfst::xfst_->print_random_lower(NULL, i, &hfst::xfst::xfst_->get_output_stream());
             else
-              hfst::xfst::xfst_->print_random_lower($2, 15, stdout);
+              hfst::xfst::xfst_->print_random_lower($2, 15, &hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_RANDOM_LOWER END_COMMAND {
-            hfst::xfst::xfst_->print_random_lower(NULL, 15, stdout);
+            hfst::xfst::xfst_->print_random_lower(NULL, 15, &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_RANDOM_LOWER NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
+            //std::ofstream oss($3);
+            std::ofstream oss($3);
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_random_lower(NULL, i, f);
+              hfst::xfst::xfst_->print_random_lower(NULL, i, &oss);
             else
-              hfst::xfst::xfst_->print_random_lower($2, 15, f);
-            hfst::xfst::xfst_fclose(f, $3);
+              hfst::xfst::xfst_->print_random_lower($2, 15, &oss);
+            //hfst::xfst::xfst_fclose(f, $3); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_LOWER REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_random_lower(NULL, 15, f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_random_lower(NULL, 15, &oss);
+            //hfst::xfst::xfst_fclose(f, $2); 
+            oss.close();
+            CHECK;
        }
        | PRINT_UPPER_WORDS NAMETOKEN NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_upper_words($2, hfst::xfst::nametoken_to_number($3), stdout);
-            free($2);
+            hfst::xfst::xfst_->print_upper_words($2, hfst::xfst::nametoken_to_number($3), &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_UPPER_WORDS NAMETOKEN NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($4, "w");
-            hfst::xfst::xfst_->print_upper_words($2, hfst::xfst::nametoken_to_number($3), f);
+            //std::ofstream oss($4, "w");
+            std::ofstream oss($4);
+            hfst::xfst::xfst_->print_upper_words($2, hfst::xfst::nametoken_to_number($3), &oss);
             free($2);
-            hfst::xfst::xfst_fclose(f, $4);
+            //hfst::xfst::xfst_fclose(f, $4); 
+            oss.close();
+            CHECK;
        }
        | PRINT_UPPER_WORDS NAMETOKEN END_COMMAND {
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_upper_words(NULL, i, stdout);
+              hfst::xfst::xfst_->print_upper_words(NULL, i, &hfst::xfst::xfst_->get_output_stream());
             else
-              hfst::xfst::xfst_->print_upper_words($2, 0, stdout);
+              hfst::xfst::xfst_->print_upper_words($2, 0, &hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_UPPER_WORDS END_COMMAND {
-            hfst::xfst::xfst_->print_upper_words(NULL, 0, stdout);
+            hfst::xfst::xfst_->print_upper_words(NULL, 0, &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_UPPER_WORDS NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
+            //std::ofstream oss($3);
+            std::ofstream oss($3);
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_upper_words(NULL, i, f);
+              hfst::xfst::xfst_->print_upper_words(NULL, i, &oss);
             else
-              hfst::xfst::xfst_->print_upper_words($2, 0, f);
-            hfst::xfst::xfst_fclose(f, $3);
+              hfst::xfst::xfst_->print_upper_words($2, 0, &oss);
+            //hfst::xfst::xfst_fclose(f, $3); 
+            oss.close();
+            CHECK;
        }
        | PRINT_UPPER_WORDS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_upper_words(NULL, 0, f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2); 
+            hfst::xfst::xfst_->print_upper_words(NULL, 0, &oss);
+            //hfst::xfst::xfst_fclose(f, $2); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_UPPER NAMETOKEN NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_random_upper($2, hfst::xfst::nametoken_to_number($3), stdout);
-            free($2);
+            hfst::xfst::xfst_->print_random_upper($2, hfst::xfst::nametoken_to_number($3), &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_RANDOM_UPPER NAMETOKEN NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($4, "w");
-            hfst::xfst::xfst_->print_random_upper($2, hfst::xfst::nametoken_to_number($3), f);
+            //std::ofstream oss($4, "w");
+            std::ofstream oss($4);
+            hfst::xfst::xfst_->print_random_upper($2, hfst::xfst::nametoken_to_number($3), &oss);
             free($2);
-            hfst::xfst::xfst_fclose(f, $4);
+            //hfst::xfst::xfst_fclose(f, $4); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_UPPER NAMETOKEN END_COMMAND {
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_random_upper(NULL, i, stdout);
+              hfst::xfst::xfst_->print_random_upper(NULL, i, &hfst::xfst::xfst_->get_output_stream());
             else
-              hfst::xfst::xfst_->print_random_upper($2, 15, stdout);
+              hfst::xfst::xfst_->print_random_upper($2, 15, &hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_RANDOM_UPPER END_COMMAND {
-            hfst::xfst::xfst_->print_random_upper(NULL, 15, stdout);
+            hfst::xfst::xfst_->print_random_upper(NULL, 15, &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_RANDOM_UPPER NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
+            //std::ofstream oss($3);
+            std::ofstream oss($3);
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_random_upper(NULL, i, f);
+              hfst::xfst::xfst_->print_random_upper(NULL, i, &oss);
             else
-              hfst::xfst::xfst_->print_random_upper($2, 15, f);
-            hfst::xfst::xfst_fclose(f, $3);
+              hfst::xfst::xfst_->print_random_upper($2, 15, &oss);
+            //hfst::xfst::xfst_fclose(f, $3); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_UPPER REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_random_upper(NULL, 15, f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_random_upper(NULL, 15, &oss);
+            //hfst::xfst::xfst_fclose(f, $2);
+            oss.close();
+            CHECK;
        }
        | PRINT_WORDS NAMETOKEN NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_words($2, hfst::xfst::nametoken_to_number($3), stdout);
-            free($2);
+            hfst::xfst::xfst_->print_words($2, hfst::xfst::nametoken_to_number($3), &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_WORDS NAMETOKEN NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($4, "w");
-            hfst::xfst::xfst_->print_words($2, hfst::xfst::nametoken_to_number($3), f);
+            //std::ofstream oss($4, "w");
+            std::ofstream oss($4);
+            hfst::xfst::xfst_->print_words($2, hfst::xfst::nametoken_to_number($3), &oss);
             free($2);
-            hfst::xfst::xfst_fclose(f, $4);
+            //hfst::xfst::xfst_fclose(f, $4); 
+            oss.close();
+            CHECK;
        }
        | PRINT_WORDS NAMETOKEN END_COMMAND {
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_words(NULL, i, stdout);
+              hfst::xfst::xfst_->print_words(NULL, i, &hfst::xfst::xfst_->get_output_stream());
             else
-              hfst::xfst::xfst_->print_words($2, 0, stdout);
+              hfst::xfst::xfst_->print_words($2, 0, &hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_WORDS END_COMMAND {
-            hfst::xfst::xfst_->print_words(NULL, 0, stdout);
+            hfst::xfst::xfst_->print_words(NULL, 0, &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_WORDS NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
+            //std::ofstream oss($3);
+            std::ofstream oss($3);
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_words(NULL, i, f);
+              hfst::xfst::xfst_->print_words(NULL, i, &oss);
             else
-              hfst::xfst::xfst_->print_words($2, 0, f);
-            hfst::xfst::xfst_fclose(f, $3);
+              hfst::xfst::xfst_->print_words($2, 0, &oss);
+            //hfst::xfst::xfst_fclose(f, $3); 
+            oss.close();
+            CHECK;
        }
        | PRINT_WORDS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_words(NULL, 0, f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_words(NULL, 0, &oss);
+            oss.close();
+            //hfst::xfst::xfst_fclose(f, $2); 
+            CHECK;
        }
        | PRINT_RANDOM_WORDS NAMETOKEN NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_random_words($2, hfst::xfst::nametoken_to_number($3), stdout);
-            free($2);
+            hfst::xfst::xfst_->print_random_words($2, hfst::xfst::nametoken_to_number($3), &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_RANDOM_WORDS NAMETOKEN NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($4, "w");
-            hfst::xfst::xfst_->print_random_words($2, hfst::xfst::nametoken_to_number($3), f);
+            //std::ofstream oss($4, "w");
+            std::ofstream oss($4);
+            hfst::xfst::xfst_->print_random_words($2, hfst::xfst::nametoken_to_number($3), &oss);
             free($2);
-            hfst::xfst::xfst_fclose(f, $4);
+            //hfst::xfst::xfst_fclose(f, $4); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_WORDS NAMETOKEN END_COMMAND {
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_random_words(NULL, i, stdout);
+              hfst::xfst::xfst_->print_random_words(NULL, i, &hfst::xfst::xfst_->get_output_stream());
             else
-              hfst::xfst::xfst_->print_random_words($2, 15, stdout);
+              hfst::xfst::xfst_->print_random_words($2, 15, &hfst::xfst::xfst_->get_output_stream());
+            CHECK;
        }
        | PRINT_RANDOM_WORDS END_COMMAND {
-            hfst::xfst::xfst_->print_random_words(NULL, 15, stdout);
+            hfst::xfst::xfst_->print_random_words(NULL, 15, &hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_RANDOM_WORDS NAMETOKEN REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($3, "w");
+            //std::ofstream oss($3);
+            std::ofstream oss($3);
             int i = hfst::xfst::nametoken_to_number($2);
             if (i != -1)
-              hfst::xfst::xfst_->print_random_words(NULL, i, f);
+              hfst::xfst::xfst_->print_random_words(NULL, i, &oss);
             else
-              hfst::xfst::xfst_->print_random_words($2, 15, f);
-            hfst::xfst::xfst_fclose(f, $3);
+              hfst::xfst::xfst_->print_random_words($2, 15, &oss);
+            //hfst::xfst::xfst_fclose(f, $3); 
+            oss.close();
+            CHECK;
        }
        | PRINT_RANDOM_WORDS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_random_words(NULL, 15, f);
-            hfst::xfst::xfst_fclose(f, $2);
+            //std::ofstream oss($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_random_words(NULL, 15, &oss);
+            //hfst::xfst::xfst_fclose(f, $2); 
+            oss.close();
+            CHECK;
        }
        | PRINT NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_net($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_net($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_net(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_net(&oss);
+            oss.close(); CHECK;
        }
        | PRINT END_COMMAND {
-            hfst::xfst::xfst_->print_net(stdout);
+            hfst::xfst::xfst_->print_net(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_PROPS NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_properties($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_properties($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_PROPS END_COMMAND {
-            hfst::xfst::xfst_->print_properties(stdout);
+            hfst::xfst::xfst_->print_properties(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_PROPS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_properties(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_properties(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_SIGMA NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_sigma($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_sigma($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_SIGMA REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_sigma(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_sigma(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_SIGMA END_COMMAND {
-            hfst::xfst::xfst_->print_sigma(stdout);
+            hfst::xfst::xfst_->print_sigma(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_SIGMA_COUNT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_sigma_count(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_sigma_count(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_SIGMA_COUNT END_COMMAND {
-            hfst::xfst::xfst_->print_sigma_count(stdout);
+            hfst::xfst::xfst_->print_sigma_count(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_SIGMA_WORD_COUNT NAMETOKEN END_COMMAND {
             if (strcmp($2, "upper") && strcmp($2, "lower"))
@@ -835,295 +918,298 @@ COMMAND: ADD_PROPS REDIRECT_IN END_COMMAND {
                 hxfsterror("must be upper or lower\n");
                 return EXIT_FAILURE;
             }
-            hfst::xfst::xfst_->print_sigma_word_count($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_sigma_word_count($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_SIGMA_WORD_COUNT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_sigma_word_count(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_sigma_word_count(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_SIGMA_WORD_COUNT END_COMMAND {
-            hfst::xfst::xfst_->print_sigma_word_count(stdout);
+            hfst::xfst::xfst_->print_sigma_word_count(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_SIZE NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->print_size($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->print_size($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | PRINT_SIZE REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_size(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_size(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_SIZE END_COMMAND {
-            hfst::xfst::xfst_->print_size(stdout);
+            hfst::xfst::xfst_->print_size(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_STACK REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_stack(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_stack(&oss);
+            oss.close(); CHECK;
        }
        | PRINT_STACK END_COMMAND {
-            hfst::xfst::xfst_->print_stack(stdout);
+            hfst::xfst::xfst_->print_stack(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | PRINT_LABELMAPS REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->print_labelmaps(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->print_labelmaps(&oss);
+            oss.close(); CHECK;
        }
        // writes
        | SAVE_DOT NAMETOKEN END_COMMAND {
-            hfst::xfst::xfst_->write_dot($2, stdout);
-            free($2);
+            hfst::xfst::xfst_->write_dot($2, &hfst::xfst::xfst_->get_output_stream());
+            free($2); CHECK;
        }
        | SAVE_DOT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_dot(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_dot(&oss);
+            oss.close(); CHECK;
        }
        | SAVE_DOT END_COMMAND {
-            hfst::xfst::xfst_->write_dot(stdout);
+            hfst::xfst::xfst_->write_dot(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | SAVE_DEFINITION NAMETOKEN LEFT_PAREN REDIRECT_OUT END_COMMAND {
             hfst::xfst::xfst_->write_function($2, $4);
-            free($2);
+            free($2); CHECK;
        }
        | SAVE_DEFINITION NAMETOKEN LEFT_PAREN END_COMMAND {
             hfst::xfst::xfst_->write_function($2, 0);
-            free($2);
+            free($2); CHECK;
        }
        | SAVE_DEFINITION NAMETOKEN REDIRECT_OUT END_COMMAND {
             hfst::xfst::xfst_->write_definition($2, $3);
-            free($2);
+            free($2); CHECK;
        }
        | SAVE_DEFINITION NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->write_definition($2, 0);
-            free($2);
+            free($2); CHECK;
        }
        | SAVE_DEFINITIONS REDIRECT_OUT END_COMMAND {    
-            hfst::xfst::xfst_->write_definitions($2);
+            hfst::xfst::xfst_->write_definitions($2); CHECK;
        }
        | SAVE_DEFINITIONS END_COMMAND {
-            hfst::xfst::xfst_->write_definitions(0);
+            hfst::xfst::xfst_->write_definitions(0); CHECK;
        }
        | SAVE_STACK NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->write_stack($2);
-            free($2);
+            free($2); CHECK;
        }
        | SAVE_PROLOG REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_prolog(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_prolog(&oss);
+            oss.close(); CHECK;
        }
        | SAVE_PROLOG NAMETOKEN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_prolog(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_prolog(&oss);
+            oss.close(); CHECK;
        }
        | SAVE_PROLOG END_COMMAND {
-            hfst::xfst::xfst_->write_prolog(stdout);
+            hfst::xfst::xfst_->write_prolog(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | SAVE_SPACED REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_spaced(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_spaced(&oss);
+            oss.close(); CHECK;
        }
        | SAVE_SPACED END_COMMAND {
-            hfst::xfst::xfst_->write_spaced(stdout);
+            hfst::xfst::xfst_->write_spaced(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | SAVE_TEXT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_text(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_text(&oss);
+            oss.close(); CHECK;
        }
        | SAVE_TEXT END_COMMAND {
-            hfst::xfst::xfst_->write_text(stdout);
+            hfst::xfst::xfst_->write_text(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        // reads
        | READ_PROPS REDIRECT_IN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->read_props(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | READ_PROPS END_COMMAND {
-            hfst::xfst::xfst_->read_props(stdin);
+            hfst::xfst::xfst_->read_props(stdin); CHECK;
        }
        | READ_PROLOG NAMETOKEN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->read_prolog(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | READ_PROLOG END_COMMAND {
-            hfst::xfst::xfst_->read_prolog(stdin);
+            hfst::xfst::xfst_->read_prolog(stdin); CHECK;
        }
        | READ_REGEX REGEX {
             hfst::xfst::xfst_->read_regex($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_REGEX REDIRECT_IN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "r");
+            FILE * f = hfst::xfst::xfst_->xfst_fopen($2, "r"); CHECK;
             hfst::xfst::xfst_->read_regex(f);
-            hfst::xfst::xfst_fclose(f, $2);
+            hfst::xfst::xfst_->xfst_fclose(f, $2); CHECK;
        }
        | READ_REGEX NAMETOKEN_LIST SEMICOLON END_COMMAND {
             hfst::xfst::xfst_->read_regex($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_SPACED REDIRECT_IN END_COMMAND {
             hfst::xfst::xfst_->read_spaced_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_SPACED NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->read_spaced_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_SPACED NAMETOKEN_LIST CTRLD {
             hfst::xfst::xfst_->read_spaced($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_TEXT REDIRECT_IN END_COMMAND {
             hfst::xfst::xfst_->read_text_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_TEXT NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->read_text_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_TEXT NAMETOKEN_LIST CTRLD {
             hfst::xfst::xfst_->read_text($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_LEXC NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->read_lexc_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_LEXC NAMETOKEN SEMICOLON END_COMMAND {
             hfst::xfst::xfst_->read_lexc_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | READ_LEXC NAMETOKEN_LIST CTRLD {
-            hfst::xfst::xfst_->read_lexc_from_file("");
+            hfst::xfst::xfst_->read_lexc_from_file(""); CHECK;
        }
        | READ_ATT NAMETOKEN END_COMMAND {
             hfst::xfst::xfst_->read_att_from_file($2);
-            free($2);
+            free($2); CHECK;
        }
        | WRITE_ATT END_COMMAND {
-            hfst::xfst::xfst_->write_att(stdout);       
+            hfst::xfst::xfst_->write_att(&hfst::xfst::xfst_->get_output_stream()); CHECK;
        }
        | WRITE_ATT REDIRECT_OUT END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_att(f);
-            hfst::xfst::xfst_fclose(f, $2);
-            free($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_att(&oss);
+            oss.close();
+            free($2); CHECK;
        }
        | WRITE_ATT NAMETOKEN END_COMMAND {
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_att(f);
-            hfst::xfst::xfst_fclose(f, $2);
-            free($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_att(&oss);
+            oss.close();
+            free($2); CHECK;
        }
        | WRITE_ATT NAMETOKEN NAMETOKEN NAMETOKEN END_COMMAND {
             // todo: handle input and output symbol tables
-            FILE * f = hfst::xfst::xfst_fopen($2, "w");
-            hfst::xfst::xfst_->write_att(f);
-            hfst::xfst::xfst_fclose(f, $2);
-            free($2);
+            std::ofstream oss($2);
+            hfst::xfst::xfst_->write_att(&oss);
+            oss.close();
+            free($2); CHECK;
        }
        // net ops
        | CLEANUP END_COMMAND {
-            hfst::xfst::xfst_->cleanup_net();
+            hfst::xfst::xfst_->cleanup_net(); CHECK;
        }
        | COMPLETE END_COMMAND {
-            hfst::xfst::xfst_->complete_net();
+            hfst::xfst::xfst_->complete_net(); CHECK;
        }
        | COMPOSE END_COMMAND {
-            hfst::xfst::xfst_->compose_net();
+            hfst::xfst::xfst_->compose_net(); CHECK;
        }
        | CONCATENATE END_COMMAND {
-            hfst::xfst::xfst_->concatenate_net();
+            hfst::xfst::xfst_->concatenate_net(); CHECK;
        }
        | MINUS END_COMMAND {
-            hfst::xfst::xfst_->minus_net();
+            hfst::xfst::xfst_->minus_net(); CHECK;
        }
        | CROSSPRODUCT END_COMMAND {
-            hfst::xfst::xfst_->crossproduct_net();
+            hfst::xfst::xfst_->crossproduct_net(); CHECK;
        }
        | MINIMIZE END_COMMAND {
-            hfst::xfst::xfst_->minimize_net();
+            hfst::xfst::xfst_->minimize_net(); CHECK;
        }
        | DETERMINIZE END_COMMAND {
-            hfst::xfst::xfst_->determinize_net();
+            hfst::xfst::xfst_->determinize_net(); CHECK;
        }
        | EPSILON_REMOVE END_COMMAND {
-            hfst::xfst::xfst_->epsilon_remove_net();
+            hfst::xfst::xfst_->epsilon_remove_net(); CHECK;
        }
        | PRUNE_NET END_COMMAND {
-            hfst::xfst::xfst_->prune_net();
+            hfst::xfst::xfst_->prune_net(); CHECK;
        }
        | XFST_IGNORE END_COMMAND {
-            hfst::xfst::xfst_->ignore_net();
+            hfst::xfst::xfst_->ignore_net(); CHECK;
        }
        | INTERSECT END_COMMAND {
-            hfst::xfst::xfst_->intersect_net();
+            hfst::xfst::xfst_->intersect_net(); CHECK;
        }
        | INSPECT END_COMMAND {
-            hfst::xfst::xfst_->inspect_net();
+            hfst::xfst::xfst_->inspect_net(); CHECK;
        }
        | INVERT END_COMMAND {
-            hfst::xfst::xfst_->invert_net();
+            hfst::xfst::xfst_->invert_net(); CHECK;
        }
        | LOWER_SIDE END_COMMAND {
-            hfst::xfst::xfst_->lower_side_net();
+            hfst::xfst::xfst_->lower_side_net(); CHECK;
        }
        | UPPER_SIDE END_COMMAND {
-            hfst::xfst::xfst_->upper_side_net();
+            hfst::xfst::xfst_->upper_side_net(); CHECK;
        }
        | NEGATE END_COMMAND {
-            hfst::xfst::xfst_->negate_net();
+            hfst::xfst::xfst_->negate_net(); CHECK;
        }
        | ONE_PLUS END_COMMAND {
-            hfst::xfst::xfst_->one_plus_net();
+            hfst::xfst::xfst_->one_plus_net(); CHECK;
        }
        | ZERO_PLUS END_COMMAND {
-            hfst::xfst::xfst_->zero_plus_net();
+            hfst::xfst::xfst_->zero_plus_net(); CHECK;
        }
        | XFST_OPTIONAL END_COMMAND {
-            hfst::xfst::xfst_->optional_net();
+            hfst::xfst::xfst_->optional_net(); CHECK;
        }
        | REVERSE END_COMMAND {
-            hfst::xfst::xfst_->reverse_net();
+            hfst::xfst::xfst_->reverse_net(); CHECK;
        }
        | SHUFFLE END_COMMAND {
-            hfst::xfst::xfst_->shuffle_net();
+            hfst::xfst::xfst_->shuffle_net(); CHECK;
        }
        | SIGMA END_COMMAND {
-            hfst::xfst::xfst_->sigma_net();
+            hfst::xfst::xfst_->sigma_net(); CHECK;
        }
        | SORT END_COMMAND {
-            hfst::xfst::xfst_->sort_net();
+            hfst::xfst::xfst_->sort_net(); CHECK;
        }
        | SUBSTRING END_COMMAND {
-            hfst::xfst::xfst_->substring_net();
+            hfst::xfst::xfst_->substring_net(); CHECK;
        }
        | UNION END_COMMAND {
-            hfst::xfst::xfst_->union_net();
+            hfst::xfst::xfst_->union_net(); CHECK;
        }
        | LABEL_NET END_COMMAND {
-            hfst::xfst::xfst_->label_net();
+            hfst::xfst::xfst_->label_net(); CHECK;
        }
        | COMPILE_REPLACE_LOWER END_COMMAND {
-            hfst::xfst::xfst_->compile_replace_lower_net();
+            hfst::xfst::xfst_->compile_replace_lower_net(); CHECK;
        }
        | COMPILE_REPLACE_UPPER END_COMMAND {
-            hfst::xfst::xfst_->compile_replace_upper_net();
+            hfst::xfst::xfst_->compile_replace_upper_net(); CHECK;
        }
        | END_COMMAND {
-            hfst::xfst::xfst_->prompt();
+            hfst::xfst::xfst_->prompt(); CHECK;
        }
        | NAMETOKEN END_COMMAND {
-            fprintf(stderr, "Command %s is not recognised.\n", $1);
-            hfst::xfst::xfst_->prompt();
+            if ( hfst::xfst::xfst_->unknown_command($1) != 0) 
+              { 
+                hxfsterror("Command not recognized.\n");
+                YYABORT;
+              }
        }
        ;
 
@@ -1271,7 +1357,9 @@ int hxfstparse(void);
 void
 hxfsterror(const char* text)
 { 
-    fprintf(stderr,  "%s\n", text);
+    hfst::xfst::xfst_->error() << text << std::endl;
+    hfst::xfst::xfst_->flush(&hfst::xfst::xfst_->error());
+    //fprintf(stderr,  "%s\n", text);
 }
 
 
diff --git a/tools/src/parsers/xfst-utils.cc b/libhfst/src/parsers/xfst-utils.cc
similarity index 89%
rename from tools/src/parsers/xfst-utils.cc
rename to libhfst/src/parsers/xfst-utils.cc
index dc835d6..c50aebc 100644
--- a/tools/src/parsers/xfst-utils.cc
+++ b/libhfst/src/parsers/xfst-utils.cc
@@ -52,32 +52,33 @@ namespace hfst { namespace xfst {
         char* r = fgets(*s, *n, f);
         if (r == 0)
           {
-            fprintf(stderr, "unable to read in substitute getline\n");
+            //fprintf(stderr, "unable to read in substitute getline\n");
             return -1;
           }
         return *n;
-       }
+      }
 #endif
 
-void
-xfst_fclose(FILE * file, const char * name)
-{
-  if (0 != fclose(file))
-    {
-      fprintf(stderr, "Unable to close %s: %s\n", name, strerror(errno));
-    }
-}
-
-FILE*
-xfst_fopen(const char* path, const char* mode)
-  {
-    FILE* f = fopen(path, mode);
-    if (f == NULL)
-      {
-        fprintf(stderr, "Unable to open %s: %s\n", path, strerror(errno));
-      }
-    return f;
-  }
+    //void
+    //xfst_fclose(FILE * file, const char * name)
+    //{
+    //return fclose(file))
+    //{
+    //  //fprintf(stderr, "Unable to close %s: %s\n", name, strerror(errno));
+    //  throw strerr;
+    //}
+    //}
+
+    //FILE*
+    //xfst_fopen(const char* path, const char* mode)
+    //{
+    //FILE* f = fopen(path, mode);
+    //if (f == NULL)
+    //  {
+    //    fprintf(stderr, "Unable to open %s: %s\n", path, strerror(errno));
+    //  }
+    //return f;
+    //}
 
 char*
 strdup_token_part()
@@ -104,7 +105,7 @@ strdup_token_part()
     return error_token;
 }
 
-char*
+    /*char*
 strip_percents(const char* s, bool do_zeros)
 {
     char* rv = (char*)malloc(sizeof(char)*strlen(s)*6+1);
@@ -166,7 +167,7 @@ strip_percents(const char* s, bool do_zeros)
         return NULL;
     }
     return rv;
-}
+    }*/
 
 char*
 strstrip(const char* s)
diff --git a/tools/src/parsers/xfst-utils.h b/libhfst/src/parsers/xfst-utils.h
similarity index 90%
rename from tools/src/parsers/xfst-utils.h
rename to libhfst/src/parsers/xfst-utils.h
index 3a022e6..e15bd3e 100644
--- a/tools/src/parsers/xfst-utils.h
+++ b/libhfst/src/parsers/xfst-utils.h
@@ -34,13 +34,13 @@ namespace hfst { namespace xfst {
 
 #ifndef HAVE_GETLINE
 #   define MAX_LINE_SIZE 12345678
-ssize_t getline(char** line, size_t* n, FILE* f);
+    ssize_t getline(char** line, size_t* n, FILE* f);
 #endif
 
 //! @brief Open file and print XFSTish stuff
-FILE* xfst_fopen(const char* path, const char* mode);
+//FILE* xfst_fopen(const char* path, const char* mode);
 //! @brief Close \a file that has \a name.
- void xfst_fclose(FILE * file, const char * name);
+// void xfst_fclose(FILE * file, const char * name);
 //! @brief Strips initial and final white space and strdups
 char* strstrip(const char* s);
 
diff --git a/tools/src/parsers/xfst_help_message.cc b/libhfst/src/parsers/xfst_help_message.cc
similarity index 85%
rename from tools/src/parsers/xfst_help_message.cc
rename to libhfst/src/parsers/xfst_help_message.cc
index 246d68d..830f7b6 100644
--- a/tools/src/parsers/xfst_help_message.cc
+++ b/libhfst/src/parsers/xfst_help_message.cc
@@ -262,16 +262,12 @@ bool handle_case(const std::string & names, const std::string & arguments,
   //COMMAND("apply med <string>, apply med", "find approximate matches to string in top network by minimum edit distance");
   COMMAND("apropos", "<string>",
           "search help for <string>");
-  COMMAND("add properties, add", "", 
-          "<no description>");
-  COMMAND("alias", "", 
-          "<no description>");
-  COMMAND("cleanup net, cleanup", "", 
-          "<no description>");
+  //COMMAND("add properties, add", "", "<not implemented>");
+  //COMMAND("alias", "", "<not implemented>");
+  //COMMAND("cleanup net, cleanup", "", "<not implemented>");
   COMMAND("clear stack, clear", "", 
           "clears the stack");
-  COMMAND("collect epsilon-loops, epsilon-loops", "", 
-          "<no description>");
+  //COMMAND("collect epsilon-loops, epsilon-loops", "", "<not implemented>");
   //"compile-replace lower, com-rep lower"
   //"compile-replace upper, com-rep upper"
   COMMAND("compact sigma", "", "removes redundant symbols from FSM");
@@ -283,18 +279,18 @@ bool handle_case(const std::string & names, const std::string & arguments,
   COMMAND("define", "<fname>(<v1,..,vn>) <r.e.>", "define function");
   COMMAND("determinize net, determinize, determinise net, determinise", "", "determinizes top FSM on stack"); 
   COMMAND("echo", "<string>", "echo a string");
-  COMMAND("edit properties, edit", "", "<no description>");
+  //COMMAND("edit properties, edit", "", "<not implemented>");
   //"epsilon-remove net, epsilon-remove"
   COMMAND("eliminate flag", "<name>", "eliminate flag <name> diacritics from the top network");
   COMMAND("eliminate flags", "", "eliminate all flag diacritics from the top network");
   COMMAND("export cmatrix", "(filename)", "export the confusion matrix as an AT&T transducer");
   COMMAND("extract ambiguous", "", "extracts the ambiguous paths of a transducer");
   COMMAND("extract unambiguous", "", "extracts the unambiguous paths of a transducer");
-  COMMAND("hfst", "", "<no description>");
+  //COMMAND("hfst", "", "<no description>");
   COMMAND("ignore net, ignore", "", "applies ignore to top two FSMs on stack");
   COMMAND("intersect net, intersect, conjunct net, conjunct", "", "intersects FSMs on stack");
   COMMAND("invert net, invert", "", "inverts top FSM");
-  COMMAND("inspect, inspect net", "", "<no description>");
+  COMMAND("inspect, inspect net", "", "interactively traverse top FSM");
   AMBIGUOUS_COMMAND("help", "help, help license, help warranty");
   CONT_COMMAND("help", "", "lists all commands");
   COMMAND("help", "<name>", "prints help message of a command");
@@ -302,7 +298,7 @@ bool handle_case(const std::string & names, const std::string & arguments,
   COMMAND("help warranty", "", "prints warranty information");
   COMMAND("label net", "", "extracts all attested symbol pairs from FSM");
   COMMAND("letter machine", "", "Converts top FSM to a letter machine");
-  COMMAND("list", "", "<no description>");
+  COMMAND("list <symbol> <symbols>", "", "Associates the given symbol with a set of symbols");
   AMBIGUOUS_COMMAND("load", "load stack, load defined");
   COMMAND("load stack, load", "<filename>", "Loads networks and pushes them on the stack");
   COMMAND("load defined, loadd", "<filename>", "Restores defined networks from file");
@@ -321,44 +317,46 @@ bool handle_case(const std::string & names, const std::string & arguments,
                     "print shortest-string-size, print shortest-string, print sigma, print sigma-tally, print size, "
                     "print stack, print upper-words, print words");
   AMBIGUOUS_COMMAND("write", "write definition, write dot, write att, print properties, write prolog, write text, write spaced-text");
-  COMMAND("print aliases, aliases", "", "<no description>");
-  COMMAND("print arc-tally, arc-tally", "", "<no description>");
+  //COMMAND("print aliases, aliases", "", "<not implemented>");
+  //COMMAND("print arc-tally, arc-tally", "", "<not implemented>");
   // print cmatrix
   COMMAND("print defined, pdefined", "", "prints defined symbols and functions");
-  COMMAND("write definition, wdef, write definitions, wdefs", "", "<no description>");
-  COMMAND("print directory, directory", "", "<no description>");
+  COMMAND("write definition, wdef", "<definition> > <filename>", "write defined network <defined> into file <filename>");
+  COMMAND("write definitions, wdefs", "> <filename>", "write all defined networks into file <filename>");
+#ifndef _WIN32
+  COMMAND("print directory, directory", "","print contents of current directory");
+#endif
   COMMAND("write dot, wdot, dot", "", "prints top FSM in Graphviz dot format");
-  COMMAND("write att, att", "", "<no description>");
-  COMMAND("print file-info, file-info", "", "<no description>");
-  COMMAND("print flags, flags", "", "<no description>");
-  COMMAND("print labels, labels", "", "<no description>");
-  COMMAND("print label-maps, label-maps", "", "<no description>");
-  COMMAND("print label-tally, label-tally", "", "<no description>");
-  COMMAND("print list", "", "<no description>");
-  COMMAND("print lists", "", "<no description>");
-  COMMAND("print longest-string, longest-string, pls", "", "<no description>");
-  COMMAND("print longest-string-size, longest-string-size, plz", "", "<no description>");
-  COMMAND("print lower-words, lower-words", "", "prints words on the lower-side of top FSM");
+  //COMMAND("print file-info, file-info", "", "<not implemented>");
+  //COMMAND("print flags, flags", "", "<not implemented>");
+  COMMAND("print labels, labels", "", "print symbol pairs of top FSM");
+  //COMMAND("print label-maps, label-maps", "> <filename>", "<not implemented>");
+  COMMAND("print label-tally, label-tally", "", "print statistics about symbol pairs in top FSM");
+  COMMAND("print list <symbol>", "", "Print the set of symbols that is associated to <symbol>");
+  COMMAND("print lists", "", "Print all symbols that are associated to a set of symbols");
+  COMMAND("print longest-string, longest-string, pls", "", "print longest input and output string of top FSM");
+  COMMAND("print longest-string-size, longest-string-size, plz", "", "print length of longest input and output string of top FSM");
+  COMMAND("print lower-words, lower-words", "", "print words on the lower-side of top FSM");
   COMMAND("print name, pname", "", "prints the name of the top FSM");
   COMMAND("print net", "", "prints all information about top FSM");
-  COMMAND("print properties, print props, write properties, write props", "", "<no description>");
+  //COMMAND("print properties, print props, write properties, write props", "", "<not implemented>");
   COMMAND("print random-lower, random-lower", "", "prints random words from lower side");
   COMMAND("print random-upper, random-upper", "", "prints random words from upper side");
   COMMAND("print random-words, random-words", "", "prints random words from top FSM");
   COMMAND("print shortest-string-size, print shortest-string-length, psss, pssl", "", "prints length of shortest string");
   COMMAND("print shortest-string, shortest-string, pss", "", "prints the shortest string of the top FSM");
   COMMAND("print sigma, sigma", "", "prints the alphabet of the top FSM");
-  COMMAND("print sigma-tally, sigma-tally, sitally, print sigma-word-tally", "", "<no description>");
+  //COMMAND("print sigma-tally, sigma-tally, sitally, print sigma-word-tally", "", "<not implemented>");
   COMMAND("print size, size", "", "prints size information about top FSM");
-  COMMAND("print stack, stack", "", "<no description>");
-  COMMAND("print upper-words, upper-words", "", "<no description>");
-  COMMAND("print words, words", "", "<no description>");
+  COMMAND("print stack, stack", "", "print info about FSMs in stack");
+  COMMAND("print upper-words, upper-words", "", "print words on the upper-side of top FSM");
+  COMMAND("print words, words", "", "print words recognized by top FSM");
   COMMAND("prune net, prune", "", "makes top network coaccessible");
   COMMAND("push (defined)", "<name>", "adds a defined FSM to top of stack");
-  COMMAND("quit, exit, bye, stop, hyvästi, au revoir, näkemiin, viszlát, auf wiedersehen, has", "", "exit foma");
+  COMMAND("quit, exit, bye, stop, hyvästi, au revoir, näkemiin, viszlát, auf wiedersehen, has", "", "exit hfst-xfst");
   COMMAND("read lexc", "(<filename>)", "read and compile lexc format file");
   COMMAND("read att", "(<filename>)", "read a file in AT&T FSM format and add to top of stack");
-  COMMAND("read properties, rprops", "", "<no description>");
+  //COMMAND("read properties, rprops", "", "<not implemented>");
   COMMAND("read prolog, rpl", "<filename>", "reads prolog format file");
   COMMAND("read regex, regex", "", "read a regular expression");
   COMMAND("read spaced-text, rs", "(<filename>)", "compile space-separated words/word-pairs separated by newlines into a FST");
@@ -384,7 +382,7 @@ bool handle_case(const std::string & names, const std::string & arguments,
   COMMAND("substitute defined", "<X> for <Y>", "substitutes defined network X at all arcs containing Y");
   //"substitute label"
   COMMAND("substitute symbol", "<X> for <Y>", "substitutes all occurrences of Y in an arc with X");
-  COMMAND("substring", "", "<no description>");
+  //COMMAND("substring", "", "<not implemented>");
   COMMAND("system", "<cmd>", "execute the system command <cmd>");
   AMBIGUOUS_COMMAND("test", "test unambiguous, test equivalent, test functional, test identity, test lower-universal, "
                     "test upper-universal, test non-null, test null, test lower-bounded, test overlap, test sequential, "
@@ -398,26 +396,26 @@ bool handle_case(const std::string & names, const std::string & arguments,
   COMMAND("test upper-universal, upper-universal, tuu", "", "test if upper side is ..");
   COMMAND("test non-null, tnn", "", "test if top machine is not the empty language");
   COMMAND("test null, tnu", "", "test if top machine is the empty language");
-  COMMAND("test lower-bounded, lower-bounded, tlb", "", "<no description>");
-  COMMAND("test overlap, overlap, to", "", "<no description>");
+  COMMAND("test lower-bounded, lower-bounded, tlb", "", "test if top FSM accepts a finite number of input strings");
+  COMMAND("test overlap, overlap, to", "", "test if intersection of two top FSMs is not empty");
   COMMAND("test sequential", "", "tests if top machine is sequential");
   COMMAND("test star-free", "", "test if top FSM is star-free");
-  COMMAND("test sublanguage, sublanguage, ts", "", "<no description>");
-  COMMAND("test upper-bounded, upper-bounded, tub", "", "<no description>");
+  COMMAND("test sublanguage, sublanguage, ts", "", "test if top FSM is a sublanguage of the next FSM in stack");
+  COMMAND("test upper-bounded, upper-bounded, tub", "", "test if top FSM produces a finite number of output strings");
   COMMAND("turn stack, turn", "", "turns stack upside down");
   COMMAND("twosided flag-diacritics, tfd", "", "changes flags to always be identity pairs");
   COMMAND("undefine", "<name>", "remove <name> from defined networks");
-  COMMAND("unlist", "", "<no description>");
+  COMMAND("unlist <symbol>", "", "disassociates the given symbol from the set that was bound to it");
   COMMAND("union net, union, disjunct", "", "union of top two FSMs");
   COMMAND("upper-side net, upper-side", "", "upper projection of top FSM");
   COMMAND("view net", "", "display top network (if supported)");
-  COMMAND("write spaced-text, wspaced-text", "", "<no description>");
-  COMMAND("write text, wt", "", "<no description>");
+  //COMMAND("write spaced-text, wspaced-text", "", "<not implemented>");
+  //COMMAND("write text, wt", "", "<not implemented>");
   COMMAND("write prolog, wpl", "(> filename)", "writes top network to prolog format file/stdout");
-  COMMAND("write att", "(> <filename>)", "writes top network to AT&T format file/stdout");
+  COMMAND("write att", "(> <filename>)", "writes top network in AT&T format to file/stdout");
   COMMAND("zero-plus net, zero-plus", "", "Kleene star on top fsm");
   AMBIGUOUS_COMMAND("variable", "variable compose-tristate, variable show-flags, variable obey-flags, variable minimal, "
-                    "variable print-pairs, variable print-space, variable print-sigma, variable quit-on-fail, "
+                    "variable print-pairs, variable print-space, variable print-sigma, variable print-weight, variable quit-on-fail, "
                     "variable recursive-define, variable verbose, variable hopcroft-min, variable med-limit, "
                     "variable med-cutoff, variable att-epsilon");
   COMMAND("variable compose-tristate", "", "use the tristate composition algorithm");
@@ -427,6 +425,7 @@ bool handle_case(const std::string & names, const std::string & arguments,
   COMMAND("variable print-pairs", "", "always print both sides when applying");
   COMMAND("variable print-space", "", "print spaces between symbols");
   COMMAND("variable print-sigma", "", "print the alphabet when printing network");
+  COMMAND("variable print-weight", "", "show weights when printing networks or strings");
   COMMAND("variable quit-on-fail", "", "Abort operations when encountering errors");
   COMMAND("variable recursive-define", "", "Allow recursive definitions");
   COMMAND("variable verbose", "", "Verbosity of interface");
diff --git a/tools/src/parsers/xfst_help_message.h b/libhfst/src/parsers/xfst_help_message.h
similarity index 100%
rename from tools/src/parsers/xfst_help_message.h
rename to libhfst/src/parsers/xfst_help_message.h
diff --git a/libhfst/src/parsers/xre_lex.ll b/libhfst/src/parsers/xre_lex.ll
index 666302f..92dc811 100644
--- a/libhfst/src/parsers/xre_lex.ll
+++ b/libhfst/src/parsers/xre_lex.ll
@@ -212,11 +212,6 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
 "(" { CR; return LEFT_PARENTHESIS; }
 ")" { CR; return RIGHT_PARENTHESIS; }
 
-
-{LWSP}":"{LWSP} { CR; return PAIR_SEPARATOR_SOLE; }
-^":"$ { CR; return PAIR_SEPARATOR_SOLE; }
-{LWSP}":" { CR; return PAIR_SEPARATOR_WO_LEFT; }
-":"{LWSP} { CR; return PAIR_SEPARATOR_WO_RIGHT; }
 ":" { CR; return PAIR_SEPARATOR; }
 
 "::"{WEIGHT} {
@@ -274,18 +269,6 @@ BRACED      [{]([^}]|[\300-\337].|[\340-\357]..|[\360-\367]...)+[}]
     return FUNCTION_NAME;
 }
 
-";\t"{WEIGHT} {
-    CR; 
-    yylval->weight = hfst::xre::get_weight(yytext + 2);
-    return END_OF_WEIGHTED_EXPRESSION;
-}
-
-";"" "+{WEIGHT} {
-    CR; 
-    yylval->weight = hfst::xre::get_weight(yytext + 2);
-    return END_OF_WEIGHTED_EXPRESSION;
-}
-
 ";" { 
     CR; 
     return END_OF_EXPRESSION;
diff --git a/libhfst/src/parsers/xre_parse.yy b/libhfst/src/parsers/xre_parse.yy
index 553a59e..8b3ba31 100644
--- a/libhfst/src/parsers/xre_parse.yy
+++ b/libhfst/src/parsers/xre_parse.yy
@@ -118,7 +118,7 @@ int xrelex ( YYSTYPE * , yyscan_t );
 %type <transducerVector> REGEXP_LIST   // function call
 %type <label> FUNCTION                 // function call
 
-%nonassoc <weight> WEIGHT END_OF_WEIGHTED_EXPRESSION
+%nonassoc <weight> WEIGHT
 %nonassoc <label> SYMBOL CURLY_BRACKETS
 
 %left  CROSS_PRODUCT COMPOSITION LENIENT_COMPOSITION INTERSECTION MERGE_RIGHT_ARROW MERGE_LEFT_ARROW
@@ -155,11 +155,10 @@ int xrelex ( YYSTYPE * , yyscan_t );
 %nonassoc <label> FUNCTION_NAME   // function call
 %token LEFT_BRACKET RIGHT_BRACKET LEFT_PARENTHESIS RIGHT_PARENTHESIS
        LEFT_BRACKET_DOTTED RIGHT_BRACKET_DOTTED SUBVAL
-       PAIR_SEPARATOR_WO_RIGHT PAIR_SEPARATOR_WO_LEFT
 %token EPSILON_TOKEN ANY_TOKEN BOUNDARY_MARKER
 %token LEXER_ERROR
 %token END_OF_EXPRESSION
-%token PAIR_SEPARATOR PAIR_SEPARATOR_SOLE 
+%token PAIR_SEPARATOR 
 %nonassoc <label> QUOTED_LITERAL
 %%
 
@@ -182,17 +181,6 @@ REGEXP1: REGEXP2 END_OF_EXPRESSION {
          return 0;
        }
    }
-   | REGEXP2 END_OF_WEIGHTED_EXPRESSION {
-        //std::cerr << "regexp1:regexp2 end of weighted expr \n"<< std::endl; 
-       // Symbols of form <foo> are not harmonized in xfst, that is why
-       // they are escaped as @_<foo>_@ and need to be unescaped finally.  
-        // hfst::xre::last_compiled = & hfst::xre::unescape_enclosing_angle_brackets($1)->minimize().set_final_weights($2, true);
-        hfst::xre::last_compiled = & $1->minimize().set_final_weights($2, true);
-        $$ = hfst::xre::last_compiled;
-        if (hfst::xre::allow_extra_text_at_end) {
-          return 0;
-        }
-   }
    | REGEXP2 {
    
         //std::cerr << "regexp1:regexp2\n"<< *$1 << std::endl; 
@@ -385,6 +373,7 @@ REPLACE : REGEXP3 { }
                case E_REPLACE_RIGHT_MARKUP:
                default:
                 xreerror("Unhandled arrow stuff I suppose");
+                YYABORT;
                 break;
             }
        
@@ -444,7 +433,7 @@ MAPPINGPAIR_VECTOR: MAPPINGPAIR_VECTOR COMMA MAPPINGPAIR
 
          if ($1->first != $3->first)
          {
-            xreerror("Replace arrows should be the same. Calculated as if all replacements had the first arrow.");
+            hfst::xre::warn("Replace arrows should be the same. Calculated as if all replacements had the first arrow.");
             //exit(1);
          }
  
@@ -562,8 +551,19 @@ CONTEXTS_VECTOR: CONTEXT
       ;
 CONTEXT: REPLACE CENTER_MARKER REPLACE 
          {
-             HfstTransducer t1(*$1);
-             HfstTransducer t2(*$3);
+            if (hfst::xre::has_non_identity_pairs($1)) // if non-identity symbols present..
+            {
+              xreerror("Contexts need to be automata");
+              YYABORT;
+            }
+            if (hfst::xre::has_non_identity_pairs($3)) // if non-identity symbols present..
+            {
+              xreerror("Contexts need to be automata");
+              YYABORT;
+            }
+            
+            HfstTransducer t1(*$1);
+            HfstTransducer t2(*$3); 
 
              if (hfst::xre::is_weighted())
              {
@@ -584,8 +584,14 @@ CONTEXT: REPLACE CENTER_MARKER REPLACE
          }
       | REPLACE CENTER_MARKER
          {
-            HfstTransducer t1(*$1);
+            if (hfst::xre::has_non_identity_pairs($1)) // if non-identity symbols present..
+            {
+              xreerror("Contexts need to be automata");
+              YYABORT;
+            }
 
+            HfstTransducer t1(*$1);
+            
             if (hfst::xre::is_weighted())
             {
               hfst::xre::has_weight_been_zeroed=false;
@@ -600,6 +606,13 @@ CONTEXT: REPLACE CENTER_MARKER REPLACE
          }
       | CENTER_MARKER REPLACE
          {
+
+            if (hfst::xre::has_non_identity_pairs($2)) // if non-identity symbols present..
+            {
+              xreerror("Contexts need to be automata");
+              YYABORT;
+            }
+            
             HfstTransducer t1(*$2);
 
             if (hfst::xre::is_weighted())
@@ -676,8 +689,9 @@ REPLACE_ARROW: REPLACE_RIGHT
 REGEXP3: REGEXP4 { }
        | REGEXP3 SHUFFLE REGEXP4 {
             xreerror("No shuffle");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
+            YYABORT;
         }
        | REGEXP3 BEFORE REGEXP4 {
             $$ = new HfstTransducer( before (*$1, *$3) );
@@ -700,16 +714,18 @@ REGEXP4: REGEXP5 { }
        // doesn't exist in xfst
        | REGEXP4 LEFT_ARROW REGEXP5 CENTER_MARKER REGEXP5 {
             xreerror("No Arrows");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
             delete $5;
+            YYABORT;
         }
        // doesn't exist in xfst
        | REGEXP4 LEFT_RIGHT_ARROW REGEXP5 CENTER_MARKER REGEXP5 {
             xreerror("No Arrows");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
             delete $5;
+            YYABORT;
         }
        ;
 
@@ -775,13 +791,15 @@ REGEXP5: REGEXP6 { }
         }
        | REGEXP5 UPPER_MINUS REGEXP6 {
             xreerror("No upper minus");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
+            YYABORT;
         }
        | REGEXP5 LOWER_MINUS REGEXP6 {
             xreerror("No lower minus");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
+            YYABORT;
         }
        | REGEXP5 UPPER_PRIORITY_UNION REGEXP6 {
             $$ = & $1->priority_union(*$3);
@@ -811,13 +829,15 @@ REGEXP7: REGEXP8 { }
         }
        | REGEXP7 IGNORE_INTERNALLY REGEXP8 {
             xreerror("No ignoring internally");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
+            YYABORT;
         }
        | REGEXP7 LEFT_QUOTIENT REGEXP8 {
             xreerror("No left quotient");
-            $$ = $1;
+            //$$ = $1;
             delete $3;
+            YYABORT;
         }
        ;
 
@@ -910,7 +930,8 @@ REGEXP10: REGEXP11 { }
         /*
        | SUBSTITUTE_LEFT REGEXP10 COMMA REGEXP10 COMMA REGEXP10 RIGHT_BRACKET {
             xreerror("no substitute");
-            $$ = $2;
+            //$$ = $2;
+            YYABORT;
         }
         */
        ;
@@ -1143,18 +1164,6 @@ LABEL: HALFARC {
         free($1);
         free($3);
      }
-     | HALFARC PAIR_SEPARATOR_WO_RIGHT {
-        $$ = hfst::xre::xfst_label_to_transducer($1,hfst::internal_unknown.c_str());
-        /*$$ = new HfstTransducer($1, hfst::internal_unknown, hfst::xre::format);*/
-        free($1);
-     }
-     | PAIR_SEPARATOR_WO_LEFT HALFARC {
-        $$ = hfst::xre::xfst_label_to_transducer(hfst::internal_unknown.c_str(),$2);
-        free($2);
-     }
-     | PAIR_SEPARATOR_SOLE {
-	$$ = hfst::xre::xfst_label_to_transducer(hfst::internal_unknown.c_str(), hfst::internal_unknown.c_str());
-     }
      | HALFARC PAIR_SEPARATOR CURLY_BRACKETS {
         $$ = hfst::xre::xfst_label_to_transducer($1,$1);
         free($1);
@@ -1192,7 +1201,11 @@ LABEL: HALFARC {
               YY_BUFFER_STATE bs = xre_scan_string(hfst::xre::get_function_xre($1),scanner);
 
               // define special variables so that function arguments get the values given in regexp list
-              hfst::xre::define_function_args($1, $2);
+              if (! hfst::xre::define_function_args($1, $2))
+              {
+                xreerror("Could not define function args.\n");  // TODO: more informative message
+                YYABORT;
+              }
 
               // if we are scanning a function definition for argument symbols, 
               // do not include the characters read when evaluating functions inside it 
diff --git a/libhfst/src/parsers/xre_utils.cc b/libhfst/src/parsers/xre_utils.cc
index ce9db5b..d9bef28 100644
--- a/libhfst/src/parsers/xre_utils.cc
+++ b/libhfst/src/parsers/xre_utils.cc
@@ -11,6 +11,7 @@
 #include "xre_utils.h"
 #include "HfstTransducer.h"
 #include "HfstXeroxRules.h"
+#include "XreCompiler.h"
 
 using std::string;
 using std::map;
@@ -30,10 +31,21 @@ namespace hfst {
   namespace xre {
     extern unsigned int cr; // number of characters read, defined in XreCompiler.cc
     bool allow_extra_text_at_end = false;
-    extern std::string error_message;
+    extern std::ostream * error_;
+    extern bool verbose_;
   }
 }
 
+std::ostream * xreerrstr()
+{
+  return hfst::xre::XreCompiler::get_stream(hfst::xre::error_);
+}
+
+void xreflush(std::ostream * os)
+{
+  hfst::xre::XreCompiler::flush(os);
+} 
+
 int xreerror(yyscan_t scanner, const char* msg)
 { 
   char buffer [1024];
@@ -51,7 +63,12 @@ int xreerror(yyscan_t scanner, const char* msg)
     }
 
   buffer[1023] = '\0';
-  hfst::xre::error_message = std::string(buffer);
+  if (hfst::xre::verbose_)
+    {
+      std::ostream * err = xreerrstr();
+      *(err) << std::string(buffer);
+      xreflush(err);
+    }
   return 0;
 }
 
@@ -61,7 +78,9 @@ xreerror(const char *msg)
   char buffer [1024];
   int n = sprintf(buffer, "*** xre parsing failed: %s\n", msg);
   buffer[1023] = '\0';
-  hfst::xre::error_message = std::string(buffer);
+  std::ostream * err = xreerrstr();
+  *err << std::string(buffer);
+  xreflush(err);
   return 0;
 }
 
@@ -84,8 +103,7 @@ size_t len;
   bool expand_definitions=false;
   bool harmonize_=true;
   bool harmonize_flags_=false;
-  bool verbose_=false;
-  FILE * warning_stream=NULL;
+  //bool verbose_=false;
 
   std::string substitution_function_symbol;
 
@@ -260,6 +278,8 @@ get_quoted(const char *s)
 char*
 parse_quoted(const char *s)
 {
+  std::ostream * err = xreerrstr();
+
     char* quoted = get_quoted(s);
     char* rv = static_cast<char*>(malloc(sizeof(char)*strlen(quoted) + 1)); // added + 1
     char* p = quoted;
@@ -284,8 +304,8 @@ parse_quoted(const char *s)
               case '5':
               case '6':
               case '7':
-                fprintf(stderr, "*** XRE unimplemented: "
-                        "parse octal escape in %s", p);
+                *err << "*** XRE unimplemented: parse octal escape in " << std::string(p);
+                xreflush(err);
                 *r = '\0';
                 p = p + 5;
                 break;
@@ -320,7 +340,8 @@ parse_quoted(const char *s)
                 p = p + 2;
                 break;
               case 'u':
-                fprintf(stderr, "Unimplemented: parse unicode escapes in %s", p);
+                *err << "Unimplemented: parse unicode escapes in " << std::string(p);
+                xreflush(err);
                 *r = '\0';
                 r++;
                 p = p + 6;
@@ -340,8 +361,10 @@ parse_quoted(const char *s)
                       }
                     else
                       {
-                        fprintf(stderr, "*** XRE unimplemented: "
-                                "parse \\x%d\n", i);
+                        *err << "*** XRE unimplemented: parse \\x" << i << std::endl;
+                        xreflush(err);
+                        //fprintf(stderr, "*** XRE unimplemented: "
+                        //        "parse \\x%d\n", i);
                         *r = '\0';
                       }
                     r++;
@@ -350,7 +373,9 @@ parse_quoted(const char *s)
                    break;
                 }
               case '\0':
-                fprintf(stderr, "End of line after \\ escape\n");
+                *err << "End of line after \\ escape" << std::endl;
+                xreflush(err);
+                //fprintf(stderr, "End of line after \\ escape\n");
                 *r = '\0';
                 r++;
                 p++;
@@ -543,7 +568,10 @@ bool is_valid_function_call
   if (name2xre == function_definitions.end() || 
       name2args == function_arguments.end())
     {
-      fprintf(stderr, "No such function defined: '%s'\n", name);
+      std::ostream * err = xreerrstr();
+      *err << "No such function defined: '" << name << "'" << std::endl;
+      xreflush(err);
+      //fprintf(stderr, "No such function defined: '%s'\n", name);
       return false;
     }
 
@@ -551,8 +579,12 @@ bool is_valid_function_call
 
   if ( number_of_args != args->size())
     {
-      fprintf(stderr, "Wrong number of arguments: function '%s' expects %i, %i given\n", 
-              name, (int)number_of_args, (int)args->size());
+      std::ostream * err = xreerrstr();
+      *err << "Wrong number of arguments: function '" << name << "' expects " 
+                           << (int)number_of_args << ", " << (int)args->size() << " given" << std::endl;
+      xreflush(err);
+        //fprintf(stderr, "Wrong number of arguments: function '%s' expects %i, %i given\n", 
+        //       name, (int)number_of_args, (int)args->size());
       return false;
     }
 
@@ -570,12 +602,11 @@ const char * get_function_xre(const char * name)
   return it->second.c_str();
 }
 
-void define_function_args(const char * name, const std::vector<HfstTransducer> * args)
+bool define_function_args(const char * name, const std::vector<HfstTransducer> * args)
 {
   if (! is_valid_function_call(name, args))
     {
-      fprintf(stderr, "Could not define function args\n");
-      exit(1);
+      return false;
     }
   unsigned int arg_number = 1;
   for (std::vector<HfstTransducer>::const_iterator it = args->begin();
@@ -589,6 +620,7 @@ void define_function_args(const char * name, const std::vector<HfstTransducer> *
       //std::cerr << *it << std::endl;
       arg_number++;
     }
+  return true;
 }
 
 void undefine_function_args(const char * name)
@@ -952,14 +984,16 @@ xfst_label_to_transducer(const char* input, const char* output)
     if (!verbose_)
       return;
     
-    fprintf(warning_stream, "%s", msg);
+    std::ostream * err = xreerrstr();
+    *err << msg;
+    xreflush(err);
   }
 
 void warn_about_xfst_special_symbol(const char * symbol)
 {
   if (strcmp("all", symbol) == 0) {
     if (verbose_) {
-      fprintf(warning_stream, "warning: symbol 'all' has no special meaning in hfst\n"); }
+      warn("warning: symbol 'all' has no special meaning in hfst\n"); }
     return;
   }
 
@@ -976,7 +1010,9 @@ void warn_about_xfst_special_symbol(const char * symbol)
     return;
   if (!verbose_)
     return;
-  fprintf(warning_stream, "warning: '%s' is an ordinary symbol in hfst\n", symbol);
+  std::ostream * err = xreerrstr();
+  *err << "warning: '" << symbol << " ' is an ordinary symbol in hfst" << std::endl;
+  xreflush(err);
 }
 
 void warn_about_hfst_special_symbol(const char * symbol)
@@ -997,7 +1033,9 @@ void warn_about_hfst_special_symbol(const char * symbol)
     return;
   if (!verbose_)
     return;
-  fprintf(warning_stream, "warning: '%s' is not an ordinary symbol in hfst\n", symbol);
+  std::ostream * err = xreerrstr();
+  *err << "warning: '" << symbol << "' is not an ordinary symbol in hfst" << std::endl;
+  xreflush(err);
 }
 
 void warn_about_special_symbols_in_replace(HfstTransducer * t)
@@ -1005,6 +1043,8 @@ void warn_about_special_symbols_in_replace(HfstTransducer * t)
   if (!verbose_)
     return;
 
+  std::ostream * err = xreerrstr();  
+
   StringSet alphabet = t->get_alphabet();
   for (StringSet::const_iterator it = alphabet.begin(); 
        it != alphabet.end(); it++)
@@ -1013,11 +1053,11 @@ void warn_about_special_symbols_in_replace(HfstTransducer * t)
           *it != hfst::internal_epsilon &&
           *it != hfst::internal_unknown &&
           *it != hfst::internal_identity)
-        {         
-          fprintf(warning_stream, "warning: using special symbol '%s' in replace rule, "
-                  "use substitute instead\n", it->c_str());
+        {  
+          *err << "warning: using special symbol '" << *it << "' in replace rule, use substitute instead" << std::endl;
         }
     }
+  xreflush(err);
 }
 
 bool has_non_identity_pairs(const HfstTransducer * t)
diff --git a/libhfst/src/parsers/xre_utils.h b/libhfst/src/parsers/xre_utils.h
index f8a9226..3197fe2 100644
--- a/libhfst/src/parsers/xre_utils.h
+++ b/libhfst/src/parsers/xre_utils.h
@@ -103,7 +103,7 @@ HfstTransducer* expand_definition(HfstTransducer* tr, const char* symbol);
 // the same but simpler..
 HfstTransducer* expand_definition(const char* symbol);
 
- void define_function_args(const char * name, const std::vector<HfstTransducer> * args);
+ bool define_function_args(const char * name, const std::vector<HfstTransducer> * args);
  void undefine_function_args(const char * name);
 
  const char * get_function_xre(const char * name);
diff --git a/man/hfst-affix-guessify.1 b/man/hfst-affix-guessify.1
index a1fec79..88cbbe3 100644
--- a/man/hfst-affix-guessify.1
+++ b/man/hfst-affix-guessify.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-AFFIX-GUESSIFY "1" "October 2014" "HFST" "User Commands"
+.TH HFST-AFFIX-GUESSIFY "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-affix-guessify \- =Create weighted affix guesser from automaton
 .SH SYNOPSIS
diff --git a/man/hfst-apertium-proc.1 b/man/hfst-apertium-proc.1
index 0600a96..0485e0b 100644
--- a/man/hfst-apertium-proc.1
+++ b/man/hfst-apertium-proc.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-APERTIUM-PROC "1" "October 2014" "HFST" "User Commands"
+.TH HFST-APERTIUM-PROC "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-apertium-proc \- =Usage: hfst-proc [-a [-p|-C|-x] [-k]|-g|-n|-d|-t] [-W] [-n N] [-c|-w] [-z] [-v|-q|]
 .SH SYNOPSIS
@@ -86,7 +86,7 @@ case, ``superblanks'' or anything else!!!
 .SH "REPORTING BUGS"
 Report bugs to hfst\-bugs at helsinki.fi
 .PP
-hfst\-proc 0.0 (hfst 3.8.0)
+hfst\-proc 0.0 (hfst 3.9.0)
 .br
-Oct  3 2014 13:50:55
+Dec 14 2015 10:44:22
 copyright (C) 2009\-2011 University of Helsinki
diff --git a/man/hfst-calculate.1 b/man/hfst-calculate.1
index 73a99bf..3fe7975 100644
--- a/man/hfst-calculate.1
+++ b/man/hfst-calculate.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-SFSTPL2FST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-SFSTPL2FST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-sfstpl2fst \- =Compile a file written with SFST programming language into a transducer.
 .SH SYNOPSIS
diff --git a/man/hfst-compare.1 b/man/hfst-compare.1
index ea6f339..d65bd6a 100644
--- a/man/hfst-compare.1
+++ b/man/hfst-compare.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-COMPARE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-COMPARE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-compare \- =Compare two transducers
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .SS "Harmonization:"
diff --git a/man/hfst-compose-intersect.1 b/man/hfst-compose-intersect.1
index 54cf6e4..6c020fc 100644
--- a/man/hfst-compose-intersect.1
+++ b/man/hfst-compose-intersect.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-COMPOSE-INTERSECT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-COMPOSE-INTERSECT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-compose-intersect \- =Compose a lexicon with one or more rule transducers.
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .SS "Composition options:"
@@ -41,9 +44,16 @@ rules with the lexicon instead
 of composing the lexicon with
 the intersection of the rules.
 .TP
+\fB\-f\fR, \fB\-\-fast\fR
+Faster compose instersect using
+more memory.
+.TP
 \fB\-e\fR, \fB\-\-encode\-weights\fR
 Encode weights when minimizing
 (default is false).
+.TP
+\fB\-a\fR, \fB\-\-harmonize\fR
+Harmonize symbols.
 .PP
 If OUTFILE, or either INFILE1 or INFILE2 is missing or \-, standard
 streams will be used. INFILE1, INFILE2, or both, must be specified
diff --git a/man/hfst-compose.1 b/man/hfst-compose.1
index a006915..79e7d25 100644
--- a/man/hfst-compose.1
+++ b/man/hfst-compose.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-COMPOSE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-COMPOSE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-compose \- =Compose two transducers
 .SH SYNOPSIS
@@ -31,8 +31,18 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
+.SS "Composition options:"
+.TP
+\fB\-x\fR, \fB\-\-xerox\-composition\fR=\fIVALUE\fR Whether flag diacritics are treated as ordinary
+symbols in composition (default is false).
+.TP
+\fB\-X\fR, \fB\-\-xfst\fR=\fIVARIABLE\fR
+Toggle xfst compatibility option VARIABLE.
 .SS "Harmonization:"
 .HP
 \fB\-H\fR, \fB\-\-do\-not\-harmonize\fR Do not harmonize symbols.
@@ -50,6 +60,10 @@ The operation is applied pairwise for INFILE1 and INFILE2
 that must have the same number of transducers.
 If INFILE2 has only one transducer, the operation is applied for
 each transducer in INFILE1 keeping the second transducer constant.
+.PP
+Xfst variables are {flag\-is\-epsilon (default OFF)}.
+VALUE can be one of the following: [true|false], [yes|no] or [ON|OFF],
+false being the default.
 .SH EXAMPLES
 .TP
 hfst\-compose \fB\-o\fR cat2dog.hfst cat2mouse.hfst mouse2dog.hfst
diff --git a/man/hfst-concatenate.1 b/man/hfst-concatenate.1
index be9cc4a..0879986 100644
--- a/man/hfst-concatenate.1
+++ b/man/hfst-concatenate.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-CONCATENATE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-CONCATENATE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-concatenate \- =Concatenate two transducers
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .SS "Harmonization:"
diff --git a/man/hfst-conjunct.1 b/man/hfst-conjunct.1
index 76c505f..8f89f2b 100644
--- a/man/hfst-conjunct.1
+++ b/man/hfst-conjunct.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-CONJUNCT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-CONJUNCT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-conjunct \- =Conjunct (intersect, AND) two transducers
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .SS "Flag diacritics:"
diff --git a/man/hfst-determinize.1 b/man/hfst-determinize.1
index ec27723..823df8f 100644
--- a/man/hfst-determinize.1
+++ b/man/hfst-determinize.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-DETERMINIZE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-DETERMINIZE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-determinize \- =Determinize a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-disjunct.1 b/man/hfst-disjunct.1
index 1824cde..423459e 100644
--- a/man/hfst-disjunct.1
+++ b/man/hfst-disjunct.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-DISJUNCT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-DISJUNCT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-disjunct \- =Disjunct (union, OR) two transducers
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .PP
diff --git a/man/hfst-edit-metadata.1 b/man/hfst-edit-metadata.1
index 1f32f3c..43ecc4a 100644
--- a/man/hfst-edit-metadata.1
+++ b/man/hfst-edit-metadata.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-EDIT-METADATA "1" "October 2014" "HFST" "User Commands"
+.TH HFST-EDIT-METADATA "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-edit-metadata \- =Name a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-expand-equivalences.1 b/man/hfst-expand-equivalences.1
index 30decd0..df118c1 100644
--- a/man/hfst-expand-equivalences.1
+++ b/man/hfst-expand-equivalences.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-EXPAND-EQUIVALENCES "1" "October 2014" "HFST" "User Commands"
+.TH HFST-EXPAND-EQUIVALENCES "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-expand-equivalences \- =Extend transducer arcs for equivalence classes
 .SH SYNOPSIS
diff --git a/man/hfst-format.1 b/man/hfst-format.1
index 72f061b..7877110 100644
--- a/man/hfst-format.1
+++ b/man/hfst-format.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-FORMAT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-FORMAT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-format \- =determine HFST transducer format
 .SH SYNOPSIS
diff --git a/man/hfst-fst2fst.1 b/man/hfst-fst2fst.1
index f950c5e..5375354 100644
--- a/man/hfst-fst2fst.1
+++ b/man/hfst-fst2fst.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-FST2FST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-FST2FST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-fst2fst \- =Convert transducers between binary formats
 .SH SYNOPSIS
@@ -44,6 +44,9 @@ Write output in (HFST's) SFST implementation
 \fB\-F\fR, \fB\-\-foma\fR
 Write output in (HFST's) foma implementation
 .TP
+\fB\-x\fR, \fB\-\-xfsm\fR
+Write output in native xfsm format
+.TP
 \fB\-t\fR, \fB\-\-openfst\-tropical\fR
 Write output in (HFST's) tropical weight (OpenFST) implementation
 .TP
@@ -61,9 +64,11 @@ When converting to optimized\-lookup, don't try hard to compress
 If OUTFILE or INFILE is missing or \-, standard streams will be used.
 Format of result depends on format of INFILE
 FMT must be name of a format usable by libhfst, i.e. one of the following:
-{ foma, openfst\-tropical, openfst\-log, sfst,
+{ foma, openfst\-tropical, openfst\-log, sfst, xfsm
 .IP
 optimized\-lookup\-weighted, optimized\-lookup\-unweighted }.
+.PP
+Note that xfsm format is always written in native format without HFST wrappers.
 .SH "REPORTING BUGS"
 Report bugs to <hfst\-bugs at helsinki.fi> or directly to our bug tracker at:
 <https://sourceforge.net/tracker/?atid=1061990&group_id=224521&func=browse>
diff --git a/man/hfst-fst2strings.1 b/man/hfst-fst2strings.1
index ffc50d5..889e2ca 100644
--- a/man/hfst-fst2strings.1
+++ b/man/hfst-fst2strings.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-FST2STRINGS "1" "October 2014" "HFST" "User Commands"
+.TH HFST-FST2STRINGS "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-fst2strings \- =Display the strings recognized by a transducer
 .SH SYNOPSIS
@@ -50,6 +50,10 @@ print epsilon as EPS
 toggle xfst compatibility option VARIABLE
 .SS "Ignore paths if:"
 .TP
+\fB\-b\fR, \fB\-\-beam\fR=\fIB\fR
+output string weight not within B from the weight
+of the best output string
+.TP
 \fB\-l\fR, \fB\-\-max\-in\-length\fR=\fIMIL\fR
 input string longer than MIL
 .TP
@@ -74,6 +78,7 @@ If all NSTR, NBEST and NCYC are omitted, all possible paths are printed:
 NSTR, NBEST and NCYC default to infinity.
 NBEST overrides NSTR and NCYC
 NRAND overrides NBEST, NSTR and NCYC
+B must be a non\-negative float
 If EPS is not given, default is empty string.
 Numeric options are parsed with strtod(3).
 Xfst variables supported are { obey\-flags, print\-flags,
diff --git a/man/hfst-fst2txt.1 b/man/hfst-fst2txt.1
index 142c6c6..4fcc16a 100644
--- a/man/hfst-fst2txt.1
+++ b/man/hfst-fst2txt.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-FST2TXT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-FST2TXT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-fst2txt \- =Print transducer in AT&T, dot, prolog or pckimmo format
 .SH SYNOPSIS
diff --git a/man/hfst-grep.1 b/man/hfst-grep.1
index 8ca2087..237accc 100644
--- a/man/hfst-grep.1
+++ b/man/hfst-grep.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-GREP "1" "October 2014" "HFST" "User Commands"
+.TH HFST-GREP "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-grep \- =Search for PATTERN in each FILE or standard input.
 .SH SYNOPSIS
diff --git a/man/hfst-guess.1 b/man/hfst-guess.1
index 9d17464..a67520c 100644
--- a/man/hfst-guess.1
+++ b/man/hfst-guess.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-GUESS "1" "October 2014" "HFST" "User Commands"
+.TH HFST-GUESS "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-guess \- =Use a guesser (and generator) to guess analyses or inflectional
 .SH SYNOPSIS
diff --git a/man/hfst-guessify.1 b/man/hfst-guessify.1
index 9c1e3d7..c90bc4c 100644
--- a/man/hfst-guessify.1
+++ b/man/hfst-guessify.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-GUESSIFY "1" "October 2014" "HFST" "User Commands"
+.TH HFST-GUESSIFY "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-guessify \- =Compile a morphological analyzer into a guesser and generator.
 .SH SYNOPSIS
diff --git a/man/hfst-head.1 b/man/hfst-head.1
index 90a7770..18cb6c4 100644
--- a/man/hfst-head.1
+++ b/man/hfst-head.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-HEAD "1" "October 2014" "HFST" "User Commands"
+.TH HFST-HEAD "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-head \- =Get first transducers from an archive
 .SH SYNOPSIS
diff --git a/man/hfst-info.1 b/man/hfst-info.1
index 5816b91..e312fe9 100644
--- a/man/hfst-info.1
+++ b/man/hfst-info.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-INFO "1" "October 2014" "HFST" "User Commands"
+.TH HFST-INFO "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-info \- =show or test HFST versions and features
 .SH SYNOPSIS
diff --git a/man/hfst-invert.1 b/man/hfst-invert.1
index d8ef2d2..f4bb18b 100644
--- a/man/hfst-invert.1
+++ b/man/hfst-invert.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-INVERT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-INVERT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-invert \- =Invert a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-lexc-wrapper.1 b/man/hfst-lexc-wrapper.1
index 0156695..981812f 100644
--- a/man/hfst-lexc-wrapper.1
+++ b/man/hfst-lexc-wrapper.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-LEXC-WRAPPER "1" "October 2014" "HFST" "User Commands"
+.TH HFST-LEXC-WRAPPER "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-lexc-wrapper \- =Compile lexc files into transducer or imitate Xerox lexc
 .SH SYNOPSIS
diff --git a/man/hfst-lexc.1 b/man/hfst-lexc.1
index 685591f..333b0d1 100644
--- a/man/hfst-lexc.1
+++ b/man/hfst-lexc.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-LEXC "1" "October 2014" "HFST" "User Commands"
+.TH HFST-LEXC "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-lexc \- =Compile lexc files into transducer
 .SH SYNOPSIS
@@ -32,6 +32,12 @@ compile into FORMAT transducer
 write result into OUTFILE
 .SS "Lexc options:"
 .TP
+\fB\-A\fR, \fB\-\-alignStrings\fR
+align characters in input and output strings
+.TP
+\fB\-E\fR, \fB\-\-encode\-weights\fR
+encode weights when minimizing (default is false)
+.TP
 \fB\-F\fR, \fB\-\-withFlags\fR
 use flags to hyperminimize result
 .TP
diff --git a/man/hfst-lookup.1 b/man/hfst-lookup.1
index b669f88..9a3f4f1 100644
--- a/man/hfst-lookup.1
+++ b/man/hfst-lookup.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-LOOKUP "1" "October 2014" "HFST" "User Commands"
+.TH HFST-LOOKUP "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-lookup \- =perform transducer lookup (apply)
 .SH SYNOPSIS
@@ -30,9 +30,8 @@ Read input transducer from INFILE
 .TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write output to OUTFILE
-.TP
-\fB\-p\fR, \fB\-\-pipe\-mode\fR
-Read lookup strings from standard input, do not prompt
+.HP
+\fB\-p\fR, \fB\-\-pipe\-mode\fR[=\fISTREAM\fR] Control input and output streams
 .SS "Lookup options:"
 .TP
 \fB\-I\fR, \fB\-\-input\-strings\fR=\fISFILE\fR
@@ -56,6 +55,14 @@ Toggle xfst VARIABLE
 \fB\-c\fR, \fB\-\-cycles\fR=\fIINT\fR
 How many times to follow input epsilon cycles
 .TP
+\fB\-b\fR, \fB\-\-beam\fR=\fIB\fR
+Output only analyses whose weight is within B from
+the best analysis
+.TP
+\fB\-t\fR, \fB\-\-time\-cutoff\fR=\fIS\fR
+Limit search after having used S seconds per input
+(currently only works in optimized\-lookup mode
+.TP
 \fB\-P\fR, \fB\-\-progress\fR
 Show neat progress bar if possible
 .PP
@@ -68,8 +75,15 @@ VARIABLEs relevant to lookup are {print\-pairs,print\-space,
 quote\-special,show\-flags,obey\-flags}
 Input epsilon cycles are followed by default INT=5 times.
 Epsilon is printed by default as an empty string.
+B must be a non\-negative float.
+S must be a non\-negative float. The default, 0.0, indicates no cutoff.
 If the input contains several transducers, a set containing
 results from all transducers is printed for each input string.
+.PP
+STREAM can be { input, output, both }. If not given, defaults to {both}.
+If input file is not specified with \fB\-I\fR, input is read interactively line by
+line from the user. If you redirect input from a file, use \fB\-\-pipe\-mode\fR=\fIinput\fR.
+\fB\-\-pipe\-mode\fR=\fIoutput\fR is ignored on non\-windows platforms.
 .SS "Todo:"
 .IP
 For optimized lookup format, only strings that pass flag diacritic checks
diff --git a/man/hfst-minimize.1 b/man/hfst-minimize.1
index 36d26b8..5770566 100644
--- a/man/hfst-minimize.1
+++ b/man/hfst-minimize.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-MINIMIZE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-MINIMIZE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-minimize \- =Minimize a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-multiply.1 b/man/hfst-multiply.1
index c7939cf..10c3216 100644
--- a/man/hfst-multiply.1
+++ b/man/hfst-multiply.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-MULTIPLY "1" "October 2014" "HFST" "User Commands"
+.TH HFST-MULTIPLY "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-multiply \- =Use first transducer of an archive repeatedly
 .SH SYNOPSIS
diff --git a/man/hfst-name.1 b/man/hfst-name.1
index d735f76..addd522 100644
--- a/man/hfst-name.1
+++ b/man/hfst-name.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-NAME "1" "October 2014" "HFST" "User Commands"
+.TH HFST-NAME "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-name \- =Name a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-optimized-lookup.1 b/man/hfst-optimized-lookup.1
index 45b8dee..8baaf0e 100644
--- a/man/hfst-optimized-lookup.1
+++ b/man/hfst-optimized-lookup.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-OPTIMIZED-LOOKUP "1" "October 2014" "HFST" "User Commands"
+.TH HFST-OPTIMIZED-LOOKUP "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-optimized-lookup \- =Usage: hfst-optimized-lookup [OPTIONS] TRANSDUCER
 .SH SYNOPSIS
@@ -37,6 +37,13 @@ Suppress duplicate analyses
 Output no more than N analyses
 (if the transducer is weighted, the N best analyses)
 .TP
+\fB\-b\fR, \fB\-\-beam\fR=\fIB\fR
+Output only analyses whose weight is within B from
+the best analysis
+.TP
+\fB\-t\fR, \fB\-\-time\-cutoff\fR=\fIS\fR
+Limit search after having used S seconds per input
+.TP
 \fB\-x\fR, \fB\-\-xerox\fR
 Xerox output format (default)
 .TP
@@ -44,15 +51,22 @@ Xerox output format (default)
 Be as fast as possible.
 (with this option enabled \fB\-u\fR and \fB\-n\fR don't work and
 output won't be ordered by weight).
+.TP
+\fB\-p\fR, \fB\-\-pipe\-mode\fR[=\fISTREAM\fR]
+Control input and output streams.
+.PP
+N must be a positive integer. B must be a non\-negative float.
+S must be a non\-negative float. The default, 0.0, indicates no cutoff.
+Options \fB\-n\fR and \fB\-b\fR are combined with AND, i.e. they both restrict the output.
 .PP
-Note that hfst\-optimized\-lookup is *not* guaranteed to behave identically to
-hfst\-lookup (although it almost always does): input\-side multicharacter symbols
-are not fully supported. If the first character of such a symbol is an ASCII
-symbol also matching a single\-character symbol, it will be tokenized as such.
+STREAM can be { input, output, both }. If not given, defaults to {both}.
+Input is read interactively line by line from the user. If you redirect input
+from a file, use \fB\-\-pipe\-mode\fR=\fIinput\fR. \fB\-\-pipe\-mode\fR=\fIoutput\fR is ignored on non\-windows
+platforms.
 .SH "REPORTING BUGS"
 Report bugs to hfst\-bugs at helsinki.fi
 .PP
 hfst\-optimized\-lookup 1.2
 .br
-Oct  3 2014 13:53:38
+Dec 10 2015 17:39:54
 copyright (C) 2009 University of Helsinki
diff --git a/man/hfst-pair-test.1 b/man/hfst-pair-test.1
index 1927624..7fc10bd 100644
--- a/man/hfst-pair-test.1
+++ b/man/hfst-pair-test.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PAIR-TEST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PAIR-TEST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-pair-test \- =pair test for a twolc rule file.
 .SH SYNOPSIS
@@ -34,6 +34,10 @@ Write test output to OUTFILE
 \fB\-N\fR  \fB\-\-negative\-test\fR
 Test fails if any of the pair strings is
 accepted.
+.TP
+\fB\-X\fR  \fB\-\-xerox\-mode\fR
+In xerox mode, test cases are harvested
+from a twolc source file.
 .SS "Pair test options:"
 .TP
 \fB\-I\fR, \fB\-\-input\-strings\fR=\fISFILE\fR
@@ -53,9 +57,11 @@ The test pair string files contain one pair string/line. Lines
 where the first non\-white\-space character is "!" are
 considered comment lines and skipped.
 .PP
-There are two test modes positive and negative. In positive
-mode, all of the pair strings should be allowed and in negative
-mode they should be disallowed.
+There are three test modes positive, negative and Xerox mode. In
+positive mode, all of the pair strings should be allowed and in
+negative mode they should be disallowed. In Xerox mode the cases
+are read from a twolc source file and both positive and negative
+cases can occur.
 .PP
 Ordinarily, positive test mode is in use. Option \fB\-N\fR switches to
 negative test mode. The exit code for a successful test is 0.
@@ -69,6 +75,20 @@ it are printed as well as the positions in the string where the
 rules run out of possible transitions. In negative mode, only
 the strings that are allowed are printed.
 .PP
+In Xerox mode, the input should be a twolc file. Tests consist of
+two lines: an input form and an output form. The test cases are
+specialized comments prefixed with either '!???' or '!$' depeding on
+whether the pair should succeed or fail. An example of a positive
+test:
+.PP
+!??? earlYer
+!??? earlier
+.PP
+An example of a negative test:
+.PP
+!$ earlYer
+!$ earlyer
+.PP
 In silent mode (\fB\-s\fR), the program won't print anything. Only the
 exit code tells whether the test was successful or not.
 .SH "REPORTING BUGS"
diff --git a/man/hfst-pmatch.1 b/man/hfst-pmatch.1
index 9042e50..6441473 100644
--- a/man/hfst-pmatch.1
+++ b/man/hfst-pmatch.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PMATCH "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PMATCH "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-pmatch \- =perform matching/lookup on text streams
 .SH SYNOPSIS
@@ -32,6 +32,9 @@ Only print tagged parts in output
 .TP
 \fB\-l\fR  \fB\-\-locate\fR
 Only print locations of matches
+.TP
+\fB\-p\fR  \fB\-\-profile\fR
+Produce profiling data
 .PP
 Use standard streams for input and output.
 .SH "REPORTING BUGS"
diff --git a/man/hfst-pmatch2fst.1 b/man/hfst-pmatch2fst.1
index 226aea3..529e6cf 100644
--- a/man/hfst-pmatch2fst.1
+++ b/man/hfst-pmatch2fst.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PMATCH2FST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PMATCH2FST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-pmatch2fst \- =Compile regular expressions into transducer(s)
 .SH SYNOPSIS
@@ -46,7 +46,7 @@ Weights are currently not implemented.
 .SH EXAMPLES
 .TP
 echo "Define TOP
-UppercaseAlpha Alpha* LC(\e"professor\e") EndTag(ProfName);" | hfst\-pmatch2fst
+UppercaseAlpha Alpha* LC({professor}) EndTag(ProfName);" | hfst\-pmatch2fst
 .IP
 create matcher that tags "professor Chomsky" as "professor <ProfName>Chomsky</ProfName>"
 .SH "REPORTING BUGS"
diff --git a/man/hfst-proc2.1 b/man/hfst-proc2.1
index 07e408d..984818b 100644
--- a/man/hfst-proc2.1
+++ b/man/hfst-proc2.1
@@ -1,10 +1,10 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PROC2 "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PROC2 "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-proc2 \- =perform matching/lookup on text streams
 .SH SYNOPSIS
 .B hfst-proc2
-[\fIOPTIONS\fR...] \fITOKENIZER\fR
+[\fI--segment | --xerox | --cg\fR] [\fIOPTIONS\fR...] \fIRULESET\fR
 .SH DESCRIPTION
 perform matching/lookup on text streams
 .SS "Common options:"
@@ -27,8 +27,24 @@ Alias of \fB\-\-quiet\fR
 \fB\-n\fR  \fB\-\-newline\fR
 Newline as input separator (default is blank line)
 .TP
-\fB\-x\fR  \fB\-\-xerox\fR
-Xerox output (default)
+\fB\-a\fR  \fB\-\-print\-all\fR
+Print nonmatching text
+.TP
+\fB\-w\fR  \fB\-\-print\-weight\fR
+Print weights
+.TP
+\fB\-\-tokenize\-multichar\fR
+Tokenize multicharacter symbols
+(by default only one utf\-8 character is tokenized at a time                         regardless of what is present in the alphabet)  \fB\-\-segment\fR              Segmenting / tokenization mode (default)
+.TP
+\fB\-\-xerox\fR
+Xerox output
+.TP
+\fB\-\-cg\fR
+cg output
+.TP
+\fB\-\-finnpos\fR
+FinnPos output
 .PP
 Use standard streams for input and output (for now).
 .SH "REPORTING BUGS"
diff --git a/man/hfst-project.1 b/man/hfst-project.1
index 4ca628e..c117061 100644
--- a/man/hfst-project.1
+++ b/man/hfst-project.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PROJECT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PROJECT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-project \- =Project (extract a level) transducer
 .SH SYNOPSIS
diff --git a/man/hfst-prune-alphabet.1 b/man/hfst-prune-alphabet.1
index 350472f..45a8b82 100644
--- a/man/hfst-prune-alphabet.1
+++ b/man/hfst-prune-alphabet.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PRUNE-ALPHABET "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PRUNE-ALPHABET "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-prune-alphabet \- =Prune the alphabet of a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-push-weights.1 b/man/hfst-push-weights.1
index 3e4f227..549c654 100644
--- a/man/hfst-push-weights.1
+++ b/man/hfst-push-weights.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-PUSH-WEIGHTS "1" "October 2014" "HFST" "User Commands"
+.TH HFST-PUSH-WEIGHTS "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-push-weights \- =Push weights of transducer
 .SH SYNOPSIS
diff --git a/man/hfst-regexp2fst.1 b/man/hfst-regexp2fst.1
index 0304a5d..eaba95c 100644
--- a/man/hfst-regexp2fst.1
+++ b/man/hfst-regexp2fst.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-REGEXP2FST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-REGEXP2FST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-regexp2fst \- =Compile (weighted) regular expressions into transducer(s)
 .SH SYNOPSIS
@@ -81,11 +81,9 @@ echo " c:d a:o::3 t:g " | hfst\-regexp2fst
 same but with weight 3
 in the middle
 .TP
-echo " {cat}:{dog} ; 3 " | hfst\-regexp2fst
-legacy way of defining weights
-.TP
-echo " cat ; dog ; 3 " | hfst\-regexp2fst \fB\-S\fR
+echo " cat ; dog ; "3" " | hfst\-regexp2fst \fB\-S\fR
 create transducers
+.IP
 "cat" and "dog" and "3"
 .SH "REPORTING BUGS"
 Report bugs to <hfst\-bugs at helsinki.fi> or directly to our bug tracker at:
diff --git a/man/hfst-remove-epsilons.1 b/man/hfst-remove-epsilons.1
index bc028fd..bdf65ab 100644
--- a/man/hfst-remove-epsilons.1
+++ b/man/hfst-remove-epsilons.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-REMOVE-EPSILONS "1" "October 2014" "HFST" "User Commands"
+.TH HFST-REMOVE-EPSILONS "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-remove-epsilons \- =Remove epsilons from a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-repeat.1 b/man/hfst-repeat.1
index c92f779..8310782 100644
--- a/man/hfst-repeat.1
+++ b/man/hfst-repeat.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-REPEAT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-REPEAT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-repeat \- =Repeat transducer
 .SH SYNOPSIS
diff --git a/man/hfst-reverse.1 b/man/hfst-reverse.1
index 29f632a..7300812 100644
--- a/man/hfst-reverse.1
+++ b/man/hfst-reverse.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-REVERSE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-REVERSE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-reverse \- =Reverse a transducer
 .SH SYNOPSIS
diff --git a/man/hfst-reweight-tagger.1 b/man/hfst-reweight-tagger.1
index 58b931b..5ce1354 100644
--- a/man/hfst-reweight-tagger.1
+++ b/man/hfst-reweight-tagger.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-REWEIGHT-TAGGER "1" "October 2014" "HFST" "User Commands"
+.TH HFST-REWEIGHT-TAGGER "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-reweight-tagger \- =Reweight a tagger accoring to a configuration file
 .SH SYNOPSIS
diff --git a/man/hfst-reweight.1 b/man/hfst-reweight.1
index 3b778a1..cbe1fab 100644
--- a/man/hfst-reweight.1
+++ b/man/hfst-reweight.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-REWEIGHT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-REWEIGHT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-reweight \- =Reweight transducer weights simply
 .SH SYNOPSIS
@@ -59,6 +59,9 @@ match arcs havins symbol SYM
 \fB\-e\fR, \fB\-\-end\-states\-only\fR
 match end states only, no arcs
 .TP
+\fB\-A\fR, \fB\-\-arcs\-only\fR
+match arcs only, no end states
+.TP
 \fB\-T\fR, \fB\-\-tsv\-file\fR=\fITFILE\fR
 read reweighting rules from TFILE
 .PP
@@ -66,16 +69,23 @@ If OUTFILE or INFILE is missing or \-, standard streams will be used.
 Format of result depends on format of INFILE
 If AVAL, BVAL or FNAME are omitted, they default to neutral elements of addition, multiplication or identity function.
 If LVAL or UVAL are omitted, they default to minimum and maximum values of the weight structure.
-If ISYM, OSYM or SYM are omitted, they default to value that matches all arcs.
-Float values are parsed with strtod(3) and integers strtoul(3)
+If ISYM, OSYM or SYM are omitted, they default to a value that matches all arcs.
+.PP
+Float values are parsed with strtod(3) and integers strtoul(3).
 The functions allowed for FNAME are <cmath> float functions with parameter count of 1 and a matching return value:
 abs, acos, asin, ... sqrt, tan, tanh
-The precedence of operands follows the formula BVAL * FNAME(w) + AVAL
-The formula is applied iff
+.PP
+The precedence of operands follows the formula BVAL * FNAME(w) + AVAL.
+The formula is applied iff:
 ((LVAL <= w) && (w <= UVAL)),
 where w is weight of arc, and
 (ISYM == i) && (OSYM == o) && ((SYM == i) || (SYM == o)) ^^
 (end state && \fB\-e\fR).
+.PP
+TFILE should contain lines with tab\-separated pairs of SYM and AVAL or BVAL. AVAL values must be preceded by a + character, BVAL should be given as plain digits. Comment lines starting with # and empty lines are ignored.
+.PP
+Weights are by default modified for all arcs and end states,
+unless option \fB\-\-end\-states\-only\fR or \fB\-\-arcs\-only\fR is used.
 .SH "REPORTING BUGS"
 Report bugs to <hfst\-bugs at helsinki.fi> or directly to our bug tracker at:
 <https://sourceforge.net/tracker/?atid=1061990&group_id=224521&func=browse>
diff --git a/man/hfst-shuffle.1 b/man/hfst-shuffle.1
index 6e9029b..98f5bf4 100644
--- a/man/hfst-shuffle.1
+++ b/man/hfst-shuffle.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-SHUFFLE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-SHUFFLE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-shuffle \- =Shuffle two transducers
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .PP
diff --git a/man/hfst-split.1 b/man/hfst-split.1
index 10db676..a358278 100644
--- a/man/hfst-split.1
+++ b/man/hfst-split.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-SPLIT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-SPLIT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-split \- =Extract transducers from archive with systematic file names
 .SH SYNOPSIS
diff --git a/man/hfst-strings2fst.1 b/man/hfst-strings2fst.1
index 47ab607..a974cfd 100644
--- a/man/hfst-strings2fst.1
+++ b/man/hfst-strings2fst.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-STRINGS2FST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-STRINGS2FST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-strings2fst \- =Compile string pairs and pair-strings into transducer(s)
 .SH SYNOPSIS
diff --git a/man/hfst-substitute.1 b/man/hfst-substitute.1
index df319b0..d41dbf9 100644
--- a/man/hfst-substitute.1
+++ b/man/hfst-substitute.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-SUBSTITUTE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-SUBSTITUTE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-substitute \- =Relabel transducer arcs
 .SH SYNOPSIS
@@ -47,6 +47,11 @@ read replacements from LABELFILE
 \fB\-R\fR, \fB\-\-in\-order\fR
 keep the order of the replacements
 (with \fB\-F\fR)
+.SS "Input options:"
+.TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+require that transducers in TFILE and INFILE
+have the same type
 .SS "Transient optimisation schemes:"
 .TP
 \fB\-9\fR, \fB\-\-compose\fR
diff --git a/man/hfst-subtract.1 b/man/hfst-subtract.1
index 35d5fa3..ef720dc 100644
--- a/man/hfst-subtract.1
+++ b/man/hfst-subtract.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-SUBTRACT "1" "October 2014" "HFST" "User Commands"
+.TH HFST-SUBTRACT "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-subtract \- =Subtract (minus) two transducers
 .SH SYNOPSIS
@@ -31,6 +31,9 @@ Read first input transducer from INFILE1
 \fB\-2\fR, \fB\-\-input2\fR=\fIINFILE2\fR
 Read second input transducer from INFILE2
 .TP
+\fB\-C\fR, \fB\-\-do\-not\-convert\fR
+Do not allow transducers to be converted into the same type
+.TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write results to OUTFILE
 .SS "Flag diacritics:"
diff --git a/man/hfst-summarize.1 b/man/hfst-summarize.1
index fb42c33..c249763 100644
--- a/man/hfst-summarize.1
+++ b/man/hfst-summarize.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-SUMMARIZE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-SUMMARIZE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-summarize \- =Calculate the properties of a transducer
 .SH SYNOPSIS
@@ -30,6 +30,11 @@ Read input transducer from INFILE
 .TP
 \fB\-o\fR, \fB\-\-output\fR=\fIOUTFILE\fR
 Write output transducer to OUTFILE
+.SS "Summarize options:"
+.TP
+\fB\-S\fR, \fB\-\-print\-symbol\-pair\-statistics\fR=\fIN\fR
+Print info about symbol pairs that occur
+at most N times (default is infinity)
 .PP
 If OUTFILE or INFILE is missing or \-, standard streams will be used.
 Format of result depends on format of INFILE
diff --git a/man/hfst-tag.1 b/man/hfst-tag.1
index bb57167..021c9d1 100644
--- a/man/hfst-tag.1
+++ b/man/hfst-tag.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-TAG "1" "October 2014" "HFST" "User Commands"
+.TH HFST-TAG "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-tag \- =Tag a text file given from stdin using an hfst tagger.
 .SH SYNOPSIS
diff --git a/man/hfst-tail.1 b/man/hfst-tail.1
index 76f094c..e328db3 100644
--- a/man/hfst-tail.1
+++ b/man/hfst-tail.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-TAIL "1" "October 2014" "HFST" "User Commands"
+.TH HFST-TAIL "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-tail \- =Get last transducers from an archive
 .SH SYNOPSIS
diff --git a/man/hfst-train-tagger.1 b/man/hfst-train-tagger.1
index 9720164..8f8d687 100644
--- a/man/hfst-train-tagger.1
+++ b/man/hfst-train-tagger.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-TRAIN-TAGGER "1" "October 2014" "HFST" "User Commands"
+.TH HFST-TRAIN-TAGGER "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-train-tagger \- =
 .SH SYNOPSIS
diff --git a/man/hfst-traverse.1 b/man/hfst-traverse.1
index f958459..4d68585 100644
--- a/man/hfst-traverse.1
+++ b/man/hfst-traverse.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-TRAVERSE "1" "October 2014" "HFST" "User Commands"
+.TH HFST-TRAVERSE "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-traverse \- =Walk through the transducer arc by arc
 .SH SYNOPSIS
diff --git a/man/hfst-twolc.1 b/man/hfst-twolc.1
index 3ff2620..19b5c8b 100644
--- a/man/hfst-twolc.1
+++ b/man/hfst-twolc.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-TWOLC "1" "October 2014" "HFST" "User Commands"
+.TH HFST-TWOLC "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-twolc \- =
 .SH SYNOPSIS
@@ -57,7 +57,7 @@ Format may be one of openfst\-log, openfst\-tropical, foma or sfst.
 By default format is openfst\-tropical. By default right arrow
 conflicts are resolved and left arrow conflicts are not resolved.
 .PP
-hfst\-twolc 0 (hfst 3.7.1)
+hfst\-twolc 0 (hfst 3.8.3)
 Copyright \(co 2010 University of Helsinki,
 License GPLv3: GNU GPL version 3
 <http://gnu.org/licenses/gpl.html>
diff --git a/man/hfst-txt2fst.1 b/man/hfst-txt2fst.1
index 0ee69ad..77fd78a 100644
--- a/man/hfst-txt2fst.1
+++ b/man/hfst-txt2fst.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-TXT2FST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-TXT2FST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-txt2fst \- =Convert AT&T or prolog format into a binary transducer
 .SH SYNOPSIS
@@ -40,6 +40,11 @@ Interpret string EPS as epsilon in att format
 .TP
 \fB\-p\fR, \fB\-\-prolog\fR
 Read prolog format instead of att
+.SS "Other options:"
+.TP
+\fB\-C\fR, \fB\-\-check\-negative\-epsilon\-cycles\fR
+Issue a warning if there are epsilon cycles
+with a negative weight in the transducer
 .PP
 If OUTFILE or INFILE is missing or \-, standard streams will be used.
 If FMT is not given, OpenFst's tropical format will be used.
diff --git a/man/hfst-xfst.1 b/man/hfst-xfst.1
index 5699e99..de3c42a 100644
--- a/man/hfst-xfst.1
+++ b/man/hfst-xfst.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
-.TH HFST-XFST "1" "October 2014" "HFST" "User Commands"
+.TH HFST-XFST "1" "December 2015" "HFST" "User Commands"
 .SH NAME
 hfst-xfst \- =Compile XFST scripts or execute XFST commands interactively
 .SH SYNOPSIS
@@ -36,24 +36,25 @@ Read commands from FILE, and quit
 .TP
 \fB\-l\fR, \fB\-\-startupfile\fR=\fIFILE\fR
 Read commands from FILE on startup
-.TP
-\fB\-p\fR, \fB\-\-pipe\-mode\fR
-Read commands from standard input (non\-interactive)
+.HP
+\fB\-p\fR, \fB\-\-pipe\-mode\fR[=\fISTREAM\fR] Control input and output streams
 .TP
 \fB\-r\fR, \fB\-\-no\-readline\fR
 Do not use readline library for input
 .TP
 \fB\-w\fR, \fB\-\-print\-weight\fR
 Print weights for each operation
-.TP
-\fB\-k\fR, \fB\-\-output\-to\-console\fR
-Output directly to console (Windows\-specific)
 .PP
 Option \fB\-\-execute\fR can be invoked many times.
 If FMT is not given, OpenFst's tropical format will be used.
 The possible values for FMT are { foma, openfst\-tropical, openfst\-log, sfst }.
 Readline library, if enabled when configuring, is used for input by default.
 Input files are always treated as UTF\-8.
+.PP
+STREAM can be { input, output, both }. If not given, defaults to {both}.
+If input file is not specified with \fB\-F\fR, input is read interactively line by
+line from the user. If you redirect input from a file, use \fB\-\-pipe\-mode\fR=\fIinput\fR.
+\fB\-\-pipe\-mode\fR=\fIoutput\fR is ignored on non\-windows platforms.
 .SH "REPORTING BUGS"
 Report bugs to <hfst\-bugs at helsinki.fi> or directly to our bug tracker at:
 <https://sourceforge.net/tracker/?atid=1061990&group_id=224521&func=browse>
diff --git a/swig/Makefile.am b/old_python/Makefile.am
similarity index 100%
rename from swig/Makefile.am
rename to old_python/Makefile.am
diff --git a/swig/README b/old_python/README
similarity index 50%
rename from swig/README
rename to old_python/README
index a1a6cbf..5e509cb 100644
--- a/swig/README
+++ b/old_python/README
@@ -1,37 +1,54 @@
-This is the SWIG binding for using the hfst library with Python.
+This is the old SWIG binding for using HFST library with Python.
+A newer binding is in the directory "../python".
+
+It is recommended to use python version 3 as it has a better support for
+UTF-8 than version 2. All examples are tested with python3.
+
 
 Building and installation is done using the standard Python module distutils.
 Once you've successfully built libhfst, use the script setup.py to build the
 Python extension eg. like so:
 
-    python setup.py build_ext --inplace
+    python3 setup.py build_ext --inplace
 
-If you are using Python3 ( =< 3.2), you can execute
-
-    sed -i 's/class HfstException(_object):/class HfstException(Exception):/' libhfst.py
-
-after build to be able to use HfstException and its subclasses in Python. 
 
 If you wish to install the extension, run
 
-    python setup.py install
+    python3 setup.py install
+
 
+To test the Python bindings after installation, go to directory 'test' and
+run there
 
-To test the SWIG bindings after installation, run
+    ./test.sh (--python python3.X)
 
-    ./test/test.sh (--python PYTHON)
 
 For further information, consult
 
-    python setup.py --help
-    python setup.py --help-commands
+    python3 setup.py --help
+    python3 setup.py --help-commands
 
 and the distutils documentation.
 
+
+Some version combinations of SWIG and Python make HFST exception classes
+subclasses of Python's _object instead of Exception. Then you will get an
+error like
+
+    TypeError: catching classes that do not inherit from BaseException is not allowed
+
+If this is the case, run
+
+    sed -i 's/class HfstException(_object):/class HfstException(Exception):/' libhfst.py
+
+after build to be able to use HfstException and its subclasses in Python. 
+
+
 If you are using SWIG bindings locally, or want to run ./test/test.sh before
 installation, add path/to/hfst-top-dir/swig/ to PYTHONPATH and 
 path/to/hfst-top-dir/libhfst/src/.libs/ to LD_LIBRARY_PATH.
 
+
 Demonstration utilities:
 	      omor_query.py, lookup and basic usage (needs omorfi installed)
 	      hfstBot.py, a irc bot for lookup
diff --git a/swig/doc/Doxyfile b/old_python/doc/Doxyfile
similarity index 99%
copy from swig/doc/Doxyfile
copy to old_python/doc/Doxyfile
index 5214327..5bc2bcb 100644
--- a/swig/doc/Doxyfile
+++ b/old_python/doc/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME           = "HFST - Helsinki Finite-State Transducer Technology - P
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = "version 3.7.1"
+PROJECT_NUMBER         = "version 3.8.3"
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
diff --git a/swig/doc/libhfst.py b/old_python/doc/libhfst.py
similarity index 100%
copy from swig/doc/libhfst.py
copy to old_python/doc/libhfst.py
diff --git a/swig/hfstBot.py b/old_python/hfstBot.py
similarity index 100%
rename from swig/hfstBot.py
rename to old_python/hfstBot.py
diff --git a/swig/hfst_swig_extensions.h b/old_python/hfst_swig_extensions.h
similarity index 100%
rename from swig/hfst_swig_extensions.h
rename to old_python/hfst_swig_extensions.h
diff --git a/swig/libhfst.i b/old_python/libhfst.i
similarity index 92%
rename from swig/libhfst.i
rename to old_python/libhfst.i
index 58b86d7..40309b9 100644
--- a/swig/libhfst.i
+++ b/old_python/libhfst.i
@@ -20,6 +20,49 @@
 #include "hfst_swig_extensions.h"
 #include "HfstExceptionDefs.h"
 #include "implementations/optimized-lookup/pmatch.h"
+
+namespace hfst {
+  class HfstFile {
+    private:
+      FILE * file;
+    public:
+      HfstFile();
+      ~HfstFile();
+      void set_file(FILE * f);
+      FILE * get_file();
+      void close();
+      void write(const char * str);
+      bool is_eof(void);
+  };
+
+  HfstFile::HfstFile(): file(NULL){};
+  HfstFile::~HfstFile() {};
+  void HfstFile::set_file(FILE * f) { file = f; };
+  FILE * HfstFile::get_file() { return file; };
+  void HfstFile::close() { if (file != stdout && file != stderr && file != stdin) { fclose(file); } };
+  void HfstFile::write(const char * str) { fprintf(file, "%s", str); };
+  bool HfstFile::is_eof(void) { return (feof(file) != 0); };
+
+  HfstFile hfst_open(const char * filename, const char * mode) {
+    FILE * f = fopen(filename, mode);
+    HfstFile file;
+    file.set_file(f);
+    return file;
+  };
+
+  HfstFile hfst_stdin() {
+    HfstFile file;
+    file.set_file(stdin);
+    return file;
+  };
+
+  HfstFile hfst_stdout() {
+    HfstFile file;
+    file.set_file(stdout);
+    return file;
+  };
+}
+
 %}
 
 
@@ -97,16 +140,19 @@ std::string hfst_get_exception();
 namespace hfst
 {
 
-class HfstFile;
-
 class HfstFile {
-public:
-  void close();
-  void write(const char * str);
+  public:
+    HfstFile();
+    ~HfstFile();
+    void write(const char * str);
+    void close();
+    bool is_eof(void);
 };
-HfstFile hfst_open(const char * filename, const char * args);
-HfstFile hfst_stdin();
+
 HfstFile hfst_stdout();
+HfstFile hfst_stdin();
+HfstFile hfst_open(const char * filename, const char * mode);
+
 
 /*
  * One of the (apparent) peculiarities of swig is that things break in the
@@ -186,7 +232,7 @@ HfstBasicTransducer (void);
 HfstBasicTransducer (const HfstBasicTransducer &graph);
 HfstBasicTransducer (const hfst::HfstTransducer &transducer);
 HfstBasicTransducer (FILE *file) throw (NotValidAttFormatException);
-HfstBasicTransducer (HfstFile &file) throw (NotValidAttFormatException);
+//HfstBasicTransducer (HfstFile &file) throw (NotValidAttFormatException);
 HfstBasicTransducer & insert_freely (const StringPair &symbol_pair, float weight);
 HfstBasicTransducer & insert_freely (const StringPairSet &symbol_pairs, float weight);
 HfstBasicTransducer & insert_freely (const HfstBasicTransducer &graph);
@@ -214,6 +260,9 @@ void write_in_att_format_number (FILE *file, bool write_weights=true);
     	 $self->write_in_att_format(tmp);
 	 return tmp;    
     }
+    HfstBasicTransducer(HfstFile &file) throw (NotValidAttFormatException) {
+         return new hfst::implementations::HfstBasicTransducer(file.get_file());                        
+    }
     };
 
 };
@@ -287,7 +336,7 @@ public:
     HfstTransducer(const std::string &symbol, ImplementationType type);
     HfstTransducer(const std::string &isymbol, const std::string &osymbol, ImplementationType type);
     HfstTransducer(FILE *ifile, ImplementationType type, const std::string &epsilon_symbol) throw (EndOfStreamException, NotValidAttFormatException);
-    HfstTransducer(HfstFile &ifile, ImplementationType type, const std::string &epsilon_symbol) throw (EndOfStreamException, NotValidAttFormatException);
+    //HfstTransducer(HfstFile &ifile, ImplementationType type, const std::string &epsilon_symbol) throw (EndOfStreamException, NotValidAttFormatException);
     
     // Then everything else, in the (alphabetic) order in the API manual
     bool compare(const HfstTransducer &another) const;
@@ -348,7 +397,7 @@ public:
     HfstTransducer & transform_weights(float(*func)(float));
     void write_in_att_format(const std::string &filename, bool write_weights=true) const;
     void write_in_att_format(FILE *ofile, bool write_weights=true) const;
-    void write_in_att_format(HfstFile &ofile, bool write_weights=true) const;
+    //void write_in_att_format(HfstFile &ofile, bool write_weights=true) const;
     void write_in_att_format(char * buffer, bool write_weights=true) const;
     virtual ~HfstTransducer(void);
     static HfstTransducer read_lexc(const std::string &filename, ImplementationType type, bool );
@@ -364,6 +413,14 @@ public:
 	 return tmp;    
     }
 
+    HfstTransducer(HfstFile &ifile, ImplementationType type, const std::string &epsilon_symbol) throw (EndOfStreamException, NotValidAttFormatException) {
+         return new hfst::HfstTransducer(ifile.get_file(), type, epsilon_symbol);
+    }
+
+    void write_in_att_format(HfstFile &ofile, bool write_weights=true) const {
+         return $self->write_in_att_format(ofile.get_file(), write_weights);
+    }
+
     HfstTransducer & __add__(const HfstTransducer & another) {
          return $self->concatenate(another);
     }
@@ -431,7 +488,7 @@ public:
     hfst::HfstTransducer * compileLexical();
     //const std::map<std::string,hfst::HfstTransducer>& getStringTries() const;
     //const std::map<std::string,hfst::HfstTransducer>& getRegexpUnions() const;
-    const LexcCompiler& printConnectedness(bool & warnings) const;
+    const LexcCompiler& printConnectedness(bool & warnings);
   };
   };
 
diff --git a/swig/omor_query.py b/old_python/omor_query.py
similarity index 100%
rename from swig/omor_query.py
rename to old_python/omor_query.py
diff --git a/swig/setup.py b/old_python/setup.py
similarity index 97%
copy from swig/setup.py
copy to old_python/setup.py
index ac83d18..af80c3a 100644
--- a/swig/setup.py
+++ b/old_python/setup.py
@@ -26,7 +26,7 @@ libhfst_module = Extension('_libhfst',
 # ["libhfst-NN.dll", "libgcc_s_seh-1.dll"] or
 # ["libhfst-NN.dll", "libgcc_s_dw2-1.dll"] or
 setup(name = 'libhfst_swig',
-      version = '3.8.2_beta',
+      version = '3.8.3_beta',
       author = 'HFST team',
       author_email = 'hfst-bugs at helsinki.fi',
       url = 'http://hfst.sourceforge.net',
diff --git a/swig/test/Makefile.am b/old_python/test/Makefile.am
similarity index 100%
rename from swig/test/Makefile.am
rename to old_python/test/Makefile.am
diff --git a/swig/test/test.sh b/old_python/test/test.sh
similarity index 100%
rename from swig/test/test.sh
rename to old_python/test/test.sh
diff --git a/swig/test/test_constructors.py b/old_python/test/test_constructors.py
similarity index 100%
rename from swig/test/test_constructors.py
rename to old_python/test/test_constructors.py
diff --git a/swig/test/test_examples.py b/old_python/test/test_examples.py
similarity index 100%
rename from swig/test/test_examples.py
rename to old_python/test/test_examples.py
diff --git a/swig/test/test_extensions.py b/old_python/test/test_extensions.py
similarity index 100%
rename from swig/test/test_extensions.py
rename to old_python/test/test_extensions.py
diff --git a/swig/test/test_flag_diacritics.py b/old_python/test/test_flag_diacritics.py
similarity index 100%
rename from swig/test/test_flag_diacritics.py
rename to old_python/test/test_flag_diacritics.py
diff --git a/swig/test/test_hfst_basic_transducer.py b/old_python/test/test_hfst_basic_transducer.py
similarity index 100%
rename from swig/test/test_hfst_basic_transducer.py
rename to old_python/test/test_hfst_basic_transducer.py
diff --git a/swig/test/test_lexc.lexc b/old_python/test/test_lexc.lexc
similarity index 100%
rename from swig/test/test_lexc.lexc
rename to old_python/test/test_lexc.lexc
diff --git a/swig/test/test_lexc.py b/old_python/test/test_lexc.py
similarity index 100%
rename from swig/test/test_lexc.py
rename to old_python/test/test_lexc.py
diff --git a/swig/test/test_lexc_fail.lexc b/old_python/test/test_lexc_fail.lexc
similarity index 100%
rename from swig/test/test_lexc_fail.lexc
rename to old_python/test/test_lexc_fail.lexc
diff --git a/swig/test/test_rules.py b/old_python/test/test_rules.py
similarity index 100%
rename from swig/test/test_rules.py
rename to old_python/test/test_rules.py
diff --git a/swig/test/test_std_streams.py b/old_python/test/test_std_streams.py
similarity index 100%
rename from swig/test/test_std_streams.py
rename to old_python/test/test_std_streams.py
diff --git a/swig/test/test_std_streams.sh b/old_python/test/test_std_streams.sh
similarity index 100%
rename from swig/test/test_std_streams.sh
rename to old_python/test/test_std_streams.sh
diff --git a/swig/test/test_streams.py b/old_python/test/test_streams.py
similarity index 100%
rename from swig/test/test_streams.py
rename to old_python/test/test_streams.py
diff --git a/swig/test/test_tokenizer.py b/old_python/test/test_tokenizer.py
similarity index 100%
rename from swig/test/test_tokenizer.py
rename to old_python/test/test_tokenizer.py
diff --git a/swig/test/test_transducer_functions.py b/old_python/test/test_transducer_functions.py
similarity index 100%
rename from swig/test/test_transducer_functions.py
rename to old_python/test/test_transducer_functions.py
diff --git a/swig/test/test_xre_compiler.py b/old_python/test/test_xre_compiler.py
similarity index 100%
rename from swig/test/test_xre_compiler.py
rename to old_python/test/test_xre_compiler.py
diff --git a/python/Makefile.am b/python/Makefile.am
new file mode 100644
index 0000000..a23f51f
--- /dev/null
+++ b/python/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = test
+EXTRA_DIST = libhfst.i README setup.py test.py
+AUTOMAKE_OPTIONS = subdir-objects
diff --git a/python/README b/python/README
new file mode 100644
index 0000000..fe11d49
--- /dev/null
+++ b/python/README
@@ -0,0 +1,59 @@
+
+         ------------------------------------------------
+         *** THIS IS THE NEW PYTHON3 WRAPPER FOR HFST ***
+              *** IT IS STILL UNDER CONSTRUCTION ***
+         ------------------------------------------------
+
+This is the SWIG binding for using HFST library with python3.
+
+Building and installation is done using the standard Python module distutils.
+Once you've successfully built libhfst, use the script setup.py to build the
+Python extension eg. like so:
+
+    python3 setup.py build_ext --inplace
+
+
+NOTE: if you already have hfst installed, it is possible that SWIG will use 
+the installed version of hfst library instead of the default located in
+"../libhfst/src/.libs/". To avoid this, add the full path to hfst library to
+LD_LIBRARY_PATH before building the Python extension, e.g. by executing
+
+    LD_LIBRARY_PATH="path/to/hfst-top-dir/libhfst/src/.libs/:"$LD_LIBRARY_PATH
+
+
+If you wish to install the extension, run
+
+    python3 setup.py install
+
+
+For further information, consult
+
+    python3 setup.py --help
+    python3 setup.py --help-commands
+
+and the distutils documentation.
+
+
+NOTE: Some version combinations of SWIG and Python make HFST exception classes
+subclasses of Python's _object instead of Exception. Then you will get an
+error like
+
+    TypeError: catching classes that do not inherit from BaseException is not allowed
+
+If this is the case, run
+
+    sed -i 's/class HfstException(_object):/class HfstException(Exception):/' libhfst.py
+
+after build/installation to be able to use HfstException and its subclasses in Python. 
+
+
+If you want to use Python bindings locally, add path/to/hfst-top-dir/python to
+PYTHONPATH, e.g. by executing
+
+    PYTHONPATH="path/to/hfst-top-dir/python:"$PYTHONPATH
+
+If this does not work, you can do the following in Python before importing libhfst:
+
+    import sys
+    sys.path.insert(1, 'path/to/hfst-top-dir/python')
+
diff --git a/swig/doc/Doxyfile b/python/doc/Doxyfile
similarity index 99%
rename from swig/doc/Doxyfile
rename to python/doc/Doxyfile
index 5214327..1bb044c 100644
--- a/swig/doc/Doxyfile
+++ b/python/doc/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME           = "HFST - Helsinki Finite-State Transducer Technology - P
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = "version 3.7.1"
+PROJECT_NUMBER         = "version 3.9.0"
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
@@ -286,7 +286,7 @@ TYPEDEF_HIDES_STRUCT   = NO
 # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
 # corresponding to a cache size of 2^16 = 65536 symbols
 
-SYMBOL_CACHE_SIZE      = 0
+# SYMBOL_CACHE_SIZE      = 0 (obsolete)
 
 #---------------------------------------------------------------------------
 # Build related configuration options
@@ -474,7 +474,7 @@ SHOW_USED_FILES        = YES
 # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
 # in the documentation. The default is NO.
 
-SHOW_DIRECTORIES       = YES
+# SHOW_DIRECTORIES       = YES (obsolete)
 
 # Set the SHOW_FILES tag to NO to disable the generation of the Files page.
 # This will remove the Files entry from the Quick Index and from the
@@ -800,7 +800,7 @@ HTML_STYLESHEET        =
 # files or namespaces will be aligned in HTML using tables. If set to
 # NO a bullet list will be used.
 
-HTML_ALIGN_MEMBERS     = YES
+# HTML_ALIGN_MEMBERS     = YES (obsolete)
 
 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
 # documentation will contain sections that can be hidden and shown after the
@@ -953,7 +953,7 @@ GENERATE_TREEVIEW      = NO
 # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
 # and Class Hierarchy pages using a tree view instead of an ordered list.
 
-USE_INLINE_TREES       = YES
+# USE_INLINE_TREES       = YES (obsolete)
 
 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
 # used to set the initial width (in pixels) of the frame in which the tree
@@ -974,7 +974,11 @@ FORMULA_FONTSIZE       = 10
 # there is already a search function so this one should typically
 # be disabled.
 
-SEARCHENGINE           = YES
+SEARCHENGINE = YES
+
+SERVER_BASED_SEARCH = YES
+
+EXTERNAL_SEARCH = NO
 
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output
diff --git a/swig/doc/libhfst.py b/python/doc/libhfst.py
similarity index 53%
rename from swig/doc/libhfst.py
rename to python/doc/libhfst.py
index aae8860..8b1964b 100644
--- a/swig/doc/libhfst.py
+++ b/python/doc/libhfst.py
@@ -1,20 +1,24 @@
 ## @package libhfst 
-# This package contains all HFST functionalities.
+# HFST API for Python3.
 
 ## @mainpage
 #
+# <p><b> <font color="red"> THIS PAGE IS FOR TESTING PURPOSES </font> </b>
+# We are moving from Sourceforge to <a href="http://www.github.com/hfst">Github</a> during autumn 2015.</p>
+#
 # HFST - The Helsinki Finite-State Transducer technology is intended for creating and manipulating weighted or unweighted synchronic transducers implementing regular relations.
-# UTF-8 is chosen as the character encoding used in the HFST software. Currently, HFST has been implemented using the
+# UTF-8 is chosen as the character encoding used in HFST software. Currently, HFST has been implemented using the
 # <a href="http://www.ims.uni-stuttgart.de/projekte/gramotron/SOFTWARE/SFST.html">SFST</a>, 
 # <a href="http://www.openfst.org">OpenFst</a> and 
 # <a href="http://code.google.com/p/foma/">foma</a> software libraries.
 # Other versions may be added in some future release. SFST and foma implementations are unweighted and OpenFst implementation is weighted.
 #
-# Some of the HFST interface functionalities have also been implemented for HFST's own two transducer formats, HfstBasicTransducer and optimized lookup format.
-# The previous is useful for converting between transducer formats and storing transducersin an implementation-independent format. The latter is used for fast lookup
-# of strings in a transducer.
+# Part of HFST interface has been implemented for HFST's own two transducer formats, HfstBasicTransducer and optimized lookup format.
+# The previous is useful for accessing individual states and transitions of a transducer, converting between transducer formats and storing transducers in an implementation-independent format. 
+# The latter is used for fast lookup of strings in a transducer.
 #
-# All implementations work according to the same interface, so it is possible to compile the same piece of code using different backend libraries.
+# All back-end implementations - SFST, OpenFst and foma - work according to the same interface, so it is possible to compile the same piece of code using different back-end libraries.
+# There are some differences related to weights, as only OpenFst supports them.
 #
 # For a quick start to the HFST interface with examples, see <a href="QuickStart.html">here</a>.
 #
@@ -43,8 +47,7 @@
 #
 # \section download_hfst Download
 #
-#   - <a href="http://sourceforge.net/projects/hfst/files/hfst">Download</a> and 
-#   <a href="InstallHfst.html">install</a> the HFST interface and command line tools
+#   - <a href="https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstDownloads">Download and install</a> the HFST interface and command line tools
 #
 #
 #\section links Links
@@ -56,31 +59,20 @@
 #   <br>
 
 
-
-## A class that represents a path in a transducer
-# 
-# Has members weight, input and output.
-#
-class HfstPath:
-    pass
-
 ## Base class for HfstExceptions. Holds its own name and the file and line number where it was thrown.
 class HfstException:
-    pass
-
-## Two or more HfstTransducers are not of the same type.
+    ## The name of the exception. 
+    self.name
+    ## The source file where the exception originated.
+    self.file
+    ## The line of the source file where the exception originated.
+    self.line
+
+## Two or more HfstTransducers are not of the same type. Same as HfstTransducerTypeMismatchException ???
 class HfstTransducerTypeMismatchException(HfstException):
     pass
 
 ## The library required by the implementation type requested is not linked to HFST. 
-# 
-# An example:
-# \verbatim
-# try:
-#     tr = libhfst.HfstTransducer('foo', 'bar', type)
-# except libhfst.ImplementationTypeNotAvailableException:
-#     print "ERROR: Type requested is not available."
-# \endverbatim
 class ImplementationTypeNotAvailableException(HfstException):
     pass
 
@@ -88,53 +80,39 @@ class ImplementationTypeNotAvailableException(HfstException):
 class FunctionNotImplementedException(HfstException):
     pass
 
+## Flag diacritics encountered on one but not the other side of a transition.
+class FlagDiacriticsAreNotIdentitiesException(HfstException):
+    pass
+
+## The input is not in valid prolog format.
+class NotValidPrologFormatException(HfstException):
+    pass
+
 ## Stream cannot be read. 
-# 
-# Thrown by
-# libhfst.HfstTransducer.__init__
-# 
-# An example:
-# \verbatim
-# try:
-#     instr = libhfst.HfstInputStream('foofile')
-# except libhfst.StreamNotReadableException:
-#     print "ERROR: file cannot be read."
-# \endverbatim
 class StreamNotReadableException(HfstException):
     pass
 
 ## Stream cannot be written. 
 # 
-# Thrown by #libhfst.HfstOutputStream.redirect and #libhfst.HfstTransducer.write_in_att_format
-# 
-# An example:
-# \verbatim
-# try:
-#     tr = libhfst.HfstTransducer('foo', libhfst.FOMA_TYPE)
-#     outstr = libhfst.HfstOutputStream('testfile')
-#     outstr.redirect(tr)
-# except libhfst.StreamCannotBeWrittenException:
-#     print "ERROR: file cannot be written."
-# \endverbatim
+# Thrown by #libhfst.HfstOutputStream.write and #libhfst.HfstTransducer.write_att
 class StreamCannotBeWrittenException(HfstException):
     pass
 
 ## Stream is closed. 
 # 
-# Thrown by #libhfst.HfstTransducer.write_in_att_format
-# #libhfst.HfstTransducer.__init__
-# #libhfst.HfstOutputStream::redirect
+# Thrown by #libhfst.HfstTransducer.write_att
+# #libhfst.HfstOutputStream.write
 # 
-# An example:
+# An example: 
 # 
 # \verbatim
 # try:
-#     tr = libhfst.HfstTransducer('foo', libhfst.TROPICAL_OPENFST_TYPE)
-#     outstr = libhfst.HfstOutputStream('testfile', tr.get_type())
+#     tr = libhfst.regex('foo')
+#     outstr = libhfst.HfstOutputStream(filename='testfile')
 #     outstr.close()
-#     outstr.redirect(tr)
+#     outstr.write(tr)
 # except libhfst.StreamIsClosedException:
-#     print "ERROR: stream to file is closed."
+#     print("Could not write transducer: stream to file was closed.")
 # \endverbatim
 class StreamIsClosedException(HfstException):
     pass
@@ -149,16 +127,17 @@ class EndOfStreamException(HfstException):
 
 ## Transducer is cyclic. 
 # 
-#     Thrown by #libhfst.extract_paths and
-#     #libhfst.extract_paths_fd. An example:
+#     Thrown by #libhfst.HfstTransducer.extract_paths. An example 
 # \verbatim
-# transducer = libhfst.HfstTransducer('a', 'b', libhfst.TROPICAL_OPENFST_TYPE)
-# transducer.repeat_star()
+# transducer = libhfst.regex('[a:b]*')
 # try:
-#     results = libhfst.detokenize_paths(libhfst.extract_paths(transducer))
-#     print "The transducer has %i paths" % len(results)
+#     results = transducer.extract_paths(output='text')
+#     print("The transducer has %i paths:" % len(results))
+#     print(results)
 # except libhfst.TransducerIsCyclicException:
-#     print "The transducer is cyclic and has an infinite number of paths."
+#     print("The transducer is cyclic and has an infinite number of paths. Some of them:")
+#     results = transducer.extract_paths(output='text', max_cycles=5)
+#     print(results)
 # \endverbatim
 class TransducerIsCyclicException(HfstException):
     pass
@@ -169,58 +148,50 @@ class TransducerIsCyclicException(HfstException):
 #     #libhfst.HfstTransducer
 #     #libhfst.HfstInputStream.__init__
 # 
-#     An example. The file 'foofile' contains
-# \verbatim
-# This is a text file.
-# Here is another line.
-# The file ends here.
-# \endverbatim
-# 
-# When we try to read it, an exception will be thrown:
-# 
+#     An example. 
 # \verbatim
+# f = open('foofile', 'w')
+# f.write('This is an ordinary text file.\n')
+# f.close()
 # try:
 #     instr = libhfst.HfstInputStream('foofile')
+#     tr = instr.read()
+#     print(tr)
+#     instr.close()
 # except libhfst.NotTransducerStreamException:
-#     print "ERROR: file does not contain transducers."
+#     print("Could not print transducer: the file does not contain binary transducers.")
 # \endverbatim
 class NotTransducerStreamException(HfstException):
     pass
 
 ## The stream is not in valid AT&T format. 
 # 
-#     An example. The file 'testfile.att' contains
-# 
-# \verbatim
-# 0       1       a      b
-# 1
-# c
-# \verbatim
-# 
-# When we try to read it, an exception is thrown:
-# 
+#     An example: 
 # \verbatim
-# ifile = open('testfile.att', 'rb')
+# f = open('testfile1.att', 'w')
+# f.write('0 1 a b\n\
+# 1 2 c\n\
+# 2\n')
+# f.close()
+# f = libhfst.hfst_open('testfile1.att', 'r')
 # try:
-#     t = libhfst.HfstTransducer(ifile, libhfst.TROPICAL_OPENFST_TYPE, 'epsilon')
-#     print "read one transducer"
+#     tr = libhfst.read_att(f)
 # except libhfst.NotValidAttFormatException:
-#     print "Error reading transducer: not valid AT&T format."
-# ifile.close()
+#     print('Could not read file: it is not in valid ATT format.')
+# f.close()
 # \endverbatim
-#
 #     thrown by 
 #     #libhfst.HfstTransducer.__init__
 class NotValidAttFormatException(HfstException):
     pass
 
-## documentation (todo)
+## The input is not in valid LexC format.
 class NotValidLexcFormatException(HfstException):
     pass
 
 ## State is not final (and cannot have a final weight). 
 # 
-#     An example:
+#     An example :
 # 
 # \verbatim
 # tr = libhfst.HfstBasicTransducer()
@@ -229,7 +200,7 @@ class NotValidLexcFormatException(HfstException):
 # try:
 #     w = tr.get_final_weight(1)
 # except libhfst.StateIsNotFinalException:
-#     print "ERROR: State is not final."
+#     print("State is not final.")
 # \endverbatim
 # 
 # You should use function #libhfst.HfstBasicTransducer.is_final_state if you are not sure whether a
@@ -239,32 +210,22 @@ class NotValidLexcFormatException(HfstException):
 class StateIsNotFinalException(HfstException):
     pass
 
-## Context transducers are not automata.
-# 
-#     This exception is thrown by
-#     #libhfst.replace_up
-#     when either context transducer does not have equivalent input and
-#     output symbols in all its transitions.
-# 
-#     An example:
-# 
-# \verbatim
-# type = libhfst.SFST_TYPE
-# # The second context transducer is 
-# contexts = (libhfst.HfstTransducer('c', type), libhfst.HfstTransducer('c', 'd', type))
-# mapping = libhfst.HfstTransducer('a', 'b', type)
-# alphabet = ('a','a'), ('b','b'), ('c','c'), ('d','d')
-# # An exception is thrown
-# try:
-#     rule = libhfst.replace_up(contexts, mapping, True, alphabet)
-# except libhfst.ContextTransducersAreNotAutomataException:
-#     print "ERROR: Context transducers must be automata!"
-# \endverbatim
+## Transducers given as rule context are not automata.
+# @see libhfst.HfstTransducer.is_automaton()
 class ContextTransducersAreNotAutomataException(HfstException):
     pass
 
 ## Transducers are not automata.
-# 
+#
+# Example: 
+# \verbatim
+# tr1 = libhfst.regex('foo:bar')
+# tr2 = libhfst.regex('bar:baz')
+# try:
+#     tr1.cross_product(tr2)
+# except libhfst.TransducersAreNotAutomataException:
+#     print('Transducers must be automata in cross product.')
+# \endverbatim 
 #     This exception is thrown by
 #     #libhfst.HfstTransducer.cross_product
 #     when either input transducer does not have equivalent input and
@@ -274,13 +235,15 @@ class TransducersAreNotAutomataException(HfstException):
 
 ## The state number argument is not valid.
 # 
-#     An example:
+#     An example :
 # 
 # \verbatim
 # tr = libhfst.HfstBasicTransducer()
 # tr.add_state(1)
-# # An exception is thrown as there is no state number 2
-# w = tr.get_final_weight(2)
+# try:
+#     w = tr.get_final_weight(2)
+# except libhfst.StateIndexOutOfBoundsException:
+#     print('State number 2 does not exist')
 # \endverbatim
 class StateIndexOutOfBoundsException(HfstException):
     pass
@@ -311,21 +274,21 @@ class MissingOpenFstInputSymbolTableException(HfstException):
 # 
 # An example:
 # \verbatim
-# foo = libhfst.HfstTransducer('foo', libhfst.SFST_TYPE)
-# bar = libhfst.HfstTransducer('bar', libhfst.FOMA_TYPE)
-# foo.disjunct(bar)   # an exception is thrown 
+# libhfst.set_default_fst_type(libhfst.TROPICAL_OPENFST_TYPE)
+# tr1 = libhfst.regex('foo')
+# tr2 = libhfst.regex('bar')
+# tr2.convert(libhfst.FOMA_TYPE)
+# try:
+#     tr1.disjunct(tr2)
+# except libhfst.TransducerTypeMismatchException:
+#     print('The implementation types of transducers must be the same.')
 # \endverbatim
 class TransducerTypeMismatchException(HfstException):
     pass
 
-## TODO: The set of transducer pairs is empty. 
-# 
-#     Thrown by rule functions. An example:
+## The set of transducer pairs is empty. 
 # 
-# \verbatim
-#     contexts = (),  # contexts is empty
-#     restr = libhfst.restriction(contexts, mapping, alphabet, twol_type, direction); 
-# \endverbatim
+#     Thrown by rule functions.
 class EmptySetOfContextsException(HfstException):
     pass
 
@@ -406,22 +369,270 @@ TO_INITIAL_STATE = _libhfst.TO_INITIAL_STATE
 TO_FINAL_STATE = _libhfst.TO_FINAL_STATE
 
 
-## A wrapper for file, possibly needed in Windows
+## A wrapper class for file operations.
+# @see libhfst.hfst_open, libhfst.hfst_stdin, libhfst.hfst_stdout, libhfst.hfst_stderr
 class HfstFile:
-  ## Close the file
-  def close():
-      pass
-  ## Write \a string to the file
-  def write(string):
-      pass
+    ## Close the file. 
+    def close(self):
+        pass
+    ## Write string to the file.
+    # @param str String to be written.
+    def write(self, str):
+        pass
+    ## Whether the file is at end.
+    def is_eof(self):
+        pass
+
+## Open file named \a filename in mode \a mode.
+# @param filename The name of the file.
+# @param mode Mode in which the file is opened.
+def hfst_open(filename, mode):
+    pass
+## Get file that points to standard input.
+def hfst_stdin():
+    pass
+## Get file that points to standard output.
+def hfst_stdout():
+    pass
+## Get file that points to standard error stream.
+def hfst_stderr():
+    pass
 
-## Opens the file \a filename with arguments \a args
-# @return HfstFile
-def hfst_open(filename, args):
+## Set the default implementation type.
+# @param impl An libhfst.ImplementationType.
+#
+# Set the implementation type (SFST_TYPE, TROPICAL_OPENFST_TYPE, FOMA_TYPE) that is
+# used by default by all operations that create transducers. The default value is
+# TROPICAL_OPENFST_TYPE
+def set_default_fst_type(impl):
     pass
+## Get default transducer implementation type.
+# If the default type is not set, it defaults to libhfst.TROPICAL_OPENFST_TYPE
+def get_default_fst_type():
+    pass
+## Get a string representation of transducer implementation type \a type.
+# @param type An libhfst.ImplementationType.
+def fst_type_to_string(type):
+    pass
+
+## The string for epsilon symbol.
+# An example:
+# \verbatim
+# fsm = libhfst.HfstBasicTransducer()
+# fsm.add_state(1)
+# fsm.set_final_weight(1, 2.0)
+# fsm.add_transition(0, 1, "foo", libhfst.EPSILON)
+# if not libhfst.HfstTransducer(fsm).compare(libhfst.regex('foo:0::2.0')):
+#     raise RuntimeError('')
+# \endverbatim
+# @note In regular expressions, "0" is used for the epsilon.
+# @see <a href="Symbols.html">Symbols</a>
+EPSILON='@_EPSILON_SYMBOL_@'
+## The string for unknown symbol.
+# An example:
+# \verbatim
+# fsm = libhfst.HfstBasicTransducer()
+# fsm.add_state(1)
+# fsm.set_final_weight(1, -0.5)
+# fsm.add_transition(0, 1, "foo", libhfst.UNKNOWN)
+# fsm.add_transition(0, 1, "foo", "foo")
+# if not libhfst.HfstTransducer(fsm).compare(libhfst.regex('foo:?::-0.5')):
+#     raise RuntimeError('')
+# \endverbatim
+# @note In regular expressions, "?" on either or both sides of a transition is used for the unknown symbol.
+# @see <a href="Symbols.html">Symbols</a>
+UNKNOWN='@_UNKNOWN_SYMBOL_@'
+## The string for identity symbol.
+# An example:
+# \verbatim
+# fsm = libhfst.HfstBasicTransducer()
+# fsm.add_state(1)
+# fsm.set_final_weight(1, 1.5)
+# fsm.add_transition(0, 1, libhfst.IDENTITY, libhfst.IDENTITY)
+# if not libhfst.HfstTransducer(fsm).compare(libhfst.regex('?::1.5')):
+#     raise RuntimeError('')
+# \endverbatim
+# @note In regular expressions, a single "?" is used for the identity symbol.
+# @see <a href="Symbols.html">Symbols</a>
+IDENTITY='@_IDENTITY_SYMBOL_@'
 
+## Get a transducer that recognizes one or more paths.
+# @param arg See example below
+#
+# Possible inputs:
+# \verbatim
+# One unweighted identity path:
+# 'foo'  ->  [f o o]
+# Weighted path: a tuple of string and number, e.g. 
+# ('foo',1.4)
+# ('bar',-3)
+# ('baz',0)
+# Several paths: a list or a tuple of paths and/or weighted paths, e.g.
+# ['foo', 'bar']
+# ('foo', ('bar',5.0))
+# ('foo', ('bar',5.0), 'baz', 'Foo', ('Bar',2.4))
+# [('foo',-1), ('bar',0), ('baz',3.5)]
+# A dictionary mapping strings to any of the above cases:
+# {'foo':'foo', 'bar':('foo',1.4), 'baz':(('foo',-1),'BAZ')}
+# \endverbatim
+def fst(arg):
+    pass
 
-## A simple transducer class with tropical weights.
+## Get a transducer that recognizes the concatenation of symbols or symbol pairs in \a arg.
+# @param arg The symbols or symbol pairs that form the path to be recognized.
+#
+# Example 
+# \verbatim
+# import libhfst
+# tok = libhfst.HfstTokenizer()
+# tok.add_multichar_symbol('foo')
+# tok.add_multichar_symbol('bar')
+# tr = libhfst.tokenized_fst(tok.tokenize('foobar', 'foobaz'))
+# \endverbatim
+# will create the transducer [foo:foo bar:b 0:a 0:z]
+def tokenized_fst(arg, weight=0):
+    pass
+
+## Get an empty transducer.
+# Empty transducer has one state that is not final, i.e. it does not recognize any string.
+def empty_fst():
+    pass
+
+## Get an epsilon transducer.
+# @param weight The weight of the final state.
+# Epsilon transducer has one state that is final (with final weight \a weight), i.e. it recognizes the empty string.
+def epsilon_fst(weight=0):
+    pass
+
+## Get a transducer as defined by regular expression \a regexp.
+# @param regexp The regular expression defined with <a href="http://www.fsmbook.com/">Xerox transducer notation</a>.
+# @param kvargs Argumnets recognized are: error.
+# @param error Where warnings and errors are printed. Possible values are sys.stdout, sys.stderr (the default), a StringIO or None, indicating a quiet mode.
+def regex(regexp, **kvargs):
+    pass
+
+## Compile lexc file \a filename into a transducer.
+# @param filename The name of the lexc file.
+# @param kvargs Arguments recognized are: verbosity, with_flags, output.
+# @param verbosity The verbosity of the compiler, defaults to 0 (silent). Possible values are: 0, 1, 2.
+# @param with_flags Whether lexc flags are used when compiling, defaults to False.
+# @param output Where output is printed. Possible values are sys.stdout, sys.stderr, a StringIO, sys.stderr being the default?
+def compile_lexc_file(filename, **kvargs):
+    pass
+
+## Compile (is 'run' a better term?) xfst file \a filename.
+# @param filename The name of the xfst file.
+# @param kvargs Arguments recognized are: verbosity, quit_on_fail, output, type.
+# @param verbosity The verbosity of the compiler, defaults to 0 (silent). Possible values are: 0, 1, 2.
+# @param quit_on_fail Whether the script is exited on any error, defaults to True.
+# @param output Where output is printed. Possible values are sys.stdout, sys.stderr, a StringIO, sys.stderr being the default?
+# @param type Implementation type of the compiler, defaults to libhfst.get_default_fst_type().
+def compile_xfst_file(filename, **kvargs):
+    pass
+
+## Start interactive xfst compiler.
+# @param kvargs Arguments recognized are: type, quit_on_fail.
+# @param quit_on_fail Whether the compiler exits on any error, defaults to False.
+# @param type Implementation type of the compiler, defaults to libhfst.get_default_fst_type().
+def start_xfst(**kvargs):
+    pass
+
+## Read AT&T input from the user and return a transducer.
+# @return An HfstTransducer whose type is libhfst.get_default_fst_type().
+# Read one AT&T line at a time from standard input and create an equivalent transducer.
+# An empty line signals the end of input.
+def read_att_input():
+    pass
+
+## Read a multiline string \a att and return a transducer.
+# @param att A string in AT&& format that defines the transducer.
+# @return An HfstTransducer whose type is libhfst.get_default_fst_type().
+# Read \a att and create a transducer as defined in it.
+def read_att_string(att):
+    pass
+
+## Read next transducer from AT&T file pointed by \a f. \a epsilonstr defines the symbol used for epsilon in the file.
+# @param f A file pointer (#libhfst.HfstFile) to the file.
+# @param epsilonstr How epsilon is represented in the file. By default, "@_EPSILON_SYMBOL_@" and "@0@" are both recognized.
+#
+# If the file contains several transducers, they must be separated by "--" lines.
+    # In AT&T format, the transition lines are of the form:
+    # 
+    # \verbatim 
+    # [0-9]+[\w]+[0-9]+[\w]+[^\w]+[\w]+[^\w]([\w]+(-)[0-9]+(\.[0-9]+)) 
+    # \endverbatim
+    # 
+    # and final state lines:
+    # 
+    # \verbatim
+    # [0-9]+[\w]+([\w]+(-)[0-9]+(\.[0-9]+))
+    # \endverbatim
+    # 
+    # If several transducers are listed in the same file, they are separated by lines of 
+    # two consecutive hyphens "--". If the weight 
+    # \verbatim
+    # ([\w]+(-)[0-9]+(\.[0-9]+))
+    # \endverbatim
+    # is missing, the transition or final state is given a zero weight.
+    # 
+    # NOTE: If transition symbols contains spaces, they must be escaped
+    # as '\@_SPACE_\@' because spaces are used as field separators.
+    # Both '\@0\@' and '\@_EPSILON_SYMBOL_\@' are always interpreted as
+    # epsilons.
+    # 
+    # 
+    # An example: 
+    # \verbatim
+    # 0      1      foo      bar      0.3
+    # 1      0.5
+    # --
+    # 0      0.0
+    # --
+    # --
+    # 0      0.0
+    # 0      0      a        <eps>    0.2
+    # \endverbatim
+    # 
+    # The example lists four transducers in AT&T format: 
+    # one transducer accepting the string pair <'foo','bar'>, one
+    # epsilon transducer, one empty transducer and one transducer 
+    # that accepts any number of 'a's and produces an empty string
+    # in all cases. The transducers can be read with the following commands (from a file named 
+    # 'testfile.att'):
+    # \verbatim
+    # transducers = []
+    # ifile = libhfst.hfst_open('testfile2.att', 'r')
+    # try:
+    #     while (not ifile.is_eof()):
+    #         t = libhfst.read_att(ifile, '<eps>')
+    #         transducers.append(t)
+    #         print("read one transducer")
+    # except libhfst.NotValidAttFormatException:
+    #     print("Error reading transducer: not valid AT&T format.")
+    # ifile.close()
+    # print("Read %i transducers in total" % len(transducers))
+    # \endverbatim
+    # 
+    # Epsilon will be represented as libhfst.EPSILON in the resulting transducer.
+    # The argument \a epsilon_symbol only denotes how epsilons are represented 
+    # in \a ifile.
+    # 
+    # @throws NotValidAttFormatException 
+    # @throws StreamNotReadableException
+    # @throws StreamIsClosedException
+    # @throws EndOfStreamException
+    # @see #write_att
+def read_att(f, epsilonstr=libhfst.EPSILON):
+    pass
+
+## Read next transducer from prolog file pointed by \a f.
+# @param f A file pointer (#libhfst.HfstFile) to the file.
+#
+# If the file contains several transducers, they must be separated by empty lines.
+def read_prolog(f):
+    pass
+
+## A simple transducer class with tropical weights. 
 #
 #    An example of creating an HfstBasicTransducer [foo:bar baz:baz] 
 #    with weight 0.4 from scratch:
@@ -449,53 +660,150 @@ def hfst_open(filename, args):
 #
 # \verbatim
 #  # Go through all states
-#  for state in fsm.states(): 
-#        # Go through all transitions
-#        for transition in fsm.transitions(state):
-#              print "%i %i %s %s %f" % (state, transition.get_target_state(), transition.get_input_symbol(), transition.get_output_symbol(), transition,get_weight())
-#        # Print final states 
-#        if fsm.is_final_state(state): 
-#              print "%i %f" % (state, fsm.get_final_weight(state))
+#  for state, arcs in enumerate(fsm):
+#    for arc in arcs:
+#      print('%i ' % (state), end='')
+#      print(arc)
+#    if fsm.is_final_state(state):
+#      print('%i %f' % (state, fsm.get_final_weight(state)) )
 # \endverbatim
 #
 # @see #libhfst.HfstBasicTransition
 class HfstBasicTransducer:
 
+    # OMIT:
+    # HfstBasicTransducer(FILE *file);
+    # HfstBasicTransducer &operator=(const HfstBasicTransducer &graph);
+    # void add_symbols_to_alphabet(const HfstSymbolPairSet &symbols);
+    # void prune_alphabet_after_substitution(const std::set<unsigned int> &symbols);
+    # const HfstTransitions & operator[](HfstState s) const;
+    # void write_in_xfst_format(std::ostream &os, bool write_weights=true);
+    # void write_in_prolog_format(std::ostream & os, const std::string & name, bool write_weights=true);
+    # static HfstBasicTransducer read_in_prolog_format(std::istream &is, FILE *file, unsigned int & linecount);
+    # static HfstBasicTransducer read_in_prolog_format(std::istream &is, unsigned int & linecount);
+    # void write_in_att_format(std::ostream &os, bool write_weights=true); 
+    # void write_in_att_format_number(FILE *file, bool write_weights=true);
+    # static HfstBasicTransducer read_in_att_format(std::istream &is, FILE *file, std::string epsilon_symbol, unsigned int & linecount);
+    # static HfstBasicTransducer read_in_att_format(std::istream &is, std::string epsilon_symbol, unsigned int & linecount);
+    # HfstBasicTransducer & substitute(bool (*func)(const HfstSymbolPair &sp, HfstSymbolPairSet &sps) );
+
+    # ONE FUNCTION WITH KEYWORD ARGUMENTS HANDLES ALL THESE
+    # HfstBasicTransducer &substitute(const HfstSymbol &old_symbol, const HfstSymbol  &new_symbol, bool input_side=true, bool output_side=true);
+    # HfstBasicTransducer &substitute_symbols(const HfstSymbolSubstitutions &substitutions);
+    # HfstBasicTransducer &substitute_symbol_pairs(const HfstSymbolPairSubstitutions &substitutions);
+    # HfstBasicTransducer &substitute(const HfstSymbolPair &sp, const HfstSymbolPairSet &sps);
+    # HfstBasicTransducer &substitute(const HfstSymbolPair &old_pair, const HfstSymbolPair &new_pair);         
+    # HfstBasicTransducer &substitute(const HfstSymbolPair &sp, const HfstBasicTransducer &graph);
+
+    # TODO?:
+    # static HfstBasicTransducer intersect(HfstBasicTransducer & graph1, HfstBasicTransducer & graph2);
+    # HfstBasicTransducer &complete();
+    # std::vector<std::set<HfstState> > topsort(SortDistance dist) const;
+    # std::vector<unsigned int> path_sizes();         
+    # bool is_lookup_infinitely_ambiguous(const HfstOneLevelPath & s);
+    # bool is_lookup_infinitely_ambiguous(const StringVector & s);         
+    # void insert_transducer(HfstState state1, HfstState state2, const HfstBasicTransducer & graph);
+
+    ## The length of the longest path in transducer.
+    # 
+    # Length of a path means number of arcs on that path.
+    def longest_path_size(self):
+        pass
+
+    ## Whether the transducer is infinitely ambiguous.
+    #
+    # A transducer is infinitely ambiguous if there exists an input that will yield infinitely many results,
+    # i.e. there are input epsilon loops that are traversed with that input.
+    def is_infinitely_ambiguous(self):
+        pass
+
+    ## Whether the transducer is infinitely ambiguous with input \a str.
+    #
+    # @param str The input.
+    #
+    # A transducer is infinitely ambiguous with a given input if the input yields infinitely many results, i.e. there are
+    # input epsilon loops that are traversed with the input.
+    def is_lookup_infinitely_ambiguous(self, str):
+        pass
+
+    ## Lookup tokenized input \a input in the transducer minding flag diacritics.
+    # @param str A list/tuple of strings to look up.
+    # @param kvargs infinite_cutoff=-1, max_weight=None
+    # @param infinite_cutoff Defaults to -1, i.e. infinite.
+    # @param max_weight Defaults to None, i.e. infinity. 
+    def lookup_fd(self, input, **kvargs):
+        pass
 
     ## Add a new state to this transducer and return its number.      
     #  @return The next (smallest) free state number.
-    def add_state():
+    def add_state(self):
         pass
 
     ## Add a state \a s to this graph.
+    # @param state The number of the state to be added.
+    # @return \a state
+    #
     # If the state already exists, it is not added again.
     # All states with state number smaller than \a s are also
     # added to the transducer if they did not exist before.
-    # @return \a state
-    def add_state(state):
+    def add_state(self, state):
         pass
 
-    ## The states of the transducer.
+    ## The states of the transducer 
     # @return A tuple of state numbers.
-    def states():
+    #
+    # An example:
+    # /verbatim
+    # for state in fsm.states():
+    # for arc in fsm.transitions(state):
+    #     print('%i ' % (state), end='')
+    #     print(arc)
+    # if fsm.is_final_state(state):
+    #    print('%i %f' % (state, fsm.get_final_weight(state)) )
+    # /endverbatim
+    def states(self):
+        pass        
+
+    ## The states and transitions of the transducer.
+    # @return A tuple of tuples of HfstBasicTransitions.
+    # @see libhfst.HfstBasicTransducer.__enumerate__
+    def states_and_transitions(self):
         pass
 
     ## Explicitly add \a symbol to the alphabet of the graph.
     # @note Usually the user does not have to take care of the alphabet
     #       of a graph. This function can be useful in some special cases.
     # @ param symbol The string to be added.
-    def add_symbol_to_alphabet(symbol):
+    def add_symbol_to_alphabet(self, symbol):
         pass
 
     ## Explicitly add \a symbols to the alphabet of the graph.
     # @note Usually the user does not have to take care of the alphabet of a graph. This function can be useful in some special cases.
     # @param symbols A tuple of strings to be added.
-    def add_symbols_to_alphabet(symbols):
+    def add_symbols_to_alphabet(self, symbols):
         pass
 
-    ## Add a transition \a transition to state \a state, \a add_symbols_to_alphabet defines whether the transition symbols are added to the alphabet. 
-    # If state \a state does not exist, it is created.
-    def add_transition(state, transition, add_symbols_to_alphabet=True):
+    ## Add a transition \a transition to state \a state, \a add_symbols_to_alphabet defines whether the transition symbols are added to the alphabet.
+    # @param state The number of the state where the transition is added. If it does not exist, it is created.
+    # @param transition A libhfst.HfstBasicTransition that is added to \a state.
+    # @param add_symbols_to_alphabet Whether the transition symbols are added to the alphabet of the transducer. (In special cases this is not wanted.)
+    def add_transition(self, state, transition, add_symbols_to_alphabet=True):
+        pass
+
+    ## Add a transition from state \a source to state \a target with input symbol \a input, output symbol \a output and weight \a weight.
+    # @param source The number of the state where the transition is added. If it does not exist, it is created.
+    # @param target The number of the state where the transition leads. If it does not exist, it is created. (?)
+    # @param input The input symbol of the transition.
+    # @param output The output symbol of the transition.
+    # @param weight The weight of the transition.
+    def add_transition(self, source, target, input, output, weight=0):
+        pass
+
+    ## Remove transition \a transition from state \a s.
+    # @param s The state which \a transition belongs to.
+    # @param transition The transition to be removed.
+    # @param remove_symbols_from_alphabet (?) 
+    def remove_transition(self, s, transition, remove_symbols_from_alphabet=False):
         pass
     
     ## Disjunct this transducer with a one-path transducer defined by consecutive string pairs in \a spv that has weight \a weight.
@@ -505,32 +813,34 @@ class HfstBasicTransducer:
     #
     # There is no way to test whether a graph is a trie, so the use
     # of this function is probably limited to fast construction of a lexicon.
-    # Here is an example:
+    # Here is an example: 
     # 
     # \verbatim
     # lexicon = libhfst.HfstBasicTransducer()
-    # TOK = libhfst.HfstTokenizer
-    # lexicon.disjunct(TOK.tokenize('dog'), 0.3)
-    # lexicon.disjunct(TOK.tokenize('cat'), 0.5)
-    # lexicon.disjunct(TOK.tokenize('elephant'), 1.6)
+    # tok = libhfst.HfstTokenizer()
+    # lexicon.disjunct(tok.tokenize('dog'), 0.3)
+    # lexicon.disjunct(tok.tokenize('cat'), 0.5)
+    # lexicon.disjunct(tok.tokenize('elephant'), 1.6)
     # \endverbatim
-    def disjunct(stringpairpath, weight):
+    def disjunct(self, stringpairpath, weight):
         pass
 
     ## The symbols in the alphabet of the transducer.     
     # The symbols do not necessarily occur in any transitions of the transducer. 
     # Epsilon, unknown and identity symbols are always included in the alphabet.
-    # @return A tuple of symbols (strings).
-    def get_alphabet():
+    # @return A tuple of strings.
+    def get_alphabet(self):
         pass
 
     ## Get the final weight of state \a state in this transducer.
-    def get_final_weight(state):
+    # @param state The number of the state. If it does not exist, a StateIsNotFinalException is thrown.
+    # @throws libhfst.StateIsNotFinalException.
+    def get_final_weight(self, state):
         pass
 
     ## Get the biggest state number in use. 
     # @return The biggest state number in use.
-    def get_max_state():
+    def get_max_state(self):
         pass
 
     ## Harmonize this transducer and \a another.
@@ -541,160 +851,176 @@ class HfstBasicTransducer:
     # For example the graphs
     # \verbatim
     # [a:b ?:?]
-    # [c:d ? ?:c]\endverbatim
+    # [c:d ? ?:c]
+    # \endverbatim
     # are expanded to
     # \verbatim
     # [ a:b [?:? | ?:c | ?:d | c:d | d:c | c:? | d:?] ]
-    # [ c:d [? | a | b] [?:c| a:c | b:?] ]\endverbatim
+    # [ c:d [? | a | b] [?:c| a:c | b:?] ]
+    # \endverbatim
     # when harmonized.
     #
-    # The symbol '?' means \@_UNKNOWN_SYMBOL_\@ in either or both sides of a transition
-    # (transitions of type [?:x], [x:?] and [?:?]). The transition [?] means [\@_IDENTITY_SYMBOL_\@].
+    # The symbol '?' means libhfst.UNKNOWN in either or both sides of a transition
+    # (transitions of type [?:x], [x:?] and [?:?]). The transition [?] means libhfst.IDENTITY.
     #
     # @note This function is always called for all transducer arguments of functions
     #       that take two or more graphs as their arguments, unless otherwise said.
-    def harmonize(another):
+    def harmonize(self, another):
         pass
 
     ## Create a transducer with one initial state that has state number zero and is not a final state, i.e. create an empty transducer.
     def __init__(self):
         pass
 
-    ## Create a deep copy of HfstBasicTransducer \a transducer.
+    ## Create a transducer equivalent to \a transducer.
+    # @param transducer The transducer to be copied, #libhfst.HfstBasicTransducer or #libhfst.HfstTransducer.
     def __init__(self, transducer):
         pass
 
-    ## Create a transducer equivalent to HfstTransducer \a transducer.
-    def __init__(self, transducer):
+    ## Read a transducer from prolog file \a f. \a linecount is incremented as lines are read (is it in python?).
+    # @return A transducer constructed by reading from file \a file.
+    # This function is a static one.
+    def read_prolog(f, linecount):
         pass
 
-    ## Create a transducer as defined in file \a file in AT&T format.
-    # TODO: An example.
-    # @pre \a file is not at end, otherwise an exception is thrown.
-    # @note Multiple AT&T transducer definitions are separated with the line "--".
-    def __init__(self, file):
+    ## Write the transducer in prolog format to file \a f. Name the transducer \a name.
+    def write_prolog(self, f, name, write_weights=True):
         pass
 
-    ## Insert freely any number of \a symbol_pair in the transducer with weight \a weight.
-    # @param symbol_pair A string pair to be inserted.
-    # @param weight The weight of the inserted symbol pair.
-    def insert_freely(symbol_pair, weight):
+    ## Write the transducer in xfst format to file \a f.
+    def write_xfst(self, f, write_weights=True):
+        pass
+
+    ## Read a transducer in AT&T format from file \a f. \a epsilon_symbol defines the symbol used for epsilon, \a linecount is incremented as lines are read.
+    # @return A transducer constructed by reading from file \a file.
+    # This function is a static one.
+    def read_att(f, epsilon_symbol, linecount):
+        pass
+
+    ## Write this transducer in AT&T format to file \a f, \a write_weights defines whether weights are written.
+    def write_att(f, bool write_weights=True):
         pass
 
-    ## Insert freely any number of any symbol in \a symbol_pairs in the graph with weight \a weight.
-    # @param symbol_pairs A tuple of string pairs to be inserted.
+    ## Insert freely any number of \a symbol_pair in the transducer with weight \a weight.
+    # @param symbol_pair A string pair to be inserted.
     # @param weight The weight of the inserted symbol pair.
-    def insert_freely(symbol_pairs, weight):
+    def insert_freely(self, symbol_pair, weight):
         pass
 
-   ## Insert freely any number of \a transducer in this transducer.
-   # param transducer An HfstBasicTransducer to be inserted.
-    def insert_freely(transducer):
+    ## Insert freely any number of \a transducer in this transducer.
+    # param transducer An HfstBasicTransducer to be inserted.
+    def insert_freely(self, transducer):
         pass
 
     ## Whether state \a state is final. 
-    def is_final_state(state):
+    # @param state The state whose finality is returned.
+    def is_final_state(self, state):
         pass
-
-    ## The assignment operator.
-    # @return This transducer.
-    def assign(transducer):
+    
+    ## Get the transitions of state \a state in this transducer. 
+    # If the state does not exist, a @a StateIndexOutOfBoundsException is thrown.
+    # @return A tuple of HfstBasicTransitions.
+    #
+    # \verbatim
+    # for state in fsm.states():
+    # for arc in fsm.transitions(state):
+    #     print('%i ' % (state), end='')
+    #     print(arc)
+    # if fsm.is_final_state(state):
+    #    print('%i %f' % (state, fsm.get_final_weight(state)) )
+    # \endverbatim
+    def transitions(self, state):
+        pass
+    
+    ## Remove all symbols that do not occur in transitions of the transducer from its alphabet. 
+    #  Epsilon, unknown and identity symbols are always included in the alphabet.
+    def prune_alphabet(self):
         pass
     
-   ## Get the transitions of state \a state in this transducer. 
-   # If the state does not exist, a @a StateIndexOutOfBoundsException is thrown.
-   # @return A tuple of state numbers.
-    def transitions(state):
+    ## Get a list of all symbols used in the transitions of this transducer. 
+    def symbols_used(self):
         pass
 
-   ## Remove all symbols that do not occur in transitions of the transudcer from its alphabet. 
-   #  Epsilon, unknown and identity symbols are always included in the alphabet.
-    def prune_alphabet():
+    ## Get a list of all input/output symbol pairs used in the transitions of this transducer. 
+    def get_transition_pairs(self):
         pass
-    
+
     ## Remove symbol \a symbol from the alphabet of the graph. 
     #  @note Use with care, removing symbols that occur in the transitions of the graph can have unexpected results.
     # @param symbol The string to be removed.
-    def remove_symbol_from_alphabet(symbol):
+    def remove_symbol_from_alphabet(self, symbol):
         pass
     
     ## Remove symbols \a symbols from the alphabet of the graph. 
     #  @note Use with care, removing symbols that occur in the transitions of the graph can have unexpected results.
     # @param symbols A tuple of strings to be removed.
-    def remove_symbols_from_alphabet(symbols):
+    def remove_symbols_from_alphabet(self, symbols):
         pass
 
     ## Set the final weight of state \a state in this transducer to \a weight. 
     # If the state does not exist, it is created.
-    def set_final_weight(state, weight):
+    def set_final_weight(self, state, weight):
         pass
     
     ## Sort the arcs of this transducer according to input and output symbols.
     # @return This transducer.
-    def sort_arcs():
+    def sort_arcs(self):
         pass
 
-    ## Substitute \a old_symbol with \a new_symbol in all transitions. \a input_side and \a output_side define whether the substitution is made on input and output sides.
-    # @return This transducer.
-    def substitute(old_symbol, new_symbol, input_side=True, output_side=True):
-        pass
-    
-    ## Substitute all transition symbols as defined in \a substitutions.
-    # For each transition symbol x, \a substitutions is searched and if a mapping x -> X is found,
-    # the transition symbol x is replaced with X. If no mapping is found, the transition remains the same.
-    # The weights remain the same.
-    # @param substitutions A dictionary that maps symbols (strings) to symbols (strings).
-    def substitute_symbols(substitutions):
-        pass
-    
-    ## Substitute all transitions as defined in \a substitutions.
-    # For each transition x:y, \a substitutions is searched and if a mapping x:y -> X:Y is found,
-    # the transition x:y is replaced with X:Y. If no mapping is found, the transition remains the same.
-    # The weights remain the same.
-    # @param substitutions A dictionary that maps transitions (string pairs) to transitions (string pairs).
-    def substitute_symbol_pairs(substitutions):
-        pass
-    
-    ## Substitute all transitions \a sp with a set of transitions \a sps.
-    # The weights remain the same.
-    # @param sp A transition (string pair) to be substituted.
-    # @param sps A tuple of substituting transitions (string pairs).
-    def substitute(sp, sps):
-        pass
-    
-    ## Substitute all transitions \a old_pair with \a new_pair.
-    # @param old_pair The transition (string pair) to be substituted.
-    # @param new_pair The substituting transition (string pair).
-    def substitute(old_pair, new_pair):
-        pass
-        
-    ## Substitute all transitions equal to \a sp with a copy of \a transducer
+    ## Substitute symbols or transitions in the transducer.
     #
-    # Copies of \a transducer are attached to this graph with epsilon transitions.
+    # @param s The symbol or transition to be substituted. Can also be a dictionary of substitutions, if S == None.
+    # @param S The symbol, transition, a tuple of transitions or a transducer (libhfst.HfstBasicTransducer) that substitutes \a s.
+    # @param kvargs Arguments recognized are 'input' and 'output', their values can be False or True, True being the default.   
+    #               These arguments are valid only if \a s and \a S are strings, else they are ignored.
+    # @param input Whether substitution is performed on input side, defaults to True. Valid only if \a s and \a S are strings.
+    # @param output Whether substitution is performed on output side, defaults to True. Valid only if \a s and \a S are strings.
     #
-    # The weights of the transitions to be substituted are copied
-    # to epsilon transitions leaving from the source state of
-    # the transitions to be substituted to the initial state
-    # of a copy of \a transducer.
+    # Possible combinations of arguments and their types are:
     #
-    # The final weights in \a transducer are copied to epsilon transitions leading from
-    # the final states (after substitution non-final states)
-    # of \a transducer to target states of transitions equal to \a sp
-    # (that are substituted) in this transducer.
+    # (1) substitute(str, str, input=bool, output=bool): substitute symbol with symbol on input, output or both sides of each transition in the transducer.
+    # (2) substitute(strpair, strpair): substitute transition with transition
+    # (3) substitute(strpair, strpairtuple): substitute transition with several transitions
+    # (4) substitute(strpair, transducer): substitute transition with a transducer
+    # (5) substitute(dict): perform several symbol-to-symbol substitutions
+    # (6) substitute(dict): perform several transition-to-transition substitutions
     #
-    # @param sp The transition (string pair) to be substituted.
-    # @param transducer The substituting transducer.
-    def substitute(sp, transducer):
-        pass
-    
-    ## Write this transducer in AT&T format to file \a file, \a write_weights defines whether weights are written.
-    def write_in_att_format(file, write_weights=True):
+    # Examples: 
+    #
+    # (1) tr.substitute('a', 'A', input=True, output=False): substitute lowercase a:s with uppercase ones
+    # (2) tr.substitute(('a','b'),('A','B')): substitute transitions that map lowercase a into lowercase b with transitions that map uppercase a into uppercase b 
+    # (3) tr.substitute(('a','b'), (('A','B'),('a','B'),('A','b'))): change either or both sides of a transition [a:b] to uppercase
+    # (4) tr.substitute(('a','b'), libhfst.regex('[a:b]+')) change [a:b] transition into one or more consecutive [a:b] transitions
+    # (5) tr.substitute({'a':'A', 'b':'B', 'c':'C'}) change lowercase a, b and c into their uppercase variants
+    # (6) tr.substitute( {('a','a'):('A','A'), ('b','b'):('B','B'), ('c','c'):('C','C')} ): change lowercase a, b and c into their uppercase variants
+    #
+    # In case (4), epsilon transitions are used to attach copies of transducer \a S between the SOURCE and TARGET state of each transition that is substituted.
+    # The transition itself is deleted, but its weight is copied to the epsilon transition leading from SOURCE to the initial state of \a S.
+    # Each final state of \a S is made non-final and an epsilon transition leading to TARGET is attached to it. The final weight is copied to the epsilon transition.
+    # 
+    def substitute(self, s, S=None, **kvargs):
         pass
 
+    ## Return an enumeration of the states and transitions of the transducer. 
+    #
+    # \verbatim
+    # for state, arcs in enumerate(fsm):
+    #   for arc in arcs:
+    #     print('%i ' % (state), end='')
+    #     print(arc)
+    #   if fsm.is_final_state(state):
+    #     print('%i %f' % (state, fsm.get_final_weight(state)) )
+    # \endverbatim
+    def __enumerate__(self):
+        pass
 
-## Print an HfstBasicTransducer
-def print(hfst_basic_transducer):
-    pass
+    ## Return a string representation of the transducer.
+    #
+    # \verbatim
+    # print(fsm)
+    # \endverbatim
+    def __str__(self):
+        pass
 
 ## A transition class that consists of a target state, input and output symbols and a a tropical weight.
 # @see libhfst.HfstBasicTransducer
@@ -710,27 +1036,25 @@ class HfstBasicTransition:
         pass
 
     ## Get the input symbol of the transition.
-    def get_input_symbol():
+    def get_input_symbol(self):
         pass
 
     ## Get the output symbol of the transition.
-    def get_output_symbol():
+    def get_output_symbol(self):
         pass
 
     ## Get number of the target state of the transition.
-    def get_target_state():
+    def get_target_state(self):
         pass
         
     ## Get the weight of the transition.
-    def get_weight():
+    def get_weight(self):
         pass
 
-
-## Print an HfstBasicTransition
-def print(hfst_basic_transition):
-    pass
-
-
+    ## A string representation of the transition.
+    #
+    # @return "target_state input_symbol output_symbol, weight"
+    def __str__(self)
 
 ## A synchronous finite-state transducer.
 # 
@@ -757,8 +1081,8 @@ def print(hfst_basic_transition):
 # For functions that take a transducer as an argument, the type of the calling transducer
 # must be the same as the type of the argument transducer:
 # \verbatim
-# # this will cause an error
-# tropical_transducer.disjunct(sfst_transducer)
+# # this will cause a TransducerTypeMismatchException:
+# tropical_transducer.disjunct(foma_transducer)
 # # this works, but weights are lost in the conversion
 # tropical_transducer.convert(libhfst.SFST_TYPE).disjunct(sfst_transducer)     
 # # this works, information is not lost
@@ -772,41 +1096,6 @@ def print(hfst_basic_transition):
 # Transducers can also be created from scratch with #libhfst.HfstBasicTransducer
 # and converted to an HfstTransducer.
 # More complex transducers can be combined from simple ones with various functions.
-# 
-# <a name="symbols"></a> 
-# \section special_symbols Special symbols
-# 
-# The HFST transducers support transitions with epsilon, unknown and identity symbols.
-# The special symbols are explained in TODO
-# 
-# An example:
-# \verbatim
-# # In the xerox formalism used here, '?' means the unknown symbol
-# # and '?:?' the identity pair 
-# 
-# tr1 = libhfst.HfstBasicTransducer()
-# tr1.add_state(1)
-# tr1.set_final_weight(1, 0)
-# tr1.add_transition(0, libhfst.HfstBasicTransition(1, '@_UNKNOWN_SYMBOL_@, 'foo', 0) )
-# 
-# # tr1 is now [ ?:foo ]
-# 
-# tr2 = libhfst.HfstBasicTransducer tr2
-# tr2.add_state(1)
-# tr2.add_state(2)
-# tr2.set_final_weight(2, 0)
-# tr2.add_transition(0, libhfst.HfstBasicTransition(1, '@_IDENTITY_SYMBOL_@', '@_IDENTITY_SYMBOL_@', 0) )
-# tr2.add_transition(1, libhfst.HfstBasicTransition(2, 'bar', 'bar', 0) )
-# 
-# # tr2 is now [ [ ?:? ] [ bar:bar ] ]
-# 
-# type = libhfst.SFST_TYPE
-# Tr1 = HfstTransducer (tr1, type)
-# Tr2 = HfstTransducer (tr2, type)
-# Tr1.disjunct(Tr2)
-# 
-# # Tr1 is now [ [ ?:foo | bar:foo ]  |  [[ ?:? | foo:foo ] [ bar:bar ]] ] 
-# \endverbatim
 class HfstTransducer:
 
     ## Whether HFST is linked to the transducer library needed by implementation type \a type.
@@ -822,263 +1111,179 @@ class HfstTransducer:
     def __init__(self):
         pass
 
-    ## Read a binary transducer from transducer stream \a instr. 
-    # 
-    # The stream can contain tranducers or OpenFst, foma or SFST
-    # type in their native format, i.e. without an HFST header. 
-    # If the backend implementations are used as such, they are converted into HFST transducers.
-    # 
-    # For more information on transducer conversions and the HFST header
-    # structure, see 
-    # <a href="https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstTransducerHeader">here</a>.
-    # 
-    # @pre ((instr.is_eof() == instr.is_bad() == False) and instr.is_fst() ), Otherwise, an exception is thrown.
-    # 
-    # @throws NotTransducerStreamException 
-    # @throws StreamNotReadableException
-    # @throws StreamIsClosedException 
-    # @throws TransducerTypeMismatchException
-    # @throws MissingOpenFstInputSymbolTableException
-    # 
-    # @see libhfst.HfstInputStream libhfst.HfstTransducer.__init__
-    def __init__(self, instr):
-        pass
-
-    ## Create a deep copy of transducer \a another. 
+    ## Create a deep copy of HfstTransducer \a another or a transducer equivalent to HfstBasicTransducer \a another.
+    # @param another An HfstTransducer or HfstBasicTransducer.
     def __init__(self, another):
         pass
 
-    ## Create a transducer by tokenizing the utf8 string \a utf8_string with tokenizer \a multichar_symbol_tokenizer. The type of the transducer is defined by \a type. 
-    # 
-    # \a utf8_str is read one token at a time and for each token 
-    # a new transition is created in the resulting
-    # transducer. The input and output symbols of that transition are 
-    # the same as the token read.
-    # 
-    # An example:
-    # \verbatim
-    # ustring = 'foobar'
-    # TOK = libhfst.HfstTokenizer()
-    # tr = libfhst.HfstTransducer(ustring, TOK, FOMA_TYPE)
-    # # tr now contains one path [f o o b a r]
-    # \endverbatim
-    # 
-    # @see libhfst.HfstTokenizer 
-    def __init__(self, utf8_str, multichar_symbol_tokenizer, type):
-        pass
-
-    ## Create a transducer by tokenizing  the utf8 input string \a input_utf8_string and output string \a output_utf8_string with tokenizer \a multichar_symbol_tokenizer. The type of the transducer is defined by \a type. 
-    # 
-    # \a input_utf8_str and \a output_utf8_str are read one token at a time
-    # and for each token a new transition is created in the resulting transducer. 
-    # The input and output symbols of that transition are the same as 
-    # the input and output tokens read. If either string contains less tokens
-    # than another, epsilons are used as transition symbols for the shorter string.
-    # 
-    # An example:
-    # \verbatim
-    # input = 'foo'
-    # output = 'barr'
-    # TOK = libhfst.HfstTokenizer()
-    # tr = libhfst.HfstTransducer(input, output, TOK, libhfst.SFST_TYPE)
-    # # tr now contains one path [f:b o:a o:r 0:r]
-    # \endverbatim
-    # 
-    # @see libhfst.HfstTokenizer 
-    def __init__(self, input_utf8_str, output_utf8_str, multichar_symbol_tokenizer, type):
-        pass
-
-    ## Create an HFST transducer equivalent to HfstBasicTransducer \a t. The type of the created transducer is defined by \a type.  
+    ## Create an HFST transducer equivalent to HfstBasicTransducer \a t. The type of the created transducer is defined by \a type.
+    # @param t An HfstBasicTransducer.
+    # @param type The type of the resulting transducer.
+    # If you want to use the default type, you can just call
+    # libhfst.HfstTransducer(fsm)
     def __init__(self, t, type):
         pass
 
-    ## Create an empty transducer, i.e. a transducer that does not recognize any string. The type of the transducer is defined by \a type.
-    # 
-    # @note Use HfstTransducer('\@_EPSILON_SYMBOL_\@') to create an epsilon transducer. 
-    def __init__(self, type):
-        pass
-
-    ## Create a transducer that recognizes the string pair <'symbol','symbol'>, i.e. [symbol:symbol]. The type of the transducer is defined by \a type. 
-    def __init__(self, symbol, type):
+    ## Rename the transducer \a name.
+    # @param name The name of the transducer.
+    # @see #get_name 
+    def set_name(self, name):
         pass
-
-    ## Create a transducer that recognizes the string pair <'isymbol','osymbol'>, i.e [isymbol:osymbol]. The type of the transducer is defined by \a type. 
-    def __init__(self, isymbol, osymbol, type):
+ 
+    ## Get the name of the transducer. 
+    # @see #set_name 
+    def get_name(self):
         pass
 
-    ## Create a transducer of type \a type as defined in AT&T format in file \a ifile. \a epsilon_symbol defines how epsilons are represented.
-    # 
-    # In AT&T format, the transition lines are of the form:
-    # 
-    # \verbatim 
-    # [0-9]+[\w]+[0-9]+[\w]+[^\w]+[\w]+[^\w]([\w]+(-)[0-9]+(\.[0-9]+)) 
-    # \endverbatim
-    # 
-    # and final state lines:
-    # 
-    # \verbatim
-    # [0-9]+[\w]+([\w]+(-)[0-9]+(\.[0-9]+))
-    # \endverbatim
-    # 
-    # If several transducers are listed in the same file, they are separated by lines of 
-    # two consecutive hyphens "--". If the weight (<tt>([\\w]+(-)[0-9]+(\.[0-9]+))</tt>) 
-    # is missing, the transition or final state is given a zero weight.
-    # 
-    # NOTE: If transition symbols contains spaces, they must be escaped
-    # as '\@_SPACE_\@' because spaces are used as field separators.
-    # Both '\@0\@' and '\@_EPSILON_SYMBOL_\@' are always interpreted as
-    # epsilons.
-    # 
-    # 
-    # An example:
+    ## An AT&T representation of the transducer.
+    # Defined for print command. An example:
     # \verbatim
-    # 0      1      foo      bar      0.3
-    # 1      0.5
-    # --
-    # 0      0.0
-    # --
-    # --
-    # 0      0.0
-    # 0      0      a        <eps>    0.2
+    # >>> print(libhfst.regex('[foo:bar::2]+'))
+    # 0       1       foo     bar     2.000000
+    # 1       1       foo     bar     2.000000
+    # 1       0.000000
     # \endverbatim
-    # 
-    # The example lists four transducers in AT&T format: 
-    # one transducer accepting the string pair <'foo','bar'>, one
-    # epsilon transducer, one empty transducer and one transducer 
-    # that accepts any number of 'a's and produces an empty string
-    # in all cases. The transducers can be read with the following commands (from a file named 
-    # 'testfile.att'):
-    # \verbatim
-    # transducers = []
-    # ifile = open('testfile.att', 'rb')
-    # try:
-    #     while (not ifile.eof()):
-    #         t = libhfst.HfstTransducer(ifile, libhfst.TROPICAL_OPENFST_TYPE, '<eps>')
-    #         transducers.append(t)
-    #         print("read one transducer")
-    # except libhfst.NotValidAttFormatException:
-    #     print("Error reading transducer: not valid AT&T format.")
-    # ifile.close()
-    # print "Read %i transducers in total" % len(transducers)
-    # \endverbatim
-    # 
-    # Epsilon will be represented as '\@_EPSILON_SYMBOL_\@' in the resulting transducer.
-    # The argument \a epsilon_symbol only denotes how epsilons are represented 
-    # in \a ifile.
-    # 
-    # @throws NotValidAttFormatException 
-    # @throws StreamNotReadableException
-    # @throws StreamIsClosedException
-    # @throws EndOfStreamException
-    # @see #write_in_att_format 
-    def __init__(self, ifile, type, epsilon_symbol):
-        pass
-
-    ## Create a transducer that recognizes (any number of, if \a cyclic is True) the union of string pairs in \a sps. The type of the transducer is defined by \a type. 
-    # @param sps A tuple of consecutive string input/output pairs
-    # @param type The type of the transducer.
-    # @param cyclic Whether the transducer recognizes any number (from zero to infinity, inclusive) of consecutive string pairs in \a sps. 
-    def __init__(self, sps, type, cyclic=False):
-        pass
- 
-    ## Create a transducer that recognizes the concatenation of string pairs in \a spv. The type of the transducer is defined by \a type.
-    # @param spv A tuple of string pairs.
-    # @param type The type of the transducer. 
-    def __init__(self, spv, type):
-        pass
- 
-    ## Create a transducer that recognizes the concatenation of the unions of string pairs in string pair sets in \a spsv. The type of the transducer is defined by \a type. 
-    # @param spsv A tuple of tuples of string input/output pairs.
-    # @param type The type of the transducer.
-    def __init__(self, spsv, type):
+    # @todo Works only for small transducers.
+    def __str__(self):
         pass
 
-    ## Rename the transducer \a name. 
-    # @see #get_name 
-    def set_name(name):
-        pass
- 
-    ## Get the name of the transducer. 
-    # @see #set_name 
-    def get_name():
+    ## Make transducer coaccessible.
+    # A transducer is coaccessible iff there is a path from every state to a final state.
+    def prune(self):
         pass
 
     ## Set arbitrary string property \a property to \a value.
+    # @param property A string naming the property.
+    # @param value A string expressing the value of \a property.
     #
-    # set_property('name') equals set_name(string&).
+    # set_property('name', 'name of the transducer') equals set_name('name of the transducer').
     #
     # @note  While this function is capable of creating endless amounts of arbitrary metadata, it is suggested that property names are
     # drawn from central repository, or prefixed with "x-". A property that does not follow this convention may affect the behavior of
     # transducer in future releases.
-    def set_property(property, value):
+    def set_property(self, property, value):
         pass
 
     ## Get arbitrary string propert @a property.
-    # get_property('name') works like get_name.
-    def get_property(property):
+    # @param property The name of the property whose value is returned.
+    # get_property('name') works like get_name().
+    def get_property(self, property):
         pass
 
     ## Get all properties from the transducer.
-    # @return A dictionary of string-to-string mappings.
-    def get_properties():
+    # @return A dictionary whose keys are properties and whose values are the values of those properties.
+    def get_properties(self):
         pass
 
     ## Get the alphabet of the transducer. 
     # 
     # The alphabet is defined as the set of symbols known to the transducer. 
     # @return A tuple of strings.
-    def get_alphabet():
+    def get_alphabet(self):
         pass
 
     ## Explicitly insert \a symbol to the alphabet of the transducer. 
-    # 
+    # @param symbol The symbol (string) to be inserted.
+    #
     # @note Usually this function is not needed since new symbols are
     # added to the alphabet by default. 
-    def insert_to_alphabet(symbol):
+    def insert_to_alphabet(self, symbol):
         pass
  
-    ## Remove \a symbol from the alphabet of the transducer. CURRENTLY NOT IMPLEMENTED.
+    ## Remove \a symbol from the alphabet of the transducer.
+    # @param symbol The symbol (string) to be removed.
     # 
     # @pre \a symbol does not occur in any transition of the transducer.
     # @note Use with care, removing a symbol that occurs in a transition
     # of the transducer can have unexpected results. 
-    def remove_from_alphabet(symbol):
+    def remove_from_alphabet(self, symbol):
         pass
 
-    ## Whether the transducer is cyclic. 
-    def is_cyclic(void):
+    ## Eliminate flag diacritic \a symbol from the transducer.
+    # @param symbol The flag to be eliminated. TODO: explain more.
+    #
+    # An equivalent transducer with no flags \a symbol.
+    def eliminate_flag(self, symbol):
+        pass
+
+    ## Eliminate flag diacritics listed in \a symbols from the transducer.
+    # @param symbols The flags to be eliminated. TODO: explain more.
+    #
+    # An equivalent transducer with no flags listed in \a symbols.
+    def eliminate_flags(self, symbols):
+        pass
+
+    ## Whether each transition in the transducer has equivalent input and output symbols.
+    # @note Transition with libhfst.UNKNOWN on both sides IS NOT a transition with equivalent input and output symbols.
+    # @note Transition with libhfst.IDENTITY on both sides IS a transition with equivalent input and output symbols.
+    def is_automaton(self):
         pass
 
-    ## The implementation type of the transducer. 
-    def get_type(void):
+    ## Whether the transducer is cyclic.
+    def is_cyclic(self):
+        pass
+
+    ## The implementation type of the transducer.
+    # @return libhfst.ImplementationType
+    def get_type(self):
         pass
  
     ## Whether this transducer and \a another are equivalent.
+    # @param another The compared transducer.
+    # @pre \a self and \a another must have the same implementation type.
     # 
     # Two transducers are equivalent iff they accept the same input/output
     # string pairs with the same weights and the same alignments. 
-    def compare(another):
+    # @note For weighted transducers, the function often returns false negatives
+    #       due to weight precision issues. 
+    def compare(self, another):
+        pass
+
+    ## Remove all <i>epsilon:epsilon</i> transitions from the transducer so that the resulting transducer is equivalent to the original one. 
+    def remove_epsilons(self):
+        pass
+
+    ## Determinize the transducer.
+    # 
+    # Determinizing a transducer yields an equivalent transducer that has
+    # no state with two or more transitions whose input:output symbol
+    # pairs are the same. 
+    def determinize(self):
+        pass
+    
+    ## The number of states in the transducer.
+    def number_of_states(self):
+        pass
+
+    ## The number of transitions in the transducer.
+    def number_of_arcs(self):
+        pass
+
+    ## Write the transducer in binary format to \a ostr.
+    # @param ostr A libhfst.HfstOutputStream where the transducer is written.
+    def write(self, ostr):
         pass
 
-    ## Remove all <i>epsilon:epsilon</i> transitions from the transducer so that the resulting transducer is equivalent to the original one. 
-    def remove_epsilons():
+    ## Write the transducer in AT&T format to file \a f, \a write_weights defined whether weights are written.
+    # @param f An libhfst.HfstFile where the transducer is written.
+    # @param write_weights Whether weights are written.
+    def write_att(self, f, write_weights=True):
         pass
 
-    ## Determinize the transducer.
-    # 
-    # Determinizing a transducer yields an equivalent transducer that has
-    # no state with two or more transitions whose input:output symbol
-    # pairs are the same. 
-    def determinize():
+    ## Write the transducer in prolog format with name \a name to file \a f, \a write_weights defined whether weights are written.
+    # @param f An libhfst.HfstFile where the transducer is written.
+    # @param name The name of the transducer that must be given in a prolog file.
+    # @param write_weights Whether weights are written.
+    def write_prolog(f, name, write_weights=True):
         pass
-    
+
     ## Minimize the transducer.
     # 
     # Minimizing a transducer yields an equivalent transducer with 
     # the smallest number of states. 
     # 
     # @bug OpenFst's minimization algorithm seems to add epsilon transitions to weighted transducers? 
-    def minimize():
+    def minimize(self):
         pass
     
     ## Extract \a n best paths of the transducer. 
@@ -1095,39 +1300,39 @@ class HfstTransducer:
     # paths are extracted and it is converted back to #FOMA_TYPE or 
     # #SFST_TYPE. If HFST is not linked to OpenFst library, an
     # ImplementationTypeNotAvailableException is thrown.
-    def n_best(n):
+    def n_best(self, n):
         pass
     
     ## A concatenation of N transducers where N is any number from zero to infinity. 
-    def repeat_star():
+    def repeat_star(self):
         pass
     
     ## A concatenation of N transducers where N is any number from one to infinity. 
-    def repeat_plus():
+    def repeat_plus(self):
         pass
     
     ## A concatenation of \a n transducers. 
-    def repeat_n(unsigned int n):
+    def repeat_n(self, n):
         pass
     
     ## A concatenation of N transducers where N is any number from zero to \a n, inclusive.
-    def repeat_n_minus(n):
+    def repeat_n_minus(self, n):
         pass
     
     ## A concatenation of N transducers where N is any number from \a n to infinity, inclusive.
-    def repeat_n_plus(n):
+    def repeat_n_plus(self, n):
         pass
     
     ## A concatenation of N transducers where N is any number from \a n to \a k, inclusive.
-    def repeat_n_to_k(n, k):
+    def repeat_n_to_k(self, n, k):
         pass
     
     ## Disjunct the transducer with an epsilon transducer. 
-    def optionalize():
+    def optionalize(self):
         pass
     
     ## Swap the input and output symbols of each transition in the transducer. 
-    def invert():
+    def invert(self):
         pass
     
     ## Reverse the transducer. 
@@ -1135,25 +1340,31 @@ class HfstTransducer:
     # A reverted transducer accepts the string 'n(0) n(1) ... n(N)' 
     # iff the original
     # transducer accepts the string 'n(N) n(N-1) ... n(0)' 
-    def reverse():
+    def reverse(self):
         pass
     
     ## Extract the input language of the transducer. 
     # 
     # All transition symbol pairs <i>isymbol:osymbol</i> are changed 
     # to <i>isymbol:isymbol</i>. 
-    def input_project():
+    def input_project(self):
         pass
     
     ## Extract the output language of the transducer.
     # 
     # All transition symbol pairs <i>isymbol:osymbol</i> are changed 
     # to <i>osymbol:osymbol</i>. 
-    def output_project():
+    def output_project(self):
         pass
     
-    ## Compose this transducer with \a another. 
-    def compose(another):
+    ## Compose this transducer with \a another.
+    # @param another The second argument in the composition. Not modified.
+    def compose(self, another):
+        pass
+
+    ## Perform a lenient composition on this transducer and \a another.
+    # TODO: explain more.
+    def lenient_composition(self, another):
         pass
     
     ## Compose this transducer with the intersection of
@@ -1167,23 +1378,33 @@ class HfstTransducer:
     # @pre The transducers in \a v are deterministic and epsilon-free.
     # @param v A tuple of transducers.
     # @param invert Whether the intersection of the transducers in \a v is composed with this transducer.
-    def compose_intersect(v, invert=False):
+    def compose_intersect(self, v, invert=False):
         pass
     
     ## Concatenate this transducer with \a another. 
-    def concatenate(another):
+    def concatenate(self, another):
         pass
     
     ## Disjunct this transducer with \a another. 
-    def disjunct(another):
+    def disjunct(self, another):
         pass
 
     ## Intersect this transducer with \a another. 
-    def intersect(another):
+    def intersect(self, another):
         pass
     
     ## Subtract transducer \a another from this transducer. 
-    def subtract(another):
+    def subtract(self, another):
+        pass
+
+    ## Alias for subtract.
+    # @see libhfst.HfstTransducer.subtract
+    def minus(self, another):
+        pass
+
+    ## Alias for intersect.
+    # @see libhfst.HfstTransducer.intersect
+    def conjunct(self, another):
         pass
 
     ## Convert the transducer into an equivalent transducer in format \a type. 
@@ -1199,10 +1420,10 @@ class HfstTransducer:
     # 
     # @note For conversion between HfstBasicTransducer and HfstTransducer,
     # see #libhfst.HfstTransducer.__init__ and #libhfst.HfstBasicTransducer.__init__
-    def convert(type, options=''):
+    def convert(self, type, options=''):
         pass
     
-    ## Write the transducer in AT&T format to file \a ofile, \a write_weights defines whether weights are written.
+    ## Write the transducer in AT&T format to file \a ofile, \a write_weights defines whether weights are written. 
     # 
     # The fields in the resulting AT&T format are separated by tabulator characters.
     # 
@@ -1210,52 +1431,51 @@ class HfstTransducer:
     # whitespace characters are used as field separators in AT&T format. Epsilon symbols are printed as '\@0\@'.
     # 
     # If several transducers are written in the same file, they must be separated by a line of two consecutive hyphens "--", so that
-    # they will be read correctly by HfstTransducer(file, type, epsilon).
+    # they will be read correctly by libhfst.read_att.
     # 
     # An example:
     # \verbatim
-    # type = libhfst.FOMA_TYPE
-    # foobar = libhfst.HfstTransducer('foo','bar',type)
-    # epsilon = libhfst.HfstTransducer('@_EPSILON_SYMBOL_@',type)
-    # empty = libhfst.HfstTransducer(type)
-    # a_star = libhfst.HfstTransducer('a',type)
-    # a_star.repeat_star()
-    # 
-    # ofile = open('testfile.att', 'wb')
-    # foobar.write_in_att_format(ofile)
-    # ofile.write("--\n")
-    # epsilon.write_in_att_format(ofile)
-    # ofile.write("--\n")
-    # empty.write_in_att_format(ofile)
-    # ofile.write("--\n")
-    # a_star.write_in_att_format(ofile)
-    # ofile.close()
+    # tr1 = libhfst.regex('[foo:bar baz:0 " "]::0.3')
+    # tr2 = libhfst.empty_fst()
+    # tr3 = libhfst.epsilon_fst(0.5)
+    # tr4 = libhfst.regex('[foo]')
+    # tr5 = libhfst.empty_fst()
+    # 
+    # f = libhfst.hfst_open('testfile.att', 'w')
+    # for tr in [tr1, tr2, tr3, tr4]:
+    #     tr.write_att(f)
+    #     f.write('--\n')
+    # tr5.write_att(f)
+    # f.close()
     # \endverbatim
     # 
     # This will yield a file 'testfile.att' that looks as follows:
     # \verbatim
-    # 0    1    foo  bar  0.0
-    # 1    0.0
+    # 0       1       foo     bar     0.299805
+    # 1       2       baz     @0@     0.000000
+    # 2       3       @_SPACE_@       @_SPACE_@       0.000000
+    # 3       0.000000
     # --
-    # 0    0.0
     # --
+    # 0       0.500000
+    # --
+    # 0       1       foo     foo     0.000000
+    # 1       0.000000
     # --
-    # 0    0.0
-    # 0    0    a    a    0.0
     # \endverbatim
     # 
     # @throws StreamCannotBeWrittenException 
     # @throws StreamIsClosedException
     # 
-    # @see #libhfst.HfstOutputStream.redirect
+    # @see #libhfst.HfstOutputStream.write
     # @see #libhfst.HfstTransducer.__init__
-    def write_in_att_format(ofile, write_weights=True):
+    def write_att(self, ofile, write_weights=True):
         pass
 
     ## Write the transducer in AT&T format to file named \a filename. \a write_weights defines whether weights are written.
     # 
     # If the file exists, it is overwritten. If the file does not exist, it is created. 
-    def write_in_att_format(filename, write_weights=True):
+    def write_att(self, filename, write_weights=True):
         pass
 
     ## Make priority union of this transducer with \a another.
@@ -1281,13 +1501,13 @@ class HfstTransducer:
     # \endverbatim
     # For more information, read <a href="http://www.fsmbook.com/">fsmbook</a>.
     #  
-    def priority_union(another):
+    def priority_union(self, another):
         pass
     
     ## Make cross product of this transducer with \a another. It pairs every string of this with every string of \a another.
     # If strings are not the same length, epsilon padding will be added in the end of the shorter string.
     # @pre Both transducers must be automata, i.e. map strings onto themselves.
-    def cross_product(another):
+    def cross_product(self, another):
         pass
     
     ## Shuffle this transducer with transducer \a another.
@@ -1297,105 +1517,160 @@ class HfstTransducer:
     # [(f|b)(o|a)(o|r)].
     #   
     # @pre Both transducers must be automata, i.e. map strings onto themselves.
-    def shuffle(another):
-        pass
-        
-    ## Freely insert symbol pair \a symbol_pair into the transducer. 
-    # 
-    # To each state in this transducer is added a transition that 
-    # leads from that state to itself with input and output symbols 
-    # defined by \a symbol_pair.
-    # @param symbol_pair A string pair to be inserted.
-    def insert_freely(symbol_pair):
+    def shuffle(self, another):
         pass
-    
-    ## Freely insert a copy of \a tr into the transducer. 
+
+    ## Freely insert a transition or a transducer into the transducer.
+    # @param ins The transition or transducer to be inserted.
     # 
-    # A copy of \a tr is attached with epsilon transitions 
+    # If \a ins is a transition, i.e. a 2-tuple of strings: A transition is added to each state in this transducer.
+    # The transition leads from that state to itself with input and output symbols defined by \a ins.
+    # The weight of the transition is zero.
+    #
+    # If \a ins is an #libhfst.HfstTransducer:
+    # A copy of \a ins is attached with epsilon transitions 
     # to each state of this transducer. After the operation, for each 
     # state S in this transducer, there is an epsilon transition 
-    # that leads from state S to the initial state of \a tr, 
-    # and for each final state of \a tr, there is an epsilon transition
+    # that leads from state S to the initial state of \a ins, 
+    # and for each final state of \a ins, there is an epsilon transition
     # that leads from that final state to state S in this transducer.
-    # The weights of the final states in \a tr are copied to the 
+    # The weights of the final states in \a ins are copied to the 
     # epsilon transitions leading to state S.
-    # 
-    # Implemented only for HfstBasicTransducer. 
-    # Conversion is carried out for an HfstTransducer, if this function
-    # is called.
-    # 
-    def insert_freely(tr):
+    def insert_freely(self, ins):
         pass
     
     ## Set the weights of all final states to \a weight. 
     # If the HfstTransducer is of unweighted type (#libhfst.SFST_TYPE or #libhfst.FOMA_TYPE), nothing is done.
-    def set_final_weights(float weight):
+    def set_final_weights(self, weight):
         pass
     
-    ## Push weights towards initial or final state(s) 
-    # as defined by \a type.
+    ## Push weights towards initial or final state(s) as defined by \a type.
+    # @param PushType defining if weights are pushed towards initial state or final states, possible values are libhfst.TO_INITIAL_STATE and libhst.TO_FINALSTATE
+    # 
+    # If the HfstTransducer is of unweighted type (#SFST_TYPE or #FOMA_TYPE), nothing is done.
+    #
+    # An example:
+    # \verbatim
+    # >>> import libhfst
+    # >>> tr = libhfst.regex('[a::1 a:b::0.3 (b::0)]::0.7;')
+    # >>> tr.push_weights(libhfst.TO_INITIAL_STATE)
+    # >>> print(tr)
+    # 0       1       a       a       2.000000
+    # 1       2       a       b       0.000000
+    # 2       3       b       b       0.000000
+    # 2       0.000000
+    # 3       0.000000
+    # 
+    # >>> tr.push_weights(libhfst.TO_FINAL_STATE)
+    # >>> print(tr)
+    # 0       1       a       a       0.000000
+    # 1       2       a       b       0.000000
+    # 2       3       b       b       0.000000
+    # 2       2.000000
+    # 3       2.000000
     # 
-    # If the HfstTransducer is of unweighted type 
-    # (#SFST_TYPE or #FOMA_TYPE), nothing is done.
+    # \endverbatim
+    #
     # @see #libhfst.TO_INITIAL_STATE #libhfst.TO_FINAL_STATE
     # 
-    def push_weights(PushType type):
+    def push_weights(self, type):
         pass
 
-    ## Substitute \a old_symbol with \a new_symbol in all transitions. \a input_side and \a output_side define whether the substitution is made on input and output sides.
-    # @return This transducer.
-    def substitute(old_symbol, new_symbol, input_side=True, output_side=True):
-        pass
-    
-    ## Substitute all transition symbols as defined in \a substitutions.
-    # For each transition symbol x, \a substitutions is searched and if a mapping x -> X is found,
-    # the transition symbol x is replaced with X. If no mapping is found, the transition remains the same.
-    # The weights remain the same.
-    # @param substitutions A dictionary that maps symbols (strings) to symbols (strings).
-    def substitute_symbols(substitutions):
-        pass
-    
-    ## Substitute all transitions as defined in \a substitutions.
-    # For each transition x:y, \a substitutions is searched and if a mapping x:y -> X:Y is found,
-    # the transition x:y is replaced with X:Y. If no mapping is found, the transition remains the same.
-    # The weights remain the same.
-    # @param substitutions A dictionary that maps transitions (string pairs) to transitions (string pairs).
-    def substitute_symbol_pairs(substitutions):
-        pass
-    
-    ## Substitute all transitions \a sp with a set of transitions \a sps.
-    # The weights remain the same.
-    # @param sp A transition (string pair) to be substituted.
-    # @param sps A tuple of substituting transitions (string pairs).
-    def substitute(sp, sps):
+    ## Substitute symbols or transitions in the transducer.
+    #
+    # @param s The symbol or transition to be substituted. Can also be a dictionary of substitutions, if S == None.
+    # @param S The symbol, transition, a tuple of transitions or a transducer (libhfst.HfstTransducer) that substitutes \a s.
+    # @param kvargs Arguments recognized are 'input' and 'output', their values can be False or True, True being the default.   
+    #               These arguments are valid only if \a s and \a S are strings, else they are ignored.
+    # @param input Whether substitution is performed on input side, defaults to True. Valid only if \a s and \a S are strings.
+    # @param output Whether substitution is performed on output side, defaults to True. Valid only if \a s and \ S are strings.
+    #
+    # For more information, see libhfst.HfstBasicTransducer.substitute. The function works similarly, with the exception
+    # of argument \a S, which must be libhfst.HfstTransducer instead of libhfst.HfstBasicTransducer.
+    #
+    # @see libhfst.HfstBasicTransducer.substitute
+    def substitute(self, s, S=None, **kvargs):
         pass
-    
-    ## Substitute all transitions \a old_pair with \a new_pair.
-    # @param old_pair The transition (string pair) to be substituted.
-    # @param new_pair The substituting transition (string pair).
-    def substitute(old_pair, new_pair):
+
+    ## Lookup string \a input.
+    # @param input The input.
+    # @param kvargs Possible parameters and their default values are: obey_flags=True, max_number=-1, time_cutoff=0.0, output='tuple'
+    # @param obey_flags Whether flag diacritics are obeyed. Currently always True.
+    # @param max_number Maximum number of results returned, defaults to -1, i.e. infinity.
+    # @param time_cutoff How long the function can search for results before returning, expressed in seconds. Defaults to 0.0, i.e. infinitely.
+    # @param output Possible values are 'tuple', 'text' and 'raw', 'tuple' being the default.
+    def lookup(self, input, **kvargs):
         pass
-        
-    ## Substitute all transitions equal to \a sp with a copy of \a transducer
+
+    ## Extract paths that are recognized by the transducer. 
+    #
+    # @param kvargs Arguments recognized are filter_flags, max_cycles, max_number, obey_flags, output, random.
+    # @param filter_flags Whether flags diacritics are filtered out from the result (default True).
+    # @param max_cycles Indicates how many times a cycle will be followed, with negative numbers indicating unlimited (default -1 i.e. unlimited).
+    # @param max_number The total number of resulting strings is capped at this value, with 0 or negative indicating unlimited (default -1 i.e. unlimited).
+    # @param obey_flags Whether flag diacritics are validated (default True).
+    # @param output Output format. Values recognized: 'text' (as a string, separated by newlines), 'raw' (libhfst.HfstTwoLevelPaths), 'dict' (a dictionary that maps input strings into tuples of an output string and a weight, the default). 
+    # @param random Whether result strings are fetched randomly (default False).
+    # @return The extracted strings. \a output controls how they are represented.
+    #
+    # @pre The transducer must be acyclic, if both \a max_number and \a max_cycles have unlimited values. Else a libhfst.TransducerIsCyclicException will be thrown.
     #
-    # Copies of \a transducer are attached to this graph with epsilon transitions.
+    # An example:
+    # 
+    # \verbatim
+    # >>> tr = libhfst.regex('a:b+ (a:c+)')
+    # >>> print(tr)
+    # 0       1       a       b       0.000000
+    # 1       1       a       b       0.000000
+    # 1       2       a       c       0.000000
+    # 1       0.000000
+    # 2       2       a       c       0.000000
+    # 2       0.000000
+    #
+    # >>> print(tr.extract_paths(max_cycles=1, output='text'))
+    # a:b     0
+    # aa:bb   0
+    # aaa:bbc 0
+    # aaaa:bbcc       0
+    # aa:bc   0
+    # aaa:bcc 0
     #
-    # The weights of the transitions to be substituted are copied
-    # to epsilon transitions leaving from the source state of
-    # the transitions to be substituted to the initial state
-    # of a copy of \a transducer.
+    # >>> print(tr.extract_paths(max_number=4, output='text'))
+    # a:b     0
+    # aa:bc   0
+    # aaa:bcc 0
+    # aaaa:bccc       0
+    # 
+    # >>> print(tr.extract_paths(max_cycles=1, max_number=4, output='text'))
+    # a:b     0
+    # aa:bb   0
+    # aa:bc   0
+    # aaa:bcc 0
     #
-    # The final weights in \a transducer are copied to epsilon transitions leading from
-    # the final states (after substitution non-final states)
-    # of \a transducer to target states of transitions equal to \a sp
-    # (that are substituted) in this transducer.
+    # \endverbatim
     #
-    # @param sp The transition (string pair) to be substituted.
-    # @param transducer The substituting transducer.
-    def substitute(sp, transducer):
+    # @throws TransducerIsCyclicException
+    # @see #libhfst.HfstTransducer.n_best
+    # @note <a href="Symbols.html">Special symbols</a> are printed as such.
+    # @todo a link to flag diacritics
+    def extract_paths(self, **kvargs):
+        pass
+
+    ## Extract shortest paths of the transducer.
+    # @return A dictionary.
+    def extract_shortest_paths():
+        pass
+
+    ## Extract longest paths of the transducer.
+    # @return A dictionary.
+    def extract_longest_paths(**kvargs):
+        pass
+
+    ## Get length of longest path of the transducer.
+    def longest_path_size(**kvargs):
         pass
 
-    ## Lookup or apply a single tokenized string \a tok_input and return a maximum of \a limit results.
+    # Lookup or apply a single tokenized string \a tok_input and return a maximum of \a limit results.
     # 
     # TODO: This is a version of lookup that handles flag diacritics as ordinary
     # symbols and does not validate the sequences prior to outputting. Currently, this function calls lookup_fd.
@@ -1405,27 +1680,25 @@ class HfstTransducer:
     # @return HfstOneLevelPaths pointer
     # @param tok_input A tuple of consecutive symbols (strings).
     # @param limit Number of strings to look up. -1 tries to look up all and may get stuck if infinitely ambiguous.
-    def lookup(tok_input, limit=-1):
-        pass
+    # def lookup(tok_input, limit=-1):
+    #    pass
     
-    # @brief Lookup or apply a single string \a input and return a maximum of \a limit results.
+    ## Lookup or apply a single string \a input and return a maximum of \a limit results.
     # 
     # This is an overloaded lookup function that leaves tokenizing to the transducer.
     # @return HfstOneLevelPaths pointer
-    # @see #lookup(tok_string, limit=-1)
-    def lookup(input, limit=-1):
-        pass
+    #def lookup(input, limit=-1):
+    #    pass
     
-    ## Lookup or apply a single string \a input and return a maximum of \a limit results. \a tok defined how \a s is tokenized.
+    # Lookup or apply a single string \a input and return a maximum of \a limit results. \a tok defined how \a s is tokenized.
     #
     # This is an overloaded lookup function that leaves tokenizing to \a tok.
     # @return HfstOneLevelPaths pointer
-    # @see #lookup(tok_string, limit=-1)
-    def lookup(tok, input, limit=-1):
-        pass
+    # def lookup(tok, input, limit=-1):
+    #    pass
     
     
-    ## Lookup or apply a single string \a tok_input minding flag diacritics properly and return a maximum of \a limit results.
+    # Lookup or apply a single string \a tok_input minding flag diacritics properly and return a maximum of \a limit results.
     #
     # Traverse all paths on logical first level of the transducer to produce
     # all possible outputs on the second.
@@ -1446,138 +1719,44 @@ class HfstTransducer:
     # @return HfstOneLevelPaths pointer
     #
     # @todo Do not ignore argument \a limit.
-    def lookup_fd(tok_input, limit = -1):
-        pass
+    # def lookup_fd(tok_input, limit = -1):
+    #    pass
     
-    ## Lookup or apply a single string \a s minding flag diacritics properly and return a maximum of \a limit results.
+    # Lookup or apply a single string \a s minding flag diacritics properly and return a maximum of \a limit results.
     #
     # This is an overloaded lookup function that leaves tokenizing to the transducer.
     # @return HfstOneLevelPaths pointer
-    # @see #lookup(tok_string, limit=-1)
-    def lookup_fd(input, limit = -1):
-        pass
+    # def lookup_fd(input, limit = -1):
+    #    pass
     
     
-    ## Lookup or apply a single string \a input minding flag diacritics properly and return a maximum of \a limit results. \a tok defines how s is tokenized.
+    # Lookup or apply a single string \a input minding flag diacritics properly and return a maximum of \a limit results. \a tok defines how s is tokenized.
     #
     # This is an overloaded lookup function that leaves tokenizing to \a tok.
     # @return HfstOneLevelPaths pointer
-    # @see #lookup(tok_string, limit=-1)
-    def lookup_fd(tok, input, limit = -1):
-        pass
+    # def lookup_fd(tok, input, limit = -1):
+    #    pass
 
-    ## Whether lookup of path \a input will have infinite results.
+    # Whether lookup of path \a input will have infinite results.
     #
     # Currently, this function will return whether the transducer
     # is infinitely ambiguous on any lookup path found in the transducer,
     # i.e. the argument \a input is ignored.
     #
     # @todo Do not ignore the argument \a input
-    # @see #lookup(tok_input, limit=-1)
-    def is_lookup_infinitely_ambiguous(tok_input):
+    def is_lookup_infinitely_ambiguous(self, tok_input):
         pass
 
-    ## Compile a lexc file in file \a filename into an HfstTransducer of type \a type and return the transducer.
-    # This function is a static one.  
-    def read_lexc(filename, type):
+    ## Whether the transducer is infinitely ambiguous.
+    #
+    # A transducer is infinitely ambiguous if there exists an input that will yield infinitely many results,
+    # i.e. there are input epsilon loops that are traversed with that input.
+    def is_infinitely_ambiguous(self):
         pass
 
-
-## Return the HfstTransducer pointed by \a transducer_ptr.
-def ptrvalue(transducer_ptr):
-    pass
-
-## Extract a maximum of \a max_num paths that are recognized by \a transducer following a maximum of \a cycles cycles.
-# 
-# @return An HfstTwoLevelPaths that contains the extracted paths.
-# @param max_num The total number of resulting strings is capped at \a max_num, with 0 or negative indicating unlimited. 
-# @param cycles Indicates how many times a cycle will be followed, with negative numbers indicating unlimited.
-# @param transducer The transducer where paths are searched.
-# 
-# This is a version of extract_paths that handles flag diacritics 
-# as ordinary symbols and does not validate the sequences prior to
-# outputting as opposed to #libhfst.extract_paths_fd
-# 
-# If this function is called on a cyclic transducer with unlimited
-# values for both \a max_num and \a cycles, an exception will be thrown.
-# 
-# This example
-# 
-# \verbatim
-# type = libhfst.SFST_TYPE
-# tr1 = libhfst.HfstTransducer('a', 'b', type)
-# tr1.repeat_star()
-# tr2 = libhfst.HfstTransducer('c', 'd', type)
-# tr2.repeat_star()
-# tr1.concatenate(tr2).minimize()
-# results = libhfst.detokenize_paths(libhfst.extract_paths(tr1, MAX_NUM, CYCLES))
-# 
-# for path in results:
-#     print "%s : &s" % (path.input, path.output)
-# \endverbatim
-# 
-# prints with values MAX_NUM == -1 and CYCLES == 1 all paths
-# that have no consecutive cycles:
-# 
-# \verbatim
-# a : b
-# ac : bd
-# acc : bdd
-# c : d
-# cc : dd
-# \endverbatim
-# 
-# and with values MAX_NUM == 7 and CYCLES == 2 a maximum of 7 paths
-# that follow a cycle a maximum of 2 times (there are 11 such paths,
-# but MAX_NUM limits their number to 7):
-# 
-# \verbatim
-# a : b
-# aa : bb
-# aac : bbd
-# aacc : bbdd
-# c : d
-# cc : dd
-# ccc : ddd
-# \endverbatim
-# 
-# @bug Does not work for HFST_OL_TYPE or HFST_OLW_TYPE?
-# @throws TransducerIsCyclicException
-# @see #libhfst.HfstTransducer.n_best 
-# @see #libhfst.extract_paths_fd
-# 
-def extract_paths(transducer, max_num=-1, cycles=-1):
-    pass
-
-## Extract a maximum of \a max_num paths that are recognized by the transducer and are not invalidated by flag diacritic rules following a maximum of \a cycles cycles. \a filter_fd defines whether the flag diacritics themselves are filtered out of the result strings.
-#
-# @return An HfstTwoLevelPaths that contains the extracted paths.
-# @param max_num The total number of resulting strings is capped at \a max_num, with 0 or negative indicating unlimited. 
-# @param cycles Indicates how many times a cycle will be followed, with negative numbers indicating unlimited.
-# @param filter_fd  Whether the flag diacritics are filtered out of the result strings.
-# @param transducer The transducer where paths are searched.
-# 
-# If this function is called on a cyclic transducer with unlimited
-# values for both \a max_num and \a cycles, an exception will be thrown.
-# 
-# Flag diacritics are of the form @[PNDRCU][.][A-Z]+([.][A-Z]+)?@. 
-# 
-# For example the transducer 
-# 
-# \verbatim
-# [[@U.FEATURE.FOO@ foo] | [@U.FEATURE.BAR@ bar]]  |  [[foo @U.FEATURE.FOO@] | [bar @U.FEATURE.BAR@]]
-# \endverbatim
-# 
-# will yield the paths <CODE>[foo foo]</CODE> and <CODE>[bar bar]</CODE>.
-# <CODE>[foo bar]</CODE> and <CODE>[bar foo]</CODE> are invalidated
-# by the flag diacritics so thay will not be included in \a results.
-# 
-# 
-# @bug Does not work for HFST_OL_TYPE or HFST_OLW_TYPE?
-# @throws TransducerIsCyclicException
-# @see #libhfst.extract_paths 
-def extract_paths_fd(transducer, max_num=-1, cycles=-1, filter_fd=False):
-    pass
+    ## Whether the transducer has flag diacritics in its transitions.
+    def has_flag_diacritics(self):
+        pass
 
 ## Detokenize \a tokenized_paths.
 #
@@ -1597,69 +1776,30 @@ def detokenize_paths(tokenized_paths):
 def detokenize_and_purge_paths(tokenized_paths):
     pass
 
-
- 
-# TODO: void extract_random_paths
-# (HfstTwoLevelPaths &results, int max_num) const;
-# 
-# void extract_random_paths_fd
-# (HfstTwoLevelPaths &results, int max_num, bool filter_fd) const;
-# 
-# /* \brief Call \a callback with extracted strings that are not 
-# invalidated by flag diacritic rules.
-# 
-# @see #extract_paths extract_paths_fd
-# (ExtractStringsCb& callback, int cycles=-1, bool filter_fd=true) const;
-
-
 ##  A stream for reading HFST binary transducers. 
 #
 # An example:
 # \verbatim
-# instr = 0
-# try:
-#     instr = libhfst.HfstInputStream('testfile') 
-# except libhfst.StreamNotReadableException: 
-#     print "ERROR: File does not exist."
-#     exit()
-#
-# transducers_read = 0
-#
-# while not in.is_eof(): 
-#     if instr.is_bad():
-#         print "ERROR: Stream cannot be read."
-#         exit(1) 
-#     t = libhfst.HfstTransducer(instr)
-#     print "One transducer successfully read."
-#     transducers_read++
-#
-# print "Read %i transducers in total" % transducers_read
-# in.close()
-#\endverbatim
+# istr = libhfst.HfstInputStream('testfile1.hfst')
+# transducers = []
+# while not (istr.is_eof()):
+#     transducers.append(istr.read())
+# istr.close()
+# print("Read %i transducers in total." % len(transducers))
+# \endverbatim
 #
 # For documentation on the HFST binary transducer format, see
 # <a href="HeaderFormatAndConversions.html">here</a>.
-#
-# @see #libhfst.HfstTransducer.__init__
 class HfstInputStream:
 
-    ##  Create a stream to standard input for reading binary transducers. 
-    #
-    # @throws StreamNotReadableException 
-    # @throws NotTransducerStreamException
-    # @throws EndOfStreamException
-    # @throws TransducerHeaderException
-    def __init__(self):
-        pass
-
-    ##  Open a stream to file \a filename for reading binary transducers. 
+    ##  Create a stream for reading binary transducers.
+    # @param filename The name of the transducer file. If not given, standard input is used.
     #
-    # @pre The file exists. Otherwise, a StreamNotReadableException is thrown.
-    # @throws StreamNotReadableException 
+    # @throws StreamNotReadableException
     # @throws NotTransducerStreamException
     # @throws EndOfStreamException
     # @throws TransducerHeaderException
-    def __init__(self, filename):
+    def __init__(self, filename=None):
         pass
 
     ##  Close the stream.
@@ -1687,30 +1827,38 @@ class HfstInputStream:
     # transducer that has a different type than the previous ones.
     def get_type():
         pass
-    
+
+    ## Return next transducer.
+    #
+    # @throws EndOfStreamException
+    def read():
+        pass
+
 ## A stream for writing binary transducers. 
 #
-#  An example:
+#  An example: 
 # \verbatim
-# #Write three HFST transducers in binary format to file named 'testfile'
-# out = libhfst.HfstOutputStream('testfile', libhfst.FOMA_TYPE)
-# out.redirect(foma_transducer1) 
-# out.redirect(foma_transducer2)
-# out.redirect(foma_transducer3)
-# out.close()
+# res = ['foo:bar','0','0 - 0','"?":?','a* b+']
+# ostr = libhfst.HfstOutputStream(filename='testfile1.hfst')
+# for re in res:
+#     ostr.write(libhfst.regex(re))
+#     ostr.flush()
+# ostr.close()
 # \endverbatim
 #
 # For more information on HFST transducer structure, see <a href="HeaderFormatAndConversions.html">this page</a>.
 class HfstOutputStream:
 
-    ## Create a stream to standard output for writing binary transducers of type \a type. \a hfst_format defines whether transducers are written in hfst format or as such in their backend format. 
-    def __init__(type, hfst_format=True):
+    ## Open a stream for writing binary transducers.
+    # @param kvargs Arguments recognized are filename, hfst_format, type.
+    # @param filename The name of the file where transducers are written. If the file exists, it is overwritten. If \a filename is not given, transducers are written to standard output.
+    # @param hfst_format Whether transducers are written in hfst format (default is True) or as such in their backend format.
+    # @param type The type of the transducers that will be written to the stream. Default is #libhfst.get_default_fst_type().
+    def __init__(self, **kvargs):
         pass
 
-    ## Open a stream to file \a filename for writing binary transducers of type \a type. \a hfst_format defines whether transducers are written in hfst format or as such in their backend format.
-    #
-    # If the file exists, it is overwritten. 
-    def __init__(filename, type, hfst_format=True):
+    ## Flush the stream.
+    def flush():
         pass
 
     ##  Write the transducer \a transducer in binary format to the stream. 
@@ -1718,7 +1866,7 @@ class HfstOutputStream:
     # All transducers must have the same type as the stream, else a TransducerTypeMismatchException is thrown. 
     #
     # @throws TransducerTypeMismatchException
-    def redirect(transducer):
+    def write(transducer):
         pass
 
     ##  Close the stream. 
@@ -1726,7 +1874,7 @@ class HfstOutputStream:
     def close():
         pass
 
-## TODO: documentation
+## TODO: documentation ???
 class MultiCharSymbolTrie:
     ## TODO: documentation
     def __init__(self):
@@ -1751,21 +1899,11 @@ class MultiCharSymbolTrie:
 #
 # An example:
 # \verbatim
-# TOK = libhfst.HfstTokenizer()
-# TOK.add_multichar_symbol('<br />')
-# TOK.add_skip_symbol('<p>')
-# TOK.add_skip_symbol('</p>')
-# spv = TOK.tokenize("<p>A<br />paragraph!</p>")
-# # spv now contains
-# #    ('A','A'), ('<br />','<br />'), ('p','p' ('a','a'), ('r','r'), ('a','a'), 
-# #    ('g','g'), ('r','r'), ('a','a'), ('p','p'), ('h','h'), ('!','!')
-#\endverbatim
+# \endverbatim
 #
 # @note The tokenizer only tokenizes utf-8 strings. 
 # Special symbols are not included in the tokenizer 
-# unless added to it.
-#
-# @see #libhfst.HfstTransducer.__init__
+# unless added to it. TODO: should they ???
 class HfstTokenizer:
 
     ## Create a tokenizer that recognizes utf-8 symbols. 
@@ -1778,7 +1916,7 @@ class HfstTokenizer:
     # For example if we have a multicharacter symbol 'foo' and a 
     # skip symbol 'bar', the string "fobaro" will be tokenized 
     # 'f' 'o' 'o', not 'foo'. 
-    def add_skip_symbol(symbol):
+    def add_skip_symbol(self, symbol):
         pass
 
     ## Add a multicharacter symbol \a symbol to this tokenizer. 
@@ -1787,17 +1925,17 @@ class HfstTokenizer:
     # not considered a multicharacter symbol. For example if we have 
     # a multicharacter symbol 'foo' and a skip symbol 'bar', the string
     # "fobaro" will be tokenized 'f' 'o' 'o', not 'foo'. 
-    def add_multichar_symbol(symbol):
+    def add_multichar_symbol(self, symbol):
         pass
 
     ## Tokenize the string \a input_string. 
     # @return A tuple of string pairs.
-    def tokenize(input_string):
+    def tokenize(self, input_string):
         pass
 
     ## Tokenize the string \a input_string.
     # @return A tuple of strings.
-    def tokenize_one_level(input_string):
+    def tokenize_one_level(self, input_string):
         pass
 
     ## Tokenize the string pair \a input_string : \a output_string. 
@@ -1807,7 +1945,12 @@ class HfstTokenizer:
     # so that both tokenized strings have the same number of tokens.
     #
     # @return A tuple of string pairs.
-    def tokenize(input_string, output_string):
+    def tokenize(self, input_string, output_string):
+        pass
+
+    ## Tokenize \a str and skip all spaces.
+    # @return A tuple of strings.
+    def tokenize_space_separated(self, str):
         pass
 
     ## If \a input_string is not valid utf-8, throw an IncorrectUtf8CodingException.
@@ -1828,7 +1971,8 @@ class HfstTokenizer:
     # (For reference: http://en.wikipedia.org/wiki/UTF-8)
     #
     # This function is a static one.
-    check_utf8_correctness(input_string);
+    def check_utf8_correctness(input_string):
+        pass
 
 
 ## A compiler holding information contained in lexc style lexicons.
@@ -1844,6 +1988,10 @@ class LexcCompiler:
   def __init__(self, impl):
       pass
 
+  ## Create a lexc compiler with \a impl as transducer format.
+  def __init__(self, impl, withFlags):
+      pass
+
   ## Compile lexc description from \a infile into current compiler.
   def parse(infile):
       pass
@@ -1852,16 +2000,42 @@ class LexcCompiler:
   def parse(filename):
       pass
 
-  # @brief Set verbosity options. When \a verbose is true, LexcCompiler will output the messages that Xerox lexc compiler does.
+  ## Set verbosity options. When \a verbose is true, LexcCompiler will output the messages that Xerox lexc compiler does.
   def setVerbosity(verbose):
       pass
 
+  ## todo
+  def isQuiet():
+      pass
+  ## todo
+  def setTreatWarningsAsErrors(value):
+      pass
+  ## todo
+  def areWarningsTreatedAsErrors():
+      pass
+  ## todo
+  def setAllowMultipleSublexiconDefinitions(value):
+      pass
+  ## todo
+  def setWithFlags(value):
+      pass
+  ## todo
+  def setMinimizeFlags(value):
+      pass
+  ## todo
+  def setRenameFlags(value):
+      pass
+
   ## Add @a alphabet to multicharacter symbol set.
   # These symbols may be used for regular expression ? for backends that do
   # not support open alphabets.
   def addAlphabet(alphabet):
       pass
 
+  ## todo
+  def addNoFlag(lexname):
+      pass
+
   ## Set current processing lexicon name to @a lexicon_name.
   def setCurrentLexiconName(lexicon_name):
       pass
@@ -1897,20 +2071,32 @@ class LexcCompiler:
       pass
 
 ## A compiler holding information needed to compile XREs.
-class XreCompiler
+class XreCompiler:
 
   ## Construct compiler for unknown format transducers.
   def __init__(self):
       pass
 
-  ## Create compiler for @a impl format transducers
+  ## Create compiler for \a impl format transducers
   def __init__(self, impl):
       pass
 
-  ## Add a definition macro. Compilers will replace arcs labeled @a name, with the transducer defined by @a xre in later phases of compilation.
+  ## Add a definition macro. Compilers will replace arcs labeled \a name, with the transducer defined by \a xre in later phases of compilation.
   def define(name, xre):
       pass
 
+  ## todo
+  def define_list(name, symbol_list):
+      pass
+
+  ## todo
+  def define_function(name, arguments, xre):
+      pass
+
+  ## todo
+  def undefine(name):
+      pass
+
   ## Compile a transducer defined by @a xre.
   # May return a pointer to @e empty transducer on non-fatal error.
   # A None pointer is returned on fatal error, if abort is not called.
@@ -1918,13 +2104,24 @@ class XreCompiler
   def compile(xre):
       pass
 
-class FdOperation:
-    ## TODO: document
-    def __init__(self, fd_operation):
-        pass
-    ## TODO: document
-    def is_diacritic(diacritic_str):
-        pass
+# For example the transducer 
+# 
+# \verbatim
+# [[@U.FEATURE.FOO@ foo] | [@U.FEATURE.BAR@ bar]]  |  [[foo @U.FEATURE.FOO@] | [bar @U.FEATURE.BAR@]]
+# \endverbatim
+# 
+# will yield the paths <CODE>[foo foo]</CODE> and <CODE>[bar bar]</CODE>.
+# <CODE>[foo bar]</CODE> and <CODE>[bar foo]</CODE> are invalidated
+# by the flag diacritics so they will not be included in \a results.
+
+## Whether symbol \a symbol is a flag diacritic.
+#
+# Flag diacritics are of the form 
+# \verbatim
+# @[PNDRCU][.][A-Z]+([.][A-Z]+)?@
+# \endverbatim
+def is_diacritic(symbol):
+    pass
 
 ## A transducer that obligatorily performs the mappings defined by \a mappings in the context \a context when the alphabet is \a alphabet. 
 # 
@@ -2166,6 +2363,85 @@ def deep_coercion(contexts, mapping, alphabet):
 def deep_restriction_and_coercion(contexts, mapping, alphabet):
     pass
 
+## @page Symbols.html Symbols in HFST
+#
+# A transducer maps strings into strings.Strings are tokenized (i.e. divided) into symbols. Each transition
+# in a transducer has an input and output symbol. If the input symbol of a transition
+# matches a symbol of an input string, it is consumed and an output symbol equal to the output symbol
+# of the transition is produced.
+#
+# There are some special symbols: the epsilon, unknown and identity.
+# Epsilon on input side consumes no symbol, epsilon on output side produces no symbol.
+# The unknown on input side matches any symbol, the unknown on output side produces any symbol.
+# If unknown is on both sides of a transition, it matches any symbol and produces any symbol other than the one that was matched on the input side.
+# The identity matches any symbol and produces the same symbol. It must always occur on both sides of a transition.
+# There is also a class of special symbols, called flag diacritics. They are of form 
+# \verbatim
+# @[PNDRCU][.][A-Z]+([.][A-Z]+)?@
+# \endverbatim
+#
+# The internal string representation for epsilon is "@_EPSILON_SYMBOL_@" (libhfst.EPSILON), for unknown "@_UNKNOWN_SYMBOL_@" (libhfst.UNKNOWN) and for identity "@_IDENTITY_SYMBOL_@" (libhfst.IDENTITY).
+# These strings are used when referring to those symbols in individual transitions, e.g.
+#
+# \verbatim
+# fsm = libhfst.HfstBasicTransducer()
+# fsm.add_state(1)
+# fsm.add_state(2)
+# fsm.set_final_weight(2, 0.5)
+# fsm.add_transition(0, 1, libhfst.EPSILON, libhfst.UNKNOWN)
+# fsm.add_transition(1, 2, libhfst.IDENTITY, libhfst.IDENTITY)
+# \endverbatim
+#
+# or reading and printing transitions in AT&& format:
+#
+# \verbatim
+# 0 1 @_EPSILON_SYMBOL@ @_UNKNOWN_SYMBOL_@ 0.0
+# 1 2 @_IDENTITY_SYMBOL@ @_IDENTITY_SYMBOL_@ 0.0
+# 2 0.5
+# \endverbatim
+#
+# There is also a shorter string for epsilon in AT&T format, "@0@".
+#
+# The syntax of regular expressions follows the Xerox formalism,
+# where the following symbols are used instead: "0" for epsilon, and "?" for unknown and identity.
+# On either side of a transition, "?" means the unknown. As a single symbol, "?" means identity-to-identity transition.
+# On both sides of a transition "?" means the combination of unknown-to-unknown AND identity-to-identity transitions.
+# If unknown-to-unknown transition is needed, it can be given as the subtraction [?:? - ?]. Some examples:
+# 
+# \verbatim
+# libhfst.regex('0:foo')       # epsilon to "foo"
+# libhfst.regex('0:foo')       # "foo" to epsilon
+# libhfst.regex('?:foo')       # any symbol to "foo"
+# libhfst.regex('?:foo')       # "foo" to any symbol
+# libhfst.regex('?:?')         # any symbol to any symbol
+# libhfst.regex('?')           # any symbol to the same symbol
+# libhfst.regex('?:? - ?')     # any symbol to any other symbol
+# \endverbatim
+#
+# Note that unknowns and identities are expanded with the symbols that the expression becomes aware of during its compilation:
+#
+# \verbatim
+# libhfst.regex('?')              # equal to [?]
+# libhfst.regex('? foo')          # equal to [[?|foo] foo]
+# libhfst.regex('? foo bar:?')    # equal to [[?|foo|bar] foo [bar:?|bar:bar|bar:foo]]
+# \endverbatim
+#
+# In lookup, the epsilon is printed as empty string and unknowns and identities as those symbols that they are matched with:
+# \verbatim
+# >>> tr = libhfst.regex('foo:0 bar:? ?')
+# >>> print(tr.lookup('foobara'))
+# (('bara', 0.0), ('fooa', 0.0))
+# \endverbatim
+#
+# In extract_paths, epsilon, unknown and identity are printed as such:
+# \verbatim
+# >>> tr = libhfst.regex('foo:0 bar:? ?')
+# >>> print(tr.extract_paths())
+# {'foobar at _IDENTITY_SYMBOL_@': [('@_EPSILON_SYMBOL_@@_UNKNOWN_SYMBOL_@@_IDENTITY_SYMBOL_@', 0.0), ('@_EPSILON_SYMBOL_ at bar@_IDENTITY_SYMBOL_@', 0.0), ('@_EPSILON_SYMBOL_ at foo@_IDENTITY_SYMBOL_@', 0.0)],
+#  'foobarfoo': [('@_EPSILON_SYMBOL_@@_UNKNOWN_SYMBOL_ at foo', 0.0), ('@_EPSILON_SYMBOL_ at barfoo', 0.0), ('@_EPSILON_SYMBOL_ at foofoo', 0.0)], 
+#  'foobarbar': [('@_EPSILON_SYMBOL_@@_UNKNOWN_SYMBOL_ at bar', 0.0), ('@_EPSILON_SYMBOL_ at barbar', 0.0), ('@_EPSILON_SYMBOL_ at foobar', 0.0)]}
+# \endverbatim
+
 
 ## @page QuickStart.html Quick Start to HFST
 # 
@@ -2173,23 +2449,22 @@ def deep_restriction_and_coercion(contexts, mapping, alphabet):
 # 
 # After <a href="InstallHfst.html">installing</a> HFST on your computer, start python and execute <code>import libhfst</code>.
 # 
-# For example, the following simple program
+# For example, the following simple program 
 #
 # \verbatim
 # import libhfst
-# import sys
 # 
-# tr1 = libhfst.HfstTransducer('foo', 'bar', libhfst.SFST_TYPE)
-# tr2 = libhfst.HfstTransducer('bar', 'baz', libhfst.SFST_TYPE)
+# tr1 = libhfst.regex('foo:bar')
+# tr2 = libhfst.regex('bar:baz')
 # tr1.compose(tr2)
-# tr1.write_in_att_format(sys.stdout);
+# print(tr1)
 # \endverbatim
 # 
 # should print to standard output the following text when run:
 # 
 # \verbatim
-# 0      1     foo    baz
-# 1
+# 0      1     foo    baz    0
+# 1      0
 # \endverbatim
 # 
 # <BR>
@@ -2211,106 +2486,83 @@ def deep_restriction_and_coercion(contexts, mapping, alphabet):
 # \section hfst_examples Examples of HFST functionalities
 # 
 # An example of creating a simple transducer from scratch and converting between transducer formats and testing
-# transducer properties and handling exceptions:
+# transducer properties and handling exceptions: 
 # 
 # \verbatim
-# import libhfst 
-#
-# # Create a HFST basic transducer [a:b] with transition weight 0.3 and final weight 0.5.
+# import libhfst
+# # Create as HFST basic transducer [a:b] with transition weight 0.3 and final weight 0.5.
 # t = libhfst.HfstBasicTransducer()
 # t.add_state(1)
-# t.add_transition(0, libhfst.HfstBasicTransition(1, 'a', 'b', 0.3))
+# t.add_transition(0, 1, 'a', 'b', 0.3)
 # t.set_final_weight(1, 0.5)
-# 
-# # Convert to tropical OpenFst format and push weights toward final state.
-# T = libhfst.HfstTransducer(t, libhfst.TROPICAL_OPENFST_TYPE)
+#
+# # Convert to tropical OpenFst format (the default) and push weights toward final state.
+# T = libhfst.HfstTransducer(t)
 # T.push_weights(libhfst.TO_FINAL_STATE)
-# 
+#
 # # Convert back to HFST basic transducer.
 # tc = libhfst.HfstBasicTransducer(T)
 # try:
-#     # Rounding might affect the precision. 
+#     # Rounding might affect the precision.
 #     if (0.79 < tc.get_final_weight(1)) and (tc.get_final_weight(1) < 0.81):
-#         print "TEST OK"
+#         print("TEST PASSED")
 #         exit(0)
 #     else:
-#         print "TEST FAILED"
+#         print("TEST FAILED")
 #         exit(1)
-# # If the state does not exist or is not final */
+# # If the state does not exist or is not final
 # except libhfst.HfstException:
-#     print "TEST FAILED: An exception thrown."
-# exit(1)
+#     print("TEST FAILED: An exception thrown.")
+#     exit(1)
 # \endverbatim
 # 
 # 
 # An example of creating transducers from strings, applying rules to them and printing the string pairs recognized by the resulting transducer.
-# 
+#  
 # \verbatim
 # import libhfst
-# type = libhfst.FOMA_TYPE
+# libhfst.set_default_fst_type(libhfst.FOMA_TYPE)
 # 
 # # Create a simple lexicon transducer [[foo bar foo] | [foo bar baz]].
-# 
 # tok = libhfst.HfstTokenizer()
 # tok.add_multichar_symbol('foo')
 # tok.add_multichar_symbol('bar')
 # tok.add_multichar_symbol('baz')
-#   
-# words = libhfst.HfstTransducer("foobarfoo", tok, type)
-# t = libhfst.HfstTransducer("foobarbaz", tok, type);
+# 
+# words = libhfst.tokenized_fst(tok.tokenize('foobarfoo'))
+# t = libhfst.tokenized_fst(tok.tokenize('foobarbaz'))
 # words.disjunct(t)
 # 
-#   
 # # Create a rule transducer that optionally replaces 'bar' with 'baz' between 'foo' and 'foo'.
+# rule = libhfst.regex('bar (->) baz || foo _ foo')
 # 
-# context = (libhfst.HfstTransducer('foo', type), libhfst.HfstTransducer('foo', type) )
-# mapping = libhfst.HfstTransducer('bar', 'baz', type)
-# optional = True
-# alphabet = (('foo','foo'), ('bar','bar'), ('baz','baz'))
-#   
-# rule = libhfst.replace_up(context, mapping, optional, alphabet)
-# 
-# 
-# # Apply the rule transducer to the lexicon. 
+# # Apply the rule transducer to the lexicon.
 # words.compose(rule).minimize()
-#   
-#   
-# # Extract all string pairs from the result and print them to standard output.
 # 
+# # Extract all string pairs from the result and print them to standard output.
 # results = 0
 # try:
 #     # Extract paths and remove tokenization
-#     results = libhfst.detokenize_paths(libhfst.extract_paths(words))
+#     results = words.extract_paths(output='dict')
 # except libhfst.TransducerIsCyclicException:
 #     # This should not happen because transducer is not cyclic.
-#     print "TEST FAILED"
+#     print("TEST FAILED")
 #     exit(1)
 # 
-# # Go through all paths and print them.
-# for path in results:
-#     print "%s : %s   %f" % (path.input, path.output, path.weight)
+# for input,outputs in results.items():
+#     print('%s:' % input)
+#     for output in outputs:
+#         print('  %s\t%f' % (output[0], output[1]))
 # \endverbatim
-# 
-# An example of reading binary transducers from standard input, converting them to SFST format and writing them 
-# in binary format to standard output as well as in AT&T format to file 'testfile.att':
-# 
+#
+# The output:
+#
 # \verbatim
-# instr = libhfst.HfstInputStream()
-# outstr = libhfst.HfstOutputStream(libhfst.SFST_TYPE)
-# att_file = open('testfile.att', 'wb')
-# first_transducer = True
-# 
-# while not instr.is_eof():
-#     if not first_transducer:
-#         att_file.write("--") # AT&T format separator
-#     t = libhfst.HfstTransducer(instr)
-#     tc = libhfst.HfstTransducer(t, libhfst.SFST_TYPE)
-#     outstr.redirect(tc)
-#     tc.write_in_att_format(att_file)
-#     first_transducer = False
-# instr.close()
-# outstr.close()
-# att_file.close()
+# foobarfoo:
+#   foobarfoo     0.000000
+#   foobazfoo     0.000000
+# foobarbaz:
+#   foobarbaz     0.000000
 # \endverbatim
 # 
 # <BR>
@@ -2321,34 +2573,79 @@ def deep_restriction_and_coercion(contexts, mapping, alphabet):
 # <a href="https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstTransducerHeader">
 # wiki pages</a>) and the transducer of the backend implementation. 
 # If you want to write backend transducers as such, you can specify it with 
-# the <i>hfst_format</i> argument of HfstOutputStream constructor:
+# the <i>hfst_format</i> keyword argument of HfstOutputStream constructor:
 # 
 # \verbatim
-#    HfstOutputStream(type, hfst_format=True)
+#    HfstOutputStream(hfst_format=True)
 # \endverbatim
 # 
 # The following piece of code will write a native OpenFst transducer 
 # with tropical weights to standard output:
 # 
+# test.py:
+# \verbatim
+# import libhfst
+# ab = libhfst.regex('a:b::2.8')
+# out = libhfst.HfstOutputStream(hfst_format=False)
+# out.write(ab)
+# out.flush()
+# out.close()
+# \endverbatim
+#
+# run on command line (fstprint is native OpenFst tool):
 # \verbatim
-#    ab = libhfst.HfstTransducer('a', 'b', libhfst.TROPICAL_OFST_TYPE)
-#    out = libhfst.HfstOutputStream(ab.get_type(), False)
-#    out.redirect(ab)
+# python3 test.py > ab.fst
+# fstprint ab.fst
 # \endverbatim
-# 
-# An HfstInputStream can also read backend transducers that do not have an
-# HFST header. If the standard input contains an SFST transducer, the following
-# piece of code will read it successfully and convert it into an HFST transducer
-# of type SFST_TYPE and write it to standard output (with the HFST header 
-# included).
-# 
+#
+# output:
 # \verbatim
-#    instr = HfstInputStream()
-#    tr = libhfst.HfstTransducer(instr)
-#    outstr = libhfst.HfstOutputStream(tr.get_type(), True)
-#    outstr.redirect(tr)
+# 0       1       a       b       2.79980469
+# 1
 # \endverbatim
-# 
+#
+# An libhfst.HfstInputStream can also read backend transducers that do not have an HFST header.
+# If we have the following files
+#
+# symbols.txt:
+# \verbatim
+# EPSILON 0
+# a 1
+# b 2
+# \endverbatim
+#
+# ab.txt:
+# \verbatim
+# 0 1 a b 0.5
+# 1 0.3
+# \endverbatim
+#
+# test.py:
+# \verbatim
+# import libhfst
+# istr = libhfst.HfstInputStream()
+# while not istr.is_eof():
+#     tr = istr.read()
+#     print('Read transducer:')
+#     print(tr)
+# istr.close()
+# \endverbatim
+#
+# the commands
+#
+# \verbatim
+# cat ab.txt | fstcompile --isymbols=symbols.txt --osymbols=symbols.txt --keep_isymbols --keep_osymbols | python3 test.py
+# \endverbatim
+#
+# will compile a native OpenFst transducer (fstcompile is a native OpenFst tool), read it with HFST tools and print it to standard output in AT&T text format:
+#
+# \verbatim
+# Read transducer:
+# 0       1       a       b       0.500000
+# 1       0.300000
+#
+# \endverbatim
+#
 # For more information on HFST transducer formats and conversions, see the
 # <a href="https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstTransducerFormats">
 # wiki pages</a>.
@@ -2359,12 +2656,13 @@ def deep_restriction_and_coercion(contexts, mapping, alphabet):
 # 
 # Foma writes its binary transducers in gzipped format using the gz tools.
 # However, we experienced problems when trying to write to standard output or
-# read from standard in with gz tools (foma tools do not write to or read
+# read from standard input with gz tools (foma tools do not write to or read
 # from standard streams). So we choose to write, and accordingly read, 
 # foma transducers unzipped when writing or reading binary HfstTransducers 
-# of FOMA_TYPE. As a result, when we write an HfstTransducer of FOMA_TYPE
+# of libhfst.FOMA_TYPE. As a result, when we write an HfstTransducer of FOMA_TYPE
 # in its plain backend format, the user must zip it themselves before it 
-# can be used by foma tools. Similarily, a foma transducer must be unzipped 
+# can be used by foma tools. (update: at least the newest releases of foma
+# are able to read also unzipped transducers.) Similarily, a foma transducer must be unzipped 
 # before it can be read by HFST tools.
 # 
 # Suppose we have written a FOMA_TYPE HfstTransducer and want to use it with
@@ -2372,18 +2670,22 @@ def deep_restriction_and_coercion(contexts, mapping, alphabet):
 # with the following piece of code:
 # 
 # \verbatim
-#    ab = libhfst.HfstTransducer ab('a', 'b', libhfst.FOMA_TYPE)
-#    out = libhfst.HfstOutputStream('ab.foma', libhfst.FOMA_TYPE, False)
-#    out.redirect(ab)
+# import libhfst
+# libhfst.set_default_fst_type(libhfst.FOMA_TYPE)
+# ab = libfst.regex('a:b')
+# out = libhfst.HfstOutputStream(hfst_format=False)
+# out.write(ab)
+# out.flush()
+# out.close()
 # \endverbatim
 # 
-# The command 
+# The command
 # 
 # \verbatim
 # gzip ab.foma
 # \endverbatim
 # 
-# will create a file 'ab.foma.gz' that can be used by foma tools.
+# will create a file 'ab.foma.gz' that can be used by (older) foma tools.
 # 
 # The same with command line tools:
 # 
@@ -2407,8 +2709,9 @@ def deep_restriction_and_coercion(contexts, mapping, alphabet):
 # same file. Now the file can be used by HFST:
 # 
 # \verbatim
-#    instr = libhfst.HfstInputStream('transducer.foma')
-#    tr = libhfst.HfstTransducer(instrOA)
+# instr = libhfst.HfstInputStream('transducer.foma')
+# tr = instr.read()
+# instr.close()
 # \endverbatim
 # 
 # The same with command line tools:
diff --git a/python/libhfst.i b/python/libhfst.i
new file mode 100644
index 0000000..e8f780c
--- /dev/null
+++ b/python/libhfst.i
@@ -0,0 +1,1740 @@
+%module libhfst
+%include "std_string.i"
+%include "std_vector.i"
+%include "std_pair.i"
+%include "std_set.i"
+%include "std_map.i"
+%include "exception.i"
+
+%feature("autodoc", "3");
+
+%init %{
+    hfst::set_warning_stream(&std::cerr);
+%}
+
+%{
+#define HFSTIMPORT
+#include "HfstDataTypes.h"
+#include "HfstTransducer.h"
+#include "HfstOutputStream.h"
+#include "HfstInputStream.h"
+#include "HfstExceptionDefs.h"
+#include "HfstTokenizer.h"
+#include "HfstFlagDiacritics.h"
+//#include "HfstRules.h" ???
+#include "parsers/XreCompiler.h"
+#include "parsers/LexcCompiler.h"
+#include "parsers/PmatchCompiler.h"
+#include "parsers/XfstCompiler.h"
+#include "implementations/HfstTransitionGraph.h"
+
+// todo instead: #include "hfst_extensions.h"
+
+namespace hfst {
+
+  class HfstFile {
+    private:
+      FILE * file;
+    public:  
+      HfstFile();
+      ~HfstFile();
+      void set_file(FILE * f);
+      FILE * get_file();
+      void close();
+      void write(const char * str);
+      bool is_eof(void);
+  };
+
+  HfstFile::HfstFile(): file(NULL){};
+  HfstFile::~HfstFile() {};
+  void HfstFile::set_file(FILE * f) { file = f; };
+  FILE * HfstFile::get_file() { return file; };
+  void HfstFile::close() { if (file != stdout && file != stderr && file != stdin) { fclose(file); } };
+  void HfstFile::write(const char * str) { fprintf(file, "%s", str); };
+  bool HfstFile::is_eof(void) { return (feof(file) != 0); }; 
+
+  HfstFile hfst_open(const char * filename, const char * mode) {
+    FILE * f = fopen(filename, mode);
+    HfstFile file;
+    file.set_file(f);
+    return file;
+  };
+
+  HfstFile hfst_stdin() {
+    HfstFile file;
+    file.set_file(stdin);
+    return file;
+  };
+
+  HfstFile hfst_stdout() {
+    HfstFile file;
+    file.set_file(stdout);
+    return file;
+  };
+
+typedef std::vector<float> FloatVector;
+
+hfst::ImplementationType type = hfst::TROPICAL_OPENFST_TYPE;
+
+hfst::HfstTokenizer deftok; // default tokenizer
+
+void set_default_fst_type(hfst::ImplementationType t)
+{
+        type = t;
+}
+
+hfst::ImplementationType get_default_fst_type()
+{
+        return type;
+}
+
+std::string fst_type_to_string(hfst::ImplementationType t)
+{
+        std::string retval = hfst::implementation_type_to_string(t);
+        return retval;
+}
+
+bool is_diacritic(const std::string & symbol)
+{
+        return hfst::FdOperation::is_diacritic(symbol);
+}
+        
+
+HfstTransducer * copy_hfst_transducer(const hfst::HfstTransducer & t)
+{
+        return new HfstTransducer(t);
+}
+
+HfstTransducer * copy_hfst_transducer_from_basic_transducer(const hfst::implementations::HfstBasicTransducer & t)
+{
+        return new HfstTransducer(t, type);
+}
+
+HfstTransducer * copy_hfst_transducer_from_basic_transducer(const hfst::implementations::HfstBasicTransducer & t, hfst::ImplementationType impl)
+{
+        return new HfstTransducer(t, impl);
+}
+
+/* Wrapper variables for an IOString output. */
+std::string hfst_regex_error_message("");
+std::string get_hfst_regex_error_message() { return hfst::hfst_regex_error_message; }
+
+hfst::HfstTransducer * hfst_regex(hfst::xre::XreCompiler & comp, const std::string & regex_string, const std::string & error_stream)
+{
+        hfst_regex_error_message="";
+        
+        if (error_stream == "cout")
+        {
+          comp.set_error_stream(&std::cout);
+          return comp.compile(regex_string);
+        }
+        else if (error_stream == "cerr")
+        {
+          comp.set_error_stream(&std::cerr);
+          return comp.compile(regex_string);
+        }
+        else
+        {
+          std::ostringstream os(std::ostringstream::ate);
+          comp.set_error_stream(&os);
+          hfst::set_warning_stream(&os);
+          hfst::HfstTransducer * retval = comp.compile(regex_string);
+          hfst_regex_error_message = os.str();
+          hfst::set_warning_stream(&std::cerr);
+          return retval;
+        }
+}
+
+/* Wrapper variables for an IOString output. */
+std::string hfst_lexc_output("");
+std::string get_hfst_lexc_output() { return hfst::hfst_lexc_output; }
+
+hfst::HfstTransducer * hfst_compile_lexc(hfst::lexc::LexcCompiler & comp, const std::string & filename, const std::string & error_stream)
+{
+        hfst_lexc_output="";
+
+        if (error_stream == "cout")
+        {
+          comp.set_error_stream(&std::cout);
+          if (comp.getVerbosity() > 1)
+            std::cout << "Parsing the lexc file..." << std::endl;
+          comp.parse(filename.c_str());
+          if (comp.getVerbosity() > 1)
+            std::cout << "Compiling..." << std::endl;
+          hfst::HfstTransducer * retval = comp.compileLexical();
+          if (comp.getVerbosity() > 1)
+            std::cout << "Compilation done." << std::endl;
+          return retval;
+        }
+        else if (error_stream == "cerr")
+        {
+          comp.set_error_stream(&std::cerr);
+          if (comp.getVerbosity() > 1)
+            std::cerr << "Parsing the lexc file..." << std::endl;
+          comp.parse(filename.c_str());
+          if (comp.getVerbosity() > 1)
+            std::cerr << "Compiling..." << std::endl;
+          hfst::HfstTransducer * retval = comp.compileLexical();
+          if (comp.getVerbosity() > 1)
+            std::cerr << "Compilation done." << std::endl;
+          return retval;
+        }
+        else
+        {
+          std::ostringstream os(std::ostringstream::ate);
+          comp.set_error_stream(&os);
+          hfst::set_warning_stream(&os);
+          if (comp.getVerbosity() > 1)
+            os << "Parsing the lexc file..." << std::endl;
+          comp.parse(filename.c_str());
+          if (comp.getVerbosity() > 1)
+            os << "Compiling..." << std::endl;
+          hfst::HfstTransducer * retval = comp.compileLexical();
+          if (comp.getVerbosity() > 1)
+            os << "Compilation done." << std::endl;
+          hfst_lexc_output = os.str();
+          hfst::set_warning_stream(&std::cerr);
+          return retval;
+        }        
+}
+
+/* Wrapper variables for an IOString output. */
+std::string hfst_xfst_string_one("");
+char * get_hfst_xfst_string_one() { return strdup(hfst::hfst_xfst_string_one.c_str()); }
+std::string hfst_xfst_string_two("");
+char * get_hfst_xfst_string_two() { return strdup(hfst::hfst_xfst_string_two.c_str()); }
+
+int hfst_compile_xfst_to_string_one(hfst::xfst::XfstCompiler & comp, std::string input)
+{
+        hfst::hfst_xfst_string_one="";
+        hfst::hfst_xfst_string_two="";
+
+        std::ostringstream os(std::ostringstream::ate);
+        hfst::set_warning_stream(&os);
+        comp.set_output_stream(os);
+        comp.set_error_stream(os);
+        int retval = comp.parse_line(input);
+        hfst::hfst_xfst_string_one = os.str();
+        hfst::set_warning_stream(&std::cerr);
+        return retval;
+}
+
+int hfst_compile_xfst(hfst::xfst::XfstCompiler & comp, std::string input, const std::string & output_stream, const std::string & error_stream)
+{
+        hfst::hfst_xfst_string_one="";
+        hfst::hfst_xfst_string_two="";
+        std::ostringstream * os1 = NULL;
+        std::ostringstream * os2 = NULL;
+
+        if (output_stream == "cout")
+          comp.set_output_stream(std::cout);
+        else if (output_stream == "cerr")
+          comp.set_output_stream(std::cerr);
+        else {
+          os1 = new std::ostringstream(std::ostringstream::ate);
+          comp.set_output_stream(*os1);
+        }
+
+        if (error_stream == "cout") {
+          comp.set_error_stream(std::cout);
+          hfst::set_warning_stream(&std::cout);
+        }
+        else if (error_stream == "cerr")
+          comp.set_error_stream(std::cerr);
+        else {
+          os2 = new std::ostringstream(std::ostringstream::ate);
+          comp.set_error_stream(*os2);
+          hfst::set_warning_stream(os2);
+        }
+
+        int retval = comp.parse_line(input);
+        hfst::set_warning_stream(&std::cerr);
+        
+        if (output_stream == "") {
+          hfst::hfst_xfst_string_one = os1->str();
+          delete os1;
+        }
+        if (error_stream == "") {
+          hfst::hfst_xfst_string_two = os2->str();
+          delete os2;
+        }
+
+        return retval;
+}
+
+
+
+hfst::HfstOutputStream * create_hfst_output_stream(const std::string & filename, hfst::ImplementationType type, bool hfst_format)
+{
+        if (filename == "") { return new hfst::HfstOutputStream(type, hfst_format); }
+        else { return new hfst::HfstOutputStream(filename, type, hfst_format); }
+}
+
+hfst::HfstTransducer * read_att(hfst::HfstFile & f, std::string epsilon="@_EPSILON_SYMBOL_@")
+{
+      return new hfst::HfstTransducer(f.get_file(), type, epsilon);
+}
+
+hfst::HfstTransducer * read_prolog(hfst::HfstFile & f)
+{
+    unsigned int linecount = 0;
+    hfst::implementations::HfstBasicTransducer fsm = hfst::implementations::HfstBasicTransducer::read_in_prolog_format(f.get_file(), linecount);
+    return new hfst::HfstTransducer(fsm, hfst::type);
+}
+
+std::string one_level_paths_to_string(const hfst::HfstOneLevelPaths & paths)
+{
+    std::ostringstream oss;
+    for(hfst::HfstOneLevelPaths::const_iterator it = paths.begin(); it != paths.end(); it++)
+    {   
+      for (hfst::StringVector::const_iterator svit = it->second.begin(); svit != it->second.end(); svit++)
+      {
+        oss << *svit;
+      }
+      oss << "\t" << it->first << std::endl;
+    }
+    return oss.str();
+}
+
+std::string two_level_paths_to_string(const hfst::HfstTwoLevelPaths & paths)
+{
+    std::ostringstream oss;
+    for(hfst::HfstTwoLevelPaths::const_iterator it = paths.begin(); it != paths.end(); it++)
+    {   
+      std::string input("");
+      std::string output("");
+      for (hfst::StringPairVector::const_iterator svit = it->second.begin(); svit != it->second.end(); svit++)
+      {
+        input += svit->first;
+        output += svit->second;
+      }
+      oss << input << ":" << output << "\t" << it->first << std::endl;
+    }
+    return oss.str();
+}
+
+
+}
+
+%}
+
+#ifdef _MSC_VER
+%include <windows.h>
+#endif
+
+%include "typemaps.i"
+
+namespace std {
+%template(StringVector) vector<string>;
+%template(StringPair) pair<string, string>;
+%template(StringPairVector) vector<pair<string, string > >;
+%template(FloatVector) vector<float>;
+%template(StringSet) set<string>;
+%template(StringPairSet) set<pair<string, string> >;
+%template(HfstTransducerVector) vector<hfst::HfstTransducer>;
+%template(HfstSymbolSubstitutions) map<string, string>;
+%template(HfstSymbolPairSubstitutions) map<pair<string, string>, pair<string, string> >;
+%template(FooBarBaz) vector<hfst::implementations::HfstBasicTransition>;
+%template(BarBazFoo) vector<unsigned int>;
+%template(HfstBasicStates) vector<vector<hfst::implementations::HfstBasicTransition> >;
+%template(HfstOneLevelPath) pair<float, vector<string> >;
+%template(HfstOneLevelPaths) set<pair<float, vector<string> > >;
+%template(HfstTwoLevelPath) pair<float, vector<pair<string, string > > >;
+%template(HfstTwoLevelPaths) set<pair<float, vector<pair<string, string > > > >;
+}
+
+//%ignore hfst::HfstTransducer::lookup_fd(const std::string & s) const;
+
+class HfstException
+{
+public:
+ HfstException();
+ HfstException(const std::string&, const std::string&, size_t);
+ ~HfstException();
+};
+
+class HfstTransducerTypeMismatchException : public HfstException { public: HfstTransducerTypeMismatchException(const std::string&, const std::string&, size_t); ~HfstTransducerTypeMismatchException(); };
+class ImplementationTypeNotAvailableException : public HfstException { public: ImplementationTypeNotAvailableException(const std::string&, const std::string&, size_t); ~ImplementationTypeNotAvailableException(); };
+class FunctionNotImplementedException : public HfstException { public: FunctionNotImplementedException(const std::string&, const std::string&, size_t); ~FunctionNotImplementedException(); };
+class StreamNotReadableException : public HfstException { public: StreamNotReadableException(const std::string&, const std::string&, size_t); ~StreamNotReadableException(); };
+class StreamCannotBeWrittenException : public HfstException { public: StreamCannotBeWrittenException(const std::string&, const std::string&, size_t); ~StreamCannotBeWrittenException(); };
+class StreamIsClosedException : public HfstException { public: StreamIsClosedException(const std::string&, const std::string&, size_t); ~StreamIsClosedException(); };
+class EndOfStreamException : public HfstException { public: EndOfStreamException(const std::string&, const std::string&, size_t); ~EndOfStreamException(); };
+class TransducerIsCyclicException : public HfstException { public: TransducerIsCyclicException(const std::string&, const std::string&, size_t); ~TransducerIsCyclicException(); };
+class NotTransducerStreamException : public HfstException { public: NotTransducerStreamException(const std::string&, const std::string&, size_t); ~NotTransducerStreamException(); };
+class NotValidAttFormatException : public HfstException { public: NotValidAttFormatException(const std::string&, const std::string&, size_t); ~NotValidAttFormatException(); };
+class NotValidPrologFormatException : public HfstException { public: NotValidPrologFormatException(const std::string&, const std::string&, size_t); ~NotValidPrologFormatException(); };
+class NotValidLexcFormatException : public HfstException { public: NotValidLexcFormatException(const std::string&, const std::string&, size_t); ~NotValidLexcFormatException(); };
+class StateIsNotFinalException : public HfstException { public: StateIsNotFinalException(const std::string&, const std::string&, size_t); ~StateIsNotFinalException(); };
+class ContextTransducersAreNotAutomataException : public HfstException { public: ContextTransducersAreNotAutomataException(const std::string&, const std::string&, size_t); ~ContextTransducersAreNotAutomataException(); };
+class TransducersAreNotAutomataException : public HfstException { public: TransducersAreNotAutomataException(const std::string&, const std::string&, size_t); ~TransducersAreNotAutomataException(); };
+class StateIndexOutOfBoundsException : public HfstException { public: StateIndexOutOfBoundsException(const std::string&, const std::string&, size_t); ~StateIndexOutOfBoundsException(); };
+class TransducerHeaderException : public HfstException { public: TransducerHeaderException(const std::string&, const std::string&, size_t); ~TransducerHeaderException(); };
+class MissingOpenFstInputSymbolTableException : public HfstException { public: MissingOpenFstInputSymbolTableException(const std::string&, const std::string&, size_t); ~MissingOpenFstInputSymbolTableException(); };
+class TransducerTypeMismatchException : public HfstException { public: TransducerTypeMismatchException(const std::string&, const std::string&, size_t); ~TransducerTypeMismatchException(); };
+class EmptySetOfContextsException : public HfstException { public: EmptySetOfContextsException(const std::string&, const std::string&, size_t); ~EmptySetOfContextsException(); };
+class SpecifiedTypeRequiredException : public HfstException { public: SpecifiedTypeRequiredException(const std::string&, const std::string&, size_t); ~SpecifiedTypeRequiredException(); };
+class HfstFatalException : public HfstException { public: HfstFatalException(const std::string&, const std::string&, size_t); ~HfstFatalException(); };
+class TransducerHasWrongTypeException : public HfstException { public: TransducerHasWrongTypeException(const std::string&, const std::string&, size_t); ~TransducerHasWrongTypeException(); };
+class IncorrectUtf8CodingException : public HfstException { public: IncorrectUtf8CodingException(const std::string&, const std::string&, size_t); ~IncorrectUtf8CodingException(); };
+class EmptyStringException : public HfstException { public: EmptyStringException(const std::string&, const std::string&, size_t); ~EmptyStringException(); };
+class SymbolNotFoundException : public HfstException { public: SymbolNotFoundException(const std::string&, const std::string&, size_t); ~SymbolNotFoundException(); };
+class MetadataException : public HfstException { public: MetadataException(const std::string&, const std::string&, size_t); ~MetadataException(); };
+class FlagDiacriticsAreNotIdentitiesException : public HfstException { public: FlagDiacriticsAreNotIdentitiesException(const std::string&, const std::string&, size_t); ~FlagDiacriticsAreNotIdentitiesException(); };
+
+namespace hfst
+{
+
+class HfstFile {
+  public:
+    HfstFile();
+    ~HfstFile();
+    void write(const char * str);
+    void close();
+    bool is_eof(void);
+};
+
+HfstFile hfst_stdout();
+HfstFile hfst_stdin();
+HfstFile hfst_open(const char * filename, const char * mode);
+
+typedef std::vector<std::string> StringVector;
+typedef std::pair<std::string, std::string> StringPair;
+typedef std::vector<std::pair<std::string, std::string> > StringPairVector;
+typedef std::vector<float> FloatVector;
+typedef std::set<std::string> StringSet;
+typedef std::set<std::pair<std::string, std::string> > StringPairSet;
+typedef std::pair<float, std::vector<std::string> > HfstOneLevelPath;
+typedef std::set<std::pair<float, std::vector<std::string> > > HfstOneLevelPaths;
+typedef std::pair<float, std::vector<std::pair<std::string, std::string > > > HfstTwoLevelPath;
+typedef std::set<std::pair<float, std::vector<std::pair<std::string, std::string> > > > HfstTwoLevelPaths;
+typedef std::map<std::string, std::string> HfstSymbolSubstitutions;
+typedef std::map<std::pair<std::string, std::string>, std::pair<std::string, std::string> > HfstSymbolPairSubstitutions;
+
+enum ImplementationType
+{
+    SFST_TYPE,
+    TROPICAL_OPENFST_TYPE,
+    LOG_OPENFST_TYPE,
+    FOMA_TYPE,
+    XFSM_TYPE,
+    HFST_OL_TYPE,
+    HFST_OLW_TYPE,
+    HFST2_TYPE,
+    UNSPECIFIED_TYPE,
+    ERROR_TYPE
+};
+
+enum PushType { TO_INITIAL_STATE, TO_FINAL_STATE };
+
+//std::ostream * get_warning_stream();
+//void set_warning_stream(std::ostream * os);
+
+/*
+%typemap(out) HfstOneLevelPaths* {
+        $result = PyList_New((*$1).size());
+        unsigned int i = 0;
+        for (hfst::HfstOneLevelPaths::const_iterator it = (*$1).begin(); it != (*$1).end(); it++)
+        {
+                std::string result_string("");
+                for (hfst::StringVector::const_iterator svit = it->second.begin(); svit != it->second.end(); svit++)
+                {
+                        result_string += *svit;
+                }
+                PyObject * res = PyTuple_New(2);
+                PyTuple_SetItem(res, 0, PyString_FromString(result_string.c_str()));
+                PyTuple_SetItem(res, 1, PyFloat_FromDouble(it->first));
+                PyList_SetItem($result, i, res);
+                i++;
+        }
+}
+*/
+
+/* instead, run:   
+      sed -i 's/class HfstException(_object):/class HfstException(Exception):/' libhfst.py
+   after build to make HfstException and its subclasses subclasses of Python's Exception.
+
+%typemap(throws) HfstTransducerTypeMismatchException %{ PyErr_SetString(PyExc_RuntimeError, "HfstTransducerTypeMismatchException"); SWIG_fail; %}
+... etc for all exception classes
+*/
+
+bool is_diacritic(const std::string & symbol);
+
+%pythoncode %{
+  def is_string(s):
+      if isinstance(s, str):
+         return True
+      else:
+        return False   
+  def is_string_pair(sp):
+      if not isinstance(sp, tuple):
+         return False
+      if len(sp) != 2:
+         return False
+      if not is_string(sp[0]):
+         return False
+      if not is_string(sp[1]):
+         return False
+      return True
+  def is_string_vector(sv):
+      if not isinstance(sv, tuple):
+         return False
+      for s in sv:
+          if not is_string(s):
+             return False
+      return True
+  def is_string_pair_vector(spv):
+      if not isinstance(spv, tuple):
+         return False
+      for sp in spv:
+          if not is_string_pair(sp):
+             return False
+      return True
+
+  def two_level_paths_to_dict(tlps):
+      retval = {}
+      for tlp in tlps:
+          input = ""
+          output = ""
+          for sp in tlp[1]:
+              input += sp[0]
+              output += sp[1]
+          if input in retval:
+              retval[input].append((output, tlp[0]))
+          else:
+              retval[input] = [(output, tlp[0])]
+      return retval
+
+  def one_level_paths_to_tuple(olps):
+      retval = []
+      for olp in olps:
+          path = ""
+          for s in olp[1]:
+              path += s
+          retval.append((path, olp[0]))
+      return tuple(retval)
+%}
+
+class HfstTransducer 
+{
+public:
+HfstTransducer();
+//HfstTransducer(const hfst::HfstTransducer &);
+//HfstTransducer(const hfst::implementations::HfstBasicTransducer &, hfst::ImplementationType);
+~HfstTransducer();
+
+void set_name(const std::string &name);
+std::string get_name() const;
+hfst::ImplementationType get_type() const;
+void set_property(const std::string& property, const std::string& value);
+std::string get_property(const std::string& property) const;
+const std::map<std::string,std::string>& get_properties() const;
+
+/* Basic binary operations */
+HfstTransducer & concatenate(const HfstTransducer&, bool harmonize=true) throw(TransducerTypeMismatchException);
+HfstTransducer & disjunct(const HfstTransducer&, bool harmonize=true) throw(TransducerTypeMismatchException);
+HfstTransducer & subtract(const HfstTransducer&, bool harmonize=true) throw(TransducerTypeMismatchException);
+HfstTransducer & intersect(const HfstTransducer&, bool harmonize=true) throw(TransducerTypeMismatchException);
+HfstTransducer & compose(const HfstTransducer&, bool harmonize=true) throw(TransducerTypeMismatchException);
+
+/* More binary operations */
+HfstTransducer & compose_intersect(const hfst::HfstTransducerVector &v, bool invert=false, bool harmonize=true);
+HfstTransducer & priority_union(const HfstTransducer &another);
+HfstTransducer & lenient_composition(const HfstTransducer &another, bool harmonize=true);
+HfstTransducer & cross_product(const HfstTransducer &another, bool harmonize=true) throw(TransducersAreNotAutomataException);
+HfstTransducer & shuffle(const HfstTransducer &another, bool harmonize=true);
+
+/* Testing */
+bool compare(const HfstTransducer&, bool harmonize=true) const throw(TransducerTypeMismatchException);
+unsigned int number_of_states() const;
+unsigned int number_of_arcs() const;
+StringSet get_alphabet() const;
+bool is_cyclic() const;
+bool is_automaton() const;
+bool is_infinitely_ambiguous() const;
+bool is_lookup_infinitely_ambiguous(const std::string &) const;
+bool has_flag_diacritics() const;
+
+void insert_to_alphabet(const std::string &);
+void remove_from_alphabet(const std::string &);
+
+static bool is_implementation_type_available(hfst::ImplementationType type);
+
+/* Optimization */
+HfstTransducer & remove_epsilons();
+HfstTransducer & determinize();
+HfstTransducer & minimize();
+HfstTransducer & prune();
+HfstTransducer & eliminate_flags();
+HfstTransducer & eliminate_flag(const std::string&) throw(HfstException);
+HfstTransducer & n_best(unsigned int n);
+HfstTransducer & convert(ImplementationType impl);
+
+/* Repeat */
+HfstTransducer & repeat_star();
+HfstTransducer & repeat_plus();
+HfstTransducer & repeat_n(unsigned int);
+HfstTransducer & repeat_n_to_k(unsigned int, unsigned int);
+HfstTransducer & repeat_n_minus(unsigned int);
+HfstTransducer & repeat_n_plus(unsigned int);
+
+/* Other basic operations */
+HfstTransducer & invert();
+HfstTransducer & reverse();
+HfstTransducer & input_project();
+HfstTransducer & output_project();
+HfstTransducer & optionalize();
+
+/* Insert freely, substitute */
+
+HfstTransducer & insert_freely(const StringPair &symbol_pair, bool harmonize=true);
+HfstTransducer & insert_freely(const HfstTransducer &tr, bool harmonize=true);
+
+//HfstTransducer & substitute(bool (*func)(const StringPair &sp, hfst::StringPairSet &sps));
+
+HfstTransducer & substitute_symbol(const std::string &old_symbol, const std::string &new_symbol, bool input_side=true, bool output_side=true);
+HfstTransducer & substitute_symbol_pair(const StringPair &old_symbol_pair, const StringPair &new_symbol_pair);
+HfstTransducer & substitute_symbol_pair_with_set(const StringPair &old_symbol_pair, const hfst::StringPairSet &new_symbol_pair_set);
+HfstTransducer & substitute_symbol_pair_with_transducer(const StringPair &symbol_pair, HfstTransducer &transducer, bool harmonize=true);
+HfstTransducer & substitute_symbols(const hfst::HfstSymbolSubstitutions &substitutions); // alias for the previous function which is shadowed
+HfstTransducer & substitute_symbol_pairs(const hfst::HfstSymbolPairSubstitutions &substitutions); // alias for the previous function which is shadowed
+
+
+/* Weight handling */
+HfstTransducer & set_final_weights(float weight, bool increment=false);
+// Can 'transform_weights' be wrapped?  It maybe needs to be rewritten in python.
+HfstTransducer & push_weights(hfst::PushType type);
+
+//void extract_shortest_paths(HfstTwoLevelPaths &results) const;
+//bool extract_longest_paths(HfstTwoLevelPaths &results, bool obey_flags=true) const;
+int longest_path_size(bool obey_flags=true) const;
+
+%extend {
+
+    hfst::HfstTwoLevelPaths extract_shortest_paths_()
+    {
+        hfst::HfstTwoLevelPaths results;
+        $self->extract_shortest_paths(results);
+        return results;
+    }
+
+    hfst::HfstTwoLevelPaths extract_longest_paths_(bool obey_flags)
+    {
+        hfst::HfstTwoLevelPaths results;
+        $self->extract_longest_paths(results, obey_flags);
+        return results;
+    }
+
+    HfstTransducer(const hfst::HfstTransducer & t)
+    {
+        return hfst::copy_hfst_transducer(t);
+    }
+    HfstTransducer(const hfst::implementations::HfstBasicTransducer & t)
+    {
+        return hfst::copy_hfst_transducer_from_basic_transducer(t);
+    }
+    HfstTransducer(const hfst::implementations::HfstBasicTransducer & t, hfst::ImplementationType impl)
+    {
+        return hfst::copy_hfst_transducer_from_basic_transducer(t, impl);
+    }
+
+    char *__str__() {
+         static char tmp[1024];
+         $self->write_in_att_format(tmp);
+         return tmp;
+    }
+    HfstTransducer & write(hfst::HfstOutputStream & os) {
+         (void) os.redirect(*$self);
+         return *$self;
+    }
+    // 'union' is a reserved word in python, so it cannot be used as an alias for function 'disjunct' 
+    HfstTransducer & minus(const HfstTransducer& t, bool harmonize=true) { return $self->subtract(t, harmonize); }
+    HfstTransducer & conjunct(const HfstTransducer& t, bool harmonize=true) { return $self->intersect(t, harmonize); }
+
+    void write_att(hfst::HfstFile & f, bool write_weights=true)
+    {
+      $self->write_in_att_format(f.get_file(), write_weights);
+    }
+
+    void write_prolog(hfst::HfstFile & f, const std::string & name, bool write_weights=true)
+    {
+      $self->write_in_prolog_format(f.get_file(), name, write_weights);
+    }
+
+    hfst::HfstTwoLevelPaths extract_paths_(int max_num=-1, int cycles=-1) const throw(TransducerIsCyclicException)
+    {
+      hfst::HfstTwoLevelPaths results;
+      $self->extract_paths(results, max_num, cycles);
+      return results;
+    }
+
+    hfst::HfstTwoLevelPaths extract_paths_fd_(int max_num=-1, int cycles=-1, bool filter_fd=true) const throw(TransducerIsCyclicException)
+    {
+      hfst::HfstTwoLevelPaths results;
+      $self->extract_paths_fd(results, max_num, cycles, filter_fd);
+      return results;
+    }
+
+    hfst::HfstTwoLevelPaths extract_random_paths_(int max_num) const
+    {
+      hfst::HfstTwoLevelPaths results;
+      $self->extract_random_paths(results, max_num);
+      return results;
+    }
+
+    hfst::HfstTwoLevelPaths extract_random_paths_fd_(int max_num, bool filter_fd) const
+    {
+      hfst::HfstTwoLevelPaths results;
+      $self->extract_random_paths_fd(results, max_num, filter_fd);
+      return results;
+    }
+
+// Wrappers for lookup functions
+
+HfstOneLevelPaths lookup_fd_vector(const StringVector& s, int limit = -1, double time_cutoff = 0.0) const throw(FunctionNotImplementedException)
+{ return *($self->lookup_fd(s, limit, time_cutoff)); }
+HfstOneLevelPaths lookup_fd_string(const std::string& s, int limit = -1, double time_cutoff = 0.0) const throw(FunctionNotImplementedException)
+{ return *($self->lookup_fd(s, limit, time_cutoff)); }
+HfstOneLevelPaths lookup_vector(const StringVector& s, int limit = -1, double time_cutoff = 0.0) const throw(FunctionNotImplementedException)
+{ return *($self->lookup(s, limit, time_cutoff)); }
+HfstOneLevelPaths lookup_string(const std::string & s, int limit = -1, double time_cutoff = 0.0) const throw(FunctionNotImplementedException)
+{ return *($self->lookup(s, limit, time_cutoff)); }
+
+
+%pythoncode %{
+
+  def lookup(self, input, **kvargs):
+      
+      obey_flags=True
+      max_number=-1
+      time_cutoff=0.0
+      output='tuple' # 'tuple' (default), 'text', 'raw'
+
+      for k,v in kvargs.items():
+          if k == 'obey_flags':
+             if v == 'True':
+                pass
+             elif v == 'False':
+                obey_flags=False
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'True' and 'False'.")
+          elif k == 'output':
+             if v == 'text':
+                output='text'
+             elif v == 'raw':
+                output='raw'
+             elif v == 'tuple':
+                output='tuple'
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'tuple' (default), 'text', 'raw'.")
+          elif k == 'max_number' :
+             max_number=v
+          elif k == 'time_cutoff' :
+             time_cutoff=v
+          else:
+             print('Warning: ignoring unknown argument %s.' % (k))
+
+      retval=0
+
+      if isinstance(input, tuple):
+         if obey_flags:
+            retval=self.lookup_fd_vector(input, max_number, time_cutoff)
+         else:
+            retval=self.lookup_vector(input, max_number, time_cutoff)
+      elif isinstance(input, str):
+         if obey_flags:
+            retval=self.lookup_fd_string(input, max_number, time_cutoff)
+         else:
+            retval=self.lookup_string(input, max_number, time_cutoff)
+      else:
+         raise RuntimeError('Input argument must be string or tuple.')
+
+      if output == 'text':
+         return one_level_paths_to_string(retval)
+      elif output == 'tuple':
+         return one_level_paths_to_tuple(retval)
+      else:
+         return retval
+
+  def extract_longest_paths(self, **kvargs):
+      obey_flags=True
+      output='dict' # 'dict' (default), 'text', 'raw'
+
+      for k,v in kvargs.items():
+          if k == 'obey_flags':
+             if v == 'True':
+                pass
+             elif v == 'False':
+                obey_flags=False
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'True' and 'False'.")
+          elif k == 'output':
+             if v == 'text':
+                output == 'text'
+             elif v == 'raw':
+                output='raw'
+             elif v == 'dict':
+                output='dict'
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'dict' (default), 'text', 'raw'.")
+          else:
+             print('Warning: ignoring unknown argument %s.' % (k))
+
+      retval = self.extract_longest_paths_(obey_flags)
+
+      if output == 'text':
+         return two_level_paths_to_string(retval)
+      elif output == 'dict':
+         return two_level_paths_to_dict(retval)
+      else:
+         return retval
+
+  def extract_shortest_paths(self, **kvargs):
+      output='dict' # 'dict' (default), 'text', 'raw'
+
+      for k,v in kvargs.items():
+          if k == 'output':
+             if v == 'text':
+                output == 'text'
+             elif v == 'raw':
+                output='raw'
+             elif v == 'dict':
+                output='dict'
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'dict' (default), 'text', 'raw'.")
+          else:
+             print('Warning: ignoring unknown argument %s.' % (k))
+
+      retval = self.extract_shortest_paths_()
+
+      if output == 'text':
+         return two_level_paths_to_string(retval)
+      elif output == 'dict':
+         return two_level_paths_to_dict(retval)
+      else:
+         return retval
+
+  def extract_paths(self, **kvargs):
+
+      obey_flags=True
+      filter_flags=True
+      max_cycles=-1
+      max_number=-1
+      random=False
+      output='dict' # 'dict' (default), 'text', 'raw'
+
+      for k,v in kvargs.items():
+          if k == 'obey_flags' :
+             if v == 'True':
+                pass
+             elif v == 'False':
+                obey_flags=False
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'True' and 'False'.")
+          elif k == 'filter_flags' :
+             if v == 'True':
+                pass
+             elif v == 'False':
+                filter_flags=False
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'True' and 'False'.")
+          elif k == 'max_cycles' :
+             max_cycles=v
+          elif k == 'max_number' :
+             max_number=v
+          elif k == 'random' :
+             if v == 'False':
+                pass
+             elif v == 'True':
+                random=True
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'True' and 'False'.")
+          elif k == 'output':
+             if v == 'text':
+                output = 'text'
+             elif v == 'raw':
+                output='raw'
+             elif v == 'dict':
+                output='dict'
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'dict' (default), 'text', 'raw'.")
+          else:
+             print('Warning: ignoring unknown argument %s.' % (k))
+
+      retval=0
+
+      if obey_flags :
+         if random :
+            retval=self.extract_random_paths_fd_(max_number, filter_flags)
+         else :
+            retval=self.extract_paths_fd_(max_number, max_cycles)
+      else :
+         if random :
+            retval=self.extract_random_paths_(max_number)  
+         else :   
+            retval=self.extract_paths_(max_number, max_cycles)
+
+      if output == 'text':
+         return two_level_paths_to_string(retval)
+      elif output == 'dict':
+         return two_level_paths_to_dict(retval)
+      else:
+         return retval
+
+  def substitute(self, s, S=None, **kvargs):
+
+      if S == None:
+         if not isinstance(s, dict):
+            raise RuntimeError('Sole input argument must be a dictionary.')
+
+         subst_type=""
+
+         for k, v in s.items():
+             if is_string(k):
+                if subst_type == "":
+                   subst_type="string"
+                elif subst_type == "string pair":
+                   raise RuntimeError('')
+                if not is_string(v):
+                   raise RuntimeError('')
+             elif is_string_pair(k):
+                if subst_type == "":
+                   subst_type="string pair"
+                elif subst_type == "string":
+                   raise RuntimeError('')
+                if not is_string_pair(v):
+                   raise RuntimeError('')
+             else:
+                raise RuntimeError('')
+
+         if subst_type == "string":
+            return self.substitute_symbols(s)
+         else:
+            return self.substitute_symbol_pairs(s)
+
+      if is_string(s):
+         if is_string(S):
+            input=True
+            output=True
+            for k,v in kvargs.items():
+                if k == 'input':
+                   if v == False:
+                      input=False
+                elif k == 'output':
+                   if v == False:
+                      output=False
+                else:
+                   raise RuntimeError('Free argument not recognized.')
+            return self.substitute_symbol(s, S, input, output)
+         else:
+            raise RuntimeError('...')
+      elif is_string_pair(s):
+         if is_string_pair(S):
+            return self.substitute_symbol_pair(s, S)
+         elif is_string_pair_vector(S):
+            return self.substitute_symbol_pair_with_set(s, S)
+         elif isinstance(S, HfstTransducer):
+            return self.substitute_symbol_pair_with_transducer(s, S, True)
+         else:
+            raise RuntimeError('...')
+      else:
+         raise RuntimeError('...')
+%}
+
+};
+
+};
+
+hfst::HfstOutputStream * create_hfst_output_stream(const std::string & filename, hfst::ImplementationType type, bool hfst_format);
+
+class HfstOutputStream
+{
+public:
+//HfstOutputStream(ImplementationType type, bool hfst_format=true);
+//HfstOutputStream(const std::string &filename, ImplementationType type, bool hfst_format=true);
+~HfstOutputStream(void);
+HfstOutputStream &flush();
+//HfstOutputStream &operator<< (HfstTransducer &transducer);
+//HfstOutputStream& redirect (HfstTransducer &transducer);
+void close(void);
+
+%extend {
+
+HfstOutputStream & write(hfst::HfstTransducer & transducer) throw(StreamIsClosedException)
+{
+  return $self->redirect(transducer);
+}
+
+HfstOutputStream() { return new hfst::HfstOutputStream(hfst::get_default_fst_type()); }
+
+%pythoncode %{
+
+def __init__(self, **kvargs):
+    filename = ""
+    hfst_format = True
+    type = _libhfst.get_default_fst_type()
+    for k,v in kvargs.items():
+        if k == 'filename':
+           filename = v
+        if k == 'hfst_format':
+           hfst_format = v
+        if k == 'type':
+           type = v
+    if filename == "":
+       self.this = _libhfst.create_hfst_output_stream("", type, hfst_format)
+    else:
+       self.this = _libhfst.create_hfst_output_stream(filename, type, hfst_format)
+%}
+
+}
+
+};
+
+class HfstInputStream
+{
+public:
+    HfstInputStream(void) throw(StreamNotReadableException, NotTransducerStreamException, EndOfStreamException, TransducerHeaderException);
+    HfstInputStream(const std::string &filename) throw(StreamNotReadableException, NotTransducerStreamException, EndOfStreamException, TransducerHeaderException);
+    ~HfstInputStream(void);
+    void close(void);
+    bool is_eof(void);
+    bool is_bad(void);
+    bool is_good(void);
+    ImplementationType get_type(void) const throw(TransducerTypeMismatchException);
+
+%extend {
+hfst::HfstTransducer * read() throw (EndOfStreamException)
+{
+  return new hfst::HfstTransducer(*($self));
+}
+}
+
+};
+
+  /* class MultiCharSymbolTrie;
+  typedef std::vector<MultiCharSymbolTrie*> MultiCharSymbolTrieVector;
+  typedef std::vector<bool> SymbolEndVector;
+
+  class MultiCharSymbolTrie
+  {
+  public:
+    MultiCharSymbolTrie(void);
+    ~MultiCharSymbolTrie(void);
+    void add(const char * p);
+    const char * find(const char * p) const;  
+  }; */
+  
+  class HfstTokenizer
+  {    
+  public:
+     HfstTokenizer();
+     void add_skip_symbol(const std::string &symbol);
+     void add_multichar_symbol(const std::string& symbol);
+     StringPairVector tokenize(const std::string &input_string) const;
+     StringVector tokenize_one_level(const std::string &input_string) const;
+     static StringPairVector tokenize_space_separated(const std::string & str);
+     StringPairVector tokenize(const std::string &input_string,
+                              const std::string &output_string) const;
+     static void check_utf8_correctness(const std::string &input_string);
+  };
+
+namespace implementations {
+
+  class HfstBasicTransducer;
+  class HfstBasicTransition;
+  typedef unsigned int HfstState;
+
+  typedef std::vector<std::vector<hfst::implementations::HfstBasicTransition> > HfstBasicStates;
+
+class HfstBasicTransducer {
+
+  public:
+
+    typedef std::vector<HfstBasicTransition> HfstTransitions;
+
+    HfstBasicTransducer(void);
+    //HfstBasicTransducer(FILE *file);
+    //HfstBasicTransducer &assign(const HfstBasicTransducer &graph);
+    HfstBasicTransducer(const HfstBasicTransducer &graph);
+    HfstBasicTransducer(const hfst::HfstTransducer &transducer);
+
+    void add_symbol_to_alphabet(const std::string &symbol);
+    void remove_symbol_from_alphabet(const std::string &symbol);
+    void remove_symbols_from_alphabet(const StringSet &symbols);
+    void add_symbols_to_alphabet(const StringSet &symbols);
+    // shadowed by the previous function: void add_symbols_to_alphabet(const StringPairSet &symbols);
+    std::set<std::string> symbols_used();
+    void prune_alphabet(bool force=true);
+    const std::set<std::string> &get_alphabet() const;
+    StringPairSet get_transition_pairs() const;
+    HfstState add_state(void);
+    HfstState add_state(HfstState s);
+    HfstState get_max_state() const;
+    std::vector<HfstState> states() const;
+    void add_transition(HfstState s, const hfst::implementations::HfstBasicTransition & transition,
+                         bool add_symbols_to_alphabet=true);
+    void remove_transition(HfstState s, const hfst::implementations::HfstBasicTransition & transition,
+                            bool remove_symbols_from_alphabet=false);
+    bool is_final_state(HfstState s) const;
+    float get_final_weight(HfstState s) const throw(StateIsNotFinalException, StateIndexOutOfBoundsException);
+    void set_final_weight(HfstState s, const float & weight);
+    HfstBasicTransducer &sort_arcs(void);
+    const std::vector<HfstBasicTransition> & transitions(HfstState s) const;
+    HfstBasicTransducer &disjunct(const StringPairVector &spv, float weight);
+    HfstBasicTransducer &harmonize(HfstBasicTransducer &another);
+
+    bool is_infinitely_ambiguous();
+    bool is_lookup_infinitely_ambiguous(const StringVector & s);
+    int longest_path_size();
+
+    HfstBasicTransducer & substitute_symbol(const std::string &old_symbol, const std::string &new_symbol, bool input_side=true, bool output_side=true);
+    HfstBasicTransducer & substitute_symbol_pair(const StringPair &old_symbol_pair, const StringPair &new_symbol_pair);
+    HfstBasicTransducer & substitute_symbol_pair_with_set(const StringPair &old_symbol_pair, const hfst::StringPairSet &new_symbol_pair_set);
+    HfstBasicTransducer & substitute_symbol_pair_with_transducer(const StringPair &symbol_pair, HfstBasicTransducer &transducer);
+    HfstBasicTransducer & substitute_symbols(const hfst::HfstSymbolSubstitutions &substitutions); // alias for the previous function which is shadowed
+    HfstBasicTransducer & substitute_symbol_pairs(const hfst::HfstSymbolPairSubstitutions &substitutions); // alias for the previous function which is shadowed
+
+    HfstBasicTransducer & insert_freely(const StringPair &symbol_pair, float weight);
+    HfstBasicTransducer & insert_freely(const HfstBasicTransducer &tr);
+    
+    // void lookup_fd(const StringVector &lookup_path, HfstTwoLevelPaths &results, size_t infinite_cutoff, float * max_weight = NULL)
+
+    hfst::implementations::HfstBasicStates states_and_transitions() const;
+
+
+
+%extend {
+
+  HfstTwoLevelPaths lookup_fd_(const StringVector &lookup_path, size_t * infinite_cutoff, float * max_weight)
+  {
+    hfst::HfstTwoLevelPaths results;
+    $self->lookup_fd(lookup_path, results, infinite_cutoff, max_weight);
+    return results;
+  }
+  void write_prolog(hfst::HfstFile & f, const std::string & name, bool write_weights=true) {
+    $self->write_in_prolog_format(f.get_file(), name, write_weights);
+  }
+  static HfstBasicTransducer read_prolog(hfst::HfstFile & f) {
+    unsigned int linecount = 0;
+    return hfst::implementations::HfstBasicTransducer::read_in_prolog_format(f.get_file(), linecount);
+  }
+  void write_xfst(hfst::HfstFile & f, bool write_weights=true) {
+    $self->write_in_xfst_format(f.get_file(), write_weights);
+  }
+  void write_att(hfst::HfstFile & f, bool write_weights=true) {
+    $self->write_in_att_format(f.get_file(), write_weights);
+  }
+  static HfstBasicTransducer read_att(hfst::HfstFile & f, std::string epsilon="@_EPSILON_SYMBOL_@") throw(EndOfStreamException, NotValidAttFormatException) {
+    unsigned int linecount = 0;
+    return hfst::implementations::HfstBasicTransducer::read_in_att_format(f.get_file(), epsilon, linecount);
+  }
+
+  char * __str__()
+  {
+    static char str[1024];
+    $self->write_in_att_format(str, true); // write_weights=true  
+    return str;
+  }
+
+  void add_transition(HfstState source, HfstState target, std::string input, std::string output, float weight=0) {
+    hfst::implementations::HfstBasicTransition tr(target, input, output, weight);
+    $self->add_transition(source, tr);
+  }
+
+%pythoncode %{
+  def __iter__(self):
+      return self.states_and_transitions().__iter__()
+
+  def __enumerate__(self):
+      return enumerate(self.states_and_transitions())
+
+  def lookup_fd(self, lookup_path, **kvargs):
+      max_weight = None
+      infinite_cutoff = None
+      output='dict' # 'dict' (default), 'text', 'raw'
+
+      for k,v in kvargs.items():
+          if k == 'max_weight' :
+             max_weight=v
+          elif k == 'infinite_cutoff' :
+             infinite_cutoff=v
+          elif k == 'output':
+             if v == 'text':
+                output == 'text'
+             elif v == 'raw':
+                output='raw'
+             elif v == 'dict':
+                output='dict'
+             else:
+                print('Warning: ignoring argument %s as it has value %s.' % (k, v))
+                print("Possible values are 'dict' (default), 'text', 'raw'.")
+          else:
+             print('Warning: ignoring unknown argument %s.' % (k))
+
+      retval = self.lookup_fd_(lookup_path, infinite_cutoff, max_weight)
+
+      if output == 'text':
+         return two_level_paths_to_string(retval)
+      elif output == 'dict':
+         return two_level_paths_to_dict(retval)
+      else:
+         return retval
+
+  def substitute(self, s, S=None, **kvargs):
+
+      if S == None:
+         if not isinstance(s, dict):
+            raise RuntimeError('First input argument must be a dictionary.')
+
+         subst_type=""
+
+         for k, v in s.items():
+             if is_string(k):
+                if subst_type == "":
+                   subst_type="string"
+                elif subst_type == "string pair":
+                   raise RuntimeError('')
+                if not is_string(v):
+                   raise RuntimeError('')
+             elif is_string_pair(k):
+                if subst_type == "":
+                   subst_type="string pair"
+                elif subst_type == "string":
+                   raise RuntimeError('')
+                if not is_string_pair(v):
+                   raise RuntimeError('')
+             else:
+                raise RuntimeError('')
+
+         if subst_type == "string":
+            return self.substitute_symbols(s)
+         else:
+            return self.substitute_symbol_pairs(s)
+
+      if is_string(s):
+         if is_string(S):
+            input=True
+            output=True
+            for k,v in kvargs.items():
+                if k == 'input':
+                   if v == False:
+                      input=False
+                elif k == 'output':
+                   if v == False:
+                      output=False
+                else:
+                   raise RuntimeError('Free argument not recognized.')
+            return self.substitute_symbol(s, S, input, output)
+         else:
+            raise RuntimeError('...')
+      elif is_string_pair(s):
+         if is_string_pair(S):
+            return self.substitute_symbol_pair(s, S)
+         elif is_string_pair_vector(S):
+            return self.substitute_symbol_pair_with_set(s, S)
+         elif isinstance(S, HfstBasicTransducer):
+            return self.substitute_symbol_pair_with_transducer(s, S)
+         else:
+            raise RuntimeError('...')
+      else:
+         raise RuntimeError('...')
+
+%}
+
+}
+        
+};
+
+class HfstBasicTransition {
+  public:
+    HfstBasicTransition();
+    HfstBasicTransition(hfst::implementations::HfstState, std::string, std::string, float);
+    ~HfstBasicTransition();
+    HfstState get_target_state() const;
+    std::string get_input_symbol() const;
+    std::string get_output_symbol() const;
+    float get_weight() const;
+  
+%extend{
+    char *__str__() {
+      static char str[1024];
+      sprintf(str, "%u %s %s %f", $self->get_target_state(), $self->get_input_symbol().c_str(), $self->get_output_symbol().c_str(), $self->get_weight());
+      return str;
+    }
+}
+
+};
+
+}
+
+
+namespace pmatch {
+  class PmatchCompiler
+  {
+    public:
+      PmatchCompiler();
+      PmatchCompiler(hfst::ImplementationType impl);
+      void set_flatten(bool val) { flatten = val; }
+      void set_verbose(bool val) { verbose = val; }
+      void define(const std::string& name, const std::string& pmatch);
+      std::map<std::string, HfstTransducer*> compile(const std::string& pmatch);
+  };
+}
+
+namespace xre {
+class XreCompiler
+{
+  public:
+  XreCompiler();
+  XreCompiler(hfst::ImplementationType impl);
+  //XreCompiler(const struct XreConstructorArguments & args);
+  void define(const std::string& name, const std::string& xre);
+  void define_list(const std::string& name, const std::set<std::string>& symbol_list);
+  bool define_function(const std::string& name, 
+                       unsigned int arguments,
+                       const std::string& xre);
+  bool is_definition(const std::string& name);
+  bool is_function_definition(const std::string& name);
+  void define(const std::string& name, const HfstTransducer & transducer);
+  void undefine(const std::string& name);
+  HfstTransducer* compile(const std::string& xre);
+  HfstTransducer* compile_first(const std::string& xre, unsigned int & chars_read);
+  bool contained_only_comments();
+  bool get_positions_of_symbol_in_xre
+    (const std::string & symbol, const std::string & xre, std::set<unsigned int> & positions);
+  void set_expand_definitions(bool expand);
+  void set_harmonization(bool harmonize);
+  void set_flag_harmonization(bool harmonize_flags);
+  void set_verbosity(bool verbose);
+  XreCompiler& setOutputToConsole(bool value);
+  bool getOutputToConsole();
+};
+}
+
+
+namespace lexc {
+  class LexcCompiler
+  {
+    public:
+      LexcCompiler();
+      LexcCompiler(hfst::ImplementationType impl);
+      LexcCompiler(hfst::ImplementationType impl, bool withFlags, bool alignStrings);
+      LexcCompiler& parse(FILE* infile);
+      LexcCompiler& parse(const char* filename);
+      LexcCompiler& setVerbosity(unsigned int verbose);
+      unsigned int getVerbosity();
+      bool isQuiet();
+      LexcCompiler& setTreatWarningsAsErrors(bool value);
+      bool areWarningsTreatedAsErrors();
+      LexcCompiler& setAllowMultipleSublexiconDefinitions(bool value);
+      LexcCompiler& setWithFlags(bool value);
+      LexcCompiler& setMinimizeFlags(bool value);
+      LexcCompiler& setRenameFlags(bool value);
+      LexcCompiler& addAlphabet(const std::string& alphabet);
+      LexcCompiler& addNoFlag(const std::string& lexname);
+      LexcCompiler& setCurrentLexiconName(const std::string& lexicon_name);
+      LexcCompiler& addStringEntry(const std::string& entry,
+                                   const std::string& continuation,
+                                   const double weight);
+      LexcCompiler& addStringPairEntry(const std::string& upper,
+                                       const std::string& lower,
+                                       const std::string& continuation,
+                                       const double weight);
+      LexcCompiler& addXreEntry(const std::string& xre,
+                                const std::string& continuation, 
+                                const double weight);
+      LexcCompiler& addXreDefinition(const std::string& name,
+                                     const std::string& xre);
+      LexcCompiler& setInitialLexiconName(const std::string& lexicon_name);
+      hfst::HfstTransducer* compileLexical();
+      // not implemented?: const std::map<std::string,hfst::HfstTransducer>& getStringTries() const;
+      // not implemented?: const std::map<std::string,hfst::HfstTransducer>& getRegexpUnions() const;
+      const LexcCompiler& printConnectedness(bool & warnings_printed);
+      void setOutputToConsole(bool);
+      bool getOutputToConsole();
+  };
+// ugh, the global
+//extern LexcCompiler* lexc_;
+}
+
+
+namespace xfst {
+  class XfstCompiler
+  {
+    public:
+      XfstCompiler();
+      XfstCompiler(hfst::ImplementationType impl);
+      //XfstCompiler& compile_regex(const char * indata, unsigned int & chars_read);
+      //int parse(FILE * infile);
+      //int parse(const char * filename);
+      //int parse_line(char line []);
+      int parse_line(std::string line);
+      //XfstCompiler& setReadline(bool readline);
+      XfstCompiler& setReadInteractiveTextFromStdin(bool value);
+      XfstCompiler& setOutputToConsole(bool value);
+      //bool getReadline();
+      //bool getReadInteractiveTextFromStdin();
+      //bool getOutputToConsole();
+      XfstCompiler& setVerbosity(bool verbosity);
+      XfstCompiler& setPromptVerbosity(bool verbosity);
+      bool quit_requested();
+      std::string get(const char *);
+      const XfstCompiler& prompt();
+      char* get_prompt() const;
+      XfstCompiler& set(const char* name, const char* text);
+  };
+}
+
+
+std::string hfst::get_hfst_regex_error_message();
+hfst::HfstTransducer * hfst::hfst_regex(hfst::xre::XreCompiler & comp, const std::string & regex_string, const std::string & error_stream);
+
+char * hfst::get_hfst_xfst_string_one();
+char * hfst::get_hfst_xfst_string_two();
+int hfst::hfst_compile_xfst_to_string_one(hfst::xfst::XfstCompiler & comp, std::string input);
+int hfst::hfst_compile_xfst(hfst::xfst::XfstCompiler & comp, std::string input, const std::string & output_stream, const std::string & error_stream);
+
+std::string hfst::get_hfst_lexc_output();
+hfst::HfstTransducer * hfst::hfst_compile_lexc(hfst::lexc::LexcCompiler & comp, const std::string & filename, const std::string & error_stream);
+
+void hfst::set_default_fst_type(hfst::ImplementationType t);
+hfst::ImplementationType hfst::get_default_fst_type();
+std::string hfst::fst_type_to_string(hfst::ImplementationType t);
+
+hfst::HfstTransducer * hfst::read_att(hfst::HfstFile & f, std::string epsilon="@_EPSILON_SYMBOL_@") throw(EndOfStreamException, NotValidAttFormatException);
+hfst::HfstTransducer * hfst::read_prolog(hfst::HfstFile & f) throw(EndOfStreamException);
+
+std::string hfst::one_level_paths_to_string(const HfstOneLevelPaths &);
+std::string hfst::two_level_paths_to_string(const HfstTwoLevelPaths &);
+
+}
+
+%pythoncode %{
+
+EPSILON='@_EPSILON_SYMBOL_@'
+UNKNOWN='@_UNKNOWN_SYMBOL_@'
+IDENTITY='@_IDENTITY_SYMBOL_@'
+
+OUTPUT_TO_CONSOLE=False
+def set_output_to_console(val):
+    global OUTPUT_TO_CONSOLE
+    OUTPUT_TO_CONSOLE=val
+def get_output_to_console():
+    return OUTPUT_TO_CONSOLE
+
+def regex(re, **kvargs):
+    type = _libhfst.get_default_fst_type()
+    to_console=get_output_to_console()
+    import sys
+    err=None
+
+    for k,v in kvargs.items():
+      if k == 'output_to_console':
+          to_console=v
+      if k == 'error':
+          err=v
+      else:
+        print('Warning: ignoring unknown argument %s.' % (k))
+
+    comp = XreCompiler(type)
+    comp.setOutputToConsole(to_console)
+
+    if err == None:
+       return _libhfst.hfst_regex(comp, re, "")
+    elif err == sys.stdout:
+       return _libhfst.hfst_regex(comp, re, "cout")
+    elif err == sys.stderr:
+       return _libhfst.hfst_regex(comp, re, "cerr")
+    else:
+       retval = _libhfst.hfst_regex(comp, re, "")
+       err.write(_libhfst.get_hfst_regex_error_message())
+       return retval
+
+def replace_symbols(symbol):
+    if symbol == "@0@":
+       return EPSILON
+    symbol = symbol.replace("@_SPACE_@", " ")
+    symbol = symbol.replace("@_TAB_@", "\t")
+    symbol = symbol.replace("@_COLON_@", ":")
+    return symbol
+
+def parse_att_line(line, fsm):
+    # get rid of extra whitespace
+    line = line.replace('\t',' ')
+    line = " ".join(line.split())
+    fields = line.split(' ')
+    if len(fields) == 1:
+           fsm.add_state(int(fields[0]))
+           fsm.set_final_weight(int(fields[0]), 0)
+    elif len(fields) == 2:
+           fsm.add_state(int(fields[0]))
+           fsm.set_final_weight(int(fields[0]), float(fields[1]))
+    elif len(fields) == 4:
+           fsm.add_transition(int(fields[0]), int(fields[1]), replace_symbols(fields[2]), replace_symbols(fields[3]), 0)
+    elif len(fields) == 5:
+           fsm.add_transition(int(fields[0]), int(fields[1]), replace_symbols(fields[2]), replace_symbols(fields[3]), float(fields[4]))
+    else:
+           return False
+    return True
+
+def read_att_string(att):
+    fsm = HfstBasicTransducer()
+    lines = att.split('\n')
+    for line in lines:
+        if not parse_att_line(line, fsm):
+           raise NotValidAttFormatException()
+    return HfstTransducer(fsm, _libhfst.get_default_fst_type())
+
+def read_att_input():
+    fsm = HfstBasicTransducer()
+    while True:
+        line = input().rstrip()
+        if line == "":
+           break
+        if not parse_att_line(line, fsm):
+           raise NotValidAttFormatException()
+    return HfstTransducer(fsm, _libhfst.get_default_fst_type())
+
+def start_xfst(**kvargs):
+    import sys
+    idle = 'idlelib' in sys.modules
+    if idle:
+        print('It seems that you are running python in in IDLE. Note that all output from xfst will be buffered.')
+        print('This means that all warnings, e.g. about time-consuming operations, will be printed only after the operation is carried out.')
+        print('Consider running python from shell, for example command prompt, if you wish to see output with no delays.')
+
+    type = _libhfst.get_default_fst_type()
+    quit_on_fail = 'OFF'
+    to_console=get_output_to_console()
+    for k,v in kvargs.items():
+      if k == 'type':
+        type = v
+      elif k == 'output_to_console':
+        to_console=v
+      elif k == 'quit_on_fail':
+        if v == True:
+          quit_on_fail='ON'
+      else:
+        print('Warning: ignoring unknown argument %s.' % (k))
+
+    comp = XfstCompiler(type)
+    comp.setReadInteractiveTextFromStdin(True)
+
+    if to_console and idle:
+        print('Cannot output to console when running libhfst from IDLE.')
+        to_console=False
+    comp.setOutputToConsole(to_console)
+    comp.set('quit-on-fail', quit_on_fail)
+
+    expression=""
+    import sys
+    while True:
+        expression += input(comp.get_prompt()).rstrip()
+        if expression[-1] == '\\':
+           expression = expression[:-2] + '\n'
+           continue
+        retval = -1
+        if idle:
+            retval = _libhfst.hfst_compile_xfst_to_string_one(comp, expression)
+            print(_libhfst.get_hfst_xfst_string_one(), end='')
+        else:
+            retval = comp.parse_line(expression + "\n")
+        if retval != 0:
+           print("expression '%s' could not be parsed" % expression)
+           if comp.get("quit-on-fail") == "ON":
+              return
+        if comp.quit_requested():
+           break
+        expression = ""
+
+def compile_xfst_file(filename, **kvargs):
+    verbosity=0
+    quit_on_fail='ON'
+    type = _libhfst.get_default_fst_type()
+    output=None
+    error=None
+    to_console=get_output_to_console()
+
+    for k,v in kvargs.items():
+      if k == 'verbosity':
+        verbosity=v
+      elif k == 'quit_on_fail':
+        if v == False:
+          quit_on_fail='OFF'
+      elif k == 'output':
+          output=v
+      elif k == 'error':
+          error=v
+      elif k == 'output_to_console':
+          to_console=v
+      else:
+        print('Warning: ignoring unknown argument %s.' % (k))
+
+    if verbosity > 1:
+      print('Compiling with %s implementation...' % _libhfst.fst_type_to_string(type))
+    xfstcomp = XfstCompiler(type)
+    xfstcomp.setOutputToConsole(to_console)
+    xfstcomp.setVerbosity(verbosity > 0)
+    xfstcomp.set('quit-on-fail', quit_on_fail)
+    if verbosity > 1:
+      print('Opening xfst file %s...' % filename)
+    f = open(filename, 'r', encoding='utf-8')
+    data = f.read()
+    f.close()
+    if verbosity > 1:
+      print('File closed...')
+
+    retval=-1
+    import sys
+    from io import StringIO
+
+    # check special case
+    if isinstance(output, StringIO) and isinstance(error, StringIO) and output == error:
+       retval =_libhfst.hfst_compile_xfst_to_string_one(xfstcomp, data)
+       output.write(_libhfst.get_hfst_xfst_string_one())
+    else:
+       arg1 = ""
+       arg2 = ""
+       if output == None or output == sys.stdout:
+          arg1 = "cout"
+       if output == sys.stderr:
+          arg1 == "cerr"
+       if error == None or error == sys.stderr:
+          arg2 = "cerr"
+       if error == sys.stdout:
+          arg2 == "cout"
+
+       retval = _libhfst.hfst_compile_xfst(xfstcomp, data, arg1, arg2)
+
+       if isinstance(output, StringIO):
+          output.write(_libhfst.get_hfst_xfst_string_one())
+       if isinstance(error, StringIO):
+          error.write(_libhfst.get_hfst_xfst_string_two())
+
+    if verbosity > 1:
+      print('Parsed file with return value %i (0 indicating succesful parsing).' % retval)
+    return retval
+
+def compile_lexc_file(filename, **kvargs):
+    verbosity=0
+    withflags=False
+    alignstrings=False
+    type = _libhfst.get_default_fst_type()
+    output=None
+    to_console=get_output_to_console()
+
+    for k,v in kvargs.items():
+      if k == 'verbosity':
+        verbosity=v
+      elif k == 'with_flags':
+        if v == True:
+          withflags = v
+      elif k == 'align_strings':
+          alignstrings = v
+      elif k == 'output':
+          output=v
+      elif k == 'output_to_console':
+          to_console=v
+      else:
+        print('Warning: ignoring unknown argument %s.' % (k))
+
+    lexccomp = LexcCompiler(type, withflags, alignstrings)
+    lexccomp.setVerbosity(verbosity)
+    lexccomp.setOutputToConsole(to_console)
+
+    retval=-1
+    import sys
+    if output == None:
+       retval = _libhfst.hfst_compile_lexc(lexccomp, filename, "")
+    elif output == sys.stdout:
+       retval = _libhfst.hfst_compile_lexc(lexccomp, filename, "cout")
+    elif output == sys.stderr:
+       retval = _libhfst.hfst_compile_lexc(lexccomp, filename, "cerr")
+    else:
+       retval = _libhfst.hfst_compile_lexc(lexccomp, filename, "")
+       output.write(_libhfst.get_hfst_lexc_output())
+
+    return retval
+
+def is_weighted_word(arg):
+    if isinstance(arg, tuple) and len(arg) == 2 and isinstance(arg[0], str) and isinstance(arg[1], (int, float)):
+       return True
+    return False
+
+def check_word(arg):
+    if len(arg) == 0:
+       raise RuntimeError('Empty word.')
+    return arg
+
+def fsa(arg):
+    if isinstance(arg, str):
+       return regex('{' + check_word(arg) + '}')
+    elif is_weighted_word(arg):
+       return regex('{' + check_word(arg[0]) + '}::' + str(arg[1]))
+    elif isinstance(arg, tuple) or isinstance(arg, list):
+       exp = '[0-0]' # empty automaton
+       for word in arg:
+           if is_weighted_word(word):
+              exp += ' | {' + check_word(word[0]) + '}::' + str(word[1])
+           elif isinstance(word, str):
+              exp += ' | {' + check_word(word) + '}'
+           else:
+              raise RuntimeError('Tuple/list element not a string or tuple of string and weight.')           
+       return regex(exp)
+    else:
+       raise RuntimeError('Not a string or tuple/list of strings.')
+
+def fst(arg):
+    if isinstance(arg, dict):
+       retval = regex('[0-0]') # empty transducer
+       for input, output in arg.items():
+           if not isinstance(input, str):
+              raise RuntimeError('Key not a string.')
+           left = fsa(input)
+           right = 0
+           if isinstance(output, str):
+              right = fsa(output)
+           elif isinstance(output, list) or isinstance(output, tuple):
+              right = fsa(output)
+           else:
+              raise RuntimeError('Value not a string or tuple/list of strings.')
+           retval.disjunct(left.cross_product(right))
+       return retval
+    return fsa(arg)
+
+def tokenized_fst(arg, weight=0):
+    exp = '[ '
+    if isinstance(arg, list) or isinstance(arg, tuple):
+       for token in arg:
+           if isinstance(token, str):
+              exp += '"' + token + '" '
+           elif isinstance(token, list) or isinstance(token, tuple):
+              if len(token) == 2:
+                 exp += '"' + token[0] + '":"' + token[1] + '" '
+              elif len(token) == 1:
+                 exp += '"' + token + '" '
+              else:
+                 raise RuntimeError('Symbol or symbol pair must be given.')
+       exp += ']'
+       return regex("[" + exp + "]::" + str(weight))
+    else:
+       raise RuntimeError('Argument must be a list or a tuple')
+
+def empty_fst():
+    return regex('[0-0]')
+
+def epsilon_fst(weight=0):
+    return regex('[0]::' + str(weight))
+
+
+
+%}
diff --git a/swig/setup.py b/python/setup.py
similarity index 93%
rename from swig/setup.py
rename to python/setup.py
index ac83d18..fd24316 100644
--- a/swig/setup.py
+++ b/python/setup.py
@@ -26,11 +26,11 @@ libhfst_module = Extension('_libhfst',
 # ["libhfst-NN.dll", "libgcc_s_seh-1.dll"] or
 # ["libhfst-NN.dll", "libgcc_s_dw2-1.dll"] or
 setup(name = 'libhfst_swig',
-      version = '3.8.2_beta',
+      version = '3.9.0_beta',
       author = 'HFST team',
       author_email = 'hfst-bugs at helsinki.fi',
       url = 'http://hfst.sourceforge.net',
-      description = 'SWIG-bound libhfst interface',
+      description = 'SWIG-bound new libhfst interface',
       ext_modules = [libhfst_module],
       py_modules = ["libhfst"],
       data_files = []
diff --git a/python/test/Makefile.am b/python/test/Makefile.am
new file mode 100644
index 0000000..9f0014d
--- /dev/null
+++ b/python/test/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = README test_hfst.py examples.py test_fail.xfst testfile.att test_pass.xfst test.lexc foobar.hfst
diff --git a/python/test/README b/python/test/README
new file mode 100644
index 0000000..38b7ce5
--- /dev/null
+++ b/python/test/README
@@ -0,0 +1,11 @@
+
+This directory contains tests for HFST python bindings. The tests are
+still under construction, as are the python bindings.
+
+For the time being, run
+
+  python3 test_hfst.py && python3 examples.py && echo "TESTS PASSED"
+
+If "TESTS PASSED" is the last line that gets printed, it means that 
+the tests have passed.
+
diff --git a/python/test/examples.py b/python/test/examples.py
new file mode 100644
index 0000000..1d7b5d3
--- /dev/null
+++ b/python/test/examples.py
@@ -0,0 +1,378 @@
+# The examples given in doxygen documentation
+
+import libhfst
+
+# StreamIsClosedException
+try:
+    tr = libhfst.regex('foo')
+    outstr = libhfst.HfstOutputStream(filename='testfile')
+    outstr.close()
+    outstr.write(tr)
+except libhfst.StreamIsClosedException:
+    print("Could not write transducer: stream to file was closed.")
+
+# TransducerIsCyclicException
+transducer = libhfst.regex('[a:b]*')
+try:
+    results = transducer.extract_paths(output='text')
+    print("The transducer has %i paths:" % len(results))
+    print(results)
+except libhfst.TransducerIsCyclicException:
+    print("The transducer is cyclic and has an infinite number of paths. Some of them:")
+    results = transducer.extract_paths(output='text', max_cycles=5)
+    print(results)
+
+# NotTransducerStreamException
+f = open('foofile', 'w')
+f.write('This is an ordinary text file.\n')
+f.close()
+try:
+    instr = libhfst.HfstInputStream('foofile')
+    tr = instr.read()
+    print(tr)
+    instr.close()
+except libhfst.NotTransducerStreamException:
+    print("Could not print transducer: the file does not contain binary transducers.")
+
+f = open('testfile1.att', 'w')
+f.write('0 1 a b\n\
+1 2 c\n\
+2\n')
+f.close()
+f = libhfst.hfst_open('testfile1.att', 'r')
+try:
+    tr = libhfst.read_att(f)
+except libhfst.NotValidAttFormatException:
+    print('Could not read file: it is not in valid ATT format.')
+f.close()
+
+# StateIsNotFinalException
+tr = libhfst.HfstBasicTransducer()
+tr.add_state(1)
+# An exception is thrown as state number 1 is not final
+try:
+    w = tr.get_final_weight(1)
+except libhfst.StateIsNotFinalException:
+    print("State is not final.")
+
+# ContextTransducersAreNotAutomataException
+# try:
+#    tr = libhfst.regex('a -> b || c:c __ c:d')
+# except libhfst.ContextTransducersAreNotAutomataException:
+#    print("Context transducers must be automata.")
+
+# TransducersAreNotAutomataException
+tr1 = libhfst.regex('foo:bar')
+tr2 = libhfst.regex('bar:baz')
+try:
+    tr1.cross_product(tr2)
+except libhfst.TransducersAreNotAutomataException:
+    print('Transducers must be automata in cross product.')
+
+# StateIndexOutOfBoundsException
+tr = libhfst.HfstBasicTransducer()
+tr.add_state(1)
+try:
+    w = tr.get_final_weight(2)
+except libhfst.StateIndexOutOfBoundsException:
+    print('State number 2 does not exist')
+
+# TransducerTypeMismatchException:
+libhfst.set_default_fst_type(libhfst.TROPICAL_OPENFST_TYPE)
+tr1 = libhfst.regex('foo')
+tr2 = libhfst.regex('bar')
+tr2.convert(libhfst.FOMA_TYPE)
+try:
+    tr1.disjunct(tr2)
+except libhfst.TransducerTypeMismatchException:
+    print('The implementation types of transducers must be the same.')
+
+# fst
+# One unweighted identity path:
+if not libhfst.fst('foo').compare(libhfst.regex('{foo}')):
+    raise RuntimeError('')
+# Weighted path: a tuple of string and number, e.g. 
+if not libhfst.fst(('foo',1.4)).compare(libhfst.regex('{foo}::1.4')):
+    raise RuntimeError('')
+if not libhfst.fst(('bar',-3)).compare(libhfst.regex('{bar}::-3')):
+    raise RuntimeError('')
+if not libhfst.fst(('baz',0)).compare(libhfst.regex('{baz}')):
+    raise RuntimeError('')
+# Several paths: a list or a tuple of paths and/or weighted paths, e.g.
+if not libhfst.fst(['foo', 'bar']).compare(libhfst.regex('{foo}|{bar}')):
+    raise RuntimeError('')
+if not libhfst.fst(('foo', ('bar',5.0))).compare(libhfst.regex('{foo}|{bar}::5.0')):
+    raise RuntimeError('')
+if not libhfst.fst(('foo', ('bar',5.0), 'baz', 'Foo', ('Bar',2.4))).compare(libhfst.regex('{foo}|{bar}::5.0|{baz}|{Foo}|{Bar}::2.4')):
+    raise RuntimeError('')
+if not libhfst.fst([('foo',-1), ('bar',0), ('baz',3.5)]).compare(libhfst.regex('{foo}::-1|{bar}|{baz}::3.5')):
+    raise RuntimeError('')
+# A dictionary
+if not libhfst.fst({'foo':'foo', 'bar':('foo',1.4), 'baz':(('foo',-1),'BAZ')}).compare(libhfst.regex('{foo}|{bar}:{foo}::1.4|{baz}:{foo}::-1|{baz}:{BAZ}')):
+    raise RuntimeError('')
+
+# tokenized_fst
+tok = libhfst.HfstTokenizer()
+tok.add_multichar_symbol('foo')
+tok.add_multichar_symbol('bar')
+tr = libhfst.tokenized_fst(tok.tokenize('foobar', 'foobaz'))
+if not tr.compare(libhfst.regex('[foo:foo bar:b 0:a 0:z]')):
+    raise RuntimeError('')
+
+# HfstBasicTransducer
+# Create an empty transducer
+# The transducer has initially one start state (number zero) 
+# that is not final
+fsm = libhfst.HfstBasicTransducer()
+# Add two states to the transducer
+fsm.add_state(1)
+fsm.add_state(2)
+# Create a transition [foo:bar] leading to state 1 with weight 0.1
+tr = libhfst.HfstBasicTransition(1, 'foo', 'bar', 0.1)
+# and add it to state zero
+fsm.add_transition(0, tr)
+# Add a transition [baz:baz] with weight 0 from state 1 to state 2 
+fsm.add_transition(1, libhfst.HfstBasicTransition(2, 'baz', 'baz', 0.0))
+# Set state 2 as final with weight 0.3
+fsm.set_final_weight(2, 0.3)
+# Go through all states
+for state, arcs in enumerate(fsm):
+    for arc in arcs:
+        print('%i ' % (state), end='')
+        print(arc)
+    if fsm.is_final_state(state):
+        print('%i %f' % (state, fsm.get_final_weight(state)) )
+
+for state in fsm.states():
+    for arc in fsm.transitions(state):
+        print('%i ' % (state), end='')
+        print(arc)
+    if fsm.is_final_state(state):
+        print('%i %f' % (state, fsm.get_final_weight(state)) )
+
+# HfstBasicTransducer.disjunct
+lexicon = libhfst.HfstBasicTransducer()
+tok = libhfst.HfstTokenizer()
+lexicon.disjunct(tok.tokenize('dog'), 0.3)
+lexicon.disjunct(tok.tokenize('cat'), 0.5)
+lexicon.disjunct(tok.tokenize('elephant'), 1.6)
+lexicon = libhfst.HfstTransducer(lexicon)
+if not lexicon.compare(libhfst.regex('{dog}::0.3|{cat}::0.5|{elephant}::1.6')):
+    raise RuntimeError('')
+
+# HfstBasicTransducer.transitions
+for state in fsm.states():
+    for arc in fsm.transitions(state):
+        print('%i ' % (state), end='')
+        print(arc)
+    if fsm.is_final_state(state):
+        print('%i %f' % (state, fsm.get_final_weight(state)) )
+
+# HfstBasicTransducer.substitute and HfstTransducer.substitute
+hfst = libhfst.regex('a:a')
+basic = libhfst.HfstBasicTransducer(hfst)
+hfst.substitute('a', 'A', input=True, output=False)
+basic.substitute('a', 'A', input=True, output=False)
+
+hfst = libhfst.regex('a a:b b')
+basic = libhfst.HfstBasicTransducer(hfst)
+hfst.substitute(('a','b'),('A','B'))
+basic.substitute(('a','b'),('A','B'))
+
+hfst = libhfst.regex('a a:b b')
+basic = libhfst.HfstBasicTransducer(hfst)
+hfst.substitute(('a','b'), (('A','B'),('a','B'),('A','b')))
+basic.substitute(('a','b'), (('A','B'),('a','B'),('A','b')))
+
+hfst = libhfst.regex('a a:b b')
+basic = libhfst.HfstBasicTransducer(hfst)
+hfst.substitute(('a','b'), libhfst.regex('[a:b]+'))
+basic.substitute(('a','b'), libhfst.HfstBasicTransducer(libhfst.regex('[a:b]+')))
+
+hfst = libhfst.regex('a b c d')
+basic = libhfst.HfstBasicTransducer(hfst)
+hfst.substitute({'a':'A', 'b':'B', 'c':'C'})
+basic.substitute({'a':'A', 'b':'B', 'c':'C'})
+
+hfst = libhfst.regex('a a:b b b:c c c:d d')
+basic = libhfst.HfstBasicTransducer(hfst)
+hfst.substitute( {('a','a'):('A','A'), ('b','b'):('B','B'), ('c','c'):('C','C')} )
+basic.substitute( {('a','a'):('A','A'), ('b','b'):('B','B'), ('c','c'):('C','C')} )
+
+# HfstBasicTransducer.enumerate
+for state, arcs in enumerate(fsm):
+    for arc in arcs:
+        print('%i ' % (state), end='')
+        print(arc)
+    if fsm.is_final_state(state):
+        print('%i %f' % (state, fsm.get_final_weight(state)) )
+
+# HfstTransducer
+# argument handling
+transducer1 = libhfst.regex('foo:bar baz')
+transducer2 = libhfst.regex('FOO:BAR BAZ')
+transducer1.reverse()
+transducer1.disjunct(transducer2)
+if not transducer2.compare(libhfst.regex('FOO:BAR BAZ')):
+    raise RuntimeError('')
+transducer1.reverse().determinize().reverse().determinize()
+# implementation types
+tropical_transducer = libhfst.regex('foo').convert(libhfst.TROPICAL_OPENFST_TYPE)
+foma_transducer = libhfst.regex('foo').convert(libhfst.FOMA_TYPE)
+# TODO: segfaults
+try:
+    tropical_transducer.compare(foma_transducer)
+except libhfst.TransducerTypeMismatchException:
+   print('Implementation types of transducers must be the same.')
+
+# read_att from file
+f = open('testfile2.att', 'w')
+f.write(
+"""0 1 foo bar 0.3
+1 0.5
+--
+0 0.0
+--
+--
+0 0.0
+0 0 a <eps> 0.2
+""")
+f.close()
+
+transducers = []
+ifile = libhfst.hfst_open('testfile2.att', 'r')
+try:
+    while (not ifile.is_eof()):
+        t = libhfst.read_att(ifile, '<eps>')
+        transducers.append(t)
+        print("read one transducer")
+except libhfst.NotValidAttFormatException:
+    print("Error reading transducer: not valid AT&T format.")
+ifile.close()
+print("Read %i transducers in total" % len(transducers))
+
+# read_att from string
+#att_str = """0 1 a b
+#1 2 c d
+#2
+#"""
+#print(att_str)
+#tr = libhfst.read_att(att_str, '@0@')
+#print(tr)
+#exit(0)
+
+# write_att
+tr1 = libhfst.regex('[foo:bar baz:0 " "]::0.3')
+tr2 = libhfst.empty_fst()
+tr3 = libhfst.epsilon_fst(0.5)
+tr4 = libhfst.regex('[foo]')
+tr5 = libhfst.empty_fst()
+
+f = libhfst.hfst_open('testfile3.att', 'w')
+for tr in [tr1, tr2, tr3, tr4]:
+    tr.write_att(f)
+    f.write('--\n')
+tr5.write_att(f)
+f.close()
+
+# extract_paths
+tr = libhfst.regex('a:b+ (a:c+)')
+print(tr)
+print(tr.extract_paths(max_cycles=1, output='text'))
+print(tr.extract_paths(max_number=4, output='text'))
+print(tr.extract_paths(max_cycles=1, max_number=4, output='text'))
+
+# HfstOutputStream
+res = ['foo:bar','0','0 - 0','"?":?','a* b+']
+ostr = libhfst.HfstOutputStream(filename='testfile1.hfst')
+for re in res:
+    ostr.write(libhfst.regex(re))
+    ostr.flush()
+ostr.close()
+
+# HfstInputStream
+istr = libhfst.HfstInputStream('testfile1.hfst')
+transducers = []
+while not (istr.is_eof()):
+    transducers.append(istr.read())
+istr.close()
+if not len(transducers) == len(res):
+    raise RuntimeError('')
+i=0
+for tr in transducers:
+    if not tr.compare(libhfst.regex(res[i])):
+        raise RuntimeError('')
+    i+=1
+
+# push_weights
+
+# QuickStart (1/3)
+
+tr1 = libhfst.regex('foo:bar')
+tr2 = libhfst.regex('bar:baz')
+tr1.compose(tr2)
+print(tr1)
+
+# QuickStart (2/3)
+
+# Create as HFST basic transducer [a:b] with transition weight 0.3 and final weight 0.5.
+t = libhfst.HfstBasicTransducer()
+t.add_state(1)
+t.add_transition(0, 1, 'a', 'b', 0.3)
+t.set_final_weight(1, 0.5)
+
+# Convert to tropical OpenFst format (the default) and push weights toward final state.
+T = libhfst.HfstTransducer(t)
+T.push_weights(libhfst.TO_FINAL_STATE)
+
+# Convert back to HFST basic transducer.
+tc = libhfst.HfstBasicTransducer(T)
+try:
+    # Rounding might affect the precision.
+    if (0.79 < tc.get_final_weight(1)) and (tc.get_final_weight(1) < 0.81):
+        print("TEST PASSED")
+    else:
+        raise RuntimeError('')
+# If the state does not exist or is not final
+except libhfst.HfstException:
+    print("TEST FAILED: An exception thrown.")
+    raise RuntimeError('')
+
+# QuickStart (3/3)
+
+libhfst.set_default_fst_type(libhfst.FOMA_TYPE)
+
+# Create a simple lexicon transducer [[foo bar foo] | [foo bar baz]].
+tok = libhfst.HfstTokenizer()
+tok.add_multichar_symbol('foo')
+tok.add_multichar_symbol('bar')
+tok.add_multichar_symbol('baz')
+
+words = libhfst.tokenized_fst(tok.tokenize('foobarfoo'))
+t = libhfst.tokenized_fst(tok.tokenize('foobarbaz'))
+words.disjunct(t)
+
+# Create a rule transducer that optionally replaces 'bar' with 'baz' between 'foo' and 'foo'.
+rule = libhfst.regex('bar (->) baz || foo _ foo')
+
+# Apply the rule transducer to the lexicon.
+words.compose(rule).minimize()
+
+# Extract all string pairs from the result and print them to standard output.
+results = 0
+try:
+    # Extract paths and remove tokenization
+    results = words.extract_paths(output='dict')
+except libhfst.TransducerIsCyclicException:
+    # This should not happen because transducer is not cyclic.
+    print("TEST FAILED")
+    exit(1)
+
+for input,outputs in results.items():
+    print('%s:' % input)
+    for output in outputs:
+        print('  %s\t%f' % (output[0], output[1]))
+
+
+# Foma issue
+
diff --git a/python/test/foobar.hfst b/python/test/foobar.hfst
new file mode 100644
index 0000000..4a6eacd
Binary files /dev/null and b/python/test/foobar.hfst differ
diff --git a/python/test/test.lexc b/python/test/test.lexc
new file mode 100644
index 0000000..4f7568a
--- /dev/null
+++ b/python/test/test.lexc
@@ -0,0 +1,9 @@
+LEXICON Root
+foo BAR ;
+foo BAZ ;
+
+LEXICON BAR
+bar # ;
+
+LEXICON BAZ
+baz # ;
diff --git a/python/test/test_fail.xfst b/python/test/test_fail.xfst
new file mode 100644
index 0000000..209ce59
--- /dev/null
+++ b/python/test/test_fail.xfst
@@ -0,0 +1,2 @@
+regex föö:bär;
+pritn net
diff --git a/python/test/test_hfst.py b/python/test/test_hfst.py
new file mode 100644
index 0000000..8e33f15
--- /dev/null
+++ b/python/test/test_hfst.py
@@ -0,0 +1,458 @@
+import libhfst
+import os.path
+from inspect import currentframe
+
+def get_linenumber():
+    cf = currentframe()
+    return cf.f_back.f_lineno
+
+for type in (libhfst.TROPICAL_OPENFST_TYPE, libhfst.FOMA_TYPE):
+
+    print('\n--- Testing implementation type %s ---\n' % libhfst.fst_type_to_string(type))
+
+    libhfst.set_default_fst_type(type)
+
+    tr1 = None
+    tr2 = None
+    tr3 = None
+
+    if not os.path.isfile('foobar.hfst'):
+        raise RuntimeError('Missing file: foobar.hfst')
+
+    istr = libhfst.HfstInputStream('foobar.hfst')
+    numtr = 0
+    try:
+        tr1 = istr.read()
+        numtr += 1
+        tr2 = istr.read()
+        numtr += 1
+        tr3 = istr.read()
+        numtr += 1
+    except libhfst.EndOfStreamException:
+        pass
+    except:
+        raise RuntimeError(get_linenumber())
+    istr.close()
+
+    if numtr != 2:
+        raise RuntimeError(get_linenumber())
+
+    tr1.convert(libhfst.get_default_fst_type())
+    tr2.convert(libhfst.get_default_fst_type())
+
+    ostr = libhfst.HfstOutputStream(filename='foobar2.hfst')
+    ostr.write(tr1)
+    ostr.write(tr2)
+    ostr.flush()
+    ostr.close()
+
+    TR1 = None
+    TR2 = None
+    TR3 = None
+
+    istr = libhfst.HfstInputStream('foobar2.hfst')
+    numtr = 0
+    try:
+        TR1 = istr.read()
+        numtr += 1
+        TR2 = istr.read()
+        numtr += 1
+        TR3 = istr.read()
+        numtr += 1
+    except libhfst.EndOfStreamException:
+        pass
+    except:
+        raise RuntimeError(get_linenumber())
+    istr.close()
+
+    if numtr != 2:
+        raise RuntimeError(get_linenumber())
+    
+    if not (TR1.compare(tr1)):
+        raise RuntimeError(get_linenumber())
+    if not (TR2.compare(tr2)):
+        raise RuntimeError(get_linenumber())
+
+    # Copy constructor
+    transducer = libhfst.HfstTransducer(TR1)
+    if not (TR1.compare(transducer)):
+        raise RuntimeError(get_linenumber())
+    if not (transducer.compare(TR1)):
+        raise RuntimeError(get_linenumber())
+
+    # Read lexc
+    tr = libhfst.compile_lexc_file('test.lexc')
+    tr.insert_freely(tr1).minimize()
+    tr.insert_freely(('A','B')).minimize()
+
+    # Substitute
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute('a', 'A', input=True, output=False)
+    eq = libhfst.regex('A:a A:b b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute('a', 'A', input=False, output=True)
+    eq = libhfst.regex('a:A a:b b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute('a','A')
+    eq = libhfst.regex('A A:b b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute(('a','b'),('A','B'))
+    eq = libhfst.regex('a A:B b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute(('a','b'),(('A','B'),('B','C'),('C','D')))
+    eq = libhfst.regex('a [A:B|B:C|C:D] b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute(('a','b'),(('A','B'),('B','C'),('C','D')))
+    eq = libhfst.regex('a [A:B|B:C|C:D] b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute({'a':'A', 'b':'B', 'c':'C'})
+    eq = libhfst.regex('A A:B B;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    tr.substitute({('a','a'):('A','a'), ('a','b'):('a','B'), ('c','c'):('C','c')})
+    eq = libhfst.regex('A:a a:B b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    tr = libhfst.regex('a a:b b;')
+    sub = libhfst.regex('[c:d]+;')
+    tr.substitute(('a','b'),sub)
+    eq = libhfst.regex('a [c:d]+ b;')
+    if not (tr.compare(eq)):
+        raise RuntimeError(get_linenumber())
+
+    # push weights
+    tr = libhfst.regex('[a::1 a:b::0.3 b::0]::0.7;')
+    tr.push_weights(libhfst.TO_INITIAL_STATE)
+    tr.push_weights(libhfst.TO_FINAL_STATE)
+
+    # set final weights
+    tr = libhfst.regex('(a a:b (b));')
+    tr.set_final_weights(0.1)
+    tr.set_final_weights(0.4, True)
+
+    # reading and writing in text format
+    f = open('testfile.att', 'w')
+    f.write('0 1 foo bar 0.5\n\
+0 1 fo ba 0.2\n\
+0 1 f b 0\n\
+1 2 baz baz\n\
+2 0.1\n\
+--\n')
+    f.close()
+
+    numtr = 0
+    f = libhfst.hfst_open('testfile.att', 'r')
+    while not f.is_eof():
+        TR = libhfst.read_att(f)
+        numtr += 1
+    try:
+        libhfst.read_att(f)
+    except libhfst.EndOfStreamException:
+        pass
+    f.close()
+    if numtr != 2:
+        raise RuntimeError(get_linenumber())
+
+    f = libhfst.hfst_open('foo_att_prolog', 'w')
+    f.write('-- in ATT format --\n')
+    TR.write_att(f)
+    f.write('-- in prolog format --\n')
+    TR.write_prolog(f, 'FOOBAR_TRANSDUCER')
+    f.close()
+
+    fsm = libhfst.read_att_string(' 0\t 1 a b\n\
+                                1 2 c   d 0.5\n\
+2 \n\
+2 3 \t\te f\n\
+                                    3   0.3 ')
+    #if not fsm.compare(libhfst.regex('a:b c:d::0.5 (e:f::0.3)')):
+    #    raise RuntimeError('read_att_string failed')
+
+    # Lookup and path extraction
+    tr = libhfst.regex('foo:bar::0.5 | foo:baz')
+
+    print('tr.lookup')
+    try:
+        print(tr.lookup('foo', max_number=5, output='text'))
+    except libhfst.FunctionNotImplementedException:
+        print('converting...')
+        TR = libhfst.HfstTransducer(tr)
+        TR.convert(libhfst.HFST_OLW_TYPE)
+        print(TR.lookup('foo', max_number=5, output='text'))
+
+#  def lookup_fd(self, lookup_path, **kvargs):
+#      max_weight = None
+#      infinite_cutoff = -1 # Is this right?
+#      output='dict' # 'dict' (default), 'text', 'raw'
+
+
+    fsm = libhfst.HfstBasicTransducer(tr)
+    print(fsm.lookup_fd((('foo'))))
+
+    print('tr.extract_paths')
+    print(tr.extract_paths(obey_flags='True', filter_flags='False', max_number=3, output='dict'))
+
+    def test_fst(input, result):
+        if not libhfst.fst(input).compare(libhfst.regex(result)):
+            raise RuntimeError('test_fst failed with input: ' + input)
+
+    # Create automaton:
+    # unweighted
+    test_fst('foobar', '[f o o b a r]')
+    test_fst(['foobar'], '[f o o b a r]')
+    test_fst(['foobar', 'foobaz'], '[f o o b a [r|z]]')
+    # with weights
+    test_fst(('foobar', 0.3), '[f o o b a r]::0.3')
+    test_fst([('foobar', 0.5)], '[f o o b a r]::0.5')
+    test_fst(['foobar', ('foobaz', -2)], '[ f o o b a [r|[z::-2]] ]')
+    # Special inputs
+    test_fst('*** FOO ***', '{*** FOO ***}')
+
+    try:
+        foo = libhfst.fst('')
+        raise RuntimeError(get_linenumber())
+    except RuntimeError as e:
+        if not e.__str__() == 'Empty word.':
+            raise RuntimeError(get_linenumber())
+
+    # Create transducer:
+    # unweighted
+    test_fst({'foobar':'foobaz'}, '[f o o b a r:z]')
+    test_fst({'foobar':['foobar','foobaz']}, '[f o o b a [r|r:z]]')
+    test_fst({'foobar':('foobar','foobaz')}, '[f o o b a [r|r:z]]')
+    test_fst({'foobar':'foobaz', 'FOOBAR':('foobar','FOOBAR'), 'Foobar':['Foo','bar','Foobar']}, '[f o o b a r:z] | [F O O B A R] | [F:f O:o O:o B:b A:a R:r] | [F o o b:0 a:0 r:0] | [F:b o:a o:r b:0 a:0 r:0] | [F o o b a r]')
+
+    # with weights
+    test_fst({'foobar':('foobaz', -1)}, '[f o o b a r:z]::-1')
+    test_fst({'foobar':['foobar',('foobaz',-2.0)]}, '[f o o b a [r|r:z::-2.0]]')
+    test_fst({'foobar':('foobar',('foobaz',3.5))}, '[f o o b a [r|r:z::3.5]]')
+    test_fst({'foobar':('foobaz', -1), 'FOOBAR':('foobar',('FOOBAR', 2)), 'Foobar':[('Foo',2.5),'bar',('Foobar',0.3)]}, '[f o o b a r:z]::-1 | [F O O B A R]::2 | [F:f O:o O:o B:b A:a R:r] | [F o o b:0 a:0 r:0]::2.5 | [F:b o:a o:r b:0 a:0 r:0] | [F o o b a r]::0.3')
+
+    # Special inputs
+    test_fst({'*** FOO ***':'+++ BAR +++'}, '{*** FOO ***}:{+++ BAR +++}')
+
+    try:
+        foo = libhfst.fst({'':'foo'})
+        raise RuntimeError(get_linenumber())
+    except RuntimeError as e:
+        if not e.__str__() == 'Empty word.':
+            raise RuntimeError(get_linenumber())
+    try:
+        foo = libhfst.fst({'foo':''})
+        raise RuntimeError(get_linenumber())
+    except RuntimeError as e:
+        if not e.__str__() == 'Empty word.':
+            raise RuntimeError(get_linenumber())
+
+    # Tokenized input
+    def test_tokenized(tok, pathin, pathout, exp, weight=0):
+        tokenized = None
+        if (pathout == None):
+            tokenized = tok.tokenize_one_level(pathin)
+        else:
+            tokenized = tok.tokenize(pathin, pathout)
+        if not libhfst.tokenized_fst(tokenized, weight).compare(libhfst.regex(exp)):
+            if pathout == None:
+                raise RuntimeError('test_tokenized failed with input: ' + pathin)
+            else:
+                raise RuntimeError('test_tokenized failed with input: ' + pathin + ", " + pathout)
+
+    tok = libhfst.HfstTokenizer()
+
+    test_tokenized(tok, 'foobar', None, '[f o o b a r]')
+    test_tokenized(tok, 'foobar', 'foobar', '[f o o b a r]')
+    test_tokenized(tok, 'foobar', 'foobaz', '[f o o b a r:z]')
+    test_tokenized(tok, 'fööbär?', None, '[f ö ö b ä r "?"]')
+    test_tokenized(tok, 'fööbär?', 'fööbär?', '[f ö ö b ä r "?"]')
+    test_tokenized(tok, 'fööbär?', 'fööbäz!', '[f ö ö b ä r:z "?":"!"]::0.5', 0.5)
+
+    test_tokenized(tok, 'foo', None, '[f o o]')
+    test_tokenized(tok, 'foobar', 'foo', '[f o o b:0 a:0 r:0]')
+    test_tokenized(tok, 'bar', 'foobaz', '[b:f a:o r:o 0:b 0:a 0:z]')
+    test_tokenized(tok, 'bär?', None, '[b ä r "?"]')
+    test_tokenized(tok, 'fööbär?', 'bär?', '[f:b ö:ä ö:r b:"?" ä:0 r:0 "?":0]')
+    test_tokenized(tok, 'bär?', 'fööbäz!', '[b:f ä:ö r:ö "?":b 0:ä 0:z 0:"!"]')
+
+    tok.add_skip_symbol('fö')
+    tok.add_multichar_symbol('föö')
+    tok.add_multichar_symbol('fööbär')
+
+    test_tokenized(tok, 'föbär', None, '[b ä r]')
+    test_tokenized(tok, 'fööbär', None, '[fööbär]')
+    test_tokenized(tok, 'föfööfö', None, '[föö]')
+
+    test_tokenized(tok, 'föbär', 'foofö', '[b:f ä:o r:o]')
+    test_tokenized(tok, 'fööbär', 'föbar', '[fööbär:b 0:a 0:r]')
+    test_tokenized(tok, 'föfööfö', 'föföföföö', '[föö]')
+
+    tok = libhfst.HfstTokenizer()
+    tok.add_skip_symbol('?')
+    tok.add_skip_symbol(' ')
+    test_tokenized(tok, 'How is this tokenized?', None, '[H o w i s t h i s t o k e n i z e d]')
+    tok.add_skip_symbol(' is ')
+    test_tokenized(tok, 'How is this tokenized?', None, '[H o w t h i s t o k e n i z e d]')
+
+    tok = libhfst.HfstTokenizer()
+    tok.add_multichar_symbol(libhfst.EPSILON) # TODO: should this be included by default???
+    test_tokenized(tok, '@_EPSILON_SYMBOL_ at foo', None, '[f o o]')
+
+    if not libhfst.tokenized_fst([(libhfst.EPSILON,'b'),('f','a'),('o','a'),('o','r')]).compare(libhfst.regex('[0:b f:a o:a o:r]')):
+        raise RuntimeError(get_linenumber())
+
+    # Is this ok???
+    if not libhfst.regex('"' + libhfst.EPSILON + '"').compare(libhfst.regex('[0]')):
+        raise RuntimeError(get_linenumber())
+    if not libhfst.regex('"' + libhfst.IDENTITY + '"').compare(libhfst.regex('[?]')):
+        raise RuntimeError(get_linenumber())
+    if not libhfst.regex('"' + libhfst.UNKNOWN + '":"' + libhfst.UNKNOWN + '"').compare(libhfst.regex('[?:?]')):
+        raise RuntimeError(get_linenumber())
+
+    # other python functions
+    if not libhfst.empty_fst().compare(libhfst.regex('[0-0]')):
+        raise RuntimeError(get_linenumber())
+    if not libhfst.epsilon_fst().compare(libhfst.regex('[0]')):
+        raise RuntimeError(get_linenumber())
+    if not libhfst.epsilon_fst(-1.5).compare(libhfst.regex('[0]::-1.5')):
+        raise RuntimeError(get_linenumber())
+
+    # Non-ascii characters and unknowns/identities
+    tr1 = libhfst.regex('Ä:é å ?;')
+    tr2 = libhfst.regex('? Ö;')
+    tr1.concatenate(tr2)
+    result = libhfst.regex('Ä:é å [Ä|é|å|Ö|?] [Ä|é|å|Ö|?] Ö;')
+    if not tr1.compare(result):
+        raise RuntimeError(get_linenumber())
+
+    tr1 = libhfst.regex('ñ ?:á;')
+    tr2 = libhfst.regex('Ê:?;')
+    tr1.concatenate(tr2)
+    result = libhfst.regex('ñ [ñ:á|á|Ê:á|?:á] [Ê:ñ|Ê|Ê:á|Ê:?];')
+    if not tr1.compare(result):
+        raise RuntimeError(get_linenumber())
+
+    # Other functions (TODO: more extensixe checks)
+    tr = libhfst.regex('[foo]|[foo bar]|[f o o bar baz]')
+    if not tr.longest_path_size() == 5:
+        raise RuntimeError(get_linenumber())
+    result = tr.extract_longest_paths()
+    if not len(result) == 1:
+        raise RuntimeError(get_linenumber())
+    result = tr.extract_shortest_paths()    
+    if not len(result) == 1:
+        raise RuntimeError(get_linenumber())
+
+    # XfstCompiler
+    if libhfst.compile_xfst_file('test_pass.xfst') != 0:
+        raise RuntimeError(get_linenumber())
+    if libhfst.compile_xfst_file('test_fail.xfst') == 0:
+        raise RuntimeError(get_linenumber())
+    if libhfst.compile_xfst_file('test_fail.xfst', quit_on_fail=False, verbosity=0) != 0:
+        raise RuntimeError(get_linenumber())
+
+    # regex compiler
+    import io
+    msg = io.StringIO()
+    msg.write('This is the error message:\n')
+    tr = libhfst.regex('foo\\', error=msg)
+    if (tr == None):
+        msg.write('This was the error message.\n')
+        print(msg.getvalue())
+    import sys
+    msg = sys.stdout
+    tr = libhfst.regex('foo\\', error=msg)
+
+    # lexc compiler
+    msg = io.StringIO()
+    tr = libhfst.compile_lexc_file('test.lexc', output=msg, verbosity=2)
+    print('This is the output from lexc:')
+    print(msg.getvalue())
+
+print('\n--- Testing HfstBasicTransducer ---\n')
+
+# Create basic transducer, write it to file, read it, and test equivalence
+fsm = libhfst.HfstBasicTransducer()
+fsm.add_state(0)
+fsm.add_state(1)
+fsm.set_final_weight(1, 0.3)
+tr = libhfst.HfstBasicTransition(1, 'foo', 'bar', 0.5)
+fsm.add_transition(0, tr)
+fsm.add_transition(0, 0, 'baz', 'baz')
+fsm.add_transition(0, 0, 'baz', 'BAZ', 0.1)
+
+f = libhfst.hfst_open('foo_basic', 'w')
+fsm.write_att(f)
+f.close()
+
+f = libhfst.hfst_open('foo_basic', 'r')
+fsm2 = libhfst.HfstBasicTransducer.read_att(f, libhfst.EPSILON)
+f.close()
+
+FSM = libhfst.HfstTransducer(fsm, libhfst.FOMA_TYPE)
+FSM2 = libhfst.HfstTransducer(fsm2, libhfst.FOMA_TYPE)
+    
+if not (FSM.compare(FSM2)):
+    raise RuntimeError(get_linenumber())
+
+for type in (libhfst.TROPICAL_OPENFST_TYPE, libhfst.FOMA_TYPE):
+    Fsm = libhfst.HfstBasicTransducer(FSM.convert(type))
+    Fsm2 = libhfst.HfstBasicTransducer(FSM2.convert(type))
+
+
+# Print basic transducer
+fsm = libhfst.HfstBasicTransducer()
+for state in [0,1,2]:
+    fsm.add_state(state)
+fsm.add_transition(0,1,'foo','bar',1)
+fsm.add_transition(0,1,'foo','BAR',2)
+fsm.add_transition(1,2,'baz','baz',0)
+fsm.set_final_weight(2,0.5)
+
+# Different ways to print the transducer
+for state in fsm.states():
+    for arc in fsm.transitions(state):
+        print('%i ' % (state), end='')
+        print(arc)
+    if fsm.is_final_state(state):
+        print('%i %f' % (state, fsm.get_final_weight(state)) )
+
+for state, arcs in enumerate(fsm):
+    for arc in arcs:
+        print('%i ' % (state), end='')
+        print(arc)
+    if fsm.is_final_state(state):
+        print('%i %f' % (state, fsm.get_final_weight(state)) )
+
+index=0
+for state in fsm.states_and_transitions():
+    for transition in state:
+        print('%u\t%u\t%s\t%s\t%.2f' % (index, transition.get_target_state(), transition.get_input_symbol(), transition.get_output_symbol(), transition.get_weight()))
+    if fsm.is_final_state(index):
+        print('%s\t%.2f' % (index, fsm.get_final_weight(index)))
+    index = index + 1
+
+print(fsm)
+
+tr = libhfst.HfstBasicTransducer(libhfst.regex('foo'))
+tr.substitute({'foo':'bar'})
+tr.substitute({('foo','foo'):('bar','bar')})
diff --git a/python/test/test_pass.xfst b/python/test/test_pass.xfst
new file mode 100644
index 0000000..a35bcae
--- /dev/null
+++ b/python/test/test_pass.xfst
@@ -0,0 +1,3 @@
+regex föö:bär;
+print net
+exit
diff --git a/python/test/testfile.att b/python/test/testfile.att
new file mode 100644
index 0000000..e1f2bdc
--- /dev/null
+++ b/python/test/testfile.att
@@ -0,0 +1,6 @@
+0 1 foo bar 0.5
+0 1 fo ba 0.2
+0 1 f b 0
+1 2 baz baz
+2 0.1
+--
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 2c56a1e..f8f7705 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -16,7 +16,9 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 if GENERATE_FOMA_WRAPPER
-bin_SCRIPTS = hfst-foma-wrapper.sh hfst-foma ${top_srcdir}/back-ends/foma/hfst_foma
+bin_SCRIPTS = hfst-foma-wrapper.sh hfst-foma ${top_srcdir}/back-ends/foma/hfst_foma$(EXEEXT)
 EXTRA_DIST=hfst-foma generate-cc-files.sh
-AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=hfst-foma-wrapper.sh hfst-foma ${top_srcdir}/back-ends/foma/hfst_foma
+AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=hfst-foma-wrapper.sh hfst-foma ${top_srcdir}/back-ends/foma/hfst_foma$(EXEEXT)
+else
+EXTRA_DIST=generate-cc-files.sh
 endif
diff --git a/scripts/README b/scripts/README
new file mode 100644
index 0000000..fb7a669
--- /dev/null
+++ b/scripts/README
@@ -0,0 +1,52 @@
+This is a directory for scripts and miscellaneous files.
+
+
+Windows-related files
+---------------------
+
+make-hfst-tools.bat            A script for creating eight hfst command line tools for Windows
+make-hfst-tool.bat HFST-FOO    A script for creating hfst command line tool HFST-FOO.exe
+make-hfst-FOO.bat              Individual scripts for creating hfst command line tool hfst-FOO.exe
+make-htwolcpre[1|2|3].bat      Individual scripts for creating htwolcpre*.exe tools that the script hfst-twolc.bat can call
+make-foma.bat                  A script for making foma dll (not used at the moment)
+make-implementations.bat       A script for compiling hfst implementations object files (not used at the moment)
+make-libhfst.bat               A script for making hfst dll (not used at the moment) 
+make-openfstwin.bat            A script for making openfstwin dll (not used at the moment)
+make-parsers.bat               A script for compiling hfst parsers object files (not used at the moment)
+test-hfst-tools.bat            A script that performs simple tests for hfst tools
+make-python-bindings.bat       A script for making python hfst bindings for Windows
+generate-python-bindings.bat   A script for making python hfst bindings for Windows (not used at the moment)
+windows_tests/                 A directory that contains files for testing hfst tools on Windows
+inttypes.h                     A header file needed for Windows compilation
+stdint.h                       A header file needed for Windows compilation
+README_eight_tools_win.txt     README file for Windows package that contains eight command line tools 
+README_xfst_win.txt            README file for Windows package that contains hfst-xfst.exe command line tool 
+copy-for-windows.sh TARGET SOURCE   Copy winopenfst and foma back-ends as well as libhfst/src (SOURCE is the top directory) under TARGET directory
+libhfst_win.i                  Tentative interface file for new HFST Python bindings for Windows
+test_libhfst_win.py            Tentative test script for HFST Python bindings for Windows 
+
+
+Mac-related files
+-----------------
+
+generate-static-binaries.sh    For packaging hfst for Mac
+package-static-binaries.sh     For packaging hfst for Mac
+README_eight_tools_mac.txt     README file for Mac package that contains eight command line tools 
+README_xfst_mac.txt            README file for MAc package that contains hfst-xfst command line tool 
+
+
+Foma wrapper files
+------------------
+
+Makefile.am                   Make foma wrapper (not so much needed now because hfst-xfst replaces it) 
+hfst-foma-wrapper.sh.in       Needed for foma wrapper?
+hfst-foma.in                  Needed for foma wrapper?
+
+
+Miscellaneous files
+-------------------
+
+hfst-fst2tesseract.xfst
+generate-cc-files.sh           Performs all the flex/bison compilation needed when compiling HFST (call before 'make')
+hfst-twolc-bin                 Twolc script?
+multiple_targets.sh            Cygwin-related?
diff --git a/scripts/README_eight_tools_mac.txt b/scripts/README_eight_tools_mac.txt
new file mode 100644
index 0000000..78ec5c9
--- /dev/null
+++ b/scripts/README_eight_tools_mac.txt
@@ -0,0 +1,30 @@
+
+This package contains the following command line tools for [32|64]-bit Mac OS X:
+
+  - hfst-xfst
+  - hfst-lexc
+  - hfst-twolc
+  - hfst-lookup
+  - hfst-optimized-lookup
+  - hfst-proc
+  - hfst-pmatch
+  - hfst-pmatch2fst
+
+
+For more info about the tools, see their KitWiki pages: 
+
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstXfst>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstLexc>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstTwolC>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstLookUp>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstOptimizedLookup>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstProc>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstPmatch>
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstPmatch2Fst>
+
+or run hfst-TOOLNAME --help.
+
+
+For more info about the HFST project, see: 
+  <http://hfst.sourceforge.net/>
+
diff --git a/scripts/README_eight_tools.txt b/scripts/README_eight_tools_win.txt
similarity index 100%
rename from scripts/README_eight_tools.txt
rename to scripts/README_eight_tools_win.txt
diff --git a/scripts/README_xfst_mac.txt b/scripts/README_xfst_mac.txt
new file mode 100644
index 0000000..9374d39
--- /dev/null
+++ b/scripts/README_xfst_mac.txt
@@ -0,0 +1,9 @@
+
+This package contains the command line tool hfst-xfst for [32|64]-bit Mac OS X.
+
+For more info about the tool, see: 
+  <https://kitwiki.csc.fi/twiki/bin/view/KitWiki/HfstXfst>
+
+For more info about the HFST project, see: 
+  <http://hfst.sourceforge.net/>
+
diff --git a/scripts/README_xfst.txt b/scripts/README_xfst_win.txt
similarity index 100%
rename from scripts/README_xfst.txt
rename to scripts/README_xfst_win.txt
diff --git a/scripts/copy-for-windows.sh b/scripts/copy-for-windows.sh
index 47fc45a..d6a13c8 100755
--- a/scripts/copy-for-windows.sh
+++ b/scripts/copy-for-windows.sh
@@ -36,6 +36,8 @@ fomalibconf.h regex.h;
 do 
     cp back-ends/foma/$file $1/back-ends/foma/;
 done
+# there is a file with the same name in openfstwin
+mv $1/back-ends/foma/flags.c $1/back-ends/foma/_flags.c
 
 # openfstwin back-end
 mkdir $1/back-ends/openfstwin
@@ -72,7 +74,8 @@ HfstDataTypes.h HfstEpsilonHandler.h HfstExceptionDefs.h \
 HfstExceptions.h HfstExtractStrings.h HfstFlagDiacritics.h \
 HfstInputStream.h HfstLookupFlagDiacritics.h HfstOutputStream.h \
 HfstSymbolDefs.h HfstTokenizer.h HfstTransducer.h HfstXeroxRules.h \
-hfst.h hfst.hpp.in hfst_apply_schemas.h hfstdll.h;
+HfstStrings2FstTokenizer.h hfst.h hfst.hpp.in hfst_apply_schemas.h hfstdll.h \
+HfstPrintDot.h HfstPrintPCKimmo.h;
 do
     cp libhfst/src/$file $1/libhfst/src/
 done
@@ -82,7 +85,7 @@ HarmonizeUnknownAndIdentitySymbols HfstApply HfstDataTypes \
 HfstEpsilonHandler HfstExceptionDefs HfstExceptions HfstFlagDiacritics \
 HfstInputStream HfstLookupFlagDiacritics HfstOutputStream HfstRules \
 HfstSymbolDefs HfstTokenizer HfstTransducer HfstXeroxRules \
-HfstXeroxRulesTest;
+HfstStrings2FstTokenizer HfstXeroxRulesTest HfstPrintDot HfstPrintPCKimmo;
 do
     cp libhfst/src/$file.cc $1/libhfst/src/$file.cpp
 done
@@ -133,10 +136,10 @@ do
         $1/libhfst/src/implementations/optimized-lookup/$file.cpp
 done
 
-# parsers
+# libhfst/src/parsers
 for file in \
-LexcCompiler PmatchCompiler XreCompiler \
-lexc-utils pmatch_utils xre_utils;
+LexcCompiler PmatchCompiler XreCompiler XfstCompiler xfst_help_message \
+lexc-utils pmatch_utils xre_utils xfst-utils;
 do
     cp libhfst/src/parsers/$file.cc \
         $1/libhfst/src/parsers/$file.cpp
@@ -144,32 +147,28 @@ do
         $1/libhfst/src/parsers/$file.h
 done
 for file in \
-lexc-lexer pmatch_lex xre_lex;
+lexc-lexer pmatch_lex xre_lex xfst-lexer;
 do
     cp libhfst/src/parsers/$file.cc \
         $1/libhfst/src/parsers/$file.cpp
 done
 for file in \
-lexc-parser pmatch_parse xre_parse;
+lexc-parser pmatch_parse xre_parse xfst-parser;
 do
     cp libhfst/src/parsers/$file.cc \
         $1/libhfst/src/parsers/$file.cpp
     cp libhfst/src/parsers/$file.hh \
         $1/libhfst/src/parsers/$file.hh
 done
+sed -i 's/#include <unistd.h>/#include <io.h>/' $1/libhfst/src/parsers/xfst-lexer.cpp
+sed -i 's/hxfstwrap( )/hxfstwrap(void)/' $1/libhfst/src/parsers/xfst-lexer.cpp
+
 
-# make scripts and headers
-# cp scripts/make-foma.bat $1/back-ends/foma/
-# cp scripts/make-openfstwin.bat $1/back-ends/openfstwin/src/lib/
-# cp scripts/test-openfstwin.bat $1/back-ends/openfstwin/src/lib/
-# cp scripts/make-parsers.bat $1/libhfst/src/parsers/
-# cp scripts/make-implementations.bat $1/libhfst/src/implementations/
-# cp scripts/make-libhfst.bat $1/libhfst/src/
-# cp scripts/test-libhfst.bat $1/libhfst/src/
-# cp scripts/generate-python-bindings.bat $1/libhfst/src/
 cp scripts/make-python-bindings.bat $1/libhfst/src/
-cp scripts/test_libhfst_win.py $1/libhfst/src/
-cp scripts/libhfst_win.i $1/libhfst/src/
+cp python/test/test_hfst.py $1/libhfst/src/
+cp python/test/examples.py $1/libhfst/src/
+cp python/test/foobar.hfst $1/libhfst/src/
+cp python/libhfst.i $1/libhfst/src/
 cp scripts/make-hfst-xfst.bat $1/libhfst/src/
 cp scripts/make-hfst-proc.bat $1/libhfst/src/
 cp scripts/make-hfst-lexc.bat $1/libhfst/src/
@@ -186,8 +185,8 @@ do
 done
 
 cp scripts/test-hfst-tools.bat $1/libhfst/src/
-cp scripts/README_xfst.txt $1/libhfst/src/
-cp scripts/README_eight_tools.txt $1/libhfst/src/
+cp scripts/README_xfst_win.txt $1/libhfst/src/
+cp scripts/README_eight_tools_win.txt $1/libhfst/src/
 
 # copy missing headers and change some headers included
 cp scripts/stdint.h $1/back-ends/foma/
@@ -197,7 +196,8 @@ for file in \
 $1/libhfst/src/parsers/pmatch_lex.cpp \
 $1/libhfst/src/parsers/xre_lex.cpp \
 $1/libhfst/src/parsers/lexc-lexer.cpp \
-$1/back-ends/foma/lex.cmatrix.c;
+$1/back-ends/foma/lex.cmatrix.c \
+$1/back-ends/foma/lex.yy.c
 do
     sed -i 's/#include <unistd.h>/#include <io.h>/' $file
 done
@@ -221,24 +221,19 @@ mkdir $1/tools/src/hfst-twolc/src/rule_src
 mkdir $1/tools/src/hfst-twolc/src/string_src
 mkdir $1/tools/src/hfst-twolc/src/variable_src
 
-
-for file in \
-xfst-utils XfstCompiler hfst-xfst xfst-parser xfst-lexer \
-init_help  xfst_help_message;
+# tools/src/parsers
+for file in hfst-xfst init_help;
 do
     cp tools/src/parsers/$file.cc $1/tools/src/parsers/$file.cpp
 done
-
-cp tools/src/parsers/xfst_help_message.h $1/tools/src/parsers/
-
-sed -i 's/#include <unistd.h>/#include <io.h>/' $1/tools/src/parsers/xfst-lexer.cpp
-sed -i 's/hxfstwrap( )/hxfstwrap(void)/' $1/tools/src/parsers/xfst-lexer.cpp
-#sed -i 's/#include "help_message.cc"/#include "help_message.cpp"/' $1/tools/src/parsers/XfstCompiler.cpp
-
+for file in cmd.h abbrcmd.h;
+do
+    cp tools/src/parsers/$file $1/tools/src/parsers/
+done
 
 # compare, strings2fst and txt2fst are needed for testing hfst-xfst
 for file in \
-hfst-program-options hfst-commandline hfst-tool-metadata HfstStrings2FstTokenizer \
+hfst-program-options hfst-commandline hfst-tool-metadata \
 hfst-file-to-mem hfst-string-conversions hfst-getopt \
 hfst-lexc-compiler hfst-compare hfst-strings2fst hfst-txt2fst hfst-pmatch hfst-pmatch2fst \
 hfst-lookup hfst-optimized-lookup;
@@ -262,19 +257,13 @@ done
 
 for file in \
 hfst-commandline.h hfst-program-options.h hfst-tool-metadata.h \
-HfstStrings2FstTokenizer.h hfst-string-conversions.h \
+hfst-string-conversions.h \
 hfst-file-to-mem.h hfst-getopt.h hfst-optimized-lookup.h;
 do
     cp tools/src/$file $1/tools/src/
 done
 
 for file in \
-XfstCompiler.h xfst-utils.h xfst-parser.hh cmd.h abbrcmd.h;
-do
-    cp tools/src/parsers/$file $1/tools/src/parsers/
-done
-
-for file in \
 check-params-binary.h check-params-common.h check-params-unary.h getopt-cases-binary.h \
 getopt-cases-common.h getopt-cases-error.h getopt-cases-unary.h globals-binary.h \
 globals-common.h globals-unary.h;
diff --git a/scripts/generate-cc-files.sh b/scripts/generate-cc-files.sh
index 9d89ab7..bcf0be0 100755
--- a/scripts/generate-cc-files.sh
+++ b/scripts/generate-cc-files.sh
@@ -6,31 +6,39 @@
 cd libhfst/src/parsers/
 rm -f xre_parse.h pmatch_parse.h lexc-parser.h
 rm -f xre_parse.cc pmatch_parse.cc lexc-parser.cc
+rm -f xre_lex.cc pmatch_lex.cc lexc-lexer.cc
+rm -f xfst-parser.cc xfst-lexer.cc xfst-parser.h
+make xre_lex.cc
+make pmatch_lex.cc
+make lexc-lexer.cc
 make xre_parse.cc
 make pmatch_parse.cc
 make lexc-parser.cc
+make xfst-lexer.cc
+make xfst-parser.cc
 test -e xre_parse.h && mv xre_parse.h xre_parse.hh
 test -e pmatch_parse.h && mv pmatch_parse.h pmatch_parse.hh
 test -e lexc-parser.h && mv lexc-parser.h lexc-parser.hh
+test -e xfst-parser.h && mv xfst-parser.h xfst-parser.hh
 cd ../../..
 cd tools/src
 rm -f hfst-compiler.h
 rm -f hfst-compiler.cc
+rm -f hfst-scanner.cc
+make hfst-scanner.cc
 make hfst-compiler.cc
 test -e hfst-compiler.h && mv hfst-compiler.h hfst-compiler.hh
 cd hfst-twolc/src/
 rm -f htwolcpre1.h htwolcpre2.h htwolcpre3.h
 rm -f htwolcpre1.cc htwolcpre2.cc htwolcpre3.cc
+rm -f scanner1.cc scanner2.cc scanner3.cc
+make scanner1.cc
+make scanner2.cc
+make scanner3.cc
 make htwolcpre1.cc
 make htwolcpre2.cc
 make htwolcpre3.cc
 test -e htwolcpre1.h && mv htwolcpre1.h htwolcpre1.hh
 test -e htwolcpre2.h && mv htwolcpre2.h htwolcpre2.hh
 test -e htwolcpre3.h && mv htwolcpre3.h htwolcpre3.hh
-cd ../..
-cd parsers
-rm -f xfst-parser.cc
-rm -f xfst-parser.h
-make xfst-parser.cc
-test -e xfst-parser.h && mv xfst-parser.h xfst-parser.hh
-cd ../../..
+cd ../../../..
diff --git a/scripts/make-hfst-lexc.bat b/scripts/make-hfst-lexc.bat
index 2c59832..5a379ce 100644
--- a/scripts/make-hfst-lexc.bat
+++ b/scripts/make-hfst-lexc.bat
@@ -24,7 +24,6 @@ cl /EHsc /Zc:wchar_t /Fehfst-lexc.exe ^
 ..\..\tools\src\hfst-file-to-mem.cpp ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\hfst-lexc-compiler.cpp ^
@@ -42,6 +41,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -69,12 +71,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-hfst-proc.bat b/scripts/make-hfst-proc.bat
index b5831ca..65a40c2 100644
--- a/scripts/make-hfst-proc.bat
+++ b/scripts/make-hfst-proc.bat
@@ -27,7 +27,6 @@ cl /EHsc /Zc:wchar_t /Fehfst-proc.exe ^
 ..\..\tools\src\hfst-file-to-mem.cpp ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\hfst-proc\hfst-proc.cpp ^
@@ -52,6 +51,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -79,12 +81,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-hfst-tool.bat b/scripts/make-hfst-tool.bat
index ee2d15c..2d8e604 100644
--- a/scripts/make-hfst-tool.bat
+++ b/scripts/make-hfst-tool.bat
@@ -24,7 +24,6 @@ cl /EHsc /Zc:wchar_t /Fe%1.exe ^
 ..\..\tools\src\hfst-file-to-mem.cpp ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\%1.cpp ^
@@ -42,6 +41,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -69,12 +71,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-hfst-xfst.bat b/scripts/make-hfst-xfst.bat
index 7c15f7e..ec8af58 100644
--- a/scripts/make-hfst-xfst.bat
+++ b/scripts/make-hfst-xfst.bat
@@ -24,15 +24,9 @@ cl /EHsc /Zc:wchar_t /Fehfst-xfst.exe ^
 ..\..\tools\src\hfst-file-to-mem.cpp ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\parsers\hfst-xfst.cpp ^
-..\..\tools\src\parsers\XfstCompiler.cpp ^
-..\..\tools\src\parsers\xfst-lexer.cpp ^
-..\..\tools\src\parsers\xfst-parser.cpp ^
-..\..\tools\src\parsers\xfst-utils.cpp ^
-..\..\tools\src\parsers\xfst_help_message.cpp ^
 HfstApply.cpp ^
 HfstInputStream.cpp ^
 HfstTransducer.cpp ^
@@ -47,6 +41,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -74,12 +71,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-htwolcpre1.bat b/scripts/make-htwolcpre1.bat
index 8e03551..1309ee7 100644
--- a/scripts/make-htwolcpre1.bat
+++ b/scripts/make-htwolcpre1.bat
@@ -24,7 +24,6 @@ cl /EHsc /Zc:wchar_t /Fehtwolcpre1.exe ^
 /I..\..\tools\src\hfst-twolc\src\variable_src /I..\..\tools\src\hfst-twolc\src\string_src ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\hfst-twolc\src\htwolcpre1.cpp ^
@@ -50,6 +49,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -77,12 +79,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-htwolcpre2.bat b/scripts/make-htwolcpre2.bat
index f7795ba..c6165b7 100644
--- a/scripts/make-htwolcpre2.bat
+++ b/scripts/make-htwolcpre2.bat
@@ -23,7 +23,6 @@ cl /EHsc /Zc:wchar_t /Fehtwolcpre2.exe ^
 /I..\..\tools\src\hfst-twolc\src /I..\..\tools\src\hfst-twolc\src\commandline_src /I..\..\tools\src\hfst-twolc\src\io_src ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\hfst-twolc\src\htwolcpre2.cpp ^
@@ -44,6 +43,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -71,12 +73,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-htwolcpre3.bat b/scripts/make-htwolcpre3.bat
index db95b41..4843d93 100644
--- a/scripts/make-htwolcpre3.bat
+++ b/scripts/make-htwolcpre3.bat
@@ -24,7 +24,6 @@ cl /EHsc /Zc:wchar_t /Fehtwolcpre3.exe ^
 /I..\..\tools\src\hfst-twolc\src\alphabet_src /I..\..\tools\src\hfst-twolc\src\rule_src /I..\..\tools\src\hfst-twolc\src\string_src ^
 ..\..\tools\src\hfst-program-options.cpp ^
 ..\..\tools\src\hfst-string-conversions.cpp ^
-..\..\tools\src\HfstStrings2FstTokenizer.cpp ^
 ..\..\tools\src\hfst-tool-metadata.cpp ^
 ..\..\tools\src\hfst-getopt.cpp ^
 ..\..\tools\src\hfst-twolc\src\htwolcpre3.cpp ^
@@ -58,6 +57,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -85,12 +87,17 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/make-python-bindings.bat b/scripts/make-python-bindings.bat
index 63fed97..e119b1d 100644
--- a/scripts/make-python-bindings.bat
+++ b/scripts/make-python-bindings.bat
@@ -7,7 +7,7 @@ rem if "%1%"=="/DEBUG" SET debug_link=/DEBUG /release
 rem copy ..\..\back-ends\foma\libfoma.* .
 rem copy ..\..\back-ends\openfstwin\src\lib\openfst.* .
 
-if not exist libhfst_win.i echo Error: missing file "libhfst_win.i" && ^
+if not exist libhfst.i echo Error: missing file "libhfst.i" && ^
 exit /B 
 
 if not exist C:\python33\libs\python33.lib echo Error: missing file "C:\python33\libs\python33.lib" && ^
@@ -26,7 +26,7 @@ move ..\..\back-ends\foma\flags.c ..\..\back-ends\foma\_flags.c
 
 copy C:\python33\libs\python33.lib .
 
-C:\swigwin-3.0.5\swig.exe -python -c++ -I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" -Wall -o _libhfst.cpp libhfst_win.i
+C:\swigwin-3.0.5\swig.exe -python -c++ -I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" -Wall -o _libhfst.cpp libhfst.i
 
 cl /EHsc /LD /Fe_libhfst.pyd ^
 /D HAVE_FOMA /D HAVE_OPENFST /D HFSTEXPORT /D OPENFSTEXPORT /D_MSC_VER /DWINDOWS /DWIN32 ^
@@ -47,6 +47,9 @@ HfstExceptionDefs.cpp ^
 HarmonizeUnknownAndIdentitySymbols.cpp ^
 HfstLookupFlagDiacritics.cpp ^
 HfstEpsilonHandler.cpp ^
+HfstStrings2FstTokenizer.cpp ^
+HfstPrintDot.cpp ^
+HfstPrintPCKimmo.cpp ^
 implementations\HfstTransitionGraph.cpp ^
 implementations\ConvertTransducerFormat.cpp ^
 implementations\HfstTropicalTransducerTransitionData.cpp ^
@@ -74,12 +77,18 @@ parsers\pmatch_parse.cpp ^
 parsers\pmatch_lex.cpp ^
 parsers\lexc-parser.cpp ^
 parsers\lexc-lexer.cpp ^
+parsers\xfst-parser.cpp ^
+parsers\xfst-lexer.cpp ^
 parsers\LexcCompiler.cpp ^
 parsers\PmatchCompiler.cpp ^
 parsers\XreCompiler.cpp ^
+parsers\XfstCompiler.cpp ^
 parsers\lexc-utils.cpp ^
 parsers\pmatch_utils.cpp ^
 parsers\xre_utils.cpp ^
+parsers\xfst-utils.cpp ^
+parsers\xfst_help_message.cpp ^
+..\..\tools\src\hfst-string-conversions.cpp ^
 ..\..\back-ends\openfstwin\src\lib\compat.cpp ^
 ..\..\back-ends\openfstwin\src\lib\flags.cpp ^
 ..\..\back-ends\openfstwin\src\lib\fst.cpp ^
diff --git a/scripts/package-static-binaries.sh b/scripts/package-static-binaries.sh
index d140822..eea4624 100755
--- a/scripts/package-static-binaries.sh
+++ b/scripts/package-static-binaries.sh
@@ -28,4 +28,4 @@ cp tools/src/hfst-proc/.libs/hfst-apertium-proc $1/hfst-proc
 cp tools/src/hfst-twolc/src/.libs/htwolcpre1 $1/
 cp tools/src/hfst-twolc/src/.libs/htwolcpre2 $1/
 cp tools/src/hfst-twolc/src/.libs/htwolcpre3 $1/
-cp scripts/hfst-twolc-bin $1/hfst-twolc
+cp scripts/hfst-twolc $1/hfst-twolc
diff --git a/scripts/test-hfst-tools.bat b/scripts/test-hfst-tools.bat
index 6d05bad..2ba1e3e 100644
--- a/scripts/test-hfst-tools.bat
+++ b/scripts/test-hfst-tools.bat
@@ -25,7 +25,3 @@ hfst-pmatch2fst --verbose test.pmatch > pmatch.hfst
 echo ^^^^
 echo test hfst-pmatch manually and copy input from test_pmatch_result.txt
 echo ^^^^
-
-
-
-
diff --git a/scripts/test-libhfst.bat b/scripts/test-libhfst.bat
deleted file mode 100644
index 536c83d..0000000
--- a/scripts/test-libhfst.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-cl /EHsc /D_MSC_VER /DWINDOWS /DWIN32 test-libhfst.cpp /link libhfst.lib
-test-libhfst.exe
diff --git a/scripts/test-openfstwin.bat b/scripts/test-openfstwin.bat
deleted file mode 100644
index c8686a4..0000000
--- a/scripts/test-openfstwin.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-cl /EHsc /D_MSC_VER /DWINDOWS /DWIN32 /I..\include\ test-openfstwin.cpp /link openfst.lib
-test-openfstwin.exe
diff --git a/test/tools/Makefile.am b/test/tools/Makefile.am
index 2dc396f..bf362fb 100644
--- a/test/tools/Makefile.am
+++ b/test/tools/Makefile.am
@@ -161,6 +161,7 @@ TESTS += proc-functionality.sh
 endif
 
 TESTS += $(STRESSES)
+TESTS += mismatching-input-streams.sh
 
 # XFAIL_TESTS=incompatible-formats.sh latin-1-strings.sh
 
@@ -181,7 +182,7 @@ DEFAULT_CHECKS=0to3cats.hfst 2to4cats.hfst 4cats.hfst 4toINFcats.hfst \
 		   prunable_alphabet.hfst non_prunable_alphabet_1.hfst non_prunable_alphabet_2.hfst id.hfst \
 		   a2a_or_a2b_or_a2unk.hfst a2b_or_b2b_or_unk2b.hfst unk2unk_or_id.hfst \
 		   a_or_id.hfst id_star_a_b_c.hfst pmatch_endtag.pmatch
-OL_CHECKS=cat2dog.hfstol cat2dog.genhfstol cat_weight_final.hfstol \
+OL_CHECKS=cat2dog.hfstol cat2dog.genhfstol cat_weight_final.hfstol cat_weight_ambig.hfstol \
 			proc-caps.hfstol proc-caps.genhfstol \
 			compounds.hfstol compounds2.hfstol
 if WANT_SFST
@@ -202,7 +203,7 @@ SFST_CHECKS=0to3cats.sfst 2to4cats.sfst 4cats.sfst\
 			ab_shuffle_bc.sfst id_shuffle_id.sfst aid_shuffle_idb.sfst \
 			prunable_alphabet.sfst non_prunable_alphabet_1.sfst non_prunable_alphabet_2.sfst id.sfst \
 			a2a_or_a2b_or_a2unk.sfst a2b_or_b2b_or_unk2b.sfst unk2unk_or_id.sfst \
-			a_or_id.sfst id_star_a_b_c.sfst epsilon.sfst another_epsilon.sfst
+			a_or_id.sfst id_star_a_b_c.sfst epsilon.sfst another_epsilon.sfst substituting_transducer.sfst substituted_transducer.sfst
 endif
 if WANT_OPENFST
 OFST_CHECKS=0to3cats.ofst \
@@ -223,7 +224,7 @@ OFST_CHECKS=0to3cats.ofst \
 			ab_shuffle_bc.ofst id_shuffle_id.ofst aid_shuffle_idb.ofst \
 			prunable_alphabet.ofst non_prunable_alphabet_1.ofst non_prunable_alphabet_2.ofst id.ofst \
 			a2a_or_a2b_or_a2unk.ofst a2b_or_b2b_or_unk2b.ofst unk2unk_or_id.ofst \
-			a_or_id.ofst id_star_a_b_c.ofst epsilon.ofst another_epsilon.ofst
+			a_or_id.ofst id_star_a_b_c.ofst epsilon.ofst another_epsilon.ofst substituting_transducer.ofst substituted_transducer.ofst
 endif
 if WANT_FOMA
 FOMA_CHECKS=0to3cats.foma 2to4cats.foma 4cats.foma \
@@ -243,12 +244,12 @@ FOMA_CHECKS=0to3cats.foma 2to4cats.foma 4cats.foma \
 			ab_shuffle_bc.foma id_shuffle_id.foma aid_shuffle_idb.foma \
 			prunable_alphabet.foma non_prunable_alphabet_1.foma non_prunable_alphabet_2.foma id.foma \
 			a2a_or_a2b_or_a2unk.foma a2b_or_b2b_or_unk2b.foma unk2unk_or_id.foma \
-			a_or_id.foma id_star_a_b_c.foma epsilon.foma another_epsilon.foma
+			a_or_id.foma id_star_a_b_c.foma epsilon.foma another_epsilon.foma substituting_transducer.foma substituted_transducer.foma
 endif
 
 check_DATA=$(DEFAULT_CHECKS) $(SFST_CHECKS) $(OFST_CHECKS) $(FOMA_CHECKS) $(OL_CHECKS)
 
-FST_TXTS=0to3cats.txt 2to4cats.txt 4cats.txt 4toINFcats.txt \
+FST_TXTS=0to3cats.txt 2to4cats.txt 4cats.txt 4toINFcats.txt cat_weight_ambig.txt \
 		 cat2cat_or_CAT_uppercased.txt cat2CAT_uppercased.txt \
 		 cat2epsilon.txt another_epsilon.txt cat2dog.txt \
 		 cat+dog.txt catdog.txt cat_or_dog.txt cat.txt CAT_uppercased2cat.txt \
@@ -265,7 +266,8 @@ FST_TXTS=0to3cats.txt 2to4cats.txt 4cats.txt 4toINFcats.txt \
 		 compounds.txt compounds2.txt \
 		 id_shuffle_id.txt aid_shuffle_idb.txt \
 		 prunable_alphabet.txt non_prunable_alphabet_1.txt non_prunable_alphabet_2.txt id.txt unk2unk_or_id.txt \
-		 a2a_or_a2b_or_a2unk.txt a2b_or_b2b_or_unk2b.txt a_or_id.txt id_star_a_b_c.txt
+		 a2a_or_a2b_or_a2unk.txt a2b_or_b2b_or_unk2b.txt a_or_id.txt id_star_a_b_c.txt \
+		 substituting_transducer.txt substituted_transducer.txt
 FST_STRINGS=cat.strings proc-caps-in.strings proc-caps-gen.strings \
 			proc-caps-out1.strings proc-caps-out2.strings \
 			proc-caps-out3.strings proc-caps-out4.strings \
@@ -274,7 +276,10 @@ FST_STRINGS=cat.strings proc-caps-in.strings proc-caps-gen.strings \
 			proc-compounds-out.strings proc-compounds.strings \
 			proc-compounds2-out.strings proc-compounds2.strings \
 			utf-8.strings latin-1.strings \
-			cat2dog.strings heavycat.strings
+			cat2dog.strings heavycat.strings \
+			cat_weight_ambig_out.strings cat_weight_ambig_W_out.strings \
+			proc-cat-NUL.strings cat_cat.strings cat_weight_ambig_xerox.strings \
+			cat_weight_ambig_W_xerox.strings cat_weight_ambig_W1_xerox.strings
 FST_PAIRS=cat2dog.pairs
 FST_PAIRSTRINGS=cat2dog.pairstring
 FST_SPACESTRINGS=cat2dog.spaces
@@ -343,7 +348,7 @@ ALL_SRCS=$(FST_TXTS) $(FST_STRINGS) $(FST_PAIRS) $(FST_PAIRSTRINGS) \
 .txt.pmatch:
 	${top_builddir}/tools/src/hfst-pmatch2fst $< > $@
 
-EXTRA_FILES=cat2dog.substitute cat.strings cat.txt cats_and_dogs.xre utf-8.strings latin-1.strings c_a_t.strings dos.strings not-contains-a.xre not-contains-a-comment-emptyline.xre parallel-left-arrow-multicom-emptyline.xre  parallel-left-arrow.xre cat.prolog
+EXTRA_FILES=cat2dog.substitute cat.strings cat.txt cats_and_dogs.xre utf-8.strings latin-1.strings c_a_t.strings dos.strings not-contains-a.xre not-contains-a-comment-emptyline.xre parallel-left-arrow-multicom-emptyline.xre  parallel-left-arrow.xre cat.prolog negative_epsilon_cycles.txt no_negative_epsilon_cycles.txt substituting_transducer.txt substituted_transducer.txt
 
 RESULT_FILES=basic.cat-dog-bird.lexc.flag.result \
 basic.cat-dog-bird.lexc.result \
diff --git a/test/tools/cat_cat.strings b/test/tools/cat_cat.strings
new file mode 100644
index 0000000..a575d25
--- /dev/null
+++ b/test/tools/cat_cat.strings
@@ -0,0 +1 @@
+cat cat
diff --git a/test/tools/cat_weight_ambig.txt b/test/tools/cat_weight_ambig.txt
new file mode 100644
index 0000000..76b4054
--- /dev/null
+++ b/test/tools/cat_weight_ambig.txt
@@ -0,0 +1,7 @@
+0	1	c	c	0.000000
+1	2	a	a	0.000000
+2	3	t	t	0.000000
+3	4	@0@	+	0.000000
+4	5	@0@	n	1.000000
+5	0.000000
+4	5	@0@	v	2.000000
diff --git a/test/tools/cat_weight_ambig_W1_xerox.strings b/test/tools/cat_weight_ambig_W1_xerox.strings
new file mode 100644
index 0000000..3171b56
--- /dev/null
+++ b/test/tools/cat_weight_ambig_W1_xerox.strings
@@ -0,0 +1,4 @@
+cat	cat+n	1
+
+cat	cat+n	1
+
diff --git a/test/tools/cat_weight_ambig_W_out.strings b/test/tools/cat_weight_ambig_W_out.strings
new file mode 100644
index 0000000..7b60da1
--- /dev/null
+++ b/test/tools/cat_weight_ambig_W_out.strings
@@ -0,0 +1 @@
+^cat/cat+n~1~/cat+v~2~$
diff --git a/test/tools/cat_weight_ambig_W_xerox.strings b/test/tools/cat_weight_ambig_W_xerox.strings
new file mode 100644
index 0000000..c41cf18
--- /dev/null
+++ b/test/tools/cat_weight_ambig_W_xerox.strings
@@ -0,0 +1,6 @@
+cat	cat+n	1
+cat	cat+v	2
+
+cat	cat+n	1
+cat	cat+v	2
+
diff --git a/test/tools/cat_weight_ambig_out.strings b/test/tools/cat_weight_ambig_out.strings
new file mode 100644
index 0000000..8ddaea6
--- /dev/null
+++ b/test/tools/cat_weight_ambig_out.strings
@@ -0,0 +1 @@
+^cat/cat+n$
diff --git a/test/tools/cat_weight_ambig_xerox.strings b/test/tools/cat_weight_ambig_xerox.strings
new file mode 100644
index 0000000..bef7940
--- /dev/null
+++ b/test/tools/cat_weight_ambig_xerox.strings
@@ -0,0 +1,6 @@
+cat	cat+n
+cat	cat+v
+
+cat	cat+n
+cat	cat+v
+
diff --git a/test/tools/cats_and_dogs.xre b/test/tools/cats_and_dogs.xre
index 06e634e..557d5b0 100644
--- a/test/tools/cats_and_dogs.xre
+++ b/test/tools/cats_and_dogs.xre
@@ -2,4 +2,4 @@ c a t
 c a t | d o g
 c:d a:o t:g
 c:d::1 a:o::2 g:t::3
-c a t ;	3.141
+! Not supported any more: c a t ;	3.141
diff --git a/test/tools/lexc-compiler-functionality.sh b/test/tools/lexc-compiler-functionality.sh
index 20d8ff8..2fe2351 100755
--- a/test/tools/lexc-compiler-functionality.sh
+++ b/test/tools/lexc-compiler-functionality.sh
@@ -19,9 +19,9 @@ LEXCTESTS="basic.cat-dog-bird.lexc basic.colons.lexc basic.comments.lexc
           xre.definitions.lexc xre.months.lexc xre.nested-definitions.lexc 
           xre.numeric-star.lexc xre.sharp.lexc xre.quotations.lexc
           xre.star-plus-optional.lexc
-          xre.any-variations.lexc
-          no-newline-before-sublexicon.lexc"
+          no-newline-before-sublexicon.lexc xre.any-variations.lexc"
 
+          # xre.any-variations.lexc # - hfst works file, foma's eliminate_flags removes valid paths (hfst-compare -e)
           # basic.end.lexc -hfst doesn't parse till end
           # xre.any-variations.lexc -foma ?:? problem
           # basic.multichar-symbol-with-0.lexc  - hfst works fine, foma wrong
@@ -123,7 +123,7 @@ for i in .sfst .ofst .foma ; do
            
          #echo "comparing flag file: $f"
          if ! $TOOLDIR/hfst-compare -e -s $RESULT.tmp test ; then
-             echo "results differ: $f"
+             echo "flag results differ: $f: "$RESULT".tmp != test"
              exit 1
          fi
         rm $RESULT.tmp
diff --git a/test/tools/mismatching-input-streams.sh b/test/tools/mismatching-input-streams.sh
new file mode 100755
index 0000000..047fd2a
--- /dev/null
+++ b/test/tools/mismatching-input-streams.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+TOOLDIR=../../tools/src
+
+TOOLS="hfst-disjunct hfst-concatenate hfst-conjunct hfst-subtract hfst-compose hfst-shuffle"
+# TODO: hfst-compose-intersect, hfst-substitute, hfst-xfst?
+NORMOPT="--silent"
+STRICTOPT="--silent --do-not-convert"
+
+for type1 in sfst ofst foma;
+do
+    for type2 in sfst ofst foma;
+    do
+        for tool in $TOOLS;
+        do
+            # only test inputs that have mismatching types
+            if (test "$type1" != "$type2"); then
+                if (ls $TOOLDIR/$tool > /dev/null 2> /dev/null); then
+                    # echo "$tool"
+                    if ($TOOLDIR/hfst-format --list-formats | grep $type1 > /dev/null); then
+                        if ($TOOLDIR/hfst-format --list-formats | grep $type2 > /dev/null); then
+                            # (1) two transducers
+                            if test -f cat.$type1 -a -f dog.$type2; then
+                                # echo "  $type1, $type2"
+                                # echo "    normal"
+                                if ! $TOOLDIR/$tool $NORMOPT cat.$type1 dog.$type2 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                                # echo "    strict"
+                                if $TOOLDIR/$tool $STRICTOPT cat.$type1 dog.$type2 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                            fi
+                            if test -f cat.$type2 -a -f dog.$type1; then
+                                # echo "  $type2, $type1"
+                                # echo "    normal"
+                                if ! $TOOLDIR/$tool $NORMOPT cat.$type2 dog.$type1 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                                # echo "    strict"
+                                if $TOOLDIR/$tool $STRICTOPT cat.$type2 dog.$type1 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                            fi
+                            # (2) archives of transducers with equal length
+                            if test -f cat.$type1 -a -f cat.$type2 -a -f dog.$type1 -a -f dog.$type2; then
+                                cat cat.$type1 dog.$type1 > test1
+                                cat cat.$type2 dog.$type2 > test2
+                                # echo "  archive $type1, archive $type2"
+                                # echo "    normal"
+                                if ! $TOOLDIR/$tool $NORMOPT test1 test2 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                                # echo "    strict"
+                                if $TOOLDIR/$tool $STRICTOPT test1 test2 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                            fi
+                            # (3) archives of transducers with different lengths
+                            if test -f cat.$type1 -a -f cat.$type2 -a -f dog.$type1 -a -f dog.$type2; then
+                                cat cat.$type1 dog.$type1 cat.$type1 dog.$type1 > test1
+                                cat cat.$type2 > test2
+                                # echo "  archive $type1, $type2"
+                                # echo "    normal"
+                                if ! $TOOLDIR/$tool $NORMOPT test1 test2 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                                # echo "    strict"
+                                if $TOOLDIR/$tool $STRICTOPT test1 test2 > test 2> /dev/null ; then
+                                    exit 1
+                                fi
+                            fi
+                        fi
+                    fi
+                fi
+            fi
+        done
+    done
+done
+
+rm test
+
diff --git a/test/tools/negative_epsilon_cycles.txt b/test/tools/negative_epsilon_cycles.txt
new file mode 100644
index 0000000..35a0904
--- /dev/null
+++ b/test/tools/negative_epsilon_cycles.txt
@@ -0,0 +1,8 @@
+0 0 @0@ @0@ -1
+0
+--
+0 1 @0@ @0@ 2
+0
+1 0 @0@ @0@ -3
+1 2 @0@ @0@ -2
+2 1 @0@ @0@ 3
diff --git a/test/tools/no_negative_epsilon_cycles.txt b/test/tools/no_negative_epsilon_cycles.txt
new file mode 100644
index 0000000..1da2dbf
--- /dev/null
+++ b/test/tools/no_negative_epsilon_cycles.txt
@@ -0,0 +1,8 @@
+0 0 @0@ @0@ 0.1
+0
+--
+0 1 @0@ @0@ -3
+0
+1 0 @0@ @0@ 4
+1 2 @0@ @0@ -2
+2 1 @0@ @0@ 3
diff --git a/test/tools/pmatch-functionality.sh b/test/tools/pmatch-functionality.sh
index cdc5a95..b4d6e2e 100755
--- a/test/tools/pmatch-functionality.sh
+++ b/test/tools/pmatch-functionality.sh
@@ -21,10 +21,14 @@ rm test.pmatch
 
 # Jyrki's suite
 if ! $srcdir/pmatch-tests.sh --log none; then
-    rm $srcdir/pmatch-tests.sh.*
+    if [ -e $srcdir/pmatch-tests.sh.* ]; then
+        rm $srcdir/pmatch-tests.sh.*
+    fi
     exit 77
     # Pending stabilisation of various things the suite fails, so we pretend
     # we skipped it
 fi
 
-rm $srcdir/pmatch-tests.sh.*
+if [ -e $srcdir/pmatch-tests.sh.* ]; then
+    rm $srcdir/pmatch-tests.sh.*
+fi
diff --git a/test/tools/proc-caps-out1.strings b/test/tools/proc-caps-out1.strings
index a1ad8fc..6d73284 100644
--- a/test/tools/proc-caps-out1.strings
+++ b/test/tools/proc-caps-out1.strings
@@ -1,6 +1,6 @@
 ^test/test+n$
-^Test/Test+n/Test+nlp/Test+np$
-^TEST/TEST+n/TEST+nlp/TEST+np$
-^TeSt/Test+n/Test+nlp/Test+np$
+^Test/Test+np/Test+n/Test+nlp$
+^TEST/TEST+np/TEST+n/TEST+nlp$
+^TeSt/Test+np/Test+n/Test+nlp$
 ^tesT/test+n$
-^TEst/Test+n/Test+nlp/Test+np$
+^TEst/Test+np/Test+n/Test+nlp$
diff --git a/test/tools/proc-caps-out3.strings b/test/tools/proc-caps-out3.strings
index 0f8e40c..a41c1ad 100644
--- a/test/tools/proc-caps-out3.strings
+++ b/test/tools/proc-caps-out3.strings
@@ -1,5 +1,5 @@
 ^test/test+n$
-^Test/Test+nlp/Test+np$
+^Test/Test+np/Test+nlp$
 ^TEST/*TEST$
 ^TeSt/*TeSt$
 ^tesT/*tesT$
diff --git a/test/tools/proc-cat-NUL.strings b/test/tools/proc-cat-NUL.strings
new file mode 100644
index 0000000..24a662d
Binary files /dev/null and b/test/tools/proc-cat-NUL.strings differ
diff --git a/test/tools/proc-functionality.sh b/test/tools/proc-functionality.sh
index 33922e1..75dbb74 100755
--- a/test/tools/proc-functionality.sh
+++ b/test/tools/proc-functionality.sh
@@ -86,6 +86,67 @@ if ! diff test.strings $srcdir/proc-caps-out5.strings ; then
     exit 1
 fi
 
+# Xerox format tests:
+if ! $TOOLDIR/hfst-proc/hfst-apertium-proc --xerox cat_weight_ambig.hfstol < $srcdir/cat_cat.strings | tr -d '\r' > test.strings ; then
+    echo xeroc fail:
+    cat test.strings
+    exit 1
+fi
+if ! diff test.strings $srcdir/cat_weight_ambig_xerox.strings ; then
+    echo xerox cat_weight_ambig diffs
+    exit 1
+fi
+if ! $TOOLDIR/hfst-proc/hfst-apertium-proc -W --xerox cat_weight_ambig.hfstol < $srcdir/cat_cat.strings | tr -d '\r' > test.strings ; then
+    echo xeroc -W fail:
+    cat test.strings
+    exit 1
+fi
+if ! diff test.strings $srcdir/cat_weight_ambig_W_xerox.strings ; then
+    echo xerox cat_weight_ambig_W diffs
+    exit 1
+fi
+if ! $TOOLDIR/hfst-proc/hfst-apertium-proc -W --weight-classes 1 --xerox cat_weight_ambig.hfstol < $srcdir/cat_cat.strings | tr -d '\r' > test.strings ; then
+    echo xeroc -W --weight-classes 1 fail:
+    cat test.strings
+    exit 1
+fi
+if ! diff test.strings $srcdir/cat_weight_ambig_W1_xerox.strings ; then
+    echo xerox --weight-classes 1 cat_weight_ambig_W diffs
+    exit 1
+fi
+
+# weight-classes checks
+if ! $TOOLDIR/hfst-proc/hfst-apertium-proc --weight-classes 1 cat_weight_ambig.hfstol < $srcdir/cat.strings | tr -d '\r' > test.strings ; then
+    echo cat_weight_ambig fail:
+    cat test.strings
+    exit 1
+fi
+if ! diff test.strings $srcdir/cat_weight_ambig_out.strings ; then
+    echo cat_weight_ambig diffs
+    exit 1
+fi
+if ! $TOOLDIR/hfst-proc/hfst-apertium-proc --weight-classes 2 -W cat_weight_ambig.hfstol < $srcdir/cat.strings | tr -d '\r' > test.strings ; then
+    echo cat_weight_ambig_W fail:
+    cat test.strings
+    exit 1
+fi
+if ! diff test.strings $srcdir/cat_weight_ambig_W_out.strings ; then
+    echo cat_weight_ambig_W diffs
+    exit 1
+fi
+
+# NUL flush checks
+if ! printf 'cat.[][\n]\0cat.[][\n]\0' | $TOOLDIR/hfst-proc/hfst-apertium-proc -z cat2dog.hfstol | tr -d '\r' > test.strings ; then
+    echo NUL flush fail:
+    cat test.strings
+    exit 1
+fi
+if ! diff test.strings $srcdir/proc-cat-NUL.strings ; then
+    echo NUL flush diffs
+    exit 1
+fi
+
+
 # compounding / space handling checks
 if ! $TOOLDIR/hfst-proc/hfst-apertium-proc compounds.hfstol < $srcdir/proc-compounds.strings | tr -d '\r' > test.strings ; then
     echo compound fail
diff --git a/test/tools/regexp2fst-functionality.sh b/test/tools/regexp2fst-functionality.sh
index 43b0915..0d47cbb 100755
--- a/test/tools/regexp2fst-functionality.sh
+++ b/test/tools/regexp2fst-functionality.sh
@@ -48,6 +48,29 @@ for i in sfst openfst-tropical foma; do
         exit 1
     fi
 
+    # Empty input and input containing only comments
+    if (echo "" | $TOOLDIR/hfst-regexp2fst -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+    if (echo "" | $TOOLDIR/hfst-regexp2fst -S -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+    if (echo ";" | $TOOLDIR/hfst-regexp2fst -S -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+    if (echo "! A comment" | $TOOLDIR/hfst-regexp2fst -S -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+    if (echo "  ! A comment" | $TOOLDIR/hfst-regexp2fst -S -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+    if (echo "! A comment" | $TOOLDIR/hfst-regexp2fst -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+    if (echo "  ! A comment" | $TOOLDIR/hfst-regexp2fst -f $i > test.fst 2> /dev/null) ; then
+        exit 1
+    fi
+
 done
 
 rm -f test.fst
diff --git a/test/tools/substitute-functionality.sh b/test/tools/substitute-functionality.sh
index bb01290..06e711f 100755
--- a/test/tools/substitute-functionality.sh
+++ b/test/tools/substitute-functionality.sh
@@ -35,5 +35,15 @@ if ((test -z "$i") || $TOOLDIR/hfst-format --list-formats | grep $i > /dev/null)
         fi
         rm test
     fi
+    # Disable test until option -T works in hfst-substitute
+    #if test -f cat$i -a -f substituted_transducer$i -a -f substituting_transducer$i; then
+    #    if ! $TOOLDIR/hfst-substitute -s cat$i -f 'a:a' -T $srcdir/substituting_transducer$i > test ; then
+    #        exit 1
+    #    fi
+    #    if ! $TOOLDIR/hfst-compare -s test substituted_transducer$i  ; then
+    #        exit 1
+    #    fi
+    #    rm test
+    #fi
 fi
 done
diff --git a/test/tools/substituted_transducer.txt b/test/tools/substituted_transducer.txt
new file mode 100644
index 0000000..a695c12
--- /dev/null
+++ b/test/tools/substituted_transducer.txt
@@ -0,0 +1,6 @@
+0 1 c c
+1 2 c c
+2 3 a a
+3 4 t t
+4 5 t t
+5
diff --git a/test/tools/substituting_transducer.txt b/test/tools/substituting_transducer.txt
new file mode 100644
index 0000000..b864e1f
--- /dev/null
+++ b/test/tools/substituting_transducer.txt
@@ -0,0 +1,4 @@
+0 1 c d
+1 2 a o
+2 3 t g
+3
diff --git a/test/tools/txt2fst-functionality.sh b/test/tools/txt2fst-functionality.sh
index c5c514b..e9bddfa 100755
--- a/test/tools/txt2fst-functionality.sh
+++ b/test/tools/txt2fst-functionality.sh
@@ -30,3 +30,12 @@ if ((test -z "$i") || $TOOLDIR/hfst-format --list-formats | grep $i > /dev/null)
     fi
 fi
 done
+
+$TOOLDIR/hfst-txt2fst -C -f openfst-tropical -i negative_epsilon_cycles.txt > /dev/null 2> test;
+if ! test `grep 'warning' test | wc -l` = '2'; then
+    exit 1
+fi
+$TOOLDIR/hfst-txt2fst -C -f openfst-tropical -i no_negative_epsilon_cycles.txt > /dev/null 2> test;
+if ! test `grep 'warning' test | wc -l` = '0'; then
+    exit 1
+fi
diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am
index 226d936..a03ad00 100644
--- a/tools/src/Makefile.am
+++ b/tools/src/Makefile.am
@@ -191,7 +191,7 @@ noinst_HEADERS= \
 	inc/getopt-cases-common.h inc/getopt-cases-error.h  \
 	inc/getopt-cases-unary.h  inc/globals-binary.h      \
 	inc/globals-common.h      inc/globals-unary.h \
-	HfstStrings2FstTokenizer.h hfst-file-to-mem.h \
+	hfst-file-to-mem.h \
 	hfst-string-conversions.h \
 	hfst-tool-metadata.h hfst-optimized-lookup.h \
 	guessify_fst.h generate_model_forms.h
@@ -266,9 +266,8 @@ hfst_lexc_SOURCES=hfst-lexc-compiler.cc $(HFST_COMMON_SRC)
 #					  parsers/LexcCompiler.h parsers/lexc-utils.h
 #hfst_lexc2fst_BUILT=parsers/lexc-parser.h parsers/xre_parse.h
 hfst_lookup_SOURCES=hfst-lookup.cc $(HFST_COMMON_SRC) \
-HfstStrings2FstTokenizer.cc hfst-string-conversions.cc
-hfst_pair_test_SOURCES=hfst-pair-test.cc $(HFST_COMMON_SRC) \
-HfstStrings2FstTokenizer.cc 
+hfst-string-conversions.cc
+hfst_pair_test_SOURCES=hfst-pair-test.cc $(HFST_COMMON_SRC) 
 hfst_minimize_SOURCES=hfst-minimize.cc $(HFST_COMMON_SRC)
 hfst_name_SOURCES=hfst-name.cc $(HFST_COMMON_SRC)
 hfst_optimized_lookup_SOURCES=hfst-optimized-lookup.cc
@@ -287,8 +286,7 @@ hfst_reverse_SOURCES=hfst-reverse.cc $(HFST_COMMON_SRC)
 hfst_reweight_SOURCES=hfst-reweight.cc $(HFST_COMMON_SRC)
 hfst_shuffle_SOURCES=hfst-shuffle.cc $(HFST_COMMON_SRC)
 hfst_split_SOURCES=hfst-split.cc $(HFST_COMMON_SRC)
-hfst_strings2fst_SOURCES=hfst-strings2fst.cc $(HFST_COMMON_SRC) \
-HfstStrings2FstTokenizer.cc
+hfst_strings2fst_SOURCES=hfst-strings2fst.cc $(HFST_COMMON_SRC)
 #hfst_strip_header_SOURCES=hfst-strip-header.cc $(HFST_COMMON_SRC)
 hfst_substitute_SOURCES=hfst-substitute.cc $(HFST_COMMON_SRC)
 hfst_subtract_SOURCES=hfst-subtract.cc $(HFST_COMMON_SRC)
diff --git a/tools/src/hfst-commandline.cc b/tools/src/hfst-commandline.cc
index b92f12a..e970374 100644
--- a/tools/src/hfst-commandline.cc
+++ b/tools/src/hfst-commandline.cc
@@ -185,6 +185,52 @@ verbose_printf(const char* fmt, ...)
     }
 }
 
+int
+conversion_type(hfst::ImplementationType type1, hfst::ImplementationType type2)
+{
+  if (type1 == type2)
+    return 0;
+  if (hfst::HfstTransducer::is_safe_conversion(type2, type1))
+    return 1;
+  else if (hfst::HfstTransducer::is_safe_conversion(type1, type2))
+    return 2;
+  else
+    return -1;
+}
+
+void
+convert_transducers(hfst::HfstTransducer & first, hfst::HfstTransducer & second)
+{
+  hfst::ImplementationType type1 = first.get_type();
+  hfst::ImplementationType type2 = second.get_type();
+  int ct = conversion_type(type1, type2);
+
+  if (ct == 0)
+    return;
+  else if (ct == 1)
+    {
+      verbose_printf("warning: transducers have different types, converting to format %s\n", 
+                     hfst_strformat(type1));
+      second.convert(type1);
+    }
+  else if (ct == 2)
+    {
+      verbose_printf("warning: transducers have different types, converting to format %s\n", 
+                     hfst_strformat(type2));
+      first.convert(type2);
+    }
+  else if (ct == -1)
+    {
+      verbose_printf("warning: transducers have different types, converting to format %s,"
+                     " loss of information is possible\n", hfst_strformat(type1));
+      second.convert(type1);
+    }
+  else /* This should not happen. */
+    HFST_THROW_MESSAGE(HfstFatalException, "convert_transducers: conversion_type returned an invalid integer");
+
+  return;
+}
+
 bool
 is_input_stream_in_ol_format(const hfst::HfstInputStream * is, const char * program)
 {
diff --git a/tools/src/hfst-commandline.h b/tools/src/hfst-commandline.h
index 39ad821..1ff2ef1 100644
--- a/tools/src/hfst-commandline.h
+++ b/tools/src/hfst-commandline.h
@@ -97,6 +97,18 @@ void hfst_set_program_name(const char* argv0, const char* version,
 
 bool is_input_stream_in_ol_format(const hfst::HfstInputStream * is, const char * program);
 
+/* Common format into which transducers of types \a type1 and \a type2 will be converted,
+   when convert_transducers will be called. Possible return values are:
+
+   0   no conversion is needed
+   1   convert into type1
+   2   convert into type2
+   -1  convert into type1, loss of information is possible */
+int conversion_type(hfst::ImplementationType type1, hfst::ImplementationType type2);
+
+/* Convert transducers into common format, if needed. */
+void convert_transducers(hfst::HfstTransducer & first, hfst::HfstTransducer & second);
+
 /** 
  * @brief set @c program_name to program's executable name for error messages.
  */
diff --git a/tools/src/hfst-compare.cc b/tools/src/hfst-compare.cc
index 9f22cc9..71d7d8b 100644
--- a/tools/src/hfst-compare.cc
+++ b/tools/src/hfst-compare.cc
@@ -154,11 +154,13 @@ compare_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
         char* secondname = strdup(second->get_name().c_str());
         if (strlen(firstname) == 0)
           {
+            free(firstname);
             firstname = strdup(firstfilename);
           }
         if (strlen(secondname) == 0)
           {
-           secondname = strdup(secondfilename);
+            free(secondname);
+            secondname = strdup(secondfilename);
           } 
         if (transducer_n_first == 1)
           {
@@ -232,6 +234,9 @@ compare_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
             delete second;
             second=0;
           }
+
+        free(firstname);
+        free(secondname);
     }
     
     if (firststream.is_good())
diff --git a/tools/src/hfst-compose-intersect.cc b/tools/src/hfst-compose-intersect.cc
index 2a654ea..7595eaf 100644
--- a/tools/src/hfst-compose-intersect.cc
+++ b/tools/src/hfst-compose-intersect.cc
@@ -256,21 +256,47 @@ void harmonize_rules(HfstTransducer & lexicon, std::vector<HfstTransducer> & rul
 }
 
 int
-compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                HfstOutputStream& outstream)
+compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
+  // there must be at least one transducer in both input streams
+  //bool continueReading = firststream.is_good() && secondstream.is_good();
+
+  hfst::ImplementationType type1 = firststream.get_type();
+  hfst::ImplementationType type2 = secondstream.get_type();
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+  if (type1 != type2)
+    {
+      if (allow_transducer_conversion)
+        {
+          int ct = conversion_type(type1, type2);
+          std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+          if (ct == 1)
+            { warnstr.append("using former type as output"); output_type = type1; }
+          else if (ct == 2)
+            { warnstr.append("using latter type as output"); output_type = type2; }
+          else if (ct == -1)
+            { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+          else /* should not happen */
+            { throw "Error: hfst-compose-intersect: conversion_type returned an invalid integer"; }
+          warning(0, 0, warnstr.c_str());
+        }
+      else
+        {
+          error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                "formats %s and %s are not compatible for compose-intersect (--do-not-convert was requested)",
+                firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+        }
+    }
+  else
+    {
+      output_type = type1;
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
+
     bool bothInputs = firststream.is_good() && secondstream.is_good();
     (void)bothInputs;
-    if (firststream.get_type() != secondstream.get_type())
-      {
-        warning(0, 0, "Transducer type mismatch in %s and %s "
-                "(types %s and %s);\n"
-                "using type %s as output",
-                firstfilename, secondfilename,
-                hfst_strformat(firststream.get_type()),
-                hfst_strformat(secondstream.get_type()),
-                hfst_strformat(secondstream.get_type()));
-      }
 
     if ( is_input_stream_in_ol_format(&firststream, "hfst-compose-intersect") ||
          is_input_stream_in_ol_format(&secondstream, "hfst-compose-intersect") )
@@ -278,12 +304,12 @@ compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
         return EXIT_FAILURE;
       }
 
-
     HfstTransducerVector rules;
     size_t rule_n = 1;  
 
     while (secondstream.is_good()) {
       HfstTransducer rule(secondstream);
+      rule.convert(output_type);
       const char* rulename = rule.get_name().c_str();
       if (strlen(rulename) > 0)
         {
@@ -314,6 +340,7 @@ compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
       {
         verbose_printf("Reading lexicon...");
         HfstTransducer lexicon(firststream);
+        lexicon.convert(output_type);
         char* lexiconname = hfst_get_name(lexicon, firstfilename);
         verbose_printf(" %s read\n", lexiconname);
      
@@ -440,14 +467,10 @@ int main( int argc, char **argv ) {
         error(EXIT_FAILURE, 0, "%s is not a valid transducer file",
               secondfilename);
     }
-    HfstOutputStream* outstream = (outfile != stdout) ?
-        new HfstOutputStream(outfilename, firststream->get_type()) :
-        new HfstOutputStream(firststream->get_type());
 
-    retval = compose_streams(*firststream, *secondstream, *outstream);
+    retval = compose_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
-    delete outstream;
     free(firstfilename);
     free(secondfilename);
     free(outfilename);
diff --git a/tools/src/hfst-compose.cc b/tools/src/hfst-compose.cc
index bcb0573..d801c83 100644
--- a/tools/src/hfst-compose.cc
+++ b/tools/src/hfst-compose.cc
@@ -73,6 +73,8 @@ print_usage()
         print_common_binary_program_parameter_instructions(message_out);
         fprintf(message_out, "\n");
         fprintf(message_out, "Xfst variables are {flag-is-epsilon (default OFF)}.\n");
+        fprintf(message_out, "VALUE can be one of the following: [true|false], [yes|no] or [ON|OFF],\n");
+        fprintf(message_out, "false being the default.\n");
         fprintf(message_out,
             "\n"
             "Examples:\n"
@@ -166,17 +168,45 @@ parse_options(int argc, char** argv)
 }
 
 int
-compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                HfstOutputStream& outstream)
+compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
-    // there must be at least one transducer in both input streams
-    bool continueReading = firststream.is_good() && secondstream.is_good();
-    if (firststream.get_type() != secondstream.get_type())
-      {
-        warning(0, 0, "Tranducer type mismatch in %s and %s; "
-              "using former type as output\n",
-              firstfilename, secondfilename);
-      }
+  // there must be at least one transducer in both input streams
+  bool continueReading = firststream.is_good() && secondstream.is_good();
+
+  hfst::ImplementationType type1 = firststream.get_type();
+  hfst::ImplementationType type2 = secondstream.get_type();
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+  if (type1 != type2)
+    {
+      if (allow_transducer_conversion)
+        {
+          int ct = conversion_type(type1, type2);
+          std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+          if (ct == 1)
+            { warnstr.append("using former type as output"); output_type = type1; }
+          else if (ct == 2)
+            { warnstr.append("using latter type as output"); output_type = type2; }
+          else if (ct == -1)
+            { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+          else /* should not happen */
+            { throw "Error: hfst-compose: conversion_type returned an invalid integer"; }
+          warning(0, 0, warnstr.c_str());
+        }
+      else
+        {
+          error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                "formats %s and %s are not compatible for composition (--do-not-convert was requested)",
+                firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+        }
+    }
+  else
+    {
+      output_type = type1;
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
+
     HfstTransducer * first=0;
     HfstTransducer * second=0;
     size_t transducer_n_first = 0; // transducers read from first stream
@@ -207,7 +237,6 @@ compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
                            firstname, secondname, transducer_n_first);
         }
 
-        try {
         if (first->has_flag_diacritics() or second->has_flag_diacritics()) 
           {
             if (not harmonize_flags)
@@ -221,24 +250,54 @@ compose_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
               }
             else
               {
-                first->harmonize_flag_diacritics(*second);
+                try 
+                  {
+                    first->harmonize_flag_diacritics(*second);
+                  }
+                catch (TransducerTypeMismatchException ttme)
+                  {
+                    if (allow_transducer_conversion)
+                      {
+                        convert_transducers(*first, *second);
+                        first->harmonize_flag_diacritics(*second);
+                      }
+                    else
+                      {
+                        error(EXIT_FAILURE, 0, "Could not compose %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                              "formats %s and %s are not compatible for composition (--do-not-convert was requested)",
+                              firstname, secondname, transducer_n_first,
+                              hfst_strformat(firststream.get_type()),
+                              hfst_strformat(secondstream.get_type()));
+                      }
+                  }
               }
-        }
+          }
+
+        try
+          {
+            first->compose(*second, harmonize);
+          }
+        catch (TransducerTypeMismatchException ttme)
+          {
+            if (allow_transducer_conversion)
+              {
+                convert_transducers(*first, *second);
+                first->compose(*second, harmonize);
+              }
+            else
+              {
+                error(EXIT_FAILURE, 0, "Could not compose %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                      "formats %s and %s are not compatible for composition (--do-not-convert was requested)",
+                      firstname, secondname, transducer_n_first,
+                      hfst_strformat(firststream.get_type()),
+                      hfst_strformat(secondstream.get_type()));
+              }
+          }
 
         hfst_set_name(*first, *first, *second, "compose");
         hfst_set_formula(*first, *first, *second, "∘");
-        first->compose(*second, harmonize);
-        outstream << *first;
 
-        }
-        catch (HfstTransducerTypeMismatchException)
-          {
-            error(EXIT_FAILURE, 0, "Could not compose %s and %s [" SIZE_T_SPECIFIER "]\n"
-                  "types %s and %s are not compatible for composition",
-                  firstname, secondname, transducer_n_first,
-                  hfst_strformat(firststream.get_type()),
-                  hfst_strformat(secondstream.get_type()));
-          }
+        outstream << *first;
 
         continueReading = 
           (firststream.is_good() && secondstream.is_good())  ||
@@ -360,7 +419,7 @@ int main( int argc, char **argv ) {
         return EXIT_FAILURE;
       }
 
-    retval = compose_streams(*firststream, *secondstream, *outstream);
+    retval = compose_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
     delete outstream;
diff --git a/tools/src/hfst-concatenate.cc b/tools/src/hfst-concatenate.cc
index 4b424da..4130ba0 100644
--- a/tools/src/hfst-concatenate.cc
+++ b/tools/src/hfst-concatenate.cc
@@ -123,18 +123,45 @@ parse_options(int argc, char** argv)
 }
 
 int
-concatenate_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                    HfstOutputStream& outstream)
+concatenate_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
-    // there must be at least one transducer in both input streams
-    bool continueReading = firststream.is_good() && secondstream.is_good();
+  // there must be at least one transducer in both input streams
+  bool continueReading = firststream.is_good() && secondstream.is_good();
+
+  hfst::ImplementationType type1 = firststream.get_type();
+  hfst::ImplementationType type2 = secondstream.get_type();
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+  if (type1 != type2)
+    {
+      if (allow_transducer_conversion)
+        {
+          int ct = conversion_type(type1, type2);
+          std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+          if (ct == 1)
+            { warnstr.append("using former type as output"); output_type = type1; }
+          else if (ct == 2)
+            { warnstr.append("using latter type as output"); output_type = type2; }
+          else if (ct == -1)
+            { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+          else /* should not happen */
+            { throw "Error: hfst-concatenate: conversion_type returned an invalid integer"; }
+          warning(0, 0, warnstr.c_str());
+        }
+      else
+        {
+          error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                "formats %s and %s are not compatible for concatenation (--do-not-convert was requested)",
+                firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+        }
+    }
+  else
+    {
+      output_type = type1;
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
 
-    if (firststream.get_type() != secondstream.get_type())
-      {
-        warning(0, 0, "Tranducer type mismatch in %s and %s; "
-              "using former type as output\n",
-              firstfilename, secondfilename);
-      }
     HfstTransducer * first=0;
     HfstTransducer * second=0;
     size_t transducer_n_first = 0; // transducers read from first stream
@@ -184,13 +211,20 @@ concatenate_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
           }
         catch (TransducerTypeMismatchException ttme)
           {
-            error(EXIT_FAILURE, 0, "Could not concatenate %s and %s [" SIZE_T_SPECIFIER "]\n"
-                  "types %s and %s are not compatible for concatenation",
-                  firstname, secondname, transducer_n_first,
-                  hfst_strformat(firststream.get_type()),
-                  hfst_strformat(secondstream.get_type()));
+            if (allow_transducer_conversion)
+              {
+                convert_transducers(*first, *second);
+                first->concatenate(*second, harmonize);
+              }
+            else
+              {
+                error(EXIT_FAILURE, 0, "Could not concatenate %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                      "formats %s and %s are not compatible for concatenation (--do-not-convert was requested)",
+                      firstname, secondname, transducer_n_first,
+                      hfst_strformat(firststream.get_type()),
+                      hfst_strformat(secondstream.get_type()));
+              }
           }
-
         hfst_set_name(*first, *first, *second, "concatenate");
         hfst_set_formula(*first, *first, *second, "⋅");
         outstream << *first;
@@ -280,9 +314,6 @@ int main( int argc, char **argv ) {
         error(EXIT_FAILURE, 0, "%s is not a valid transducer file",
               secondfilename);
     }
-    HfstOutputStream* outstream = (outfile != stdout) ?
-        new HfstOutputStream(outfilename, firststream->get_type()) :
-        new HfstOutputStream(firststream->get_type());
 
     if ( is_input_stream_in_ol_format(firststream, "hfst-concatenate") ||
          is_input_stream_in_ol_format(secondstream, "hfst-concatenate") )
@@ -290,10 +321,9 @@ int main( int argc, char **argv ) {
         return EXIT_FAILURE;
       }
 
-    retval = concatenate_streams(*firststream, *secondstream, *outstream);
+    retval = concatenate_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
-    delete outstream;
     free(firstfilename);
     free(secondfilename);
     free(outfilename);
diff --git a/tools/src/hfst-conjunct.cc b/tools/src/hfst-conjunct.cc
index b5b9c97..f3b524c 100644
--- a/tools/src/hfst-conjunct.cc
+++ b/tools/src/hfst-conjunct.cc
@@ -121,17 +121,45 @@ parse_options(int argc, char** argv)
 }
 
 int
-conjunct_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                    HfstOutputStream& outstream)
+conjunct_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
-    // there must be at least one transducer in both input streams
-    bool continueReading = firststream.is_good() && secondstream.is_good();
-    if (firststream.get_type() != secondstream.get_type())
-      {
-        warning(0, 0, "Tranducer type mismatch in %s and %s; "
-              "using former type as output",
-              firstfilename, secondfilename);
-      }
+  // there must be at least one transducer in both input streams
+  bool continueReading = firststream.is_good() && secondstream.is_good();
+
+  hfst::ImplementationType type1 = firststream.get_type();
+  hfst::ImplementationType type2 = secondstream.get_type();
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+  if (type1 != type2)
+    {
+      if (allow_transducer_conversion)
+        {
+          int ct = conversion_type(type1, type2);
+          std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+          if (ct == 1)
+            { warnstr.append("using former type as output"); output_type = type1; }
+          else if (ct == 2)
+            { warnstr.append("using latter type as output"); output_type = type2; }
+          else if (ct == -1)
+            { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+          else /* should not happen */
+            { throw "Error: hfst-conjunct: conversion_type returned an invalid integer"; }
+          warning(0, 0, warnstr.c_str());
+        }
+      else
+        {
+          error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                "formats %s and %s are not compatible for conjunction (--do-not-convert was requested)",
+                firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+        }
+    }
+  else
+    {
+      output_type = type1;
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
+
     HfstTransducer * first=0;
     HfstTransducer * second=0;
     size_t transducer_n_first = 0; // transducers read from first stream
@@ -175,18 +203,25 @@ conjunct_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
                 first->harmonize_flag_diacritics(*second);
               }
         }
-
-        try 
+        try
           {
             first->intersect(*second, harmonize);
           }
         catch (TransducerTypeMismatchException ttme)
           {
-            error(EXIT_FAILURE, 0, "Could not conjunct %s and %s [" SIZE_T_SPECIFIER "]\n"
-                  "formats %s and %s are not compatible for intersection",
-                  firstname, secondname, transducer_n_first,
-                  hfst_strformat(firststream.get_type()),
-                  hfst_strformat(secondstream.get_type()));
+            if (allow_transducer_conversion)
+              {
+                convert_transducers(*first, *second);
+                first->intersect(*second, harmonize);
+              }
+            else
+              {
+                error(EXIT_FAILURE, 0, "Could not conjunct %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                      "formats %s and %s are not compatible for conjunction (--do-not-convert was requested)",
+                      firstname, secondname, transducer_n_first,
+                      hfst_strformat(firststream.get_type()),
+                      hfst_strformat(secondstream.get_type()));
+              }
           }
         hfst_set_name(*first, *first, *second, "intersect");
         hfst_set_formula(*first, *first, *second, "∩");
@@ -276,9 +311,6 @@ int main( int argc, char **argv ) {
         error(EXIT_FAILURE, 0, "%s is not a valid transducer file",
               secondfilename);
     }
-    HfstOutputStream* outstream = (outfile != stdout) ?
-        new HfstOutputStream(outfilename, firststream->get_type()) :
-        new HfstOutputStream(firststream->get_type());
 
     if ( is_input_stream_in_ol_format(firststream, "hfst-conjunct") ||
          is_input_stream_in_ol_format(secondstream, "hfst-conjunct") )
@@ -286,10 +318,9 @@ int main( int argc, char **argv ) {
         return EXIT_FAILURE;
       }
 
-    retval = conjunct_streams(*firststream, *secondstream, *outstream);
+    retval = conjunct_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
-    delete outstream;
     free(firstfilename);
     free(secondfilename);
     free(outfilename);
diff --git a/tools/src/hfst-disjunct.cc b/tools/src/hfst-disjunct.cc
index 6f5943f..1c395e8 100644
--- a/tools/src/hfst-disjunct.cc
+++ b/tools/src/hfst-disjunct.cc
@@ -118,18 +118,45 @@ parse_options(int argc, char** argv)
 }
 
 int
-disjunct_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                    HfstOutputStream& outstream)
+disjunct_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
     // there must be at least one transducer in both input streams
     bool continueReading = firststream.is_good() && secondstream.is_good();
 
-    if (firststream.get_type() != secondstream.get_type())
+    hfst::ImplementationType type1 = firststream.get_type();
+    hfst::ImplementationType type2 = secondstream.get_type();
+    hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+    if (type1 != type2)
       {
-        warning(0, 0, "Tranducer type mismatch in %s and %s; "
-              "using former type as output",
-              firstfilename, secondfilename);
+        if (allow_transducer_conversion)
+          {
+            int ct = conversion_type(type1, type2);
+            std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+            if (ct == 1)
+              { warnstr.append("using former type as output"); output_type = type1; }
+            else if (ct == 2)
+              { warnstr.append("using latter type as output"); output_type = type2; }
+            else if (ct == -1)
+              { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+            else /* should not happen */
+              { throw "Error: hfst-disjunct: conversion_type returned an invalid integer"; }
+            warning(0, 0, warnstr.c_str());
+          }
+        else
+          {
+            error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                  "formats %s and %s are not compatible for disjunction (--do-not-convert was requested)",
+                  firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+          }
       }
+    else
+      {
+        output_type = type1;
+      }
+
+    HfstOutputStream outstream = (outfile != stdout) ?
+        HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
+
     HfstTransducer * first=0;
     HfstTransducer * second=0;
     size_t transducer_n_first = 0; // transducers read from first stream
@@ -162,11 +189,19 @@ disjunct_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
           }
         catch (TransducerTypeMismatchException ttme)
           {
-            error(EXIT_FAILURE, 0, "Could not disjunct %s and %s [" SIZE_T_SPECIFIER "]\n"
-                  "formats %s and %s are not compatible for conjunction",
-                  firstname, secondname, transducer_n_first,
-                  hfst_strformat(firststream.get_type()),
-                  hfst_strformat(secondstream.get_type()));
+            if (allow_transducer_conversion)
+              {
+                convert_transducers(*first, *second);
+                first->disjunct(*second, harmonize);
+              }
+            else
+              {
+                error(EXIT_FAILURE, 0, "Could not disjunct %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                      "formats %s and %s are not compatible for disjunction (--do-not-convert was requested)",
+                      firstname, secondname, transducer_n_first,
+                      hfst_strformat(firststream.get_type()),
+                      hfst_strformat(secondstream.get_type()));
+              }
           }
         hfst_set_name(*first, *first, *second, "union");
         hfst_set_formula(*first, *first, *second, "∪");
@@ -257,9 +292,6 @@ int main( int argc, char **argv ) {
         error(EXIT_FAILURE, 0, "%s is not a valid transducer file",
               secondfilename);
     }
-    HfstOutputStream* outstream = (outfile != stdout) ?
-        new HfstOutputStream(outfilename, firststream->get_type()) :
-        new HfstOutputStream(firststream->get_type());
 
     if ( is_input_stream_in_ol_format(firststream, "hfst-disjunct") ||
          is_input_stream_in_ol_format(secondstream, "hfst-disjunct") )
@@ -267,10 +299,9 @@ int main( int argc, char **argv ) {
         return EXIT_FAILURE;
       }
 
-    retval = disjunct_streams(*firststream, *secondstream, *outstream);
+    retval = disjunct_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
-    delete outstream;
     free(firstfilename);
     free(secondfilename);
     free(outfilename);
diff --git a/tools/src/hfst-fst2txt.cc b/tools/src/hfst-fst2txt.cc
index ed0b537..c8f3105 100644
--- a/tools/src/hfst-fst2txt.cc
+++ b/tools/src/hfst-fst2txt.cc
@@ -45,6 +45,8 @@ using std::map;
 #include "HfstTransducer.h"
 #include "HfstInputStream.h"
 #include "HfstOutputStream.h"
+#include "HfstPrintDot.h"
+#include "HfstPrintPCKimmo.h"
 
 #include "inc/globals-common.h"
 #include "inc/globals-unary.h"
@@ -178,323 +180,6 @@ parse_options(int argc, char** argv)
     return EXIT_CONTINUE;
 }
 
-static
-void
-print_dot(FILE* out, HfstTransducer& t)
-  {
-    fprintf(out, "// This graph generated with hfst-fst2txt\n");
-    if (t.get_name() != "")
-      {
-        fprintf(out, "digraph \"%s\" {\n", t.get_name().c_str());
-      }
-    else
-      {
-        fprintf(out, "digraph H {\n");
-      }
-    fprintf(out, "charset = UTF8;\n");
-    fprintf(out, "rankdir = LR;\n");
-    fprintf(out, "node [shape=circle,style=filled,fillcolor=yellow]\n");
-    HfstBasicTransducer* mutt = new HfstBasicTransducer(t);
-    HfstState s = 0;
-    // for some reason, dot works nicer if I first have all nodes, then arcs
-    for (HfstBasicTransducer::const_iterator state = mutt->begin();
-         state != mutt->end();
-         ++state)
-      {
-        if (mutt->is_final_state(s))
-          {
-            if (mutt->get_final_weight(s) > 0)
-              {
-                fprintf(out, "q%d [shape=doublecircle,"
-                       "label=\"q%d/\\n%.2f\"] \n",
-                        s, s, mutt->get_final_weight(s));
-              }
-            else
-              {
-                fprintf(out, "q%d [shape=doublecircle,"
-                       "label=\"q%d\"] \n",
-                        s, s);
-              }
-          }
-        else
-          {
-            fprintf(out, "q%d [label=\"q%d\"] \n", 
-                    s, s);
-          }
-        ++s;
-      } // each state
-    s = 0;
-    for (HfstBasicTransducer::const_iterator state = mutt->begin();
-         state != mutt->end();
-         ++state)
-      {
-        map<HfstState, string> target_labels;
-        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
-             state->begin();
-             arc != state->end();
-             ++arc)
-          {
-            string old_label = target_labels[arc->get_target_state()];
-            string first = arc->get_input_symbol();
-            string second = arc->get_output_symbol();
-            if (first == hfst::internal_epsilon)
-              {
-                first = string("00");
-              }
-            else if (first == hfst::internal_identity)
-              {
-                first = string("??");
-              }
-            else if (first == hfst::internal_unknown)
-              { 
-                first = string("?1");
-              }
-            if (second == hfst::internal_epsilon)
-              {
-                second = string("00");
-              }
-            else if (second == hfst::internal_identity)
-              {
-                second = string("??");
-              }
-            else if (second == hfst::internal_unknown)
-              {
-                second = string("?2");
-              }
-#define DOT_MAX_LABEL_SIZE 64
-            char* l = static_cast<char*>(malloc(sizeof(char) * 
-                                                DOT_MAX_LABEL_SIZE));
-            if (first == second)
-              {
-                if (arc->get_weight() > 0)
-                  {
-                    errno = 0;
-                    if (old_label != "")
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                             "%s, %s/%.2f", old_label.c_str(),
-                             first.c_str(),
-                             arc->get_weight()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                 "sprinting dot arc label");
-                          }
-                      }
-                    else 
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                                     "%s/%.2f", first.c_str(),
-                                     arc->get_weight()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                 "sprinting dot arc label");
-                          }
-                      }  // if old label empty
-                  } // if weighted
-                else
-                  {
-                    errno = 0;
-                    if (old_label != "")
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                             "%s, %s", old_label.c_str(),
-                             first.c_str()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                 "sprinting dot arc label");
-                          }
-                      }
-                    else 
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                                     "%s", first.c_str()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                 "sprinting dot arc label");
-                          }
-                      } // if old label empty
-                  } // if weighted 
-              } // if id pair
-            else
-              {
-                if (arc->get_weight() > 0)
-                  {
-                    errno = 0;
-                    if (old_label != "")
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                                     "%s, %s:%s/%.2f", old_label.c_str(),
-                                    first.c_str(), second.c_str(),
-                                    arc->get_weight()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                  "sprinting dot arc label");
-                          }
-                      }
-                    else
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                                     "%s:%s/%.2f",
-                                    first.c_str(), second.c_str(),
-                                    arc->get_weight()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                  "sprinting dot arc label");
-                          }
-                      }  // old label empty
-                  } // if weighted
-                else
-                  {
-                    errno = 0;
-                    if (old_label != "")
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                                     "%s, %s:%s", old_label.c_str(),
-                                    first.c_str(), second.c_str()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                  "sprinting dot arc label");
-                          }
-                      }
-                    else
-                      {
-                        if (snprintf(l, DOT_MAX_LABEL_SIZE,
-                                     "%s:%s",
-                                    first.c_str(), second.c_str()) < 0)
-                          {
-                            error(EXIT_FAILURE, errno, 
-                                  "sprinting dot arc label");
-                          }
-                      } // if old label empty
-                  } // if weighted
-              } // if id pair
-            target_labels[arc->get_target_state()] = l;
-            free(l);
-          } // each arc
-        for (map<HfstState,string>::const_iterator tl = target_labels.begin();
-             tl != target_labels.end();
-             ++tl)
-          {
-            fprintf(out, "q%d -> q%d ", s, tl->first);
-            fprintf(out, "[label=\"%s \"];\n", tl->second.c_str());
-          }
-        ++s;
-      } // each state
-    fprintf(out, "}\n");
-  }
-
-static
-void
-print_pckimmo(FILE* out, HfstTransducer& t)
-  {
-    HfstBasicTransducer* mutt = new HfstBasicTransducer(t);
-    HfstState s = 0;
-    HfstState last = 0;
-    set<pair<string,string> > pairs;
-    for (HfstBasicTransducer::const_iterator state = mutt->begin();
-         state != mutt->end();
-         ++state)
-      {
-        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
-             state->begin();
-             arc != state->end();
-             ++arc)
-          {
-            string first = arc->get_input_symbol();
-            string second = arc->get_output_symbol();
-            pairs.insert(pair<string,string>(first, second));
-          }
-        ++last;
-      }
-    // width of the first column
-    unsigned int numwidth = 0;
-    for (unsigned int i = 1; i < last; i *= 10, numwidth++)
-      {}
-    // first line is input symbols per pair 
-    // (left corner is digit width + 2)
-    fprintf(out, "%*s  ", numwidth, " ");
-    for (set<pair<string, string> >::const_iterator p = pairs.begin();
-         p != pairs.end();
-         ++p)
-      {
-        if (p->first == hfst::internal_epsilon)
-          {
-            fprintf(out, "%.*s ", numwidth, "0");
-          }
-        else if (p->first == hfst::internal_unknown)
-          {
-            fprintf(out, "%.*s ", numwidth, "@");
-          }
-        else
-          {
-            fprintf(out, "%.*s ", numwidth, p->first.c_str());
-          }
-      }
-    // second line is output symbols per pair
-    fprintf(out, "\n");
-    // (left corner is digit width + 2)
-    fprintf(out, "%*s  ", numwidth, " ");
-    for (set<pair<string, string> >::const_iterator p = pairs.begin();
-         p != pairs.end();
-         ++p)
-      {
-        if (p->second == hfst::internal_epsilon)
-          {
-            fprintf(out, "%.*s ", numwidth, "0");
-          }
-        else if (p->second == hfst::internal_unknown)
-          {
-            fprintf(out, "%.*s ", numwidth, "@");
-          }
-        else
-          {
-            fprintf(out, "%.*s ", numwidth, p->second.c_str());
-          }
-
-      }
-    // the transition table per state
-    fprintf(out, "\n");
-    for (HfstBasicTransducer::const_iterator state = mutt->begin();
-         state != mutt->end();
-         ++state)
-      {
-        if (mutt->is_final_state(s))
-          {
-            fprintf(out, "%.*d. ", numwidth, s + 1);
-          }
-        else
-          {
-            fprintf(out, "%.*d: ", numwidth, s + 1);
-          }
-        // map everything to sink state 0 first
-        map<pair<string,string>,HfstState> transitions;
-        for(set<pair<string,string> >::const_iterator p = pairs.begin();
-            p != pairs.end();
-            ++p)
-          {
-            transitions[*p] = -1;
-          }
-        for (HfstBasicTransducer::HfstTransitions::const_iterator arc = 
-             state->begin();
-             arc != state->end();
-             ++arc)
-          {
-            string first = arc->get_input_symbol();
-            string second = arc->get_output_symbol();
-            transitions[pair<string,string>(first,second)] = 
-                arc->get_target_state();
-          }
-        for(map<pair<string,string>,HfstState>::const_iterator trans = 
-            transitions.begin();
-            trans != transitions.end();
-            ++trans)
-          {
-            fprintf(out, "%.*d ", numwidth, trans->second + 1);
-          }
-        fprintf(out, "\n");
-        ++s;
-      } // for each state
-  }
 
 int
 process_stream(HfstInputStream& instream, FILE* outf)
@@ -562,10 +247,11 @@ process_stream(HfstInputStream& instream, FILE* outf)
         }
         break;
       case DOT_TEXT: // xfsm case checked earlier
-        print_dot(outf, *t);
+        fprintf(outf, "// This graph generated with hfst-fst2txt\n");
+        hfst::print_dot(outf, *t);
         break;
       case PCKIMMO_TEXT: // xfsm case checked earlier
-        print_pckimmo(outf, *t);
+        hfst::print_pckimmo(outf, *t);
         break;
       case PROLOG_TEXT:
         {
diff --git a/tools/src/hfst-lexc-compiler.cc b/tools/src/hfst-lexc-compiler.cc
index dbd00d6..f5c9869 100644
--- a/tools/src/hfst-lexc-compiler.cc
+++ b/tools/src/hfst-lexc-compiler.cc
@@ -60,6 +60,7 @@ static FILE** lexcfiles = 0;
 static unsigned int lexccount = 0;
 static bool is_input_stdin = true;
 static ImplementationType format = hfst::UNSPECIFIED_TYPE;
+static bool align_strings = false;
 static bool with_flags = false;
 static bool minimize_flags = false;
 static bool rename_flags = false;
@@ -80,6 +81,7 @@ print_usage()
                "  -f, --format=FORMAT     compile into FORMAT transducer\n"
                "  -o, --output=OUTFILE    write result into OUTFILE\n");
         fprintf(message_out, "Lexc options:\n"
+               "  -A, --alignStrings      align characters in input and output strings\n"
                "  -E, --encode-weights    encode weights when minimizing (default is false)\n"
                "  -F, --withFlags         use flags to hyperminimize result\n"
                "  -M, --minimizeFlags     if --withFlags is used, minimize the number of flags\n"
@@ -133,6 +135,7 @@ parse_options(int argc, char** argv)
           {"encode-weights", no_argument, 0, 'E'},
           {"format", required_argument, 0, 'f'},
           {"output", required_argument, 0, 'o'},
+          {"alignStrings", no_argument,    0, 'A'},
           {"withFlags", no_argument,    0, 'F'},
           {"minimizeFlags", no_argument,    0, 'M'},
           {"renameFlags", no_argument,    0, 'R'},
@@ -143,7 +146,7 @@ parse_options(int argc, char** argv)
         };
         int option_index = 0;
         char c = getopt_long(argc, argv, HFST_GETOPT_COMMON_SHORT
-                             "Ef:o:FMRx:X:W",
+                             "Ef:o:AFMRx:X:W",
                              long_options, &option_index);
         if (-1 == c)
         {
@@ -152,6 +155,9 @@ parse_options(int argc, char** argv)
         switch (c)
         {
 #include "inc/getopt-cases-common.h"
+        case 'A':
+          align_strings = true;
+          break;
         case 'E':
           encode_weights = true;
           break;
@@ -348,7 +354,7 @@ int main( int argc, char **argv ) {
         new HfstOutputStream(outfilename, format) :
         new HfstOutputStream(format);
     hfst::set_xerox_composition(xerox_composition);
-    LexcCompiler lexc(format, with_flags);
+    LexcCompiler lexc(format, with_flags, align_strings);
     lexc.setMinimizeFlags(minimize_flags);
     lexc.setRenameFlags(rename_flags);
    // lexc.with_flags_ = with_flags;
diff --git a/tools/src/hfst-lookup.cc b/tools/src/hfst-lookup.cc
index 921fe9d..0478e46 100644
--- a/tools/src/hfst-lookup.cc
+++ b/tools/src/hfst-lookup.cc
@@ -39,7 +39,10 @@
 #  include <getopt.h>
 #endif
 
+#ifdef WINDOWS
 #include "hfst-string-conversions.h"
+using hfst::hfst_fprintf_console;
+#endif
 
 #include <limits>
 #include <math.h>
@@ -87,7 +90,6 @@ using hfst::StringSet;
 using std::string;
 using std::vector;
 
-using hfst::hfst_fprintf;
 
 // add tools-specific variables here
 static char* lookup_file_name;
@@ -119,6 +121,7 @@ enum lookup_output_format
 
 static lookup_input_format input_format = UTF8_TOKEN_INPUT;
 static lookup_output_format output_format = XEROX_OUTPUT;
+static double time_cutoff = 0.0;
 
 // XFST variables for apply
 static bool show_flags = false;
@@ -246,6 +249,8 @@ print_usage()
             "  -c, --cycles=INT                 How many times to follow input epsilon cycles\n"
             "  -b, --beam=B                     Output only analyses whose weight is within B from\n"
             "                                   the best analysis\n"
+            "  -t, --time-cutoff=S              Limit search after having used S seconds per input\n"
+            "                                   (currently only works in optimized-lookup mode\n"
             "  -P, --progress                   Show neat progress bar if possible\n");
     fprintf(message_out, "\n");
     print_common_unary_program_parameter_instructions(message_out);
@@ -258,6 +263,7 @@ print_usage()
             "Input epsilon cycles are followed by default INT=5 times.\n"
             "Epsilon is printed by default as an empty string.\n"
             "B must be a non-negative float.\n"
+            "S must be a non-negative float. The default, 0.0, indicates no cutoff.\n"
             "If the input contains several transducers, a set containing\n"
             "results from all transducers is printed for each input string.\n");
     fprintf(message_out, "\n");
@@ -275,19 +281,6 @@ print_usage()
 #endif
     fprintf(message_out, "\n");
 
-/*    fprintf(message_out,
-#ifdef _MSC_VER
-          "If input file is not specified with -I, input is read interactively via the\n"
-          "console, i.e. line by line from the user. If input is redirected  from a file,\n"
-          "use -p. Output is by default printed to the console. If output is redirected\n"
-          "to a file, use -k.\n"
-#else
-          "If input file is not specified with -I, input is read interactively line by\n"
-          "line from the user. If input is redirected from a file, use -p.\n"
-#endif
-);*/
-
-
     fprintf(message_out, 
             "Todo:\n"
             "  For optimized lookup format, only strings that pass "
@@ -326,6 +319,7 @@ parse_options(int argc, char** argv)
             {"epsilon-format", required_argument, 0, 'e'},
             {"epsilon-format2", required_argument, 0, 'E'},
             {"beam", required_argument, 0, 'b'},
+            {"time-cutoff", required_argument, 0, 't'},
             {"pipe-mode", optional_argument, 0, 'p'},
             {"progress", no_argument, 0, 'P'},
             {0,0,0,0}
@@ -333,7 +327,7 @@ parse_options(int argc, char** argv)
         int option_index = 0;
         // add tool-specific options here 
         char c = getopt_long(argc, argv, HFST_GETOPT_COMMON_SHORT
-                             HFST_GETOPT_UNARY_SHORT "I:O:F:xc:X:e:E:b:p::P",
+                             HFST_GETOPT_UNARY_SHORT "I:O:F:xc:X:e:E:b:t:p::P",
                              long_options, &option_index);
         if (-1 == c)
         {
@@ -405,6 +399,14 @@ parse_options(int argc, char** argv)
               return EXIT_FAILURE;
             }
           break;
+        case 't':
+            time_cutoff = atof(optarg);
+            if (time_cutoff < 0.0)
+            {
+                std::cerr << "Invalid argument for --time-cutoff\n";
+                return EXIT_FAILURE;
+            }
+            break;
         case 'x':
             print_statistics = true;
             break;
@@ -909,9 +911,23 @@ lookup_printf(const char* format, const HfstOneLevelPath* input,
     free(lookupform);
     int rv;
     if (! quote_special)
-      rv = hfst::hfst_fprintf(ofile, "%s", res);
+      {
+#ifdef WINDOWS
+        if (!pipe_output)
+          rv = hfst_fprintf_console(ofile, "%s", res);
+        else
+#endif
+          rv = fprintf(ofile, "%s", res);
+      }
     else
-      rv = hfst::hfst_fprintf(ofile, "%s", get_print_format(res).c_str());
+      {
+#ifdef WINDOWS
+        if (!pipe_output)
+          rv = hfst_fprintf_console(ofile, "%s", get_print_format(res).c_str());
+        else
+#endif
+          rv = fprintf(ofile, "%s", get_print_format(res).c_str());
+      }
     free(res);
     return rv;
 }
@@ -1106,12 +1122,12 @@ lookup_simple(const HfstOneLevelPath& s, HfstTransducer& t, bool* infinity)
     warning(0, 0, "Got infinite results, number of cycles limited to " SIZE_T_SPECIFIER "",
         infinite_cutoff);
       }
-      results = t.lookup_fd(s.second, infinite_cutoff);
+      results = t.lookup_fd(s.second, infinite_cutoff, time_cutoff);
       *infinity = true;
     }
   else
     {
-      results = t.lookup_fd(s.second);
+        results = t.lookup_fd(s.second, -1, time_cutoff);
     }
 
   if (results->size() == 0)
@@ -1197,7 +1213,7 @@ void lookup_fd_and_print(HfstBasicTransducer &t, HfstOneLevelPaths& results,
   if (is_possible_to_get_result(s, cascade_symbols_seen[transducer_number], 
                                 cascade_unknown_or_identity_seen[transducer_number]))
     {
-      t.lookup_fd(s.second, results_spv, infinite_cutoff);
+        t.lookup_fd(s.second, results_spv, &infinite_cutoff);
     }
 
   if (print_pairs) {
@@ -1239,6 +1255,7 @@ void lookup_fd_and_print(HfstBasicTransducer &t, HfstOneLevelPaths& results,
       }
     fprintf(outfile, "\n");
     }
+    fflush(outfile);
   }
 
   // Convert HfstTwoLevelPaths into HfstOneLevelPaths
@@ -1299,7 +1316,7 @@ lookup_simple(const HfstOneLevelPath& s, HfstBasicTransducer& t, bool* infinity)
     }
   else
     {
-      lookup_fd_and_print(t, *results, s);
+        lookup_fd_and_print(t, *results, s);
     }
 
   if (results->size() == 0)
@@ -1367,6 +1384,7 @@ lookup_cascading(const HfstOneLevelPath& s, vector<HfstBasicTransducer> cascade,
         {
           results->insert(*it);
         }
+      delete result;
     }
   // all transducers gone through
 
@@ -1681,6 +1699,7 @@ process_stream(HfstInputStream& inputstream, FILE* outstream)
         if (! print_pairs) { 
           // printing was already done in function lookup_fd
           print_lookups(*kvs, *kv, markup, unknown, infinite, outstream);
+          fflush(outstream);
         }
         delete kv;
         delete kvs;
@@ -1729,7 +1748,7 @@ int main( int argc, char **argv ) {
       }
 
     // has no effect on windows or mac
-    hfst::print_output_to_console(!pipe_output);
+    //hfst::print_output_to_console(!pipe_output);
 #endif
 
     // close buffers, we use streams
@@ -1769,6 +1788,7 @@ int main( int argc, char **argv ) {
     {
         fclose(outfile);
     }
+    delete instream;
     free(inputfilename);
     free(outfilename);
     return EXIT_SUCCESS;
diff --git a/tools/src/hfst-optimized-lookup.cc b/tools/src/hfst-optimized-lookup.cc
index 7ed03fb..c28fc90 100644
--- a/tools/src/hfst-optimized-lookup.cc
+++ b/tools/src/hfst-optimized-lookup.cc
@@ -32,7 +32,7 @@
 
 #ifdef _MSC_VER
 #  include "hfst-string-conversions.h"
-using hfst::hfst_fprintf;
+using hfst::hfst_fprintf_console;
 #endif
 
 #include <cstdarg>
@@ -62,6 +62,7 @@ bool print_usage(void)
     "                              (if the transducer is weighted, the N best analyses)\n" <<
     "  -b, --beam=B                Output only analyses whose weight is within B from\n" <<
     "                              the best analysis\n" <<
+    "  -t, --time-cutoff=S         Limit search after having used S seconds per input\n"
     "  -x, --xerox                 Xerox output format (default)\n" <<
     "  -f, --fast                  Be as fast as possible.\n" <<
     "                              (with this option enabled -u and -n don't work and\n" <<
@@ -69,6 +70,7 @@ bool print_usage(void)
     "  -p, --pipe-mode[=STREAM]    Control input and output streams.\n" <<
     "\n" <<
     "N must be a positive integer. B must be a non-negative float.\n" <<
+    "S must be a non-negative float. The default, 0.0, indicates no cutoff.\n"
     "Options -n and -b are combined with AND, i.e. they both restrict the output.\n" <<
     "\n" << 
     "STREAM can be { input, output, both }. If not given, defaults to {both}.\n" <<
@@ -122,6 +124,7 @@ int main(int argc, char **argv)
           {"echo-inputs",  no_argument,       0, 'e'},
           {"show-weights", no_argument,       0, 'w'},
           {"beam",         required_argument, 0, 'b'},
+          {"time-cutoff",  required_argument, 0, 't'},
           {"unique",       no_argument,       0, 'u'},
           {"xerox",        no_argument,       0, 'x'},
           {"fast",         no_argument,       0, 'f'},
@@ -193,7 +196,14 @@ int main(int argc, char **argv)
               return EXIT_FAILURE;
             }
           break;
-
+        case 't':
+            time_cutoff = atof(optarg);
+            if (time_cutoff < 0.0)
+            {
+                std::cerr << "Invalid argument for --time-cutoff\n";
+                return EXIT_FAILURE;
+            }
+            break;
         case 'n':
           maxAnalyses = atoi(optarg);
           if (maxAnalyses < 1)
@@ -236,7 +246,7 @@ int main(int argc, char **argv)
     }
 
 #ifdef _MSC_VER
-  hfst::print_output_to_console(!pipe_output); // has no effect on windows or mac
+  //hfst::print_output_to_console(!pipe_output); // has no effect on windows or mac
 #endif
 
   // no more options, we should now be at the input filename
@@ -456,6 +466,10 @@ void runTransducer (genericTransducer T)
   char * str = (char*)(malloc(MAX_IO_STRING*sizeof(char)));  
   *str = 0;
   char * old_str = str;
+
+  if (time_cutoff > 0.0) {
+      max_clock = clock() + CLOCKS_PER_SEC*time_cutoff;
+  }
         
   while(true)
     {
@@ -478,11 +492,12 @@ void runTransducer (genericTransducer T)
                         
       if (echoInputsFlag)
         {
-#ifndef WINDOWS
-          std::cout << str << std::endl;
-#else
-          hfst_fprintf(stdout, "%s\n", str); // fix: add \r?
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "%s\n", str); // fix: add \r?
+          else
 #endif
+            std::cout << str << std::endl;
         }
       int i = 0;
       SymbolNumber k = NO_SYMBOL_NUMBER;
@@ -511,12 +526,19 @@ void runTransducer (genericTransducer T)
         { // tokenization failed
           if (outputType == xerox)
             {
-#ifndef WINDOWS
-              std::cout << str << "\t+?" << std::endl;
-#else
-              hfst_fprintf(stdout, "%s\t+?\n", str);
+#ifdef WINDOWS
+          if (!pipe_output)
+              hfst_fprintf_console(stdout, "%s\t+?\n", str);
+          else
 #endif
-              std::cout << std::endl;
+            std::cout << str << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "\n");
+          else
+#endif
+            std::cout << std::endl;
             }
           continue;
         }
@@ -925,13 +947,20 @@ void Transducer::note_analysis(SymbolNumber * whole_output_string)
     {
       for (SymbolNumber * num = whole_output_string; *num != NO_SYMBOL_NUMBER; ++num)
         {
-#ifndef WINDOWS
-          std::cout << symbol_table[*num];
-#else
-          hfst_fprintf(stdout, "%s", symbol_table[*num]);
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "%s", symbol_table[*num]);
+          else
 #endif
+            std::cout << symbol_table[*num];
         }
-      std::cout << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "\n");
+      else
+#endif
+        std::cout << std::endl;
     } else
     {
       std::string str = "";
@@ -968,6 +997,12 @@ void Transducer::get_analyses(SymbolNumber * input_symbol,
                               SymbolNumber * original_output_string,
                               TransitionTableIndex i)
 {
+  if (time_cutoff > 0.0) {
+    // quit if we've overspent our time
+    if (clock() > max_clock) {
+      return;
+    }
+  }
 #if OL_FULL_DEBUG
   std::cout << "get_analyses " << i << std::endl;
 #endif
@@ -1044,12 +1079,19 @@ void Transducer::printAnalyses(std::string prepend)
     {
       if (outputType == xerox && display_vector.size() == 0)
         {
-#ifndef WINDOWS
-          std::cout << prepend << "\t+?" << std::endl;
-#else
-          hfst_fprintf(stdout, "%s\t+?\n", prepend.c_str());
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "%s\t+?\n", prepend.c_str());
+          else
 #endif
-          std::cout << std::endl;
+            std::cout << prepend << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "\n");
+          else
+#endif
+            std::cout << std::endl;
           return;
         }
       int i = 0;
@@ -1058,22 +1100,33 @@ void Transducer::printAnalyses(std::string prepend)
         {
           if (outputType == xerox)
             {
-#ifndef WINDOWS
-              std::cout << prepend << "\t";
-#else
-              hfst_fprintf(stdout, "%s\t", prepend.c_str());
+#ifdef WINDOWS
+              if (!pipe_output)
+                hfst_fprintf_console(stdout, "%s\t", prepend.c_str());
+              else
 #endif
+                std::cout << prepend << "\t";
             }                   
-#ifndef WINDOWS
-          std::cout << *it << std::endl;
-#else
-          hfst_fprintf(stdout, "%s\n", it->c_str());
+
+#ifdef WINDOWS
+          if (!pipe_mode)
+            hfst_fprintf_console(stdout, "%s\n", it->c_str());
+          else
 #endif
+            std::cout << *it << std::endl;
+
           ++it;
           ++i;
         }
       display_vector.clear(); // purge the display vector
-      std::cout << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_mode)
+        hfst_fprintf_console(stdout, "\n");
+      else
+#endif
+        std::cout << std::endl;
+
     }
 }
 
@@ -1081,12 +1134,21 @@ void TransducerUniq::printAnalyses(std::string prepend)
 {
   if (outputType == xerox && display_vector.size() == 0)
     {
-#ifndef WINDOWS
-      std::cout << prepend << "\t+?" << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\t+?\n", prepend.c_str());
+
+#ifdef WINDOWS
+      if (!pipe_mode)
+        hfst_fprintf_console(stdout, "%s\t+?\n", prepend.c_str());
+      else
 #endif
-      std::cout << std::endl;
+        std::cout << prepend << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_mode)
+        hfst_fprintf_console("\n");
+      else
+#endif
+        std::cout << std::endl;
+
       return;
     }
   int i = 0;
@@ -1095,35 +1157,52 @@ void TransducerUniq::printAnalyses(std::string prepend)
     {
       if (outputType == xerox)
         {
-#ifndef WINDOWS
-          std::cout << prepend << "\t";
-#else
-          hfst_fprintf(stdout, "%s\t", prepend.c_str());
+#ifdef WINDOWS
+      if (!pipe_mode)
+        hfst_fprintf_console(stdout, "%s\t", prepend.c_str());
+      else
 #endif
+        std::cout << prepend << "\t";
         }
-#ifndef WINDOWS
-      std::cout << *it << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\n", it->c_str());
+
+#ifdef WINDOWS
+      if (!pipe_mode)
+        hfst_fprintf_console(stdout, "%s\n", it->c_str());
+      else
 #endif
+        std::cout << *it << std::endl;
+
       ++it;
       ++i;
     }
   display_vector.clear(); // purge the display set
-  std::cout << std::endl;
+#ifdef WINDOWS
+  if (!pipe_mode)
+    hfst_fprintf_console("\n");
+  else
+#endif
+    std::cout << std::endl;
 }
 
 void TransducerFdUniq::printAnalyses(std::string prepend)
 {
   if (outputType == xerox && display_vector.size() == 0)
     {
-#ifndef WINDOWS
-      std::cout << prepend << "\t+?" << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\t+?\n", prepend.c_str());
+#ifdef WINDOWS
+  if (!pipe_mode)
+    hfst_fprintf_console(stdout, "%s\t+?\n", prepend.c_str());
+  else
 #endif
-      std::cout << std::endl;
-      return;
+    std::cout << prepend << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+  if (!pipe_mode)
+    hfst_fprintf_console(stdout, "\n");
+  else
+#endif
+    std::cout << std::endl;
+
+  return;
     }
   int i = 0;
   DisplaySet::iterator it = display_vector.begin();
@@ -1131,22 +1210,32 @@ void TransducerFdUniq::printAnalyses(std::string prepend)
     {
       if (outputType == xerox)
         {
-#ifndef WINDOWS
-          std::cout << prepend << "\t";
-#else
-          hfst_fprintf(stdout, "%s\t", prepend.c_str());
+#ifdef WINDOWS
+          if (!pipe_mode)
+            hfst_fprintf_console(stdout, "%s\t", prepend.c_str());
+          else
 #endif
+            std::cout << prepend << "\t";
         }
-#ifndef WINDOWS
-      std::cout << *it << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\n", it->c_str());
+
+#ifdef WINDOWS
+      if (!pipe_mode)
+        hfst_fprintf_console(stdout, "%s\n", it->c_str());
+      else
 #endif
+        std::cout << *it << std::endl;
+
       ++it;
       ++i;
     }
   display_vector.clear(); // purge the display set
-  std::cout << std::endl;
+
+#ifdef WINDOWS
+  if (!pipe_mode)
+    hfst_fprintf_console("\n");
+  else
+#endif
+    std::cout << std::endl;
 }
 
 /**
@@ -1537,12 +1626,20 @@ void TransducerW::printAnalyses(std::string prepend)
 {
   if (outputType == xerox && display_map.size() == 0)
     {
-#ifndef WINDOWS
-      std::cout << prepend << "\t+?" << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\t+?\n", prepend.c_str());
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "%s\t+?\n", prepend.c_str());
+      else
+#endif
+        std::cout << prepend << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "\n");
+      else
+        std::cout << std::endl;
 #endif
-      std::cout << std::endl;
+
       return;
     }
   int i = 0;
@@ -1558,40 +1655,70 @@ void TransducerW::printAnalyses(std::string prepend)
       {
         if (outputType == xerox)
           {
-#ifndef WINDOWS
-            std::cout << prepend << "\t";
-#else
-            hfst_fprintf(stdout, "%s\t", prepend.c_str()); 
+#ifdef WINDOWS
+            if (!pipe_output)
+              hfst_fprintf_console(stdout, "%s\t", prepend.c_str()); 
+            else
 #endif
+              std::cout << prepend << "\t";
           }
-#ifndef WINDOWS
-        std::cout << (*it).second;
-#else
-        hfst_fprintf(stdout, "%s", (*it).second.c_str());
+
+#ifdef WINDOWS
+        if (!pipe_output)
+          hfst_fprintf_console(stdout, "%s", (*it).second.c_str());
+        else
 #endif
+          std::cout << (*it).second;
+        
         if (displayWeightsFlag)
           {
-            std::cout << '\t' << (*it).first;
+#ifdef WINDOWS
+            if (!pipe_output)
+              hfst_fprintf_console(stdout, "\t%f", (*it).first);
+            else
+#endif
+              std::cout << '\t' << (*it).first;
           }
-        std::cout << std::endl;
+
+#ifdef WINDOWS
+        if (!pipe_output)
+          hfst_fprintf_console(stdout, "\n");
+        else
+#endif
+          std::cout << std::endl;
+ 
       }
       ++it;
       ++i;
     }
   display_map.clear();
-  std::cout << std::endl;
+
+#ifdef WINDOWS
+  if (!pipe_output)
+    hfst_fprintf_console(stdout, "\n");
+  else
+#endif
+    std::cout << std::endl;
 }
 
 void TransducerWUniq::printAnalyses(std::string prepend)
 {
   if (outputType == xerox && display_map.size() == 0)
     {
-#ifndef WINDOWS
-      std::cout << prepend << "\t+?" << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\t+?\n", prepend.c_str());
-#endif      
-      std::cout << std::endl;
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "%s\t+?\n", prepend.c_str());
+      else
+#endif
+        std::cout << prepend << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "\n");
+      else
+#endif
+        std::cout << std::endl;
+
       return;
     }
   int i = 0;
@@ -1611,39 +1738,69 @@ void TransducerWUniq::printAnalyses(std::string prepend)
     {
       if (outputType == xerox)
         {
-#ifndef WINDOWS
-          std::cout << prepend << "\t";
-#else
-          hfst_fprintf(stdout, "%s\t", prepend.c_str());
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "%s\t", prepend.c_str());
+          else
 #endif
+            std::cout << prepend << "\t";
         }
-#ifndef WINDOWS
-      std::cout << (*display_it).second;
-#else
-      hfst_fprintf(stdout, "%s", (*display_it).second.c_str());
+
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "%s", (*display_it).second.c_str());
+          else
 #endif
+            std::cout << (*display_it).second;
+
       if (displayWeightsFlag)
         {
-          std::cout << '\t' << (*display_it).first;
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console("\t%f", (*display_it).first);
+          else
+#endif
+            std::cout << '\t' << (*display_it).first;
         }
-      std::cout << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "\n");
+      else
+#endif
+        std::cout << std::endl;
+
       ++display_it;
       ++i;
     }
   display_map.clear();
-  std::cout << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "\n");
+      else
+#endif
+        std::cout << std::endl;
 }
 
 void TransducerWFdUniq::printAnalyses(std::string prepend)
 {
   if (outputType == xerox && display_map.size() == 0)
     {
-#ifndef WINDOWS
-      std::cout << prepend << "\t+?" << std::endl;
-#else
-      hfst_fprintf(stdout, "%s\t+?", prepend);
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "%s\t+?", prepend);
+      else
+#endif
+        std::cout << prepend << "\t+?" << std::endl;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console(stdout, "\n");
+      else
 #endif
-      std::cout << std::endl;
+        std::cout << std::endl;
+
       return;
     }
   int i = 0;
@@ -1664,21 +1821,46 @@ void TransducerWFdUniq::printAnalyses(std::string prepend)
     {
       if (outputType == xerox)
         {
-#ifndef WINDOWS
-          std::cout << prepend << "\t";
-#else
-          hfst_fprintf(stdout, "%s\t", prepend);
+#ifdef WINDOWS
+          if (!pipe_output)
+            hfst_fprintf_console(stdout, "%s\t", prepend);
+          else
 #endif
+            std::cout << prepend << "\t";
         }
-      std::cout << (*display_it).second;
+
+#ifdef WINDOWS
+      if (!pipe_output)
+        hfst_fprintf_console("%s", (*display_it).second);
+      else
+#endif
+        std::cout << (*display_it).second;
+
       if (displayWeightsFlag)
         {
-          std::cout << '\t' << (*display_it).first;
+#ifdef WINDOWS
+          if (!pipe_mode)
+            hfst_fprintf("\t%f", (*display_it).first);
+          else
+#endif
+            std::cout << '\t' << (*display_it).first;
         }
-      std::cout << std::endl;
+
+#ifdef WINDOWS
+          if (!pipe_mode)
+            hfst_fprintf_console("\n");
+          else
+#endif
+            std::cout << std::endl;
     }
   display_map.clear();
-  std::cout << std::endl;
+
+#ifdef WINDOWS
+  if (!pipe_mode)
+    hfst_fprintf_console("\n");
+  else
+#endif
+    std::cout << std::endl;
 }
 
 void TransducerW::get_analyses(SymbolNumber * input_symbol,
diff --git a/tools/src/hfst-optimized-lookup.h b/tools/src/hfst-optimized-lookup.h
index 2c4c62f..4ae4118 100644
--- a/tools/src/hfst-optimized-lookup.h
+++ b/tools/src/hfst-optimized-lookup.h
@@ -47,7 +47,7 @@ const char * PACKAGE_STRING = "hfst-optimized-lookup 1.2";
 #include <ctime>
 #include <iostream>
 #include <string>
-
+#include <time.h>
 
 enum OutputType {HFST, xerox};
 OutputType outputType = xerox;
@@ -60,6 +60,8 @@ bool echoInputsFlag = false;
 bool beFast = false;
 int maxAnalyses = INT_MAX;
 bool preserveDiacriticRepresentationsFlag = false;
+double time_cutoff = 0.0;
+clock_t max_clock;
 
 #define MAX_IO_STRING 5000
 
diff --git a/tools/src/hfst-pmatch.cc b/tools/src/hfst-pmatch.cc
index 6655e91..8ce5a3e 100644
--- a/tools/src/hfst-pmatch.cc
+++ b/tools/src/hfst-pmatch.cc
@@ -47,6 +47,7 @@ using std::pair;
 #include <math.h>
 #include <errno.h>
 
+#include "HfstExceptionDefs.h"
 #include "hfst-commandline.h"
 #include "hfst-program-options.h"
 #include "hfst-tool-metadata.h"
@@ -97,7 +98,7 @@ void match_and_print(hfst_ol::PmatchContainer & container,
 #ifndef _MSC_VER
       outstream << container.match(input_text);
 #else
-      hfst::hfst_fprintf(stdout, "%s", container.match(input_text).c_str());
+      hfst::hfst_fprintf_console(stdout, "%s", container.match(input_text).c_str());
 #endif
     } else {
         hfst_ol::LocationVectorVector locations = container.locate(input_text);
@@ -108,7 +109,7 @@ void match_and_print(hfst_ol::PmatchContainer & container,
               outstream << it->at(0).start << "|" << it->at(0).length << "|"
                           << it->at(0).output << "|" << it->at(0).tag << std::endl;
 #else
-              hfst::hfst_fprintf(stdout, "%i|%i|%s|%s\n", it->at(0).start, it->at(0).length, it->at(0).output.c_str(), it->at(0).tag.c_str());
+              hfst::hfst_fprintf_console(stdout, "%i|%i|%s|%s\n", it->at(0).start, it->at(0).length, it->at(0).output.c_str(), it->at(0).tag.c_str());
 #endif
             }
         }
@@ -251,10 +252,20 @@ int main(int argc, char ** argv)
         std::cerr << "Could not open file " << pmatch_filename << std::endl;
         return EXIT_FAILURE;
     }
-    hfst_ol::PmatchContainer container(instream);
-    container.set_verbose(verbose);
-    container.set_extract_tags_mode(extract_tags);
-    container.set_profile(profile);
+    try {
+        hfst_ol::PmatchContainer container(instream);
+        container.set_verbose(verbose);
+        container.set_extract_tags_mode(extract_tags);
+        container.set_profile(profile);
+#ifdef _MSC_VER
+        //hfst::print_output_to_console(true);
+#endif
+    return process_input(container, std::cout);
+    } catch(HfstException & e) {
+        std::cerr << "The archive in " << pmatch_filename << " doesn't look right."
+            "\nDid you make it with hfst-pmatch2fst or make sure it's in weighted optimized-lookup format?\n";
+        return 1;
+    }
 //     if (outfile != stdout) {
 //         std::filebuf fb;
 // fb.open(outfilename, std::ios::out);
@@ -263,9 +274,4 @@ int main(int argc, char ** argv)
 // fb.close();
 //     } else {
 
-#ifdef _MSC_VER
-    hfst::print_output_to_console(true);
-#endif
-
-    return process_input(container, std::cout);
 }
diff --git a/tools/src/hfst-pmatch2fst.cc b/tools/src/hfst-pmatch2fst.cc
index c87f609..31690fb 100644
--- a/tools/src/hfst-pmatch2fst.cc
+++ b/tools/src/hfst-pmatch2fst.cc
@@ -107,7 +107,7 @@ print_usage()
         );
 
     fprintf(message_out, "Examples:\n"
-            "  echo \"Define TOP  UppercaseAlpha Alpha* LC(\\\"professor\\\") EndTag(ProfName);\" | %s \n"
+            "  echo \"Define TOP  UppercaseAlpha Alpha* LC({professor}) EndTag(ProfName);\" | %s \n"
             "  create matcher that tags \"professor Chomsky\" as \"professor <ProfName>Chomsky</ProfName>\"\n"
             "\n", program_name, program_name);
     print_report_bugs();
diff --git a/tools/src/hfst-proc/applicators.cc b/tools/src/hfst-proc/applicators.cc
index 73132d2..48708f5 100644
--- a/tools/src/hfst-proc/applicators.cc
+++ b/tools/src/hfst-proc/applicators.cc
@@ -83,7 +83,7 @@ AnalysisApplicator::apply()
   LookupState state(transducer);
   size_t last_stream_location = 0;
   TokenVector surface_form;
-  std::set<std::string> analyzed_forms;
+  ProcResult analyzed_forms;
   
   Token next_token;
   while((next_token = token_stream.get_token()).type != None)
@@ -102,26 +102,26 @@ AnalysisApplicator::apply()
     if(next_token.type == ReservedCharacter)
       stream_error(std::string("Found unexpected character ")+next_token.character+" unescaped in stream");
     
-  	if(surface_form.size() > 0 && state.is_final())
-  	{
-  	  LookupPathSet finals = state.get_finals_set();
+        if(surface_form.size() > 0 && state.is_final())
+        {
+          LookupPathSet finals = state.get_finals_set();
       if (caps_mode == DictionaryCase || caps_mode == CaseSensitiveDictionaryCase)
         {
-  	      analyzed_forms = formatter.process_finals(finals, 
-  	                                                Unknown);
+              analyzed_forms = formatter.process_finals(finals, 
+                                                        Unknown);
         }
       else
         {
           analyzed_forms = formatter.process_finals(finals,
-  	                                                                        token_stream.get_capitalization_state(surface_form));
+                                                                                token_stream.get_capitalization_state(surface_form));
         }
-  	  last_stream_location = token_stream.get_pos()-1;
-  	  
-  	  if(printDebuggingInformationFlag)
-  	    std::cout << "Final paths (" << finals.size() << ") found and saved, stream location is " << last_stream_location << std::endl;
-  	}
-  	
-  	state.step(token_stream.to_symbol(next_token), caps_mode);
+          last_stream_location = token_stream.get_pos()-1;
+          
+          if(printDebuggingInformationFlag)
+            std::cout << "Final paths (" << finals.size() << ") found and saved, stream location is " << last_stream_location << std::endl;
+        }
+        
+        state.step(token_stream.to_symbol(next_token), caps_mode);
     
     if(printDebuggingInformationFlag)
       std::cout << "After stepping, there are " << state.num_active() << " active paths" << std::endl;
@@ -325,7 +325,7 @@ GenerationApplicator::lookup(const TokenVector& tokens, bool generate_on_fail)
     LookupPathSet finals = state.get_finals_set();
     
     if(printDebuggingInformationFlag)
-  	    std::cout << "Generated " << finals.size() << " forms" << std::endl;
+            std::cout << "Generated " << finals.size() << " forms" << std::endl;
     
     token_stream.put_symbols((*finals.begin())->get_output_symbols(),capitalization_state);
     if(finals.size() > 1)
diff --git a/tools/src/hfst-proc/buffer.h b/tools/src/hfst-proc/buffer.h
index 27e3ef3..f65dcb4 100644
--- a/tools/src/hfst-proc/buffer.h
+++ b/tools/src/hfst-proc/buffer.h
@@ -12,9 +12,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #ifndef _HFST_PROC_BUFFER_
 #define _HFST_PROC_BUFFER_
diff --git a/tools/src/hfst-proc/formatter.cc b/tools/src/hfst-proc/formatter.cc
index ce23b84..0c9e08f 100644
--- a/tools/src/hfst-proc/formatter.cc
+++ b/tools/src/hfst-proc/formatter.cc
@@ -35,7 +35,7 @@ OutputFormatter::filter_compound_analyses(LookupPathSet& finals) const
 {
   int fewest_boundaries = std::numeric_limits<int>::max();
   std::vector<int> boundary_counts;
-  
+
   // first look to find the analysis with the fewest compound boundaries
   for(LookupPathSet::const_iterator it=finals.begin(); it!=finals.end(); it++)
   {
@@ -44,7 +44,7 @@ OutputFormatter::filter_compound_analyses(LookupPathSet& finals) const
     if(num < fewest_boundaries)
       fewest_boundaries = num;
   }
-  
+
   // filter all analyses with more boundaries than the minimum
   int i=0;
   for(LookupPathSet::iterator it=finals.begin(); it!=finals.end();i++)
@@ -65,71 +65,82 @@ OutputFormatter::filter_compound_analyses(LookupPathSet& finals) const
 LookupPathSet
 OutputFormatter::preprocess_finals(const LookupPathSet& finals) const
 {
-  LookupPathSet new_finals(LookupPath::compare_pointers);
+  LookupPathSet goodcmp_finals(LookupPathW::compare_weights);
   // insertion sort :)
-  for (LookupPathSet::const_iterator it = finals.begin(); it != finals.end();
-       ++it) {
-      new_finals.insert(*it);
+  for (LookupPathSet::const_iterator it = finals.begin(); it != finals.end(); ++it)
+  {
+      goodcmp_finals.insert(*it);
   }
   if(do_compound_filtering)
   {
-    filter_compound_analyses(new_finals);
+    filter_compound_analyses(goodcmp_finals);
     if(printDebuggingInformationFlag)
     {
-      if(new_finals.size() < finals.size())
-        std::cout << "Filtered " << finals.size()-new_finals.size() << " compound analyses" << std::endl;
+            if(goodcmp_finals.size() < finals.size()) {
+        std::cout << "Filtered " << finals.size()-goodcmp_finals.size() << " compound analyses" << std::endl;
+            }
     }
   }
 
-  // Remove excess analyses by N-best or N-weight classes
+  // Keep only the N best weight classes
   int classes_found = -1;
   Weight last_weight_class = 0.0;
-  LookupPathSet clipped_finals(LookupPath::compare_pointers);
-  LookupPathSet::const_iterator it=new_finals.begin();
-  // the for loop filters out > maxAnalyses analyses
-  for(int i=0;i<maxAnalyses && it != new_finals.end();i++,it++) {
-      // this condition filters out > maxWeightClasses
-      if(dynamic_cast<const LookupPathW*>(*it) != NULL) { // if we actually have weights
-	  Weight current_weight = dynamic_cast<const LookupPathW*>(*it)->get_weight();
-	  if (classes_found == -1) { // we're just starting
-	      classes_found = 1;
-	      last_weight_class = current_weight;
-	  } else if (last_weight_class != current_weight) { // we might want to ignore the rest due to weight classes
-	      last_weight_class = current_weight;
-	      ++classes_found;
-	  }
-	  if (classes_found > maxWeightClasses) {
-	      break; // don't insert any more
-	  }
+  LookupPathSet goodweight_finals(LookupPathW::compare_weights);
+  for(LookupPathSet::const_iterator it = goodcmp_finals.begin(); it != goodcmp_finals.end(); it++)
+  {
+          LookupPathW* pw = dynamic_cast<LookupPathW*>(*it);
+    if(pw != NULL) {
+      Weight current_weight = pw->get_weight();
+      if (classes_found == -1) // we're just starting
+      {
+        classes_found = 1;
+        last_weight_class = current_weight;
+      }
+      else if (last_weight_class != current_weight) // we might want to ignore the rest due to weight classes
+      {
+        last_weight_class = current_weight;
+        ++classes_found;
+      }
+      if (classes_found > maxWeightClasses)
+      {
+        break;
       }
-      clipped_finals.insert(*it);
+    }
+    goodweight_finals.insert(*it);
+  }
+  // Keep no more than maxAnalyses
+  LookupPathSet clipped_finals(LookupPathW::compare_weights);
+  LookupPathSet::const_iterator it = goodweight_finals.begin();
+  for(int i=0; i < maxAnalyses && it != goodweight_finals.end(); i++, it++)
+  {
+          clipped_finals.insert(*it);
   }
   return clipped_finals;
 }
 
 //////////Function definitions for ApertiumOutputFormatter
 
-std::set<std::string>
+ProcResult
 ApertiumOutputFormatter::process_finals(const LookupPathSet& finals, CapitalizationState caps) const
 {
-  std::set<std::string> results;
+  ProcResult results;
   LookupPathSet new_finals = preprocess_finals(finals);
-  
+
   for(LookupPathSet::const_iterator it=new_finals.begin(); it!=new_finals.end(); it++)
   {
     std::ostringstream res;
     res << token_stream.get_alphabet().symbols_to_string((*it)->get_output_symbols(), caps);
     if(dynamic_cast<const LookupPathW*>(*it) != NULL && displayWeightsFlag)
       res << '~' << dynamic_cast<const LookupPathW*>(*it)->get_weight() << '~';
-    
-    results.insert(res.str());
+
+    results.push_back(res.str());
   }
   return results;
 }
 
 void
-ApertiumOutputFormatter::print_word(const TokenVector& surface_form, 
-                                  std::set<std::string> const &analyzed_forms) const
+ApertiumOutputFormatter::print_word(const TokenVector& surface_form,
+                                  ProcResult const &analyzed_forms) const
 {
   // any superblanks in the surface form should not be printed as part of the
   // analysis output, but should be output directly afterwards
@@ -148,13 +159,13 @@ ApertiumOutputFormatter::print_word(const TokenVector& surface_form,
 
   if(printDebuggingInformationFlag)
     std::cout << "surface_form consists of " << output_surface_form.size() << " tokens" << std::endl;
-  
+
   token_stream.ostream() << '^';
   token_stream.write_escaped(output_surface_form);
-  for(std::set<std::string>::const_iterator it=analyzed_forms.begin(); it!=analyzed_forms.end(); it++)
+  for(ProcResult::const_iterator it=analyzed_forms.begin(); it!=analyzed_forms.end(); it++)
     token_stream.ostream() << "/" << *it;
   token_stream.ostream() << "$";
-  
+
   for(size_t i=0;i<superblanks.size();i++)
     token_stream.ostream() << token_stream.get_superblank(superblanks[i]);
 }
@@ -176,9 +187,9 @@ CGOutputFormatter::process_final(const SymbolNumberVector& symbols, Capitalizati
 {
   std::ostringstream res;
   size_t start_pos = 0;
-  
+
   res << '"'; // before start of lexical form
-  
+
   while(start_pos < symbols.size())
   {
     size_t tag_start = symbols.size();
@@ -188,22 +199,22 @@ CGOutputFormatter::process_final(const SymbolNumberVector& symbols, Capitalizati
       if(tag_start == symbols.size() &&
          token_stream.get_alphabet().is_tag(symbols[i]))
         tag_start = i;
-      
+
       if(compound_split == symbols.size())
       {
         std::string s = token_stream.get_alphabet().symbol_to_string(symbols[i]);
         if(s == "#" || s == "+" || s[s.length()-1] == '+')
           compound_split = i;
       }
-      
+
       if(tag_start != symbols.size() && compound_split != symbols.size())
         break;
     }
-    
+
     // grab the base form without tags
     res << token_stream.get_alphabet().symbols_to_string(
       SymbolNumberVector(symbols.begin()+start_pos,symbols.begin()+tag_start), caps);
-    
+
     // look for compounding. Don't output the tags for non-final segments
     if(compound_split != symbols.size())
     {
@@ -230,7 +241,7 @@ CGOutputFormatter::process_final(const SymbolNumberVector& symbols, Capitalizati
           {
             tag = tag.substr(1);
           }
-          
+
           res << (i==tag_start?"\t":" ") << tag;
         }
       }
@@ -243,35 +254,35 @@ CGOutputFormatter::process_final(const SymbolNumberVector& symbols, Capitalizati
           SymbolNumberVector(symbols.begin()+0,symbols.begin()+symbols.size()), caps);
         res << '"';
       }
-      
+
       break;
     }
   }
-  
+
   return res.str();
 }
 
-std::set<std::string>
+ProcResult
 CGOutputFormatter::process_finals(const LookupPathSet& finals, CapitalizationState caps) const
 {
-  std::set<std::string> results;
+  ProcResult results;
   LookupPathSet new_finals = preprocess_finals(finals);
-  
+
   for(LookupPathSet::const_iterator it=new_finals.begin(); it!=new_finals.end(); it++)
-    results.insert(process_final((*it)->get_output_symbols(), caps));
-  
+    results.push_back(process_final((*it)->get_output_symbols(), caps));
+
   return results;
 }
 
 void
 CGOutputFormatter::print_word(const TokenVector& surface_form,
-                                std::set<std::string> const &analyzed_forms) const
+                                ProcResult const &analyzed_forms) const
 {
   token_stream.ostream() << "\"<"
                          << token_stream.tokens_to_string(clear_superblanks(surface_form))
                          << ">\"" << std::endl;
-  
-  for(std::set<std::string>::const_iterator it=analyzed_forms.begin(); it!=analyzed_forms.end(); it++)
+
+  for(ProcResult::const_iterator it=analyzed_forms.begin(); it!=analyzed_forms.end(); it++)
     token_stream.ostream() << "\t" << *it << std::endl;
 }
 
@@ -286,84 +297,31 @@ CGOutputFormatter::print_unknown_word(const TokenVector& surface_form) const
 
 //////////Function definitions for XeroxOutputFormatter
 
-std::string
-XeroxOutputFormatter::process_final(const SymbolNumberVector& symbols, CapitalizationState caps) const
-{
-  std::ostringstream res;
-  size_t start_pos = 0;
-  
-  while(start_pos < symbols.size())
-  {
-    size_t tag_start = symbols.size();
-    size_t compound_split = symbols.size();
-    for(size_t i=start_pos; i<symbols.size(); i++)
-    {
-      if(tag_start == symbols.size() &&
-         token_stream.get_alphabet().is_tag(symbols[i]))
-        tag_start = i;
-      
-      if(compound_split == symbols.size())
-      {
-        std::string s = token_stream.get_alphabet().symbol_to_string(symbols[i]);
-        if(s == "#" || s == "+" || s[s.length()-1] == '+')
-          compound_split = i;
-      }
-      
-      if(tag_start != symbols.size() && compound_split != symbols.size())
-        break;
-    }
-    
-    // grab the analysis
-    res << token_stream.get_alphabet().symbols_to_string(
-      SymbolNumberVector(symbols.begin()+start_pos,symbols.begin()+symbols.size()), caps);
-
-    // When -r option is given, print the full analysis string as well
-    // (as a specially prefixed tag):
-    if(displayRawAnalysisInCG)
-    {
-      res << "+" << "∏" << '"';
-      res << token_stream.get_alphabet().symbols_to_string(
-        SymbolNumberVector(symbols.begin()+0,symbols.begin()+symbols.size()), caps);
-      res << '"';
-    }
-    
-    break;
-  }
-  
-  return res.str();
-}
-
-std::set<std::string>
+ProcResult
 XeroxOutputFormatter::process_finals(const LookupPathSet& finals, CapitalizationState caps) const
 {
-  std::set<std::string> results;
+  ProcResult results;
   LookupPathSet new_finals = preprocess_finals(finals);
-  
+
   for(LookupPathSet::const_iterator it=new_finals.begin(); it!=new_finals.end(); it++)
   {
     std::ostringstream res;
-//    res << token_stream.get_alphabet().symbols_to_string((*it)->get_output_symbols(), caps);
-//    if(dynamic_cast<const LookupPathW*>(*it) != NULL && displayWeightsFlag)
-//      res << "\t" << dynamic_cast<const LookupPathW*>(*it)->get_weight();
-//    
-    results.insert(process_final((*it)->get_output_symbols(), caps));
-
-    // add weights if requested:
+    res << token_stream.get_alphabet().symbols_to_string((*it)->get_output_symbols(), caps);
     if(dynamic_cast<const LookupPathW*>(*it) != NULL && displayWeightsFlag)
       res << "\t" << dynamic_cast<const LookupPathW*>(*it)->get_weight();
-    results.insert(res.str());
 
+    results.push_back(res.str());
   }
   return results;
 }
 
 void
 XeroxOutputFormatter::print_word(const TokenVector& surface_form,
-                                std::set<std::string> const &analyzed_forms) const
+                                ProcResult const &analyzed_forms) const
 {
   std::string surface = token_stream.tokens_to_string(clear_superblanks(surface_form));
-  
-  for(std::set<std::string>::const_iterator it=analyzed_forms.begin(); it!=analyzed_forms.end(); it++)
+
+  for(ProcResult::const_iterator it=analyzed_forms.begin(); it!=analyzed_forms.end(); it++)
     token_stream.ostream() << surface << "\t" << *it << std::endl;
   token_stream.ostream() << std::endl;
 }
@@ -374,4 +332,3 @@ XeroxOutputFormatter::print_unknown_word(const TokenVector& surface_form) const
   token_stream.ostream() << token_stream.tokens_to_string(clear_superblanks(surface_form))
                          << "\t+?" << std::endl << std::endl;
 }
-
diff --git a/tools/src/hfst-proc/formatter.h b/tools/src/hfst-proc/formatter.h
index 1b8c489..d696867 100644
--- a/tools/src/hfst-proc/formatter.h
+++ b/tools/src/hfst-proc/formatter.h
@@ -16,6 +16,8 @@
 #include "lookup-path.h"
 #include "tokenizer.h"
 
+typedef std::vector<std::string> ProcResult;
+
 /**
  * Abstract base class for handling the outputting of lookup results. Subclasses
  * implement different formatting systems.
@@ -53,10 +55,10 @@ class OutputFormatter
    * @param finals a list of lookup paths ending in final states
    * @param state the capitalization of the surface form
    */
-  virtual std::set<std::string> process_finals(const LookupPathSet& finals,
+  virtual ProcResult process_finals(const LookupPathSet& finals,
                                                   CapitalizationState state) const = 0;
   virtual void print_word(const TokenVector& surface_form, 
-                          std::set<std::string> const &analyzed_forms) const = 0;
+                          ProcResult const &analyzed_forms) const = 0;
   virtual void print_unknown_word(const TokenVector& surface_form) const = 0;
   
   /**
@@ -71,10 +73,10 @@ class ApertiumOutputFormatter: public OutputFormatter
  public:
   ApertiumOutputFormatter(TokenIOStream& s, bool f): OutputFormatter(s,f) {}
   
-  std::set<std::string> process_finals(const LookupPathSet& finals,
+  ProcResult process_finals(const LookupPathSet& finals,
                                           CapitalizationState state) const;
   void print_word(const TokenVector& surface_form, 
-                  std::set<std::string> const &analyzed_forms) const;
+                  ProcResult const &analyzed_forms) const;
   void print_unknown_word(const TokenVector& surface_form) const;
   
   bool preserve_nonalphabetic() const {return true;}
@@ -86,10 +88,10 @@ class CGOutputFormatter: public OutputFormatter
  public:
   CGOutputFormatter(TokenIOStream& s, bool f): OutputFormatter(s,f) {}
   
-  std::set<std::string> process_finals(const LookupPathSet& finals,
+  ProcResult process_finals(const LookupPathSet& finals,
                                           CapitalizationState caps) const;
   void print_word(const TokenVector& surface_form, 
-                  std::set<std::string> const &analyzed_forms) const;
+                  ProcResult const &analyzed_forms) const;
   void print_unknown_word(const TokenVector& surface_form) const;
   
   bool preserve_nonalphabetic() const {return false;}
@@ -101,10 +103,10 @@ class XeroxOutputFormatter: public OutputFormatter
  public:
   XeroxOutputFormatter(TokenIOStream& s, bool f): OutputFormatter(s,f) {}
   
-  std::set<std::string> process_finals(const LookupPathSet& finals,
+  ProcResult process_finals(const LookupPathSet& finals,
                                           CapitalizationState state) const;
   void print_word(const TokenVector& surface_form, 
-                  std::set<std::string> const &analyzed_forms) const;
+                  ProcResult const &analyzed_forms) const;
   void print_unknown_word(const TokenVector& surface_form) const;
   
   bool preserve_nonalphabetic() const {return false;}
diff --git a/tools/src/hfst-proc/lookup-path.h b/tools/src/hfst-proc/lookup-path.h
index d1c9f6a..8cdba48 100644
--- a/tools/src/hfst-proc/lookup-path.h
+++ b/tools/src/hfst-proc/lookup-path.h
@@ -135,7 +135,7 @@ class LookupPathW : public LookupPath
   Weight final_weight;
  public:
   LookupPathW(const ProcTransducer& t, const TransitionTableIndex initial): 
-  	LookupPath(t, initial), weight(0.0f), final_weight(0.0f) {}
+        LookupPath(t, initial), weight(0.0f), final_weight(0.0f) {}
   LookupPathW(const LookupPathW& o): LookupPath(o), weight(o.weight),
     final_weight(o.final_weight) {}
   
@@ -144,6 +144,17 @@ class LookupPathW : public LookupPath
   virtual void follow(const TransitionIndex& index);
   virtual bool follow(const Transition& transition);
   
+  static bool compare_weights(LookupPath* p1, LookupPath* p2) {
+          LookupPathW* pw1 = dynamic_cast<LookupPathW*>(p1);
+          LookupPathW* pw2 = dynamic_cast<LookupPathW*>(p2);
+          if(pw1 != NULL && pw2 != NULL) {
+                  return (*pw1) < (*pw2);
+          }
+          else {
+                  return (*p1) < (*p2);
+          }
+  }
+
   /**
    * This sorts first by weight then by the value of output_symbols
    */
diff --git a/tools/src/hfst-proc/tokenizer.cc b/tools/src/hfst-proc/tokenizer.cc
index 1be38c7..6591d8e 100644
--- a/tools/src/hfst-proc/tokenizer.cc
+++ b/tools/src/hfst-proc/tokenizer.cc
@@ -49,6 +49,7 @@ TokenIOStream::initialize_escaped_chars()
 void
 TokenIOStream::do_null_flush()
 {
+  std::cout << '\0';
   os.flush();
   if(os.bad())
     std::cerr << "Could not flush file" << std::endl;
@@ -190,12 +191,15 @@ Token
 TokenIOStream::make_token()
 {
   SymbolNumber s = symbolizer.extract_symbol(is);
-  if(s == 0) // EOF
+  if(s == 0)
+  {
+    // literal NUL without null-flushing
     return Token();
-  
+  }
+
   if(s != NO_SYMBOL_NUMBER)
     return Token::as_symbol(s);
-  
+
   // the next thing in the stream is not a symbol
   // (extract_symbol moved the stream back to before anything was read)
   std::string ch = read_utf8_char();
@@ -212,7 +216,12 @@ TokenIOStream::read_token()
   int next_char = is.peek();
   if(is.eof())
     return Token();
-  
+
+  if(next_char == 0 && null_flush) {
+    do_null_flush();
+    return Token::as_character(is.get());
+  }
+
   if(escaped_chars.find(next_char) != escaped_chars.end())
   {
     switch(next_char)
@@ -220,11 +229,11 @@ TokenIOStream::read_token()
       case '[':
         superblank_bucket.push_back(read_delimited(']'));
         return Token::as_superblank(superblank_bucket.size()-1);
-      
+
       case '\\':
         next_char = is.get(); // get the peeked char for real
         return Token::as_character(read_escaped());
-      
+
       case '<':
       {
         Token t = make_token();
@@ -232,7 +241,7 @@ TokenIOStream::read_token()
           return t;
         return Token::as_reservedcharacter('<');
       }
-      
+
       default:
         return Token::as_reservedcharacter((char)is.get());
     }
diff --git a/tools/src/hfst-proc2.cc b/tools/src/hfst-proc2.cc
index 839ac4c..942ddcc 100644
--- a/tools/src/hfst-proc2.cc
+++ b/tools/src/hfst-proc2.cc
@@ -44,6 +44,7 @@ using std::pair;
 #include "hfst-program-options.h"
 #include "hfst-tool-metadata.h"
 #include "implementations/optimized-lookup/pmatch.h"
+#include "HfstExceptionDefs.h"
 
 #include "inc/globals-common.h"
 #include "inc/globals-unary.h"
@@ -51,6 +52,7 @@ using std::pair;
 bool blankline_separated = true;
 bool print_all = false;
 bool print_weights = false;
+bool tokenize_multichar = false;
 std::string tokenizer_filename;
 enum OutputFormat {
     tokenize,
@@ -76,10 +78,13 @@ print_usage()
             "  -n  --newline          Newline as input separator (default is blank line)\n"
             "  -a  --print-all        Print nonmatching text\n"
             "  -w  --print-weight     Print weights\n"
+            "  --tokenize-multichar   Tokenize multicharacter symbols\n"
+            "                         (by default only one utf-8 character is tokenized at a time"
+            "                         regardless of what is present in the alphabet)"
             "  --segment              Segmenting / tokenization mode (default)\n"
             "  --xerox                Xerox output\n"
             "  --cg                   cg output\n"
-            " --finnpos               FinnPos output\n");
+            "  --finnpos              FinnPos output\n");
     fprintf(message_out, 
             "Use standard streams for input and output (for now).\n"
             "\n"
@@ -276,6 +281,7 @@ int parse_options(int argc, char** argv)
                 {"newline", no_argument, 0, 'n'},
                 {"print-all", no_argument, 0, 'a'},
                 {"print-weights", no_argument, 0, 'w'},
+                {"tokenize-multichar", no_argument, 0, 'm'},
                 {"segment", no_argument, 0, 't'},
                 {"xerox", no_argument, 0, 'x'},
                 {"cg", no_argument, 0, 'c'},
@@ -303,6 +309,9 @@ int parse_options(int argc, char** argv)
         case 'w':
             print_weights = true;
             break;
+        case 'm':
+            tokenize_multichar = true;
+            break;
         case 't':
             output_format = tokenize;
             break;
@@ -367,8 +376,16 @@ int main(int argc, char ** argv)
         std::cerr << "Could not open file " << tokenizer_filename << std::endl;
         return EXIT_FAILURE;
     }
-    hfst_ol::PmatchContainer container(instream);
-    container.set_verbose(verbose);
+    try {
+        hfst_ol::PmatchContainer container(instream);
+        container.set_verbose(verbose);
+        container.set_single_codepoint_tokenization(!tokenize_multichar);
+        return process_input(container, std::cout);
+    } catch(HfstException & e) {
+        std::cerr << "The archive in " << tokenizer_filename << " doesn't look right."
+            "\nDid you make it with hfst-pmatch2fst or make sure it's in weighted optimized-lookup format?\n";
+        return 1;
+    }
 //     if (outfile != stdout) {
 //         std::filebuf fb;
 // fb.open(outfilename, std::ios::out);
@@ -376,5 +393,5 @@ int main(int argc, char ** argv)
 // return process_input(container, outstream);
 // fb.close();
 //     } else {
-    return process_input(container, std::cout);
+
 }
diff --git a/tools/src/hfst-program-options.cc b/tools/src/hfst-program-options.cc
index b539c19..ec0c537 100644
--- a/tools/src/hfst-program-options.cc
+++ b/tools/src/hfst-program-options.cc
@@ -70,6 +70,7 @@ void print_common_binary_program_options(FILE *file) {
   fprintf(file, "Input/Output options:\n"
           "  -1, --input1=INFILE1   Read first input transducer from INFILE1\n"
           "  -2, --input2=INFILE2   Read second input transducer from INFILE2\n"
+          "  -C, --do-not-convert   Do not allow transducers to be converted into the same type\n"
           "  -o, --output=OUTFILE   Write results to OUTFILE\n");
 }
 
diff --git a/tools/src/hfst-program-options.h b/tools/src/hfst-program-options.h
index 8dfa56b..8dba329 100644
--- a/tools/src/hfst-program-options.h
+++ b/tools/src/hfst-program-options.h
@@ -52,20 +52,21 @@ void print_common_unary_string_program_options(FILE *file);
 
 // Text to one transducer: txt2fst
 // Text to transducer(s): strings2fst
-//	  "  -i, --input=FILENAME  	Read input text-file from FILENAME\n"
-//	  "  -o, --output=FILENAME 	Write output transducer(s) to FILENAME\n"
-//	  "  -R, --symbols=FILENAME 	Read symbol table from FILENAME\n"
-//	  "  -D, --do-not-write-symbols 	Do not write symbol table with the output transducer(s)\n"
-//	  "  -W, --write-symbols-to=FILENAME 	Write symbol table to file FILENAME\n"
+//        "  -i, --input=FILENAME       Read input text-file from FILENAME\n"
+//        "  -o, --output=FILENAME      Write output transducer(s) to FILENAME\n"
+//        "  -R, --symbols=FILENAME     Read symbol table from FILENAME\n"
+//        "  -D, --do-not-write-symbols         Do not write symbol table with the output transducer(s)\n"
+//        "  -W, --write-symbols-to=FILENAME    Write symbol table to file FILENAME\n"
 
 
 // Two transducers to one transducer: compose, concatenate, conjunct, disjunct, 
 void print_common_binary_program_options(FILE *file);
 void print_common_binary_program_parameter_instructions(FILE *file);
-#define HFST_GETOPT_BINARY_SHORT "1:2:o:"
+#define HFST_GETOPT_BINARY_SHORT "1:2:o:C"
 #define HFST_GETOPT_BINARY_LONG {"input1", required_argument, 0, '1'},\
     {"input2", required_argument, 0, '1'},\
-    {"output", required_argument, 0, 'o'}
+    {"output", required_argument, 0, 'o'},\
+    {"do-not-convert", no_argument, 0, 'C'}
 
 // Write separate commandline helps: compare, split, strings2fst, summarize, txt2fst
 
diff --git a/tools/src/hfst-regexp2fst.cc b/tools/src/hfst-regexp2fst.cc
index 0e3df9e..25ad3a5 100644
--- a/tools/src/hfst-regexp2fst.cc
+++ b/tools/src/hfst-regexp2fst.cc
@@ -123,8 +123,8 @@ print_usage()
 "  echo \" {cat}:{dog}::3 \" | %s    same but with weight 3\n"
 "  echo \" c:d a:o::3 t:g \" | %s    same but with weight 3\n"
 "                                               in the middle\n"
-"  echo \" {cat}:{dog} ; 3 \" | %s   legacy way of defining weights\n"
-"  echo \" cat ; dog ; 3 \" | %s -S  create transducers\n"
+//"  echo \" {cat}:{dog} ; 3 \" | %s   legacy way of defining weights\n"
+"  echo \" cat ; dog ; \"3\" \" | %s -S  create transducers\n"
 "                                               \"cat\" and \"dog\" and \"3\"\n"
                 "\n", program_name, program_name, program_name, program_name, program_name);
         print_report_bugs();
@@ -264,7 +264,8 @@ process_stream(HfstOutputStream& outstream)
   size_t len = 0;
   unsigned int line_count = 0;
   XreCompiler comp(output_format);
-  comp.set_verbosity(verbose, stderr);
+  comp.set_verbosity(verbose);
+  comp.set_error_stream(&std::cerr);
   comp.set_harmonization(harmonize);
   comp.set_flag_harmonization(harmonize_flags);
   HfstTransducer disjunction(output_format);
@@ -272,12 +273,6 @@ process_stream(HfstOutputStream& outstream)
   char delim = (line_separated)? '\n' : ';';  
   char* first_line = 0;
 
-  // todo: Not yet working until we know how weights should be handled, 
-  // For example input 'cat ; 3' is ambiguous 
-  // (regex [cat] with weight 3 or regex [cat] followed by regex [3])
-  // Another problem is that compile_first is not eager enough, so comments
-  // at the end get not parsed until next call which then gives an error
-  // message (for example the line 'cat ; ! a comment').
   if (!line_separated)
     {
       char * filebuf_ = hfst_file_to_mem(inputfilename);
@@ -295,13 +290,14 @@ process_stream(HfstOutputStream& outstream)
                 {
                   if (transducer_n == 1)
                     {
-                      warning(0, 0, "input contains only whitespace or comments");
+                      error(EXIT_FAILURE, 0, "%s: XRE parsing failed: expression #%u "
+                            "contains only whitespace or comments", inputfilename, 
+                            (unsigned int)transducer_n);
                     }
                   break;
                 }
               else
                 {
-                  std::cerr << comp.get_error_message() << std::endl;
                   error(EXIT_FAILURE, 0, "%s: XRE parsing failed"
                         "in expression #%u separated by semicolons", inputfilename,
                         (unsigned int)transducer_n);
@@ -332,10 +328,16 @@ process_stream(HfstOutputStream& outstream)
     }
   else
     {
+      bool input_contains_only_whitespace_or_comments = true;
       while (true)
         {
           if (hfst_getdelim(&line, &len, delim, inputfile) == -1)
             {
+              if (input_contains_only_whitespace_or_comments)
+                {
+                  error(EXIT_FAILURE, 0, "%s: XRE parsing failed:"
+                        " input contains only whitespace or comments", inputfilename);
+                }
               break;
             }
           if (first_line == 0)
@@ -359,41 +361,26 @@ process_stream(HfstOutputStream& outstream)
           compiled = comp.compile(exp);
           if (compiled == NULL)
             {
-              if (comp.contained_only_comments())
+              if (!comp.contained_only_comments())
                 {
-                  if (transducer_n == 1)
-                    {
-                      warning(0, 0, "input contains only whitespace or comments");
-                    }
-                  break;
+                  error_at_line(EXIT_FAILURE, 0, inputfilename, line_count,
+                                "XRE parsing failed");
                 }
-              else {
-              //if (line_separated)
-              //{
-                std::cerr << comp.get_error_message() << std::endl;
-                error_at_line(EXIT_FAILURE, 0, inputfilename, line_count,
-                              "XRE parsing failed");
-              }
-                  //else
-                  //{
-                  //error(EXIT_FAILURE, 0, "%s: XRE parsing failed"
-                  //      "in expression #%u separated semicolons", inputfilename,
-                  //      line_count);
-                  //}
+              continue;
             }
-          if (compiled != NULL)
+          input_contains_only_whitespace_or_comments = false;
+
+          if (disjunct_expressions)
             {
-              if (disjunct_expressions)
-                {
-                  disjunction.disjunct(*compiled, harmonize);
-                }
-              else
-                {
-                  hfst_set_name(*compiled, "?", "xre");
-                  outstream << *compiled;
-                }
-              delete compiled;
+              disjunction.disjunct(*compiled, harmonize);
+            }
+          else
+            {
+              hfst_set_name(*compiled, "?", "xre");
+              outstream << *compiled;
             }
+          delete compiled;
+          
         }
     }
 
diff --git a/tools/src/hfst-remove-epsilons.cc b/tools/src/hfst-remove-epsilons.cc
index 5168b50..cd9cc1c 100644
--- a/tools/src/hfst-remove-epsilons.cc
+++ b/tools/src/hfst-remove-epsilons.cc
@@ -113,6 +113,9 @@ process_stream(HfstInputStream& instream, HfstOutputStream& outstream)
   //instream.open();
   //outstream.open();
     
+  if (!silent)
+    hfst::set_warning_stream(&std::cerr);
+
     size_t transducer_n=0;
     while(instream.is_good())
     {
diff --git a/tools/src/hfst-shuffle.cc b/tools/src/hfst-shuffle.cc
index fa06929..390ffb1 100644
--- a/tools/src/hfst-shuffle.cc
+++ b/tools/src/hfst-shuffle.cc
@@ -107,18 +107,45 @@ parse_options(int argc, char** argv)
 }
 
 int
-shuffle_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                    HfstOutputStream& outstream)
+shuffle_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
-    // there must be at least one transducer in both input streams
-    bool continueReading = firststream.is_good() && secondstream.is_good();
+  // there must be at least one transducer in both input streams
+  bool continueReading = firststream.is_good() && secondstream.is_good();
+
+  hfst::ImplementationType type1 = firststream.get_type();
+  hfst::ImplementationType type2 = secondstream.get_type();
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+  if (type1 != type2)
+    {
+      if (allow_transducer_conversion)
+        {
+          int ct = conversion_type(type1, type2);
+          std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+          if (ct == 1)
+            { warnstr.append("using former type as output"); output_type = type1; }
+          else if (ct == 2)
+            { warnstr.append("using latter type as output"); output_type = type2; }
+          else if (ct == -1)
+            { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+          else /* should not happen */
+            { throw "Error: hfst-shuffle: conversion_type returned an invalid integer"; }
+          warning(0, 0, warnstr.c_str());
+        }
+      else
+        {
+          error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                "formats %s and %s are not compatible for shuffle (--do-not-convert was requested)",
+                firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+        }
+    }
+  else
+    {
+      output_type = type1;
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
 
-    if (firststream.get_type() != secondstream.get_type())
-      {
-        warning(0, 0, "Tranducer type mismatch in %s and %s; "
-              "using former type as output",
-              firstfilename, secondfilename);
-      }
     HfstTransducer * first=0;
     HfstTransducer * second=0;
     size_t transducer_n_first = 0; // transducers read from first stream
@@ -145,18 +172,29 @@ shuffle_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
             verbose_printf("Shuffling %s and %s... " SIZE_T_SPECIFIER "\n",
                            firstname, secondname, transducer_n_first);
         }
-        try
-          {
-            first->shuffle(*second);
-          }
-        catch (TransducerTypeMismatchException ttme)
-          {
-            error(EXIT_FAILURE, 0, "Could not shuffle %s and %s [" SIZE_T_SPECIFIER "]\n"
-                  "formats %s and %s are not compatible for shuffling",
-                  firstname, secondname, transducer_n_first,
-                  hfst_strformat(firststream.get_type()),
-                  hfst_strformat(secondstream.get_type()));
-          }
+
+        try {
+          try
+            {
+              first->shuffle(*second /*, harmonize=true*/);
+            }
+          catch (TransducerTypeMismatchException ttme)
+            {
+              if (allow_transducer_conversion)
+                {
+                  convert_transducers(*first, *second);
+                  first->shuffle(*second/*, harmonize=true*/);
+                }
+              else
+                {
+                  error(EXIT_FAILURE, 0, "Could not shuffle %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                        "formats %s and %s are not compatible for shuffling (--do-not-convert was requested)",
+                        firstname, secondname, transducer_n_first,
+                        hfst_strformat(firststream.get_type()),
+                        hfst_strformat(secondstream.get_type()));
+                }
+            }
+        }
         catch (TransducersAreNotAutomataException tanae)
           {
             error(EXIT_FAILURE, 0, "Could not shuffle %s and %s [" SIZE_T_SPECIFIER "]\n"
@@ -164,8 +202,8 @@ shuffle_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
                   firstname, secondname, transducer_n_first);
           }
 
-        hfst_set_name(*first, *first, *second, "union");
-        hfst_set_formula(*first, *first, *second, "∪");
+        hfst_set_name(*first, *first, *second, "shuffle");
+        hfst_set_formula(*first, *first, *second, "shuffle");
         outstream << *first;
 
         continueReading = firststream.is_good() && 
@@ -253,9 +291,6 @@ int main( int argc, char **argv ) {
         error(EXIT_FAILURE, 0, "%s is not a valid transducer file",
               secondfilename);
     }
-    HfstOutputStream* outstream = (outfile != stdout) ?
-        new HfstOutputStream(outfilename, firststream->get_type()) :
-        new HfstOutputStream(firststream->get_type());
 
     if ( is_input_stream_in_ol_format(firststream, "hfst-shuffle") ||
          is_input_stream_in_ol_format(secondstream, "hfst-shuffle") )
@@ -263,10 +298,9 @@ int main( int argc, char **argv ) {
         return EXIT_FAILURE;
       }
 
-    retval = shuffle_streams(*firststream, *secondstream, *outstream);
+    retval = shuffle_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
-    delete outstream;
     free(firstfilename);
     free(secondfilename);
     free(outfilename);
diff --git a/tools/src/hfst-string-conversions.cc b/tools/src/hfst-string-conversions.cc
index 32c75ef..604fb68 100644
--- a/tools/src/hfst-string-conversions.cc
+++ b/tools/src/hfst-string-conversions.cc
@@ -1,7 +1,7 @@
 #ifdef WINDOWS
-#  include <windows.h>
-#  include <string>
-#endif // WINDOWS
+
+#include <windows.h>
+#include <string>
 
 #include <cstdarg>
 #include <cstdio>
@@ -10,31 +10,12 @@
 
 namespace hfst 
 {
-#ifdef WINDOWS
-  /*  std::string wide_string_to_string(const std::wstring & wstr)
-    {
-      int size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), NULL, 0, NULL, NULL);
-      std::string str( size_needed, 0 );
-      WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), &str[0], size_needed, NULL, NULL);
-      return str;
-      }*/
-#endif // WINDOWS*/
-
-#ifdef WINDOWS
-  bool output_to_console = false;
-  void print_output_to_console(bool val) { output_to_console = val; }
-  bool is_output_printed_to_console() { return output_to_console; }
-#else
-  void print_output_to_console(bool val) { (void)val; }
-  bool is_output_printed_to_console() { return false; }
-#endif // WINDOWS
-
-  int hfst_fprintf(FILE * stream, const char * format, ...)
+  int hfst_fprintf_console(FILE * stream, const char * format, ...)
   {
     va_list args;
     va_start(args, format);
-#ifdef WINDOWS
-    if (output_to_console && (stream == stdout || stream == stderr))
+
+    if ((stream == stdout || stream == stderr))
       {
         char buffer [1024];
         int r = vsprintf(buffer, format, args);
@@ -63,14 +44,8 @@ namespace hfst
         va_end(args);
         return retval;
       }
-#else
-    int retval = vfprintf(stream, format, args);
-    va_end(args);
-    return retval;
-#endif // WINDOWS
   }
 
-#ifdef WINDOWS
   bool get_line_from_console(std::string & str, size_t buffer_size, bool keep_newline /* = false*/)
   {
     bool DEBUG = false;  
@@ -126,6 +101,7 @@ namespace hfst
   {
     SetConsoleCP(65001);
   }
-#endif // WINDOWS
 
 } // namespace hfst
+
+#endif // WINDOWS
diff --git a/tools/src/hfst-string-conversions.h b/tools/src/hfst-string-conversions.h
index 87b1866..0c22571 100644
--- a/tools/src/hfst-string-conversions.h
+++ b/tools/src/hfst-string-conversions.h
@@ -1,13 +1,10 @@
 #ifdef WINDOWS
-#  include <string>
-#endif // WINDOWS
 
+#include <string>
 #include <cstdio>
 
 namespace hfst 
 {
-
-#ifdef WINDOWS
   /* Convert utf-8 string \a wstr into an ordinary string. */
   //std::string wide_string_to_string(const std::wstring & wstr);
   /* Get a line from console input and store it into \a str.
@@ -16,18 +13,10 @@ namespace hfst
   bool get_line_from_console(std::string & str, size_t buffer_size, bool keep_newline = false);
 
   void set_console_cp_to_utf8();
-#endif // WINDOWS
 
-  /* Whether hfst_fprintf prints directly to console output.
-         Has no effect on linux or mac. */
-  void print_output_to_console(bool val);
-  /* Return whether hfst_fprintf prints directly to console output.
-         The default is false. */
-  bool is_output_printed_to_console();
-
-  /* Wrapper around fprintf that prints to console output,
-         is_output_printed_to_console is true. 
+  /* Wrapper around fprintf that prints to console output if stream is stdout or stderr.
          On linux and mac, calls always fprintf directly. */
-  int hfst_fprintf(FILE * stream, const char * format, ...);
-
+  int hfst_fprintf_console(FILE * stream, const char * format, ...);
 }
+
+#endif // WINDOWS
diff --git a/tools/src/hfst-substitute.cc b/tools/src/hfst-substitute.cc
index df6d0a2..8cf5d77 100644
--- a/tools/src/hfst-substitute.cc
+++ b/tools/src/hfst-substitute.cc
@@ -79,6 +79,7 @@ static bool delayed = false;
 static HfstSymbolSubstitutions* label_substitution_map = 0;
 static HfstSymbolPairSubstitutions* pair_substitution_map = 0;
 static bool in_order = false;
+static bool allow_transducer_conversion = true;
 
 /**
  * @brief parse string pair from arc label.
@@ -166,6 +167,9 @@ print_usage()
             "  -F, --from-file=LABELFILE    read replacements from LABELFILE\n"
             "  -R, --in-order               keep the order of the replacements\n"
             "                               (with -F)\n"
+            "Input options:\n"
+            "  -C, --do-not-convert         require that transducers in TFILE and INFILE\n"
+            "                               have the same type\n"
             "Transient optimisation schemes:\n"
             "  -9, --compose                compose substitutions when possible\n"
            );
@@ -211,12 +215,13 @@ parse_options(int argc, char** argv)
             {"to-transducer", required_argument, 0, 'T'},
             {"in-order", no_argument, 0, 'R'},
             {"compose", no_argument, 0, '9'},
+            {"do-not-convert", no_argument, 0, 'C'},
             {0,0,0,0}
         };
         int option_index = 0;
         // add tool-specific options here 
         char c = getopt_long(argc, argv, HFST_GETOPT_COMMON_SHORT
-                             HFST_GETOPT_UNARY_SHORT "f:F:t:T:R9",
+                             HFST_GETOPT_UNARY_SHORT "f:F:t:T:R9C",
                              long_options, &option_index);
         if (-1 == c)
         {
@@ -284,6 +289,9 @@ parse_options(int argc, char** argv)
         case '9':
             compose = true;
             break;
+        case 'C':
+            allow_transducer_conversion = false;
+            break;
 #include "inc/getopt-cases-error.h"
         }
     }
@@ -528,25 +536,67 @@ perform_delayed(HfstTransducer& trans)
 }
 
 int
-process_stream(HfstInputStream& instream, HfstOutputStream& outstream)
+process_stream(HfstInputStream& instream)
 {
   bool symbol_pair_map_in_use=false;
   bool symbol_map_in_use=false;
 
   size_t transducer_n = 0;
+
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+
   HfstTransducer* to_transducer = NULL;
-  if (to_transducer_filename)
+  if (to_transducer_filename != NULL)
     {
       try {
         HfstInputStream tostream(to_transducer_filename);
         to_transducer = new HfstTransducer(tostream);
+        tostream.close();
       } catch (NotTransducerStreamException ntse)  
         {
           error(EXIT_FAILURE, 0, "%s is not a valid transducer file",
                 to_transducer_filename);
           return EXIT_FAILURE;
         }
+      hfst::ImplementationType to_transducer_type = to_transducer->get_type();
+      hfst::ImplementationType instream_type = instream.get_type();
+      if (to_transducer_type != instream_type)
+          {
+            if (allow_transducer_conversion)
+              {
+                int ct = conversion_type(instream_type, to_transducer_type);
+                std::string warnstr("Transducer type mismatch in " + std::string(inputfilename) + " and " + std::string(to_transducer_filename) + "; ");
+                if (ct == 1)
+                  { warnstr.append("using former type as output"); output_type = instream_type; }
+                else if (ct == 2)
+                  { warnstr.append("using latter type as output"); output_type = to_transducer_type; }
+                else if (ct == -1)
+                  { warnstr.append("using former type as output, loss of information is possible"); output_type = instream_type; }
+                else /* should not happen */
+                  { throw "Error: hfst-disjunct: conversion_type returned an invalid integer"; }
+                warning(0, 0, warnstr.c_str());
+                to_transducer->convert(output_type);
+              }
+            else
+              {
+                error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                      "formats %s and %s are not compatible for substitution (--do-not-convert was requested)",
+                      inputfilename, to_transducer_filename, hfst_strformat(instream_type), hfst_strformat(to_transducer_type));
+              }
+          }
+      else
+        {
+          output_type = instream.get_type();
+        }
     }
+  else
+    {
+      output_type = instream.get_type();
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
+
   HfstBasicTransducer* fallback = 0;
   bool warnedAlready = false;
   bool fellback = false;
@@ -872,16 +922,13 @@ int main( int argc, char **argv )
           inputfilename);
             return EXIT_FAILURE;
     }
-    HfstOutputStream* outstream = (outfile != stdout) ?
-            new HfstOutputStream(outfilename, instream->get_type()) :
-            new HfstOutputStream(instream->get_type());
 
     if ( is_input_stream_in_ol_format(instream, "hfst-substitute"))
       {
         return EXIT_FAILURE;
       }
 
-    process_stream(*instream, *outstream);
+    process_stream(*instream);
     free(inputfilename);
     free(outfilename);
     return EXIT_SUCCESS;
diff --git a/tools/src/hfst-subtract.cc b/tools/src/hfst-subtract.cc
index 0d9a0dc..198f626 100644
--- a/tools/src/hfst-subtract.cc
+++ b/tools/src/hfst-subtract.cc
@@ -123,18 +123,45 @@ parse_options(int argc, char** argv)
 }
 
 int
-subtract_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
-                 HfstOutputStream& outstream)
+subtract_streams(HfstInputStream& firststream, HfstInputStream& secondstream)
 {
-    // there must be at least one transducer in both input streams
-    bool continueReading = firststream.is_good() && secondstream.is_good();
+  // there must be at least one transducer in both input streams
+  bool continueReading = firststream.is_good() && secondstream.is_good();
+
+  hfst::ImplementationType type1 = firststream.get_type();
+  hfst::ImplementationType type2 = secondstream.get_type();
+  hfst::ImplementationType output_type = hfst::UNSPECIFIED_TYPE;
+  if (type1 != type2)
+    {
+      if (allow_transducer_conversion)
+        {
+          int ct = conversion_type(type1, type2);
+          std::string warnstr("Transducer type mismatch in " + std::string(firstfilename) + " and " + std::string(secondfilename) + "; ");
+          if (ct == 1)
+            { warnstr.append("using former type as output"); output_type = type1; }
+          else if (ct == 2)
+            { warnstr.append("using latter type as output"); output_type = type2; }
+          else if (ct == -1)
+            { warnstr.append("using former type as output, loss of information is possible"); output_type = type1; }
+          else /* should not happen */
+            { throw "Error: hfst-subtract: conversion_type returned an invalid integer"; }
+          warning(0, 0, warnstr.c_str());
+        }
+      else
+        {
+          error(EXIT_FAILURE, 0, "Transducer type mismatch in %s and %s; "
+                "formats %s and %s are not compatible for subtraction (--do-not-convert was requested)",
+                firstfilename, secondfilename, hfst_strformat(type1), hfst_strformat(type2));
+        }
+    }
+  else
+    {
+      output_type = type1;
+    }
+
+  HfstOutputStream outstream = (outfile != stdout) ?
+    HfstOutputStream(outfilename, output_type) : HfstOutputStream(output_type);
 
-    if (firststream.get_type() != secondstream.get_type())
-      {
-        warning(0, 0, "Tranducer type mismatch in %s and %s; "
-              "using former type as output",
-              firstfilename, secondfilename);
-      }
     HfstTransducer * first=0;
     HfstTransducer * second=0;
     size_t transducer_n_first = 0; // transducers read from first stream
@@ -190,11 +217,19 @@ subtract_streams(HfstInputStream& firststream, HfstInputStream& secondstream,
           }
         catch (TransducerTypeMismatchException ttme)
           {
-            error(EXIT_FAILURE, 0, "Could not subtract %s from %s [" SIZE_T_SPECIFIER "]\n"
-                  "formats %s and %s are not compatible for subtraction",
-                  secondname, firstname, transducer_n_first,
-                  hfst_strformat(secondstream.get_type()),
-                  hfst_strformat(firststream.get_type()));
+            if (allow_transducer_conversion)
+              {
+                convert_transducers(*first, *second);
+                first->subtract(*second, harmonize);
+              }
+            else
+              {
+                error(EXIT_FAILURE, 0, "Could not subtract %s and %s [" SIZE_T_SPECIFIER "]:\n"
+                      "formats %s and %s are not compatible for subtraction (--do-not-convert was requested)",
+                      firstname, secondname, transducer_n_first,
+                      hfst_strformat(firststream.get_type()),
+                      hfst_strformat(secondstream.get_type()));
+              }
           }
         hfst_set_name(*first, *first, *second, "subtract");
         hfst_set_formula(*first, *first, *second, "−");
@@ -296,10 +331,9 @@ int main( int argc, char **argv ) {
         return EXIT_FAILURE;
       }
 
-    retval = subtract_streams(*firststream, *secondstream, *outstream);
+    retval = subtract_streams(*firststream, *secondstream);
     delete firststream;
     delete secondstream;
-    delete outstream;
     free(firstfilename);
     free(secondfilename);
     free(outfilename);
diff --git a/tools/src/hfst-txt2fst.cc b/tools/src/hfst-txt2fst.cc
index 2d99541..1c60826 100644
--- a/tools/src/hfst-txt2fst.cc
+++ b/tools/src/hfst-txt2fst.cc
@@ -60,6 +60,8 @@ static bool use_numbers=false; // not used
 // printname for epsilon
 static char *epsilonname=NULL;
 static const unsigned int EPSILON_KEY=0;
+// check if there are epsilon cycles with a negative weight
+bool check_negative_epsilon_cycles = false;
 
 void
 print_usage()
@@ -74,7 +76,10 @@ print_usage()
     fprintf(message_out, "Text and format options:\n"
             "  -f, --format=FMT    Write result using FMT as backend format\n"
             "  -e, --epsilon=EPS   Interpret string EPS as epsilon in att format\n"
-            "  -p, --prolog        Read prolog format instead of att\n" );
+            "  -p, --prolog        Read prolog format instead of att\n");
+    fprintf(message_out, "Other options:\n"
+            "  -C, --check-negative-epsilon-cycles  Issue a warning if there are epsilon cycles\n"
+            "                                       with a negative weight in the transducer\n");
     fprintf(message_out, "\n");
     fprintf(message_out, 
         "If OUTFILE or INFILE is missing or -, standard streams will be used.\n"
@@ -108,12 +113,13 @@ parse_options(int argc, char** argv)
             {"number", no_argument, 0, 'n'},
             {"format", required_argument, 0, 'f'}, 
             {"prolog", no_argument, 0, 'p'}, 
+            {"check-negative-epsilon-cycles", no_argument, 0, 'C'}, 
             {0,0,0,0}
         };
         int option_index = 0;
         // add tool-specific options here 
         char c = getopt_long(argc, argv, HFST_GETOPT_COMMON_SHORT
-                             HFST_GETOPT_UNARY_SHORT "e:nf:p",
+                             HFST_GETOPT_UNARY_SHORT "e:nf:pC",
                              long_options, &option_index);
         if (-1 == c)
         {
@@ -137,6 +143,9 @@ break;
         case 'f':
             output_format = hfst_parse_format_name(optarg);
             break;
+        case 'C':
+            check_negative_epsilon_cycles = true;
+            break;
 #include "inc/getopt-cases-error.h"
           }
     }
@@ -156,6 +165,13 @@ break;
                 "with tropical weight class\n");
       }
 
+    if (output_format == hfst::XFSM_TYPE && read_prolog_format && check_negative_epsilon_cycles)
+      {
+        error(EXIT_FAILURE, 0, "Error: checking negative epsilon cycles not supported when reading in prolog format\n"
+              "and outputting in xfsm format.\n");
+        return EXIT_FAILURE;
+      }
+
     return EXIT_CONTINUE;
 }
 
@@ -199,6 +215,23 @@ process_stream(HfstOutputStream& outstream)
           try {
             HfstBasicTransducer fsm = 
               HfstBasicTransducer::read_in_prolog_format(inputfile, linecount);
+
+            if (check_negative_epsilon_cycles)
+              {
+                verbose_printf("Checking if the transducer has epsilon cycles with a negative weight...\n");
+                if (fsm.has_negative_epsilon_cycles())
+                  {
+                    if (!silent)
+                      {
+                        warning(0, 0, "Transducer has epsilon cycles with a negative weight.\n");
+                      }
+                  }
+                else
+                  {
+                    verbose_printf("No epsilon cycles with a negative weight detected...\n");
+                  }
+              }
+
             HfstTransducer t(fsm, output_format);
             hfst_set_name(t, inputfilename, "text");
             hfst_set_formula(t, inputfilename, "T");
@@ -218,6 +251,22 @@ process_stream(HfstOutputStream& outstream)
                              linecount);
             hfst_set_name(t, inputfilename, "text");
             hfst_set_formula(t, inputfilename, "T");
+            if (check_negative_epsilon_cycles)
+              {
+                verbose_printf("Checking if the transducer has epsilon cycles with a negative weight...\n");
+                hfst::implementations::HfstBasicTransducer fsm(t);
+                if (fsm.has_negative_epsilon_cycles())
+                  {
+                    if (!silent)
+                      {
+                        warning(0, 0, "Transducer has epsilon cycles with a negative weight.\n");
+                      }
+                  }
+                else
+                  {
+                    verbose_printf("No epsilon cycles with a negative weight detected...\n");
+                  }
+              }
             outstream << t;
           }
           catch (NotValidAttFormatException e) {
diff --git a/tools/src/inc/getopt-cases-binary.h b/tools/src/inc/getopt-cases-binary.h
index d8a21ea..6783bbd 100644
--- a/tools/src/inc/getopt-cases-binary.h
+++ b/tools/src/inc/getopt-cases-binary.h
@@ -31,3 +31,6 @@ case '2':
   }
   secondNamed = true;
   break;
+case 'C':
+  allow_transducer_conversion=false;
+  break;
diff --git a/tools/src/inc/globals-binary.h b/tools/src/inc/globals-binary.h
index b650d7c..3bee67d 100644
--- a/tools/src/inc/globals-binary.h
+++ b/tools/src/inc/globals-binary.h
@@ -19,4 +19,4 @@
   FILE *secondfile = stdin;
   bool secondNamed = false;
   bool is_input_stdin = true;
-  
+  bool allow_transducer_conversion = true;
diff --git a/tools/src/parsers/Makefile.am b/tools/src/parsers/Makefile.am
index f265dd1..220a7fc 100644
--- a/tools/src/parsers/Makefile.am
+++ b/tools/src/parsers/Makefile.am
@@ -17,15 +17,16 @@
 
 SUBDIRS=test
 
-hfst_xfst_SOURCES = xfst-lexer.ll xfst-parser.yy xfst-utils.cc XfstCompiler.cc hfst-xfst.cc $(HFST_COMMON_SRC)
+#hfst_xfst_SOURCES = xfst-lexer.ll xfst-parser.yy xfst-utils.cc XfstCompiler.cc hfst-xfst.cc $(HFST_COMMON_SRC)
+hfst_xfst_SOURCES = hfst-xfst.cc $(HFST_COMMON_SRC)
 
-BUILT_SOURCES=xfst-parser.cc xfst-lexer.cc
-CLEANFILES=xfst-parser.cc xfst-lexer.cc xfst-parser.hh
+#BUILT_SOURCES=xfst-parser.cc xfst-lexer.cc
+#CLEANFILES=xfst-parser.cc xfst-lexer.cc xfst-parser.hh
 
-CLEANFILES+=xfst-parser.hh
+#CLEANFILES+=xfst-parser.hh
 
-AM_YFLAGS=-d
-AM_LFLAGS=--outfile=$(LEX_OUTPUT_ROOT).c
+#AM_YFLAGS=-d
+#AM_LFLAGS=--outfile=$(LEX_OUTPUT_ROOT).c
 
 AM_CPPFLAGS = -I${top_srcdir}/libhfst/src -I${top_srcdir}/libhfst/src/parsers -I${top_srcdir}/tools/src $(GLIB_CPPFLAGS) -Wno-deprecated
 
@@ -44,9 +45,9 @@ if WANT_XFST
 MAYBE_XFST=hfst-xfst
 endif
 
-noinst_HEADERS = XfstCompiler.h xfst-utils.h xfst-parser.hh
+#noinst_HEADERS = XfstCompiler.h xfst-utils.h xfst-parser.hh
 
-HFST_COMMON_SRC=../hfst-program-options.cc ../hfst-commandline.cc ../hfst-tool-metadata.cc ../HfstStrings2FstTokenizer.cc ../hfst-file-to-mem.cc ../hfst-string-conversions.cc xfst_help_message.cc
+HFST_COMMON_SRC=../hfst-program-options.cc ../hfst-commandline.cc ../hfst-tool-metadata.cc ../hfst-file-to-mem.cc # ../hfst-string-conversions.cc xfst_help_message.cc
 
 bin_PROGRAMS=$(MAYBE_XFST)
 
@@ -58,9 +59,9 @@ endif
 
 #xfst-parser.h: xfst-parser.cc
 
-xfst-parser.cc: xfst-parser.yy
+#xfst-parser.cc: xfst-parser.yy
 
-xfst-lexer.cc: xfst-lexer.ll
+#xfst-lexer.cc: xfst-lexer.ll
 
-EXTRA_DIST=init_help.cc cmd.h abbrcmd.h xfst_help_message.h xfst-parser.cc xfst-lexer.cc xfst-parser.hh
+EXTRA_DIST=init_help.cc cmd.h abbrcmd.h # xfst_help_message.h xfst-parser.cc xfst-lexer.cc xfst-parser.hh
 
diff --git a/tools/src/parsers/hfst-xfst.cc b/tools/src/parsers/hfst-xfst.cc
index 48f9ffd..e9f3cb3 100644
--- a/tools/src/parsers/hfst-xfst.cc
+++ b/tools/src/parsers/hfst-xfst.cc
@@ -265,7 +265,6 @@ static bool expression_continues(std::string & expr)
   return false;
 }
 
-
 #ifdef HAVE_READLINE
 #include "cmd.h"
 #include "abbrcmd.h"
@@ -473,7 +472,22 @@ int main(int argc, char** argv)
 
           if (0 != comp.parse_line((expression + "\n").c_str()))
             {
-              fprintf(stderr, "expression '%s' could not be parsed\n", expression.c_str());
+#ifdef WINDOWS
+              if (!pipe_output)
+                hfst::hfst_fprintf_console(stderr, "expression '%s' could not be parsed\n", expression.c_str());
+              else
+#endif
+                fprintf(stderr, "expression '%s' could not be parsed\n", expression.c_str());
+              if (comp.get("quit-on-fail") == "ON")
+                {
+                  return EXIT_FAILURE;
+                }
+              if (!silent)
+                comp.prompt();
+            }
+          if (comp.quit_requested())
+            {
+              break;
             }
 
           expression = "";
@@ -513,7 +527,20 @@ int main(int argc, char** argv)
 
           if (0 != comp.parse_line((expression + "\n").c_str()))
             {
-              fprintf(stderr, "expression '%s' could not be parsed\n", expression.c_str());
+#ifdef WINDOWS
+              if (!pipe_output)
+                hfst::hfst_fprintf_console(stderr, "expression '%s' could not be parsed\n", expression.c_str());
+              else
+#endif
+                fprintf(stderr, "expression '%s' could not be parsed\n", expression.c_str());
+              if (comp.get("quit-on-fail") == "ON")
+                {
+                  return EXIT_FAILURE;
+                }
+            }
+          if (comp.quit_requested())
+            {
+              break;
             }
           
           expression = "";
diff --git a/tools/src/parsers/test/Makefile.am b/tools/src/parsers/test/Makefile.am
index 72f236a..908dd76 100644
--- a/tools/src/parsers/test/Makefile.am
+++ b/tools/src/parsers/test/Makefile.am
@@ -61,6 +61,7 @@ EXTRA_DIST=test.sh \
 	print_labels.xfst print_labels.output \
 	print_label_tally.xfst print_label_tally.output \
 	shortest_string.xfst shortest_string.output \
+	flag_with_unknown.xfst flag_with_unknown.output \
 	test_sublanguage_true.xfst test_sublanguage_false.xfst \
 	test_overlap_true.xfst test_overlap_false.xfst \
 	test_true.output test_false.output \
@@ -170,5 +171,16 @@ EXTRA_DIST=test.sh \
 	xerox_composition.xfst xerox_composition.output \
 	compile_replace_1.xfst compile_replace_1.output \
 	compile_replace_2.xfst compile_replace_2.output \
-	compile_replace_3.xfst compile_replace_3.output
+	compile_replace_3.xfst compile_replace_3.output \
+	replace_markup_1.att replace_markup_1.xfst \
+	replace_markup_2.att replace_markup_2.xfst \
+	replace_markup_3.att replace_markup_3.xfst \
+	replace_markup_4.att replace_markup_4.xfst \
+	replace_markup_5.att replace_markup_5.xfst \
+	replace_markup_6.att replace_markup_6.xfst \
+	replace_markup_7.att replace_markup_7.xfst \
+	priority_union_1.att priority_union_1.att \
+	priority_union_2.att priority_union_2.att \
+	priority_union_3.att priority_union_3.att \
+	priority_union_4.att priority_union_4.att
 check_DATA=test.sh
diff --git a/tools/src/parsers/test/contains_with_weight.output b/tools/src/parsers/test/contains_with_weight.output
index 621d6b2..a086e8f 100644
--- a/tools/src/parsers/test/contains_with_weight.output
+++ b/tools/src/parsers/test/contains_with_weight.output
@@ -8,3 +8,9 @@ abcabcbazabc	3.0
 ba	1.0
 aba	2.0
 abaa	3.0
+--
+???
+bar	-1.0
+fooa	-1.0
+afooa	-2.0
+abara	-3.0
diff --git a/tools/src/parsers/test/contains_with_weight.xfst b/tools/src/parsers/test/contains_with_weight.xfst
index 38088b1..7015340 100644
--- a/tools/src/parsers/test/contains_with_weight.xfst
+++ b/tools/src/parsers/test/contains_with_weight.xfst
@@ -19,4 +19,14 @@ b
 ba
 aba
 abaa
+<ctrl-d>
+echo --
 
+# negative weight
+regex $::-1[a];
+apply up
+foo
+bar
+fooa
+afooa
+abara
diff --git a/tools/src/parsers/test/flag_with_unknown.output b/tools/src/parsers/test/flag_with_unknown.output
new file mode 100644
index 0000000..ab901f2
--- /dev/null
+++ b/tools/src/parsers/test/flag_with_unknown.output
@@ -0,0 +1,4 @@
+0, (1 = TRUE, 0 = FALSE)
+0, (1 = TRUE, 0 = FALSE)
+0, (1 = TRUE, 0 = FALSE)
+0, (1 = TRUE, 0 = FALSE)
diff --git a/tools/src/parsers/test/flag_with_unknown.xfst b/tools/src/parsers/test/flag_with_unknown.xfst
new file mode 100644
index 0000000..dbc04d6
--- /dev/null
+++ b/tools/src/parsers/test/flag_with_unknown.xfst
@@ -0,0 +1,19 @@
+regex "@U.FOO.ON@" ?;
+regex "@U.FOO.ON@" ["@U.FOO.ON@"|?];
+equivalent
+clear stack
+
+regex ? "@U.FOO.ON@";
+regex ["@U.FOO.ON@"|?] "@U.FOO.ON@";
+equivalent
+clear stack
+
+regex "@U.FOO.ON@" ?:?;
+regex "@U.FOO.ON@" ["@U.FOO.ON@"|?:?|"@U.FOO.ON@":?|?:"@U.FOO.ON@"];
+equivalent
+clear stack
+
+regex ?:? "@U.FOO.ON@";
+regex ["@U.FOO.ON@"|?:?|"@U.FOO.ON@":?|?:"@U.FOO.ON@"] "@U.FOO.ON@";
+equivalent
+clear stack
diff --git a/tools/src/parsers/test/merge_weighted.att b/tools/src/parsers/test/merge_weighted.att
index 3761a51..cf0e2a1 100644
--- a/tools/src/parsers/test/merge_weighted.att
+++ b/tools/src/parsers/test/merge_weighted.att
@@ -37,3 +37,11 @@
 4	5	b	b	0.000000
 5	6	i	i	0.000000
 6	0.000000
+--
+0	1	k	k	2.000000
+1	2	a	a	0.000000
+2	3	t	t	0.000000
+3	4	a	a	0.000000
+4	5	b	b	0.000000
+5	6	i	i	0.000000
+6	0.000000
diff --git a/tools/src/parsers/test/merge_weighted.xfst b/tools/src/parsers/test/merge_weighted.xfst
index 4f2779b..6ee450d 100644
--- a/tools/src/parsers/test/merge_weighted.xfst
+++ b/tools/src/parsers/test/merge_weighted.xfst
@@ -15,4 +15,7 @@ write att
 echo --
 regex [ {CVCVCV} .<m. [k t b]::1 ] .<m. [a+ i]::3 ;
 write att
+echo --
+regex [ {CVCVCV} .<m. [k t b]::-1 ] .<m. [a+ i]::3 ;
+write att
 quit
diff --git a/tools/src/parsers/test/priority_union_1.att b/tools/src/parsers/test/priority_union_1.att
new file mode 100644
index 0000000..474177c
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_1.att
@@ -0,0 +1,28 @@
+0       1       a       b
+0       2       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       2       b       b
+0       2       c       c
+0       3       a       c
+3       2       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+3       2       b       b
+3       2       c       c
+3       4       a       c
+4       2       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+4       2       b       b
+4       2       c       c
+4       5       a       c
+5       2       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+5       2       b       b
+5       2       c       c
+5       2       a       c
+2       2       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+2       2       b       b
+2       2       c       c
+2       2       a       c
+1       6       a       b
+6       7       a       @0@
+0
+3
+4
+2
+7
diff --git a/tools/src/parsers/test/priority_union_1.xfst b/tools/src/parsers/test/priority_union_1.xfst
new file mode 100644
index 0000000..1043823
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_1.xfst
@@ -0,0 +1,2 @@
+regex [ a:b a:b a:0 ] .P. [ a -> c ] ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/priority_union_2.att b/tools/src/parsers/test/priority_union_2.att
new file mode 100644
index 0000000..3d8c319
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_2.att
@@ -0,0 +1,4 @@
+0       1       a       x
+0       1       b       y
+0       1       c       w
+1
diff --git a/tools/src/parsers/test/priority_union_2.xfst b/tools/src/parsers/test/priority_union_2.xfst
new file mode 100644
index 0000000..797dadf
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_2.xfst
@@ -0,0 +1,2 @@
+regex [a:x | b:y] .P. [b:{zs} | c:w];
+write att
diff --git a/tools/src/parsers/test/priority_union_3.att b/tools/src/parsers/test/priority_union_3.att
new file mode 100644
index 0000000..4b7067b
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_3.att
@@ -0,0 +1,6 @@
+0       1       m       m
+1       2       o       i
+2       3       u       c
+3       4       s       e
+4       5       e       @0@
+5
diff --git a/tools/src/parsers/test/priority_union_3.xfst b/tools/src/parsers/test/priority_union_3.xfst
new file mode 100644
index 0000000..58c0688
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_3.xfst
@@ -0,0 +1,2 @@
+regex {mouse}:{mice} .P. {mouse}:{mouses} ;
+write att
diff --git a/tools/src/parsers/test/priority_union_4.att b/tools/src/parsers/test/priority_union_4.att
new file mode 100644
index 0000000..7db0eb3
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_4.att
@@ -0,0 +1,5 @@
+0       1       a       A
+0       1       b       B
+0       1       @0@     D
+0       1       c       K
+1
diff --git a/tools/src/parsers/test/priority_union_4.xfst b/tools/src/parsers/test/priority_union_4.xfst
new file mode 100644
index 0000000..eb65098
--- /dev/null
+++ b/tools/src/parsers/test/priority_union_4.xfst
@@ -0,0 +1,2 @@
+regex [a:A | b:B | 0:D ] .P. [b:K | c:K | 0:N ];
+write att
diff --git a/tools/src/parsers/test/replace_markup_1.att b/tools/src/parsers/test/replace_markup_1.att
new file mode 100644
index 0000000..2fa0919
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_1.att
@@ -0,0 +1,8 @@
+0       0       ]       ]
+0       0       [       [
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       1       @0@     [
+0
+1       2       b       b
+1       2       a       a
+2       0       @0@     ]
diff --git a/tools/src/parsers/test/replace_markup_1.xfst b/tools/src/parsers/test/replace_markup_1.xfst
new file mode 100644
index 0000000..5d570b7
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_1.xfst
@@ -0,0 +1,2 @@
+regex [a | b] -> %[ ... %] ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_markup_2.att b/tools/src/parsers/test/replace_markup_2.att
new file mode 100644
index 0000000..d28d303
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_2.att
@@ -0,0 +1,6 @@
+0       1       @0@     a
+1       2       a       a
+1       2       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+1       2       b       b
+2       0       @0@     b
+0
diff --git a/tools/src/parsers/test/replace_markup_2.xfst b/tools/src/parsers/test/replace_markup_2.xfst
new file mode 100644
index 0000000..2473efb
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_2.xfst
@@ -0,0 +1,2 @@
+regex ? @-> a ... b;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_markup_3.att b/tools/src/parsers/test/replace_markup_3.att
new file mode 100644
index 0000000..6157011
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_3.att
@@ -0,0 +1,15 @@
+0       0       c       c
+0       0       b       b
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       1       @0@     b
+0       2       a       a
+0
+1       1       @0@     b
+1       2       a       a
+2       0       c       c
+2       0       b       b
+2       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+2       1       @0@     b
+2       2       a       a
+2       2       @0@     c
+2
diff --git a/tools/src/parsers/test/replace_markup_3.xfst b/tools/src/parsers/test/replace_markup_3.xfst
new file mode 100644
index 0000000..3494a1e
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_3.xfst
@@ -0,0 +1,2 @@
+regex  a+ ->  b* ... c*;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_markup_4.att b/tools/src/parsers/test/replace_markup_4.att
new file mode 100644
index 0000000..0792613
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_4.att
@@ -0,0 +1,9 @@
+0       0       d       d
+0       0       c       c
+0       0       b       b
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       0       a       d
+0       1       @0@     b
+0
+1       2       a       a
+2       0       @0@     c
diff --git a/tools/src/parsers/test/replace_markup_4.xfst b/tools/src/parsers/test/replace_markup_4.xfst
new file mode 100644
index 0000000..5101597
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_4.xfst
@@ -0,0 +1,2 @@
+regex a -> b ... c , a -> d ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_markup_5.att b/tools/src/parsers/test/replace_markup_5.att
new file mode 100644
index 0000000..780ebd6
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_5.att
@@ -0,0 +1,109 @@
+0       0       >       >
+0       0       o       o
+0       0       /       /
+0       0       <       <
+0       0       n       n
+0       0       i       i
+0       0       l       l
+0       0       p       p
+0       0       h       h
+0       0       a       a
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       1       c       c
+0
+1       0       >       >
+1       0       o       o
+1       0       /       /
+1       0       <       <
+1       0       n       n
+1       0       i       i
+1       0       l       l
+1       0       p       p
+1       2       h       h
+1       0       a       a
+1       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+1       1       c       c
+1
+2       0       >       >
+2       0       o       o
+2       0       /       /
+2       0       <       <
+2       0       n       n
+2       0       i       i
+2       0       l       l
+2       0       p       p
+2       0       h       h
+2       3       a       a
+2       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+2       1       c       c
+2
+3       0       >       >
+3       0       o       o
+3       0       /       /
+3       0       <       <
+3       0       n       n
+3       0       i       i
+3       0       l       l
+3       4       p       p
+3       0       h       h
+3       0       a       a
+3       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+3       1       c       c
+3       5       @0@     <
+3
+4       0       >       >
+4       0       o       o
+4       0       /       /
+4       0       <       <
+4       0       n       n
+4       0       i       i
+4       6       l       l
+4       0       p       p
+4       0       h       h
+4       0       a       a
+4       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+4       1       c       c
+4
+5       7       @0@     /
+6       0       >       >
+6       0       o       o
+6       0       /       /
+6       0       <       <
+6       0       n       n
+6       8       i       i
+6       0       l       l
+6       0       p       p
+6       0       h       h
+6       0       a       a
+6       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+6       1       c       c
+6
+7       9       @0@     o
+8       0       >       >
+8       0       o       o
+8       0       /       /
+8       0       <       <
+8       10      n       n
+8       0       i       i
+8       0       l       l
+8       0       p       p
+8       0       h       h
+8       0       a       a
+8       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+8       1       c       c
+8
+9       0       @0@     >
+10      0       >       >
+10      0       o       o
+10      0       /       /
+10      0       <       <
+10      0       n       n
+10      0       i       i
+10      0       l       l
+10      0       p       p
+10      0       h       h
+10      0       a       a
+10      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+10      1       c       c
+10      5       @0@     <
+10
diff --git a/tools/src/parsers/test/replace_markup_5.xfst b/tools/src/parsers/test/replace_markup_5.xfst
new file mode 100644
index 0000000..4bcd577
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_5.xfst
@@ -0,0 +1,2 @@
+regex [{cha} | {chaplin}] -> ... ({</o>}) ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_markup_6.att b/tools/src/parsers/test/replace_markup_6.att
new file mode 100644
index 0000000..80fb1d9
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_6.att
@@ -0,0 +1,213 @@
+0       0       m       m
+0       0       u       u
+0       0       s       s
+0       0       g       g
+0       0       e       e
+0       0       >       >
+0       0       o       o
+0       0       /       /
+0       0       <       <
+0       0       n       n
+0       0       i       i
+0       0       l       l
+0       0       h       h
+0       0       a       a
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       1       c       c
+0
+1       0       m       m
+1       0       u       u
+1       0       s       s
+1       0       g       g
+1       0       e       e
+1       0       >       >
+1       0       o       o
+1       0       /       /
+1       0       <       <
+1       0       n       n
+1       0       i       i
+1       0       l       l
+1       2       h       h
+1       0       a       a
+1       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+1       1       c       c
+1
+2       0       m       m
+2       0       u       u
+2       0       s       s
+2       0       g       g
+2       0       e       e
+2       0       >       >
+2       0       o       o
+2       0       /       /
+2       0       <       <
+2       0       n       n
+2       0       i       i
+2       0       l       l
+2       0       h       h
+2       3       a       a
+2       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+2       1       c       c
+2
+3       0       m       m
+3       0       u       u
+3       0       s       s
+3       0       g       g
+3       0       e       e
+3       0       >       >
+3       0       o       o
+3       0       /       /
+3       0       <       <
+3       0       n       n
+3       0       i       i
+3       4       l       l
+3       0       h       h
+3       0       a       a
+3       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+3       1       c       c
+3       5       @0@     <
+3
+4       0       m       m
+4       0       u       u
+4       0       s       s
+4       0       g       g
+4       0       e       e
+4       0       >       >
+4       0       o       o
+4       0       /       /
+4       0       <       <
+4       0       n       n
+4       0       i       i
+4       6       l       l
+4       0       h       h
+4       0       a       a
+4       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+4       1       c       c
+4
+5       7       @0@     /
+6       0       m       m
+6       0       u       u
+6       0       s       s
+6       0       g       g
+6       8       e       e
+6       0       >       >
+6       0       o       o
+6       0       /       /
+6       0       <       <
+6       0       n       n
+6       0       i       i
+6       0       l       l
+6       0       h       h
+6       0       a       a
+6       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+6       1       c       c
+6
+7       9       @0@     o
+8       0       m       m
+8       0       u       u
+8       0       s       s
+8       0       g       g
+8       0       e       e
+8       0       >       >
+8       0       o       o
+8       0       /       /
+8       0       <       <
+8       10      n       n
+8       0       i       i
+8       0       l       l
+8       0       h       h
+8       0       a       a
+8       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+8       1       c       c
+8
+9       11      @0@     s
+10      0       m       m
+10      0       u       u
+10      0       s       s
+10      12      g       g
+10      0       e       e
+10      0       >       >
+10      0       o       o
+10      0       /       /
+10      0       <       <
+10      0       n       n
+10      0       i       i
+10      0       l       l
+10      0       h       h
+10      0       a       a
+10      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+10      1       c       c
+10
+11      13      @0@     u
+12      0       m       m
+12      0       u       u
+12      0       s       s
+12      0       g       g
+12      0       e       e
+12      0       >       >
+12      0       o       o
+12      0       /       /
+12      0       <       <
+12      0       n       n
+12      14      i       i
+12      0       l       l
+12      0       h       h
+12      0       a       a
+12      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+12      1       c       c
+12
+13      15      @0@     m
+14      0       m       m
+14      0       u       u
+14      0       s       s
+14      0       g       g
+14      0       e       e
+14      0       >       >
+14      0       o       o
+14      0       /       /
+14      0       <       <
+14      16      n       n
+14      0       i       i
+14      0       l       l
+14      0       h       h
+14      0       a       a
+14      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+14      1       c       c
+14
+15      17      @0@     a
+16      0       m       m
+16      0       u       u
+16      0       s       s
+16      18      g       g
+16      0       e       e
+16      0       >       >
+16      0       o       o
+16      0       /       /
+16      0       <       <
+16      0       n       n
+16      0       i       i
+16      0       l       l
+16      0       h       h
+16      0       a       a
+16      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+16      1       c       c
+16
+17      0       @0@     >
+18      0       m       m
+18      0       u       u
+18      0       s       s
+18      0       g       g
+18      0       e       e
+18      0       >       >
+18      0       o       o
+18      0       /       /
+18      0       <       <
+18      0       n       n
+18      0       i       i
+18      0       l       l
+18      0       h       h
+18      0       a       a
+18      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+18      1       c       c
+18      5       @0@     <
+18
diff --git a/tools/src/parsers/test/replace_markup_6.xfst b/tools/src/parsers/test/replace_markup_6.xfst
new file mode 100644
index 0000000..199477a
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_6.xfst
@@ -0,0 +1,2 @@
+regex [{cha} | {challenging}] -> ... ({</osuma>});
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_markup_7.att b/tools/src/parsers/test/replace_markup_7.att
new file mode 100644
index 0000000..dfbb1a9
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_7.att
@@ -0,0 +1,200 @@
+0       0       u       u
+0       0       s       s
+0       0       g       g
+0       0       e       e
+0       0       >       >
+0       0       o       o
+0       0       /       /
+0       0       <       <
+0       0       n       n
+0       0       i       i
+0       0       l       l
+0       0       h       h
+0       0       a       a
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       1       c       c
+0
+1       0       u       u
+1       0       s       s
+1       0       g       g
+1       0       e       e
+1       0       >       >
+1       0       o       o
+1       0       /       /
+1       0       <       <
+1       0       n       n
+1       0       i       i
+1       0       l       l
+1       2       h       h
+1       0       a       a
+1       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+1       1       c       c
+1
+2       0       u       u
+2       0       s       s
+2       0       g       g
+2       0       e       e
+2       0       >       >
+2       0       o       o
+2       0       /       /
+2       0       <       <
+2       0       n       n
+2       0       i       i
+2       0       l       l
+2       0       h       h
+2       3       a       a
+2       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+2       1       c       c
+2
+3       0       u       u
+3       0       s       s
+3       0       g       g
+3       0       e       e
+3       0       >       >
+3       0       o       o
+3       0       /       /
+3       0       <       <
+3       0       n       n
+3       0       i       i
+3       4       l       l
+3       0       h       h
+3       0       a       a
+3       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+3       1       c       c
+3       5       @0@     <
+3
+4       0       u       u
+4       0       s       s
+4       0       g       g
+4       0       e       e
+4       0       >       >
+4       0       o       o
+4       0       /       /
+4       0       <       <
+4       0       n       n
+4       0       i       i
+4       6       l       l
+4       0       h       h
+4       0       a       a
+4       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+4       1       c       c
+4
+5       7       @0@     /
+6       0       u       u
+6       0       s       s
+6       0       g       g
+6       8       e       e
+6       0       >       >
+6       0       o       o
+6       0       /       /
+6       0       <       <
+6       0       n       n
+6       0       i       i
+6       0       l       l
+6       0       h       h
+6       0       a       a
+6       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+6       1       c       c
+6
+7       9       @0@     o
+8       0       u       u
+8       0       s       s
+8       0       g       g
+8       0       e       e
+8       0       >       >
+8       0       o       o
+8       0       /       /
+8       0       <       <
+8       10      n       n
+8       0       i       i
+8       0       l       l
+8       0       h       h
+8       0       a       a
+8       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+8       1       c       c
+8
+9       11      @0@     s
+10      0       u       u
+10      0       s       s
+10      12      g       g
+10      0       e       e
+10      0       >       >
+10      0       o       o
+10      0       /       /
+10      0       <       <
+10      0       n       n
+10      0       i       i
+10      0       l       l
+10      0       h       h
+10      0       a       a
+10      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+10      1       c       c
+10
+11      13      @0@     u
+12      0       u       u
+12      0       s       s
+12      0       g       g
+12      0       e       e
+12      0       >       >
+12      0       o       o
+12      0       /       /
+12      0       <       <
+12      0       n       n
+12      14      i       i
+12      0       l       l
+12      0       h       h
+12      0       a       a
+12      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+12      1       c       c
+12
+13      15      @0@     i
+14      0       u       u
+14      0       s       s
+14      0       g       g
+14      0       e       e
+14      0       >       >
+14      0       o       o
+14      0       /       /
+14      0       <       <
+14      16      n       n
+14      0       i       i
+14      0       l       l
+14      0       h       h
+14      0       a       a
+14      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+14      1       c       c
+14
+15      0       @0@     >
+16      0       u       u
+16      0       s       s
+16      17      g       g
+16      0       e       e
+16      0       >       >
+16      0       o       o
+16      0       /       /
+16      0       <       <
+16      0       n       n
+16      0       i       i
+16      0       l       l
+16      0       h       h
+16      0       a       a
+16      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+16      1       c       c
+16
+17      0       u       u
+17      0       s       s
+17      0       g       g
+17      0       e       e
+17      0       >       >
+17      0       o       o
+17      0       /       /
+17      0       <       <
+17      0       n       n
+17      0       i       i
+17      0       l       l
+17      0       h       h
+17      0       a       a
+17      0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+17      1       c       c
+17      5       @0@     <
+17
diff --git a/tools/src/parsers/test/replace_markup_7.xfst b/tools/src/parsers/test/replace_markup_7.xfst
new file mode 100644
index 0000000..3acb395
--- /dev/null
+++ b/tools/src/parsers/test/replace_markup_7.xfst
@@ -0,0 +1,2 @@
+regex [{cha} | {challenging}] -> ... ({</osui>}) ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_test_flags_1.att b/tools/src/parsers/test/replace_test_flags_1.att
new file mode 100644
index 0000000..d0f0033
--- /dev/null
+++ b/tools/src/parsers/test/replace_test_flags_1.att
@@ -0,0 +1,17 @@
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       0       @P.FOO.BAR@     @P.FOO.BAR@
+0       0       @u.a.b@ @u.a.b@
+0       1       a       a
+1       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+1       0       @P.FOO.BAR@     @P.FOO.BAR@
+1       0       @u.a.b@ @u.a.b@
+1       2       a       a
+1       3       a       @P.FOO.BAR@
+3       0       @u.a.b@ @u.a.b@
+2       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+2       0       @P.FOO.BAR@     @P.FOO.BAR@
+2       2       a       a
+2       3       a       @P.FOO.BAR@
+0
+1
+2
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_test_flags_1.xfst b/tools/src/parsers/test/replace_test_flags_1.xfst
new file mode 100644
index 0000000..aeb6747
--- /dev/null
+++ b/tools/src/parsers/test/replace_test_flags_1.xfst
@@ -0,0 +1,2 @@
+regex [ a ->  "@P.FOO.BAR@" || a _ "@u.a.b@" ] ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_test_flags_2.att b/tools/src/parsers/test/replace_test_flags_2.att
new file mode 100644
index 0000000..68805ad
--- /dev/null
+++ b/tools/src/parsers/test/replace_test_flags_2.att
@@ -0,0 +1,18 @@
+0       0       @P.FOO.FOO@     @P.FOO.FOO@
+0       0       @D.BAR.BAR@     @D.BAR.BAR@
+0       0       b       b
+0       1       a       a
+0       0       c       c
+0       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+0       2       a       b
+0
+1       1       @P.FOO.FOO@     @P.FOO.FOO@
+1       1       @D.BAR.BAR@     @D.BAR.BAR@
+1       0       b       b
+1       1       a       a
+1       0       @_IDENTITY_SYMBOL_@     @_IDENTITY_SYMBOL_@
+1       2       a       b
+2       2       @P.FOO.FOO@     @P.FOO.FOO@
+2       2       @D.BAR.BAR@     @D.BAR.BAR@
+2       0       c       c
+2
\ No newline at end of file
diff --git a/tools/src/parsers/test/replace_test_flags_2.xfst b/tools/src/parsers/test/replace_test_flags_2.xfst
new file mode 100644
index 0000000..8f84c43
--- /dev/null
+++ b/tools/src/parsers/test/replace_test_flags_2.xfst
@@ -0,0 +1,2 @@
+regex [ a -> b || _ [%@P.FOO.FOO%@ | %@D.BAR.BAR%@ ]* [ .#. | ?:c - a:c ] ] ;
+write att
\ No newline at end of file
diff --git a/tools/src/parsers/test/test.sh b/tools/src/parsers/test/test.sh
index 09dffc3..09f0c4f 100755
--- a/tools/src/parsers/test/test.sh
+++ b/tools/src/parsers/test/test.sh
@@ -24,7 +24,7 @@ for format in sfst openfst-tropical foma;
 do
     # comment this if hfst-format is not available
     if ! (${HFST_FORMAT} --list-formats | ${GREP} $format > /dev/null); then
-	continue;
+    continue;
     fi
 
     ## Create a transducer [Foo Bar Baz] where Foo is [foo], Bar [bar] and Baz [Baz].
@@ -32,49 +32,49 @@ do
     ## on command line. Baz is later undefined in input.
     echo "define Foo foo" > startup
     if ! ((echo "undefine Baz" && echo "regex Foo Bar Baz;" && echo "save stack tmp") | \
-	${XFST_TOOL} -f $format -l startup \
-	-e "define Bar bar;" -e "define Baz baz;" > /dev/null 2> /dev/null)
+    ${XFST_TOOL} -f $format -l startup \
+    -e "define Bar bar;" -e "define Baz baz;" > /dev/null 2> /dev/null)
     then
-	${REMOVE} ${EXTRA_FILES}
+    ${REMOVE} ${EXTRA_FILES}
         echo "fail #1";
-	exit 1
+    exit 1
     fi
 
     # Test that the result is as intended.
     if ! (echo "foo bar Baz" | ${STRINGS2FST} -f $format | ${COMPARE} tmp);
     then
-	${REMOVE} ${EXTRA_FILES}
+    ${REMOVE} ${EXTRA_FILES}
         echo "fail #2";
-	exit 1
+    exit 1
     fi
 
     # Create a transducer with literal words "define" and "regex".
     for word in define regex
     do
-	if ! ((echo "regex "$word";" && echo "save stack tmp") | ${XFST_TOOL} -f $format > /dev/null 2> /dev/null)
-	then
-	    ${REMOVE} ${EXTRA_FILES}
+    if ! ((echo "regex "$word";" && echo "save stack tmp") | ${XFST_TOOL} -f $format > /dev/null 2> /dev/null)
+    then
+        ${REMOVE} ${EXTRA_FILES}
             echo "fail #3";
-	    exit 1
-	fi
+        exit 1
+    fi
         # Test that the result is as intended.
-	if ! (echo $word | ${STRINGS2FST} -f $format | ${COMPARE} tmp);
-	then
-	    ${REMOVE} ${EXTRA_FILES}
+    if ! (echo $word | ${STRINGS2FST} -f $format | ${COMPARE} tmp);
+    then
+        ${REMOVE} ${EXTRA_FILES}
             echo "fail #4";
-	    exit 1
-	fi
+        exit 1
+    fi
     done
 
     ## Test that using special symbols in replace rules yields an error message
     if ! (echo 'regex a -> "@_foo_@";' | ../hfst-xfst --pipe-mode=input -f $format > /dev/null 2> tmp && ${GREP} "warning:" tmp > /dev/null); then
         echo "fail #5";
-	exit 1;
+    exit 1;
     fi
     # silent mode
     if (echo 'regex a -> "@_foo_@";' | ../hfst-xfst --pipe-mode=input -s -f $format > /dev/null 2> tmp && ${GREP} "warning:" tmp > /dev/null); then
         echo "fail #6";
-	exit 1;
+    exit 1;
     fi
 
     ## Test that using incompatible replace types in parallel rules yields an error message
@@ -100,9 +100,9 @@ do
     ## Test that the result of testfile.xfst (written in att format to standard output)
     ## is the same as testfile.att using att-to-fst conversion.
     for testfile in compose_net concatenate_net union_net ignore_net invert_net minus_net intersect_net \
-	determinize_net epsilon_remove_net invert_net minimize_net negate_net \
-	one_plus_net prune_net reverse_net sort_net upper_side_net zero_plus_net lower_side_net \
-	define define_function prolog \
+    determinize_net epsilon_remove_net invert_net minimize_net negate_net \
+    one_plus_net prune_net reverse_net sort_net upper_side_net zero_plus_net lower_side_net \
+    define define_function prolog \
         substitute_symbol_1 substitute_symbol_2 substitute_symbol_3 \
         substitute_symbol_4 substitute_symbol_5 \
         substitute_label_1 substitute_label_2 substitute_label_3 substitute_label_4 \
@@ -110,50 +110,57 @@ do
         substitute_defined_1 substitute_defined_2 substitute_defined_3 \
         substitute_defined_4 substitute_defined_5 substitute_defined_6 \
         at_re_1 at_re_2 at_re_3 at_txt at_stxt at_txt_and_stxt at_pl \
-        quoted_literals replace_identity one_transition_regex merge
+        quoted_literals replace_identity one_transition_regex merge \
+        replace_test_flags_1 \
+        replace_markup_1 replace_markup_2 replace_markup_3 replace_markup_4 replace_markup_5\
+        replace_markup_6 replace_markup_7 \
+        priority_union_1 priority_union_2 priority_union_3 priority_union_4 \
+        
+        
+        #replace_test_flags_2        
         # substitute_symbol_6 fails on sfst,  substitute_symbol_7 substitute_symbol_8 should be added
         # angle_brackets omitted, since xfst and foma handle them differently
     do
-	${REMOVE} result result1 result2
-	if ! (${LS} $testfile.xfst 2> /dev/null); then
-	    echo "skipping missing test for "$testfile"..."
-	    continue
-	fi
-	if ! (${CAT} $testfile.xfst | ../hfst-xfst --pipe-mode=input -q -f $format > result 2> /dev/null); then
-	    echo "ERROR: in compiling "$testfile".xfst"
-	    exit 1;
-	fi
-	if ! (${CAT} result | ${TXT2FST} > tmp1; ${CAT} $testfile.att | ${TXT2FST} > tmp2; ); then
-	    echo "ERROR: in compiling "$testfile".att"
-	    exit 1;
-	fi
-	if ! (${COMPARE} tmp1 tmp2); then
-	    echo "ERROR: "$testfile" test failed"
-	    exit 1;
-	fi
+    ${REMOVE} result result1 result2
+    if ! (${LS} $testfile.xfst 2> /dev/null); then
+        echo "skipping missing test for "$testfile"..."
+        continue
+    fi
+    if ! (${CAT} $testfile.xfst | ../hfst-xfst --pipe-mode=input -q -f $format > result 2> /dev/null); then
+        echo "ERROR: in compiling "$testfile".xfst"
+        exit 1;
+    fi
+    if ! (${CAT} result | ${TXT2FST} > tmp1; ${CAT} $testfile.att | ${TXT2FST} > tmp2; ); then
+        echo "ERROR: in compiling "$testfile".att"
+        exit 1;
+    fi
+    if ! (${COMPARE} tmp1 tmp2); then
+        echo "ERROR: "$testfile" test failed"
+        exit 1;
+    fi
     done
 
     ## The same as above but only for openfst format
     if [ "$format" = "openfst-tropical" ]; then
         for testfile in merge_weighted
         do
-	    ${REMOVE} result result1 result2
-	    if ! (${LS} $testfile.xfst 2> /dev/null); then
-	        echo "skipping missing test for "$testfile"..."
-	        continue
-	    fi
-	    if ! (${CAT} $testfile.xfst | ../hfst-xfst --pipe-mode=input -q -f $format > result 2> /dev/null); then
-	        echo "ERROR: in compiling "$testfile".xfst"
-	        exit 1;
-	    fi
-	    if ! (${CAT} result | ${TXT2FST} > tmp1; ${CAT} $testfile.att | ${TXT2FST} > tmp2; ); then
-	        echo "ERROR: in compiling "$testfile".att"
-	        exit 1;
-	    fi
-	    if ! (${COMPARE} tmp1 tmp2); then
-	        echo "ERROR: "$testfile" test failed"
-	        exit 1;
-	    fi
+        ${REMOVE} result result1 result2
+        if ! (${LS} $testfile.xfst 2> /dev/null); then
+            echo "skipping missing test for "$testfile"..."
+            continue
+        fi
+        if ! (${CAT} $testfile.xfst | ../hfst-xfst --pipe-mode=input -q -f $format > result 2> /dev/null); then
+            echo "ERROR: in compiling "$testfile".xfst"
+            exit 1;
+        fi
+        if ! (${CAT} result | ${TXT2FST} > tmp1; ${CAT} $testfile.att | ${TXT2FST} > tmp2; ); then
+            echo "ERROR: in compiling "$testfile".att"
+            exit 1;
+        fi
+        if ! (${COMPARE} tmp1 tmp2); then
+            echo "ERROR: "$testfile" test failed"
+            exit 1;
+        fi
         done
     fi
 
@@ -161,36 +168,36 @@ do
     ## Test that testfile_fail fails.
     #for testfile in define_fail
     #do
-#	if ! (ls $testfile.xfst 2> /dev/null); then
-#	    echo "skipping missing test for "$testfile"..."
-#	    continue
-#	fi
-#	if ! (cat $testfile.xfst | ../hfst-xfst -s -f $format 2> tmp > /dev/null); then
-#	    echo "ERROR: in compiling "$testfile".xfst"
-#	    exit 1;
-#	fi
-#	if ! (grep "xre parsing failed" tmp > /dev/null); then
-#	    echo "ERROR: in "$testfile".xfst"
-#	    exit 1;
-#	fi
+#    if ! (ls $testfile.xfst 2> /dev/null); then
+#        echo "skipping missing test for "$testfile"..."
+#        continue
+#    fi
+#    if ! (cat $testfile.xfst | ../hfst-xfst -s -f $format 2> tmp > /dev/null); then
+#        echo "ERROR: in compiling "$testfile".xfst"
+#        exit 1;
+#    fi
+#    if ! (grep "xre parsing failed" tmp > /dev/null); then
+#        echo "ERROR: in "$testfile".xfst"
+#        exit 1;
+#    fi
 #    done
 
     ## Test that the result of testfile.xfst (written to standard output)
     ## is the same as testfile.output
     for testfile in print_stack print_labels print_label_tally \
-	shortest_string set_variable info print_net eliminate_flag empty_context xerox_composition \
-        compile_replace_1 compile_replace_2 compile_replace_3 
+    shortest_string set_variable info print_net eliminate_flag empty_context xerox_composition \
+        compile_replace_1 compile_replace_2 compile_replace_3 flag_with_unknown
     do
-	if ! (${LS} $testfile.xfst 2> /dev/null); then
-	    echo "skipping missing test for "$testfile"..."
-	    continue
-	fi
+    if ! (${LS} $testfile.xfst 2> /dev/null); then
+        echo "skipping missing test for "$testfile"..."
+        continue
+    fi
         # apply up/down leak to stdout with readline..
-	if ! (${CAT} $testfile.xfst | ../hfst-xfst --pipe-mode=input -f $format -s | ${TR} -d '\r' > tmp); then
-	    echo "ERROR: in compiling "$testfile.xfst
-	    exit 1;
-	fi
-	if ! ($DIFF tmp $testfile.output > tmpdiff); then
+    if ! (${CAT} $testfile.xfst | ../hfst-xfst --pipe-mode=input -f $format -s | ${TR} -d '\r' > tmp); then
+        echo "ERROR: in compiling "$testfile.xfst
+        exit 1;
+    fi
+    if ! ($DIFF tmp $testfile.output > tmpdiff); then
             if (${LS} $testfile.alternative_output > /dev/null 2> /dev/null); then
                 if ! ($DIFF tmp $testfile.alternative_output); then
                     ${REMOVE} tmpdiff
@@ -200,20 +207,20 @@ do
             else
                 ${CAT} tmpdiff
                 ${REMOVE} tmpdiff
-	        echo "ERROR: in result from "$testfile.xfst
-	        exit 1;
+            echo "ERROR: in result from "$testfile.xfst
+            exit 1;
             fi
             ${REMOVE} tmpdiff
-	fi
+    fi
     done
 
     ## Interactive commands
     for testfile in apply_up apply_down inspect_net
     do
-	if ! (${LS} $testfile.xfst 2> /dev/null); then
-	    echo "skipping missing test for "$testfile"..."
-	    continue
-	fi
+    if ! (${LS} $testfile.xfst 2> /dev/null); then
+        echo "skipping missing test for "$testfile"..."
+        continue
+    fi
         # apply up/down leak to stdout with readline..
         for param in --pipe-mode=input # --no-readline
         do
@@ -221,11 +228,11 @@ do
             if (${TEST} "$param" = "--pipe-mode=input" -a "$testfile" = "inspect_net"); then
                 continue
             fi
-	    if ! (${CAT} $testfile.xfst | ../hfst-xfst  $param -f $format -s | ${TR} -d '\r' > tmp); then
-	    echo "ERROR: in compiling "$testfile.xfst" with parameters "$param
-	    exit 1;
-	    fi
-	    if ! ($DIFF tmp $testfile.output > tmpdiff); then
+        if ! (${CAT} $testfile.xfst | ../hfst-xfst  $param -f $format -s | ${TR} -d '\r' > tmp); then
+        echo "ERROR: in compiling "$testfile.xfst" with parameters "$param
+        exit 1;
+        fi
+        if ! ($DIFF tmp $testfile.output > tmpdiff); then
                 if (${LS} $testfile.alternative_output > /dev/null 2> /dev/null); then
                     if ! ($DIFF tmp $testfile.alternative_output); then
                         ${REMOVE} tmpdiff
@@ -235,11 +242,11 @@ do
                 else
                     ${CAT} tmpdiff
                     ${REMOVE} tmpdiff
-	            echo "ERROR: in result from "$testfile.xfst
-	            exit 1;
+                echo "ERROR: in result from "$testfile.xfst
+                exit 1;
                 fi
                 ${REMOVE} tmpdiff
-	    fi
+        fi
         done
     done
 
@@ -248,21 +255,21 @@ do
     ## contain the lines listed in files test_true.input and test_false.output, respectively.
     for testcase in _true _false # whether we test the positive or negative case
     do
-	for testfile in test_overlap test_sublanguage # the function to be tested
-	do
-	    if ! (${LS} $testfile$testcase.xfst 2> /dev/null); then
-		echo "skipping missing test for "$testfile$testcase"..."
-		continue
-	    fi
-	    if ! (${CAT} $testfile$testcase.xfst | ../hfst-xfst --pipe-mode=input -s -f $format | ${TR} -d '\r' > tmp); then
-		echo "ERROR: in compiling "$testfile$testcase.xfst
-		exit 1;
-	    fi
-	    if ! ($DIFF tmp "test"$testcase.output); then
-		echo "ERROR: in testing "$testfile$testcase.xfst
-		exit 1;
-	    fi
-	done
+    for testfile in test_overlap test_sublanguage # the function to be tested
+    do
+        if ! (${LS} $testfile$testcase.xfst 2> /dev/null); then
+        echo "skipping missing test for "$testfile$testcase"..."
+        continue
+        fi
+        if ! (${CAT} $testfile$testcase.xfst | ../hfst-xfst --pipe-mode=input -s -f $format | ${TR} -d '\r' > tmp); then
+        echo "ERROR: in compiling "$testfile$testcase.xfst
+        exit 1;
+        fi
+        if ! ($DIFF tmp "test"$testcase.output); then
+        echo "ERROR: in testing "$testfile$testcase.xfst
+        exit 1;
+        fi
+    done
     done
 
     for file in quit-on-fail.xfst assert.xfst
@@ -295,10 +302,10 @@ do
         weighted_ltr_longest_match_1 weighted_ltr_longest_match_2 weighted_ltr_longest_match_3 \
         weighted_ltr_shortest_match_1 weighted_ltr_shortest_match_2 weighted_ltr_shortest_match_3
         do
-	    if ! (${LS} $file.xfst 2> /dev/null); then
-	        echo "skipping missing test for "$file"..."
-	        continue
-	    fi
+        if ! (${LS} $file.xfst 2> /dev/null); then
+            echo "skipping missing test for "$file"..."
+            continue
+        fi
             if ! (${CAT} $file.xfst | ../hfst-xfst --pipe-mode=input -s -f $format | ${TR} -d '\r' > tmp 2> /dev/null); then
                 echo "ERROR: in compiling "$file".xfst"
                 exit 1;
@@ -311,10 +318,10 @@ do
                 echo "ERROR: in compiling file "$file".result"
                 exit 1;
             fi
-	    if ! (${COMPARE} tmp1 tmp2); then
-	        echo "ERROR: "$file" test failed"
-	        exit 1;
-	    fi
+        if ! (${COMPARE} tmp1 tmp2); then
+            echo "ERROR: "$file" test failed"
+            exit 1;
+        fi
         done
         for file in contains contains_with_weight contains_once contains_once_optional \
             replace_test_1 replace_test_2 replace_test_3 replace_test_4 replace_test_5 \
@@ -331,20 +338,21 @@ do
             weighted_parallel_rules_1 weighted_parallel_rules_2 weighted_parallel_rules_3 \
             weighted_parallel_rules_4 weighted_parallel_rules_5 weighted_parallel_rules_6 \
             weighted_parallel_rules_7 weighted_parallel_rules_8 weighted_parallel_rules_9 \
-            weighted_parallel_rules_10 weighted_parallel_rules_11
+            weighted_parallel_rules_10 weighted_parallel_rules_11 weighted_parallel_rules_12 \
+            weighted_parallel_rules_13
         do
             if ! (${LS} $file.xfst 2> /dev/null); then
-	        echo "skipping missing test for "$file"..."
-	        continue
-	    fi
+            echo "skipping missing test for "$file"..."
+            continue
+        fi
             if ! (${CAT} $file.xfst | ../hfst-xfst --pipe-mode=input -s -f $format | ${TR} -d '\r' > tmp 2> /dev/null); then
                 echo "ERROR: in compiling "$file".xfst"
                 exit 1;
             fi
             if ! (${DIFF} $file.output tmp); then
-	        echo "ERROR: "$file" test failed"
-	        exit 1;
-	    fi
+            echo "ERROR: "$file" test failed"
+            exit 1;
+        fi
         done
     fi
 
diff --git a/tools/src/parsers/test/weighted_parallel_rules_12.output b/tools/src/parsers/test/weighted_parallel_rules_12.output
new file mode 100644
index 0000000..b9834bf
--- /dev/null
+++ b/tools/src/parsers/test/weighted_parallel_rules_12.output
@@ -0,0 +1 @@
+cbdbc	1.0
diff --git a/tools/src/parsers/test/weighted_parallel_rules_12.xfst b/tools/src/parsers/test/weighted_parallel_rules_12.xfst
new file mode 100644
index 0000000..a8df9f8
--- /dev/null
+++ b/tools/src/parsers/test/weighted_parallel_rules_12.xfst
@@ -0,0 +1,7 @@
+set print-weight ON
+set precision 1
+set lookup-cycle-cutoff 5
+set encode-weights ON
+
+regex C -> d::3.0 \/ b _ b ,, a::-1.0 -> b || c _ C , C _ c ;
+apply up caCac
diff --git a/tools/src/parsers/test/weighted_parallel_rules_13.output b/tools/src/parsers/test/weighted_parallel_rules_13.output
new file mode 100644
index 0000000..e377553
--- /dev/null
+++ b/tools/src/parsers/test/weighted_parallel_rules_13.output
@@ -0,0 +1,5 @@
+cbCbc	-3.0
+caCbc	-1.5
+cbCac	-1.5
+caCac	0.0
+cbdbc	0.0
diff --git a/tools/src/parsers/test/weighted_parallel_rules_13.xfst b/tools/src/parsers/test/weighted_parallel_rules_13.xfst
new file mode 100644
index 0000000..5bff6b6
--- /dev/null
+++ b/tools/src/parsers/test/weighted_parallel_rules_13.xfst
@@ -0,0 +1,7 @@
+set print-weight ON
+set precision 1
+set lookup-cycle-cutoff 5
+set encode-weights ON
+
+regex C (->) d::3 \/ b _ b ,, a::-1.5 (->) b || c _ C , C _ c ;
+apply up caCac

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hfst.git



More information about the debian-science-commits mailing list