diff options
Diffstat (limited to 'gr-dtv/lib/atsc')
45 files changed, 4106 insertions, 4937 deletions
diff --git a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc index b0aeee5df5..99e9745cd8 100644 --- a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc +++ b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.cc @@ -22,43 +22,30 @@ #include <assert.h> namespace gr { - namespace dtv { +namespace dtv { - const unsigned char atsc_basic_trellis_encoder::next_state[32] = { - 0,1,4,5, - 2,3,6,7, - 1,0,5,4, - 3,2,7,6, - 4,5,0,1, - 6,7,2,3, - 5,4,1,0, - 7,6,3,2 - }; +const unsigned char atsc_basic_trellis_encoder::next_state[32] = { + 0, 1, 4, 5, 2, 3, 6, 7, 1, 0, 5, 4, 3, 2, 7, 6, + 4, 5, 0, 1, 6, 7, 2, 3, 5, 4, 1, 0, 7, 6, 3, 2 +}; - const unsigned char atsc_basic_trellis_encoder::out_symbol[32] = { - 0,2,4,6, - 1,3,5,7, - 0,2,4,6, - 1,3,5,7, - 4,6,0,2, - 5,7,1,3, - 4,6,0,2, - 5,7,1,3 - }; +const unsigned char atsc_basic_trellis_encoder::out_symbol[32] = { + 0, 2, 4, 6, 1, 3, 5, 7, 0, 2, 4, 6, 1, 3, 5, 7, + 4, 6, 0, 2, 5, 7, 1, 3, 4, 6, 0, 2, 5, 7, 1, 3 +}; - /*! - * Encode two bit INPUT into 3 bit return value. Domain is [0,3], - * Range is [0,7]. The mapping to bipolar levels is not done. - */ +/*! + * Encode two bit INPUT into 3 bit return value. Domain is [0,3], + * Range is [0,7]. The mapping to bipolar levels is not done. + */ - int - atsc_basic_trellis_encoder::encode(unsigned int input) - { - assert (input < 4); - int index = (state << 2) + input; - state = next_state[index]; - return out_symbol[index]; - } +int atsc_basic_trellis_encoder::encode(unsigned int input) +{ + assert(input < 4); + int index = (state << 2) + input; + state = next_state[index]; + return out_symbol[index]; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h index 3bac601741..49b78ca99d 100644 --- a/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h +++ b/gr-dtv/lib/atsc/atsc_basic_trellis_encoder.h @@ -34,30 +34,30 @@ */ namespace gr { - namespace dtv { +namespace dtv { - class atsc_basic_trellis_encoder - { - private: - int state; // two bit state; +class atsc_basic_trellis_encoder +{ +private: + int state; // two bit state; - public: - atsc_basic_trellis_encoder() : state(0) {} +public: + atsc_basic_trellis_encoder() : state(0) {} - /*! - * Encode two bit INPUT into 3 bit return value. Domain is [0,3], - * Range is [0,7]. The mapping to bipolar levels is not done. - */ - int encode(unsigned int input); + /*! + * Encode two bit INPUT into 3 bit return value. Domain is [0,3], + * Range is [0,7]. The mapping to bipolar levels is not done. + */ + int encode(unsigned int input); - //! reset encoder state - void reset() {state = 0;} + //! reset encoder state + void reset() { state = 0; } - static const unsigned char next_state[32]; - static const unsigned char out_symbol[32]; - }; + static const unsigned char next_state[32]; + static const unsigned char out_symbol[32]; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_ATSC_TRELLIS_ENCODER_H */ diff --git a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc index 7b2001aacb..e4757e97a6 100644 --- a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc +++ b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.cc @@ -29,69 +29,67 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - atsc_deinterleaver::sptr - atsc_deinterleaver::make() - { - return gnuradio::get_initial_sptr - (new atsc_deinterleaver_impl()); - } - - atsc_deinterleaver_impl::atsc_deinterleaver_impl() - : gr::sync_block("atsc_deinterleaver", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))), - alignment_fifo (156) - { - m_fifo.resize(52); - - for (int i = 0; i < 52; i++) +namespace dtv { + +atsc_deinterleaver::sptr atsc_deinterleaver::make() +{ + return gnuradio::get_initial_sptr(new atsc_deinterleaver_impl()); +} + +atsc_deinterleaver_impl::atsc_deinterleaver_impl() + : gr::sync_block("atsc_deinterleaver", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))), + alignment_fifo(156) +{ + m_fifo.resize(52); + + for (int i = 0; i < 52; i++) m_fifo[52 - 1 - i] = new interleaver_fifo<unsigned char>(i * 4); - sync(); - } + sync(); +} - atsc_deinterleaver_impl::~atsc_deinterleaver_impl() - { - for (int i = 0; i < 52; i++) +atsc_deinterleaver_impl::~atsc_deinterleaver_impl() +{ + for (int i = 0; i < 52; i++) delete m_fifo[i]; - } +} - void atsc_deinterleaver_impl::reset() - { - sync(); - for (int i = 0; i < 52; i++) +void atsc_deinterleaver_impl::reset() +{ + sync(); + for (int i = 0; i < 52; i++) m_fifo[i]->reset(); - } - - int - atsc_deinterleaver_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *)input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *)output_items[0]; - - for (int i = 0; i < noutput_items; i++) { - assert (in[i].pli.regular_seg_p()); +} + +int atsc_deinterleaver_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { + assert(in[i].pli.regular_seg_p()); plinfo::sanity_check(in[i].pli); // reset commutator if required using INPUT pipeline info if (in[i].pli.first_regular_seg_p()) - sync(); + sync(); // remap OUTPUT pipeline info to reflect 52 data segment end-to-end delay - plinfo::delay (out[i].pli, in[i].pli, 52); + plinfo::delay(out[i].pli, in[i].pli, 52); // now do the actual deinterleaving for (unsigned int j = 0; j < sizeof(in[i].data); j++) { - out[i].data[j] = alignment_fifo.stuff(transform (in[i].data[j])); + out[i].data[j] = alignment_fifo.stuff(transform(in[i].data[j])); } - } - - return noutput_items; } - } /* namespace dtv */ + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h index 75eb7e877d..b9202e4f22 100644 --- a/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h +++ b/gr-dtv/lib/atsc/atsc_deinterleaver_impl.h @@ -28,48 +28,49 @@ #include "interleaver_fifo.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_deinterleaver_impl : public atsc_deinterleaver +class atsc_deinterleaver_impl : public atsc_deinterleaver +{ +private: + //! transform a single symbol + unsigned char transform(unsigned char input) { - private: - //! transform a single symbol - unsigned char transform(unsigned char input) { unsigned char retval = m_fifo[m_commutator]->stuff(input); m_commutator++; if (m_commutator >= 52) - m_commutator = 0; + m_commutator = 0; return retval; - } + } - /*! - * Note: The use of the alignment_fifo keeps the encoder and decoder - * aligned if both are synced to a field boundary. There may be other - * ways to implement this function. This is a best guess as to how - * this should behave, as we have no test vectors for either the - * interleaver or deinterleaver. - */ - interleaver_fifo<unsigned char> alignment_fifo; + /*! + * Note: The use of the alignment_fifo keeps the encoder and decoder + * aligned if both are synced to a field boundary. There may be other + * ways to implement this function. This is a best guess as to how + * this should behave, as we have no test vectors for either the + * interleaver or deinterleaver. + */ + interleaver_fifo<unsigned char> alignment_fifo; - int m_commutator; - std::vector<interleaver_fifo<unsigned char> *> m_fifo; + int m_commutator; + std::vector<interleaver_fifo<unsigned char>*> m_fifo; - public: - atsc_deinterleaver_impl(); - ~atsc_deinterleaver_impl(); +public: + atsc_deinterleaver_impl(); + ~atsc_deinterleaver_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); - //! reset interleaver (flushes contents and resets commutator) - void reset(); + //! reset interleaver (flushes contents and resets commutator) + void reset(); - //! sync interleaver (resets commutator, but doesn't flush fifos) - void sync() { m_commutator = 0; } - }; + //! sync interleaver (resets commutator, but doesn't flush fifos) + void sync() { m_commutator = 0; } +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DEINTERLEAVER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_depad_impl.cc b/gr-dtv/lib/atsc/atsc_depad_impl.cc index e1172e630c..fbaa3d0701 100644 --- a/gr-dtv/lib/atsc/atsc_depad_impl.cc +++ b/gr-dtv/lib/atsc/atsc_depad_impl.cc @@ -29,38 +29,35 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - atsc_depad::sptr - atsc_depad::make() - { - return gnuradio::get_initial_sptr - (new atsc_depad_impl()); - } - - atsc_depad_impl::atsc_depad_impl() - : gr::sync_interpolator("atsc_depad", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - io_signature::make(1, 1, sizeof(unsigned char)), - ATSC_MPEG_PKT_LENGTH) - { - } - - int - atsc_depad_impl::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet *in = (const atsc_mpeg_packet *)input_items[0]; - unsigned char *out = (unsigned char *)output_items[0]; - - int i; - - for (i = 0; i < noutput_items/ATSC_MPEG_PKT_LENGTH; i++) +namespace dtv { + +atsc_depad::sptr atsc_depad::make() +{ + return gnuradio::get_initial_sptr(new atsc_depad_impl()); +} + +atsc_depad_impl::atsc_depad_impl() + : gr::sync_interpolator("atsc_depad", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), + io_signature::make(1, 1, sizeof(unsigned char)), + ATSC_MPEG_PKT_LENGTH) +{ +} + +int atsc_depad_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet* in = (const atsc_mpeg_packet*)input_items[0]; + unsigned char* out = (unsigned char*)output_items[0]; + + int i; + + for (i = 0; i < noutput_items / ATSC_MPEG_PKT_LENGTH; i++) memcpy(&out[i * ATSC_MPEG_PKT_LENGTH], in[i].data, ATSC_MPEG_PKT_LENGTH); - return i * ATSC_MPEG_PKT_LENGTH; - } + return i * ATSC_MPEG_PKT_LENGTH; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_depad_impl.h b/gr-dtv/lib/atsc/atsc_depad_impl.h index d29b1cfe9e..b649f2f9d3 100644 --- a/gr-dtv/lib/atsc/atsc_depad_impl.h +++ b/gr-dtv/lib/atsc/atsc_depad_impl.h @@ -27,19 +27,19 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_depad_impl : public atsc_depad - { - public: - atsc_depad_impl(); +class atsc_depad_impl : public atsc_depad +{ +public: + atsc_depad_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DEPAD_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc b/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc index 364713f7b5..31d16b3c1d 100644 --- a/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc +++ b/gr-dtv/lib/atsc/atsc_derandomizer_impl.cc @@ -29,37 +29,34 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { +namespace dtv { - atsc_derandomizer::sptr - atsc_derandomizer::make() - { - return gnuradio::get_initial_sptr - (new atsc_derandomizer_impl()); - } +atsc_derandomizer::sptr atsc_derandomizer::make() +{ + return gnuradio::get_initial_sptr(new atsc_derandomizer_impl()); +} - atsc_derandomizer_impl::atsc_derandomizer_impl() - : gr::sync_block("dtv_atsc_derandomizer", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet))) - { - d_rand.reset(); - } +atsc_derandomizer_impl::atsc_derandomizer_impl() + : gr::sync_block("dtv_atsc_derandomizer", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet))) +{ + d_rand.reset(); +} - int - atsc_derandomizer_impl::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_no_sync *in = (const atsc_mpeg_packet_no_sync *) input_items[0]; - atsc_mpeg_packet *out = (atsc_mpeg_packet *) output_items[0]; +int atsc_derandomizer_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_no_sync* in = (const atsc_mpeg_packet_no_sync*)input_items[0]; + atsc_mpeg_packet* out = (atsc_mpeg_packet*)output_items[0]; - for (int i = 0; i < noutput_items; i++){ + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); if (in[i].pli.first_regular_seg_p()) - d_rand.reset(); + d_rand.reset(); d_rand.derandomize(out[i], in[i]); @@ -67,13 +64,13 @@ namespace gr { // corresponding bit in transport packet header. if (in[i].pli.transport_error_p()) - out[i].data[1] |= MPEG_TRANSPORT_ERROR_BIT; + out[i].data[1] |= MPEG_TRANSPORT_ERROR_BIT; else - out[i].data[1] &= ~MPEG_TRANSPORT_ERROR_BIT; - } - - return noutput_items; + out[i].data[1] &= ~MPEG_TRANSPORT_ERROR_BIT; } - } /* namespace dtv */ + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_derandomizer_impl.h b/gr-dtv/lib/atsc/atsc_derandomizer_impl.h index a307a51d86..f93f0895f3 100644 --- a/gr-dtv/lib/atsc/atsc_derandomizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_derandomizer_impl.h @@ -27,22 +27,22 @@ #include "atsc_randomize.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_derandomizer_impl : public atsc_derandomizer - { - private: - atsc_randomize d_rand; +class atsc_derandomizer_impl : public atsc_derandomizer +{ +private: + atsc_randomize d_rand; - public: - atsc_derandomizer_impl(); +public: + atsc_derandomizer_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_DERANDOMIZER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_equalizer_impl.cc b/gr-dtv/lib/atsc/atsc_equalizer_impl.cc index 0e0b6ab88d..6dba4f180f 100644 --- a/gr-dtv/lib/atsc/atsc_equalizer_impl.cc +++ b/gr-dtv/lib/atsc/atsc_equalizer_impl.cc @@ -31,202 +31,185 @@ #include <volk/volk.h> namespace gr { - namespace dtv { +namespace dtv { - atsc_equalizer::sptr - atsc_equalizer::make() - { - return gnuradio::get_initial_sptr - (new atsc_equalizer_impl()); - } +atsc_equalizer::sptr atsc_equalizer::make() +{ + return gnuradio::get_initial_sptr(new atsc_equalizer_impl()); +} - static float - bin_map (int bit) - { - return bit ? +5 : -5; - } +static float bin_map(int bit) { return bit ? +5 : -5; } - static void - init_field_sync_common (float *p, int mask) - { - int i = 0; +static void init_field_sync_common(float* p, int mask) +{ + int i = 0; - p[i++] = bin_map (1); // data segment sync pulse - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (1); + p[i++] = bin_map(1); // data segment sync pulse + p[i++] = bin_map(0); + p[i++] = bin_map(0); + p[i++] = bin_map(1); - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map (atsc_pn511[j]); + for (int j = 0; j < 511; j++) // PN511 + p[i++] = bin_map(atsc_pn511[j]); - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); + for (int j = 0; j < 63; j++) // PN63 + p[i++] = bin_map(atsc_pn63[j]); - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map (atsc_pn63[j] ^ mask); + for (int j = 0; j < 63; j++) // PN63, toggled on field 2 + p[i++] = bin_map(atsc_pn63[j] ^ mask); - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - } + for (int j = 0; j < 63; j++) // PN63 + p[i++] = bin_map(atsc_pn63[j]); +} - atsc_equalizer_impl::atsc_equalizer_impl() - : gr::block("dtv_atsc_equalizer", - io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) - { - init_field_sync_common(training_sequence1, 0); - init_field_sync_common(training_sequence2, 1); +atsc_equalizer_impl::atsc_equalizer_impl() + : gr::block("dtv_atsc_equalizer", + io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), + io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) +{ + init_field_sync_common(training_sequence1, 0); + init_field_sync_common(training_sequence2, 1); - d_taps.resize(NTAPS, 0.0f); + d_taps.resize(NTAPS, 0.0f); - d_buff_not_filled = true; + d_buff_not_filled = true; - const int alignment_multiple = - volk_get_alignment() / sizeof(float); - set_alignment(std::max(1, alignment_multiple)); - } + const int alignment_multiple = volk_get_alignment() / sizeof(float); + set_alignment(std::max(1, alignment_multiple)); +} - atsc_equalizer_impl::~atsc_equalizer_impl() - { - } +atsc_equalizer_impl::~atsc_equalizer_impl() {} - std::vector<float> - atsc_equalizer_impl::taps() const - { - return d_taps; - } +std::vector<float> atsc_equalizer_impl::taps() const { return d_taps; } - std::vector<float> - atsc_equalizer_impl::data() const - { - std::vector<float> ret(&data_mem2[0], &data_mem2[ATSC_DATA_SEGMENT_LENGTH-1]); - return ret; - } +std::vector<float> atsc_equalizer_impl::data() const +{ + std::vector<float> ret(&data_mem2[0], &data_mem2[ATSC_DATA_SEGMENT_LENGTH - 1]); + return ret; +} - void - atsc_equalizer_impl::filterN(const float *input_samples, - float *output_samples, - int nsamples) - { - for (int j = 0; j < nsamples; j++) { +void atsc_equalizer_impl::filterN(const float* input_samples, + float* output_samples, + int nsamples) +{ + for (int j = 0; j < nsamples; j++) { output_samples[j] = 0; - volk_32f_x2_dot_prod_32f(&output_samples[j], - &input_samples[j], - &d_taps[0], NTAPS); - } + volk_32f_x2_dot_prod_32f( + &output_samples[j], &input_samples[j], &d_taps[0], NTAPS); } +} - void - atsc_equalizer_impl::adaptN(const float *input_samples, - const float *training_pattern, - float *output_samples, - int nsamples) - { - static const double BETA = 0.00005; // FIXME figure out what this ought to be - // FIXME add gear-shifting +void atsc_equalizer_impl::adaptN(const float* input_samples, + const float* training_pattern, + float* output_samples, + int nsamples) +{ + static const double BETA = 0.00005; // FIXME figure out what this ought to be + // FIXME add gear-shifting - for(int j = 0; j < nsamples; j++) { + for (int j = 0; j < nsamples; j++) { output_samples[j] = 0; - volk_32f_x2_dot_prod_32f(&output_samples[j], - &input_samples[j], - &d_taps[0], NTAPS); + volk_32f_x2_dot_prod_32f( + &output_samples[j], &input_samples[j], &d_taps[0], NTAPS); float e = output_samples[j] - training_pattern[j]; // update taps... float tmp_taps[NTAPS]; - volk_32f_s32f_multiply_32f(tmp_taps, &input_samples[j], BETA*e, NTAPS); + volk_32f_s32f_multiply_32f(tmp_taps, &input_samples[j], BETA * e, NTAPS); volk_32f_x2_subtract_32f(&d_taps[0], &d_taps[0], tmp_taps, NTAPS); - } } - - int - atsc_equalizer_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_soft_data_segment *out = (atsc_soft_data_segment *) output_items[0]; - - int output_produced = 0; - int i = 0; - - if(d_buff_not_filled) { - memset(&data_mem[0], 0, - NPRETAPS*sizeof(float)); - memcpy(&data_mem[NPRETAPS], in[i].data, - ATSC_DATA_SEGMENT_LENGTH*sizeof(float)); +} + +int atsc_equalizer_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_soft_data_segment* in = (const atsc_soft_data_segment*)input_items[0]; + atsc_soft_data_segment* out = (atsc_soft_data_segment*)output_items[0]; + + int output_produced = 0; + int i = 0; + + if (d_buff_not_filled) { + memset(&data_mem[0], 0, NPRETAPS * sizeof(float)); + memcpy(&data_mem[NPRETAPS], in[i].data, ATSC_DATA_SEGMENT_LENGTH * sizeof(float)); d_flags = in[i].pli._flags; d_segno = in[i].pli._segno; d_buff_not_filled = false; i++; - } - - for (; i < noutput_items; i++) { - - memcpy(&data_mem[ATSC_DATA_SEGMENT_LENGTH + NPRETAPS], in[i].data, - (NTAPS - NPRETAPS)*sizeof(float)); - - if(d_segno == -1) { - if(d_flags & 0x0010) { - adaptN(data_mem, training_sequence2, data_mem2, KNOWN_FIELD_SYNC_LENGTH); - //filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); - } - else if( !(d_flags & 0x0010) ) { - adaptN( data_mem, training_sequence1, data_mem2, KNOWN_FIELD_SYNC_LENGTH ); - //filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); - } - } - else { - filterN(data_mem, data_mem2, ATSC_DATA_SEGMENT_LENGTH); - - memcpy(out[output_produced].data, data_mem2, - ATSC_DATA_SEGMENT_LENGTH*sizeof(float)); + } - out[output_produced].pli._flags = d_flags; - out[output_produced].pli._segno = d_segno; - output_produced++; + for (; i < noutput_items; i++) { + + memcpy(&data_mem[ATSC_DATA_SEGMENT_LENGTH + NPRETAPS], + in[i].data, + (NTAPS - NPRETAPS) * sizeof(float)); + + if (d_segno == -1) { + if (d_flags & 0x0010) { + adaptN(data_mem, training_sequence2, data_mem2, KNOWN_FIELD_SYNC_LENGTH); + // filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, + // ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); + } else if (!(d_flags & 0x0010)) { + adaptN(data_mem, training_sequence1, data_mem2, KNOWN_FIELD_SYNC_LENGTH); + // filterN(&data_mem[KNOWN_FIELD_SYNC_LENGTH], data_mem2, + // ATSC_DATA_SEGMENT_LENGTH - KNOWN_FIELD_SYNC_LENGTH); + } + } else { + filterN(data_mem, data_mem2, ATSC_DATA_SEGMENT_LENGTH); + + memcpy(out[output_produced].data, + data_mem2, + ATSC_DATA_SEGMENT_LENGTH * sizeof(float)); + + out[output_produced].pli._flags = d_flags; + out[output_produced].pli._segno = d_segno; + output_produced++; } - memcpy(data_mem, &data_mem[ATSC_DATA_SEGMENT_LENGTH], - NPRETAPS*sizeof(float)); - memcpy(&data_mem[NPRETAPS], in[i].data, - ATSC_DATA_SEGMENT_LENGTH*sizeof(float)); + memcpy(data_mem, &data_mem[ATSC_DATA_SEGMENT_LENGTH], NPRETAPS * sizeof(float)); + memcpy(&data_mem[NPRETAPS], in[i].data, ATSC_DATA_SEGMENT_LENGTH * sizeof(float)); d_flags = in[i].pli._flags; d_segno = in[i].pli._segno; - } - - consume_each(noutput_items); - return output_produced; } - void - atsc_equalizer_impl::setup_rpc() - { + consume_each(noutput_items); + return output_produced; +} + +void atsc_equalizer_impl::setup_rpc() +{ #ifdef GR_CTRLPORT - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float> >( - alias(), "taps", - &atsc_equalizer::taps, - pmt::make_f32vector(1,-10), - pmt::make_f32vector(1,10), - pmt::make_f32vector(1,0), - "", "Equalizer Taps", RPC_PRIVLVL_MIN, - DISPTIME))); - - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float> >( - alias(), "data", - &atsc_equalizer::data, - pmt::make_f32vector(1,-10), - pmt::make_f32vector(1,10), - pmt::make_f32vector(1,0), - "", "Post-equalizer Data", RPC_PRIVLVL_MIN, - DISPTIME))); + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float>>( + alias(), + "taps", + &atsc_equalizer::taps, + pmt::make_f32vector(1, -10), + pmt::make_f32vector(1, 10), + pmt::make_f32vector(1, 0), + "", + "Equalizer Taps", + RPC_PRIVLVL_MIN, + DISPTIME))); + + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<atsc_equalizer, std::vector<float>>( + alias(), + "data", + &atsc_equalizer::data, + pmt::make_f32vector(1, -10), + pmt::make_f32vector(1, 10), + pmt::make_f32vector(1, 0), + "", + "Post-equalizer Data", + RPC_PRIVLVL_MIN, + DISPTIME))); #endif /* GR_CTRLPORT */ - } +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_equalizer_impl.h b/gr-dtv/lib/atsc/atsc_equalizer_impl.h index 75862f6408..86e1171a09 100644 --- a/gr-dtv/lib/atsc/atsc_equalizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_equalizer_impl.h @@ -28,49 +28,51 @@ #include "atsc_syminfo_impl.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_equalizer_impl : public atsc_equalizer - { - private: - static const int NTAPS = 64; - static const int NPRETAPS = (int) (NTAPS * 0.8); // probably should be either .2 or .8 +class atsc_equalizer_impl : public atsc_equalizer +{ +private: + static const int NTAPS = 64; + static const int NPRETAPS = (int)(NTAPS * 0.8); // probably should be either .2 or .8 - // the length of the field sync pattern that we know unequivocally - static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; + // the length of the field sync pattern that we know unequivocally + static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; - float training_sequence1[KNOWN_FIELD_SYNC_LENGTH]; - float training_sequence2[KNOWN_FIELD_SYNC_LENGTH]; + float training_sequence1[KNOWN_FIELD_SYNC_LENGTH]; + float training_sequence2[KNOWN_FIELD_SYNC_LENGTH]; - void filterN(const float *input_samples, float *output_samples, int nsamples); - void adaptN(const float *input_samples, const float *training_pattern, - float *output_samples, int nsamples); + void filterN(const float* input_samples, float* output_samples, int nsamples); + void adaptN(const float* input_samples, + const float* training_pattern, + float* output_samples, + int nsamples); - std::vector<float> d_taps; + std::vector<float> d_taps; - float data_mem[ATSC_DATA_SEGMENT_LENGTH + NTAPS]; // Buffer for previous data packet - float data_mem2[ATSC_DATA_SEGMENT_LENGTH]; - unsigned short d_flags; - short d_segno; + float data_mem[ATSC_DATA_SEGMENT_LENGTH + NTAPS]; // Buffer for previous data packet + float data_mem2[ATSC_DATA_SEGMENT_LENGTH]; + unsigned short d_flags; + short d_segno; - int d_buff_not_filled; + int d_buff_not_filled; - public: - atsc_equalizer_impl(); - ~atsc_equalizer_impl(); +public: + atsc_equalizer_impl(); + ~atsc_equalizer_impl(); - void setup_rpc(); + void setup_rpc(); - std::vector<float> taps() const; - std::vector<float> data() const; + std::vector<float> taps() const; + std::vector<float> data() const; - virtual int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_EQUALIZER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc index ffe410292e..88ac0a3558 100644 --- a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc +++ b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.cc @@ -23,50 +23,39 @@ #include "atsc_fake_single_viterbi.h" namespace gr { - namespace dtv { +namespace dtv { - void - atsc_fake_single_viterbi::reset() - { - post_coder_state = 0; - } +void atsc_fake_single_viterbi::reset() { post_coder_state = 0; } - atsc_fake_single_viterbi::atsc_fake_single_viterbi() - { - reset(); - } +atsc_fake_single_viterbi::atsc_fake_single_viterbi() { reset(); } - /* - * implement simple slicer and post coder - */ - char - atsc_fake_single_viterbi::decode(float input) - { - int y2, y1; +/* + * implement simple slicer and post coder + */ +char atsc_fake_single_viterbi::decode(float input) +{ + int y2, y1; - if (input < -4){ + if (input < -4) { y2 = 0; y1 = 0; - } - else if (input < 0){ + } else if (input < 0) { y2 = 0; y1 = 1; - } - else if (input < 4){ + } else if (input < 4) { y2 = 1; y1 = 0; - } - else { + } else { y2 = 1; y1 = 1; - } + } - int x1 = y1; - int x2 = y2 ^ post_coder_state; - post_coder_state = y2; + int x1 = y1; + int x2 = y2 ^ post_coder_state; + post_coder_state = y2; - return (x2 << 1) | x1; - } + return (x2 << 1) | x1; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h index 9ca546a6ab..3c770d70ba 100644 --- a/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h +++ b/gr-dtv/lib/atsc/atsc_fake_single_viterbi.h @@ -24,29 +24,29 @@ #define INCLUDED_ATSC_FAKE_SINGLE_VITERBI_H namespace gr { - namespace dtv { +namespace dtv { - class atsc_fake_single_viterbi - { - public: - atsc_fake_single_viterbi(); +class atsc_fake_single_viterbi +{ +public: + atsc_fake_single_viterbi(); - /*! - * \p INPUT ideally takes on the values +/- 1,3,5,7 - * return is decoded dibit in the range [0, 3] - */ - char decode (float input); + /*! + * \p INPUT ideally takes on the values +/- 1,3,5,7 + * return is decoded dibit in the range [0, 3] + */ + char decode(float input); - void reset(); + void reset(); - //! internal delay of decoder - int delay() { return 0; } + //! internal delay of decoder + int delay() { return 0; } - protected: - int post_coder_state; - }; +protected: + int post_coder_state; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_ATSC_FAKE_SINGLE_VITERBI_H */ diff --git a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc index ed9c44a85c..4d058718f6 100644 --- a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc +++ b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.cc @@ -27,198 +27,186 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { - - static const int N_SAVED_SYMBOLS = 12; - - atsc_field_sync_mux::sptr - atsc_field_sync_mux::make() - { - return gnuradio::get_initial_sptr - (new atsc_field_sync_mux_impl()); - } - - atsc_field_sync_mux_impl::atsc_field_sync_mux_impl() - : gr::block("atsc_field_sync_mux", - gr::io_signature::make(1, 1, sizeof(atsc_data_segment)), - gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) - { - d_already_output_field_sync = false; - for (int i = 0; i < N_SAVED_SYMBOLS; i++) { - d_saved_symbols[i] = 0; - } +namespace dtv { + +static const int N_SAVED_SYMBOLS = 12; + +atsc_field_sync_mux::sptr atsc_field_sync_mux::make() +{ + return gnuradio::get_initial_sptr(new atsc_field_sync_mux_impl()); +} + +atsc_field_sync_mux_impl::atsc_field_sync_mux_impl() + : gr::block("atsc_field_sync_mux", + gr::io_signature::make(1, 1, sizeof(atsc_data_segment)), + gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) +{ + d_already_output_field_sync = false; + for (int i = 0; i < N_SAVED_SYMBOLS; i++) { + d_saved_symbols[i] = 0; } +} - atsc_field_sync_mux_impl::~atsc_field_sync_mux_impl() - { - } +atsc_field_sync_mux_impl::~atsc_field_sync_mux_impl() {} - void - atsc_field_sync_mux_impl::init_field_sync_common(unsigned char *p, int mask, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - { - static const unsigned char bin_map[2] = {1, 6}; // map binary values to 1 of 8 levels +void atsc_field_sync_mux_impl::init_field_sync_common( + unsigned char* p, int mask, const unsigned char saved_symbols[N_SAVED_SYMBOLS]) +{ + static const unsigned char bin_map[2] = { 1, + 6 }; // map binary values to 1 of 8 levels - int i = 0; + int i = 0; - p[i++] = bin_map[1]; // data segment sync pulse - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; + p[i++] = bin_map[1]; // data segment sync pulse + p[i++] = bin_map[0]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; - for (int j = 0; j < 511; j++) { // PN511 + for (int j = 0; j < 511; j++) { // PN511 p[i++] = bin_map[atsc_pn511[j]]; - } + } - for (int j = 0; j < 63; j++) { // PN63 + for (int j = 0; j < 63; j++) { // PN63 p[i++] = bin_map[atsc_pn63[j]]; - } + } - for (int j = 0; j < 63; j++) { // PN63, toggled on field 2 + for (int j = 0; j < 63; j++) { // PN63, toggled on field 2 p[i++] = bin_map[atsc_pn63[j] ^ mask]; - } - - for (int j = 0; j < 63; j++) { // PN63 - p[i++] = bin_map[atsc_pn63[j]]; - } - - p[i++] = bin_map[0]; // 24 bits of 8VSB mode identifier - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - for (int j = 0; j < 92; j++) { // 92 more bits - p[i++] = bin_map[atsc_pn63[j % 63]]; - } - - // now copy the last 12 symbols of the previous segment - - for (int j = 0; j < N_SAVED_SYMBOLS; j++) { - p[i++] = saved_symbols[j]; - } - - assert(i == ATSC_DATA_SEGMENT_LENGTH); } - inline void - atsc_field_sync_mux_impl::init_field_sync_1(atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - { - init_field_sync_common(&s->data[0], 0, saved_symbols); + for (int j = 0; j < 63; j++) { // PN63 + p[i++] = bin_map[atsc_pn63[j]]; } - inline void - atsc_field_sync_mux_impl::init_field_sync_2(atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - { - init_field_sync_common(&s->data[0], 1, saved_symbols); + p[i++] = bin_map[0]; // 24 bits of 8VSB mode identifier + p[i++] = bin_map[0]; + p[i++] = bin_map[0]; + p[i++] = bin_map[0]; + + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + + p[i++] = bin_map[1]; + p[i++] = bin_map[1]; + p[i++] = bin_map[1]; + p[i++] = bin_map[1]; + + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + p[i++] = bin_map[1]; + p[i++] = bin_map[0]; + + for (int j = 0; j < 92; j++) { // 92 more bits + p[i++] = bin_map[atsc_pn63[j % 63]]; } - void - atsc_field_sync_mux_impl::save_last_symbols(unsigned char saved_symbols[N_SAVED_SYMBOLS], - const atsc_data_segment &seg) - { - for (int i = 0; i < N_SAVED_SYMBOLS; i++) { - saved_symbols[i] = seg.data[i + ATSC_DATA_SEGMENT_LENGTH - N_SAVED_SYMBOLS]; - } - } + // now copy the last 12 symbols of the previous segment - inline bool - atsc_field_sync_mux_impl::last_regular_seg_p(const plinfo &pli) - { - return pli.regular_seg_p() && (pli.segno() == ATSC_DSEGS_PER_FIELD - 1); + for (int j = 0; j < N_SAVED_SYMBOLS; j++) { + p[i++] = saved_symbols[j]; } - void - atsc_field_sync_mux_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) - { - ninput_items_required[0] = noutput_items; + assert(i == ATSC_DATA_SEGMENT_LENGTH); +} + +inline void atsc_field_sync_mux_impl::init_field_sync_1( + atsc_data_segment* s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]) +{ + init_field_sync_common(&s->data[0], 0, saved_symbols); +} + +inline void atsc_field_sync_mux_impl::init_field_sync_2( + atsc_data_segment* s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]) +{ + init_field_sync_common(&s->data[0], 1, saved_symbols); +} + +void atsc_field_sync_mux_impl::save_last_symbols( + unsigned char saved_symbols[N_SAVED_SYMBOLS], const atsc_data_segment& seg) +{ + for (int i = 0; i < N_SAVED_SYMBOLS; i++) { + saved_symbols[i] = seg.data[i + ATSC_DATA_SEGMENT_LENGTH - N_SAVED_SYMBOLS]; } - - int - atsc_field_sync_mux_impl::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_data_segment *in = (const atsc_data_segment *) input_items[0]; - atsc_data_segment *out = (atsc_data_segment *) output_items[0]; - int in_length = ninput_items[0]; - int index = 0; - int outdex = 0; - - for (outdex = 0; outdex < noutput_items && index < in_length; outdex++) { +} + +inline bool atsc_field_sync_mux_impl::last_regular_seg_p(const plinfo& pli) +{ + return pli.regular_seg_p() && (pli.segno() == ATSC_DSEGS_PER_FIELD - 1); +} + +void atsc_field_sync_mux_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) +{ + ninput_items_required[0] = noutput_items; +} + +int atsc_field_sync_mux_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_data_segment* in = (const atsc_data_segment*)input_items[0]; + atsc_data_segment* out = (atsc_data_segment*)output_items[0]; + int in_length = ninput_items[0]; + int index = 0; + int outdex = 0; + + for (outdex = 0; outdex < noutput_items && index < in_length; outdex++) { assert(in[index].pli.regular_seg_p()); if (!in[index].pli.first_regular_seg_p()) { - out[outdex] = in[index]; // just copy in to out - - if (last_regular_seg_p(in[index].pli)) { - save_last_symbols(d_saved_symbols, in[index]); - } - index++; - } - else { // first_regular_seg_p - if (!d_already_output_field_sync) { - // write out field sync... - atsc_data_segment field_sync; - - field_sync.pli._flags = 0; - field_sync.pli._segno = 0; - memset(field_sync._pad_, 0, atsc_data_segment::NPAD); + out[outdex] = in[index]; // just copy in to out - if (in[index].pli.in_field1_p()) { - init_field_sync_1(&field_sync, d_saved_symbols); + if (last_regular_seg_p(in[index].pli)) { + save_last_symbols(d_saved_symbols, in[index]); } - else { - init_field_sync_2(&field_sync, d_saved_symbols); - } - - // note that index doesn't advance in this branch - out[outdex] = field_sync; - d_already_output_field_sync = true; - } - else { - // already output field sync, now output first regular segment - out[outdex] = in[index]; index++; - d_already_output_field_sync = false; - } + } else { // first_regular_seg_p + if (!d_already_output_field_sync) { + // write out field sync... + atsc_data_segment field_sync; + + field_sync.pli._flags = 0; + field_sync.pli._segno = 0; + memset(field_sync._pad_, 0, atsc_data_segment::NPAD); + + if (in[index].pli.in_field1_p()) { + init_field_sync_1(&field_sync, d_saved_symbols); + } else { + init_field_sync_2(&field_sync, d_saved_symbols); + } + + // note that index doesn't advance in this branch + out[outdex] = field_sync; + d_already_output_field_sync = true; + } else { + // already output field sync, now output first regular segment + out[outdex] = in[index]; + index++; + d_already_output_field_sync = false; + } } - } + } - // Tell runtime system how many input items we consumed on - // each input stream. - consume_each (index); + // Tell runtime system how many input items we consumed on + // each input stream. + consume_each(index); - // Tell runtime system how many output items we produced. - return outdex; - } + // Tell runtime system how many output items we produced. + return outdex; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h index ce4ab30323..9e3083e104 100644 --- a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h +++ b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h @@ -26,34 +26,39 @@ #include "atsc_types.h" namespace gr { - namespace dtv { - - class atsc_field_sync_mux_impl : public atsc_field_sync_mux - { - private: - static const int N_SAVED_SYMBOLS = 12; - bool d_already_output_field_sync; - unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; - - void init_field_sync_common(unsigned char *p, int mask, const unsigned char saved_symbols[N_SAVED_SYMBOLS]); - inline void init_field_sync_1(atsc_data_segment *s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]); - inline void init_field_sync_2(atsc_data_segment *s, const unsigned char saved_symbols[N_SAVED_SYMBOLS]); - void save_last_symbols(unsigned char saved_symbols[N_SAVED_SYMBOLS], const atsc_data_segment &seg); - inline bool last_regular_seg_p(const plinfo &pli); - - public: - atsc_field_sync_mux_impl(); - ~atsc_field_sync_mux_impl(); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class atsc_field_sync_mux_impl : public atsc_field_sync_mux +{ +private: + static const int N_SAVED_SYMBOLS = 12; + bool d_already_output_field_sync; + unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; + + void init_field_sync_common(unsigned char* p, + int mask, + const unsigned char saved_symbols[N_SAVED_SYMBOLS]); + inline void init_field_sync_1(atsc_data_segment* s, + const unsigned char saved_symbols[N_SAVED_SYMBOLS]); + inline void init_field_sync_2(atsc_data_segment* s, + const unsigned char saved_symbols[N_SAVED_SYMBOLS]); + void save_last_symbols(unsigned char saved_symbols[N_SAVED_SYMBOLS], + const atsc_data_segment& seg); + inline bool last_regular_seg_p(const plinfo& pli); + +public: + atsc_field_sync_mux_impl(); + ~atsc_field_sync_mux_impl(); + + void forecast(int noutput_items, gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_FIELD_SYNC_MUX_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_fpll_impl.cc b/gr-dtv/lib/atsc/atsc_fpll_impl.cc index a552004972..8522a912ca 100644 --- a/gr-dtv/lib/atsc/atsc_fpll_impl.cc +++ b/gr-dtv/lib/atsc/atsc_fpll_impl.cc @@ -30,45 +30,40 @@ #include <gnuradio/sincos.h> namespace gr { - namespace dtv { +namespace dtv { - atsc_fpll::sptr - atsc_fpll::make(float rate) - { - return gnuradio::get_initial_sptr - (new atsc_fpll_impl(rate)); - } +atsc_fpll::sptr atsc_fpll::make(float rate) +{ + return gnuradio::get_initial_sptr(new atsc_fpll_impl(rate)); +} - atsc_fpll_impl::atsc_fpll_impl(float rate) - : sync_block("dtv_atsc_fpll", - io_signature::make(1, 1, sizeof(gr_complex)), - io_signature::make(1, 1, sizeof(float))) - { - d_afc.set_taps(1.0-exp(-1.0/rate/5e-6)); - d_nco.set_freq((-3e6 + 0.309e6)/rate*2*GR_M_PI); - d_nco.set_phase(0.0); - } +atsc_fpll_impl::atsc_fpll_impl(float rate) + : sync_block("dtv_atsc_fpll", + io_signature::make(1, 1, sizeof(gr_complex)), + io_signature::make(1, 1, sizeof(float))) +{ + d_afc.set_taps(1.0 - exp(-1.0 / rate / 5e-6)); + d_nco.set_freq((-3e6 + 0.309e6) / rate * 2 * GR_M_PI); + d_nco.set_phase(0.0); +} - atsc_fpll_impl::~atsc_fpll_impl() - { - } +atsc_fpll_impl::~atsc_fpll_impl() {} - int - atsc_fpll_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *)input_items[0]; - float *out = (float *)output_items[0]; +int atsc_fpll_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const gr_complex* in = (const gr_complex*)input_items[0]; + float* out = (float*)output_items[0]; - for (int k = 0; k < noutput_items; k++) { + for (int k = 0; k < noutput_items; k++) { float a_cos, a_sin; - d_nco.step(); // increment phase - d_nco.sincos(&a_sin, &a_cos); // compute cos and sin + d_nco.step(); // increment phase + d_nco.sincos(&a_sin, &a_cos); // compute cos and sin // Mix out carrier and output I-only signal - gr_complex result = in[k]*gr_complex(a_sin, a_cos); + gr_complex result = in[k] * gr_complex(a_sin, a_cos); out[k] = result.real(); // Update phase/freq error @@ -76,20 +71,20 @@ namespace gr { float x = gr::fast_atan2f(filtered.imag(), filtered.real()); // avoid slamming filter with big transitions - static const float limit = GR_M_PI/2.0; + static const float limit = GR_M_PI / 2.0; if (x > limit) - x = limit; + x = limit; else if (x < -limit) - x = -limit; + x = -limit; static const float alpha = 0.01; - static const float beta = alpha*alpha/4.0; - d_nco.adjust_phase(alpha*x); - d_nco.adjust_freq(beta*x); - } - - return noutput_items; + static const float beta = alpha * alpha / 4.0; + d_nco.adjust_phase(alpha * x); + d_nco.adjust_freq(beta * x); } - } /* namespace dtv */ + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_fpll_impl.h b/gr-dtv/lib/atsc/atsc_fpll_impl.h index e06fc09cc5..1cc5bbd127 100644 --- a/gr-dtv/lib/atsc/atsc_fpll_impl.h +++ b/gr-dtv/lib/atsc/atsc_fpll_impl.h @@ -30,24 +30,24 @@ #include <stdio.h> namespace gr { - namespace dtv { +namespace dtv { - class atsc_fpll_impl : public atsc_fpll - { - private: - gr::nco<float,float> d_nco; - gr::filter::single_pole_iir<gr_complex,gr_complex,float> d_afc; +class atsc_fpll_impl : public atsc_fpll +{ +private: + gr::nco<float, float> d_nco; + gr::filter::single_pole_iir<gr_complex, gr_complex, float> d_afc; - public: - atsc_fpll_impl(float rate); - ~atsc_fpll_impl(); +public: + atsc_fpll_impl(float rate); + ~atsc_fpll_impl(); - virtual int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_FPLL_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc b/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc index 3a39bc794b..6297650227 100644 --- a/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc +++ b/gr-dtv/lib/atsc/atsc_fs_checker_impl.cc @@ -31,98 +31,91 @@ #include "gnuradio/dtv/atsc_consts.h" #include <gnuradio/io_signature.h> -static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong +static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong static const int PN63_ERROR_LIMIT = 5; namespace gr { - namespace dtv { - - atsc_fs_checker::sptr - atsc_fs_checker::make() - { - return gnuradio::get_initial_sptr - (new atsc_fs_checker_impl()); - } - - atsc_fs_checker_impl::atsc_fs_checker_impl() - : gr::block("dtv_atsc_fs_checker", - io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) - { - reset(); - } - - void - atsc_fs_checker_impl::reset() - { - d_index = 0; - memset (d_sample_sr, 0, sizeof (d_sample_sr)); - memset (d_tag_sr, 0, sizeof (d_tag_sr)); - memset (d_bit_sr, 0, sizeof (d_bit_sr)); - d_field_num = 0; - d_segment_num = 0; - } - - atsc_fs_checker_impl::~atsc_fs_checker_impl() - { - } - - int - atsc_fs_checker_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_soft_data_segment *out = (atsc_soft_data_segment *) output_items[0]; - - int output_produced = 0; - - for (int i = 0; i < noutput_items; i++) { +namespace dtv { + +atsc_fs_checker::sptr atsc_fs_checker::make() +{ + return gnuradio::get_initial_sptr(new atsc_fs_checker_impl()); +} + +atsc_fs_checker_impl::atsc_fs_checker_impl() + : gr::block("dtv_atsc_fs_checker", + io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), + io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) +{ + reset(); +} + +void atsc_fs_checker_impl::reset() +{ + d_index = 0; + memset(d_sample_sr, 0, sizeof(d_sample_sr)); + memset(d_tag_sr, 0, sizeof(d_tag_sr)); + memset(d_bit_sr, 0, sizeof(d_bit_sr)); + d_field_num = 0; + d_segment_num = 0; +} + +atsc_fs_checker_impl::~atsc_fs_checker_impl() {} + +int atsc_fs_checker_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_soft_data_segment* in = (const atsc_soft_data_segment*)input_items[0]; + atsc_soft_data_segment* out = (atsc_soft_data_segment*)output_items[0]; + + int output_produced = 0; + + for (int i = 0; i < noutput_items; i++) { // check for a hit on the PN 511 pattern int errors = 0; for (int j = 0; j < LENGTH_511 && errors < PN511_ERROR_LIMIT; j++) - errors += (in[i].data[j + OFFSET_511] >= 0) ^ atsc_pn511[j]; + errors += (in[i].data[j + OFFSET_511] >= 0) ^ atsc_pn511[j]; - //std::cout << errors << std::endl; + // std::cout << errors << std::endl; if (errors < PN511_ERROR_LIMIT) { // 511 pattern is good. - // determine if this is field 1 or field 2 - errors = 0; - for (int j = 0; j < LENGTH_2ND_63; j++) - errors += (in[i].data[j + OFFSET_2ND_63] >= 0) ^ atsc_pn63[j]; - - // we should have either field 1 (== PN63) or field 2 (== ~PN63) - if (errors <= PN63_ERROR_LIMIT) { - //std::cout << "Found FIELD_SYNC_1" << std::endl; - d_field_num = 1; // We are in field number 1 now - d_segment_num = -1; // This is the first segment - } - else if (errors >= (LENGTH_2ND_63 - PN63_ERROR_LIMIT)) { - //std::cout << "Found FIELD_SYNC_2" << std::endl; - d_field_num = 2; // We are in field number 2 now - d_segment_num = -1; // This is the first segment - } - else { - // should be extremely rare. - std::cerr << "!!! atsc_fs_checker: PN63 error count = " << errors << std::endl; - } + // determine if this is field 1 or field 2 + errors = 0; + for (int j = 0; j < LENGTH_2ND_63; j++) + errors += (in[i].data[j + OFFSET_2ND_63] >= 0) ^ atsc_pn63[j]; + + // we should have either field 1 (== PN63) or field 2 (== ~PN63) + if (errors <= PN63_ERROR_LIMIT) { + // std::cout << "Found FIELD_SYNC_1" << std::endl; + d_field_num = 1; // We are in field number 1 now + d_segment_num = -1; // This is the first segment + } else if (errors >= (LENGTH_2ND_63 - PN63_ERROR_LIMIT)) { + // std::cout << "Found FIELD_SYNC_2" << std::endl; + d_field_num = 2; // We are in field number 2 now + d_segment_num = -1; // This is the first segment + } else { + // should be extremely rare. + std::cerr << "!!! atsc_fs_checker: PN63 error count = " << errors + << std::endl; + } } - if( d_field_num == 1 || d_field_num == 2 ) { // If we have sync - // So we copy out current packet data to an output packet and fill its plinfo - for( int j = 0; j < ATSC_DATA_SEGMENT_LENGTH; j++ ) - out[output_produced].data[j] = in[i].data[j]; - out[output_produced].pli.set_regular_seg((d_field_num == 2), d_segment_num); - d_segment_num++; - output_produced++; + if (d_field_num == 1 || d_field_num == 2) { // If we have sync + // So we copy out current packet data to an output packet and fill its plinfo + for (int j = 0; j < ATSC_DATA_SEGMENT_LENGTH; j++) + out[output_produced].data[j] = in[i].data[j]; + out[output_produced].pli.set_regular_seg((d_field_num == 2), d_segment_num); + d_segment_num++; + output_produced++; } - } - - consume_each(noutput_items); - return output_produced; } - } /* namespace dtv */ + consume_each(noutput_items); + return output_produced; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_fs_checker_impl.h b/gr-dtv/lib/atsc/atsc_fs_checker_impl.h index 1210ae5830..544f6a4ba6 100644 --- a/gr-dtv/lib/atsc/atsc_fs_checker_impl.h +++ b/gr-dtv/lib/atsc/atsc_fs_checker_impl.h @@ -27,41 +27,41 @@ #include "atsc_syminfo_impl.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_fs_checker_impl : public atsc_fs_checker - { - private: - static const int SRSIZE = 1024; // must be power of two - int d_index; // points at oldest sample - float d_sample_sr[SRSIZE]; // sample shift register - atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register - unsigned char d_bit_sr[SRSIZE]; // binary decision shift register - int d_field_num; - int d_segment_num; +class atsc_fs_checker_impl : public atsc_fs_checker +{ +private: + static const int SRSIZE = 1024; // must be power of two + int d_index; // points at oldest sample + float d_sample_sr[SRSIZE]; // sample shift register + atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register + unsigned char d_bit_sr[SRSIZE]; // binary decision shift register + int d_field_num; + int d_segment_num; - static const int OFFSET_511 = 4; // offset to second PN 63 pattern - static const int LENGTH_511 = 511; // length of PN 63 pattern - static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern - static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern + static const int OFFSET_511 = 4; // offset to second PN 63 pattern + static const int LENGTH_511 = 511; // length of PN 63 pattern + static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern + static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern - inline static int wrap (int index){ return index & (SRSIZE - 1); } - inline static int incr (int index){ return wrap (index + 1); } - inline static int decr (int index){ return wrap (index - 1); } + inline static int wrap(int index) { return index & (SRSIZE - 1); } + inline static int incr(int index) { return wrap(index + 1); } + inline static int decr(int index) { return wrap(index - 1); } - public: - atsc_fs_checker_impl(); - ~atsc_fs_checker_impl(); +public: + atsc_fs_checker_impl(); + ~atsc_fs_checker_impl(); - void reset(); + void reset(); - virtual int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_FS_CHECKER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_interleaver_fifo.h b/gr-dtv/lib/atsc/atsc_interleaver_fifo.h index 0d40389c74..f9dad30029 100644 --- a/gr-dtv/lib/atsc/atsc_interleaver_fifo.h +++ b/gr-dtv/lib/atsc/atsc_interleaver_fifo.h @@ -26,61 +26,62 @@ #include <string.h> namespace gr { - namespace dtv { +namespace dtv { - template<class symbol_type> - class interleaver_fifo { - public: +template <class symbol_type> +class interleaver_fifo +{ +public: + interleaver_fifo(unsigned int size); + ~interleaver_fifo(); - interleaver_fifo(unsigned int size); - ~interleaver_fifo(); + //! reset interleaver (flushes contents and resets commutator) + void reset(); - //! reset interleaver (flushes contents and resets commutator) - void reset (); - - //! stuff a symbol into the fifo and return the oldest - symbol_type stuff(symbol_type input) { + //! stuff a symbol into the fifo and return the oldest + symbol_type stuff(symbol_type input) + { if (m_size == 0) - return input; + return input; symbol_type retval = m_fifo[m_position]; m_fifo[m_position] = input; m_position++; if (m_position >= m_size) - m_position = 0; + m_position = 0; return retval; - } + } - protected: - unsigned int m_size; - unsigned int m_position; - symbol_type *m_fifo; - }; +protected: + unsigned int m_size; + unsigned int m_position; + symbol_type* m_fifo; +}; - template<class symbol_type> - interleaver_fifo<symbol_type>::interleaver_fifo(unsigned int size) - { - m_size = size; - m_position = 0; - m_fifo = new symbol_type[size]; - memset (m_fifo, 0, m_size * sizeof(symbol_type)); - } +template <class symbol_type> +interleaver_fifo<symbol_type>::interleaver_fifo(unsigned int size) +{ + m_size = size; + m_position = 0; + m_fifo = new symbol_type[size]; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); +} - template<class symbol_type> - interleaver_fifo<symbol_type>::~interleaver_fifo() - { - delete [] m_fifo; - } +template <class symbol_type> +interleaver_fifo<symbol_type>::~interleaver_fifo() +{ + delete[] m_fifo; +} - template<class symbol_type> void - interleaver_fifo<symbol_type>::reset() - { - m_position = 0; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); - } +template <class symbol_type> +void interleaver_fifo<symbol_type>::reset() +{ + m_position = 0; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_INTERLEAVER_FIFO_H */ diff --git a/gr-dtv/lib/atsc/atsc_interleaver_impl.cc b/gr-dtv/lib/atsc/atsc_interleaver_impl.cc index cfc9e2996c..3337cfd0c7 100644 --- a/gr-dtv/lib/atsc/atsc_interleaver_impl.cc +++ b/gr-dtv/lib/atsc/atsc_interleaver_impl.cc @@ -26,84 +26,81 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { - - atsc_interleaver::sptr - atsc_interleaver::make() - { - return gnuradio::get_initial_sptr - (new atsc_interleaver_impl()); - } - - atsc_interleaver_impl::atsc_interleaver_impl() - : gr::sync_block("atsc_interleaver", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) - { - I = 52; /* ATSC interleaver */ - J = 4; - registers = (unsigned char *) malloc(sizeof(unsigned char) * I * ((I - 1) * J)); - if (registers == NULL) { +namespace dtv { + +atsc_interleaver::sptr atsc_interleaver::make() +{ + return gnuradio::get_initial_sptr(new atsc_interleaver_impl()); +} + +atsc_interleaver_impl::atsc_interleaver_impl() + : gr::sync_block("atsc_interleaver", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) +{ + I = 52; /* ATSC interleaver */ + J = 4; + registers = (unsigned char*)malloc(sizeof(unsigned char) * I * ((I - 1) * J)); + if (registers == NULL) { GR_LOG_FATAL(d_logger, "ATSC Interleaver, cannot allocate memory for registers."); throw std::bad_alloc(); - } + } - pointers = (int *) malloc(sizeof(int) * I); - if (pointers == NULL) { + pointers = (int*)malloc(sizeof(int) * I); + if (pointers == NULL) { free(registers); GR_LOG_FATAL(d_logger, "ATSC Interleaver, cannot allocate memory for pointers"); throw std::bad_alloc(); - } + } - memset(registers, 0, sizeof(unsigned char) * I * ((I - 1) * J)); - memset(pointers, 0, sizeof(int) * I); + memset(registers, 0, sizeof(unsigned char) * I * ((I - 1) * J)); + memset(pointers, 0, sizeof(int) * I); - commutator = 0; - } + commutator = 0; +} - atsc_interleaver_impl::~atsc_interleaver_impl() - { - free(pointers); - free(registers); - } +atsc_interleaver_impl::~atsc_interleaver_impl() +{ + free(pointers); + free(registers); +} - int - atsc_interleaver_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - int p, n = ATSC_MPEG_RS_ENCODED_LENGTH; +int atsc_interleaver_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + int p, n = ATSC_MPEG_RS_ENCODED_LENGTH; - for (int i = 0; i < noutput_items; i++) { + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); plinfo::sanity_check(in[i].pli); - out[i].pli = in[i].pli; // copy pipeline info - if (in[i].pli.first_regular_seg_p()) { // reset commutator if required - commutator = 0; + out[i].pli = in[i].pli; // copy pipeline info + if (in[i].pli.first_regular_seg_p()) { // reset commutator if required + commutator = 0; } for (int j = 0; j < n; j++) { - if (commutator == 0) { - out[i].data[j] = in[i].data[j]; - } - else { - p = pointers[commutator]; + if (commutator == 0) { + out[i].data[j] = in[i].data[j]; + } else { + p = pointers[commutator]; - out[i].data[j] = registers[commutator * (I - 1) * J + p]; - registers[commutator * (I - 1) * J + p] = in[i].data[j]; + out[i].data[j] = registers[commutator * (I - 1) * J + p]; + registers[commutator * (I - 1) * J + p] = in[i].data[j]; - pointers[commutator] = (p + 1) % (commutator * J); - } + pointers[commutator] = (p + 1) % (commutator * J); + } - commutator = (commutator + 1) % I; + commutator = (commutator + 1) % I; } - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_interleaver_impl.h b/gr-dtv/lib/atsc/atsc_interleaver_impl.h index ffcd02bf84..884b6a4ccc 100644 --- a/gr-dtv/lib/atsc/atsc_interleaver_impl.h +++ b/gr-dtv/lib/atsc/atsc_interleaver_impl.h @@ -25,26 +25,26 @@ #include "atsc_types.h" namespace gr { - namespace dtv { - - class atsc_interleaver_impl : public atsc_interleaver - { - private: - int I, J; - int commutator; - unsigned char *registers; - int *pointers; - - public: - atsc_interleaver_impl(); - ~atsc_interleaver_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } // namespace dtv +namespace dtv { + +class atsc_interleaver_impl : public atsc_interleaver +{ +private: + int I, J; + int commutator; + unsigned char* registers; + int* pointers; + +public: + atsc_interleaver_impl(); + ~atsc_interleaver_impl(); + + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; + +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_INTERLEAVER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_pad_impl.cc b/gr-dtv/lib/atsc/atsc_pad_impl.cc index 2dee03f031..5b1a18dcb9 100644 --- a/gr-dtv/lib/atsc/atsc_pad_impl.cc +++ b/gr-dtv/lib/atsc/atsc_pad_impl.cc @@ -26,41 +26,37 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { - - atsc_pad::sptr - atsc_pad::make() - { - return gnuradio::get_initial_sptr - (new atsc_pad_impl()); - } - - atsc_pad_impl::atsc_pad_impl() - : gr::sync_decimator("atsc_pad", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), ATSC_MPEG_PKT_LENGTH) - { - } - - atsc_pad_impl::~atsc_pad_impl() - { - } - - int - atsc_pad_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned char *in = (const unsigned char *) input_items[0]; - atsc_mpeg_packet *out = (atsc_mpeg_packet *) output_items[0]; - - for (int i = 0; i < noutput_items; i++) { +namespace dtv { + +atsc_pad::sptr atsc_pad::make() +{ + return gnuradio::get_initial_sptr(new atsc_pad_impl()); +} + +atsc_pad_impl::atsc_pad_impl() + : gr::sync_decimator("atsc_pad", + gr::io_signature::make(1, 1, sizeof(unsigned char)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), + ATSC_MPEG_PKT_LENGTH) +{ +} + +atsc_pad_impl::~atsc_pad_impl() {} + +int atsc_pad_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const unsigned char* in = (const unsigned char*)input_items[0]; + atsc_mpeg_packet* out = (atsc_mpeg_packet*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { memcpy(out[i].data, &in[i * ATSC_MPEG_PKT_LENGTH], ATSC_MPEG_PKT_LENGTH); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_pad_impl.h b/gr-dtv/lib/atsc/atsc_pad_impl.h index 292931d1f7..471bf2d8ee 100644 --- a/gr-dtv/lib/atsc/atsc_pad_impl.h +++ b/gr-dtv/lib/atsc/atsc_pad_impl.h @@ -25,20 +25,20 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_pad_impl : public atsc_pad - { - public: - atsc_pad_impl(); - ~atsc_pad_impl(); +class atsc_pad_impl : public atsc_pad +{ +public: + atsc_pad_impl(); + ~atsc_pad_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_PAD_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_pnXXX_impl.h b/gr-dtv/lib/atsc/atsc_pnXXX_impl.h index d4b86dcdbb..da07b779e5 100644 --- a/gr-dtv/lib/atsc/atsc_pnXXX_impl.h +++ b/gr-dtv/lib/atsc/atsc_pnXXX_impl.h @@ -26,34 +26,42 @@ #include <gnuradio/dtv/api.h> const unsigned char atsc_pn511[511] = { - 0,0,0,0, 0,0,0,1, 0,1,1,1, 1,1,1,1, 1,1,0,0, 1,0,1,0, 1,0,1,0, 1,1,1,0, - 0,1,1,0, 0,1,1,0, 1,0,0,0, 1,0,0,0, 1,0,0,1, 1,1,1,0, 0,0,0,1, 1,1,0,1, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, - 0,1,1,1, 1,1,0,1, 0,0,1,1, 0,1,0,1, 0,0,1,1, 1,0,1,1, 0,0,1,1, 1,0,1,0, - 0,1,0,0, 0,1,0,1, 1,0,0,0, 1,1,1,1, 0,0,1,0, 0,0,0,1, 0,1,0,0, 0,1,1,1, + 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, + 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, + 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, - 1,1,0,0, 1,1,1,1, 0,1,0,1, 0,0,0,1, 0,1,0,0, 1,1,0,0, 0,0,1,1, 0,0,0,1, - 0,0,0,0, 0,1,0,0, 0,0,1,1, 1,1,1,1, 0,0,0,0, 0,1,0,1, 0,1,0,0, 0,0,0,0, + 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, - 1,1,0,0, 1,1,1,1, 1,1,1,0, 1,1,1,0, 1,0,1,0, 1,0,0,1, 0,1,1,0, 0,1,1,0, - 0,0,1,1, 0,1,1,1, 0,1,1,1, 1,0,1,1, 0,1,0,0, 1,0,1,0, 0,1,0,0, 1,1,1,0, + 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, - 0,1,1,1, 0,0,0,1, 0,1,1,1, 0,1,0,0, 0,0,1,1, 0,1,0,0, 1,1,1,1, 1,0,1,1, - 0,0,0,1, 0,1,0,1, 1,0,1,1, 1,1,0,0, 1,1,0,1, 1,0,1,0, 1,1,1,0, 1,1,0,1, + 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, + 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, + 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, - 1,0,0,1, 0,1,1,0, 1,1,0,1, 1,1,0,0, 1,0,0,1, 0,0,1,0, 1,1,1,0, 0,0,1,1, - 1,0,0,1, 0,1,1,1, 1,0,1,0, 0,0,1,1, 0,1,0,1, 1,0,0,0, 0,1,0,0, 1,1,0,1, + 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, + 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, + 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, - 1,1,1,1, 0,0,0,1, 0,0,1,0, 1,0,1,1, 1,1,0,0, 0,1,1,0, 0,1,0,1, 0,0,0,0, - 1,0,0,0, 1,1,0,0, 0,0,0,1, 1,1,1,0, 1,1,1,1, 1,1,0,1, 0,1,1,0, 1,0,1,0, + 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, + 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, - 1,1,0,0, 1,0,0,1, 1,0,0,1, 0,0,0,1, 1,1,0,1, 1,1,0,0, 0,0,1,0, 1,1,0,1, - 0,0,0,0, 0,1,1,0, 1,1,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0, 0,0,0,1, 1,1,0 + 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 }; -const unsigned char atsc_pn63[63] = { - 1,1,1,0, 0,1,0,0, 1,0,1,1, 0,1,1,1, 0,1,1,0, 0,1,1,0, 1,0,1,0, 1,1,1,1, - 1,1,0,0, 0,0,0,1, 0,0,0,0, 1,1,0,0, 0,1,0,1, 0,0,1,1, 1,1,0,1, 0,0,0 -}; +const unsigned char atsc_pn63[63] = { 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, + 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0 }; #endif /* INCLUDED_DTV_ATSC_PNXXX_H */ diff --git a/gr-dtv/lib/atsc/atsc_randomize.cc b/gr-dtv/lib/atsc/atsc_randomize.cc index 769b08587a..e598e2ecba 100644 --- a/gr-dtv/lib/atsc/atsc_randomize.cc +++ b/gr-dtv/lib/atsc/atsc_randomize.cc @@ -23,95 +23,88 @@ #include "atsc_randomize.h" namespace gr { - namespace dtv { - - unsigned char atsc_randomize::s_output_map[1 << 14]; - bool atsc_randomize::s_output_map_initialized_p = false; - - atsc_randomize::atsc_randomize () - { - d_state = PRELOAD_VALUE; - - if (!s_output_map_initialized_p) - initialize_output_map (); - } - - /*! - * \brief Generate the table used in the fast_output_map function. - * - * The table has 16K byte entries, but because of how is is used, only - * 256 entries end up being resident in the cache. This seems - * like a good use of memory. We can get away with a 16K table - * because the low two bits of the state do not affect the output - * function. By shifting right those two bits we shrink the table, - * and also get better cache line utilization. - */ - void - atsc_randomize::initialize_output_map () - { - s_output_map_initialized_p = true; - - for (int i = 0; i < (1 << 14); i++) - s_output_map[i] = slow_output_map (i << 2); - } - - - void - atsc_randomize::reset () - { - d_state = PRELOAD_VALUE; - } - - void - atsc_randomize::randomize (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in) - { - assert (in.data[0] == MPEG_SYNC_BYTE); // confirm it's there, then drop - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - out.data[i] = in.data[i + 1] ^ output_and_clk (); - } - - void - atsc_randomize::derandomize (atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in) - { - out.data[0] = MPEG_SYNC_BYTE; // add sync byte to beginning of packet - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - out.data[i + 1] = in.data[i] ^ output_and_clk (); - } - - - unsigned char - atsc_randomize::slow_output_map (int st) - { - int output = 0; - - if (st & 0x8000) +namespace dtv { + +unsigned char atsc_randomize::s_output_map[1 << 14]; +bool atsc_randomize::s_output_map_initialized_p = false; + +atsc_randomize::atsc_randomize() +{ + d_state = PRELOAD_VALUE; + + if (!s_output_map_initialized_p) + initialize_output_map(); +} + +/*! + * \brief Generate the table used in the fast_output_map function. + * + * The table has 16K byte entries, but because of how is is used, only + * 256 entries end up being resident in the cache. This seems + * like a good use of memory. We can get away with a 16K table + * because the low two bits of the state do not affect the output + * function. By shifting right those two bits we shrink the table, + * and also get better cache line utilization. + */ +void atsc_randomize::initialize_output_map() +{ + s_output_map_initialized_p = true; + + for (int i = 0; i < (1 << 14); i++) + s_output_map[i] = slow_output_map(i << 2); +} + + +void atsc_randomize::reset() { d_state = PRELOAD_VALUE; } + +void atsc_randomize::randomize(atsc_mpeg_packet_no_sync& out, const atsc_mpeg_packet& in) +{ + assert(in.data[0] == MPEG_SYNC_BYTE); // confirm it's there, then drop + + for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) + out.data[i] = in.data[i + 1] ^ output_and_clk(); +} + +void atsc_randomize::derandomize(atsc_mpeg_packet& out, + const atsc_mpeg_packet_no_sync& in) +{ + out.data[0] = MPEG_SYNC_BYTE; // add sync byte to beginning of packet + + for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) + out.data[i + 1] = in.data[i] ^ output_and_clk(); +} + + +unsigned char atsc_randomize::slow_output_map(int st) +{ + int output = 0; + + if (st & 0x8000) output |= 0x01; - if (st & 0x2000) + if (st & 0x2000) output |= 0x02; - if (st & 0x1000) + if (st & 0x1000) output |= 0x04; - if (st & 0x0200) + if (st & 0x0200) output |= 0x08; - if (st & 0x0020) + if (st & 0x0020) output |= 0x10; - if (st & 0x0010) + if (st & 0x0010) output |= 0x20; - if (st & 0x0008) + if (st & 0x0008) output |= 0x40; - if (st & 0x0004) + if (st & 0x0004) output |= 0x80; - return output; - } + return output; +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_randomize.h b/gr-dtv/lib/atsc/atsc_randomize.h index 0903240f48..48331cdab8 100644 --- a/gr-dtv/lib/atsc/atsc_randomize.h +++ b/gr-dtv/lib/atsc/atsc_randomize.h @@ -26,67 +26,70 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_randomize +class atsc_randomize +{ +public: + atsc_randomize(); + + /*! \brief reset randomizer LFSR + * + * must be called during the Data Segment Sync interval prior to the + * first data segment. I.e., the LFSR is reset prior to the first + * field of each VSB data frame. + */ + void reset(); + + //! randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte + void randomize(atsc_mpeg_packet_no_sync& out, const atsc_mpeg_packet& in); + + //! derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte + void derandomize(atsc_mpeg_packet& out, const atsc_mpeg_packet_no_sync& in); + + unsigned int state() const { return d_state; } + +private: + static void initialize_output_map(); + static unsigned char slow_output_map(int st); + + static unsigned char fast_output_map(int st) + { + return s_output_map[(st & 0xb23c) >> + 2]; // Magic const with 8 bits set improves cache + // utilization. The bits correspond to the taps + // used in output calculation. Others may be + // safely ignored. + } + + //! return current output value + unsigned char output() { return fast_output_map(d_state); } + + //! clock LFSR; advance to next state. + void clk() { - public: - atsc_randomize(); - - /*! \brief reset randomizer LFSR - * - * must be called during the Data Segment Sync interval prior to the - * first data segment. I.e., the LFSR is reset prior to the first - * field of each VSB data frame. - */ - void reset (); - - //! randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte - void randomize (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in); - - //! derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte - void derandomize (atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in); - - unsigned int state() const { return d_state; } - private: - static void initialize_output_map (); - static unsigned char slow_output_map (int st); - - static unsigned char fast_output_map (int st){ - return s_output_map[(st & 0xb23c) >> 2]; // Magic const with 8 bits set improves cache - // utilization. The bits correspond to the taps - // used in output calculation. Others may be - // safely ignored. - } - - //! return current output value - unsigned char output (){ - return fast_output_map (d_state); - } - - //! clock LFSR; advance to next state. - void clk (){ if (d_state & 0x1) - d_state = ((d_state ^ MASK) >> 1) | 0x8000; + d_state = ((d_state ^ MASK) >> 1) | 0x8000; else - d_state = d_state >> 1; - } + d_state = d_state >> 1; + } - //! return current output value and advance to next state - unsigned char output_and_clk (){ - unsigned char r = output (); - clk (); + //! return current output value and advance to next state + unsigned char output_and_clk() + { + unsigned char r = output(); + clk(); return r; - } + } - unsigned int d_state; + unsigned int d_state; - static const unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ - static const unsigned int MASK = 0xa638; - static unsigned char s_output_map[1 << 14]; - static bool s_output_map_initialized_p; - }; - } /* namespace dtv */ + static const unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ + static const unsigned int MASK = 0xa638; + static unsigned char s_output_map[1 << 14]; + static bool s_output_map_initialized_p; +}; +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_ATSC_RANDOMIZE_H */ diff --git a/gr-dtv/lib/atsc/atsc_randomizer_impl.cc b/gr-dtv/lib/atsc/atsc_randomizer_impl.cc index f6b6a6a370..f77bb80f9d 100644 --- a/gr-dtv/lib/atsc/atsc_randomizer_impl.cc +++ b/gr-dtv/lib/atsc/atsc_randomizer_impl.cc @@ -27,44 +27,38 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { +namespace dtv { - atsc_randomizer::sptr - atsc_randomizer::make() - { - return gnuradio::get_initial_sptr - (new atsc_randomizer_impl()); - } +atsc_randomizer::sptr atsc_randomizer::make() +{ + return gnuradio::get_initial_sptr(new atsc_randomizer_impl()); +} - atsc_randomizer_impl::atsc_randomizer_impl() - : gr::sync_block("atsc_randomizer", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) - { - reset(); - } +atsc_randomizer_impl::atsc_randomizer_impl() + : gr::sync_block("atsc_randomizer", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) +{ + reset(); +} - atsc_randomizer_impl::~atsc_randomizer_impl() - { - } +atsc_randomizer_impl::~atsc_randomizer_impl() {} - void - atsc_randomizer_impl::reset() - { - d_rand.reset(); - d_field2 = false; - d_segno = 0; - } +void atsc_randomizer_impl::reset() +{ + d_rand.reset(); + d_field2 = false; + d_segno = 0; +} - int - atsc_randomizer_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet *in = (const atsc_mpeg_packet *) input_items[0]; - atsc_mpeg_packet_no_sync *out = (atsc_mpeg_packet_no_sync *) output_items[0]; +int atsc_randomizer_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet* in = (const atsc_mpeg_packet*)input_items[0]; + atsc_mpeg_packet_no_sync* out = (atsc_mpeg_packet_no_sync*)output_items[0]; - for (int i = 0; i < noutput_items; i++) { + for (int i = 0; i < noutput_items; i++) { // sanity check incoming data. assert((in[i].data[0] == MPEG_SYNC_BYTE)); assert((in[i].data[1] & MPEG_TRANSPORT_ERROR_BIT) == 0); @@ -78,20 +72,20 @@ namespace gr { d_segno++; if (d_segno == 312) { - d_segno = 0; - d_field2 = !d_field2; + d_segno = 0; + d_field2 = !d_field2; } if (out[i].pli.first_regular_seg_p()) { - d_rand.reset(); + d_rand.reset(); } d_rand.randomize(out[i], in[i]); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_randomizer_impl.h b/gr-dtv/lib/atsc/atsc_randomizer_impl.h index d13b09f5e4..6c90c1a99e 100644 --- a/gr-dtv/lib/atsc/atsc_randomizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_randomizer_impl.h @@ -26,27 +26,27 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_randomizer_impl : public atsc_randomizer - { - private: - atsc_randomize d_rand; - int d_segno; - bool d_field2; +class atsc_randomizer_impl : public atsc_randomizer +{ +private: + atsc_randomize d_rand; + int d_segno; + bool d_field2; - void reset(void); + void reset(void); - public: - atsc_randomizer_impl(); - ~atsc_randomizer_impl(); +public: + atsc_randomizer_impl(); + ~atsc_randomizer_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_RANDOMIZER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc index a0ca0c1c07..d7c0cc4d5b 100644 --- a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.cc @@ -29,153 +29,149 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - static const int rs_init_symsize = 8; - static const int rs_init_gfpoly = 0x11d; - static const int rs_init_fcr = 0; // first consecutive root - static const int rs_init_prim = 1; // primitive is 1 (alpha) - static const int rs_init_nroots = 20; - - static const int N = (1 << rs_init_symsize) - 1; // 255 - - static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 - - atsc_rs_decoder::sptr - atsc_rs_decoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_rs_decoder_impl()); - } - - atsc_rs_decoder_impl::atsc_rs_decoder_impl() - : gr::sync_block("dtv_atsc_rs_decoder", - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) - { - d_rs = init_rs_char(rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); - assert (d_rs != 0); - d_nerrors_corrrected_count = 0; - d_bad_packet_count = 0; - d_total_packets = 0; - } - - int atsc_rs_decoder_impl::decode (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet_rs_encoded &in) - { - unsigned char tmp[N]; - int ncorrections; - - assert((int)(amount_of_pad + sizeof(in.data)) == N); - - // add missing prefix zero padding to message - memset(tmp, 0, amount_of_pad); - memcpy(&tmp[amount_of_pad], in.data, sizeof(in.data)); - - // correct message... - ncorrections = decode_rs_char(d_rs, tmp, 0, 0); - - // copy corrected message to output, skipping prefix zero padding - memcpy (out.data, &tmp[amount_of_pad], sizeof (out.data)); - - return ncorrections; - } - - atsc_rs_decoder_impl::~atsc_rs_decoder_impl() - { - if (d_rs) - free_rs_char (d_rs); - d_rs = 0; - } - - int - atsc_rs_decoder_impl::num_errors_corrected() const - { - return d_nerrors_corrrected_count; - } - - int - atsc_rs_decoder_impl::num_bad_packets() const - { - return d_bad_packet_count; - } - - int - atsc_rs_decoder_impl::num_packets() const - { - return d_total_packets; - } - - int - atsc_rs_decoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *)input_items[0]; - atsc_mpeg_packet_no_sync *out = (atsc_mpeg_packet_no_sync *)output_items[0]; - - for (int i = 0; i < noutput_items; i++) { +namespace dtv { + +static const int rs_init_symsize = 8; +static const int rs_init_gfpoly = 0x11d; +static const int rs_init_fcr = 0; // first consecutive root +static const int rs_init_prim = 1; // primitive is 1 (alpha) +static const int rs_init_nroots = 20; + +static const int N = (1 << rs_init_symsize) - 1; // 255 + +static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 + +atsc_rs_decoder::sptr atsc_rs_decoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_rs_decoder_impl()); +} + +atsc_rs_decoder_impl::atsc_rs_decoder_impl() + : gr::sync_block("dtv_atsc_rs_decoder", + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) +{ + d_rs = init_rs_char( + rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); + assert(d_rs != 0); + d_nerrors_corrrected_count = 0; + d_bad_packet_count = 0; + d_total_packets = 0; +} + +int atsc_rs_decoder_impl::decode(atsc_mpeg_packet_no_sync& out, + const atsc_mpeg_packet_rs_encoded& in) +{ + unsigned char tmp[N]; + int ncorrections; + + assert((int)(amount_of_pad + sizeof(in.data)) == N); + + // add missing prefix zero padding to message + memset(tmp, 0, amount_of_pad); + memcpy(&tmp[amount_of_pad], in.data, sizeof(in.data)); + + // correct message... + ncorrections = decode_rs_char(d_rs, tmp, 0, 0); + + // copy corrected message to output, skipping prefix zero padding + memcpy(out.data, &tmp[amount_of_pad], sizeof(out.data)); + + return ncorrections; +} + +atsc_rs_decoder_impl::~atsc_rs_decoder_impl() +{ + if (d_rs) + free_rs_char(d_rs); + d_rs = 0; +} + +int atsc_rs_decoder_impl::num_errors_corrected() const +{ + return d_nerrors_corrrected_count; +} + +int atsc_rs_decoder_impl::num_bad_packets() const { return d_bad_packet_count; } + +int atsc_rs_decoder_impl::num_packets() const { return d_total_packets; } + +int atsc_rs_decoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_mpeg_packet_no_sync* out = (atsc_mpeg_packet_no_sync*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); - out[i].pli = in[i].pli; // copy pipeline info... + out[i].pli = in[i].pli; // copy pipeline info... int nerrors_corrrected = decode(out[i], in[i]); out[i].pli.set_transport_error(nerrors_corrrected == -1); if (nerrors_corrrected == -1) { - d_bad_packet_count++; - d_nerrors_corrrected_count += 10; // lower bound estimate; most this RS can fix - } - else { - d_nerrors_corrrected_count += nerrors_corrrected; + d_bad_packet_count++; + d_nerrors_corrrected_count += + 10; // lower bound estimate; most this RS can fix + } else { + d_nerrors_corrrected_count += nerrors_corrrected; } - d_total_packets++; - #if 0 + d_total_packets++; +#if 0 if (d_total_packets > 1000) { GR_LOG_INFO(d_logger, boost::format("Error rate: %1%\tPacket error rate: %2%") \ % ((float)d_nerrors_corrrected_count/(ATSC_MPEG_DATA_LENGTH*d_total_packets)) % ((float)d_bad_packet_count/d_total_packets)); } - #endif - } - - return noutput_items; +#endif } + return noutput_items; +} + - void - atsc_rs_decoder_impl::setup_rpc() - { +void atsc_rs_decoder_impl::setup_rpc() +{ #ifdef GR_CTRLPORT - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int >( - alias(), "num_errors_corrected", - &atsc_rs_decoder::num_errors_corrected, - pmt::from_long(0), - pmt::from_long(10000000), - pmt::from_long(0), - "", "Number of errors corrected", RPC_PRIVLVL_MIN, - DISPTIME))); - - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int >( - alias(), "num_bad_packets", - &atsc_rs_decoder::num_bad_packets, - pmt::from_long(0), - pmt::from_long(10000000), - pmt::from_long(0), - "", "Number of bad packets", RPC_PRIVLVL_MIN, - DISPTIME))); - - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int >( - alias(), "num_packets", - &atsc_rs_decoder::num_packets, - pmt::from_long(0), - pmt::from_long(10000000), - pmt::from_long(0), - "", "Number of packets", RPC_PRIVLVL_MIN, - DISPTIME))); + add_rpc_variable(rpcbasic_sptr(new rpcbasic_register_get<atsc_rs_decoder, int>( + alias(), + "num_errors_corrected", + &atsc_rs_decoder::num_errors_corrected, + pmt::from_long(0), + pmt::from_long(10000000), + pmt::from_long(0), + "", + "Number of errors corrected", + RPC_PRIVLVL_MIN, + DISPTIME))); + + add_rpc_variable(rpcbasic_sptr( + new rpcbasic_register_get<atsc_rs_decoder, int>(alias(), + "num_bad_packets", + &atsc_rs_decoder::num_bad_packets, + pmt::from_long(0), + pmt::from_long(10000000), + pmt::from_long(0), + "", + "Number of bad packets", + RPC_PRIVLVL_MIN, + DISPTIME))); + + add_rpc_variable(rpcbasic_sptr( + new rpcbasic_register_get<atsc_rs_decoder, int>(alias(), + "num_packets", + &atsc_rs_decoder::num_packets, + pmt::from_long(0), + pmt::from_long(10000000), + pmt::from_long(0), + "", + "Number of packets", + RPC_PRIVLVL_MIN, + DISPTIME))); #endif /* GR_CTRLPORT */ - } +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h index c657e699dc..926a9789e4 100644 --- a/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_rs_decoder_impl.h @@ -31,38 +31,38 @@ extern "C" { } namespace gr { - namespace dtv { +namespace dtv { - class atsc_rs_decoder_impl : public atsc_rs_decoder - { - private: - int d_nerrors_corrrected_count; - int d_bad_packet_count; - int d_total_packets; - void *d_rs; +class atsc_rs_decoder_impl : public atsc_rs_decoder +{ +private: + int d_nerrors_corrrected_count; + int d_bad_packet_count; + int d_total_packets; + void* d_rs; - public: - atsc_rs_decoder_impl(); - ~atsc_rs_decoder_impl(); +public: + atsc_rs_decoder_impl(); + ~atsc_rs_decoder_impl(); - void setup_rpc(); + void setup_rpc(); - int num_errors_corrected() const; - int num_bad_packets() const; - int num_packets() const; + int num_errors_corrected() const; + int num_bad_packets() const; + int num_packets() const; - /*! - * Decode RS encoded packet. - * \returns a count of corrected symbols, or -1 if the block was uncorrectible. - */ - int decode(atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet_rs_encoded &in); + /*! + * Decode RS encoded packet. + * \returns a count of corrected symbols, or -1 if the block was uncorrectible. + */ + int decode(atsc_mpeg_packet_no_sync& out, const atsc_mpeg_packet_rs_encoded& in); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_RS_DECODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc index 9249301165..04a0c7c5a2 100644 --- a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.cc @@ -26,79 +26,77 @@ #include "atsc_rs_encoder_impl.h" namespace gr { - namespace dtv { - - static const int rs_init_symsize = 8; - static const int rs_init_gfpoly = 0x11d; - static const int rs_init_fcr = 0; // first consecutive root - static const int rs_init_prim = 1; // primitive is 1 (alpha) - static const int rs_init_nroots = 20; - - static const int N = (1 << rs_init_symsize) - 1; // 255 - static const int K = N - rs_init_nroots; // 235 - - static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 - - atsc_rs_encoder::sptr - atsc_rs_encoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_rs_encoder_impl()); - } - - atsc_rs_encoder_impl::atsc_rs_encoder_impl() - : gr::sync_block("atsc_rs_encoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) - { - d_rs = init_rs_char(rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); - assert (d_rs != 0); - } - - atsc_rs_encoder_impl::~atsc_rs_encoder_impl() - { - if (d_rs) { +namespace dtv { + +static const int rs_init_symsize = 8; +static const int rs_init_gfpoly = 0x11d; +static const int rs_init_fcr = 0; // first consecutive root +static const int rs_init_prim = 1; // primitive is 1 (alpha) +static const int rs_init_nroots = 20; + +static const int N = (1 << rs_init_symsize) - 1; // 255 +static const int K = N - rs_init_nroots; // 235 + +static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 + +atsc_rs_encoder::sptr atsc_rs_encoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_rs_encoder_impl()); +} + +atsc_rs_encoder_impl::atsc_rs_encoder_impl() + : gr::sync_block("atsc_rs_encoder", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) +{ + d_rs = init_rs_char( + rs_init_symsize, rs_init_gfpoly, rs_init_fcr, rs_init_prim, rs_init_nroots); + assert(d_rs != 0); +} + +atsc_rs_encoder_impl::~atsc_rs_encoder_impl() +{ + if (d_rs) { free_rs_char(d_rs); - } - - d_rs = 0; } - void - atsc_rs_encoder_impl::encode(atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_no_sync &in) - { - unsigned char tmp[K]; + d_rs = 0; +} - assert((int)(amount_of_pad + sizeof (in.data)) == K); +void atsc_rs_encoder_impl::encode(atsc_mpeg_packet_rs_encoded& out, + const atsc_mpeg_packet_no_sync& in) +{ + unsigned char tmp[K]; - // add missing prefix zero padding to message - memset(tmp, 0, amount_of_pad); - memcpy(&tmp[amount_of_pad], in.data, sizeof (in.data)); + assert((int)(amount_of_pad + sizeof(in.data)) == K); - // copy message portion to output packet - memcpy(out.data, in.data, sizeof (in.data)); + // add missing prefix zero padding to message + memset(tmp, 0, amount_of_pad); + memcpy(&tmp[amount_of_pad], in.data, sizeof(in.data)); - // now compute parity bytes and add them to tail end of output packet - encode_rs_char(d_rs, tmp, &out.data[sizeof (in.data)]); - } + // copy message portion to output packet + memcpy(out.data, in.data, sizeof(in.data)); - int - atsc_rs_encoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_no_sync *in = (const atsc_mpeg_packet_no_sync *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; + // now compute parity bytes and add them to tail end of output packet + encode_rs_char(d_rs, tmp, &out.data[sizeof(in.data)]); +} - for (int i = 0; i < noutput_items; i++) { +int atsc_rs_encoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_no_sync* in = (const atsc_mpeg_packet_no_sync*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + + for (int i = 0; i < noutput_items; i++) { assert(in[i].pli.regular_seg_p()); - out[i].pli = in[i].pli; // copy pipeline info... + out[i].pli = in[i].pli; // copy pipeline info... encode(out[i], in[i]); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h index 9086c8223d..a6eb3ecd73 100644 --- a/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_rs_encoder_impl.h @@ -24,30 +24,29 @@ #include <gnuradio/dtv/atsc_rs_encoder.h> #include "atsc_types.h" -extern "C" -{ +extern "C" { #include <gnuradio/fec/rs.h> } namespace gr { - namespace dtv { +namespace dtv { - class atsc_rs_encoder_impl : public atsc_rs_encoder - { - private: - void *d_rs; - void encode(atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_no_sync &in); +class atsc_rs_encoder_impl : public atsc_rs_encoder +{ +private: + void* d_rs; + void encode(atsc_mpeg_packet_rs_encoded& out, const atsc_mpeg_packet_no_sync& in); - public: - atsc_rs_encoder_impl(); - ~atsc_rs_encoder_impl(); +public: + atsc_rs_encoder_impl(); + ~atsc_rs_encoder_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_RS_ENCODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_single_viterbi.cc b/gr-dtv/lib/atsc/atsc_single_viterbi.cc index 5f4850d81a..d6ffeb7fef 100644 --- a/gr-dtv/lib/atsc/atsc_single_viterbi.cc +++ b/gr-dtv/lib/atsc/atsc_single_viterbi.cc @@ -24,83 +24,76 @@ #include <math.h> namespace gr { - namespace dtv { - - /* was_sent is a table of what symbol we get given what bit pair - was sent and what state we where in [state][pair] */ - const int atsc_single_viterbi::d_was_sent[4][4] = { - {0,2,4,6}, - {0,2,4,6}, - {1,3,5,7}, - {1,3,5,7}, - }; - - /* transition_table is a table of what state we were in - given current state and bit pair sent [state][pair] */ - const int atsc_single_viterbi::d_transition_table[4][4] = { - {0,2,0,2}, - {2,0,2,0}, - {1,3,1,3}, - {3,1,3,1}, - }; - - void - atsc_single_viterbi::reset() - { - for (unsigned int i = 0; i<2; i++) - for (unsigned int j = 0; j<4; j++) { - d_path_metrics[i][j] = 0; - d_traceback[i][j] = 0; +namespace dtv { + +/* was_sent is a table of what symbol we get given what bit pair + was sent and what state we where in [state][pair] */ +const int atsc_single_viterbi::d_was_sent[4][4] = { + { 0, 2, 4, 6 }, + { 0, 2, 4, 6 }, + { 1, 3, 5, 7 }, + { 1, 3, 5, 7 }, +}; + +/* transition_table is a table of what state we were in + given current state and bit pair sent [state][pair] */ +const int atsc_single_viterbi::d_transition_table[4][4] = { + { 0, 2, 0, 2 }, + { 2, 0, 2, 0 }, + { 1, 3, 1, 3 }, + { 3, 1, 3, 1 }, +}; + +void atsc_single_viterbi::reset() +{ + for (unsigned int i = 0; i < 2; i++) + for (unsigned int j = 0; j < 4; j++) { + d_path_metrics[i][j] = 0; + d_traceback[i][j] = 0; } - d_post_coder_state = 0; - d_phase = 0; - d_best_state_metric = 100000; - } + d_post_coder_state = 0; + d_phase = 0; + d_best_state_metric = 100000; +} - atsc_single_viterbi::atsc_single_viterbi() - { - reset(); - } +atsc_single_viterbi::atsc_single_viterbi() { reset(); } - float - atsc_single_viterbi::best_state_metric() const - { - return d_best_state_metric; - } +float atsc_single_viterbi::best_state_metric() const { return d_best_state_metric; } + +char atsc_single_viterbi::decode(float input) +{ + unsigned int best_state = 0; + // float best_state_metric = 100000; + d_best_state_metric = 100000; + + /* Precompute distances from input to each possible symbol */ + float distances[8] = { fabsf(input + 7), fabsf(input + 5), fabsf(input + 3), + fabsf(input + 1), fabsf(input - 1), fabsf(input - 3), + fabsf(input - 5), fabsf(input - 7) }; - char - atsc_single_viterbi::decode(float input) - { - unsigned int best_state = 0; - //float best_state_metric = 100000; - d_best_state_metric = 100000; - - /* Precompute distances from input to each possible symbol */ - float distances[8] = { fabsf( input + 7 ), fabsf( input + 5 ), - fabsf( input + 3 ), fabsf( input + 1 ), - fabsf( input - 1 ), fabsf( input - 3 ), - fabsf( input - 5 ), fabsf( input - 7 ) }; - - /* We start by iterating over all possible states */ - for (unsigned int state = 0; state < 4; state++) { + /* We start by iterating over all possible states */ + for (unsigned int state = 0; state < 4; state++) { /* Next we find the most probable path from the previous states to the state we are testing, we only need to look at the 4 paths that can be taken given the 2-bit input */ int min_metric_symb = 0; float min_metric = distances[d_was_sent[state][0]] + - d_path_metrics[d_phase][d_transition_table[state][0]]; + d_path_metrics[d_phase][d_transition_table[state][0]]; for (unsigned int symbol_sent = 1; symbol_sent < 4; symbol_sent++) - if( (distances[d_was_sent[state][symbol_sent]] + - d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]) < min_metric) { - min_metric = distances[d_was_sent[state][symbol_sent]] + - d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]; - min_metric_symb = symbol_sent; - } - - d_path_metrics[d_phase^1][state] = min_metric; - d_traceback[d_phase^1][state] = (((unsigned long long)min_metric_symb) << 62) | - (d_traceback[d_phase][d_transition_table[state][min_metric_symb]] >> 2); + if ((distances[d_was_sent[state][symbol_sent]] + + d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]) < + min_metric) { + min_metric = + distances[d_was_sent[state][symbol_sent]] + + d_path_metrics[d_phase][d_transition_table[state][symbol_sent]]; + min_metric_symb = symbol_sent; + } + + d_path_metrics[d_phase ^ 1][state] = min_metric; + d_traceback[d_phase ^ 1][state] = + (((unsigned long long)min_metric_symb) << 62) | + (d_traceback[d_phase][d_transition_table[state][min_metric_symb]] >> 2); /* If this is the most probable state so far remember it, this only needs to be checked when we are about to output a path @@ -111,24 +104,24 @@ namespace gr { head state path will tend towards the optimal path with a probability approaching 1 in just 8 or so transitions */ - if(min_metric <= d_best_state_metric) { - d_best_state_metric = min_metric; - best_state = state; + if (min_metric <= d_best_state_metric) { + d_best_state_metric = min_metric; + best_state = state; } - } + } - if(d_best_state_metric > 10000) { - for(unsigned int state = 0; state < 4; state++) - d_path_metrics[d_phase^1][state] -= d_best_state_metric; - } - d_phase ^= 1; + if (d_best_state_metric > 10000) { + for (unsigned int state = 0; state < 4; state++) + d_path_metrics[d_phase ^ 1][state] -= d_best_state_metric; + } + d_phase ^= 1; - int y2 = (0x2 & d_traceback[d_phase][best_state]) >> 1; - int x2 = y2 ^ d_post_coder_state; - d_post_coder_state = y2; + int y2 = (0x2 & d_traceback[d_phase][best_state]) >> 1; + int x2 = y2 ^ d_post_coder_state; + d_post_coder_state = y2; - return ( x2 << 1 ) | (0x1 & d_traceback[d_phase][best_state]); - } + return (x2 << 1) | (0x1 & d_traceback[d_phase][best_state]); +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_single_viterbi.h b/gr-dtv/lib/atsc/atsc_single_viterbi.h index 9522e2eb1b..fbfd673915 100644 --- a/gr-dtv/lib/atsc/atsc_single_viterbi.h +++ b/gr-dtv/lib/atsc/atsc_single_viterbi.h @@ -24,40 +24,40 @@ #define INCLUDED_DTV_ATSC_SINGLE_VITERBI_H namespace gr { - namespace dtv { +namespace dtv { - class atsc_single_viterbi - { - public: - atsc_single_viterbi(); +class atsc_single_viterbi +{ +public: + atsc_single_viterbi(); - static const unsigned int TB_LEN = 32; + static const unsigned int TB_LEN = 32; - /*! - * \p INPUT ideally takes on the values +/- 1,3,5,7 - * return is decoded dibit in the range [0, 3] - */ - char decode(float input); + /*! + * \p INPUT ideally takes on the values +/- 1,3,5,7 + * return is decoded dibit in the range [0, 3] + */ + char decode(float input); - void reset (); + void reset(); - //! internal delay of decoder - static int delay () { return TB_LEN - 1; } + //! internal delay of decoder + static int delay() { return TB_LEN - 1; } - float best_state_metric() const; + float best_state_metric() const; - protected: - static const int d_transition_table[4][4]; - static const int d_was_sent[4][4]; +protected: + static const int d_transition_table[4][4]; + static const int d_was_sent[4][4]; - float d_path_metrics [2][4]; - unsigned long long d_traceback [2][4]; - unsigned char d_phase; - int d_post_coder_state; - float d_best_state_metric; - }; + float d_path_metrics[2][4]; + unsigned long long d_traceback[2][4]; + unsigned char d_phase; + int d_post_coder_state; + float d_best_state_metric; +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_SINGLE_VITERBI_H */ diff --git a/gr-dtv/lib/atsc/atsc_syminfo_impl.h b/gr-dtv/lib/atsc/atsc_syminfo_impl.h index 4a5008e5f8..c12f47c6b9 100644 --- a/gr-dtv/lib/atsc/atsc_syminfo_impl.h +++ b/gr-dtv/lib/atsc/atsc_syminfo_impl.h @@ -23,40 +23,39 @@ #define INCLUDED_GR_DTV_ATSC_SYMINFO_H namespace gr { - namespace dtv { - namespace atsc { - - static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; - static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = SI_SEGMENT_NUM_MASK; // conceptually -1 - - struct syminfo { - unsigned int symbol_num : 10; // 0..831 - unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM - unsigned int field_num : 1; // 0..1 - unsigned int valid : 1; // contents are valid - }; - - - static inline bool - tag_is_start_field_sync (syminfo tag) - { - return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && tag.valid; - } - - static inline bool - tag_is_start_field_sync_1 (syminfo tag) - { - return tag_is_start_field_sync (tag) && tag.field_num == 0; - } - - static inline bool - tag_is_start_field_sync_2 (syminfo tag) - { - return tag_is_start_field_sync (tag) && tag.field_num == 1; - } - - } /* namespace atsc */ - } /* namespace dtv */ +namespace dtv { +namespace atsc { + +static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; +static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = + SI_SEGMENT_NUM_MASK; // conceptually -1 + +struct syminfo { + unsigned int symbol_num : 10; // 0..831 + unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM + unsigned int field_num : 1; // 0..1 + unsigned int valid : 1; // contents are valid +}; + + +static inline bool tag_is_start_field_sync(syminfo tag) +{ + return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && + tag.valid; +} + +static inline bool tag_is_start_field_sync_1(syminfo tag) +{ + return tag_is_start_field_sync(tag) && tag.field_num == 0; +} + +static inline bool tag_is_start_field_sync_2(syminfo tag) +{ + return tag_is_start_field_sync(tag) && tag.field_num == 1; +} + +} /* namespace atsc */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_GR_DTV_ATSC_SYMINFO_H */ diff --git a/gr-dtv/lib/atsc/atsc_sync_impl.cc b/gr-dtv/lib/atsc/atsc_sync_impl.cc index 702772ed1b..2c3737564e 100644 --- a/gr-dtv/lib/atsc/atsc_sync_impl.cc +++ b/gr-dtv/lib/atsc/atsc_sync_impl.cc @@ -29,173 +29,179 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace dtv { - - static const double LOOP_FILTER_TAP = 0.0005; // 0.0005 works - static const double ADJUSTMENT_GAIN = 1.0e-5 / (10 * ATSC_DATA_SEGMENT_LENGTH); - static const int SYMBOL_INDEX_OFFSET = 3; - static const int MIN_SEG_LOCK_CORRELATION_VALUE = 5; - static const signed char SSI_MIN = -16; - static const signed char SSI_MAX = 15; - - atsc_sync::sptr - atsc_sync::make(float rate) - { - return gnuradio::get_initial_sptr - (new atsc_sync_impl(rate)); - } - - atsc_sync_impl::atsc_sync_impl(float rate) - : gr::block("dtv_atsc_sync", - io_signature::make(1, 1, sizeof(float)), - io_signature::make(1, 1, sizeof(atsc_soft_data_segment))), - d_rx_clock_to_symbol_freq(rate/ATSC_SYMBOL_RATE), - d_si(0) - { - d_loop.set_taps(LOOP_FILTER_TAP); - reset(); - } - - void - atsc_sync_impl::reset() - { - d_w = d_rx_clock_to_symbol_freq; - d_mu = 0.5; - - d_timing_adjust = 0; - d_counter = 0; - d_symbol_index = 0; - d_seg_locked = false; - - d_sr = 0; - - memset(d_sample_mem, 0, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_sample_mem)); // (float)0 = 0x00000000 - memset(d_data_mem, 0, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_data_mem)); // (float)0 = 0x00000000 - memset(d_integrator, SSI_MIN, ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_integrator)); // signed char - } - - atsc_sync_impl::~atsc_sync_impl() - { - } - - void - atsc_sync_impl::forecast(int noutput_items, - gr_vector_int &ninput_items_required) - { - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = static_cast<int>(noutput_items * d_rx_clock_to_symbol_freq * ATSC_DATA_SEGMENT_LENGTH) + 1500 - 1; - } - - int - atsc_sync_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const float *in = (const float *) input_items[0]; - atsc_soft_data_segment *soft_data_segment_out = (atsc_soft_data_segment *) output_items[0]; - - float interp_sample; - - // amount actually consumed - d_si = 0; - - for (d_output_produced = 0; d_output_produced < noutput_items && (d_si + (int)d_interp.ntaps()) < ninput_items[0];) { - // First we interpolate a sample from input to work with - interp_sample = d_interp.interpolate(&in[d_si], d_mu); - - // Apply our timing adjustment slowly over several samples - d_mu += ADJUSTMENT_GAIN * 1e3 * d_timing_adjust; - - double s = d_mu + d_w; - double float_incr = floor(s); - d_mu = s - float_incr; - d_incr = (int)float_incr; - - assert (d_incr >= 1 && d_incr <= 3); - d_si += d_incr; - - // Remember the sample at this count position - d_sample_mem[d_counter] = interp_sample; - - // Is the sample positive or negative? - int bit = (interp_sample < 0 ? 0 : 1); - - // Put the sign bit into our shift register - d_sr = ((bit & 1) << 3) | (d_sr >> 1); - - // When +,-,-,+ (0x9, 1001) samples show up we have likely found a segment - // sync, it is more likely the segment sync will show up at about the same - // spot every ATSC_DATA_SEGMENT_LENGTH samples so we add some weight - // to this spot every pass to prevent random +,-,-,+ symbols from - // confusing our synchronizer - d_integrator[d_counter] += ((d_sr == 0x9) ? +2 : -1); - if(d_integrator[d_counter] < SSI_MIN) d_integrator[d_counter] = SSI_MIN; - if(d_integrator[d_counter] > SSI_MAX) d_integrator[d_counter] = SSI_MAX; - - d_symbol_index++; - if( d_symbol_index >= ATSC_DATA_SEGMENT_LENGTH ) +namespace dtv { + +static const double LOOP_FILTER_TAP = 0.0005; // 0.0005 works +static const double ADJUSTMENT_GAIN = 1.0e-5 / (10 * ATSC_DATA_SEGMENT_LENGTH); +static const int SYMBOL_INDEX_OFFSET = 3; +static const int MIN_SEG_LOCK_CORRELATION_VALUE = 5; +static const signed char SSI_MIN = -16; +static const signed char SSI_MAX = 15; + +atsc_sync::sptr atsc_sync::make(float rate) +{ + return gnuradio::get_initial_sptr(new atsc_sync_impl(rate)); +} + +atsc_sync_impl::atsc_sync_impl(float rate) + : gr::block("dtv_atsc_sync", + io_signature::make(1, 1, sizeof(float)), + io_signature::make(1, 1, sizeof(atsc_soft_data_segment))), + d_rx_clock_to_symbol_freq(rate / ATSC_SYMBOL_RATE), + d_si(0) +{ + d_loop.set_taps(LOOP_FILTER_TAP); + reset(); +} + +void atsc_sync_impl::reset() +{ + d_w = d_rx_clock_to_symbol_freq; + d_mu = 0.5; + + d_timing_adjust = 0; + d_counter = 0; + d_symbol_index = 0; + d_seg_locked = false; + + d_sr = 0; + + memset(d_sample_mem, + 0, + ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_sample_mem)); // (float)0 = 0x00000000 + memset(d_data_mem, + 0, + ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_data_mem)); // (float)0 = 0x00000000 + memset(d_integrator, + SSI_MIN, + ATSC_DATA_SEGMENT_LENGTH * sizeof(*d_integrator)); // signed char +} + +atsc_sync_impl::~atsc_sync_impl() {} + +void atsc_sync_impl::forecast(int noutput_items, gr_vector_int& ninput_items_required) +{ + unsigned ninputs = ninput_items_required.size(); + for (unsigned i = 0; i < ninputs; i++) + ninput_items_required[i] = + static_cast<int>(noutput_items * d_rx_clock_to_symbol_freq * + ATSC_DATA_SEGMENT_LENGTH) + + 1500 - 1; +} + +int atsc_sync_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const float* in = (const float*)input_items[0]; + atsc_soft_data_segment* soft_data_segment_out = + (atsc_soft_data_segment*)output_items[0]; + + float interp_sample; + + // amount actually consumed + d_si = 0; + + for (d_output_produced = 0; d_output_produced < noutput_items && + (d_si + (int)d_interp.ntaps()) < ninput_items[0];) { + // First we interpolate a sample from input to work with + interp_sample = d_interp.interpolate(&in[d_si], d_mu); + + // Apply our timing adjustment slowly over several samples + d_mu += ADJUSTMENT_GAIN * 1e3 * d_timing_adjust; + + double s = d_mu + d_w; + double float_incr = floor(s); + d_mu = s - float_incr; + d_incr = (int)float_incr; + + assert(d_incr >= 1 && d_incr <= 3); + d_si += d_incr; + + // Remember the sample at this count position + d_sample_mem[d_counter] = interp_sample; + + // Is the sample positive or negative? + int bit = (interp_sample < 0 ? 0 : 1); + + // Put the sign bit into our shift register + d_sr = ((bit & 1) << 3) | (d_sr >> 1); + + // When +,-,-,+ (0x9, 1001) samples show up we have likely found a segment + // sync, it is more likely the segment sync will show up at about the same + // spot every ATSC_DATA_SEGMENT_LENGTH samples so we add some weight + // to this spot every pass to prevent random +,-,-,+ symbols from + // confusing our synchronizer + d_integrator[d_counter] += ((d_sr == 0x9) ? +2 : -1); + if (d_integrator[d_counter] < SSI_MIN) + d_integrator[d_counter] = SSI_MIN; + if (d_integrator[d_counter] > SSI_MAX) + d_integrator[d_counter] = SSI_MAX; + + d_symbol_index++; + if (d_symbol_index >= ATSC_DATA_SEGMENT_LENGTH) d_symbol_index = 0; - d_counter++; - if( d_counter >= ATSC_DATA_SEGMENT_LENGTH ) { // counter just wrapped... + d_counter++; + if (d_counter >= ATSC_DATA_SEGMENT_LENGTH) { // counter just wrapped... int best_correlation_value = d_integrator[0]; int best_correlation_index = 0; - for(int i = 1; i < ATSC_DATA_SEGMENT_LENGTH; i++) - if (d_integrator[i] > best_correlation_value) { - best_correlation_value = d_integrator[i]; - best_correlation_index = i; - } + for (int i = 1; i < ATSC_DATA_SEGMENT_LENGTH; i++) + if (d_integrator[i] > best_correlation_value) { + best_correlation_value = d_integrator[i]; + best_correlation_index = i; + } d_seg_locked = best_correlation_value >= MIN_SEG_LOCK_CORRELATION_VALUE; // the coefficients are -1,-1,+1,+1 - //d_timing_adjust = d_sample_mem[best_correlation_index - 3] + + // d_timing_adjust = d_sample_mem[best_correlation_index - 3] + // d_sample_mem[best_correlation_index - 2] - // d_sample_mem[best_correlation_index - 1] - // d_sample_mem[best_correlation_index]; - //printf( "d_timing_adjust = %f\n", d_timing_adjust ); + // printf( "d_timing_adjust = %f\n", d_timing_adjust ); int corr_count = best_correlation_index; d_timing_adjust = -d_sample_mem[corr_count--]; - if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; + if (corr_count < 0) + corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; d_timing_adjust -= d_sample_mem[corr_count--]; - if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; + if (corr_count < 0) + corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; d_timing_adjust += d_sample_mem[corr_count--]; - if( corr_count < 0 ) corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; + if (corr_count < 0) + corr_count = ATSC_DATA_SEGMENT_LENGTH - 1; d_timing_adjust += d_sample_mem[corr_count--]; d_symbol_index = SYMBOL_INDEX_OFFSET - 1 - best_correlation_index; if (d_symbol_index < 0) - d_symbol_index += ATSC_DATA_SEGMENT_LENGTH; + d_symbol_index += ATSC_DATA_SEGMENT_LENGTH; d_counter = 0; - } + } - // If we are locked we can start filling and producing data packets - // Due to the way we lock the first data packet will almost always be - // half full, this is OK because the fs_checker will not let packets though - // until a non-corrupted field packet is found - if( d_seg_locked ) { + // If we are locked we can start filling and producing data packets + // Due to the way we lock the first data packet will almost always be + // half full, this is OK because the fs_checker will not let packets though + // until a non-corrupted field packet is found + if (d_seg_locked) { d_data_mem[d_symbol_index] = interp_sample; - if( d_symbol_index >= (ATSC_DATA_SEGMENT_LENGTH - 1) ) - { - for( int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++ ) - soft_data_segment_out[d_output_produced].data[i] = d_data_mem[i]; + if (d_symbol_index >= (ATSC_DATA_SEGMENT_LENGTH - 1)) { + for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++) + soft_data_segment_out[d_output_produced].data[i] = d_data_mem[i]; d_output_produced++; - } - } - } - - consume_each(d_si); - return d_output_produced; - + } + } } - } /* namespace dtv */ + consume_each(d_si); + return d_output_produced; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_sync_impl.h b/gr-dtv/lib/atsc/atsc_sync_impl.h index cf5fccd1b3..544c554fc4 100644 --- a/gr-dtv/lib/atsc/atsc_sync_impl.h +++ b/gr-dtv/lib/atsc/atsc_sync_impl.h @@ -29,47 +29,46 @@ #include <gnuradio/filter/mmse_fir_interpolator_ff.h> namespace gr { - namespace dtv { +namespace dtv { - class atsc_sync_impl : public atsc_sync - { - private: - gr::filter::single_pole_iir<float,float,float> d_loop; // ``VCO'' loop filter - gr::filter::mmse_fir_interpolator_ff d_interp; +class atsc_sync_impl : public atsc_sync +{ +private: + gr::filter::single_pole_iir<float, float, float> d_loop; // ``VCO'' loop filter + gr::filter::mmse_fir_interpolator_ff d_interp; - double d_rx_clock_to_symbol_freq; - int d_si; - double d_w; // ratio of PERIOD of Tx to Rx clocks - double d_mu; // fractional delay [0,1] - int d_incr; + double d_rx_clock_to_symbol_freq; + int d_si; + double d_w; // ratio of PERIOD of Tx to Rx clocks + double d_mu; // fractional delay [0,1] + int d_incr; - float d_sample_mem[ATSC_DATA_SEGMENT_LENGTH]; - float d_data_mem[ATSC_DATA_SEGMENT_LENGTH]; + float d_sample_mem[ATSC_DATA_SEGMENT_LENGTH]; + float d_data_mem[ATSC_DATA_SEGMENT_LENGTH]; - double d_timing_adjust; - int d_counter; // free running mod 832 counter - int d_symbol_index; - bool d_seg_locked; - unsigned char d_sr; // 4 bit shift register - signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH]; - int d_output_produced; + double d_timing_adjust; + int d_counter; // free running mod 832 counter + int d_symbol_index; + bool d_seg_locked; + unsigned char d_sr; // 4 bit shift register + signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH]; + int d_output_produced; - public: - atsc_sync_impl(float rate); - ~atsc_sync_impl(); +public: + atsc_sync_impl(float rate); + ~atsc_sync_impl(); - void reset(); + void reset(); - void forecast(int noutput_items, - gr_vector_int &ninput_items_required); + void forecast(int noutput_items, gr_vector_int& ninput_items_required); - virtual int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_SYNC_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc index 3252f94d31..1f474b7305 100644 --- a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.cc @@ -27,122 +27,119 @@ #include "gnuradio/dtv/atsc_consts.h" namespace gr { - namespace dtv { +namespace dtv { - static const int DIBITS_PER_BYTE = 4; +static const int DIBITS_PER_BYTE = 4; -#define SEGOF(x) ( (x) / ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) +#define SEGOF(x) ((x) / ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) #define SYMOF(x) (((x) % ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) - 4) - /* How many separate Trellis encoders / Viterbi decoders run in parallel */ - static const int NCODERS = 12; +/* How many separate Trellis encoders / Viterbi decoders run in parallel */ +static const int NCODERS = 12; #define ENCODER_SEG_BUMP 4 - /* A Segment sync symbol is an 8VSB +5,-5,-5,+5 sequence that occurs at - the start of each 207-byte segment (including field sync segments). */ -#define DSEG_SYNC_SYM1 0x06 /* +5 */ -#define DSEG_SYNC_SYM2 0x01 /* -5 */ -#define DSEG_SYNC_SYM3 0x01 /* -5 */ -#define DSEG_SYNC_SYM4 0x06 /* +5 */ - - /* Shift counts to bit numbers (high order, low order); 9x entries unused */ - static const int bit1[8] = {1, 99, 3, 98, 5, 97, 7, 96}; - static const int bit2[8] = {0, 99, 2, 98, 4, 97, 6, 96}; - - atsc_trellis_encoder::sptr - atsc_trellis_encoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_trellis_encoder_impl()); - } - - atsc_trellis_encoder_impl::atsc_trellis_encoder_impl() - : gr::sync_block("atsc_trellis_encoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) - { - reset(); - debug = false; - set_output_multiple(NCODERS); - } - - atsc_trellis_encoder_impl::~atsc_trellis_encoder_impl() - { - } - - void - atsc_trellis_encoder_impl::reset() - { - for (int i = 0; i < NCODERS; i++) { +/* A Segment sync symbol is an 8VSB +5,-5,-5,+5 sequence that occurs at + the start of each 207-byte segment (including field sync segments). */ +#define DSEG_SYNC_SYM1 0x06 /* +5 */ +#define DSEG_SYNC_SYM2 0x01 /* -5 */ +#define DSEG_SYNC_SYM3 0x01 /* -5 */ +#define DSEG_SYNC_SYM4 0x06 /* +5 */ + +/* Shift counts to bit numbers (high order, low order); 9x entries unused */ +static const int bit1[8] = { 1, 99, 3, 98, 5, 97, 7, 96 }; +static const int bit2[8] = { 0, 99, 2, 98, 4, 97, 6, 96 }; + +atsc_trellis_encoder::sptr atsc_trellis_encoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_trellis_encoder_impl()); +} + +atsc_trellis_encoder_impl::atsc_trellis_encoder_impl() + : gr::sync_block("atsc_trellis_encoder", + gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), + gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) +{ + reset(); + debug = false; + set_output_multiple(NCODERS); +} + +atsc_trellis_encoder_impl::~atsc_trellis_encoder_impl() {} + +void atsc_trellis_encoder_impl::reset() +{ + for (int i = 0; i < NCODERS; i++) { enc[i].reset(); - } } +} - void - atsc_trellis_encoder_impl::encode(atsc_data_segment out[NCODERS], - const atsc_mpeg_packet_rs_encoded in[NCODERS]) - { - unsigned char out_copy[OUTPUT_SIZE]; - unsigned char in_copy[INPUT_SIZE]; +void atsc_trellis_encoder_impl::encode(atsc_data_segment out[NCODERS], + const atsc_mpeg_packet_rs_encoded in[NCODERS]) +{ + unsigned char out_copy[OUTPUT_SIZE]; + unsigned char in_copy[INPUT_SIZE]; - assert (sizeof (in_copy) == sizeof (in[0].data) * NCODERS); - assert (sizeof (out_copy) == sizeof (out[0].data) * NCODERS); + assert(sizeof(in_copy) == sizeof(in[0].data) * NCODERS); + assert(sizeof(out_copy) == sizeof(out[0].data) * NCODERS); - // copy input into continguous temporary buffer - for (int i = 0; i < NCODERS; i++) { + // copy input into continguous temporary buffer + for (int i = 0; i < NCODERS; i++) { assert(in[i].pli.regular_seg_p()); - plinfo::sanity_check (in[i].pli); - memcpy(&in_copy[i * INPUT_SIZE / NCODERS], &in[i].data[0], ATSC_MPEG_RS_ENCODED_LENGTH * sizeof (in_copy[0])); - } + plinfo::sanity_check(in[i].pli); + memcpy(&in_copy[i * INPUT_SIZE / NCODERS], + &in[i].data[0], + ATSC_MPEG_RS_ENCODED_LENGTH * sizeof(in_copy[0])); + } - memset(out_copy, 0, sizeof (out_copy)); // FIXME, sanity check + memset(out_copy, 0, sizeof(out_copy)); // FIXME, sanity check - // do the deed... - encode_helper(out_copy, in_copy); + // do the deed... + encode_helper(out_copy, in_copy); - // copy output from contiguous temp buffer into final output - for (int i = 0; i < NCODERS; i++) { - memcpy(&out[i].data[0], &out_copy[i * OUTPUT_SIZE / NCODERS], ATSC_DATA_SEGMENT_LENGTH * sizeof (out_copy[0])); + // copy output from contiguous temp buffer into final output + for (int i = 0; i < NCODERS; i++) { + memcpy(&out[i].data[0], + &out_copy[i * OUTPUT_SIZE / NCODERS], + ATSC_DATA_SEGMENT_LENGTH * sizeof(out_copy[0])); // copy pipeline info out[i].pli = in[i].pli; plinfo::sanity_check(out[i].pli); assert(out[i].pli.regular_seg_p()); - } } +} - /* - * This code expects contiguous arrrays. Use it as is, it computes - * the correct answer. Maybe someday, when we've run out of better - * things to do, rework to avoid the copying in encode. +/* + * This code expects contiguous arrrays. Use it as is, it computes + * the correct answer. Maybe someday, when we've run out of better + * things to do, rework to avoid the copying in encode. + */ +void atsc_trellis_encoder_impl::encode_helper(unsigned char output[OUTPUT_SIZE], + const unsigned char input[INPUT_SIZE]) +{ + int i; + int encoder; + unsigned char trellis_buffer[NCODERS]; + int trellis_wherefrom[NCODERS]; + unsigned char *out, *next_out_seg; + int chunk; + int shift; + unsigned char dibit; + unsigned char symbol; + int skip_encoder_bump; + + /* FIXME, we may want special processing here for a flag + * byte to keep track of which part of the field we're in? */ - void - atsc_trellis_encoder_impl::encode_helper(unsigned char output[OUTPUT_SIZE], - const unsigned char input[INPUT_SIZE]) - { - int i; - int encoder; - unsigned char trellis_buffer[NCODERS]; - int trellis_wherefrom[NCODERS]; - unsigned char *out, *next_out_seg; - int chunk; - int shift; - unsigned char dibit; - unsigned char symbol; - int skip_encoder_bump; - - /* FIXME, we may want special processing here for a flag - * byte to keep track of which part of the field we're in? - */ - - encoder = NCODERS - ENCODER_SEG_BUMP; - skip_encoder_bump = 0; - out = output; - next_out_seg = out; - - for (chunk = 0; chunk < INPUT_SIZE; chunk += NCODERS) { + + encoder = NCODERS - ENCODER_SEG_BUMP; + skip_encoder_bump = 0; + out = output; + next_out_seg = out; + + for (chunk = 0; chunk < INPUT_SIZE; chunk += NCODERS) { /* Load a new chunk of bytes into the Trellis encoder buffers. * They get loaded in an order that depends on where we are in * the segment sync progress (sigh). @@ -151,93 +148,100 @@ namespace gr { * rather than LATER during the bitshift transition!!! */ if (out >= next_out_seg) { - encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; - skip_encoder_bump = 1; + encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; + skip_encoder_bump = 1; } for (i = 0; i < NCODERS; i++) { - /* for debug */ - trellis_wherefrom[encoder] = chunk + i; - trellis_buffer[encoder] = input [chunk + i]; - encoder++; - if (encoder >= NCODERS) { - encoder = 0; - } - } - - for (shift = 6; shift >= 0; shift -= 2) { - /* Segment boundaries happen to occur on some bitshift transitions. */ - if (out >= next_out_seg) { - /* Segment transition. Output a data segment sync symbol, - * and mess with the trellis encoder mux. - */ - *out++ = DSEG_SYNC_SYM1; - *out++ = DSEG_SYNC_SYM2; - *out++ = DSEG_SYNC_SYM3; - *out++ = DSEG_SYNC_SYM4; - if (debug) { - printf("SYNC SYNC SYNC SYNC\n"); - } - - next_out_seg = out + (SEGMENT_SIZE * DIBITS_PER_BYTE); - - if (!skip_encoder_bump) { - encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; - } - skip_encoder_bump = 0; - } - - /* Now run each of the 12 Trellis encoders to spit out 12 symbols. - * Each encoder takes input from the same byte of the chunk, but - * the outputs of the encoders come out in various orders. - * NOPE -- this is false. The encoders take input from various - * bytes of the chunk (which changes at segment sync time), AND - * they also come out in various orders. You really do have to - * keep separate track of: the input bytes, the encoders, and - * the output bytes -- because they're all moving with respect - * to each other!!! - */ - for (i = 0; i < NCODERS; i++) { - dibit = 0x03 & (trellis_buffer[encoder] >> shift); - if (debug) { - printf("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = dibit %d ", (long) SEGOF(out-output), (long) SYMOF(out-output), encoder, trellis_wherefrom[encoder], bit1[shift], bit2[shift], dibit); - } - - symbol = enc[encoder].encode(dibit); - *out++ = symbol; + /* for debug */ + trellis_wherefrom[encoder] = chunk + i; + trellis_buffer[encoder] = input[chunk + i]; encoder++; if (encoder >= NCODERS) { - encoder = 0; - } - if (debug) { - printf("sym %d\n", symbol); + encoder = 0; } + } - } /* Encoders */ - } /* Bit shifts */ - } /* Chunks */ - - /* Check up on ourselves */ - assert (0 == (INPUT_SIZE * DIBITS_PER_BYTE) % NCODERS); - assert (OUTPUT_SIZE == out - output); - assert (NCODERS - ENCODER_SEG_BUMP == encoder); - } - - int - atsc_trellis_encoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_data_segment *out = (atsc_data_segment *) output_items[0]; + for (shift = 6; shift >= 0; shift -= 2) { + /* Segment boundaries happen to occur on some bitshift transitions. */ + if (out >= next_out_seg) { + /* Segment transition. Output a data segment sync symbol, + * and mess with the trellis encoder mux. + */ + *out++ = DSEG_SYNC_SYM1; + *out++ = DSEG_SYNC_SYM2; + *out++ = DSEG_SYNC_SYM3; + *out++ = DSEG_SYNC_SYM4; + if (debug) { + printf("SYNC SYNC SYNC SYNC\n"); + } + + next_out_seg = out + (SEGMENT_SIZE * DIBITS_PER_BYTE); + + if (!skip_encoder_bump) { + encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; + } + skip_encoder_bump = 0; + } - for (int i = 0; i < noutput_items; i += NCODERS) { + /* Now run each of the 12 Trellis encoders to spit out 12 symbols. + * Each encoder takes input from the same byte of the chunk, but + * the outputs of the encoders come out in various orders. + * NOPE -- this is false. The encoders take input from various + * bytes of the chunk (which changes at segment sync time), AND + * they also come out in various orders. You really do have to + * keep separate track of: the input bytes, the encoders, and + * the output bytes -- because they're all moving with respect + * to each other!!! + */ + for (i = 0; i < NCODERS; i++) { + dibit = 0x03 & (trellis_buffer[encoder] >> shift); + if (debug) { + printf("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = dibit %d ", + (long)SEGOF(out - output), + (long)SYMOF(out - output), + encoder, + trellis_wherefrom[encoder], + bit1[shift], + bit2[shift], + dibit); + } + + symbol = enc[encoder].encode(dibit); + *out++ = symbol; + encoder++; + if (encoder >= NCODERS) { + encoder = 0; + } + if (debug) { + printf("sym %d\n", symbol); + } + + } /* Encoders */ + } /* Bit shifts */ + } /* Chunks */ + + /* Check up on ourselves */ + assert(0 == (INPUT_SIZE * DIBITS_PER_BYTE) % NCODERS); + assert(OUTPUT_SIZE == out - output); + assert(NCODERS - ENCODER_SEG_BUMP == encoder); +} + +int atsc_trellis_encoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_mpeg_packet_rs_encoded* in = + (const atsc_mpeg_packet_rs_encoded*)input_items[0]; + atsc_data_segment* out = (atsc_data_segment*)output_items[0]; + + for (int i = 0; i < noutput_items; i += NCODERS) { encode(&out[i], &in[i]); - } - - // Tell runtime system how many output items we produced. - return noutput_items; } - } /* namespace dtv */ + // Tell runtime system how many output items we produced. + return noutput_items; +} + +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h index 054a3aca3b..914d7b1ff3 100644 --- a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h @@ -26,34 +26,36 @@ #include "atsc_types.h" namespace gr { - namespace dtv { +namespace dtv { - class atsc_trellis_encoder_impl : public atsc_trellis_encoder - { - private: - bool debug; +class atsc_trellis_encoder_impl : public atsc_trellis_encoder +{ +private: + bool debug; - static const int NCODERS = 12; - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; - static const int INPUT_SIZE = (SEGMENT_SIZE * 12); - static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); + static const int NCODERS = 12; + static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; + static const int INPUT_SIZE = (SEGMENT_SIZE * 12); + static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); - void reset(); - void encode(atsc_data_segment out[NCODERS], const atsc_mpeg_packet_rs_encoded in[NCODERS]); - void encode_helper(unsigned char output[OUTPUT_SIZE], const unsigned char input[INPUT_SIZE]); + void reset(); + void encode(atsc_data_segment out[NCODERS], + const atsc_mpeg_packet_rs_encoded in[NCODERS]); + void encode_helper(unsigned char output[OUTPUT_SIZE], + const unsigned char input[INPUT_SIZE]); - atsc_basic_trellis_encoder enc[NCODERS]; + atsc_basic_trellis_encoder enc[NCODERS]; - public: - atsc_trellis_encoder_impl(); - ~atsc_trellis_encoder_impl(); +public: + atsc_trellis_encoder_impl(); + ~atsc_trellis_encoder_impl(); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } // namespace dtv +} // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_ATSC_TRELLIS_ENCODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_types.h b/gr-dtv/lib/atsc/atsc_types.h index e9f82bae8c..f1202d29e6 100644 --- a/gr-dtv/lib/atsc/atsc_types.h +++ b/gr-dtv/lib/atsc/atsc_types.h @@ -28,242 +28,259 @@ #include <cassert> namespace gr { - namespace dtv { +namespace dtv { - /*! - * \brief pipeline info that flows with data - * - * Not all modules need all the info - */ - class plinfo { - public: - plinfo () : _flags (0), _segno (0) { } +/*! + * \brief pipeline info that flows with data + * + * Not all modules need all the info + */ +class plinfo +{ +public: + plinfo() : _flags(0), _segno(0) {} - // accessors + // accessors - bool field_sync1_p () const { return (_flags & fl_field_sync1) != 0; } - bool field_sync2_p () const { return (_flags & fl_field_sync2) != 0; } - bool field_sync_p () const { return field_sync1_p () || field_sync2_p (); } + bool field_sync1_p() const { return (_flags & fl_field_sync1) != 0; } + bool field_sync2_p() const { return (_flags & fl_field_sync2) != 0; } + bool field_sync_p() const { return field_sync1_p() || field_sync2_p(); } - bool regular_seg_p () const { return (_flags & fl_regular_seg) != 0; } + bool regular_seg_p() const { return (_flags & fl_regular_seg) != 0; } - bool in_field1_p () const { return (_flags & fl_field2) == 0; } - bool in_field2_p () const { return (_flags & fl_field2) != 0; } + bool in_field1_p() const { return (_flags & fl_field2) == 0; } + bool in_field2_p() const { return (_flags & fl_field2) != 0; } - bool first_regular_seg_p () const { return (_flags & fl_first_regular_seg) != 0; } + bool first_regular_seg_p() const { return (_flags & fl_first_regular_seg) != 0; } - bool transport_error_p () const { return (_flags & fl_transport_error) != 0; } + bool transport_error_p() const { return (_flags & fl_transport_error) != 0; } - unsigned int segno () const { return _segno; } - unsigned int flags () const { return _flags; } + unsigned int segno() const { return _segno; } + unsigned int flags() const { return _flags; } - // setters + // setters - void set_field_sync1 () - { + void set_field_sync1() + { _segno = 0; _flags = fl_field_sync1; - } + } - void set_field_sync2 () - { + void set_field_sync2() + { _segno = 0; _flags = fl_field_sync2 | fl_field2; - } + } - void set_regular_seg (bool field2, int segno) - { - //assert (0 <= segno && segno < ATSC_DSEGS_PER_FIELD); + void set_regular_seg(bool field2, int segno) + { + // assert (0 <= segno && segno < ATSC_DSEGS_PER_FIELD); _segno = segno; _flags = fl_regular_seg; if (segno == 0) - _flags |= fl_first_regular_seg; + _flags |= fl_first_regular_seg; if (segno >= ATSC_DSEGS_PER_FIELD) - _flags |= fl_transport_error; + _flags |= fl_transport_error; if (field2) - _flags |= fl_field2; - } + _flags |= fl_field2; + } - void set_transport_error (bool error){ + void set_transport_error(bool error) + { if (error) - _flags |= fl_transport_error; + _flags |= fl_transport_error; else - _flags &= ~fl_transport_error; - } + _flags &= ~fl_transport_error; + } - // overload equality operator - bool operator== (const plinfo &other) const { + // overload equality operator + bool operator==(const plinfo& other) const + { return (_flags == other._flags && _segno == other._segno); - } + } - bool operator!= (const plinfo &other) const { + bool operator!=(const plinfo& other) const + { return !(_flags == other._flags && _segno == other._segno); - } + } - /*! - * Set \p OUT such that it reflects a \p NSEGS_OF_DELAY - * pipeline delay from \p IN. - */ - static void delay (plinfo &out, const plinfo &in, int nsegs_of_delay) - { - assert (in.regular_seg_p ()); - assert (nsegs_of_delay >= 0); + /*! + * Set \p OUT such that it reflects a \p NSEGS_OF_DELAY + * pipeline delay from \p IN. + */ + static void delay(plinfo& out, const plinfo& in, int nsegs_of_delay) + { + assert(in.regular_seg_p()); + assert(nsegs_of_delay >= 0); - int s = in.segno (); - if (in.in_field2_p ()) - s += ATSC_DSEGS_PER_FIELD; + int s = in.segno(); + if (in.in_field2_p()) + s += ATSC_DSEGS_PER_FIELD; s -= nsegs_of_delay; if (s < 0) - s += 2 * ATSC_DSEGS_PER_FIELD; + s += 2 * ATSC_DSEGS_PER_FIELD; - //assert (0 <= s && s < 2 * ATSC_DSEGS_PER_FIELD); + // assert (0 <= s && s < 2 * ATSC_DSEGS_PER_FIELD); if (s < ATSC_DSEGS_PER_FIELD) - out.set_regular_seg (false, s); // field 1 + out.set_regular_seg(false, s); // field 1 else - out.set_regular_seg (true, s - ATSC_DSEGS_PER_FIELD); // field 2 - } - - /*! - * confirm that \p X is plausible - */ - static void sanity_check (const plinfo &in) - { - // basic sanity checks... - //assert (x.segno () >= 0); - //assert (x.segno () < (unsigned) ATSC_DSEGS_PER_FIELD); - //assert ((x.flags () & ~0x3f) == 0); - - //assert (x.regular_seg_p () ^ x.field_sync_p ()); - //assert ((x.segno () != 0) ^ x.first_regular_seg_p ()); - } - - unsigned short _flags; // bitmask - short _segno; // segment number [-1,311] -1 is the field sync segment - - protected: - // these three are mutually exclusive - // This is a regular data segment. - static const int fl_regular_seg = 0x0001; - // This is a field sync segment, for 1st half of a field. - static const int fl_field_sync1 = 0x0002; - // This is a field sync segment, for 2nd half of a field. - static const int fl_field_sync2 = 0x0004; - - // This bit is on ONLY when fl_regular_seg is set AND when this is - // the first regular data segment AFTER a field sync segment. This - // segment causes various processing modules to reset. - static const int fl_first_regular_seg = 0x0008; - - // which field are we in? - static const int fl_field2 = 0x0010; // else field 1 - - // This bit is set when Reed-Solomon decoding detects an error that it - // can't correct. Note that other error detection (e.g. Viterbi) do not - // set it, since Reed-Solomon will correct many of those. This bit is - // then copied into the final Transport Stream packet so that MPEG - // software can see that the 188-byte data segment has been corrupted. - static const int fl_transport_error = 0x0020; - }; - - - - - class atsc_mpeg_packet { - public: - static const int NPAD = 68; - unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - }; - - bool operator!= (const atsc_mpeg_packet &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - }; - }; - - class atsc_mpeg_packet_no_sync { - public: - static const int NPAD = 65; - plinfo pli; - unsigned char data[ATSC_MPEG_DATA_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet_no_sync &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_mpeg_packet_no_sync &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } - }; - - class atsc_mpeg_packet_rs_encoded { - public: - static const int NPAD = 45; - plinfo pli; - unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet_rs_encoded &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_mpeg_packet_rs_encoded &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } - }; - - - //! contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol. - - class atsc_data_segment { - public: - static const int NPAD = 188; - plinfo pli; - unsigned char data[ATSC_DATA_SEGMENT_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (1024) - - // overload equality operator - bool operator== (const atsc_data_segment &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_data_segment &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } - }; + out.set_regular_seg(true, s - ATSC_DSEGS_PER_FIELD); // field 2 + } /*! - * Contains 832 bipolar floating point symbols. - * Nominal values are +/- {1, 3, 5, 7}. - * This data type represents the input to the viterbi decoder. + * confirm that \p X is plausible */ + static void sanity_check(const plinfo& in) + { + // basic sanity checks... + // assert (x.segno () >= 0); + // assert (x.segno () < (unsigned) ATSC_DSEGS_PER_FIELD); + // assert ((x.flags () & ~0x3f) == 0); + + // assert (x.regular_seg_p () ^ x.field_sync_p ()); + // assert ((x.segno () != 0) ^ x.first_regular_seg_p ()); + } + + unsigned short _flags; // bitmask + short _segno; // segment number [-1,311] -1 is the field sync segment + +protected: + // these three are mutually exclusive + // This is a regular data segment. + static const int fl_regular_seg = 0x0001; + // This is a field sync segment, for 1st half of a field. + static const int fl_field_sync1 = 0x0002; + // This is a field sync segment, for 2nd half of a field. + static const int fl_field_sync2 = 0x0004; + + // This bit is on ONLY when fl_regular_seg is set AND when this is + // the first regular data segment AFTER a field sync segment. This + // segment causes various processing modules to reset. + static const int fl_first_regular_seg = 0x0008; + + // which field are we in? + static const int fl_field2 = 0x0010; // else field 1 + + // This bit is set when Reed-Solomon decoding detects an error that it + // can't correct. Note that other error detection (e.g. Viterbi) do not + // set it, since Reed-Solomon will correct many of those. This bit is + // then copied into the final Transport Stream packet so that MPEG + // software can see that the 188-byte data segment has been corrupted. + static const int fl_transport_error = 0x0020; +}; + + +class atsc_mpeg_packet +{ +public: + static const int NPAD = 68; + unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync + unsigned char _pad_[NPAD]; // pad to power of 2 (256) + + // overload equality operator + bool operator==(const atsc_mpeg_packet& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + }; - class atsc_soft_data_segment { - public: - static const int NPAD = 764; - plinfo pli; - float data[ATSC_DATA_SEGMENT_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (4096) - - // overload equality operator - bool operator== (const atsc_data_segment &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_data_segment &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } + bool operator!=(const atsc_mpeg_packet& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); }; +}; + +class atsc_mpeg_packet_no_sync +{ +public: + static const int NPAD = 65; + plinfo pli; + unsigned char data[ATSC_MPEG_DATA_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (256) + + // overload equality operator + bool operator==(const atsc_mpeg_packet_no_sync& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_mpeg_packet_no_sync& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + +class atsc_mpeg_packet_rs_encoded +{ +public: + static const int NPAD = 45; + plinfo pli; + unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (256) + + // overload equality operator + bool operator==(const atsc_mpeg_packet_rs_encoded& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_mpeg_packet_rs_encoded& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + + +//! contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol. + +class atsc_data_segment +{ +public: + static const int NPAD = 188; + plinfo pli; + unsigned char data[ATSC_DATA_SEGMENT_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (1024) + + // overload equality operator + bool operator==(const atsc_data_segment& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_data_segment& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + +/*! + * Contains 832 bipolar floating point symbols. + * Nominal values are +/- {1, 3, 5, 7}. + * This data type represents the input to the viterbi decoder. + */ - } /* namespace dtv */ +class atsc_soft_data_segment +{ +public: + static const int NPAD = 764; + plinfo pli; + float data[ATSC_DATA_SEGMENT_LENGTH]; + unsigned char _pad_[NPAD]; // pad to power of 2 (4096) + + // overload equality operator + bool operator==(const atsc_data_segment& other) const + { + return std::memcmp(data, other.data, sizeof(data)) == 0; + } + + bool operator!=(const atsc_data_segment& other) const + { + return !(std::memcmp(data, other.data, sizeof(data)) == 0); + } +}; + +} /* namespace dtv */ } /* namespace gr */ #endif /* _ATSC_TYPES_H_ */ diff --git a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc index bf1e86c9f8..a30c5663d1 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc +++ b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.cc @@ -30,135 +30,134 @@ #include "atsc_viterbi_mux.h" namespace gr { - namespace dtv { - - atsc_viterbi_decoder::sptr - atsc_viterbi_decoder::make() - { - return gnuradio::get_initial_sptr - (new atsc_viterbi_decoder_impl()); - } - - atsc_viterbi_decoder_impl::atsc_viterbi_decoder_impl() - : sync_block("dtv_atsc_viterbi_decoder", - io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) - { - set_output_multiple(NCODERS); - - /* - * These fifo's handle the alignment problem caused by the - * inherent decoding delay of the individual viterbi decoders. - * The net result is that this entire block has a pipeline latency - * of 12 complete segments. - * - * If anybody cares, it is possible to do it with less delay, but - * this approach is at least somewhat understandable... - */ - - // the -4 is for the 4 sync symbols - int fifo_size = ATSC_DATA_SEGMENT_LENGTH - 4 - viterbi[0].delay(); - for (int i = 0; i < NCODERS; i++) +namespace dtv { + +atsc_viterbi_decoder::sptr atsc_viterbi_decoder::make() +{ + return gnuradio::get_initial_sptr(new atsc_viterbi_decoder_impl()); +} + +atsc_viterbi_decoder_impl::atsc_viterbi_decoder_impl() + : sync_block("dtv_atsc_viterbi_decoder", + io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), + io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) +{ + set_output_multiple(NCODERS); + + /* + * These fifo's handle the alignment problem caused by the + * inherent decoding delay of the individual viterbi decoders. + * The net result is that this entire block has a pipeline latency + * of 12 complete segments. + * + * If anybody cares, it is possible to do it with less delay, but + * this approach is at least somewhat understandable... + */ + + // the -4 is for the 4 sync symbols + int fifo_size = ATSC_DATA_SEGMENT_LENGTH - 4 - viterbi[0].delay(); + for (int i = 0; i < NCODERS; i++) fifo[i] = new fifo_t(fifo_size); - reset(); - } + reset(); +} - atsc_viterbi_decoder_impl::~atsc_viterbi_decoder_impl() - { - for (int i = 0; i < NCODERS; i++) +atsc_viterbi_decoder_impl::~atsc_viterbi_decoder_impl() +{ + for (int i = 0; i < NCODERS; i++) delete fifo[i]; - } +} - void - atsc_viterbi_decoder_impl::reset() - { - for (int i = 0; i < NCODERS; i++) +void atsc_viterbi_decoder_impl::reset() +{ + for (int i = 0; i < NCODERS; i++) fifo[i]->reset(); - } +} - std::vector<float> - atsc_viterbi_decoder_impl::decoder_metrics() const - { - std::vector<float> metrics(NCODERS); - for (int i = 0; i < NCODERS; i++) +std::vector<float> atsc_viterbi_decoder_impl::decoder_metrics() const +{ + std::vector<float> metrics(NCODERS); + for (int i = 0; i < NCODERS; i++) metrics[i] = viterbi[i].best_state_metric(); - return metrics; - } - - int - atsc_viterbi_decoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - - // The way the fs_checker works ensures we start getting packets - // starting with a field sync, and out input multiple is set to - // 12, so we should always get a mod 12 numbered first packet - assert(noutput_items % NCODERS == 0); - - int dbwhere; - int dbindex; - int shift; - float symbols[NCODERS][enco_which_max]; - unsigned char dibits[NCODERS][enco_which_max]; - - unsigned char out_copy[OUTPUT_SIZE]; - - for (int i = 0; i < noutput_items; i += NCODERS) { + return metrics; +} + +int atsc_viterbi_decoder_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + const atsc_soft_data_segment* in = (const atsc_soft_data_segment*)input_items[0]; + atsc_mpeg_packet_rs_encoded* out = (atsc_mpeg_packet_rs_encoded*)output_items[0]; + + // The way the fs_checker works ensures we start getting packets + // starting with a field sync, and out input multiple is set to + // 12, so we should always get a mod 12 numbered first packet + assert(noutput_items % NCODERS == 0); + + int dbwhere; + int dbindex; + int shift; + float symbols[NCODERS][enco_which_max]; + unsigned char dibits[NCODERS][enco_which_max]; + + unsigned char out_copy[OUTPUT_SIZE]; + + for (int i = 0; i < noutput_items; i += NCODERS) { /* Build a continuous symbol buffer for each encoder */ for (unsigned int encoder = 0; encoder < NCODERS; encoder++) - for (unsigned int k = 0; k < enco_which_max; k++) - symbols[encoder][k] = in[i + (enco_which_syms[encoder][k]/832)].data[enco_which_syms[encoder][k] % 832]; + for (unsigned int k = 0; k < enco_which_max; k++) + symbols[encoder][k] = in[i + (enco_which_syms[encoder][k] / 832)] + .data[enco_which_syms[encoder][k] % 832]; /* Now run each of the 12 Viterbi decoders over their subset of the input symbols */ for (unsigned int encoder = 0; encoder < NCODERS; encoder++) - for (unsigned int k = 0; k < enco_which_max; k++) - dibits[encoder][k] = viterbi[encoder].decode(symbols[encoder][k]); + for (unsigned int k = 0; k < enco_which_max; k++) + dibits[encoder][k] = viterbi[encoder].decode(symbols[encoder][k]); /* Move dibits into their location in the output buffer */ for (unsigned int encoder = 0; encoder < NCODERS; encoder++) { - for (unsigned int k = 0; k < enco_which_max; k++) { - /* Store the dibit into the output data segment */ - dbwhere = enco_which_dibits[encoder][k]; - dbindex = dbwhere >> 3; - shift = dbwhere & 0x7; - out_copy[dbindex] = (out_copy[dbindex] & ~(0x03 << shift)) | (fifo[encoder]->stuff(dibits[encoder][k]) << shift); - } /* Symbols fed into one encoder */ - } /* Encoders */ + for (unsigned int k = 0; k < enco_which_max; k++) { + /* Store the dibit into the output data segment */ + dbwhere = enco_which_dibits[encoder][k]; + dbindex = dbwhere >> 3; + shift = dbwhere & 0x7; + out_copy[dbindex] = (out_copy[dbindex] & ~(0x03 << shift)) | + (fifo[encoder]->stuff(dibits[encoder][k]) << shift); + } /* Symbols fed into one encoder */ + } /* Encoders */ // copy output from contiguous temp buffer into final output for (int j = 0; j < NCODERS; j++) { - memcpy (&out[i + j].data[0], - &out_copy[j * OUTPUT_SIZE/NCODERS], - ATSC_MPEG_RS_ENCODED_LENGTH * sizeof(out_copy[0])); + memcpy(&out[i + j].data[0], + &out_copy[j * OUTPUT_SIZE / NCODERS], + ATSC_MPEG_RS_ENCODED_LENGTH * sizeof(out_copy[0])); - // adjust pipeline info to reflect 12 segment delay - plinfo::delay(out[i + j].pli, in[i + j].pli, NCODERS); + // adjust pipeline info to reflect 12 segment delay + plinfo::delay(out[i + j].pli, in[i + j].pli, NCODERS); } - } - - return noutput_items; } - void - atsc_viterbi_decoder_impl::setup_rpc() - { + return noutput_items; +} + +void atsc_viterbi_decoder_impl::setup_rpc() +{ #ifdef GR_CTRLPORT - add_rpc_variable( - rpcbasic_sptr(new rpcbasic_register_get<atsc_viterbi_decoder, std::vector<float> >( - alias(), "decoder_metrics", - &atsc_viterbi_decoder::decoder_metrics, - pmt::make_f32vector(1,0), - pmt::make_f32vector(1,100000), - pmt::make_f32vector(1,0), - "", "Viterbi decoder metrics", RPC_PRIVLVL_MIN, - DISPTIME))); + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<atsc_viterbi_decoder, std::vector<float>>( + alias(), + "decoder_metrics", + &atsc_viterbi_decoder::decoder_metrics, + pmt::make_f32vector(1, 0), + pmt::make_f32vector(1, 100000), + pmt::make_f32vector(1, 0), + "", + "Viterbi decoder metrics", + RPC_PRIVLVL_MIN, + DISPTIME))); #endif /* GR_CTRLPORT */ - } +} - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h index e52aea7fa0..f5420ef259 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h @@ -28,7 +28,7 @@ #include "atsc_syminfo_impl.h" #include "atsc_interleaver_fifo.h" -#define USE_SIMPLE_SLICER 0 +#define USE_SIMPLE_SLICER 0 #define NCODERS 12 #if USE_SIMPLE_SLICER @@ -38,42 +38,42 @@ #endif namespace gr { - namespace dtv { +namespace dtv { #if USE_SIMPLE_SLICER - typedef atsc_fake_single_viterbi single_viterbi_t; +typedef atsc_fake_single_viterbi single_viterbi_t; #else - typedef atsc_single_viterbi single_viterbi_t; +typedef atsc_single_viterbi single_viterbi_t; #endif - class atsc_viterbi_decoder_impl : public atsc_viterbi_decoder - { - private: - typedef interleaver_fifo<unsigned char> fifo_t; +class atsc_viterbi_decoder_impl : public atsc_viterbi_decoder +{ +private: + typedef interleaver_fifo<unsigned char> fifo_t; - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 - static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12); - static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); + static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 + static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12); + static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); - single_viterbi_t viterbi[NCODERS]; - fifo_t *fifo[NCODERS]; + single_viterbi_t viterbi[NCODERS]; + fifo_t* fifo[NCODERS]; - public: - atsc_viterbi_decoder_impl(); - ~atsc_viterbi_decoder_impl(); +public: + atsc_viterbi_decoder_impl(); + ~atsc_viterbi_decoder_impl(); - void setup_rpc(); + void setup_rpc(); - void reset(); + void reset(); - std::vector<float> decoder_metrics() const; + std::vector<float> decoder_metrics() const; - virtual int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; + virtual int work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items); +}; - } /* namespace dtv */ +} /* namespace dtv */ } /* namespace gr */ #endif /* INCLUDED_DTV_ATSC_VITERBI_DECODER_IMPL_H */ diff --git a/gr-dtv/lib/atsc/atsc_viterbi_gen.cc b/gr-dtv/lib/atsc/atsc_viterbi_gen.cc index bff3c47736..b19d2da018 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_gen.cc +++ b/gr-dtv/lib/atsc/atsc_viterbi_gen.cc @@ -53,20 +53,20 @@ using std::cerr; this incredible complexity buys us anything subtle and important. */ -#define SEGMENT_SIZE 207 -#define INPUT_SIZE (SEGMENT_SIZE * 12) -#define DIBITS_PER_BYTE 4 -#define EXTRAS (4 * 12) /* FIXME, sync symbols and such */ -#define SYMBOLS_OUT ((INPUT_SIZE * DIBITS_PER_BYTE) + EXTRAS) -#define SEGOF(x) ( (x) / ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE)) -#define SYMOF(x) (((x) % ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE))-4) -#define ENCODERS 12 -#define ENCODER_SEG_BUMP 4 +#define SEGMENT_SIZE 207 +#define INPUT_SIZE (SEGMENT_SIZE * 12) +#define DIBITS_PER_BYTE 4 +#define EXTRAS (4 * 12) /* FIXME, sync symbols and such */ +#define SYMBOLS_OUT ((INPUT_SIZE * DIBITS_PER_BYTE) + EXTRAS) +#define SEGOF(x) ((x) / ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) +#define SYMOF(x) (((x) % ((SEGMENT_SIZE + 1) * DIBITS_PER_BYTE)) - 4) +#define ENCODERS 12 +#define ENCODER_SEG_BUMP 4 /* Shift counts to bit numbers (high order, low order); 9x entries unused */ -static const int bit1[8] = {1, 99, 3, 98, 5, 97, 7, 96}; -static const int bit2[8] = {0, 99, 2, 98, 4, 97, 6, 96}; +static const int bit1[8] = { 1, 99, 3, 98, 5, 97, 7, 96 }; +static const int bit2[8] = { 0, 99, 2, 98, 4, 97, 6, 96 }; /* Detailed Debugging */ int debug_dec = 0; @@ -75,106 +75,109 @@ int debug_dec = 0; * Build indirect data structures to say which symbols go into which * encoder, and then where the resulting dibits from the encoders go. */ -int -build_decode_structures (char *fileout) +int build_decode_structures(char* fileout) { - int retval = 0; - int i; - int encoder; - int trellis_wheredata[ENCODERS]; - unsigned char *symp, *next_sym_seg; - unsigned char symbols[SYMBOLS_OUT]; - int chunk; - int shift; - int skip_encoder_bump; - int *enco_syms[ENCODERS]; - int *enco_dibits[ENCODERS]; - int j; - /* The data structures we'll build and then spit out... */ - int sync_symbol_indices[1000]; - int sync_symbol_indices_max; - int enco_which_syms[ENCODERS][INPUT_SIZE]; - int enco_which_dibits[ENCODERS][INPUT_SIZE]; - int enco_which_max; - #define BIT_PTR(int,shif) (((int) << 3) | ((shif) & 0x7)) - /* Running indices into them as we build 'em... */ - int *syncsyms = sync_symbol_indices; - - /* Start our running pointers at the start of our per-encoder subarrays */ - for (i = 0; i < ENCODERS; i++) { - enco_dibits[i] = enco_which_dibits[i]; - enco_syms[i] = enco_which_syms[i]; - } - - encoder = ENCODERS - ENCODER_SEG_BUMP; - skip_encoder_bump = 0; - symp = symbols; - next_sym_seg = symp; - - for (chunk = 0; - chunk < INPUT_SIZE; - chunk += ENCODERS) { - /* Associate data bytes with the Trellis encoders. - They get loaded or stored in an order that depends on where we are in the - segment sync progress (sigh). - GRR! When the chunk reload happens at the same time as the - segment boundary, we should bump the encoder NOW for the reload, - rather than LATER during the bitshift transition!!! */ - if (symp >= next_sym_seg) { - encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; - skip_encoder_bump = 1; - } - - /* Remember where the data bytes are going to go, once we've - accumulated them from the 12 interleaved decoders */ + int retval = 0; + int i; + int encoder; + int trellis_wheredata[ENCODERS]; + unsigned char *symp, *next_sym_seg; + unsigned char symbols[SYMBOLS_OUT]; + int chunk; + int shift; + int skip_encoder_bump; + int* enco_syms[ENCODERS]; + int* enco_dibits[ENCODERS]; + int j; + /* The data structures we'll build and then spit out... */ + int sync_symbol_indices[1000]; + int sync_symbol_indices_max; + int enco_which_syms[ENCODERS][INPUT_SIZE]; + int enco_which_dibits[ENCODERS][INPUT_SIZE]; + int enco_which_max; +#define BIT_PTR(int, shif) (((int) << 3) | ((shif)&0x7)) + /* Running indices into them as we build 'em... */ + int* syncsyms = sync_symbol_indices; + + /* Start our running pointers at the start of our per-encoder subarrays */ for (i = 0; i < ENCODERS; i++) { - trellis_wheredata[encoder] = chunk+i; - encoder++; - if (encoder >= ENCODERS) encoder = 0; + enco_dibits[i] = enco_which_dibits[i]; + enco_syms[i] = enco_which_syms[i]; } - for (shift = 6; shift >= 0; shift -= 2) { - - /* Segment boundaries happen to occur on some bitshift transitions. */ - if (symp >= next_sym_seg) { - /* Segment transition. Output a data segment sync symbol, and - mess with the trellis encoder mux. */ - *syncsyms++ = symp - symbols; - symp += 4; - next_sym_seg = symp + (SEGMENT_SIZE * DIBITS_PER_BYTE); - - if (!skip_encoder_bump) - encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; - skip_encoder_bump = 0; - } - - /* Now run each of the 12 Trellis encoders to spit out 12 symbols. - Each encoder takes input from the same byte of the chunk, but the - outputs of the encoders come out in various orders. - NOPE -- this is false. The encoders take input from various - bytes of the chunk (which changes at segment sync time), AND - they also come out in various orders. You really do have to - keep separate track of: the datasegs bytes, the encoders, and - the symbol bytes -- because they're all moving with respect to - each other!!! */ - for (i = 0; i < ENCODERS; i++) { - if (debug_dec) - printf ("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = ", - (long) SEGOF(symp-symbols), (long) SYMOF(symp-symbols), - encoder, trellis_wheredata[encoder], - bit1[shift], bit2[shift]); - - /* Decoding: Grab symbol, run through decoder, slice dibit into - buffer. */ - /* This symbol goes into this encoder next */ - *(enco_syms[encoder]++) = symp - symbols; - symp++; - /* The next output from this encoder goes into these dibits */ - *(enco_dibits[encoder]++) = BIT_PTR(trellis_wheredata[encoder], shift); - - encoder++; if (encoder >= ENCODERS) encoder = 0; - } /* Encoders */ - } /* Bit shifts */ + encoder = ENCODERS - ENCODER_SEG_BUMP; + skip_encoder_bump = 0; + symp = symbols; + next_sym_seg = symp; + + for (chunk = 0; chunk < INPUT_SIZE; chunk += ENCODERS) { + /* Associate data bytes with the Trellis encoders. + They get loaded or stored in an order that depends on where we are in the + segment sync progress (sigh). + GRR! When the chunk reload happens at the same time as the + segment boundary, we should bump the encoder NOW for the reload, + rather than LATER during the bitshift transition!!! */ + if (symp >= next_sym_seg) { + encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; + skip_encoder_bump = 1; + } + + /* Remember where the data bytes are going to go, once we've + accumulated them from the 12 interleaved decoders */ + for (i = 0; i < ENCODERS; i++) { + trellis_wheredata[encoder] = chunk + i; + encoder++; + if (encoder >= ENCODERS) + encoder = 0; + } + + for (shift = 6; shift >= 0; shift -= 2) { + + /* Segment boundaries happen to occur on some bitshift transitions. */ + if (symp >= next_sym_seg) { + /* Segment transition. Output a data segment sync symbol, and + mess with the trellis encoder mux. */ + *syncsyms++ = symp - symbols; + symp += 4; + next_sym_seg = symp + (SEGMENT_SIZE * DIBITS_PER_BYTE); + + if (!skip_encoder_bump) + encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; + skip_encoder_bump = 0; + } + + /* Now run each of the 12 Trellis encoders to spit out 12 symbols. + Each encoder takes input from the same byte of the chunk, but the + outputs of the encoders come out in various orders. + NOPE -- this is false. The encoders take input from various + bytes of the chunk (which changes at segment sync time), AND + they also come out in various orders. You really do have to + keep separate track of: the datasegs bytes, the encoders, and + the symbol bytes -- because they're all moving with respect to + each other!!! */ + for (i = 0; i < ENCODERS; i++) { + if (debug_dec) + printf("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = ", + (long)SEGOF(symp - symbols), + (long)SYMOF(symp - symbols), + encoder, + trellis_wheredata[encoder], + bit1[shift], + bit2[shift]); + + /* Decoding: Grab symbol, run through decoder, slice dibit into + buffer. */ + /* This symbol goes into this encoder next */ + *(enco_syms[encoder]++) = symp - symbols; + symp++; + /* The next output from this encoder goes into these dibits */ + *(enco_dibits[encoder]++) = BIT_PTR(trellis_wheredata[encoder], shift); + + encoder++; + if (encoder >= ENCODERS) + encoder = 0; + } /* Encoders */ + } /* Bit shifts */ #if 0 /* Now dump out the chunk of 12 data bytes that the twelve decoders have @@ -189,14 +192,14 @@ build_decode_structures (char *fileout) if (encoder >= ENCODERS) encoder = 0; } /* Dumping encoder bytes */ #endif - } /* Chunks */ + } /* Chunks */ - /* Now print the resulting data structures in C++ */ + /* Now print the resulting data structures in C++ */ - if (!freopen(fileout, "w", stdout)) - return 2; + if (!freopen(fileout, "w", stdout)) + return 2; - printf ("/*\n\ + printf("/*\n\ * atsc_viterbi_mux.cc\n\ *\n\ * Data structures for knowing which symbols are fed to which\n\ @@ -204,64 +207,59 @@ build_decode_structures (char *fileout) *\n\ * Generated by 'atsc_viterbi_gen.cc'.\n\ */\n\n"); - sync_symbol_indices_max = syncsyms - sync_symbol_indices; - printf ("const unsigned int sync_symbol_indices_max = %d;\n", - sync_symbol_indices_max); - printf ("const unsigned int sync_symbol_indices[%d] = {\n ", - sync_symbol_indices_max); - for (i = 0; i < sync_symbol_indices_max; i++) { - printf ("%d,%s", sync_symbol_indices[i], (7 == i%8)? "\n ": " "); - } - printf ("};\n\n"); - - enco_which_max = enco_dibits[0] - enco_which_dibits[0]; - for (i = 0; i < ENCODERS; i++) - if (enco_which_max != enco_dibits[i] - enco_which_dibits[i]) { - cerr << "Encoder " << i << " has different max_dibits " << - enco_dibits[i] - enco_which_dibits[i] << " than " << enco_which_max; - retval = 3; + sync_symbol_indices_max = syncsyms - sync_symbol_indices; + printf("const unsigned int sync_symbol_indices_max = %d;\n", sync_symbol_indices_max); + printf("const unsigned int sync_symbol_indices[%d] = {\n ", sync_symbol_indices_max); + for (i = 0; i < sync_symbol_indices_max; i++) { + printf("%d,%s", sync_symbol_indices[i], (7 == i % 8) ? "\n " : " "); } + printf("};\n\n"); + + enco_which_max = enco_dibits[0] - enco_which_dibits[0]; + for (i = 0; i < ENCODERS; i++) + if (enco_which_max != enco_dibits[i] - enco_which_dibits[i]) { + cerr << "Encoder " << i << " has different max_dibits " + << enco_dibits[i] - enco_which_dibits[i] << " than " << enco_which_max; + retval = 3; + } + + printf("const unsigned int enco_which_max = %d;\n", enco_which_max); - printf ("const unsigned int enco_which_max = %d;\n" , enco_which_max); - - printf ("const unsigned int enco_which_syms[%d][%d] = {\n", - ENCODERS, enco_which_max); - for (i = 0; i < ENCODERS; i++) { - printf (" /* %d */\n {", i); - for (j = 0; j < enco_which_max; j++) - printf ("%d,%s", enco_which_syms[i][j], (7 == j%8)? "\n ": " "); - printf ("},\n"); - } - printf ("};\n\n"); - - printf ("const unsigned int enco_which_dibits[%d][%d] = {\n", - ENCODERS, enco_which_max); - for (i = 0; i < ENCODERS; i++) { - printf (" /* %d */\n {", i); - for (j = 0; j < enco_which_max; j++) - printf ("%d,%s", enco_which_dibits[i][j], (7 == j%8)? "\n ": " "); - printf ("},\n"); - } - printf ("};\n\n"); - return retval; + printf("const unsigned int enco_which_syms[%d][%d] = {\n", ENCODERS, enco_which_max); + for (i = 0; i < ENCODERS; i++) { + printf(" /* %d */\n {", i); + for (j = 0; j < enco_which_max; j++) + printf("%d,%s", enco_which_syms[i][j], (7 == j % 8) ? "\n " : " "); + printf("},\n"); + } + printf("};\n\n"); + + printf( + "const unsigned int enco_which_dibits[%d][%d] = {\n", ENCODERS, enco_which_max); + for (i = 0; i < ENCODERS; i++) { + printf(" /* %d */\n {", i); + for (j = 0; j < enco_which_max; j++) + printf("%d,%s", enco_which_dibits[i][j], (7 == j % 8) ? "\n " : " "); + printf("},\n"); + } + printf("};\n\n"); + return retval; } -int -usage() +int usage() { - cerr << "atsc_viterbi_gen: Usage:\n"; - cerr << " ./atsc_viterbi_gen -o atsc_viterbi_mux.cc\n"; - cerr << "That's all, folks!\n"; - return 1; + cerr << "atsc_viterbi_gen: Usage:\n"; + cerr << " ./atsc_viterbi_gen -o atsc_viterbi_mux.cc\n"; + cerr << "That's all, folks!\n"; + return 1; } -int -main(int argc, char **argv) +int main(int argc, char** argv) { - if (argc != 3) return usage(); - if (argv[1][0] != '-' - || argv[1][1] != 'o' - || argv[1][2] != 0 ) return usage(); - return build_decode_structures(argv[2]); + if (argc != 3) + return usage(); + if (argv[1][0] != '-' || argv[1][1] != 'o' || argv[1][2] != 0) + return usage(); + return build_decode_structures(argv[2]); } diff --git a/gr-dtv/lib/atsc/atsc_viterbi_mux.h b/gr-dtv/lib/atsc/atsc_viterbi_mux.h index 07ec557544..2beb49e08a 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_mux.h +++ b/gr-dtv/lib/atsc/atsc_viterbi_mux.h @@ -7,2533 +7,1764 @@ const unsigned int sync_symbol_indices_max = 12; const unsigned int sync_symbol_indices[12] = { - 0, 832, 1664, 2496, 3328, 4160, 4992, 5824, - 6656, 7488, 8320, 9152, }; + 0, 832, 1664, 2496, 3328, 4160, 4992, 5824, 6656, 7488, 8320, 9152, +}; const unsigned int enco_which_max = 828; const unsigned int enco_which_syms[12][828] = { - /* 0 */ - {4, 16, 28, 40, 52, 64, 76, 88, - 100, 112, 124, 136, 148, 160, 172, 184, - 196, 208, 220, 232, 244, 256, 268, 280, - 292, 304, 316, 328, 340, 352, 364, 376, - 388, 400, 412, 424, 436, 448, 460, 472, - 484, 496, 508, 520, 532, 544, 556, 568, - 580, 592, 604, 616, 628, 640, 652, 664, - 676, 688, 700, 712, 724, 736, 748, 760, - 772, 784, 796, 808, 820, 844, 856, 868, - 880, 892, 904, 916, 928, 940, 952, 964, - 976, 988, 1000, 1012, 1024, 1036, 1048, 1060, - 1072, 1084, 1096, 1108, 1120, 1132, 1144, 1156, - 1168, 1180, 1192, 1204, 1216, 1228, 1240, 1252, - 1264, 1276, 1288, 1300, 1312, 1324, 1336, 1348, - 1360, 1372, 1384, 1396, 1408, 1420, 1432, 1444, - 1456, 1468, 1480, 1492, 1504, 1516, 1528, 1540, - 1552, 1564, 1576, 1588, 1600, 1612, 1624, 1636, - 1648, 1660, 1672, 1684, 1696, 1708, 1720, 1732, - 1744, 1756, 1768, 1780, 1792, 1804, 1816, 1828, - 1840, 1852, 1864, 1876, 1888, 1900, 1912, 1924, - 1936, 1948, 1960, 1972, 1984, 1996, 2008, 2020, - 2032, 2044, 2056, 2068, 2080, 2092, 2104, 2116, - 2128, 2140, 2152, 2164, 2176, 2188, 2200, 2212, - 2224, 2236, 2248, 2260, 2272, 2284, 2296, 2308, - 2320, 2332, 2344, 2356, 2368, 2380, 2392, 2404, - 2416, 2428, 2440, 2452, 2464, 2476, 2488, 2500, - 2512, 2524, 2536, 2548, 2560, 2572, 2584, 2596, - 2608, 2620, 2632, 2644, 2656, 2668, 2680, 2692, - 2704, 2716, 2728, 2740, 2752, 2764, 2776, 2788, - 2800, 2812, 2824, 2836, 2848, 2860, 2872, 2884, - 2896, 2908, 2920, 2932, 2944, 2956, 2968, 2980, - 2992, 3004, 3016, 3028, 3040, 3052, 3064, 3076, - 3088, 3100, 3112, 3124, 3136, 3148, 3160, 3172, - 3184, 3196, 3208, 3220, 3232, 3244, 3256, 3268, - 3280, 3292, 3304, 3316, 3340, 3352, 3364, 3376, - 3388, 3400, 3412, 3424, 3436, 3448, 3460, 3472, - 3484, 3496, 3508, 3520, 3532, 3544, 3556, 3568, - 3580, 3592, 3604, 3616, 3628, 3640, 3652, 3664, - 3676, 3688, 3700, 3712, 3724, 3736, 3748, 3760, - 3772, 3784, 3796, 3808, 3820, 3832, 3844, 3856, - 3868, 3880, 3892, 3904, 3916, 3928, 3940, 3952, - 3964, 3976, 3988, 4000, 4012, 4024, 4036, 4048, - 4060, 4072, 4084, 4096, 4108, 4120, 4132, 4144, - 4156, 4168, 4180, 4192, 4204, 4216, 4228, 4240, - 4252, 4264, 4276, 4288, 4300, 4312, 4324, 4336, - 4348, 4360, 4372, 4384, 4396, 4408, 4420, 4432, - 4444, 4456, 4468, 4480, 4492, 4504, 4516, 4528, - 4540, 4552, 4564, 4576, 4588, 4600, 4612, 4624, - 4636, 4648, 4660, 4672, 4684, 4696, 4708, 4720, - 4732, 4744, 4756, 4768, 4780, 4792, 4804, 4816, - 4828, 4840, 4852, 4864, 4876, 4888, 4900, 4912, - 4924, 4936, 4948, 4960, 4972, 4984, 4996, 5008, - 5020, 5032, 5044, 5056, 5068, 5080, 5092, 5104, - 5116, 5128, 5140, 5152, 5164, 5176, 5188, 5200, - 5212, 5224, 5236, 5248, 5260, 5272, 5284, 5296, - 5308, 5320, 5332, 5344, 5356, 5368, 5380, 5392, - 5404, 5416, 5428, 5440, 5452, 5464, 5476, 5488, - 5500, 5512, 5524, 5536, 5548, 5560, 5572, 5584, - 5596, 5608, 5620, 5632, 5644, 5656, 5668, 5680, - 5692, 5704, 5716, 5728, 5740, 5752, 5764, 5776, - 5788, 5800, 5812, 5836, 5848, 5860, 5872, 5884, - 5896, 5908, 5920, 5932, 5944, 5956, 5968, 5980, - 5992, 6004, 6016, 6028, 6040, 6052, 6064, 6076, - 6088, 6100, 6112, 6124, 6136, 6148, 6160, 6172, - 6184, 6196, 6208, 6220, 6232, 6244, 6256, 6268, - 6280, 6292, 6304, 6316, 6328, 6340, 6352, 6364, - 6376, 6388, 6400, 6412, 6424, 6436, 6448, 6460, - 6472, 6484, 6496, 6508, 6520, 6532, 6544, 6556, - 6568, 6580, 6592, 6604, 6616, 6628, 6640, 6652, - 6664, 6676, 6688, 6700, 6712, 6724, 6736, 6748, - 6760, 6772, 6784, 6796, 6808, 6820, 6832, 6844, - 6856, 6868, 6880, 6892, 6904, 6916, 6928, 6940, - 6952, 6964, 6976, 6988, 7000, 7012, 7024, 7036, - 7048, 7060, 7072, 7084, 7096, 7108, 7120, 7132, - 7144, 7156, 7168, 7180, 7192, 7204, 7216, 7228, - 7240, 7252, 7264, 7276, 7288, 7300, 7312, 7324, - 7336, 7348, 7360, 7372, 7384, 7396, 7408, 7420, - 7432, 7444, 7456, 7468, 7480, 7492, 7504, 7516, - 7528, 7540, 7552, 7564, 7576, 7588, 7600, 7612, - 7624, 7636, 7648, 7660, 7672, 7684, 7696, 7708, - 7720, 7732, 7744, 7756, 7768, 7780, 7792, 7804, - 7816, 7828, 7840, 7852, 7864, 7876, 7888, 7900, - 7912, 7924, 7936, 7948, 7960, 7972, 7984, 7996, - 8008, 8020, 8032, 8044, 8056, 8068, 8080, 8092, - 8104, 8116, 8128, 8140, 8152, 8164, 8176, 8188, - 8200, 8212, 8224, 8236, 8248, 8260, 8272, 8284, - 8296, 8308, 8332, 8344, 8356, 8368, 8380, 8392, - 8404, 8416, 8428, 8440, 8452, 8464, 8476, 8488, - 8500, 8512, 8524, 8536, 8548, 8560, 8572, 8584, - 8596, 8608, 8620, 8632, 8644, 8656, 8668, 8680, - 8692, 8704, 8716, 8728, 8740, 8752, 8764, 8776, - 8788, 8800, 8812, 8824, 8836, 8848, 8860, 8872, - 8884, 8896, 8908, 8920, 8932, 8944, 8956, 8968, - 8980, 8992, 9004, 9016, 9028, 9040, 9052, 9064, - 9076, 9088, 9100, 9112, 9124, 9136, 9148, 9160, - 9172, 9184, 9196, 9208, 9220, 9232, 9244, 9256, - 9268, 9280, 9292, 9304, 9316, 9328, 9340, 9352, - 9364, 9376, 9388, 9400, 9412, 9424, 9436, 9448, - 9460, 9472, 9484, 9496, 9508, 9520, 9532, 9544, - 9556, 9568, 9580, 9592, 9604, 9616, 9628, 9640, - 9652, 9664, 9676, 9688, 9700, 9712, 9724, 9736, - 9748, 9760, 9772, 9784, 9796, 9808, 9820, 9832, - 9844, 9856, 9868, 9880, 9892, 9904, 9916, 9928, - 9940, 9952, 9964, 9976, }, - /* 1 */ - {5, 17, 29, 41, 53, 65, 77, 89, - 101, 113, 125, 137, 149, 161, 173, 185, - 197, 209, 221, 233, 245, 257, 269, 281, - 293, 305, 317, 329, 341, 353, 365, 377, - 389, 401, 413, 425, 437, 449, 461, 473, - 485, 497, 509, 521, 533, 545, 557, 569, - 581, 593, 605, 617, 629, 641, 653, 665, - 677, 689, 701, 713, 725, 737, 749, 761, - 773, 785, 797, 809, 821, 845, 857, 869, - 881, 893, 905, 917, 929, 941, 953, 965, - 977, 989, 1001, 1013, 1025, 1037, 1049, 1061, - 1073, 1085, 1097, 1109, 1121, 1133, 1145, 1157, - 1169, 1181, 1193, 1205, 1217, 1229, 1241, 1253, - 1265, 1277, 1289, 1301, 1313, 1325, 1337, 1349, - 1361, 1373, 1385, 1397, 1409, 1421, 1433, 1445, - 1457, 1469, 1481, 1493, 1505, 1517, 1529, 1541, - 1553, 1565, 1577, 1589, 1601, 1613, 1625, 1637, - 1649, 1661, 1673, 1685, 1697, 1709, 1721, 1733, - 1745, 1757, 1769, 1781, 1793, 1805, 1817, 1829, - 1841, 1853, 1865, 1877, 1889, 1901, 1913, 1925, - 1937, 1949, 1961, 1973, 1985, 1997, 2009, 2021, - 2033, 2045, 2057, 2069, 2081, 2093, 2105, 2117, - 2129, 2141, 2153, 2165, 2177, 2189, 2201, 2213, - 2225, 2237, 2249, 2261, 2273, 2285, 2297, 2309, - 2321, 2333, 2345, 2357, 2369, 2381, 2393, 2405, - 2417, 2429, 2441, 2453, 2465, 2477, 2489, 2501, - 2513, 2525, 2537, 2549, 2561, 2573, 2585, 2597, - 2609, 2621, 2633, 2645, 2657, 2669, 2681, 2693, - 2705, 2717, 2729, 2741, 2753, 2765, 2777, 2789, - 2801, 2813, 2825, 2837, 2849, 2861, 2873, 2885, - 2897, 2909, 2921, 2933, 2945, 2957, 2969, 2981, - 2993, 3005, 3017, 3029, 3041, 3053, 3065, 3077, - 3089, 3101, 3113, 3125, 3137, 3149, 3161, 3173, - 3185, 3197, 3209, 3221, 3233, 3245, 3257, 3269, - 3281, 3293, 3305, 3317, 3341, 3353, 3365, 3377, - 3389, 3401, 3413, 3425, 3437, 3449, 3461, 3473, - 3485, 3497, 3509, 3521, 3533, 3545, 3557, 3569, - 3581, 3593, 3605, 3617, 3629, 3641, 3653, 3665, - 3677, 3689, 3701, 3713, 3725, 3737, 3749, 3761, - 3773, 3785, 3797, 3809, 3821, 3833, 3845, 3857, - 3869, 3881, 3893, 3905, 3917, 3929, 3941, 3953, - 3965, 3977, 3989, 4001, 4013, 4025, 4037, 4049, - 4061, 4073, 4085, 4097, 4109, 4121, 4133, 4145, - 4157, 4169, 4181, 4193, 4205, 4217, 4229, 4241, - 4253, 4265, 4277, 4289, 4301, 4313, 4325, 4337, - 4349, 4361, 4373, 4385, 4397, 4409, 4421, 4433, - 4445, 4457, 4469, 4481, 4493, 4505, 4517, 4529, - 4541, 4553, 4565, 4577, 4589, 4601, 4613, 4625, - 4637, 4649, 4661, 4673, 4685, 4697, 4709, 4721, - 4733, 4745, 4757, 4769, 4781, 4793, 4805, 4817, - 4829, 4841, 4853, 4865, 4877, 4889, 4901, 4913, - 4925, 4937, 4949, 4961, 4973, 4985, 4997, 5009, - 5021, 5033, 5045, 5057, 5069, 5081, 5093, 5105, - 5117, 5129, 5141, 5153, 5165, 5177, 5189, 5201, - 5213, 5225, 5237, 5249, 5261, 5273, 5285, 5297, - 5309, 5321, 5333, 5345, 5357, 5369, 5381, 5393, - 5405, 5417, 5429, 5441, 5453, 5465, 5477, 5489, - 5501, 5513, 5525, 5537, 5549, 5561, 5573, 5585, - 5597, 5609, 5621, 5633, 5645, 5657, 5669, 5681, - 5693, 5705, 5717, 5729, 5741, 5753, 5765, 5777, - 5789, 5801, 5813, 5837, 5849, 5861, 5873, 5885, - 5897, 5909, 5921, 5933, 5945, 5957, 5969, 5981, - 5993, 6005, 6017, 6029, 6041, 6053, 6065, 6077, - 6089, 6101, 6113, 6125, 6137, 6149, 6161, 6173, - 6185, 6197, 6209, 6221, 6233, 6245, 6257, 6269, - 6281, 6293, 6305, 6317, 6329, 6341, 6353, 6365, - 6377, 6389, 6401, 6413, 6425, 6437, 6449, 6461, - 6473, 6485, 6497, 6509, 6521, 6533, 6545, 6557, - 6569, 6581, 6593, 6605, 6617, 6629, 6641, 6653, - 6665, 6677, 6689, 6701, 6713, 6725, 6737, 6749, - 6761, 6773, 6785, 6797, 6809, 6821, 6833, 6845, - 6857, 6869, 6881, 6893, 6905, 6917, 6929, 6941, - 6953, 6965, 6977, 6989, 7001, 7013, 7025, 7037, - 7049, 7061, 7073, 7085, 7097, 7109, 7121, 7133, - 7145, 7157, 7169, 7181, 7193, 7205, 7217, 7229, - 7241, 7253, 7265, 7277, 7289, 7301, 7313, 7325, - 7337, 7349, 7361, 7373, 7385, 7397, 7409, 7421, - 7433, 7445, 7457, 7469, 7481, 7493, 7505, 7517, - 7529, 7541, 7553, 7565, 7577, 7589, 7601, 7613, - 7625, 7637, 7649, 7661, 7673, 7685, 7697, 7709, - 7721, 7733, 7745, 7757, 7769, 7781, 7793, 7805, - 7817, 7829, 7841, 7853, 7865, 7877, 7889, 7901, - 7913, 7925, 7937, 7949, 7961, 7973, 7985, 7997, - 8009, 8021, 8033, 8045, 8057, 8069, 8081, 8093, - 8105, 8117, 8129, 8141, 8153, 8165, 8177, 8189, - 8201, 8213, 8225, 8237, 8249, 8261, 8273, 8285, - 8297, 8309, 8333, 8345, 8357, 8369, 8381, 8393, - 8405, 8417, 8429, 8441, 8453, 8465, 8477, 8489, - 8501, 8513, 8525, 8537, 8549, 8561, 8573, 8585, - 8597, 8609, 8621, 8633, 8645, 8657, 8669, 8681, - 8693, 8705, 8717, 8729, 8741, 8753, 8765, 8777, - 8789, 8801, 8813, 8825, 8837, 8849, 8861, 8873, - 8885, 8897, 8909, 8921, 8933, 8945, 8957, 8969, - 8981, 8993, 9005, 9017, 9029, 9041, 9053, 9065, - 9077, 9089, 9101, 9113, 9125, 9137, 9149, 9161, - 9173, 9185, 9197, 9209, 9221, 9233, 9245, 9257, - 9269, 9281, 9293, 9305, 9317, 9329, 9341, 9353, - 9365, 9377, 9389, 9401, 9413, 9425, 9437, 9449, - 9461, 9473, 9485, 9497, 9509, 9521, 9533, 9545, - 9557, 9569, 9581, 9593, 9605, 9617, 9629, 9641, - 9653, 9665, 9677, 9689, 9701, 9713, 9725, 9737, - 9749, 9761, 9773, 9785, 9797, 9809, 9821, 9833, - 9845, 9857, 9869, 9881, 9893, 9905, 9917, 9929, - 9941, 9953, 9965, 9977, }, - /* 2 */ - {6, 18, 30, 42, 54, 66, 78, 90, - 102, 114, 126, 138, 150, 162, 174, 186, - 198, 210, 222, 234, 246, 258, 270, 282, - 294, 306, 318, 330, 342, 354, 366, 378, - 390, 402, 414, 426, 438, 450, 462, 474, - 486, 498, 510, 522, 534, 546, 558, 570, - 582, 594, 606, 618, 630, 642, 654, 666, - 678, 690, 702, 714, 726, 738, 750, 762, - 774, 786, 798, 810, 822, 846, 858, 870, - 882, 894, 906, 918, 930, 942, 954, 966, - 978, 990, 1002, 1014, 1026, 1038, 1050, 1062, - 1074, 1086, 1098, 1110, 1122, 1134, 1146, 1158, - 1170, 1182, 1194, 1206, 1218, 1230, 1242, 1254, - 1266, 1278, 1290, 1302, 1314, 1326, 1338, 1350, - 1362, 1374, 1386, 1398, 1410, 1422, 1434, 1446, - 1458, 1470, 1482, 1494, 1506, 1518, 1530, 1542, - 1554, 1566, 1578, 1590, 1602, 1614, 1626, 1638, - 1650, 1662, 1674, 1686, 1698, 1710, 1722, 1734, - 1746, 1758, 1770, 1782, 1794, 1806, 1818, 1830, - 1842, 1854, 1866, 1878, 1890, 1902, 1914, 1926, - 1938, 1950, 1962, 1974, 1986, 1998, 2010, 2022, - 2034, 2046, 2058, 2070, 2082, 2094, 2106, 2118, - 2130, 2142, 2154, 2166, 2178, 2190, 2202, 2214, - 2226, 2238, 2250, 2262, 2274, 2286, 2298, 2310, - 2322, 2334, 2346, 2358, 2370, 2382, 2394, 2406, - 2418, 2430, 2442, 2454, 2466, 2478, 2490, 2502, - 2514, 2526, 2538, 2550, 2562, 2574, 2586, 2598, - 2610, 2622, 2634, 2646, 2658, 2670, 2682, 2694, - 2706, 2718, 2730, 2742, 2754, 2766, 2778, 2790, - 2802, 2814, 2826, 2838, 2850, 2862, 2874, 2886, - 2898, 2910, 2922, 2934, 2946, 2958, 2970, 2982, - 2994, 3006, 3018, 3030, 3042, 3054, 3066, 3078, - 3090, 3102, 3114, 3126, 3138, 3150, 3162, 3174, - 3186, 3198, 3210, 3222, 3234, 3246, 3258, 3270, - 3282, 3294, 3306, 3318, 3342, 3354, 3366, 3378, - 3390, 3402, 3414, 3426, 3438, 3450, 3462, 3474, - 3486, 3498, 3510, 3522, 3534, 3546, 3558, 3570, - 3582, 3594, 3606, 3618, 3630, 3642, 3654, 3666, - 3678, 3690, 3702, 3714, 3726, 3738, 3750, 3762, - 3774, 3786, 3798, 3810, 3822, 3834, 3846, 3858, - 3870, 3882, 3894, 3906, 3918, 3930, 3942, 3954, - 3966, 3978, 3990, 4002, 4014, 4026, 4038, 4050, - 4062, 4074, 4086, 4098, 4110, 4122, 4134, 4146, - 4158, 4170, 4182, 4194, 4206, 4218, 4230, 4242, - 4254, 4266, 4278, 4290, 4302, 4314, 4326, 4338, - 4350, 4362, 4374, 4386, 4398, 4410, 4422, 4434, - 4446, 4458, 4470, 4482, 4494, 4506, 4518, 4530, - 4542, 4554, 4566, 4578, 4590, 4602, 4614, 4626, - 4638, 4650, 4662, 4674, 4686, 4698, 4710, 4722, - 4734, 4746, 4758, 4770, 4782, 4794, 4806, 4818, - 4830, 4842, 4854, 4866, 4878, 4890, 4902, 4914, - 4926, 4938, 4950, 4962, 4974, 4986, 4998, 5010, - 5022, 5034, 5046, 5058, 5070, 5082, 5094, 5106, - 5118, 5130, 5142, 5154, 5166, 5178, 5190, 5202, - 5214, 5226, 5238, 5250, 5262, 5274, 5286, 5298, - 5310, 5322, 5334, 5346, 5358, 5370, 5382, 5394, - 5406, 5418, 5430, 5442, 5454, 5466, 5478, 5490, - 5502, 5514, 5526, 5538, 5550, 5562, 5574, 5586, - 5598, 5610, 5622, 5634, 5646, 5658, 5670, 5682, - 5694, 5706, 5718, 5730, 5742, 5754, 5766, 5778, - 5790, 5802, 5814, 5838, 5850, 5862, 5874, 5886, - 5898, 5910, 5922, 5934, 5946, 5958, 5970, 5982, - 5994, 6006, 6018, 6030, 6042, 6054, 6066, 6078, - 6090, 6102, 6114, 6126, 6138, 6150, 6162, 6174, - 6186, 6198, 6210, 6222, 6234, 6246, 6258, 6270, - 6282, 6294, 6306, 6318, 6330, 6342, 6354, 6366, - 6378, 6390, 6402, 6414, 6426, 6438, 6450, 6462, - 6474, 6486, 6498, 6510, 6522, 6534, 6546, 6558, - 6570, 6582, 6594, 6606, 6618, 6630, 6642, 6654, - 6666, 6678, 6690, 6702, 6714, 6726, 6738, 6750, - 6762, 6774, 6786, 6798, 6810, 6822, 6834, 6846, - 6858, 6870, 6882, 6894, 6906, 6918, 6930, 6942, - 6954, 6966, 6978, 6990, 7002, 7014, 7026, 7038, - 7050, 7062, 7074, 7086, 7098, 7110, 7122, 7134, - 7146, 7158, 7170, 7182, 7194, 7206, 7218, 7230, - 7242, 7254, 7266, 7278, 7290, 7302, 7314, 7326, - 7338, 7350, 7362, 7374, 7386, 7398, 7410, 7422, - 7434, 7446, 7458, 7470, 7482, 7494, 7506, 7518, - 7530, 7542, 7554, 7566, 7578, 7590, 7602, 7614, - 7626, 7638, 7650, 7662, 7674, 7686, 7698, 7710, - 7722, 7734, 7746, 7758, 7770, 7782, 7794, 7806, - 7818, 7830, 7842, 7854, 7866, 7878, 7890, 7902, - 7914, 7926, 7938, 7950, 7962, 7974, 7986, 7998, - 8010, 8022, 8034, 8046, 8058, 8070, 8082, 8094, - 8106, 8118, 8130, 8142, 8154, 8166, 8178, 8190, - 8202, 8214, 8226, 8238, 8250, 8262, 8274, 8286, - 8298, 8310, 8334, 8346, 8358, 8370, 8382, 8394, - 8406, 8418, 8430, 8442, 8454, 8466, 8478, 8490, - 8502, 8514, 8526, 8538, 8550, 8562, 8574, 8586, - 8598, 8610, 8622, 8634, 8646, 8658, 8670, 8682, - 8694, 8706, 8718, 8730, 8742, 8754, 8766, 8778, - 8790, 8802, 8814, 8826, 8838, 8850, 8862, 8874, - 8886, 8898, 8910, 8922, 8934, 8946, 8958, 8970, - 8982, 8994, 9006, 9018, 9030, 9042, 9054, 9066, - 9078, 9090, 9102, 9114, 9126, 9138, 9150, 9162, - 9174, 9186, 9198, 9210, 9222, 9234, 9246, 9258, - 9270, 9282, 9294, 9306, 9318, 9330, 9342, 9354, - 9366, 9378, 9390, 9402, 9414, 9426, 9438, 9450, - 9462, 9474, 9486, 9498, 9510, 9522, 9534, 9546, - 9558, 9570, 9582, 9594, 9606, 9618, 9630, 9642, - 9654, 9666, 9678, 9690, 9702, 9714, 9726, 9738, - 9750, 9762, 9774, 9786, 9798, 9810, 9822, 9834, - 9846, 9858, 9870, 9882, 9894, 9906, 9918, 9930, - 9942, 9954, 9966, 9978, }, - /* 3 */ - {7, 19, 31, 43, 55, 67, 79, 91, - 103, 115, 127, 139, 151, 163, 175, 187, - 199, 211, 223, 235, 247, 259, 271, 283, - 295, 307, 319, 331, 343, 355, 367, 379, - 391, 403, 415, 427, 439, 451, 463, 475, - 487, 499, 511, 523, 535, 547, 559, 571, - 583, 595, 607, 619, 631, 643, 655, 667, - 679, 691, 703, 715, 727, 739, 751, 763, - 775, 787, 799, 811, 823, 847, 859, 871, - 883, 895, 907, 919, 931, 943, 955, 967, - 979, 991, 1003, 1015, 1027, 1039, 1051, 1063, - 1075, 1087, 1099, 1111, 1123, 1135, 1147, 1159, - 1171, 1183, 1195, 1207, 1219, 1231, 1243, 1255, - 1267, 1279, 1291, 1303, 1315, 1327, 1339, 1351, - 1363, 1375, 1387, 1399, 1411, 1423, 1435, 1447, - 1459, 1471, 1483, 1495, 1507, 1519, 1531, 1543, - 1555, 1567, 1579, 1591, 1603, 1615, 1627, 1639, - 1651, 1663, 1675, 1687, 1699, 1711, 1723, 1735, - 1747, 1759, 1771, 1783, 1795, 1807, 1819, 1831, - 1843, 1855, 1867, 1879, 1891, 1903, 1915, 1927, - 1939, 1951, 1963, 1975, 1987, 1999, 2011, 2023, - 2035, 2047, 2059, 2071, 2083, 2095, 2107, 2119, - 2131, 2143, 2155, 2167, 2179, 2191, 2203, 2215, - 2227, 2239, 2251, 2263, 2275, 2287, 2299, 2311, - 2323, 2335, 2347, 2359, 2371, 2383, 2395, 2407, - 2419, 2431, 2443, 2455, 2467, 2479, 2491, 2503, - 2515, 2527, 2539, 2551, 2563, 2575, 2587, 2599, - 2611, 2623, 2635, 2647, 2659, 2671, 2683, 2695, - 2707, 2719, 2731, 2743, 2755, 2767, 2779, 2791, - 2803, 2815, 2827, 2839, 2851, 2863, 2875, 2887, - 2899, 2911, 2923, 2935, 2947, 2959, 2971, 2983, - 2995, 3007, 3019, 3031, 3043, 3055, 3067, 3079, - 3091, 3103, 3115, 3127, 3139, 3151, 3163, 3175, - 3187, 3199, 3211, 3223, 3235, 3247, 3259, 3271, - 3283, 3295, 3307, 3319, 3343, 3355, 3367, 3379, - 3391, 3403, 3415, 3427, 3439, 3451, 3463, 3475, - 3487, 3499, 3511, 3523, 3535, 3547, 3559, 3571, - 3583, 3595, 3607, 3619, 3631, 3643, 3655, 3667, - 3679, 3691, 3703, 3715, 3727, 3739, 3751, 3763, - 3775, 3787, 3799, 3811, 3823, 3835, 3847, 3859, - 3871, 3883, 3895, 3907, 3919, 3931, 3943, 3955, - 3967, 3979, 3991, 4003, 4015, 4027, 4039, 4051, - 4063, 4075, 4087, 4099, 4111, 4123, 4135, 4147, - 4159, 4171, 4183, 4195, 4207, 4219, 4231, 4243, - 4255, 4267, 4279, 4291, 4303, 4315, 4327, 4339, - 4351, 4363, 4375, 4387, 4399, 4411, 4423, 4435, - 4447, 4459, 4471, 4483, 4495, 4507, 4519, 4531, - 4543, 4555, 4567, 4579, 4591, 4603, 4615, 4627, - 4639, 4651, 4663, 4675, 4687, 4699, 4711, 4723, - 4735, 4747, 4759, 4771, 4783, 4795, 4807, 4819, - 4831, 4843, 4855, 4867, 4879, 4891, 4903, 4915, - 4927, 4939, 4951, 4963, 4975, 4987, 4999, 5011, - 5023, 5035, 5047, 5059, 5071, 5083, 5095, 5107, - 5119, 5131, 5143, 5155, 5167, 5179, 5191, 5203, - 5215, 5227, 5239, 5251, 5263, 5275, 5287, 5299, - 5311, 5323, 5335, 5347, 5359, 5371, 5383, 5395, - 5407, 5419, 5431, 5443, 5455, 5467, 5479, 5491, - 5503, 5515, 5527, 5539, 5551, 5563, 5575, 5587, - 5599, 5611, 5623, 5635, 5647, 5659, 5671, 5683, - 5695, 5707, 5719, 5731, 5743, 5755, 5767, 5779, - 5791, 5803, 5815, 5839, 5851, 5863, 5875, 5887, - 5899, 5911, 5923, 5935, 5947, 5959, 5971, 5983, - 5995, 6007, 6019, 6031, 6043, 6055, 6067, 6079, - 6091, 6103, 6115, 6127, 6139, 6151, 6163, 6175, - 6187, 6199, 6211, 6223, 6235, 6247, 6259, 6271, - 6283, 6295, 6307, 6319, 6331, 6343, 6355, 6367, - 6379, 6391, 6403, 6415, 6427, 6439, 6451, 6463, - 6475, 6487, 6499, 6511, 6523, 6535, 6547, 6559, - 6571, 6583, 6595, 6607, 6619, 6631, 6643, 6655, - 6667, 6679, 6691, 6703, 6715, 6727, 6739, 6751, - 6763, 6775, 6787, 6799, 6811, 6823, 6835, 6847, - 6859, 6871, 6883, 6895, 6907, 6919, 6931, 6943, - 6955, 6967, 6979, 6991, 7003, 7015, 7027, 7039, - 7051, 7063, 7075, 7087, 7099, 7111, 7123, 7135, - 7147, 7159, 7171, 7183, 7195, 7207, 7219, 7231, - 7243, 7255, 7267, 7279, 7291, 7303, 7315, 7327, - 7339, 7351, 7363, 7375, 7387, 7399, 7411, 7423, - 7435, 7447, 7459, 7471, 7483, 7495, 7507, 7519, - 7531, 7543, 7555, 7567, 7579, 7591, 7603, 7615, - 7627, 7639, 7651, 7663, 7675, 7687, 7699, 7711, - 7723, 7735, 7747, 7759, 7771, 7783, 7795, 7807, - 7819, 7831, 7843, 7855, 7867, 7879, 7891, 7903, - 7915, 7927, 7939, 7951, 7963, 7975, 7987, 7999, - 8011, 8023, 8035, 8047, 8059, 8071, 8083, 8095, - 8107, 8119, 8131, 8143, 8155, 8167, 8179, 8191, - 8203, 8215, 8227, 8239, 8251, 8263, 8275, 8287, - 8299, 8311, 8335, 8347, 8359, 8371, 8383, 8395, - 8407, 8419, 8431, 8443, 8455, 8467, 8479, 8491, - 8503, 8515, 8527, 8539, 8551, 8563, 8575, 8587, - 8599, 8611, 8623, 8635, 8647, 8659, 8671, 8683, - 8695, 8707, 8719, 8731, 8743, 8755, 8767, 8779, - 8791, 8803, 8815, 8827, 8839, 8851, 8863, 8875, - 8887, 8899, 8911, 8923, 8935, 8947, 8959, 8971, - 8983, 8995, 9007, 9019, 9031, 9043, 9055, 9067, - 9079, 9091, 9103, 9115, 9127, 9139, 9151, 9163, - 9175, 9187, 9199, 9211, 9223, 9235, 9247, 9259, - 9271, 9283, 9295, 9307, 9319, 9331, 9343, 9355, - 9367, 9379, 9391, 9403, 9415, 9427, 9439, 9451, - 9463, 9475, 9487, 9499, 9511, 9523, 9535, 9547, - 9559, 9571, 9583, 9595, 9607, 9619, 9631, 9643, - 9655, 9667, 9679, 9691, 9703, 9715, 9727, 9739, - 9751, 9763, 9775, 9787, 9799, 9811, 9823, 9835, - 9847, 9859, 9871, 9883, 9895, 9907, 9919, 9931, - 9943, 9955, 9967, 9979, }, - /* 4 */ - {8, 20, 32, 44, 56, 68, 80, 92, - 104, 116, 128, 140, 152, 164, 176, 188, - 200, 212, 224, 236, 248, 260, 272, 284, - 296, 308, 320, 332, 344, 356, 368, 380, - 392, 404, 416, 428, 440, 452, 464, 476, - 488, 500, 512, 524, 536, 548, 560, 572, - 584, 596, 608, 620, 632, 644, 656, 668, - 680, 692, 704, 716, 728, 740, 752, 764, - 776, 788, 800, 812, 824, 836, 848, 860, - 872, 884, 896, 908, 920, 932, 944, 956, - 968, 980, 992, 1004, 1016, 1028, 1040, 1052, - 1064, 1076, 1088, 1100, 1112, 1124, 1136, 1148, - 1160, 1172, 1184, 1196, 1208, 1220, 1232, 1244, - 1256, 1268, 1280, 1292, 1304, 1316, 1328, 1340, - 1352, 1364, 1376, 1388, 1400, 1412, 1424, 1436, - 1448, 1460, 1472, 1484, 1496, 1508, 1520, 1532, - 1544, 1556, 1568, 1580, 1592, 1604, 1616, 1628, - 1640, 1652, 1676, 1688, 1700, 1712, 1724, 1736, - 1748, 1760, 1772, 1784, 1796, 1808, 1820, 1832, - 1844, 1856, 1868, 1880, 1892, 1904, 1916, 1928, - 1940, 1952, 1964, 1976, 1988, 2000, 2012, 2024, - 2036, 2048, 2060, 2072, 2084, 2096, 2108, 2120, - 2132, 2144, 2156, 2168, 2180, 2192, 2204, 2216, - 2228, 2240, 2252, 2264, 2276, 2288, 2300, 2312, - 2324, 2336, 2348, 2360, 2372, 2384, 2396, 2408, - 2420, 2432, 2444, 2456, 2468, 2480, 2492, 2504, - 2516, 2528, 2540, 2552, 2564, 2576, 2588, 2600, - 2612, 2624, 2636, 2648, 2660, 2672, 2684, 2696, - 2708, 2720, 2732, 2744, 2756, 2768, 2780, 2792, - 2804, 2816, 2828, 2840, 2852, 2864, 2876, 2888, - 2900, 2912, 2924, 2936, 2948, 2960, 2972, 2984, - 2996, 3008, 3020, 3032, 3044, 3056, 3068, 3080, - 3092, 3104, 3116, 3128, 3140, 3152, 3164, 3176, - 3188, 3200, 3212, 3224, 3236, 3248, 3260, 3272, - 3284, 3296, 3308, 3320, 3332, 3344, 3356, 3368, - 3380, 3392, 3404, 3416, 3428, 3440, 3452, 3464, - 3476, 3488, 3500, 3512, 3524, 3536, 3548, 3560, - 3572, 3584, 3596, 3608, 3620, 3632, 3644, 3656, - 3668, 3680, 3692, 3704, 3716, 3728, 3740, 3752, - 3764, 3776, 3788, 3800, 3812, 3824, 3836, 3848, - 3860, 3872, 3884, 3896, 3908, 3920, 3932, 3944, - 3956, 3968, 3980, 3992, 4004, 4016, 4028, 4040, - 4052, 4064, 4076, 4088, 4100, 4112, 4124, 4136, - 4148, 4172, 4184, 4196, 4208, 4220, 4232, 4244, - 4256, 4268, 4280, 4292, 4304, 4316, 4328, 4340, - 4352, 4364, 4376, 4388, 4400, 4412, 4424, 4436, - 4448, 4460, 4472, 4484, 4496, 4508, 4520, 4532, - 4544, 4556, 4568, 4580, 4592, 4604, 4616, 4628, - 4640, 4652, 4664, 4676, 4688, 4700, 4712, 4724, - 4736, 4748, 4760, 4772, 4784, 4796, 4808, 4820, - 4832, 4844, 4856, 4868, 4880, 4892, 4904, 4916, - 4928, 4940, 4952, 4964, 4976, 4988, 5000, 5012, - 5024, 5036, 5048, 5060, 5072, 5084, 5096, 5108, - 5120, 5132, 5144, 5156, 5168, 5180, 5192, 5204, - 5216, 5228, 5240, 5252, 5264, 5276, 5288, 5300, - 5312, 5324, 5336, 5348, 5360, 5372, 5384, 5396, - 5408, 5420, 5432, 5444, 5456, 5468, 5480, 5492, - 5504, 5516, 5528, 5540, 5552, 5564, 5576, 5588, - 5600, 5612, 5624, 5636, 5648, 5660, 5672, 5684, - 5696, 5708, 5720, 5732, 5744, 5756, 5768, 5780, - 5792, 5804, 5816, 5828, 5840, 5852, 5864, 5876, - 5888, 5900, 5912, 5924, 5936, 5948, 5960, 5972, - 5984, 5996, 6008, 6020, 6032, 6044, 6056, 6068, - 6080, 6092, 6104, 6116, 6128, 6140, 6152, 6164, - 6176, 6188, 6200, 6212, 6224, 6236, 6248, 6260, - 6272, 6284, 6296, 6308, 6320, 6332, 6344, 6356, - 6368, 6380, 6392, 6404, 6416, 6428, 6440, 6452, - 6464, 6476, 6488, 6500, 6512, 6524, 6536, 6548, - 6560, 6572, 6584, 6596, 6608, 6620, 6632, 6644, - 6668, 6680, 6692, 6704, 6716, 6728, 6740, 6752, - 6764, 6776, 6788, 6800, 6812, 6824, 6836, 6848, - 6860, 6872, 6884, 6896, 6908, 6920, 6932, 6944, - 6956, 6968, 6980, 6992, 7004, 7016, 7028, 7040, - 7052, 7064, 7076, 7088, 7100, 7112, 7124, 7136, - 7148, 7160, 7172, 7184, 7196, 7208, 7220, 7232, - 7244, 7256, 7268, 7280, 7292, 7304, 7316, 7328, - 7340, 7352, 7364, 7376, 7388, 7400, 7412, 7424, - 7436, 7448, 7460, 7472, 7484, 7496, 7508, 7520, - 7532, 7544, 7556, 7568, 7580, 7592, 7604, 7616, - 7628, 7640, 7652, 7664, 7676, 7688, 7700, 7712, - 7724, 7736, 7748, 7760, 7772, 7784, 7796, 7808, - 7820, 7832, 7844, 7856, 7868, 7880, 7892, 7904, - 7916, 7928, 7940, 7952, 7964, 7976, 7988, 8000, - 8012, 8024, 8036, 8048, 8060, 8072, 8084, 8096, - 8108, 8120, 8132, 8144, 8156, 8168, 8180, 8192, - 8204, 8216, 8228, 8240, 8252, 8264, 8276, 8288, - 8300, 8312, 8324, 8336, 8348, 8360, 8372, 8384, - 8396, 8408, 8420, 8432, 8444, 8456, 8468, 8480, - 8492, 8504, 8516, 8528, 8540, 8552, 8564, 8576, - 8588, 8600, 8612, 8624, 8636, 8648, 8660, 8672, - 8684, 8696, 8708, 8720, 8732, 8744, 8756, 8768, - 8780, 8792, 8804, 8816, 8828, 8840, 8852, 8864, - 8876, 8888, 8900, 8912, 8924, 8936, 8948, 8960, - 8972, 8984, 8996, 9008, 9020, 9032, 9044, 9056, - 9068, 9080, 9092, 9104, 9116, 9128, 9140, 9164, - 9176, 9188, 9200, 9212, 9224, 9236, 9248, 9260, - 9272, 9284, 9296, 9308, 9320, 9332, 9344, 9356, - 9368, 9380, 9392, 9404, 9416, 9428, 9440, 9452, - 9464, 9476, 9488, 9500, 9512, 9524, 9536, 9548, - 9560, 9572, 9584, 9596, 9608, 9620, 9632, 9644, - 9656, 9668, 9680, 9692, 9704, 9716, 9728, 9740, - 9752, 9764, 9776, 9788, 9800, 9812, 9824, 9836, - 9848, 9860, 9872, 9884, 9896, 9908, 9920, 9932, - 9944, 9956, 9968, 9980, }, - /* 5 */ - {9, 21, 33, 45, 57, 69, 81, 93, - 105, 117, 129, 141, 153, 165, 177, 189, - 201, 213, 225, 237, 249, 261, 273, 285, - 297, 309, 321, 333, 345, 357, 369, 381, - 393, 405, 417, 429, 441, 453, 465, 477, - 489, 501, 513, 525, 537, 549, 561, 573, - 585, 597, 609, 621, 633, 645, 657, 669, - 681, 693, 705, 717, 729, 741, 753, 765, - 777, 789, 801, 813, 825, 837, 849, 861, - 873, 885, 897, 909, 921, 933, 945, 957, - 969, 981, 993, 1005, 1017, 1029, 1041, 1053, - 1065, 1077, 1089, 1101, 1113, 1125, 1137, 1149, - 1161, 1173, 1185, 1197, 1209, 1221, 1233, 1245, - 1257, 1269, 1281, 1293, 1305, 1317, 1329, 1341, - 1353, 1365, 1377, 1389, 1401, 1413, 1425, 1437, - 1449, 1461, 1473, 1485, 1497, 1509, 1521, 1533, - 1545, 1557, 1569, 1581, 1593, 1605, 1617, 1629, - 1641, 1653, 1677, 1689, 1701, 1713, 1725, 1737, - 1749, 1761, 1773, 1785, 1797, 1809, 1821, 1833, - 1845, 1857, 1869, 1881, 1893, 1905, 1917, 1929, - 1941, 1953, 1965, 1977, 1989, 2001, 2013, 2025, - 2037, 2049, 2061, 2073, 2085, 2097, 2109, 2121, - 2133, 2145, 2157, 2169, 2181, 2193, 2205, 2217, - 2229, 2241, 2253, 2265, 2277, 2289, 2301, 2313, - 2325, 2337, 2349, 2361, 2373, 2385, 2397, 2409, - 2421, 2433, 2445, 2457, 2469, 2481, 2493, 2505, - 2517, 2529, 2541, 2553, 2565, 2577, 2589, 2601, - 2613, 2625, 2637, 2649, 2661, 2673, 2685, 2697, - 2709, 2721, 2733, 2745, 2757, 2769, 2781, 2793, - 2805, 2817, 2829, 2841, 2853, 2865, 2877, 2889, - 2901, 2913, 2925, 2937, 2949, 2961, 2973, 2985, - 2997, 3009, 3021, 3033, 3045, 3057, 3069, 3081, - 3093, 3105, 3117, 3129, 3141, 3153, 3165, 3177, - 3189, 3201, 3213, 3225, 3237, 3249, 3261, 3273, - 3285, 3297, 3309, 3321, 3333, 3345, 3357, 3369, - 3381, 3393, 3405, 3417, 3429, 3441, 3453, 3465, - 3477, 3489, 3501, 3513, 3525, 3537, 3549, 3561, - 3573, 3585, 3597, 3609, 3621, 3633, 3645, 3657, - 3669, 3681, 3693, 3705, 3717, 3729, 3741, 3753, - 3765, 3777, 3789, 3801, 3813, 3825, 3837, 3849, - 3861, 3873, 3885, 3897, 3909, 3921, 3933, 3945, - 3957, 3969, 3981, 3993, 4005, 4017, 4029, 4041, - 4053, 4065, 4077, 4089, 4101, 4113, 4125, 4137, - 4149, 4173, 4185, 4197, 4209, 4221, 4233, 4245, - 4257, 4269, 4281, 4293, 4305, 4317, 4329, 4341, - 4353, 4365, 4377, 4389, 4401, 4413, 4425, 4437, - 4449, 4461, 4473, 4485, 4497, 4509, 4521, 4533, - 4545, 4557, 4569, 4581, 4593, 4605, 4617, 4629, - 4641, 4653, 4665, 4677, 4689, 4701, 4713, 4725, - 4737, 4749, 4761, 4773, 4785, 4797, 4809, 4821, - 4833, 4845, 4857, 4869, 4881, 4893, 4905, 4917, - 4929, 4941, 4953, 4965, 4977, 4989, 5001, 5013, - 5025, 5037, 5049, 5061, 5073, 5085, 5097, 5109, - 5121, 5133, 5145, 5157, 5169, 5181, 5193, 5205, - 5217, 5229, 5241, 5253, 5265, 5277, 5289, 5301, - 5313, 5325, 5337, 5349, 5361, 5373, 5385, 5397, - 5409, 5421, 5433, 5445, 5457, 5469, 5481, 5493, - 5505, 5517, 5529, 5541, 5553, 5565, 5577, 5589, - 5601, 5613, 5625, 5637, 5649, 5661, 5673, 5685, - 5697, 5709, 5721, 5733, 5745, 5757, 5769, 5781, - 5793, 5805, 5817, 5829, 5841, 5853, 5865, 5877, - 5889, 5901, 5913, 5925, 5937, 5949, 5961, 5973, - 5985, 5997, 6009, 6021, 6033, 6045, 6057, 6069, - 6081, 6093, 6105, 6117, 6129, 6141, 6153, 6165, - 6177, 6189, 6201, 6213, 6225, 6237, 6249, 6261, - 6273, 6285, 6297, 6309, 6321, 6333, 6345, 6357, - 6369, 6381, 6393, 6405, 6417, 6429, 6441, 6453, - 6465, 6477, 6489, 6501, 6513, 6525, 6537, 6549, - 6561, 6573, 6585, 6597, 6609, 6621, 6633, 6645, - 6669, 6681, 6693, 6705, 6717, 6729, 6741, 6753, - 6765, 6777, 6789, 6801, 6813, 6825, 6837, 6849, - 6861, 6873, 6885, 6897, 6909, 6921, 6933, 6945, - 6957, 6969, 6981, 6993, 7005, 7017, 7029, 7041, - 7053, 7065, 7077, 7089, 7101, 7113, 7125, 7137, - 7149, 7161, 7173, 7185, 7197, 7209, 7221, 7233, - 7245, 7257, 7269, 7281, 7293, 7305, 7317, 7329, - 7341, 7353, 7365, 7377, 7389, 7401, 7413, 7425, - 7437, 7449, 7461, 7473, 7485, 7497, 7509, 7521, - 7533, 7545, 7557, 7569, 7581, 7593, 7605, 7617, - 7629, 7641, 7653, 7665, 7677, 7689, 7701, 7713, - 7725, 7737, 7749, 7761, 7773, 7785, 7797, 7809, - 7821, 7833, 7845, 7857, 7869, 7881, 7893, 7905, - 7917, 7929, 7941, 7953, 7965, 7977, 7989, 8001, - 8013, 8025, 8037, 8049, 8061, 8073, 8085, 8097, - 8109, 8121, 8133, 8145, 8157, 8169, 8181, 8193, - 8205, 8217, 8229, 8241, 8253, 8265, 8277, 8289, - 8301, 8313, 8325, 8337, 8349, 8361, 8373, 8385, - 8397, 8409, 8421, 8433, 8445, 8457, 8469, 8481, - 8493, 8505, 8517, 8529, 8541, 8553, 8565, 8577, - 8589, 8601, 8613, 8625, 8637, 8649, 8661, 8673, - 8685, 8697, 8709, 8721, 8733, 8745, 8757, 8769, - 8781, 8793, 8805, 8817, 8829, 8841, 8853, 8865, - 8877, 8889, 8901, 8913, 8925, 8937, 8949, 8961, - 8973, 8985, 8997, 9009, 9021, 9033, 9045, 9057, - 9069, 9081, 9093, 9105, 9117, 9129, 9141, 9165, - 9177, 9189, 9201, 9213, 9225, 9237, 9249, 9261, - 9273, 9285, 9297, 9309, 9321, 9333, 9345, 9357, - 9369, 9381, 9393, 9405, 9417, 9429, 9441, 9453, - 9465, 9477, 9489, 9501, 9513, 9525, 9537, 9549, - 9561, 9573, 9585, 9597, 9609, 9621, 9633, 9645, - 9657, 9669, 9681, 9693, 9705, 9717, 9729, 9741, - 9753, 9765, 9777, 9789, 9801, 9813, 9825, 9837, - 9849, 9861, 9873, 9885, 9897, 9909, 9921, 9933, - 9945, 9957, 9969, 9981, }, - /* 6 */ - {10, 22, 34, 46, 58, 70, 82, 94, - 106, 118, 130, 142, 154, 166, 178, 190, - 202, 214, 226, 238, 250, 262, 274, 286, - 298, 310, 322, 334, 346, 358, 370, 382, - 394, 406, 418, 430, 442, 454, 466, 478, - 490, 502, 514, 526, 538, 550, 562, 574, - 586, 598, 610, 622, 634, 646, 658, 670, - 682, 694, 706, 718, 730, 742, 754, 766, - 778, 790, 802, 814, 826, 838, 850, 862, - 874, 886, 898, 910, 922, 934, 946, 958, - 970, 982, 994, 1006, 1018, 1030, 1042, 1054, - 1066, 1078, 1090, 1102, 1114, 1126, 1138, 1150, - 1162, 1174, 1186, 1198, 1210, 1222, 1234, 1246, - 1258, 1270, 1282, 1294, 1306, 1318, 1330, 1342, - 1354, 1366, 1378, 1390, 1402, 1414, 1426, 1438, - 1450, 1462, 1474, 1486, 1498, 1510, 1522, 1534, - 1546, 1558, 1570, 1582, 1594, 1606, 1618, 1630, - 1642, 1654, 1678, 1690, 1702, 1714, 1726, 1738, - 1750, 1762, 1774, 1786, 1798, 1810, 1822, 1834, - 1846, 1858, 1870, 1882, 1894, 1906, 1918, 1930, - 1942, 1954, 1966, 1978, 1990, 2002, 2014, 2026, - 2038, 2050, 2062, 2074, 2086, 2098, 2110, 2122, - 2134, 2146, 2158, 2170, 2182, 2194, 2206, 2218, - 2230, 2242, 2254, 2266, 2278, 2290, 2302, 2314, - 2326, 2338, 2350, 2362, 2374, 2386, 2398, 2410, - 2422, 2434, 2446, 2458, 2470, 2482, 2494, 2506, - 2518, 2530, 2542, 2554, 2566, 2578, 2590, 2602, - 2614, 2626, 2638, 2650, 2662, 2674, 2686, 2698, - 2710, 2722, 2734, 2746, 2758, 2770, 2782, 2794, - 2806, 2818, 2830, 2842, 2854, 2866, 2878, 2890, - 2902, 2914, 2926, 2938, 2950, 2962, 2974, 2986, - 2998, 3010, 3022, 3034, 3046, 3058, 3070, 3082, - 3094, 3106, 3118, 3130, 3142, 3154, 3166, 3178, - 3190, 3202, 3214, 3226, 3238, 3250, 3262, 3274, - 3286, 3298, 3310, 3322, 3334, 3346, 3358, 3370, - 3382, 3394, 3406, 3418, 3430, 3442, 3454, 3466, - 3478, 3490, 3502, 3514, 3526, 3538, 3550, 3562, - 3574, 3586, 3598, 3610, 3622, 3634, 3646, 3658, - 3670, 3682, 3694, 3706, 3718, 3730, 3742, 3754, - 3766, 3778, 3790, 3802, 3814, 3826, 3838, 3850, - 3862, 3874, 3886, 3898, 3910, 3922, 3934, 3946, - 3958, 3970, 3982, 3994, 4006, 4018, 4030, 4042, - 4054, 4066, 4078, 4090, 4102, 4114, 4126, 4138, - 4150, 4174, 4186, 4198, 4210, 4222, 4234, 4246, - 4258, 4270, 4282, 4294, 4306, 4318, 4330, 4342, - 4354, 4366, 4378, 4390, 4402, 4414, 4426, 4438, - 4450, 4462, 4474, 4486, 4498, 4510, 4522, 4534, - 4546, 4558, 4570, 4582, 4594, 4606, 4618, 4630, - 4642, 4654, 4666, 4678, 4690, 4702, 4714, 4726, - 4738, 4750, 4762, 4774, 4786, 4798, 4810, 4822, - 4834, 4846, 4858, 4870, 4882, 4894, 4906, 4918, - 4930, 4942, 4954, 4966, 4978, 4990, 5002, 5014, - 5026, 5038, 5050, 5062, 5074, 5086, 5098, 5110, - 5122, 5134, 5146, 5158, 5170, 5182, 5194, 5206, - 5218, 5230, 5242, 5254, 5266, 5278, 5290, 5302, - 5314, 5326, 5338, 5350, 5362, 5374, 5386, 5398, - 5410, 5422, 5434, 5446, 5458, 5470, 5482, 5494, - 5506, 5518, 5530, 5542, 5554, 5566, 5578, 5590, - 5602, 5614, 5626, 5638, 5650, 5662, 5674, 5686, - 5698, 5710, 5722, 5734, 5746, 5758, 5770, 5782, - 5794, 5806, 5818, 5830, 5842, 5854, 5866, 5878, - 5890, 5902, 5914, 5926, 5938, 5950, 5962, 5974, - 5986, 5998, 6010, 6022, 6034, 6046, 6058, 6070, - 6082, 6094, 6106, 6118, 6130, 6142, 6154, 6166, - 6178, 6190, 6202, 6214, 6226, 6238, 6250, 6262, - 6274, 6286, 6298, 6310, 6322, 6334, 6346, 6358, - 6370, 6382, 6394, 6406, 6418, 6430, 6442, 6454, - 6466, 6478, 6490, 6502, 6514, 6526, 6538, 6550, - 6562, 6574, 6586, 6598, 6610, 6622, 6634, 6646, - 6670, 6682, 6694, 6706, 6718, 6730, 6742, 6754, - 6766, 6778, 6790, 6802, 6814, 6826, 6838, 6850, - 6862, 6874, 6886, 6898, 6910, 6922, 6934, 6946, - 6958, 6970, 6982, 6994, 7006, 7018, 7030, 7042, - 7054, 7066, 7078, 7090, 7102, 7114, 7126, 7138, - 7150, 7162, 7174, 7186, 7198, 7210, 7222, 7234, - 7246, 7258, 7270, 7282, 7294, 7306, 7318, 7330, - 7342, 7354, 7366, 7378, 7390, 7402, 7414, 7426, - 7438, 7450, 7462, 7474, 7486, 7498, 7510, 7522, - 7534, 7546, 7558, 7570, 7582, 7594, 7606, 7618, - 7630, 7642, 7654, 7666, 7678, 7690, 7702, 7714, - 7726, 7738, 7750, 7762, 7774, 7786, 7798, 7810, - 7822, 7834, 7846, 7858, 7870, 7882, 7894, 7906, - 7918, 7930, 7942, 7954, 7966, 7978, 7990, 8002, - 8014, 8026, 8038, 8050, 8062, 8074, 8086, 8098, - 8110, 8122, 8134, 8146, 8158, 8170, 8182, 8194, - 8206, 8218, 8230, 8242, 8254, 8266, 8278, 8290, - 8302, 8314, 8326, 8338, 8350, 8362, 8374, 8386, - 8398, 8410, 8422, 8434, 8446, 8458, 8470, 8482, - 8494, 8506, 8518, 8530, 8542, 8554, 8566, 8578, - 8590, 8602, 8614, 8626, 8638, 8650, 8662, 8674, - 8686, 8698, 8710, 8722, 8734, 8746, 8758, 8770, - 8782, 8794, 8806, 8818, 8830, 8842, 8854, 8866, - 8878, 8890, 8902, 8914, 8926, 8938, 8950, 8962, - 8974, 8986, 8998, 9010, 9022, 9034, 9046, 9058, - 9070, 9082, 9094, 9106, 9118, 9130, 9142, 9166, - 9178, 9190, 9202, 9214, 9226, 9238, 9250, 9262, - 9274, 9286, 9298, 9310, 9322, 9334, 9346, 9358, - 9370, 9382, 9394, 9406, 9418, 9430, 9442, 9454, - 9466, 9478, 9490, 9502, 9514, 9526, 9538, 9550, - 9562, 9574, 9586, 9598, 9610, 9622, 9634, 9646, - 9658, 9670, 9682, 9694, 9706, 9718, 9730, 9742, - 9754, 9766, 9778, 9790, 9802, 9814, 9826, 9838, - 9850, 9862, 9874, 9886, 9898, 9910, 9922, 9934, - 9946, 9958, 9970, 9982, }, - /* 7 */ - {11, 23, 35, 47, 59, 71, 83, 95, - 107, 119, 131, 143, 155, 167, 179, 191, - 203, 215, 227, 239, 251, 263, 275, 287, - 299, 311, 323, 335, 347, 359, 371, 383, - 395, 407, 419, 431, 443, 455, 467, 479, - 491, 503, 515, 527, 539, 551, 563, 575, - 587, 599, 611, 623, 635, 647, 659, 671, - 683, 695, 707, 719, 731, 743, 755, 767, - 779, 791, 803, 815, 827, 839, 851, 863, - 875, 887, 899, 911, 923, 935, 947, 959, - 971, 983, 995, 1007, 1019, 1031, 1043, 1055, - 1067, 1079, 1091, 1103, 1115, 1127, 1139, 1151, - 1163, 1175, 1187, 1199, 1211, 1223, 1235, 1247, - 1259, 1271, 1283, 1295, 1307, 1319, 1331, 1343, - 1355, 1367, 1379, 1391, 1403, 1415, 1427, 1439, - 1451, 1463, 1475, 1487, 1499, 1511, 1523, 1535, - 1547, 1559, 1571, 1583, 1595, 1607, 1619, 1631, - 1643, 1655, 1679, 1691, 1703, 1715, 1727, 1739, - 1751, 1763, 1775, 1787, 1799, 1811, 1823, 1835, - 1847, 1859, 1871, 1883, 1895, 1907, 1919, 1931, - 1943, 1955, 1967, 1979, 1991, 2003, 2015, 2027, - 2039, 2051, 2063, 2075, 2087, 2099, 2111, 2123, - 2135, 2147, 2159, 2171, 2183, 2195, 2207, 2219, - 2231, 2243, 2255, 2267, 2279, 2291, 2303, 2315, - 2327, 2339, 2351, 2363, 2375, 2387, 2399, 2411, - 2423, 2435, 2447, 2459, 2471, 2483, 2495, 2507, - 2519, 2531, 2543, 2555, 2567, 2579, 2591, 2603, - 2615, 2627, 2639, 2651, 2663, 2675, 2687, 2699, - 2711, 2723, 2735, 2747, 2759, 2771, 2783, 2795, - 2807, 2819, 2831, 2843, 2855, 2867, 2879, 2891, - 2903, 2915, 2927, 2939, 2951, 2963, 2975, 2987, - 2999, 3011, 3023, 3035, 3047, 3059, 3071, 3083, - 3095, 3107, 3119, 3131, 3143, 3155, 3167, 3179, - 3191, 3203, 3215, 3227, 3239, 3251, 3263, 3275, - 3287, 3299, 3311, 3323, 3335, 3347, 3359, 3371, - 3383, 3395, 3407, 3419, 3431, 3443, 3455, 3467, - 3479, 3491, 3503, 3515, 3527, 3539, 3551, 3563, - 3575, 3587, 3599, 3611, 3623, 3635, 3647, 3659, - 3671, 3683, 3695, 3707, 3719, 3731, 3743, 3755, - 3767, 3779, 3791, 3803, 3815, 3827, 3839, 3851, - 3863, 3875, 3887, 3899, 3911, 3923, 3935, 3947, - 3959, 3971, 3983, 3995, 4007, 4019, 4031, 4043, - 4055, 4067, 4079, 4091, 4103, 4115, 4127, 4139, - 4151, 4175, 4187, 4199, 4211, 4223, 4235, 4247, - 4259, 4271, 4283, 4295, 4307, 4319, 4331, 4343, - 4355, 4367, 4379, 4391, 4403, 4415, 4427, 4439, - 4451, 4463, 4475, 4487, 4499, 4511, 4523, 4535, - 4547, 4559, 4571, 4583, 4595, 4607, 4619, 4631, - 4643, 4655, 4667, 4679, 4691, 4703, 4715, 4727, - 4739, 4751, 4763, 4775, 4787, 4799, 4811, 4823, - 4835, 4847, 4859, 4871, 4883, 4895, 4907, 4919, - 4931, 4943, 4955, 4967, 4979, 4991, 5003, 5015, - 5027, 5039, 5051, 5063, 5075, 5087, 5099, 5111, - 5123, 5135, 5147, 5159, 5171, 5183, 5195, 5207, - 5219, 5231, 5243, 5255, 5267, 5279, 5291, 5303, - 5315, 5327, 5339, 5351, 5363, 5375, 5387, 5399, - 5411, 5423, 5435, 5447, 5459, 5471, 5483, 5495, - 5507, 5519, 5531, 5543, 5555, 5567, 5579, 5591, - 5603, 5615, 5627, 5639, 5651, 5663, 5675, 5687, - 5699, 5711, 5723, 5735, 5747, 5759, 5771, 5783, - 5795, 5807, 5819, 5831, 5843, 5855, 5867, 5879, - 5891, 5903, 5915, 5927, 5939, 5951, 5963, 5975, - 5987, 5999, 6011, 6023, 6035, 6047, 6059, 6071, - 6083, 6095, 6107, 6119, 6131, 6143, 6155, 6167, - 6179, 6191, 6203, 6215, 6227, 6239, 6251, 6263, - 6275, 6287, 6299, 6311, 6323, 6335, 6347, 6359, - 6371, 6383, 6395, 6407, 6419, 6431, 6443, 6455, - 6467, 6479, 6491, 6503, 6515, 6527, 6539, 6551, - 6563, 6575, 6587, 6599, 6611, 6623, 6635, 6647, - 6671, 6683, 6695, 6707, 6719, 6731, 6743, 6755, - 6767, 6779, 6791, 6803, 6815, 6827, 6839, 6851, - 6863, 6875, 6887, 6899, 6911, 6923, 6935, 6947, - 6959, 6971, 6983, 6995, 7007, 7019, 7031, 7043, - 7055, 7067, 7079, 7091, 7103, 7115, 7127, 7139, - 7151, 7163, 7175, 7187, 7199, 7211, 7223, 7235, - 7247, 7259, 7271, 7283, 7295, 7307, 7319, 7331, - 7343, 7355, 7367, 7379, 7391, 7403, 7415, 7427, - 7439, 7451, 7463, 7475, 7487, 7499, 7511, 7523, - 7535, 7547, 7559, 7571, 7583, 7595, 7607, 7619, - 7631, 7643, 7655, 7667, 7679, 7691, 7703, 7715, - 7727, 7739, 7751, 7763, 7775, 7787, 7799, 7811, - 7823, 7835, 7847, 7859, 7871, 7883, 7895, 7907, - 7919, 7931, 7943, 7955, 7967, 7979, 7991, 8003, - 8015, 8027, 8039, 8051, 8063, 8075, 8087, 8099, - 8111, 8123, 8135, 8147, 8159, 8171, 8183, 8195, - 8207, 8219, 8231, 8243, 8255, 8267, 8279, 8291, - 8303, 8315, 8327, 8339, 8351, 8363, 8375, 8387, - 8399, 8411, 8423, 8435, 8447, 8459, 8471, 8483, - 8495, 8507, 8519, 8531, 8543, 8555, 8567, 8579, - 8591, 8603, 8615, 8627, 8639, 8651, 8663, 8675, - 8687, 8699, 8711, 8723, 8735, 8747, 8759, 8771, - 8783, 8795, 8807, 8819, 8831, 8843, 8855, 8867, - 8879, 8891, 8903, 8915, 8927, 8939, 8951, 8963, - 8975, 8987, 8999, 9011, 9023, 9035, 9047, 9059, - 9071, 9083, 9095, 9107, 9119, 9131, 9143, 9167, - 9179, 9191, 9203, 9215, 9227, 9239, 9251, 9263, - 9275, 9287, 9299, 9311, 9323, 9335, 9347, 9359, - 9371, 9383, 9395, 9407, 9419, 9431, 9443, 9455, - 9467, 9479, 9491, 9503, 9515, 9527, 9539, 9551, - 9563, 9575, 9587, 9599, 9611, 9623, 9635, 9647, - 9659, 9671, 9683, 9695, 9707, 9719, 9731, 9743, - 9755, 9767, 9779, 9791, 9803, 9815, 9827, 9839, - 9851, 9863, 9875, 9887, 9899, 9911, 9923, 9935, - 9947, 9959, 9971, 9983, }, - /* 8 */ - {12, 24, 36, 48, 60, 72, 84, 96, - 108, 120, 132, 144, 156, 168, 180, 192, - 204, 216, 228, 240, 252, 264, 276, 288, - 300, 312, 324, 336, 348, 360, 372, 384, - 396, 408, 420, 432, 444, 456, 468, 480, - 492, 504, 516, 528, 540, 552, 564, 576, - 588, 600, 612, 624, 636, 648, 660, 672, - 684, 696, 708, 720, 732, 744, 756, 768, - 780, 792, 804, 816, 828, 840, 852, 864, - 876, 888, 900, 912, 924, 936, 948, 960, - 972, 984, 996, 1008, 1020, 1032, 1044, 1056, - 1068, 1080, 1092, 1104, 1116, 1128, 1140, 1152, - 1164, 1176, 1188, 1200, 1212, 1224, 1236, 1248, - 1260, 1272, 1284, 1296, 1308, 1320, 1332, 1344, - 1356, 1368, 1380, 1392, 1404, 1416, 1428, 1440, - 1452, 1464, 1476, 1488, 1500, 1512, 1524, 1536, - 1548, 1560, 1572, 1584, 1596, 1608, 1620, 1632, - 1644, 1656, 1668, 1680, 1692, 1704, 1716, 1728, - 1740, 1752, 1764, 1776, 1788, 1800, 1812, 1824, - 1836, 1848, 1860, 1872, 1884, 1896, 1908, 1920, - 1932, 1944, 1956, 1968, 1980, 1992, 2004, 2016, - 2028, 2040, 2052, 2064, 2076, 2088, 2100, 2112, - 2124, 2136, 2148, 2160, 2172, 2184, 2196, 2208, - 2220, 2232, 2244, 2256, 2268, 2280, 2292, 2304, - 2316, 2328, 2340, 2352, 2364, 2376, 2388, 2400, - 2412, 2424, 2436, 2448, 2460, 2472, 2484, 2508, - 2520, 2532, 2544, 2556, 2568, 2580, 2592, 2604, - 2616, 2628, 2640, 2652, 2664, 2676, 2688, 2700, - 2712, 2724, 2736, 2748, 2760, 2772, 2784, 2796, - 2808, 2820, 2832, 2844, 2856, 2868, 2880, 2892, - 2904, 2916, 2928, 2940, 2952, 2964, 2976, 2988, - 3000, 3012, 3024, 3036, 3048, 3060, 3072, 3084, - 3096, 3108, 3120, 3132, 3144, 3156, 3168, 3180, - 3192, 3204, 3216, 3228, 3240, 3252, 3264, 3276, - 3288, 3300, 3312, 3324, 3336, 3348, 3360, 3372, - 3384, 3396, 3408, 3420, 3432, 3444, 3456, 3468, - 3480, 3492, 3504, 3516, 3528, 3540, 3552, 3564, - 3576, 3588, 3600, 3612, 3624, 3636, 3648, 3660, - 3672, 3684, 3696, 3708, 3720, 3732, 3744, 3756, - 3768, 3780, 3792, 3804, 3816, 3828, 3840, 3852, - 3864, 3876, 3888, 3900, 3912, 3924, 3936, 3948, - 3960, 3972, 3984, 3996, 4008, 4020, 4032, 4044, - 4056, 4068, 4080, 4092, 4104, 4116, 4128, 4140, - 4152, 4164, 4176, 4188, 4200, 4212, 4224, 4236, - 4248, 4260, 4272, 4284, 4296, 4308, 4320, 4332, - 4344, 4356, 4368, 4380, 4392, 4404, 4416, 4428, - 4440, 4452, 4464, 4476, 4488, 4500, 4512, 4524, - 4536, 4548, 4560, 4572, 4584, 4596, 4608, 4620, - 4632, 4644, 4656, 4668, 4680, 4692, 4704, 4716, - 4728, 4740, 4752, 4764, 4776, 4788, 4800, 4812, - 4824, 4836, 4848, 4860, 4872, 4884, 4896, 4908, - 4920, 4932, 4944, 4956, 4968, 4980, 5004, 5016, - 5028, 5040, 5052, 5064, 5076, 5088, 5100, 5112, - 5124, 5136, 5148, 5160, 5172, 5184, 5196, 5208, - 5220, 5232, 5244, 5256, 5268, 5280, 5292, 5304, - 5316, 5328, 5340, 5352, 5364, 5376, 5388, 5400, - 5412, 5424, 5436, 5448, 5460, 5472, 5484, 5496, - 5508, 5520, 5532, 5544, 5556, 5568, 5580, 5592, - 5604, 5616, 5628, 5640, 5652, 5664, 5676, 5688, - 5700, 5712, 5724, 5736, 5748, 5760, 5772, 5784, - 5796, 5808, 5820, 5832, 5844, 5856, 5868, 5880, - 5892, 5904, 5916, 5928, 5940, 5952, 5964, 5976, - 5988, 6000, 6012, 6024, 6036, 6048, 6060, 6072, - 6084, 6096, 6108, 6120, 6132, 6144, 6156, 6168, - 6180, 6192, 6204, 6216, 6228, 6240, 6252, 6264, - 6276, 6288, 6300, 6312, 6324, 6336, 6348, 6360, - 6372, 6384, 6396, 6408, 6420, 6432, 6444, 6456, - 6468, 6480, 6492, 6504, 6516, 6528, 6540, 6552, - 6564, 6576, 6588, 6600, 6612, 6624, 6636, 6648, - 6660, 6672, 6684, 6696, 6708, 6720, 6732, 6744, - 6756, 6768, 6780, 6792, 6804, 6816, 6828, 6840, - 6852, 6864, 6876, 6888, 6900, 6912, 6924, 6936, - 6948, 6960, 6972, 6984, 6996, 7008, 7020, 7032, - 7044, 7056, 7068, 7080, 7092, 7104, 7116, 7128, - 7140, 7152, 7164, 7176, 7188, 7200, 7212, 7224, - 7236, 7248, 7260, 7272, 7284, 7296, 7308, 7320, - 7332, 7344, 7356, 7368, 7380, 7392, 7404, 7416, - 7428, 7440, 7452, 7464, 7476, 7500, 7512, 7524, - 7536, 7548, 7560, 7572, 7584, 7596, 7608, 7620, - 7632, 7644, 7656, 7668, 7680, 7692, 7704, 7716, - 7728, 7740, 7752, 7764, 7776, 7788, 7800, 7812, - 7824, 7836, 7848, 7860, 7872, 7884, 7896, 7908, - 7920, 7932, 7944, 7956, 7968, 7980, 7992, 8004, - 8016, 8028, 8040, 8052, 8064, 8076, 8088, 8100, - 8112, 8124, 8136, 8148, 8160, 8172, 8184, 8196, - 8208, 8220, 8232, 8244, 8256, 8268, 8280, 8292, - 8304, 8316, 8328, 8340, 8352, 8364, 8376, 8388, - 8400, 8412, 8424, 8436, 8448, 8460, 8472, 8484, - 8496, 8508, 8520, 8532, 8544, 8556, 8568, 8580, - 8592, 8604, 8616, 8628, 8640, 8652, 8664, 8676, - 8688, 8700, 8712, 8724, 8736, 8748, 8760, 8772, - 8784, 8796, 8808, 8820, 8832, 8844, 8856, 8868, - 8880, 8892, 8904, 8916, 8928, 8940, 8952, 8964, - 8976, 8988, 9000, 9012, 9024, 9036, 9048, 9060, - 9072, 9084, 9096, 9108, 9120, 9132, 9144, 9156, - 9168, 9180, 9192, 9204, 9216, 9228, 9240, 9252, - 9264, 9276, 9288, 9300, 9312, 9324, 9336, 9348, - 9360, 9372, 9384, 9396, 9408, 9420, 9432, 9444, - 9456, 9468, 9480, 9492, 9504, 9516, 9528, 9540, - 9552, 9564, 9576, 9588, 9600, 9612, 9624, 9636, - 9648, 9660, 9672, 9684, 9696, 9708, 9720, 9732, - 9744, 9756, 9768, 9780, 9792, 9804, 9816, 9828, - 9840, 9852, 9864, 9876, 9888, 9900, 9912, 9924, - 9936, 9948, 9960, 9972, }, - /* 9 */ - {13, 25, 37, 49, 61, 73, 85, 97, - 109, 121, 133, 145, 157, 169, 181, 193, - 205, 217, 229, 241, 253, 265, 277, 289, - 301, 313, 325, 337, 349, 361, 373, 385, - 397, 409, 421, 433, 445, 457, 469, 481, - 493, 505, 517, 529, 541, 553, 565, 577, - 589, 601, 613, 625, 637, 649, 661, 673, - 685, 697, 709, 721, 733, 745, 757, 769, - 781, 793, 805, 817, 829, 841, 853, 865, - 877, 889, 901, 913, 925, 937, 949, 961, - 973, 985, 997, 1009, 1021, 1033, 1045, 1057, - 1069, 1081, 1093, 1105, 1117, 1129, 1141, 1153, - 1165, 1177, 1189, 1201, 1213, 1225, 1237, 1249, - 1261, 1273, 1285, 1297, 1309, 1321, 1333, 1345, - 1357, 1369, 1381, 1393, 1405, 1417, 1429, 1441, - 1453, 1465, 1477, 1489, 1501, 1513, 1525, 1537, - 1549, 1561, 1573, 1585, 1597, 1609, 1621, 1633, - 1645, 1657, 1669, 1681, 1693, 1705, 1717, 1729, - 1741, 1753, 1765, 1777, 1789, 1801, 1813, 1825, - 1837, 1849, 1861, 1873, 1885, 1897, 1909, 1921, - 1933, 1945, 1957, 1969, 1981, 1993, 2005, 2017, - 2029, 2041, 2053, 2065, 2077, 2089, 2101, 2113, - 2125, 2137, 2149, 2161, 2173, 2185, 2197, 2209, - 2221, 2233, 2245, 2257, 2269, 2281, 2293, 2305, - 2317, 2329, 2341, 2353, 2365, 2377, 2389, 2401, - 2413, 2425, 2437, 2449, 2461, 2473, 2485, 2509, - 2521, 2533, 2545, 2557, 2569, 2581, 2593, 2605, - 2617, 2629, 2641, 2653, 2665, 2677, 2689, 2701, - 2713, 2725, 2737, 2749, 2761, 2773, 2785, 2797, - 2809, 2821, 2833, 2845, 2857, 2869, 2881, 2893, - 2905, 2917, 2929, 2941, 2953, 2965, 2977, 2989, - 3001, 3013, 3025, 3037, 3049, 3061, 3073, 3085, - 3097, 3109, 3121, 3133, 3145, 3157, 3169, 3181, - 3193, 3205, 3217, 3229, 3241, 3253, 3265, 3277, - 3289, 3301, 3313, 3325, 3337, 3349, 3361, 3373, - 3385, 3397, 3409, 3421, 3433, 3445, 3457, 3469, - 3481, 3493, 3505, 3517, 3529, 3541, 3553, 3565, - 3577, 3589, 3601, 3613, 3625, 3637, 3649, 3661, - 3673, 3685, 3697, 3709, 3721, 3733, 3745, 3757, - 3769, 3781, 3793, 3805, 3817, 3829, 3841, 3853, - 3865, 3877, 3889, 3901, 3913, 3925, 3937, 3949, - 3961, 3973, 3985, 3997, 4009, 4021, 4033, 4045, - 4057, 4069, 4081, 4093, 4105, 4117, 4129, 4141, - 4153, 4165, 4177, 4189, 4201, 4213, 4225, 4237, - 4249, 4261, 4273, 4285, 4297, 4309, 4321, 4333, - 4345, 4357, 4369, 4381, 4393, 4405, 4417, 4429, - 4441, 4453, 4465, 4477, 4489, 4501, 4513, 4525, - 4537, 4549, 4561, 4573, 4585, 4597, 4609, 4621, - 4633, 4645, 4657, 4669, 4681, 4693, 4705, 4717, - 4729, 4741, 4753, 4765, 4777, 4789, 4801, 4813, - 4825, 4837, 4849, 4861, 4873, 4885, 4897, 4909, - 4921, 4933, 4945, 4957, 4969, 4981, 5005, 5017, - 5029, 5041, 5053, 5065, 5077, 5089, 5101, 5113, - 5125, 5137, 5149, 5161, 5173, 5185, 5197, 5209, - 5221, 5233, 5245, 5257, 5269, 5281, 5293, 5305, - 5317, 5329, 5341, 5353, 5365, 5377, 5389, 5401, - 5413, 5425, 5437, 5449, 5461, 5473, 5485, 5497, - 5509, 5521, 5533, 5545, 5557, 5569, 5581, 5593, - 5605, 5617, 5629, 5641, 5653, 5665, 5677, 5689, - 5701, 5713, 5725, 5737, 5749, 5761, 5773, 5785, - 5797, 5809, 5821, 5833, 5845, 5857, 5869, 5881, - 5893, 5905, 5917, 5929, 5941, 5953, 5965, 5977, - 5989, 6001, 6013, 6025, 6037, 6049, 6061, 6073, - 6085, 6097, 6109, 6121, 6133, 6145, 6157, 6169, - 6181, 6193, 6205, 6217, 6229, 6241, 6253, 6265, - 6277, 6289, 6301, 6313, 6325, 6337, 6349, 6361, - 6373, 6385, 6397, 6409, 6421, 6433, 6445, 6457, - 6469, 6481, 6493, 6505, 6517, 6529, 6541, 6553, - 6565, 6577, 6589, 6601, 6613, 6625, 6637, 6649, - 6661, 6673, 6685, 6697, 6709, 6721, 6733, 6745, - 6757, 6769, 6781, 6793, 6805, 6817, 6829, 6841, - 6853, 6865, 6877, 6889, 6901, 6913, 6925, 6937, - 6949, 6961, 6973, 6985, 6997, 7009, 7021, 7033, - 7045, 7057, 7069, 7081, 7093, 7105, 7117, 7129, - 7141, 7153, 7165, 7177, 7189, 7201, 7213, 7225, - 7237, 7249, 7261, 7273, 7285, 7297, 7309, 7321, - 7333, 7345, 7357, 7369, 7381, 7393, 7405, 7417, - 7429, 7441, 7453, 7465, 7477, 7501, 7513, 7525, - 7537, 7549, 7561, 7573, 7585, 7597, 7609, 7621, - 7633, 7645, 7657, 7669, 7681, 7693, 7705, 7717, - 7729, 7741, 7753, 7765, 7777, 7789, 7801, 7813, - 7825, 7837, 7849, 7861, 7873, 7885, 7897, 7909, - 7921, 7933, 7945, 7957, 7969, 7981, 7993, 8005, - 8017, 8029, 8041, 8053, 8065, 8077, 8089, 8101, - 8113, 8125, 8137, 8149, 8161, 8173, 8185, 8197, - 8209, 8221, 8233, 8245, 8257, 8269, 8281, 8293, - 8305, 8317, 8329, 8341, 8353, 8365, 8377, 8389, - 8401, 8413, 8425, 8437, 8449, 8461, 8473, 8485, - 8497, 8509, 8521, 8533, 8545, 8557, 8569, 8581, - 8593, 8605, 8617, 8629, 8641, 8653, 8665, 8677, - 8689, 8701, 8713, 8725, 8737, 8749, 8761, 8773, - 8785, 8797, 8809, 8821, 8833, 8845, 8857, 8869, - 8881, 8893, 8905, 8917, 8929, 8941, 8953, 8965, - 8977, 8989, 9001, 9013, 9025, 9037, 9049, 9061, - 9073, 9085, 9097, 9109, 9121, 9133, 9145, 9157, - 9169, 9181, 9193, 9205, 9217, 9229, 9241, 9253, - 9265, 9277, 9289, 9301, 9313, 9325, 9337, 9349, - 9361, 9373, 9385, 9397, 9409, 9421, 9433, 9445, - 9457, 9469, 9481, 9493, 9505, 9517, 9529, 9541, - 9553, 9565, 9577, 9589, 9601, 9613, 9625, 9637, - 9649, 9661, 9673, 9685, 9697, 9709, 9721, 9733, - 9745, 9757, 9769, 9781, 9793, 9805, 9817, 9829, - 9841, 9853, 9865, 9877, 9889, 9901, 9913, 9925, - 9937, 9949, 9961, 9973, }, - /* 10 */ - {14, 26, 38, 50, 62, 74, 86, 98, - 110, 122, 134, 146, 158, 170, 182, 194, - 206, 218, 230, 242, 254, 266, 278, 290, - 302, 314, 326, 338, 350, 362, 374, 386, - 398, 410, 422, 434, 446, 458, 470, 482, - 494, 506, 518, 530, 542, 554, 566, 578, - 590, 602, 614, 626, 638, 650, 662, 674, - 686, 698, 710, 722, 734, 746, 758, 770, - 782, 794, 806, 818, 830, 842, 854, 866, - 878, 890, 902, 914, 926, 938, 950, 962, - 974, 986, 998, 1010, 1022, 1034, 1046, 1058, - 1070, 1082, 1094, 1106, 1118, 1130, 1142, 1154, - 1166, 1178, 1190, 1202, 1214, 1226, 1238, 1250, - 1262, 1274, 1286, 1298, 1310, 1322, 1334, 1346, - 1358, 1370, 1382, 1394, 1406, 1418, 1430, 1442, - 1454, 1466, 1478, 1490, 1502, 1514, 1526, 1538, - 1550, 1562, 1574, 1586, 1598, 1610, 1622, 1634, - 1646, 1658, 1670, 1682, 1694, 1706, 1718, 1730, - 1742, 1754, 1766, 1778, 1790, 1802, 1814, 1826, - 1838, 1850, 1862, 1874, 1886, 1898, 1910, 1922, - 1934, 1946, 1958, 1970, 1982, 1994, 2006, 2018, - 2030, 2042, 2054, 2066, 2078, 2090, 2102, 2114, - 2126, 2138, 2150, 2162, 2174, 2186, 2198, 2210, - 2222, 2234, 2246, 2258, 2270, 2282, 2294, 2306, - 2318, 2330, 2342, 2354, 2366, 2378, 2390, 2402, - 2414, 2426, 2438, 2450, 2462, 2474, 2486, 2510, - 2522, 2534, 2546, 2558, 2570, 2582, 2594, 2606, - 2618, 2630, 2642, 2654, 2666, 2678, 2690, 2702, - 2714, 2726, 2738, 2750, 2762, 2774, 2786, 2798, - 2810, 2822, 2834, 2846, 2858, 2870, 2882, 2894, - 2906, 2918, 2930, 2942, 2954, 2966, 2978, 2990, - 3002, 3014, 3026, 3038, 3050, 3062, 3074, 3086, - 3098, 3110, 3122, 3134, 3146, 3158, 3170, 3182, - 3194, 3206, 3218, 3230, 3242, 3254, 3266, 3278, - 3290, 3302, 3314, 3326, 3338, 3350, 3362, 3374, - 3386, 3398, 3410, 3422, 3434, 3446, 3458, 3470, - 3482, 3494, 3506, 3518, 3530, 3542, 3554, 3566, - 3578, 3590, 3602, 3614, 3626, 3638, 3650, 3662, - 3674, 3686, 3698, 3710, 3722, 3734, 3746, 3758, - 3770, 3782, 3794, 3806, 3818, 3830, 3842, 3854, - 3866, 3878, 3890, 3902, 3914, 3926, 3938, 3950, - 3962, 3974, 3986, 3998, 4010, 4022, 4034, 4046, - 4058, 4070, 4082, 4094, 4106, 4118, 4130, 4142, - 4154, 4166, 4178, 4190, 4202, 4214, 4226, 4238, - 4250, 4262, 4274, 4286, 4298, 4310, 4322, 4334, - 4346, 4358, 4370, 4382, 4394, 4406, 4418, 4430, - 4442, 4454, 4466, 4478, 4490, 4502, 4514, 4526, - 4538, 4550, 4562, 4574, 4586, 4598, 4610, 4622, - 4634, 4646, 4658, 4670, 4682, 4694, 4706, 4718, - 4730, 4742, 4754, 4766, 4778, 4790, 4802, 4814, - 4826, 4838, 4850, 4862, 4874, 4886, 4898, 4910, - 4922, 4934, 4946, 4958, 4970, 4982, 5006, 5018, - 5030, 5042, 5054, 5066, 5078, 5090, 5102, 5114, - 5126, 5138, 5150, 5162, 5174, 5186, 5198, 5210, - 5222, 5234, 5246, 5258, 5270, 5282, 5294, 5306, - 5318, 5330, 5342, 5354, 5366, 5378, 5390, 5402, - 5414, 5426, 5438, 5450, 5462, 5474, 5486, 5498, - 5510, 5522, 5534, 5546, 5558, 5570, 5582, 5594, - 5606, 5618, 5630, 5642, 5654, 5666, 5678, 5690, - 5702, 5714, 5726, 5738, 5750, 5762, 5774, 5786, - 5798, 5810, 5822, 5834, 5846, 5858, 5870, 5882, - 5894, 5906, 5918, 5930, 5942, 5954, 5966, 5978, - 5990, 6002, 6014, 6026, 6038, 6050, 6062, 6074, - 6086, 6098, 6110, 6122, 6134, 6146, 6158, 6170, - 6182, 6194, 6206, 6218, 6230, 6242, 6254, 6266, - 6278, 6290, 6302, 6314, 6326, 6338, 6350, 6362, - 6374, 6386, 6398, 6410, 6422, 6434, 6446, 6458, - 6470, 6482, 6494, 6506, 6518, 6530, 6542, 6554, - 6566, 6578, 6590, 6602, 6614, 6626, 6638, 6650, - 6662, 6674, 6686, 6698, 6710, 6722, 6734, 6746, - 6758, 6770, 6782, 6794, 6806, 6818, 6830, 6842, - 6854, 6866, 6878, 6890, 6902, 6914, 6926, 6938, - 6950, 6962, 6974, 6986, 6998, 7010, 7022, 7034, - 7046, 7058, 7070, 7082, 7094, 7106, 7118, 7130, - 7142, 7154, 7166, 7178, 7190, 7202, 7214, 7226, - 7238, 7250, 7262, 7274, 7286, 7298, 7310, 7322, - 7334, 7346, 7358, 7370, 7382, 7394, 7406, 7418, - 7430, 7442, 7454, 7466, 7478, 7502, 7514, 7526, - 7538, 7550, 7562, 7574, 7586, 7598, 7610, 7622, - 7634, 7646, 7658, 7670, 7682, 7694, 7706, 7718, - 7730, 7742, 7754, 7766, 7778, 7790, 7802, 7814, - 7826, 7838, 7850, 7862, 7874, 7886, 7898, 7910, - 7922, 7934, 7946, 7958, 7970, 7982, 7994, 8006, - 8018, 8030, 8042, 8054, 8066, 8078, 8090, 8102, - 8114, 8126, 8138, 8150, 8162, 8174, 8186, 8198, - 8210, 8222, 8234, 8246, 8258, 8270, 8282, 8294, - 8306, 8318, 8330, 8342, 8354, 8366, 8378, 8390, - 8402, 8414, 8426, 8438, 8450, 8462, 8474, 8486, - 8498, 8510, 8522, 8534, 8546, 8558, 8570, 8582, - 8594, 8606, 8618, 8630, 8642, 8654, 8666, 8678, - 8690, 8702, 8714, 8726, 8738, 8750, 8762, 8774, - 8786, 8798, 8810, 8822, 8834, 8846, 8858, 8870, - 8882, 8894, 8906, 8918, 8930, 8942, 8954, 8966, - 8978, 8990, 9002, 9014, 9026, 9038, 9050, 9062, - 9074, 9086, 9098, 9110, 9122, 9134, 9146, 9158, - 9170, 9182, 9194, 9206, 9218, 9230, 9242, 9254, - 9266, 9278, 9290, 9302, 9314, 9326, 9338, 9350, - 9362, 9374, 9386, 9398, 9410, 9422, 9434, 9446, - 9458, 9470, 9482, 9494, 9506, 9518, 9530, 9542, - 9554, 9566, 9578, 9590, 9602, 9614, 9626, 9638, - 9650, 9662, 9674, 9686, 9698, 9710, 9722, 9734, - 9746, 9758, 9770, 9782, 9794, 9806, 9818, 9830, - 9842, 9854, 9866, 9878, 9890, 9902, 9914, 9926, - 9938, 9950, 9962, 9974, }, - /* 11 */ - {15, 27, 39, 51, 63, 75, 87, 99, - 111, 123, 135, 147, 159, 171, 183, 195, - 207, 219, 231, 243, 255, 267, 279, 291, - 303, 315, 327, 339, 351, 363, 375, 387, - 399, 411, 423, 435, 447, 459, 471, 483, - 495, 507, 519, 531, 543, 555, 567, 579, - 591, 603, 615, 627, 639, 651, 663, 675, - 687, 699, 711, 723, 735, 747, 759, 771, - 783, 795, 807, 819, 831, 843, 855, 867, - 879, 891, 903, 915, 927, 939, 951, 963, - 975, 987, 999, 1011, 1023, 1035, 1047, 1059, - 1071, 1083, 1095, 1107, 1119, 1131, 1143, 1155, - 1167, 1179, 1191, 1203, 1215, 1227, 1239, 1251, - 1263, 1275, 1287, 1299, 1311, 1323, 1335, 1347, - 1359, 1371, 1383, 1395, 1407, 1419, 1431, 1443, - 1455, 1467, 1479, 1491, 1503, 1515, 1527, 1539, - 1551, 1563, 1575, 1587, 1599, 1611, 1623, 1635, - 1647, 1659, 1671, 1683, 1695, 1707, 1719, 1731, - 1743, 1755, 1767, 1779, 1791, 1803, 1815, 1827, - 1839, 1851, 1863, 1875, 1887, 1899, 1911, 1923, - 1935, 1947, 1959, 1971, 1983, 1995, 2007, 2019, - 2031, 2043, 2055, 2067, 2079, 2091, 2103, 2115, - 2127, 2139, 2151, 2163, 2175, 2187, 2199, 2211, - 2223, 2235, 2247, 2259, 2271, 2283, 2295, 2307, - 2319, 2331, 2343, 2355, 2367, 2379, 2391, 2403, - 2415, 2427, 2439, 2451, 2463, 2475, 2487, 2511, - 2523, 2535, 2547, 2559, 2571, 2583, 2595, 2607, - 2619, 2631, 2643, 2655, 2667, 2679, 2691, 2703, - 2715, 2727, 2739, 2751, 2763, 2775, 2787, 2799, - 2811, 2823, 2835, 2847, 2859, 2871, 2883, 2895, - 2907, 2919, 2931, 2943, 2955, 2967, 2979, 2991, - 3003, 3015, 3027, 3039, 3051, 3063, 3075, 3087, - 3099, 3111, 3123, 3135, 3147, 3159, 3171, 3183, - 3195, 3207, 3219, 3231, 3243, 3255, 3267, 3279, - 3291, 3303, 3315, 3327, 3339, 3351, 3363, 3375, - 3387, 3399, 3411, 3423, 3435, 3447, 3459, 3471, - 3483, 3495, 3507, 3519, 3531, 3543, 3555, 3567, - 3579, 3591, 3603, 3615, 3627, 3639, 3651, 3663, - 3675, 3687, 3699, 3711, 3723, 3735, 3747, 3759, - 3771, 3783, 3795, 3807, 3819, 3831, 3843, 3855, - 3867, 3879, 3891, 3903, 3915, 3927, 3939, 3951, - 3963, 3975, 3987, 3999, 4011, 4023, 4035, 4047, - 4059, 4071, 4083, 4095, 4107, 4119, 4131, 4143, - 4155, 4167, 4179, 4191, 4203, 4215, 4227, 4239, - 4251, 4263, 4275, 4287, 4299, 4311, 4323, 4335, - 4347, 4359, 4371, 4383, 4395, 4407, 4419, 4431, - 4443, 4455, 4467, 4479, 4491, 4503, 4515, 4527, - 4539, 4551, 4563, 4575, 4587, 4599, 4611, 4623, - 4635, 4647, 4659, 4671, 4683, 4695, 4707, 4719, - 4731, 4743, 4755, 4767, 4779, 4791, 4803, 4815, - 4827, 4839, 4851, 4863, 4875, 4887, 4899, 4911, - 4923, 4935, 4947, 4959, 4971, 4983, 5007, 5019, - 5031, 5043, 5055, 5067, 5079, 5091, 5103, 5115, - 5127, 5139, 5151, 5163, 5175, 5187, 5199, 5211, - 5223, 5235, 5247, 5259, 5271, 5283, 5295, 5307, - 5319, 5331, 5343, 5355, 5367, 5379, 5391, 5403, - 5415, 5427, 5439, 5451, 5463, 5475, 5487, 5499, - 5511, 5523, 5535, 5547, 5559, 5571, 5583, 5595, - 5607, 5619, 5631, 5643, 5655, 5667, 5679, 5691, - 5703, 5715, 5727, 5739, 5751, 5763, 5775, 5787, - 5799, 5811, 5823, 5835, 5847, 5859, 5871, 5883, - 5895, 5907, 5919, 5931, 5943, 5955, 5967, 5979, - 5991, 6003, 6015, 6027, 6039, 6051, 6063, 6075, - 6087, 6099, 6111, 6123, 6135, 6147, 6159, 6171, - 6183, 6195, 6207, 6219, 6231, 6243, 6255, 6267, - 6279, 6291, 6303, 6315, 6327, 6339, 6351, 6363, - 6375, 6387, 6399, 6411, 6423, 6435, 6447, 6459, - 6471, 6483, 6495, 6507, 6519, 6531, 6543, 6555, - 6567, 6579, 6591, 6603, 6615, 6627, 6639, 6651, - 6663, 6675, 6687, 6699, 6711, 6723, 6735, 6747, - 6759, 6771, 6783, 6795, 6807, 6819, 6831, 6843, - 6855, 6867, 6879, 6891, 6903, 6915, 6927, 6939, - 6951, 6963, 6975, 6987, 6999, 7011, 7023, 7035, - 7047, 7059, 7071, 7083, 7095, 7107, 7119, 7131, - 7143, 7155, 7167, 7179, 7191, 7203, 7215, 7227, - 7239, 7251, 7263, 7275, 7287, 7299, 7311, 7323, - 7335, 7347, 7359, 7371, 7383, 7395, 7407, 7419, - 7431, 7443, 7455, 7467, 7479, 7503, 7515, 7527, - 7539, 7551, 7563, 7575, 7587, 7599, 7611, 7623, - 7635, 7647, 7659, 7671, 7683, 7695, 7707, 7719, - 7731, 7743, 7755, 7767, 7779, 7791, 7803, 7815, - 7827, 7839, 7851, 7863, 7875, 7887, 7899, 7911, - 7923, 7935, 7947, 7959, 7971, 7983, 7995, 8007, - 8019, 8031, 8043, 8055, 8067, 8079, 8091, 8103, - 8115, 8127, 8139, 8151, 8163, 8175, 8187, 8199, - 8211, 8223, 8235, 8247, 8259, 8271, 8283, 8295, - 8307, 8319, 8331, 8343, 8355, 8367, 8379, 8391, - 8403, 8415, 8427, 8439, 8451, 8463, 8475, 8487, - 8499, 8511, 8523, 8535, 8547, 8559, 8571, 8583, - 8595, 8607, 8619, 8631, 8643, 8655, 8667, 8679, - 8691, 8703, 8715, 8727, 8739, 8751, 8763, 8775, - 8787, 8799, 8811, 8823, 8835, 8847, 8859, 8871, - 8883, 8895, 8907, 8919, 8931, 8943, 8955, 8967, - 8979, 8991, 9003, 9015, 9027, 9039, 9051, 9063, - 9075, 9087, 9099, 9111, 9123, 9135, 9147, 9159, - 9171, 9183, 9195, 9207, 9219, 9231, 9243, 9255, - 9267, 9279, 9291, 9303, 9315, 9327, 9339, 9351, - 9363, 9375, 9387, 9399, 9411, 9423, 9435, 9447, - 9459, 9471, 9483, 9495, 9507, 9519, 9531, 9543, - 9555, 9567, 9579, 9591, 9603, 9615, 9627, 9639, - 9651, 9663, 9675, 9687, 9699, 9711, 9723, 9735, - 9747, 9759, 9771, 9783, 9795, 9807, 9819, 9831, - 9843, 9855, 9867, 9879, 9891, 9903, 9915, 9927, - 9939, 9951, 9963, 9975, }, + /* 0 */ + { + 4, 16, 28, 40, 52, 64, 76, 88, 100, 112, 124, 136, 148, + 160, 172, 184, 196, 208, 220, 232, 244, 256, 268, 280, 292, 304, + 316, 328, 340, 352, 364, 376, 388, 400, 412, 424, 436, 448, 460, + 472, 484, 496, 508, 520, 532, 544, 556, 568, 580, 592, 604, 616, + 628, 640, 652, 664, 676, 688, 700, 712, 724, 736, 748, 760, 772, + 784, 796, 808, 820, 844, 856, 868, 880, 892, 904, 916, 928, 940, + 952, 964, 976, 988, 1000, 1012, 1024, 1036, 1048, 1060, 1072, 1084, 1096, + 1108, 1120, 1132, 1144, 1156, 1168, 1180, 1192, 1204, 1216, 1228, 1240, 1252, + 1264, 1276, 1288, 1300, 1312, 1324, 1336, 1348, 1360, 1372, 1384, 1396, 1408, + 1420, 1432, 1444, 1456, 1468, 1480, 1492, 1504, 1516, 1528, 1540, 1552, 1564, + 1576, 1588, 1600, 1612, 1624, 1636, 1648, 1660, 1672, 1684, 1696, 1708, 1720, + 1732, 1744, 1756, 1768, 1780, 1792, 1804, 1816, 1828, 1840, 1852, 1864, 1876, + 1888, 1900, 1912, 1924, 1936, 1948, 1960, 1972, 1984, 1996, 2008, 2020, 2032, + 2044, 2056, 2068, 2080, 2092, 2104, 2116, 2128, 2140, 2152, 2164, 2176, 2188, + 2200, 2212, 2224, 2236, 2248, 2260, 2272, 2284, 2296, 2308, 2320, 2332, 2344, + 2356, 2368, 2380, 2392, 2404, 2416, 2428, 2440, 2452, 2464, 2476, 2488, 2500, + 2512, 2524, 2536, 2548, 2560, 2572, 2584, 2596, 2608, 2620, 2632, 2644, 2656, + 2668, 2680, 2692, 2704, 2716, 2728, 2740, 2752, 2764, 2776, 2788, 2800, 2812, + 2824, 2836, 2848, 2860, 2872, 2884, 2896, 2908, 2920, 2932, 2944, 2956, 2968, + 2980, 2992, 3004, 3016, 3028, 3040, 3052, 3064, 3076, 3088, 3100, 3112, 3124, + 3136, 3148, 3160, 3172, 3184, 3196, 3208, 3220, 3232, 3244, 3256, 3268, 3280, + 3292, 3304, 3316, 3340, 3352, 3364, 3376, 3388, 3400, 3412, 3424, 3436, 3448, + 3460, 3472, 3484, 3496, 3508, 3520, 3532, 3544, 3556, 3568, 3580, 3592, 3604, + 3616, 3628, 3640, 3652, 3664, 3676, 3688, 3700, 3712, 3724, 3736, 3748, 3760, + 3772, 3784, 3796, 3808, 3820, 3832, 3844, 3856, 3868, 3880, 3892, 3904, 3916, + 3928, 3940, 3952, 3964, 3976, 3988, 4000, 4012, 4024, 4036, 4048, 4060, 4072, + 4084, 4096, 4108, 4120, 4132, 4144, 4156, 4168, 4180, 4192, 4204, 4216, 4228, + 4240, 4252, 4264, 4276, 4288, 4300, 4312, 4324, 4336, 4348, 4360, 4372, 4384, + 4396, 4408, 4420, 4432, 4444, 4456, 4468, 4480, 4492, 4504, 4516, 4528, 4540, + 4552, 4564, 4576, 4588, 4600, 4612, 4624, 4636, 4648, 4660, 4672, 4684, 4696, + 4708, 4720, 4732, 4744, 4756, 4768, 4780, 4792, 4804, 4816, 4828, 4840, 4852, + 4864, 4876, 4888, 4900, 4912, 4924, 4936, 4948, 4960, 4972, 4984, 4996, 5008, + 5020, 5032, 5044, 5056, 5068, 5080, 5092, 5104, 5116, 5128, 5140, 5152, 5164, + 5176, 5188, 5200, 5212, 5224, 5236, 5248, 5260, 5272, 5284, 5296, 5308, 5320, + 5332, 5344, 5356, 5368, 5380, 5392, 5404, 5416, 5428, 5440, 5452, 5464, 5476, + 5488, 5500, 5512, 5524, 5536, 5548, 5560, 5572, 5584, 5596, 5608, 5620, 5632, + 5644, 5656, 5668, 5680, 5692, 5704, 5716, 5728, 5740, 5752, 5764, 5776, 5788, + 5800, 5812, 5836, 5848, 5860, 5872, 5884, 5896, 5908, 5920, 5932, 5944, 5956, + 5968, 5980, 5992, 6004, 6016, 6028, 6040, 6052, 6064, 6076, 6088, 6100, 6112, + 6124, 6136, 6148, 6160, 6172, 6184, 6196, 6208, 6220, 6232, 6244, 6256, 6268, + 6280, 6292, 6304, 6316, 6328, 6340, 6352, 6364, 6376, 6388, 6400, 6412, 6424, + 6436, 6448, 6460, 6472, 6484, 6496, 6508, 6520, 6532, 6544, 6556, 6568, 6580, + 6592, 6604, 6616, 6628, 6640, 6652, 6664, 6676, 6688, 6700, 6712, 6724, 6736, + 6748, 6760, 6772, 6784, 6796, 6808, 6820, 6832, 6844, 6856, 6868, 6880, 6892, + 6904, 6916, 6928, 6940, 6952, 6964, 6976, 6988, 7000, 7012, 7024, 7036, 7048, + 7060, 7072, 7084, 7096, 7108, 7120, 7132, 7144, 7156, 7168, 7180, 7192, 7204, + 7216, 7228, 7240, 7252, 7264, 7276, 7288, 7300, 7312, 7324, 7336, 7348, 7360, + 7372, 7384, 7396, 7408, 7420, 7432, 7444, 7456, 7468, 7480, 7492, 7504, 7516, + 7528, 7540, 7552, 7564, 7576, 7588, 7600, 7612, 7624, 7636, 7648, 7660, 7672, + 7684, 7696, 7708, 7720, 7732, 7744, 7756, 7768, 7780, 7792, 7804, 7816, 7828, + 7840, 7852, 7864, 7876, 7888, 7900, 7912, 7924, 7936, 7948, 7960, 7972, 7984, + 7996, 8008, 8020, 8032, 8044, 8056, 8068, 8080, 8092, 8104, 8116, 8128, 8140, + 8152, 8164, 8176, 8188, 8200, 8212, 8224, 8236, 8248, 8260, 8272, 8284, 8296, + 8308, 8332, 8344, 8356, 8368, 8380, 8392, 8404, 8416, 8428, 8440, 8452, 8464, + 8476, 8488, 8500, 8512, 8524, 8536, 8548, 8560, 8572, 8584, 8596, 8608, 8620, + 8632, 8644, 8656, 8668, 8680, 8692, 8704, 8716, 8728, 8740, 8752, 8764, 8776, + 8788, 8800, 8812, 8824, 8836, 8848, 8860, 8872, 8884, 8896, 8908, 8920, 8932, + 8944, 8956, 8968, 8980, 8992, 9004, 9016, 9028, 9040, 9052, 9064, 9076, 9088, + 9100, 9112, 9124, 9136, 9148, 9160, 9172, 9184, 9196, 9208, 9220, 9232, 9244, + 9256, 9268, 9280, 9292, 9304, 9316, 9328, 9340, 9352, 9364, 9376, 9388, 9400, + 9412, 9424, 9436, 9448, 9460, 9472, 9484, 9496, 9508, 9520, 9532, 9544, 9556, + 9568, 9580, 9592, 9604, 9616, 9628, 9640, 9652, 9664, 9676, 9688, 9700, 9712, + 9724, 9736, 9748, 9760, 9772, 9784, 9796, 9808, 9820, 9832, 9844, 9856, 9868, + 9880, 9892, 9904, 9916, 9928, 9940, 9952, 9964, 9976, + }, + /* 1 */ + { + 5, 17, 29, 41, 53, 65, 77, 89, 101, 113, 125, 137, 149, + 161, 173, 185, 197, 209, 221, 233, 245, 257, 269, 281, 293, 305, + 317, 329, 341, 353, 365, 377, 389, 401, 413, 425, 437, 449, 461, + 473, 485, 497, 509, 521, 533, 545, 557, 569, 581, 593, 605, 617, + 629, 641, 653, 665, 677, 689, 701, 713, 725, 737, 749, 761, 773, + 785, 797, 809, 821, 845, 857, 869, 881, 893, 905, 917, 929, 941, + 953, 965, 977, 989, 1001, 1013, 1025, 1037, 1049, 1061, 1073, 1085, 1097, + 1109, 1121, 1133, 1145, 1157, 1169, 1181, 1193, 1205, 1217, 1229, 1241, 1253, + 1265, 1277, 1289, 1301, 1313, 1325, 1337, 1349, 1361, 1373, 1385, 1397, 1409, + 1421, 1433, 1445, 1457, 1469, 1481, 1493, 1505, 1517, 1529, 1541, 1553, 1565, + 1577, 1589, 1601, 1613, 1625, 1637, 1649, 1661, 1673, 1685, 1697, 1709, 1721, + 1733, 1745, 1757, 1769, 1781, 1793, 1805, 1817, 1829, 1841, 1853, 1865, 1877, + 1889, 1901, 1913, 1925, 1937, 1949, 1961, 1973, 1985, 1997, 2009, 2021, 2033, + 2045, 2057, 2069, 2081, 2093, 2105, 2117, 2129, 2141, 2153, 2165, 2177, 2189, + 2201, 2213, 2225, 2237, 2249, 2261, 2273, 2285, 2297, 2309, 2321, 2333, 2345, + 2357, 2369, 2381, 2393, 2405, 2417, 2429, 2441, 2453, 2465, 2477, 2489, 2501, + 2513, 2525, 2537, 2549, 2561, 2573, 2585, 2597, 2609, 2621, 2633, 2645, 2657, + 2669, 2681, 2693, 2705, 2717, 2729, 2741, 2753, 2765, 2777, 2789, 2801, 2813, + 2825, 2837, 2849, 2861, 2873, 2885, 2897, 2909, 2921, 2933, 2945, 2957, 2969, + 2981, 2993, 3005, 3017, 3029, 3041, 3053, 3065, 3077, 3089, 3101, 3113, 3125, + 3137, 3149, 3161, 3173, 3185, 3197, 3209, 3221, 3233, 3245, 3257, 3269, 3281, + 3293, 3305, 3317, 3341, 3353, 3365, 3377, 3389, 3401, 3413, 3425, 3437, 3449, + 3461, 3473, 3485, 3497, 3509, 3521, 3533, 3545, 3557, 3569, 3581, 3593, 3605, + 3617, 3629, 3641, 3653, 3665, 3677, 3689, 3701, 3713, 3725, 3737, 3749, 3761, + 3773, 3785, 3797, 3809, 3821, 3833, 3845, 3857, 3869, 3881, 3893, 3905, 3917, + 3929, 3941, 3953, 3965, 3977, 3989, 4001, 4013, 4025, 4037, 4049, 4061, 4073, + 4085, 4097, 4109, 4121, 4133, 4145, 4157, 4169, 4181, 4193, 4205, 4217, 4229, + 4241, 4253, 4265, 4277, 4289, 4301, 4313, 4325, 4337, 4349, 4361, 4373, 4385, + 4397, 4409, 4421, 4433, 4445, 4457, 4469, 4481, 4493, 4505, 4517, 4529, 4541, + 4553, 4565, 4577, 4589, 4601, 4613, 4625, 4637, 4649, 4661, 4673, 4685, 4697, + 4709, 4721, 4733, 4745, 4757, 4769, 4781, 4793, 4805, 4817, 4829, 4841, 4853, + 4865, 4877, 4889, 4901, 4913, 4925, 4937, 4949, 4961, 4973, 4985, 4997, 5009, + 5021, 5033, 5045, 5057, 5069, 5081, 5093, 5105, 5117, 5129, 5141, 5153, 5165, + 5177, 5189, 5201, 5213, 5225, 5237, 5249, 5261, 5273, 5285, 5297, 5309, 5321, + 5333, 5345, 5357, 5369, 5381, 5393, 5405, 5417, 5429, 5441, 5453, 5465, 5477, + 5489, 5501, 5513, 5525, 5537, 5549, 5561, 5573, 5585, 5597, 5609, 5621, 5633, + 5645, 5657, 5669, 5681, 5693, 5705, 5717, 5729, 5741, 5753, 5765, 5777, 5789, + 5801, 5813, 5837, 5849, 5861, 5873, 5885, 5897, 5909, 5921, 5933, 5945, 5957, + 5969, 5981, 5993, 6005, 6017, 6029, 6041, 6053, 6065, 6077, 6089, 6101, 6113, + 6125, 6137, 6149, 6161, 6173, 6185, 6197, 6209, 6221, 6233, 6245, 6257, 6269, + 6281, 6293, 6305, 6317, 6329, 6341, 6353, 6365, 6377, 6389, 6401, 6413, 6425, + 6437, 6449, 6461, 6473, 6485, 6497, 6509, 6521, 6533, 6545, 6557, 6569, 6581, + 6593, 6605, 6617, 6629, 6641, 6653, 6665, 6677, 6689, 6701, 6713, 6725, 6737, + 6749, 6761, 6773, 6785, 6797, 6809, 6821, 6833, 6845, 6857, 6869, 6881, 6893, + 6905, 6917, 6929, 6941, 6953, 6965, 6977, 6989, 7001, 7013, 7025, 7037, 7049, + 7061, 7073, 7085, 7097, 7109, 7121, 7133, 7145, 7157, 7169, 7181, 7193, 7205, + 7217, 7229, 7241, 7253, 7265, 7277, 7289, 7301, 7313, 7325, 7337, 7349, 7361, + 7373, 7385, 7397, 7409, 7421, 7433, 7445, 7457, 7469, 7481, 7493, 7505, 7517, + 7529, 7541, 7553, 7565, 7577, 7589, 7601, 7613, 7625, 7637, 7649, 7661, 7673, + 7685, 7697, 7709, 7721, 7733, 7745, 7757, 7769, 7781, 7793, 7805, 7817, 7829, + 7841, 7853, 7865, 7877, 7889, 7901, 7913, 7925, 7937, 7949, 7961, 7973, 7985, + 7997, 8009, 8021, 8033, 8045, 8057, 8069, 8081, 8093, 8105, 8117, 8129, 8141, + 8153, 8165, 8177, 8189, 8201, 8213, 8225, 8237, 8249, 8261, 8273, 8285, 8297, + 8309, 8333, 8345, 8357, 8369, 8381, 8393, 8405, 8417, 8429, 8441, 8453, 8465, + 8477, 8489, 8501, 8513, 8525, 8537, 8549, 8561, 8573, 8585, 8597, 8609, 8621, + 8633, 8645, 8657, 8669, 8681, 8693, 8705, 8717, 8729, 8741, 8753, 8765, 8777, + 8789, 8801, 8813, 8825, 8837, 8849, 8861, 8873, 8885, 8897, 8909, 8921, 8933, + 8945, 8957, 8969, 8981, 8993, 9005, 9017, 9029, 9041, 9053, 9065, 9077, 9089, + 9101, 9113, 9125, 9137, 9149, 9161, 9173, 9185, 9197, 9209, 9221, 9233, 9245, + 9257, 9269, 9281, 9293, 9305, 9317, 9329, 9341, 9353, 9365, 9377, 9389, 9401, + 9413, 9425, 9437, 9449, 9461, 9473, 9485, 9497, 9509, 9521, 9533, 9545, 9557, + 9569, 9581, 9593, 9605, 9617, 9629, 9641, 9653, 9665, 9677, 9689, 9701, 9713, + 9725, 9737, 9749, 9761, 9773, 9785, 9797, 9809, 9821, 9833, 9845, 9857, 9869, + 9881, 9893, 9905, 9917, 9929, 9941, 9953, 9965, 9977, + }, + /* 2 */ + { + 6, 18, 30, 42, 54, 66, 78, 90, 102, 114, 126, 138, 150, + 162, 174, 186, 198, 210, 222, 234, 246, 258, 270, 282, 294, 306, + 318, 330, 342, 354, 366, 378, 390, 402, 414, 426, 438, 450, 462, + 474, 486, 498, 510, 522, 534, 546, 558, 570, 582, 594, 606, 618, + 630, 642, 654, 666, 678, 690, 702, 714, 726, 738, 750, 762, 774, + 786, 798, 810, 822, 846, 858, 870, 882, 894, 906, 918, 930, 942, + 954, 966, 978, 990, 1002, 1014, 1026, 1038, 1050, 1062, 1074, 1086, 1098, + 1110, 1122, 1134, 1146, 1158, 1170, 1182, 1194, 1206, 1218, 1230, 1242, 1254, + 1266, 1278, 1290, 1302, 1314, 1326, 1338, 1350, 1362, 1374, 1386, 1398, 1410, + 1422, 1434, 1446, 1458, 1470, 1482, 1494, 1506, 1518, 1530, 1542, 1554, 1566, + 1578, 1590, 1602, 1614, 1626, 1638, 1650, 1662, 1674, 1686, 1698, 1710, 1722, + 1734, 1746, 1758, 1770, 1782, 1794, 1806, 1818, 1830, 1842, 1854, 1866, 1878, + 1890, 1902, 1914, 1926, 1938, 1950, 1962, 1974, 1986, 1998, 2010, 2022, 2034, + 2046, 2058, 2070, 2082, 2094, 2106, 2118, 2130, 2142, 2154, 2166, 2178, 2190, + 2202, 2214, 2226, 2238, 2250, 2262, 2274, 2286, 2298, 2310, 2322, 2334, 2346, + 2358, 2370, 2382, 2394, 2406, 2418, 2430, 2442, 2454, 2466, 2478, 2490, 2502, + 2514, 2526, 2538, 2550, 2562, 2574, 2586, 2598, 2610, 2622, 2634, 2646, 2658, + 2670, 2682, 2694, 2706, 2718, 2730, 2742, 2754, 2766, 2778, 2790, 2802, 2814, + 2826, 2838, 2850, 2862, 2874, 2886, 2898, 2910, 2922, 2934, 2946, 2958, 2970, + 2982, 2994, 3006, 3018, 3030, 3042, 3054, 3066, 3078, 3090, 3102, 3114, 3126, + 3138, 3150, 3162, 3174, 3186, 3198, 3210, 3222, 3234, 3246, 3258, 3270, 3282, + 3294, 3306, 3318, 3342, 3354, 3366, 3378, 3390, 3402, 3414, 3426, 3438, 3450, + 3462, 3474, 3486, 3498, 3510, 3522, 3534, 3546, 3558, 3570, 3582, 3594, 3606, + 3618, 3630, 3642, 3654, 3666, 3678, 3690, 3702, 3714, 3726, 3738, 3750, 3762, + 3774, 3786, 3798, 3810, 3822, 3834, 3846, 3858, 3870, 3882, 3894, 3906, 3918, + 3930, 3942, 3954, 3966, 3978, 3990, 4002, 4014, 4026, 4038, 4050, 4062, 4074, + 4086, 4098, 4110, 4122, 4134, 4146, 4158, 4170, 4182, 4194, 4206, 4218, 4230, + 4242, 4254, 4266, 4278, 4290, 4302, 4314, 4326, 4338, 4350, 4362, 4374, 4386, + 4398, 4410, 4422, 4434, 4446, 4458, 4470, 4482, 4494, 4506, 4518, 4530, 4542, + 4554, 4566, 4578, 4590, 4602, 4614, 4626, 4638, 4650, 4662, 4674, 4686, 4698, + 4710, 4722, 4734, 4746, 4758, 4770, 4782, 4794, 4806, 4818, 4830, 4842, 4854, + 4866, 4878, 4890, 4902, 4914, 4926, 4938, 4950, 4962, 4974, 4986, 4998, 5010, + 5022, 5034, 5046, 5058, 5070, 5082, 5094, 5106, 5118, 5130, 5142, 5154, 5166, + 5178, 5190, 5202, 5214, 5226, 5238, 5250, 5262, 5274, 5286, 5298, 5310, 5322, + 5334, 5346, 5358, 5370, 5382, 5394, 5406, 5418, 5430, 5442, 5454, 5466, 5478, + 5490, 5502, 5514, 5526, 5538, 5550, 5562, 5574, 5586, 5598, 5610, 5622, 5634, + 5646, 5658, 5670, 5682, 5694, 5706, 5718, 5730, 5742, 5754, 5766, 5778, 5790, + 5802, 5814, 5838, 5850, 5862, 5874, 5886, 5898, 5910, 5922, 5934, 5946, 5958, + 5970, 5982, 5994, 6006, 6018, 6030, 6042, 6054, 6066, 6078, 6090, 6102, 6114, + 6126, 6138, 6150, 6162, 6174, 6186, 6198, 6210, 6222, 6234, 6246, 6258, 6270, + 6282, 6294, 6306, 6318, 6330, 6342, 6354, 6366, 6378, 6390, 6402, 6414, 6426, + 6438, 6450, 6462, 6474, 6486, 6498, 6510, 6522, 6534, 6546, 6558, 6570, 6582, + 6594, 6606, 6618, 6630, 6642, 6654, 6666, 6678, 6690, 6702, 6714, 6726, 6738, + 6750, 6762, 6774, 6786, 6798, 6810, 6822, 6834, 6846, 6858, 6870, 6882, 6894, + 6906, 6918, 6930, 6942, 6954, 6966, 6978, 6990, 7002, 7014, 7026, 7038, 7050, + 7062, 7074, 7086, 7098, 7110, 7122, 7134, 7146, 7158, 7170, 7182, 7194, 7206, + 7218, 7230, 7242, 7254, 7266, 7278, 7290, 7302, 7314, 7326, 7338, 7350, 7362, + 7374, 7386, 7398, 7410, 7422, 7434, 7446, 7458, 7470, 7482, 7494, 7506, 7518, + 7530, 7542, 7554, 7566, 7578, 7590, 7602, 7614, 7626, 7638, 7650, 7662, 7674, + 7686, 7698, 7710, 7722, 7734, 7746, 7758, 7770, 7782, 7794, 7806, 7818, 7830, + 7842, 7854, 7866, 7878, 7890, 7902, 7914, 7926, 7938, 7950, 7962, 7974, 7986, + 7998, 8010, 8022, 8034, 8046, 8058, 8070, 8082, 8094, 8106, 8118, 8130, 8142, + 8154, 8166, 8178, 8190, 8202, 8214, 8226, 8238, 8250, 8262, 8274, 8286, 8298, + 8310, 8334, 8346, 8358, 8370, 8382, 8394, 8406, 8418, 8430, 8442, 8454, 8466, + 8478, 8490, 8502, 8514, 8526, 8538, 8550, 8562, 8574, 8586, 8598, 8610, 8622, + 8634, 8646, 8658, 8670, 8682, 8694, 8706, 8718, 8730, 8742, 8754, 8766, 8778, + 8790, 8802, 8814, 8826, 8838, 8850, 8862, 8874, 8886, 8898, 8910, 8922, 8934, + 8946, 8958, 8970, 8982, 8994, 9006, 9018, 9030, 9042, 9054, 9066, 9078, 9090, + 9102, 9114, 9126, 9138, 9150, 9162, 9174, 9186, 9198, 9210, 9222, 9234, 9246, + 9258, 9270, 9282, 9294, 9306, 9318, 9330, 9342, 9354, 9366, 9378, 9390, 9402, + 9414, 9426, 9438, 9450, 9462, 9474, 9486, 9498, 9510, 9522, 9534, 9546, 9558, + 9570, 9582, 9594, 9606, 9618, 9630, 9642, 9654, 9666, 9678, 9690, 9702, 9714, + 9726, 9738, 9750, 9762, 9774, 9786, 9798, 9810, 9822, 9834, 9846, 9858, 9870, + 9882, 9894, 9906, 9918, 9930, 9942, 9954, 9966, 9978, + }, + /* 3 */ + { + 7, 19, 31, 43, 55, 67, 79, 91, 103, 115, 127, 139, 151, + 163, 175, 187, 199, 211, 223, 235, 247, 259, 271, 283, 295, 307, + 319, 331, 343, 355, 367, 379, 391, 403, 415, 427, 439, 451, 463, + 475, 487, 499, 511, 523, 535, 547, 559, 571, 583, 595, 607, 619, + 631, 643, 655, 667, 679, 691, 703, 715, 727, 739, 751, 763, 775, + 787, 799, 811, 823, 847, 859, 871, 883, 895, 907, 919, 931, 943, + 955, 967, 979, 991, 1003, 1015, 1027, 1039, 1051, 1063, 1075, 1087, 1099, + 1111, 1123, 1135, 1147, 1159, 1171, 1183, 1195, 1207, 1219, 1231, 1243, 1255, + 1267, 1279, 1291, 1303, 1315, 1327, 1339, 1351, 1363, 1375, 1387, 1399, 1411, + 1423, 1435, 1447, 1459, 1471, 1483, 1495, 1507, 1519, 1531, 1543, 1555, 1567, + 1579, 1591, 1603, 1615, 1627, 1639, 1651, 1663, 1675, 1687, 1699, 1711, 1723, + 1735, 1747, 1759, 1771, 1783, 1795, 1807, 1819, 1831, 1843, 1855, 1867, 1879, + 1891, 1903, 1915, 1927, 1939, 1951, 1963, 1975, 1987, 1999, 2011, 2023, 2035, + 2047, 2059, 2071, 2083, 2095, 2107, 2119, 2131, 2143, 2155, 2167, 2179, 2191, + 2203, 2215, 2227, 2239, 2251, 2263, 2275, 2287, 2299, 2311, 2323, 2335, 2347, + 2359, 2371, 2383, 2395, 2407, 2419, 2431, 2443, 2455, 2467, 2479, 2491, 2503, + 2515, 2527, 2539, 2551, 2563, 2575, 2587, 2599, 2611, 2623, 2635, 2647, 2659, + 2671, 2683, 2695, 2707, 2719, 2731, 2743, 2755, 2767, 2779, 2791, 2803, 2815, + 2827, 2839, 2851, 2863, 2875, 2887, 2899, 2911, 2923, 2935, 2947, 2959, 2971, + 2983, 2995, 3007, 3019, 3031, 3043, 3055, 3067, 3079, 3091, 3103, 3115, 3127, + 3139, 3151, 3163, 3175, 3187, 3199, 3211, 3223, 3235, 3247, 3259, 3271, 3283, + 3295, 3307, 3319, 3343, 3355, 3367, 3379, 3391, 3403, 3415, 3427, 3439, 3451, + 3463, 3475, 3487, 3499, 3511, 3523, 3535, 3547, 3559, 3571, 3583, 3595, 3607, + 3619, 3631, 3643, 3655, 3667, 3679, 3691, 3703, 3715, 3727, 3739, 3751, 3763, + 3775, 3787, 3799, 3811, 3823, 3835, 3847, 3859, 3871, 3883, 3895, 3907, 3919, + 3931, 3943, 3955, 3967, 3979, 3991, 4003, 4015, 4027, 4039, 4051, 4063, 4075, + 4087, 4099, 4111, 4123, 4135, 4147, 4159, 4171, 4183, 4195, 4207, 4219, 4231, + 4243, 4255, 4267, 4279, 4291, 4303, 4315, 4327, 4339, 4351, 4363, 4375, 4387, + 4399, 4411, 4423, 4435, 4447, 4459, 4471, 4483, 4495, 4507, 4519, 4531, 4543, + 4555, 4567, 4579, 4591, 4603, 4615, 4627, 4639, 4651, 4663, 4675, 4687, 4699, + 4711, 4723, 4735, 4747, 4759, 4771, 4783, 4795, 4807, 4819, 4831, 4843, 4855, + 4867, 4879, 4891, 4903, 4915, 4927, 4939, 4951, 4963, 4975, 4987, 4999, 5011, + 5023, 5035, 5047, 5059, 5071, 5083, 5095, 5107, 5119, 5131, 5143, 5155, 5167, + 5179, 5191, 5203, 5215, 5227, 5239, 5251, 5263, 5275, 5287, 5299, 5311, 5323, + 5335, 5347, 5359, 5371, 5383, 5395, 5407, 5419, 5431, 5443, 5455, 5467, 5479, + 5491, 5503, 5515, 5527, 5539, 5551, 5563, 5575, 5587, 5599, 5611, 5623, 5635, + 5647, 5659, 5671, 5683, 5695, 5707, 5719, 5731, 5743, 5755, 5767, 5779, 5791, + 5803, 5815, 5839, 5851, 5863, 5875, 5887, 5899, 5911, 5923, 5935, 5947, 5959, + 5971, 5983, 5995, 6007, 6019, 6031, 6043, 6055, 6067, 6079, 6091, 6103, 6115, + 6127, 6139, 6151, 6163, 6175, 6187, 6199, 6211, 6223, 6235, 6247, 6259, 6271, + 6283, 6295, 6307, 6319, 6331, 6343, 6355, 6367, 6379, 6391, 6403, 6415, 6427, + 6439, 6451, 6463, 6475, 6487, 6499, 6511, 6523, 6535, 6547, 6559, 6571, 6583, + 6595, 6607, 6619, 6631, 6643, 6655, 6667, 6679, 6691, 6703, 6715, 6727, 6739, + 6751, 6763, 6775, 6787, 6799, 6811, 6823, 6835, 6847, 6859, 6871, 6883, 6895, + 6907, 6919, 6931, 6943, 6955, 6967, 6979, 6991, 7003, 7015, 7027, 7039, 7051, + 7063, 7075, 7087, 7099, 7111, 7123, 7135, 7147, 7159, 7171, 7183, 7195, 7207, + 7219, 7231, 7243, 7255, 7267, 7279, 7291, 7303, 7315, 7327, 7339, 7351, 7363, + 7375, 7387, 7399, 7411, 7423, 7435, 7447, 7459, 7471, 7483, 7495, 7507, 7519, + 7531, 7543, 7555, 7567, 7579, 7591, 7603, 7615, 7627, 7639, 7651, 7663, 7675, + 7687, 7699, 7711, 7723, 7735, 7747, 7759, 7771, 7783, 7795, 7807, 7819, 7831, + 7843, 7855, 7867, 7879, 7891, 7903, 7915, 7927, 7939, 7951, 7963, 7975, 7987, + 7999, 8011, 8023, 8035, 8047, 8059, 8071, 8083, 8095, 8107, 8119, 8131, 8143, + 8155, 8167, 8179, 8191, 8203, 8215, 8227, 8239, 8251, 8263, 8275, 8287, 8299, + 8311, 8335, 8347, 8359, 8371, 8383, 8395, 8407, 8419, 8431, 8443, 8455, 8467, + 8479, 8491, 8503, 8515, 8527, 8539, 8551, 8563, 8575, 8587, 8599, 8611, 8623, + 8635, 8647, 8659, 8671, 8683, 8695, 8707, 8719, 8731, 8743, 8755, 8767, 8779, + 8791, 8803, 8815, 8827, 8839, 8851, 8863, 8875, 8887, 8899, 8911, 8923, 8935, + 8947, 8959, 8971, 8983, 8995, 9007, 9019, 9031, 9043, 9055, 9067, 9079, 9091, + 9103, 9115, 9127, 9139, 9151, 9163, 9175, 9187, 9199, 9211, 9223, 9235, 9247, + 9259, 9271, 9283, 9295, 9307, 9319, 9331, 9343, 9355, 9367, 9379, 9391, 9403, + 9415, 9427, 9439, 9451, 9463, 9475, 9487, 9499, 9511, 9523, 9535, 9547, 9559, + 9571, 9583, 9595, 9607, 9619, 9631, 9643, 9655, 9667, 9679, 9691, 9703, 9715, + 9727, 9739, 9751, 9763, 9775, 9787, 9799, 9811, 9823, 9835, 9847, 9859, 9871, + 9883, 9895, 9907, 9919, 9931, 9943, 9955, 9967, 9979, + }, + /* 4 */ + { + 8, 20, 32, 44, 56, 68, 80, 92, 104, 116, 128, 140, 152, + 164, 176, 188, 200, 212, 224, 236, 248, 260, 272, 284, 296, 308, + 320, 332, 344, 356, 368, 380, 392, 404, 416, 428, 440, 452, 464, + 476, 488, 500, 512, 524, 536, 548, 560, 572, 584, 596, 608, 620, + 632, 644, 656, 668, 680, 692, 704, 716, 728, 740, 752, 764, 776, + 788, 800, 812, 824, 836, 848, 860, 872, 884, 896, 908, 920, 932, + 944, 956, 968, 980, 992, 1004, 1016, 1028, 1040, 1052, 1064, 1076, 1088, + 1100, 1112, 1124, 1136, 1148, 1160, 1172, 1184, 1196, 1208, 1220, 1232, 1244, + 1256, 1268, 1280, 1292, 1304, 1316, 1328, 1340, 1352, 1364, 1376, 1388, 1400, + 1412, 1424, 1436, 1448, 1460, 1472, 1484, 1496, 1508, 1520, 1532, 1544, 1556, + 1568, 1580, 1592, 1604, 1616, 1628, 1640, 1652, 1676, 1688, 1700, 1712, 1724, + 1736, 1748, 1760, 1772, 1784, 1796, 1808, 1820, 1832, 1844, 1856, 1868, 1880, + 1892, 1904, 1916, 1928, 1940, 1952, 1964, 1976, 1988, 2000, 2012, 2024, 2036, + 2048, 2060, 2072, 2084, 2096, 2108, 2120, 2132, 2144, 2156, 2168, 2180, 2192, + 2204, 2216, 2228, 2240, 2252, 2264, 2276, 2288, 2300, 2312, 2324, 2336, 2348, + 2360, 2372, 2384, 2396, 2408, 2420, 2432, 2444, 2456, 2468, 2480, 2492, 2504, + 2516, 2528, 2540, 2552, 2564, 2576, 2588, 2600, 2612, 2624, 2636, 2648, 2660, + 2672, 2684, 2696, 2708, 2720, 2732, 2744, 2756, 2768, 2780, 2792, 2804, 2816, + 2828, 2840, 2852, 2864, 2876, 2888, 2900, 2912, 2924, 2936, 2948, 2960, 2972, + 2984, 2996, 3008, 3020, 3032, 3044, 3056, 3068, 3080, 3092, 3104, 3116, 3128, + 3140, 3152, 3164, 3176, 3188, 3200, 3212, 3224, 3236, 3248, 3260, 3272, 3284, + 3296, 3308, 3320, 3332, 3344, 3356, 3368, 3380, 3392, 3404, 3416, 3428, 3440, + 3452, 3464, 3476, 3488, 3500, 3512, 3524, 3536, 3548, 3560, 3572, 3584, 3596, + 3608, 3620, 3632, 3644, 3656, 3668, 3680, 3692, 3704, 3716, 3728, 3740, 3752, + 3764, 3776, 3788, 3800, 3812, 3824, 3836, 3848, 3860, 3872, 3884, 3896, 3908, + 3920, 3932, 3944, 3956, 3968, 3980, 3992, 4004, 4016, 4028, 4040, 4052, 4064, + 4076, 4088, 4100, 4112, 4124, 4136, 4148, 4172, 4184, 4196, 4208, 4220, 4232, + 4244, 4256, 4268, 4280, 4292, 4304, 4316, 4328, 4340, 4352, 4364, 4376, 4388, + 4400, 4412, 4424, 4436, 4448, 4460, 4472, 4484, 4496, 4508, 4520, 4532, 4544, + 4556, 4568, 4580, 4592, 4604, 4616, 4628, 4640, 4652, 4664, 4676, 4688, 4700, + 4712, 4724, 4736, 4748, 4760, 4772, 4784, 4796, 4808, 4820, 4832, 4844, 4856, + 4868, 4880, 4892, 4904, 4916, 4928, 4940, 4952, 4964, 4976, 4988, 5000, 5012, + 5024, 5036, 5048, 5060, 5072, 5084, 5096, 5108, 5120, 5132, 5144, 5156, 5168, + 5180, 5192, 5204, 5216, 5228, 5240, 5252, 5264, 5276, 5288, 5300, 5312, 5324, + 5336, 5348, 5360, 5372, 5384, 5396, 5408, 5420, 5432, 5444, 5456, 5468, 5480, + 5492, 5504, 5516, 5528, 5540, 5552, 5564, 5576, 5588, 5600, 5612, 5624, 5636, + 5648, 5660, 5672, 5684, 5696, 5708, 5720, 5732, 5744, 5756, 5768, 5780, 5792, + 5804, 5816, 5828, 5840, 5852, 5864, 5876, 5888, 5900, 5912, 5924, 5936, 5948, + 5960, 5972, 5984, 5996, 6008, 6020, 6032, 6044, 6056, 6068, 6080, 6092, 6104, + 6116, 6128, 6140, 6152, 6164, 6176, 6188, 6200, 6212, 6224, 6236, 6248, 6260, + 6272, 6284, 6296, 6308, 6320, 6332, 6344, 6356, 6368, 6380, 6392, 6404, 6416, + 6428, 6440, 6452, 6464, 6476, 6488, 6500, 6512, 6524, 6536, 6548, 6560, 6572, + 6584, 6596, 6608, 6620, 6632, 6644, 6668, 6680, 6692, 6704, 6716, 6728, 6740, + 6752, 6764, 6776, 6788, 6800, 6812, 6824, 6836, 6848, 6860, 6872, 6884, 6896, + 6908, 6920, 6932, 6944, 6956, 6968, 6980, 6992, 7004, 7016, 7028, 7040, 7052, + 7064, 7076, 7088, 7100, 7112, 7124, 7136, 7148, 7160, 7172, 7184, 7196, 7208, + 7220, 7232, 7244, 7256, 7268, 7280, 7292, 7304, 7316, 7328, 7340, 7352, 7364, + 7376, 7388, 7400, 7412, 7424, 7436, 7448, 7460, 7472, 7484, 7496, 7508, 7520, + 7532, 7544, 7556, 7568, 7580, 7592, 7604, 7616, 7628, 7640, 7652, 7664, 7676, + 7688, 7700, 7712, 7724, 7736, 7748, 7760, 7772, 7784, 7796, 7808, 7820, 7832, + 7844, 7856, 7868, 7880, 7892, 7904, 7916, 7928, 7940, 7952, 7964, 7976, 7988, + 8000, 8012, 8024, 8036, 8048, 8060, 8072, 8084, 8096, 8108, 8120, 8132, 8144, + 8156, 8168, 8180, 8192, 8204, 8216, 8228, 8240, 8252, 8264, 8276, 8288, 8300, + 8312, 8324, 8336, 8348, 8360, 8372, 8384, 8396, 8408, 8420, 8432, 8444, 8456, + 8468, 8480, 8492, 8504, 8516, 8528, 8540, 8552, 8564, 8576, 8588, 8600, 8612, + 8624, 8636, 8648, 8660, 8672, 8684, 8696, 8708, 8720, 8732, 8744, 8756, 8768, + 8780, 8792, 8804, 8816, 8828, 8840, 8852, 8864, 8876, 8888, 8900, 8912, 8924, + 8936, 8948, 8960, 8972, 8984, 8996, 9008, 9020, 9032, 9044, 9056, 9068, 9080, + 9092, 9104, 9116, 9128, 9140, 9164, 9176, 9188, 9200, 9212, 9224, 9236, 9248, + 9260, 9272, 9284, 9296, 9308, 9320, 9332, 9344, 9356, 9368, 9380, 9392, 9404, + 9416, 9428, 9440, 9452, 9464, 9476, 9488, 9500, 9512, 9524, 9536, 9548, 9560, + 9572, 9584, 9596, 9608, 9620, 9632, 9644, 9656, 9668, 9680, 9692, 9704, 9716, + 9728, 9740, 9752, 9764, 9776, 9788, 9800, 9812, 9824, 9836, 9848, 9860, 9872, + 9884, 9896, 9908, 9920, 9932, 9944, 9956, 9968, 9980, + }, + /* 5 */ + { + 9, 21, 33, 45, 57, 69, 81, 93, 105, 117, 129, 141, 153, + 165, 177, 189, 201, 213, 225, 237, 249, 261, 273, 285, 297, 309, + 321, 333, 345, 357, 369, 381, 393, 405, 417, 429, 441, 453, 465, + 477, 489, 501, 513, 525, 537, 549, 561, 573, 585, 597, 609, 621, + 633, 645, 657, 669, 681, 693, 705, 717, 729, 741, 753, 765, 777, + 789, 801, 813, 825, 837, 849, 861, 873, 885, 897, 909, 921, 933, + 945, 957, 969, 981, 993, 1005, 1017, 1029, 1041, 1053, 1065, 1077, 1089, + 1101, 1113, 1125, 1137, 1149, 1161, 1173, 1185, 1197, 1209, 1221, 1233, 1245, + 1257, 1269, 1281, 1293, 1305, 1317, 1329, 1341, 1353, 1365, 1377, 1389, 1401, + 1413, 1425, 1437, 1449, 1461, 1473, 1485, 1497, 1509, 1521, 1533, 1545, 1557, + 1569, 1581, 1593, 1605, 1617, 1629, 1641, 1653, 1677, 1689, 1701, 1713, 1725, + 1737, 1749, 1761, 1773, 1785, 1797, 1809, 1821, 1833, 1845, 1857, 1869, 1881, + 1893, 1905, 1917, 1929, 1941, 1953, 1965, 1977, 1989, 2001, 2013, 2025, 2037, + 2049, 2061, 2073, 2085, 2097, 2109, 2121, 2133, 2145, 2157, 2169, 2181, 2193, + 2205, 2217, 2229, 2241, 2253, 2265, 2277, 2289, 2301, 2313, 2325, 2337, 2349, + 2361, 2373, 2385, 2397, 2409, 2421, 2433, 2445, 2457, 2469, 2481, 2493, 2505, + 2517, 2529, 2541, 2553, 2565, 2577, 2589, 2601, 2613, 2625, 2637, 2649, 2661, + 2673, 2685, 2697, 2709, 2721, 2733, 2745, 2757, 2769, 2781, 2793, 2805, 2817, + 2829, 2841, 2853, 2865, 2877, 2889, 2901, 2913, 2925, 2937, 2949, 2961, 2973, + 2985, 2997, 3009, 3021, 3033, 3045, 3057, 3069, 3081, 3093, 3105, 3117, 3129, + 3141, 3153, 3165, 3177, 3189, 3201, 3213, 3225, 3237, 3249, 3261, 3273, 3285, + 3297, 3309, 3321, 3333, 3345, 3357, 3369, 3381, 3393, 3405, 3417, 3429, 3441, + 3453, 3465, 3477, 3489, 3501, 3513, 3525, 3537, 3549, 3561, 3573, 3585, 3597, + 3609, 3621, 3633, 3645, 3657, 3669, 3681, 3693, 3705, 3717, 3729, 3741, 3753, + 3765, 3777, 3789, 3801, 3813, 3825, 3837, 3849, 3861, 3873, 3885, 3897, 3909, + 3921, 3933, 3945, 3957, 3969, 3981, 3993, 4005, 4017, 4029, 4041, 4053, 4065, + 4077, 4089, 4101, 4113, 4125, 4137, 4149, 4173, 4185, 4197, 4209, 4221, 4233, + 4245, 4257, 4269, 4281, 4293, 4305, 4317, 4329, 4341, 4353, 4365, 4377, 4389, + 4401, 4413, 4425, 4437, 4449, 4461, 4473, 4485, 4497, 4509, 4521, 4533, 4545, + 4557, 4569, 4581, 4593, 4605, 4617, 4629, 4641, 4653, 4665, 4677, 4689, 4701, + 4713, 4725, 4737, 4749, 4761, 4773, 4785, 4797, 4809, 4821, 4833, 4845, 4857, + 4869, 4881, 4893, 4905, 4917, 4929, 4941, 4953, 4965, 4977, 4989, 5001, 5013, + 5025, 5037, 5049, 5061, 5073, 5085, 5097, 5109, 5121, 5133, 5145, 5157, 5169, + 5181, 5193, 5205, 5217, 5229, 5241, 5253, 5265, 5277, 5289, 5301, 5313, 5325, + 5337, 5349, 5361, 5373, 5385, 5397, 5409, 5421, 5433, 5445, 5457, 5469, 5481, + 5493, 5505, 5517, 5529, 5541, 5553, 5565, 5577, 5589, 5601, 5613, 5625, 5637, + 5649, 5661, 5673, 5685, 5697, 5709, 5721, 5733, 5745, 5757, 5769, 5781, 5793, + 5805, 5817, 5829, 5841, 5853, 5865, 5877, 5889, 5901, 5913, 5925, 5937, 5949, + 5961, 5973, 5985, 5997, 6009, 6021, 6033, 6045, 6057, 6069, 6081, 6093, 6105, + 6117, 6129, 6141, 6153, 6165, 6177, 6189, 6201, 6213, 6225, 6237, 6249, 6261, + 6273, 6285, 6297, 6309, 6321, 6333, 6345, 6357, 6369, 6381, 6393, 6405, 6417, + 6429, 6441, 6453, 6465, 6477, 6489, 6501, 6513, 6525, 6537, 6549, 6561, 6573, + 6585, 6597, 6609, 6621, 6633, 6645, 6669, 6681, 6693, 6705, 6717, 6729, 6741, + 6753, 6765, 6777, 6789, 6801, 6813, 6825, 6837, 6849, 6861, 6873, 6885, 6897, + 6909, 6921, 6933, 6945, 6957, 6969, 6981, 6993, 7005, 7017, 7029, 7041, 7053, + 7065, 7077, 7089, 7101, 7113, 7125, 7137, 7149, 7161, 7173, 7185, 7197, 7209, + 7221, 7233, 7245, 7257, 7269, 7281, 7293, 7305, 7317, 7329, 7341, 7353, 7365, + 7377, 7389, 7401, 7413, 7425, 7437, 7449, 7461, 7473, 7485, 7497, 7509, 7521, + 7533, 7545, 7557, 7569, 7581, 7593, 7605, 7617, 7629, 7641, 7653, 7665, 7677, + 7689, 7701, 7713, 7725, 7737, 7749, 7761, 7773, 7785, 7797, 7809, 7821, 7833, + 7845, 7857, 7869, 7881, 7893, 7905, 7917, 7929, 7941, 7953, 7965, 7977, 7989, + 8001, 8013, 8025, 8037, 8049, 8061, 8073, 8085, 8097, 8109, 8121, 8133, 8145, + 8157, 8169, 8181, 8193, 8205, 8217, 8229, 8241, 8253, 8265, 8277, 8289, 8301, + 8313, 8325, 8337, 8349, 8361, 8373, 8385, 8397, 8409, 8421, 8433, 8445, 8457, + 8469, 8481, 8493, 8505, 8517, 8529, 8541, 8553, 8565, 8577, 8589, 8601, 8613, + 8625, 8637, 8649, 8661, 8673, 8685, 8697, 8709, 8721, 8733, 8745, 8757, 8769, + 8781, 8793, 8805, 8817, 8829, 8841, 8853, 8865, 8877, 8889, 8901, 8913, 8925, + 8937, 8949, 8961, 8973, 8985, 8997, 9009, 9021, 9033, 9045, 9057, 9069, 9081, + 9093, 9105, 9117, 9129, 9141, 9165, 9177, 9189, 9201, 9213, 9225, 9237, 9249, + 9261, 9273, 9285, 9297, 9309, 9321, 9333, 9345, 9357, 9369, 9381, 9393, 9405, + 9417, 9429, 9441, 9453, 9465, 9477, 9489, 9501, 9513, 9525, 9537, 9549, 9561, + 9573, 9585, 9597, 9609, 9621, 9633, 9645, 9657, 9669, 9681, 9693, 9705, 9717, + 9729, 9741, 9753, 9765, 9777, 9789, 9801, 9813, 9825, 9837, 9849, 9861, 9873, + 9885, 9897, 9909, 9921, 9933, 9945, 9957, 9969, 9981, + }, + /* 6 */ + { + 10, 22, 34, 46, 58, 70, 82, 94, 106, 118, 130, 142, 154, + 166, 178, 190, 202, 214, 226, 238, 250, 262, 274, 286, 298, 310, + 322, 334, 346, 358, 370, 382, 394, 406, 418, 430, 442, 454, 466, + 478, 490, 502, 514, 526, 538, 550, 562, 574, 586, 598, 610, 622, + 634, 646, 658, 670, 682, 694, 706, 718, 730, 742, 754, 766, 778, + 790, 802, 814, 826, 838, 850, 862, 874, 886, 898, 910, 922, 934, + 946, 958, 970, 982, 994, 1006, 1018, 1030, 1042, 1054, 1066, 1078, 1090, + 1102, 1114, 1126, 1138, 1150, 1162, 1174, 1186, 1198, 1210, 1222, 1234, 1246, + 1258, 1270, 1282, 1294, 1306, 1318, 1330, 1342, 1354, 1366, 1378, 1390, 1402, + 1414, 1426, 1438, 1450, 1462, 1474, 1486, 1498, 1510, 1522, 1534, 1546, 1558, + 1570, 1582, 1594, 1606, 1618, 1630, 1642, 1654, 1678, 1690, 1702, 1714, 1726, + 1738, 1750, 1762, 1774, 1786, 1798, 1810, 1822, 1834, 1846, 1858, 1870, 1882, + 1894, 1906, 1918, 1930, 1942, 1954, 1966, 1978, 1990, 2002, 2014, 2026, 2038, + 2050, 2062, 2074, 2086, 2098, 2110, 2122, 2134, 2146, 2158, 2170, 2182, 2194, + 2206, 2218, 2230, 2242, 2254, 2266, 2278, 2290, 2302, 2314, 2326, 2338, 2350, + 2362, 2374, 2386, 2398, 2410, 2422, 2434, 2446, 2458, 2470, 2482, 2494, 2506, + 2518, 2530, 2542, 2554, 2566, 2578, 2590, 2602, 2614, 2626, 2638, 2650, 2662, + 2674, 2686, 2698, 2710, 2722, 2734, 2746, 2758, 2770, 2782, 2794, 2806, 2818, + 2830, 2842, 2854, 2866, 2878, 2890, 2902, 2914, 2926, 2938, 2950, 2962, 2974, + 2986, 2998, 3010, 3022, 3034, 3046, 3058, 3070, 3082, 3094, 3106, 3118, 3130, + 3142, 3154, 3166, 3178, 3190, 3202, 3214, 3226, 3238, 3250, 3262, 3274, 3286, + 3298, 3310, 3322, 3334, 3346, 3358, 3370, 3382, 3394, 3406, 3418, 3430, 3442, + 3454, 3466, 3478, 3490, 3502, 3514, 3526, 3538, 3550, 3562, 3574, 3586, 3598, + 3610, 3622, 3634, 3646, 3658, 3670, 3682, 3694, 3706, 3718, 3730, 3742, 3754, + 3766, 3778, 3790, 3802, 3814, 3826, 3838, 3850, 3862, 3874, 3886, 3898, 3910, + 3922, 3934, 3946, 3958, 3970, 3982, 3994, 4006, 4018, 4030, 4042, 4054, 4066, + 4078, 4090, 4102, 4114, 4126, 4138, 4150, 4174, 4186, 4198, 4210, 4222, 4234, + 4246, 4258, 4270, 4282, 4294, 4306, 4318, 4330, 4342, 4354, 4366, 4378, 4390, + 4402, 4414, 4426, 4438, 4450, 4462, 4474, 4486, 4498, 4510, 4522, 4534, 4546, + 4558, 4570, 4582, 4594, 4606, 4618, 4630, 4642, 4654, 4666, 4678, 4690, 4702, + 4714, 4726, 4738, 4750, 4762, 4774, 4786, 4798, 4810, 4822, 4834, 4846, 4858, + 4870, 4882, 4894, 4906, 4918, 4930, 4942, 4954, 4966, 4978, 4990, 5002, 5014, + 5026, 5038, 5050, 5062, 5074, 5086, 5098, 5110, 5122, 5134, 5146, 5158, 5170, + 5182, 5194, 5206, 5218, 5230, 5242, 5254, 5266, 5278, 5290, 5302, 5314, 5326, + 5338, 5350, 5362, 5374, 5386, 5398, 5410, 5422, 5434, 5446, 5458, 5470, 5482, + 5494, 5506, 5518, 5530, 5542, 5554, 5566, 5578, 5590, 5602, 5614, 5626, 5638, + 5650, 5662, 5674, 5686, 5698, 5710, 5722, 5734, 5746, 5758, 5770, 5782, 5794, + 5806, 5818, 5830, 5842, 5854, 5866, 5878, 5890, 5902, 5914, 5926, 5938, 5950, + 5962, 5974, 5986, 5998, 6010, 6022, 6034, 6046, 6058, 6070, 6082, 6094, 6106, + 6118, 6130, 6142, 6154, 6166, 6178, 6190, 6202, 6214, 6226, 6238, 6250, 6262, + 6274, 6286, 6298, 6310, 6322, 6334, 6346, 6358, 6370, 6382, 6394, 6406, 6418, + 6430, 6442, 6454, 6466, 6478, 6490, 6502, 6514, 6526, 6538, 6550, 6562, 6574, + 6586, 6598, 6610, 6622, 6634, 6646, 6670, 6682, 6694, 6706, 6718, 6730, 6742, + 6754, 6766, 6778, 6790, 6802, 6814, 6826, 6838, 6850, 6862, 6874, 6886, 6898, + 6910, 6922, 6934, 6946, 6958, 6970, 6982, 6994, 7006, 7018, 7030, 7042, 7054, + 7066, 7078, 7090, 7102, 7114, 7126, 7138, 7150, 7162, 7174, 7186, 7198, 7210, + 7222, 7234, 7246, 7258, 7270, 7282, 7294, 7306, 7318, 7330, 7342, 7354, 7366, + 7378, 7390, 7402, 7414, 7426, 7438, 7450, 7462, 7474, 7486, 7498, 7510, 7522, + 7534, 7546, 7558, 7570, 7582, 7594, 7606, 7618, 7630, 7642, 7654, 7666, 7678, + 7690, 7702, 7714, 7726, 7738, 7750, 7762, 7774, 7786, 7798, 7810, 7822, 7834, + 7846, 7858, 7870, 7882, 7894, 7906, 7918, 7930, 7942, 7954, 7966, 7978, 7990, + 8002, 8014, 8026, 8038, 8050, 8062, 8074, 8086, 8098, 8110, 8122, 8134, 8146, + 8158, 8170, 8182, 8194, 8206, 8218, 8230, 8242, 8254, 8266, 8278, 8290, 8302, + 8314, 8326, 8338, 8350, 8362, 8374, 8386, 8398, 8410, 8422, 8434, 8446, 8458, + 8470, 8482, 8494, 8506, 8518, 8530, 8542, 8554, 8566, 8578, 8590, 8602, 8614, + 8626, 8638, 8650, 8662, 8674, 8686, 8698, 8710, 8722, 8734, 8746, 8758, 8770, + 8782, 8794, 8806, 8818, 8830, 8842, 8854, 8866, 8878, 8890, 8902, 8914, 8926, + 8938, 8950, 8962, 8974, 8986, 8998, 9010, 9022, 9034, 9046, 9058, 9070, 9082, + 9094, 9106, 9118, 9130, 9142, 9166, 9178, 9190, 9202, 9214, 9226, 9238, 9250, + 9262, 9274, 9286, 9298, 9310, 9322, 9334, 9346, 9358, 9370, 9382, 9394, 9406, + 9418, 9430, 9442, 9454, 9466, 9478, 9490, 9502, 9514, 9526, 9538, 9550, 9562, + 9574, 9586, 9598, 9610, 9622, 9634, 9646, 9658, 9670, 9682, 9694, 9706, 9718, + 9730, 9742, 9754, 9766, 9778, 9790, 9802, 9814, 9826, 9838, 9850, 9862, 9874, + 9886, 9898, 9910, 9922, 9934, 9946, 9958, 9970, 9982, + }, + /* 7 */ + { + 11, 23, 35, 47, 59, 71, 83, 95, 107, 119, 131, 143, 155, + 167, 179, 191, 203, 215, 227, 239, 251, 263, 275, 287, 299, 311, + 323, 335, 347, 359, 371, 383, 395, 407, 419, 431, 443, 455, 467, + 479, 491, 503, 515, 527, 539, 551, 563, 575, 587, 599, 611, 623, + 635, 647, 659, 671, 683, 695, 707, 719, 731, 743, 755, 767, 779, + 791, 803, 815, 827, 839, 851, 863, 875, 887, 899, 911, 923, 935, + 947, 959, 971, 983, 995, 1007, 1019, 1031, 1043, 1055, 1067, 1079, 1091, + 1103, 1115, 1127, 1139, 1151, 1163, 1175, 1187, 1199, 1211, 1223, 1235, 1247, + 1259, 1271, 1283, 1295, 1307, 1319, 1331, 1343, 1355, 1367, 1379, 1391, 1403, + 1415, 1427, 1439, 1451, 1463, 1475, 1487, 1499, 1511, 1523, 1535, 1547, 1559, + 1571, 1583, 1595, 1607, 1619, 1631, 1643, 1655, 1679, 1691, 1703, 1715, 1727, + 1739, 1751, 1763, 1775, 1787, 1799, 1811, 1823, 1835, 1847, 1859, 1871, 1883, + 1895, 1907, 1919, 1931, 1943, 1955, 1967, 1979, 1991, 2003, 2015, 2027, 2039, + 2051, 2063, 2075, 2087, 2099, 2111, 2123, 2135, 2147, 2159, 2171, 2183, 2195, + 2207, 2219, 2231, 2243, 2255, 2267, 2279, 2291, 2303, 2315, 2327, 2339, 2351, + 2363, 2375, 2387, 2399, 2411, 2423, 2435, 2447, 2459, 2471, 2483, 2495, 2507, + 2519, 2531, 2543, 2555, 2567, 2579, 2591, 2603, 2615, 2627, 2639, 2651, 2663, + 2675, 2687, 2699, 2711, 2723, 2735, 2747, 2759, 2771, 2783, 2795, 2807, 2819, + 2831, 2843, 2855, 2867, 2879, 2891, 2903, 2915, 2927, 2939, 2951, 2963, 2975, + 2987, 2999, 3011, 3023, 3035, 3047, 3059, 3071, 3083, 3095, 3107, 3119, 3131, + 3143, 3155, 3167, 3179, 3191, 3203, 3215, 3227, 3239, 3251, 3263, 3275, 3287, + 3299, 3311, 3323, 3335, 3347, 3359, 3371, 3383, 3395, 3407, 3419, 3431, 3443, + 3455, 3467, 3479, 3491, 3503, 3515, 3527, 3539, 3551, 3563, 3575, 3587, 3599, + 3611, 3623, 3635, 3647, 3659, 3671, 3683, 3695, 3707, 3719, 3731, 3743, 3755, + 3767, 3779, 3791, 3803, 3815, 3827, 3839, 3851, 3863, 3875, 3887, 3899, 3911, + 3923, 3935, 3947, 3959, 3971, 3983, 3995, 4007, 4019, 4031, 4043, 4055, 4067, + 4079, 4091, 4103, 4115, 4127, 4139, 4151, 4175, 4187, 4199, 4211, 4223, 4235, + 4247, 4259, 4271, 4283, 4295, 4307, 4319, 4331, 4343, 4355, 4367, 4379, 4391, + 4403, 4415, 4427, 4439, 4451, 4463, 4475, 4487, 4499, 4511, 4523, 4535, 4547, + 4559, 4571, 4583, 4595, 4607, 4619, 4631, 4643, 4655, 4667, 4679, 4691, 4703, + 4715, 4727, 4739, 4751, 4763, 4775, 4787, 4799, 4811, 4823, 4835, 4847, 4859, + 4871, 4883, 4895, 4907, 4919, 4931, 4943, 4955, 4967, 4979, 4991, 5003, 5015, + 5027, 5039, 5051, 5063, 5075, 5087, 5099, 5111, 5123, 5135, 5147, 5159, 5171, + 5183, 5195, 5207, 5219, 5231, 5243, 5255, 5267, 5279, 5291, 5303, 5315, 5327, + 5339, 5351, 5363, 5375, 5387, 5399, 5411, 5423, 5435, 5447, 5459, 5471, 5483, + 5495, 5507, 5519, 5531, 5543, 5555, 5567, 5579, 5591, 5603, 5615, 5627, 5639, + 5651, 5663, 5675, 5687, 5699, 5711, 5723, 5735, 5747, 5759, 5771, 5783, 5795, + 5807, 5819, 5831, 5843, 5855, 5867, 5879, 5891, 5903, 5915, 5927, 5939, 5951, + 5963, 5975, 5987, 5999, 6011, 6023, 6035, 6047, 6059, 6071, 6083, 6095, 6107, + 6119, 6131, 6143, 6155, 6167, 6179, 6191, 6203, 6215, 6227, 6239, 6251, 6263, + 6275, 6287, 6299, 6311, 6323, 6335, 6347, 6359, 6371, 6383, 6395, 6407, 6419, + 6431, 6443, 6455, 6467, 6479, 6491, 6503, 6515, 6527, 6539, 6551, 6563, 6575, + 6587, 6599, 6611, 6623, 6635, 6647, 6671, 6683, 6695, 6707, 6719, 6731, 6743, + 6755, 6767, 6779, 6791, 6803, 6815, 6827, 6839, 6851, 6863, 6875, 6887, 6899, + 6911, 6923, 6935, 6947, 6959, 6971, 6983, 6995, 7007, 7019, 7031, 7043, 7055, + 7067, 7079, 7091, 7103, 7115, 7127, 7139, 7151, 7163, 7175, 7187, 7199, 7211, + 7223, 7235, 7247, 7259, 7271, 7283, 7295, 7307, 7319, 7331, 7343, 7355, 7367, + 7379, 7391, 7403, 7415, 7427, 7439, 7451, 7463, 7475, 7487, 7499, 7511, 7523, + 7535, 7547, 7559, 7571, 7583, 7595, 7607, 7619, 7631, 7643, 7655, 7667, 7679, + 7691, 7703, 7715, 7727, 7739, 7751, 7763, 7775, 7787, 7799, 7811, 7823, 7835, + 7847, 7859, 7871, 7883, 7895, 7907, 7919, 7931, 7943, 7955, 7967, 7979, 7991, + 8003, 8015, 8027, 8039, 8051, 8063, 8075, 8087, 8099, 8111, 8123, 8135, 8147, + 8159, 8171, 8183, 8195, 8207, 8219, 8231, 8243, 8255, 8267, 8279, 8291, 8303, + 8315, 8327, 8339, 8351, 8363, 8375, 8387, 8399, 8411, 8423, 8435, 8447, 8459, + 8471, 8483, 8495, 8507, 8519, 8531, 8543, 8555, 8567, 8579, 8591, 8603, 8615, + 8627, 8639, 8651, 8663, 8675, 8687, 8699, 8711, 8723, 8735, 8747, 8759, 8771, + 8783, 8795, 8807, 8819, 8831, 8843, 8855, 8867, 8879, 8891, 8903, 8915, 8927, + 8939, 8951, 8963, 8975, 8987, 8999, 9011, 9023, 9035, 9047, 9059, 9071, 9083, + 9095, 9107, 9119, 9131, 9143, 9167, 9179, 9191, 9203, 9215, 9227, 9239, 9251, + 9263, 9275, 9287, 9299, 9311, 9323, 9335, 9347, 9359, 9371, 9383, 9395, 9407, + 9419, 9431, 9443, 9455, 9467, 9479, 9491, 9503, 9515, 9527, 9539, 9551, 9563, + 9575, 9587, 9599, 9611, 9623, 9635, 9647, 9659, 9671, 9683, 9695, 9707, 9719, + 9731, 9743, 9755, 9767, 9779, 9791, 9803, 9815, 9827, 9839, 9851, 9863, 9875, + 9887, 9899, 9911, 9923, 9935, 9947, 9959, 9971, 9983, + }, + /* 8 */ + { + 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, + 168, 180, 192, 204, 216, 228, 240, 252, 264, 276, 288, 300, 312, + 324, 336, 348, 360, 372, 384, 396, 408, 420, 432, 444, 456, 468, + 480, 492, 504, 516, 528, 540, 552, 564, 576, 588, 600, 612, 624, + 636, 648, 660, 672, 684, 696, 708, 720, 732, 744, 756, 768, 780, + 792, 804, 816, 828, 840, 852, 864, 876, 888, 900, 912, 924, 936, + 948, 960, 972, 984, 996, 1008, 1020, 1032, 1044, 1056, 1068, 1080, 1092, + 1104, 1116, 1128, 1140, 1152, 1164, 1176, 1188, 1200, 1212, 1224, 1236, 1248, + 1260, 1272, 1284, 1296, 1308, 1320, 1332, 1344, 1356, 1368, 1380, 1392, 1404, + 1416, 1428, 1440, 1452, 1464, 1476, 1488, 1500, 1512, 1524, 1536, 1548, 1560, + 1572, 1584, 1596, 1608, 1620, 1632, 1644, 1656, 1668, 1680, 1692, 1704, 1716, + 1728, 1740, 1752, 1764, 1776, 1788, 1800, 1812, 1824, 1836, 1848, 1860, 1872, + 1884, 1896, 1908, 1920, 1932, 1944, 1956, 1968, 1980, 1992, 2004, 2016, 2028, + 2040, 2052, 2064, 2076, 2088, 2100, 2112, 2124, 2136, 2148, 2160, 2172, 2184, + 2196, 2208, 2220, 2232, 2244, 2256, 2268, 2280, 2292, 2304, 2316, 2328, 2340, + 2352, 2364, 2376, 2388, 2400, 2412, 2424, 2436, 2448, 2460, 2472, 2484, 2508, + 2520, 2532, 2544, 2556, 2568, 2580, 2592, 2604, 2616, 2628, 2640, 2652, 2664, + 2676, 2688, 2700, 2712, 2724, 2736, 2748, 2760, 2772, 2784, 2796, 2808, 2820, + 2832, 2844, 2856, 2868, 2880, 2892, 2904, 2916, 2928, 2940, 2952, 2964, 2976, + 2988, 3000, 3012, 3024, 3036, 3048, 3060, 3072, 3084, 3096, 3108, 3120, 3132, + 3144, 3156, 3168, 3180, 3192, 3204, 3216, 3228, 3240, 3252, 3264, 3276, 3288, + 3300, 3312, 3324, 3336, 3348, 3360, 3372, 3384, 3396, 3408, 3420, 3432, 3444, + 3456, 3468, 3480, 3492, 3504, 3516, 3528, 3540, 3552, 3564, 3576, 3588, 3600, + 3612, 3624, 3636, 3648, 3660, 3672, 3684, 3696, 3708, 3720, 3732, 3744, 3756, + 3768, 3780, 3792, 3804, 3816, 3828, 3840, 3852, 3864, 3876, 3888, 3900, 3912, + 3924, 3936, 3948, 3960, 3972, 3984, 3996, 4008, 4020, 4032, 4044, 4056, 4068, + 4080, 4092, 4104, 4116, 4128, 4140, 4152, 4164, 4176, 4188, 4200, 4212, 4224, + 4236, 4248, 4260, 4272, 4284, 4296, 4308, 4320, 4332, 4344, 4356, 4368, 4380, + 4392, 4404, 4416, 4428, 4440, 4452, 4464, 4476, 4488, 4500, 4512, 4524, 4536, + 4548, 4560, 4572, 4584, 4596, 4608, 4620, 4632, 4644, 4656, 4668, 4680, 4692, + 4704, 4716, 4728, 4740, 4752, 4764, 4776, 4788, 4800, 4812, 4824, 4836, 4848, + 4860, 4872, 4884, 4896, 4908, 4920, 4932, 4944, 4956, 4968, 4980, 5004, 5016, + 5028, 5040, 5052, 5064, 5076, 5088, 5100, 5112, 5124, 5136, 5148, 5160, 5172, + 5184, 5196, 5208, 5220, 5232, 5244, 5256, 5268, 5280, 5292, 5304, 5316, 5328, + 5340, 5352, 5364, 5376, 5388, 5400, 5412, 5424, 5436, 5448, 5460, 5472, 5484, + 5496, 5508, 5520, 5532, 5544, 5556, 5568, 5580, 5592, 5604, 5616, 5628, 5640, + 5652, 5664, 5676, 5688, 5700, 5712, 5724, 5736, 5748, 5760, 5772, 5784, 5796, + 5808, 5820, 5832, 5844, 5856, 5868, 5880, 5892, 5904, 5916, 5928, 5940, 5952, + 5964, 5976, 5988, 6000, 6012, 6024, 6036, 6048, 6060, 6072, 6084, 6096, 6108, + 6120, 6132, 6144, 6156, 6168, 6180, 6192, 6204, 6216, 6228, 6240, 6252, 6264, + 6276, 6288, 6300, 6312, 6324, 6336, 6348, 6360, 6372, 6384, 6396, 6408, 6420, + 6432, 6444, 6456, 6468, 6480, 6492, 6504, 6516, 6528, 6540, 6552, 6564, 6576, + 6588, 6600, 6612, 6624, 6636, 6648, 6660, 6672, 6684, 6696, 6708, 6720, 6732, + 6744, 6756, 6768, 6780, 6792, 6804, 6816, 6828, 6840, 6852, 6864, 6876, 6888, + 6900, 6912, 6924, 6936, 6948, 6960, 6972, 6984, 6996, 7008, 7020, 7032, 7044, + 7056, 7068, 7080, 7092, 7104, 7116, 7128, 7140, 7152, 7164, 7176, 7188, 7200, + 7212, 7224, 7236, 7248, 7260, 7272, 7284, 7296, 7308, 7320, 7332, 7344, 7356, + 7368, 7380, 7392, 7404, 7416, 7428, 7440, 7452, 7464, 7476, 7500, 7512, 7524, + 7536, 7548, 7560, 7572, 7584, 7596, 7608, 7620, 7632, 7644, 7656, 7668, 7680, + 7692, 7704, 7716, 7728, 7740, 7752, 7764, 7776, 7788, 7800, 7812, 7824, 7836, + 7848, 7860, 7872, 7884, 7896, 7908, 7920, 7932, 7944, 7956, 7968, 7980, 7992, + 8004, 8016, 8028, 8040, 8052, 8064, 8076, 8088, 8100, 8112, 8124, 8136, 8148, + 8160, 8172, 8184, 8196, 8208, 8220, 8232, 8244, 8256, 8268, 8280, 8292, 8304, + 8316, 8328, 8340, 8352, 8364, 8376, 8388, 8400, 8412, 8424, 8436, 8448, 8460, + 8472, 8484, 8496, 8508, 8520, 8532, 8544, 8556, 8568, 8580, 8592, 8604, 8616, + 8628, 8640, 8652, 8664, 8676, 8688, 8700, 8712, 8724, 8736, 8748, 8760, 8772, + 8784, 8796, 8808, 8820, 8832, 8844, 8856, 8868, 8880, 8892, 8904, 8916, 8928, + 8940, 8952, 8964, 8976, 8988, 9000, 9012, 9024, 9036, 9048, 9060, 9072, 9084, + 9096, 9108, 9120, 9132, 9144, 9156, 9168, 9180, 9192, 9204, 9216, 9228, 9240, + 9252, 9264, 9276, 9288, 9300, 9312, 9324, 9336, 9348, 9360, 9372, 9384, 9396, + 9408, 9420, 9432, 9444, 9456, 9468, 9480, 9492, 9504, 9516, 9528, 9540, 9552, + 9564, 9576, 9588, 9600, 9612, 9624, 9636, 9648, 9660, 9672, 9684, 9696, 9708, + 9720, 9732, 9744, 9756, 9768, 9780, 9792, 9804, 9816, 9828, 9840, 9852, 9864, + 9876, 9888, 9900, 9912, 9924, 9936, 9948, 9960, 9972, + }, + /* 9 */ + { + 13, 25, 37, 49, 61, 73, 85, 97, 109, 121, 133, 145, 157, + 169, 181, 193, 205, 217, 229, 241, 253, 265, 277, 289, 301, 313, + 325, 337, 349, 361, 373, 385, 397, 409, 421, 433, 445, 457, 469, + 481, 493, 505, 517, 529, 541, 553, 565, 577, 589, 601, 613, 625, + 637, 649, 661, 673, 685, 697, 709, 721, 733, 745, 757, 769, 781, + 793, 805, 817, 829, 841, 853, 865, 877, 889, 901, 913, 925, 937, + 949, 961, 973, 985, 997, 1009, 1021, 1033, 1045, 1057, 1069, 1081, 1093, + 1105, 1117, 1129, 1141, 1153, 1165, 1177, 1189, 1201, 1213, 1225, 1237, 1249, + 1261, 1273, 1285, 1297, 1309, 1321, 1333, 1345, 1357, 1369, 1381, 1393, 1405, + 1417, 1429, 1441, 1453, 1465, 1477, 1489, 1501, 1513, 1525, 1537, 1549, 1561, + 1573, 1585, 1597, 1609, 1621, 1633, 1645, 1657, 1669, 1681, 1693, 1705, 1717, + 1729, 1741, 1753, 1765, 1777, 1789, 1801, 1813, 1825, 1837, 1849, 1861, 1873, + 1885, 1897, 1909, 1921, 1933, 1945, 1957, 1969, 1981, 1993, 2005, 2017, 2029, + 2041, 2053, 2065, 2077, 2089, 2101, 2113, 2125, 2137, 2149, 2161, 2173, 2185, + 2197, 2209, 2221, 2233, 2245, 2257, 2269, 2281, 2293, 2305, 2317, 2329, 2341, + 2353, 2365, 2377, 2389, 2401, 2413, 2425, 2437, 2449, 2461, 2473, 2485, 2509, + 2521, 2533, 2545, 2557, 2569, 2581, 2593, 2605, 2617, 2629, 2641, 2653, 2665, + 2677, 2689, 2701, 2713, 2725, 2737, 2749, 2761, 2773, 2785, 2797, 2809, 2821, + 2833, 2845, 2857, 2869, 2881, 2893, 2905, 2917, 2929, 2941, 2953, 2965, 2977, + 2989, 3001, 3013, 3025, 3037, 3049, 3061, 3073, 3085, 3097, 3109, 3121, 3133, + 3145, 3157, 3169, 3181, 3193, 3205, 3217, 3229, 3241, 3253, 3265, 3277, 3289, + 3301, 3313, 3325, 3337, 3349, 3361, 3373, 3385, 3397, 3409, 3421, 3433, 3445, + 3457, 3469, 3481, 3493, 3505, 3517, 3529, 3541, 3553, 3565, 3577, 3589, 3601, + 3613, 3625, 3637, 3649, 3661, 3673, 3685, 3697, 3709, 3721, 3733, 3745, 3757, + 3769, 3781, 3793, 3805, 3817, 3829, 3841, 3853, 3865, 3877, 3889, 3901, 3913, + 3925, 3937, 3949, 3961, 3973, 3985, 3997, 4009, 4021, 4033, 4045, 4057, 4069, + 4081, 4093, 4105, 4117, 4129, 4141, 4153, 4165, 4177, 4189, 4201, 4213, 4225, + 4237, 4249, 4261, 4273, 4285, 4297, 4309, 4321, 4333, 4345, 4357, 4369, 4381, + 4393, 4405, 4417, 4429, 4441, 4453, 4465, 4477, 4489, 4501, 4513, 4525, 4537, + 4549, 4561, 4573, 4585, 4597, 4609, 4621, 4633, 4645, 4657, 4669, 4681, 4693, + 4705, 4717, 4729, 4741, 4753, 4765, 4777, 4789, 4801, 4813, 4825, 4837, 4849, + 4861, 4873, 4885, 4897, 4909, 4921, 4933, 4945, 4957, 4969, 4981, 5005, 5017, + 5029, 5041, 5053, 5065, 5077, 5089, 5101, 5113, 5125, 5137, 5149, 5161, 5173, + 5185, 5197, 5209, 5221, 5233, 5245, 5257, 5269, 5281, 5293, 5305, 5317, 5329, + 5341, 5353, 5365, 5377, 5389, 5401, 5413, 5425, 5437, 5449, 5461, 5473, 5485, + 5497, 5509, 5521, 5533, 5545, 5557, 5569, 5581, 5593, 5605, 5617, 5629, 5641, + 5653, 5665, 5677, 5689, 5701, 5713, 5725, 5737, 5749, 5761, 5773, 5785, 5797, + 5809, 5821, 5833, 5845, 5857, 5869, 5881, 5893, 5905, 5917, 5929, 5941, 5953, + 5965, 5977, 5989, 6001, 6013, 6025, 6037, 6049, 6061, 6073, 6085, 6097, 6109, + 6121, 6133, 6145, 6157, 6169, 6181, 6193, 6205, 6217, 6229, 6241, 6253, 6265, + 6277, 6289, 6301, 6313, 6325, 6337, 6349, 6361, 6373, 6385, 6397, 6409, 6421, + 6433, 6445, 6457, 6469, 6481, 6493, 6505, 6517, 6529, 6541, 6553, 6565, 6577, + 6589, 6601, 6613, 6625, 6637, 6649, 6661, 6673, 6685, 6697, 6709, 6721, 6733, + 6745, 6757, 6769, 6781, 6793, 6805, 6817, 6829, 6841, 6853, 6865, 6877, 6889, + 6901, 6913, 6925, 6937, 6949, 6961, 6973, 6985, 6997, 7009, 7021, 7033, 7045, + 7057, 7069, 7081, 7093, 7105, 7117, 7129, 7141, 7153, 7165, 7177, 7189, 7201, + 7213, 7225, 7237, 7249, 7261, 7273, 7285, 7297, 7309, 7321, 7333, 7345, 7357, + 7369, 7381, 7393, 7405, 7417, 7429, 7441, 7453, 7465, 7477, 7501, 7513, 7525, + 7537, 7549, 7561, 7573, 7585, 7597, 7609, 7621, 7633, 7645, 7657, 7669, 7681, + 7693, 7705, 7717, 7729, 7741, 7753, 7765, 7777, 7789, 7801, 7813, 7825, 7837, + 7849, 7861, 7873, 7885, 7897, 7909, 7921, 7933, 7945, 7957, 7969, 7981, 7993, + 8005, 8017, 8029, 8041, 8053, 8065, 8077, 8089, 8101, 8113, 8125, 8137, 8149, + 8161, 8173, 8185, 8197, 8209, 8221, 8233, 8245, 8257, 8269, 8281, 8293, 8305, + 8317, 8329, 8341, 8353, 8365, 8377, 8389, 8401, 8413, 8425, 8437, 8449, 8461, + 8473, 8485, 8497, 8509, 8521, 8533, 8545, 8557, 8569, 8581, 8593, 8605, 8617, + 8629, 8641, 8653, 8665, 8677, 8689, 8701, 8713, 8725, 8737, 8749, 8761, 8773, + 8785, 8797, 8809, 8821, 8833, 8845, 8857, 8869, 8881, 8893, 8905, 8917, 8929, + 8941, 8953, 8965, 8977, 8989, 9001, 9013, 9025, 9037, 9049, 9061, 9073, 9085, + 9097, 9109, 9121, 9133, 9145, 9157, 9169, 9181, 9193, 9205, 9217, 9229, 9241, + 9253, 9265, 9277, 9289, 9301, 9313, 9325, 9337, 9349, 9361, 9373, 9385, 9397, + 9409, 9421, 9433, 9445, 9457, 9469, 9481, 9493, 9505, 9517, 9529, 9541, 9553, + 9565, 9577, 9589, 9601, 9613, 9625, 9637, 9649, 9661, 9673, 9685, 9697, 9709, + 9721, 9733, 9745, 9757, 9769, 9781, 9793, 9805, 9817, 9829, 9841, 9853, 9865, + 9877, 9889, 9901, 9913, 9925, 9937, 9949, 9961, 9973, + }, + /* 10 */ + { + 14, 26, 38, 50, 62, 74, 86, 98, 110, 122, 134, 146, 158, + 170, 182, 194, 206, 218, 230, 242, 254, 266, 278, 290, 302, 314, + 326, 338, 350, 362, 374, 386, 398, 410, 422, 434, 446, 458, 470, + 482, 494, 506, 518, 530, 542, 554, 566, 578, 590, 602, 614, 626, + 638, 650, 662, 674, 686, 698, 710, 722, 734, 746, 758, 770, 782, + 794, 806, 818, 830, 842, 854, 866, 878, 890, 902, 914, 926, 938, + 950, 962, 974, 986, 998, 1010, 1022, 1034, 1046, 1058, 1070, 1082, 1094, + 1106, 1118, 1130, 1142, 1154, 1166, 1178, 1190, 1202, 1214, 1226, 1238, 1250, + 1262, 1274, 1286, 1298, 1310, 1322, 1334, 1346, 1358, 1370, 1382, 1394, 1406, + 1418, 1430, 1442, 1454, 1466, 1478, 1490, 1502, 1514, 1526, 1538, 1550, 1562, + 1574, 1586, 1598, 1610, 1622, 1634, 1646, 1658, 1670, 1682, 1694, 1706, 1718, + 1730, 1742, 1754, 1766, 1778, 1790, 1802, 1814, 1826, 1838, 1850, 1862, 1874, + 1886, 1898, 1910, 1922, 1934, 1946, 1958, 1970, 1982, 1994, 2006, 2018, 2030, + 2042, 2054, 2066, 2078, 2090, 2102, 2114, 2126, 2138, 2150, 2162, 2174, 2186, + 2198, 2210, 2222, 2234, 2246, 2258, 2270, 2282, 2294, 2306, 2318, 2330, 2342, + 2354, 2366, 2378, 2390, 2402, 2414, 2426, 2438, 2450, 2462, 2474, 2486, 2510, + 2522, 2534, 2546, 2558, 2570, 2582, 2594, 2606, 2618, 2630, 2642, 2654, 2666, + 2678, 2690, 2702, 2714, 2726, 2738, 2750, 2762, 2774, 2786, 2798, 2810, 2822, + 2834, 2846, 2858, 2870, 2882, 2894, 2906, 2918, 2930, 2942, 2954, 2966, 2978, + 2990, 3002, 3014, 3026, 3038, 3050, 3062, 3074, 3086, 3098, 3110, 3122, 3134, + 3146, 3158, 3170, 3182, 3194, 3206, 3218, 3230, 3242, 3254, 3266, 3278, 3290, + 3302, 3314, 3326, 3338, 3350, 3362, 3374, 3386, 3398, 3410, 3422, 3434, 3446, + 3458, 3470, 3482, 3494, 3506, 3518, 3530, 3542, 3554, 3566, 3578, 3590, 3602, + 3614, 3626, 3638, 3650, 3662, 3674, 3686, 3698, 3710, 3722, 3734, 3746, 3758, + 3770, 3782, 3794, 3806, 3818, 3830, 3842, 3854, 3866, 3878, 3890, 3902, 3914, + 3926, 3938, 3950, 3962, 3974, 3986, 3998, 4010, 4022, 4034, 4046, 4058, 4070, + 4082, 4094, 4106, 4118, 4130, 4142, 4154, 4166, 4178, 4190, 4202, 4214, 4226, + 4238, 4250, 4262, 4274, 4286, 4298, 4310, 4322, 4334, 4346, 4358, 4370, 4382, + 4394, 4406, 4418, 4430, 4442, 4454, 4466, 4478, 4490, 4502, 4514, 4526, 4538, + 4550, 4562, 4574, 4586, 4598, 4610, 4622, 4634, 4646, 4658, 4670, 4682, 4694, + 4706, 4718, 4730, 4742, 4754, 4766, 4778, 4790, 4802, 4814, 4826, 4838, 4850, + 4862, 4874, 4886, 4898, 4910, 4922, 4934, 4946, 4958, 4970, 4982, 5006, 5018, + 5030, 5042, 5054, 5066, 5078, 5090, 5102, 5114, 5126, 5138, 5150, 5162, 5174, + 5186, 5198, 5210, 5222, 5234, 5246, 5258, 5270, 5282, 5294, 5306, 5318, 5330, + 5342, 5354, 5366, 5378, 5390, 5402, 5414, 5426, 5438, 5450, 5462, 5474, 5486, + 5498, 5510, 5522, 5534, 5546, 5558, 5570, 5582, 5594, 5606, 5618, 5630, 5642, + 5654, 5666, 5678, 5690, 5702, 5714, 5726, 5738, 5750, 5762, 5774, 5786, 5798, + 5810, 5822, 5834, 5846, 5858, 5870, 5882, 5894, 5906, 5918, 5930, 5942, 5954, + 5966, 5978, 5990, 6002, 6014, 6026, 6038, 6050, 6062, 6074, 6086, 6098, 6110, + 6122, 6134, 6146, 6158, 6170, 6182, 6194, 6206, 6218, 6230, 6242, 6254, 6266, + 6278, 6290, 6302, 6314, 6326, 6338, 6350, 6362, 6374, 6386, 6398, 6410, 6422, + 6434, 6446, 6458, 6470, 6482, 6494, 6506, 6518, 6530, 6542, 6554, 6566, 6578, + 6590, 6602, 6614, 6626, 6638, 6650, 6662, 6674, 6686, 6698, 6710, 6722, 6734, + 6746, 6758, 6770, 6782, 6794, 6806, 6818, 6830, 6842, 6854, 6866, 6878, 6890, + 6902, 6914, 6926, 6938, 6950, 6962, 6974, 6986, 6998, 7010, 7022, 7034, 7046, + 7058, 7070, 7082, 7094, 7106, 7118, 7130, 7142, 7154, 7166, 7178, 7190, 7202, + 7214, 7226, 7238, 7250, 7262, 7274, 7286, 7298, 7310, 7322, 7334, 7346, 7358, + 7370, 7382, 7394, 7406, 7418, 7430, 7442, 7454, 7466, 7478, 7502, 7514, 7526, + 7538, 7550, 7562, 7574, 7586, 7598, 7610, 7622, 7634, 7646, 7658, 7670, 7682, + 7694, 7706, 7718, 7730, 7742, 7754, 7766, 7778, 7790, 7802, 7814, 7826, 7838, + 7850, 7862, 7874, 7886, 7898, 7910, 7922, 7934, 7946, 7958, 7970, 7982, 7994, + 8006, 8018, 8030, 8042, 8054, 8066, 8078, 8090, 8102, 8114, 8126, 8138, 8150, + 8162, 8174, 8186, 8198, 8210, 8222, 8234, 8246, 8258, 8270, 8282, 8294, 8306, + 8318, 8330, 8342, 8354, 8366, 8378, 8390, 8402, 8414, 8426, 8438, 8450, 8462, + 8474, 8486, 8498, 8510, 8522, 8534, 8546, 8558, 8570, 8582, 8594, 8606, 8618, + 8630, 8642, 8654, 8666, 8678, 8690, 8702, 8714, 8726, 8738, 8750, 8762, 8774, + 8786, 8798, 8810, 8822, 8834, 8846, 8858, 8870, 8882, 8894, 8906, 8918, 8930, + 8942, 8954, 8966, 8978, 8990, 9002, 9014, 9026, 9038, 9050, 9062, 9074, 9086, + 9098, 9110, 9122, 9134, 9146, 9158, 9170, 9182, 9194, 9206, 9218, 9230, 9242, + 9254, 9266, 9278, 9290, 9302, 9314, 9326, 9338, 9350, 9362, 9374, 9386, 9398, + 9410, 9422, 9434, 9446, 9458, 9470, 9482, 9494, 9506, 9518, 9530, 9542, 9554, + 9566, 9578, 9590, 9602, 9614, 9626, 9638, 9650, 9662, 9674, 9686, 9698, 9710, + 9722, 9734, 9746, 9758, 9770, 9782, 9794, 9806, 9818, 9830, 9842, 9854, 9866, + 9878, 9890, 9902, 9914, 9926, 9938, 9950, 9962, 9974, + }, + /* 11 */ + { + 15, 27, 39, 51, 63, 75, 87, 99, 111, 123, 135, 147, 159, + 171, 183, 195, 207, 219, 231, 243, 255, 267, 279, 291, 303, 315, + 327, 339, 351, 363, 375, 387, 399, 411, 423, 435, 447, 459, 471, + 483, 495, 507, 519, 531, 543, 555, 567, 579, 591, 603, 615, 627, + 639, 651, 663, 675, 687, 699, 711, 723, 735, 747, 759, 771, 783, + 795, 807, 819, 831, 843, 855, 867, 879, 891, 903, 915, 927, 939, + 951, 963, 975, 987, 999, 1011, 1023, 1035, 1047, 1059, 1071, 1083, 1095, + 1107, 1119, 1131, 1143, 1155, 1167, 1179, 1191, 1203, 1215, 1227, 1239, 1251, + 1263, 1275, 1287, 1299, 1311, 1323, 1335, 1347, 1359, 1371, 1383, 1395, 1407, + 1419, 1431, 1443, 1455, 1467, 1479, 1491, 1503, 1515, 1527, 1539, 1551, 1563, + 1575, 1587, 1599, 1611, 1623, 1635, 1647, 1659, 1671, 1683, 1695, 1707, 1719, + 1731, 1743, 1755, 1767, 1779, 1791, 1803, 1815, 1827, 1839, 1851, 1863, 1875, + 1887, 1899, 1911, 1923, 1935, 1947, 1959, 1971, 1983, 1995, 2007, 2019, 2031, + 2043, 2055, 2067, 2079, 2091, 2103, 2115, 2127, 2139, 2151, 2163, 2175, 2187, + 2199, 2211, 2223, 2235, 2247, 2259, 2271, 2283, 2295, 2307, 2319, 2331, 2343, + 2355, 2367, 2379, 2391, 2403, 2415, 2427, 2439, 2451, 2463, 2475, 2487, 2511, + 2523, 2535, 2547, 2559, 2571, 2583, 2595, 2607, 2619, 2631, 2643, 2655, 2667, + 2679, 2691, 2703, 2715, 2727, 2739, 2751, 2763, 2775, 2787, 2799, 2811, 2823, + 2835, 2847, 2859, 2871, 2883, 2895, 2907, 2919, 2931, 2943, 2955, 2967, 2979, + 2991, 3003, 3015, 3027, 3039, 3051, 3063, 3075, 3087, 3099, 3111, 3123, 3135, + 3147, 3159, 3171, 3183, 3195, 3207, 3219, 3231, 3243, 3255, 3267, 3279, 3291, + 3303, 3315, 3327, 3339, 3351, 3363, 3375, 3387, 3399, 3411, 3423, 3435, 3447, + 3459, 3471, 3483, 3495, 3507, 3519, 3531, 3543, 3555, 3567, 3579, 3591, 3603, + 3615, 3627, 3639, 3651, 3663, 3675, 3687, 3699, 3711, 3723, 3735, 3747, 3759, + 3771, 3783, 3795, 3807, 3819, 3831, 3843, 3855, 3867, 3879, 3891, 3903, 3915, + 3927, 3939, 3951, 3963, 3975, 3987, 3999, 4011, 4023, 4035, 4047, 4059, 4071, + 4083, 4095, 4107, 4119, 4131, 4143, 4155, 4167, 4179, 4191, 4203, 4215, 4227, + 4239, 4251, 4263, 4275, 4287, 4299, 4311, 4323, 4335, 4347, 4359, 4371, 4383, + 4395, 4407, 4419, 4431, 4443, 4455, 4467, 4479, 4491, 4503, 4515, 4527, 4539, + 4551, 4563, 4575, 4587, 4599, 4611, 4623, 4635, 4647, 4659, 4671, 4683, 4695, + 4707, 4719, 4731, 4743, 4755, 4767, 4779, 4791, 4803, 4815, 4827, 4839, 4851, + 4863, 4875, 4887, 4899, 4911, 4923, 4935, 4947, 4959, 4971, 4983, 5007, 5019, + 5031, 5043, 5055, 5067, 5079, 5091, 5103, 5115, 5127, 5139, 5151, 5163, 5175, + 5187, 5199, 5211, 5223, 5235, 5247, 5259, 5271, 5283, 5295, 5307, 5319, 5331, + 5343, 5355, 5367, 5379, 5391, 5403, 5415, 5427, 5439, 5451, 5463, 5475, 5487, + 5499, 5511, 5523, 5535, 5547, 5559, 5571, 5583, 5595, 5607, 5619, 5631, 5643, + 5655, 5667, 5679, 5691, 5703, 5715, 5727, 5739, 5751, 5763, 5775, 5787, 5799, + 5811, 5823, 5835, 5847, 5859, 5871, 5883, 5895, 5907, 5919, 5931, 5943, 5955, + 5967, 5979, 5991, 6003, 6015, 6027, 6039, 6051, 6063, 6075, 6087, 6099, 6111, + 6123, 6135, 6147, 6159, 6171, 6183, 6195, 6207, 6219, 6231, 6243, 6255, 6267, + 6279, 6291, 6303, 6315, 6327, 6339, 6351, 6363, 6375, 6387, 6399, 6411, 6423, + 6435, 6447, 6459, 6471, 6483, 6495, 6507, 6519, 6531, 6543, 6555, 6567, 6579, + 6591, 6603, 6615, 6627, 6639, 6651, 6663, 6675, 6687, 6699, 6711, 6723, 6735, + 6747, 6759, 6771, 6783, 6795, 6807, 6819, 6831, 6843, 6855, 6867, 6879, 6891, + 6903, 6915, 6927, 6939, 6951, 6963, 6975, 6987, 6999, 7011, 7023, 7035, 7047, + 7059, 7071, 7083, 7095, 7107, 7119, 7131, 7143, 7155, 7167, 7179, 7191, 7203, + 7215, 7227, 7239, 7251, 7263, 7275, 7287, 7299, 7311, 7323, 7335, 7347, 7359, + 7371, 7383, 7395, 7407, 7419, 7431, 7443, 7455, 7467, 7479, 7503, 7515, 7527, + 7539, 7551, 7563, 7575, 7587, 7599, 7611, 7623, 7635, 7647, 7659, 7671, 7683, + 7695, 7707, 7719, 7731, 7743, 7755, 7767, 7779, 7791, 7803, 7815, 7827, 7839, + 7851, 7863, 7875, 7887, 7899, 7911, 7923, 7935, 7947, 7959, 7971, 7983, 7995, + 8007, 8019, 8031, 8043, 8055, 8067, 8079, 8091, 8103, 8115, 8127, 8139, 8151, + 8163, 8175, 8187, 8199, 8211, 8223, 8235, 8247, 8259, 8271, 8283, 8295, 8307, + 8319, 8331, 8343, 8355, 8367, 8379, 8391, 8403, 8415, 8427, 8439, 8451, 8463, + 8475, 8487, 8499, 8511, 8523, 8535, 8547, 8559, 8571, 8583, 8595, 8607, 8619, + 8631, 8643, 8655, 8667, 8679, 8691, 8703, 8715, 8727, 8739, 8751, 8763, 8775, + 8787, 8799, 8811, 8823, 8835, 8847, 8859, 8871, 8883, 8895, 8907, 8919, 8931, + 8943, 8955, 8967, 8979, 8991, 9003, 9015, 9027, 9039, 9051, 9063, 9075, 9087, + 9099, 9111, 9123, 9135, 9147, 9159, 9171, 9183, 9195, 9207, 9219, 9231, 9243, + 9255, 9267, 9279, 9291, 9303, 9315, 9327, 9339, 9351, 9363, 9375, 9387, 9399, + 9411, 9423, 9435, 9447, 9459, 9471, 9483, 9495, 9507, 9519, 9531, 9543, 9555, + 9567, 9579, 9591, 9603, 9615, 9627, 9639, 9651, 9663, 9675, 9687, 9699, 9711, + 9723, 9735, 9747, 9759, 9771, 9783, 9795, 9807, 9819, 9831, 9843, 9855, 9867, + 9879, 9891, 9903, 9915, 9927, 9939, 9951, 9963, 9975, + }, }; const unsigned int enco_which_dibits[12][828] = { - /* 0 */ - {6, 4, 2, 0, 102, 100, 98, 96, - 198, 196, 194, 192, 294, 292, 290, 288, - 390, 388, 386, 384, 486, 484, 482, 480, - 582, 580, 578, 576, 678, 676, 674, 672, - 774, 772, 770, 768, 870, 868, 866, 864, - 966, 964, 962, 960, 1062, 1060, 1058, 1056, - 1158, 1156, 1154, 1152, 1254, 1252, 1250, 1248, - 1350, 1348, 1346, 1344, 1446, 1444, 1442, 1440, - 1542, 1540, 1538, 1536, 1638, 1636, 1634, 1632, - 1798, 1796, 1794, 1792, 1894, 1892, 1890, 1888, - 1990, 1988, 1986, 1984, 2086, 2084, 2082, 2080, - 2182, 2180, 2178, 2176, 2278, 2276, 2274, 2272, - 2374, 2372, 2370, 2368, 2470, 2468, 2466, 2464, - 2566, 2564, 2562, 2560, 2662, 2660, 2658, 2656, - 2758, 2756, 2754, 2752, 2854, 2852, 2850, 2848, - 2950, 2948, 2946, 2944, 3046, 3044, 3042, 3040, - 3142, 3140, 3138, 3136, 3238, 3236, 3234, 3232, - 3334, 3332, 3330, 3328, 3398, 3396, 3394, 3392, - 3494, 3492, 3490, 3488, 3590, 3588, 3586, 3584, - 3686, 3684, 3682, 3680, 3782, 3780, 3778, 3776, - 3878, 3876, 3874, 3872, 3974, 3972, 3970, 3968, - 4070, 4068, 4066, 4064, 4166, 4164, 4162, 4160, - 4262, 4260, 4258, 4256, 4358, 4356, 4354, 4352, - 4454, 4452, 4450, 4448, 4550, 4548, 4546, 4544, - 4646, 4644, 4642, 4640, 4742, 4740, 4738, 4736, - 4838, 4836, 4834, 4832, 4934, 4932, 4930, 4928, - 4998, 4996, 4994, 4992, 5094, 5092, 5090, 5088, - 5190, 5188, 5186, 5184, 5286, 5284, 5282, 5280, - 5382, 5380, 5378, 5376, 5478, 5476, 5474, 5472, - 5574, 5572, 5570, 5568, 5670, 5668, 5666, 5664, - 5766, 5764, 5762, 5760, 5862, 5860, 5858, 5856, - 5958, 5956, 5954, 5952, 6054, 6052, 6050, 6048, - 6150, 6148, 6146, 6144, 6246, 6244, 6242, 6240, - 6342, 6340, 6338, 6336, 6438, 6436, 6434, 6432, - 6534, 6532, 6530, 6528, 6694, 6692, 6690, 6688, - 6790, 6788, 6786, 6784, 6886, 6884, 6882, 6880, - 6982, 6980, 6978, 6976, 7078, 7076, 7074, 7072, - 7174, 7172, 7170, 7168, 7270, 7268, 7266, 7264, - 7366, 7364, 7362, 7360, 7462, 7460, 7458, 7456, - 7558, 7556, 7554, 7552, 7654, 7652, 7650, 7648, - 7750, 7748, 7746, 7744, 7846, 7844, 7842, 7840, - 7942, 7940, 7938, 7936, 8038, 8036, 8034, 8032, - 8134, 8132, 8130, 8128, 8230, 8228, 8226, 8224, - 8326, 8324, 8322, 8320, 8390, 8388, 8386, 8384, - 8486, 8484, 8482, 8480, 8582, 8580, 8578, 8576, - 8678, 8676, 8674, 8672, 8774, 8772, 8770, 8768, - 8870, 8868, 8866, 8864, 8966, 8964, 8962, 8960, - 9062, 9060, 9058, 9056, 9158, 9156, 9154, 9152, - 9254, 9252, 9250, 9248, 9350, 9348, 9346, 9344, - 9446, 9444, 9442, 9440, 9542, 9540, 9538, 9536, - 9638, 9636, 9634, 9632, 9734, 9732, 9730, 9728, - 9830, 9828, 9826, 9824, 9926, 9924, 9922, 9920, - 9990, 9988, 9986, 9984, 10086, 10084, 10082, 10080, - 10182, 10180, 10178, 10176, 10278, 10276, 10274, 10272, - 10374, 10372, 10370, 10368, 10470, 10468, 10466, 10464, - 10566, 10564, 10562, 10560, 10662, 10660, 10658, 10656, - 10758, 10756, 10754, 10752, 10854, 10852, 10850, 10848, - 10950, 10948, 10946, 10944, 11046, 11044, 11042, 11040, - 11142, 11140, 11138, 11136, 11238, 11236, 11234, 11232, - 11334, 11332, 11330, 11328, 11430, 11428, 11426, 11424, - 11526, 11524, 11522, 11520, 11686, 11684, 11682, 11680, - 11782, 11780, 11778, 11776, 11878, 11876, 11874, 11872, - 11974, 11972, 11970, 11968, 12070, 12068, 12066, 12064, - 12166, 12164, 12162, 12160, 12262, 12260, 12258, 12256, - 12358, 12356, 12354, 12352, 12454, 12452, 12450, 12448, - 12550, 12548, 12546, 12544, 12646, 12644, 12642, 12640, - 12742, 12740, 12738, 12736, 12838, 12836, 12834, 12832, - 12934, 12932, 12930, 12928, 13030, 13028, 13026, 13024, - 13126, 13124, 13122, 13120, 13222, 13220, 13218, 13216, - 13286, 13284, 13282, 13280, 13382, 13380, 13378, 13376, - 13478, 13476, 13474, 13472, 13574, 13572, 13570, 13568, - 13670, 13668, 13666, 13664, 13766, 13764, 13762, 13760, - 13862, 13860, 13858, 13856, 13958, 13956, 13954, 13952, - 14054, 14052, 14050, 14048, 14150, 14148, 14146, 14144, - 14246, 14244, 14242, 14240, 14342, 14340, 14338, 14336, - 14438, 14436, 14434, 14432, 14534, 14532, 14530, 14528, - 14630, 14628, 14626, 14624, 14726, 14724, 14722, 14720, - 14822, 14820, 14818, 14816, 14918, 14916, 14914, 14912, - 14982, 14980, 14978, 14976, 15078, 15076, 15074, 15072, - 15174, 15172, 15170, 15168, 15270, 15268, 15266, 15264, - 15366, 15364, 15362, 15360, 15462, 15460, 15458, 15456, - 15558, 15556, 15554, 15552, 15654, 15652, 15650, 15648, - 15750, 15748, 15746, 15744, 15846, 15844, 15842, 15840, - 15942, 15940, 15938, 15936, 16038, 16036, 16034, 16032, - 16134, 16132, 16130, 16128, 16230, 16228, 16226, 16224, - 16326, 16324, 16322, 16320, 16422, 16420, 16418, 16416, - 16518, 16516, 16514, 16512, 16678, 16676, 16674, 16672, - 16774, 16772, 16770, 16768, 16870, 16868, 16866, 16864, - 16966, 16964, 16962, 16960, 17062, 17060, 17058, 17056, - 17158, 17156, 17154, 17152, 17254, 17252, 17250, 17248, - 17350, 17348, 17346, 17344, 17446, 17444, 17442, 17440, - 17542, 17540, 17538, 17536, 17638, 17636, 17634, 17632, - 17734, 17732, 17730, 17728, 17830, 17828, 17826, 17824, - 17926, 17924, 17922, 17920, 18022, 18020, 18018, 18016, - 18118, 18116, 18114, 18112, 18214, 18212, 18210, 18208, - 18278, 18276, 18274, 18272, 18374, 18372, 18370, 18368, - 18470, 18468, 18466, 18464, 18566, 18564, 18562, 18560, - 18662, 18660, 18658, 18656, 18758, 18756, 18754, 18752, - 18854, 18852, 18850, 18848, 18950, 18948, 18946, 18944, - 19046, 19044, 19042, 19040, 19142, 19140, 19138, 19136, - 19238, 19236, 19234, 19232, 19334, 19332, 19330, 19328, - 19430, 19428, 19426, 19424, 19526, 19524, 19522, 19520, - 19622, 19620, 19618, 19616, 19718, 19716, 19714, 19712, - 19814, 19812, 19810, 19808, }, - /* 1 */ - {14, 12, 10, 8, 110, 108, 106, 104, - 206, 204, 202, 200, 302, 300, 298, 296, - 398, 396, 394, 392, 494, 492, 490, 488, - 590, 588, 586, 584, 686, 684, 682, 680, - 782, 780, 778, 776, 878, 876, 874, 872, - 974, 972, 970, 968, 1070, 1068, 1066, 1064, - 1166, 1164, 1162, 1160, 1262, 1260, 1258, 1256, - 1358, 1356, 1354, 1352, 1454, 1452, 1450, 1448, - 1550, 1548, 1546, 1544, 1646, 1644, 1642, 1640, - 1806, 1804, 1802, 1800, 1902, 1900, 1898, 1896, - 1998, 1996, 1994, 1992, 2094, 2092, 2090, 2088, - 2190, 2188, 2186, 2184, 2286, 2284, 2282, 2280, - 2382, 2380, 2378, 2376, 2478, 2476, 2474, 2472, - 2574, 2572, 2570, 2568, 2670, 2668, 2666, 2664, - 2766, 2764, 2762, 2760, 2862, 2860, 2858, 2856, - 2958, 2956, 2954, 2952, 3054, 3052, 3050, 3048, - 3150, 3148, 3146, 3144, 3246, 3244, 3242, 3240, - 3342, 3340, 3338, 3336, 3406, 3404, 3402, 3400, - 3502, 3500, 3498, 3496, 3598, 3596, 3594, 3592, - 3694, 3692, 3690, 3688, 3790, 3788, 3786, 3784, - 3886, 3884, 3882, 3880, 3982, 3980, 3978, 3976, - 4078, 4076, 4074, 4072, 4174, 4172, 4170, 4168, - 4270, 4268, 4266, 4264, 4366, 4364, 4362, 4360, - 4462, 4460, 4458, 4456, 4558, 4556, 4554, 4552, - 4654, 4652, 4650, 4648, 4750, 4748, 4746, 4744, - 4846, 4844, 4842, 4840, 4942, 4940, 4938, 4936, - 5006, 5004, 5002, 5000, 5102, 5100, 5098, 5096, - 5198, 5196, 5194, 5192, 5294, 5292, 5290, 5288, - 5390, 5388, 5386, 5384, 5486, 5484, 5482, 5480, - 5582, 5580, 5578, 5576, 5678, 5676, 5674, 5672, - 5774, 5772, 5770, 5768, 5870, 5868, 5866, 5864, - 5966, 5964, 5962, 5960, 6062, 6060, 6058, 6056, - 6158, 6156, 6154, 6152, 6254, 6252, 6250, 6248, - 6350, 6348, 6346, 6344, 6446, 6444, 6442, 6440, - 6542, 6540, 6538, 6536, 6702, 6700, 6698, 6696, - 6798, 6796, 6794, 6792, 6894, 6892, 6890, 6888, - 6990, 6988, 6986, 6984, 7086, 7084, 7082, 7080, - 7182, 7180, 7178, 7176, 7278, 7276, 7274, 7272, - 7374, 7372, 7370, 7368, 7470, 7468, 7466, 7464, - 7566, 7564, 7562, 7560, 7662, 7660, 7658, 7656, - 7758, 7756, 7754, 7752, 7854, 7852, 7850, 7848, - 7950, 7948, 7946, 7944, 8046, 8044, 8042, 8040, - 8142, 8140, 8138, 8136, 8238, 8236, 8234, 8232, - 8334, 8332, 8330, 8328, 8398, 8396, 8394, 8392, - 8494, 8492, 8490, 8488, 8590, 8588, 8586, 8584, - 8686, 8684, 8682, 8680, 8782, 8780, 8778, 8776, - 8878, 8876, 8874, 8872, 8974, 8972, 8970, 8968, - 9070, 9068, 9066, 9064, 9166, 9164, 9162, 9160, - 9262, 9260, 9258, 9256, 9358, 9356, 9354, 9352, - 9454, 9452, 9450, 9448, 9550, 9548, 9546, 9544, - 9646, 9644, 9642, 9640, 9742, 9740, 9738, 9736, - 9838, 9836, 9834, 9832, 9934, 9932, 9930, 9928, - 9998, 9996, 9994, 9992, 10094, 10092, 10090, 10088, - 10190, 10188, 10186, 10184, 10286, 10284, 10282, 10280, - 10382, 10380, 10378, 10376, 10478, 10476, 10474, 10472, - 10574, 10572, 10570, 10568, 10670, 10668, 10666, 10664, - 10766, 10764, 10762, 10760, 10862, 10860, 10858, 10856, - 10958, 10956, 10954, 10952, 11054, 11052, 11050, 11048, - 11150, 11148, 11146, 11144, 11246, 11244, 11242, 11240, - 11342, 11340, 11338, 11336, 11438, 11436, 11434, 11432, - 11534, 11532, 11530, 11528, 11694, 11692, 11690, 11688, - 11790, 11788, 11786, 11784, 11886, 11884, 11882, 11880, - 11982, 11980, 11978, 11976, 12078, 12076, 12074, 12072, - 12174, 12172, 12170, 12168, 12270, 12268, 12266, 12264, - 12366, 12364, 12362, 12360, 12462, 12460, 12458, 12456, - 12558, 12556, 12554, 12552, 12654, 12652, 12650, 12648, - 12750, 12748, 12746, 12744, 12846, 12844, 12842, 12840, - 12942, 12940, 12938, 12936, 13038, 13036, 13034, 13032, - 13134, 13132, 13130, 13128, 13230, 13228, 13226, 13224, - 13294, 13292, 13290, 13288, 13390, 13388, 13386, 13384, - 13486, 13484, 13482, 13480, 13582, 13580, 13578, 13576, - 13678, 13676, 13674, 13672, 13774, 13772, 13770, 13768, - 13870, 13868, 13866, 13864, 13966, 13964, 13962, 13960, - 14062, 14060, 14058, 14056, 14158, 14156, 14154, 14152, - 14254, 14252, 14250, 14248, 14350, 14348, 14346, 14344, - 14446, 14444, 14442, 14440, 14542, 14540, 14538, 14536, - 14638, 14636, 14634, 14632, 14734, 14732, 14730, 14728, - 14830, 14828, 14826, 14824, 14926, 14924, 14922, 14920, - 14990, 14988, 14986, 14984, 15086, 15084, 15082, 15080, - 15182, 15180, 15178, 15176, 15278, 15276, 15274, 15272, - 15374, 15372, 15370, 15368, 15470, 15468, 15466, 15464, - 15566, 15564, 15562, 15560, 15662, 15660, 15658, 15656, - 15758, 15756, 15754, 15752, 15854, 15852, 15850, 15848, - 15950, 15948, 15946, 15944, 16046, 16044, 16042, 16040, - 16142, 16140, 16138, 16136, 16238, 16236, 16234, 16232, - 16334, 16332, 16330, 16328, 16430, 16428, 16426, 16424, - 16526, 16524, 16522, 16520, 16686, 16684, 16682, 16680, - 16782, 16780, 16778, 16776, 16878, 16876, 16874, 16872, - 16974, 16972, 16970, 16968, 17070, 17068, 17066, 17064, - 17166, 17164, 17162, 17160, 17262, 17260, 17258, 17256, - 17358, 17356, 17354, 17352, 17454, 17452, 17450, 17448, - 17550, 17548, 17546, 17544, 17646, 17644, 17642, 17640, - 17742, 17740, 17738, 17736, 17838, 17836, 17834, 17832, - 17934, 17932, 17930, 17928, 18030, 18028, 18026, 18024, - 18126, 18124, 18122, 18120, 18222, 18220, 18218, 18216, - 18286, 18284, 18282, 18280, 18382, 18380, 18378, 18376, - 18478, 18476, 18474, 18472, 18574, 18572, 18570, 18568, - 18670, 18668, 18666, 18664, 18766, 18764, 18762, 18760, - 18862, 18860, 18858, 18856, 18958, 18956, 18954, 18952, - 19054, 19052, 19050, 19048, 19150, 19148, 19146, 19144, - 19246, 19244, 19242, 19240, 19342, 19340, 19338, 19336, - 19438, 19436, 19434, 19432, 19534, 19532, 19530, 19528, - 19630, 19628, 19626, 19624, 19726, 19724, 19722, 19720, - 19822, 19820, 19818, 19816, }, - /* 2 */ - {22, 20, 18, 16, 118, 116, 114, 112, - 214, 212, 210, 208, 310, 308, 306, 304, - 406, 404, 402, 400, 502, 500, 498, 496, - 598, 596, 594, 592, 694, 692, 690, 688, - 790, 788, 786, 784, 886, 884, 882, 880, - 982, 980, 978, 976, 1078, 1076, 1074, 1072, - 1174, 1172, 1170, 1168, 1270, 1268, 1266, 1264, - 1366, 1364, 1362, 1360, 1462, 1460, 1458, 1456, - 1558, 1556, 1554, 1552, 1654, 1652, 1650, 1648, - 1814, 1812, 1810, 1808, 1910, 1908, 1906, 1904, - 2006, 2004, 2002, 2000, 2102, 2100, 2098, 2096, - 2198, 2196, 2194, 2192, 2294, 2292, 2290, 2288, - 2390, 2388, 2386, 2384, 2486, 2484, 2482, 2480, - 2582, 2580, 2578, 2576, 2678, 2676, 2674, 2672, - 2774, 2772, 2770, 2768, 2870, 2868, 2866, 2864, - 2966, 2964, 2962, 2960, 3062, 3060, 3058, 3056, - 3158, 3156, 3154, 3152, 3254, 3252, 3250, 3248, - 3350, 3348, 3346, 3344, 3414, 3412, 3410, 3408, - 3510, 3508, 3506, 3504, 3606, 3604, 3602, 3600, - 3702, 3700, 3698, 3696, 3798, 3796, 3794, 3792, - 3894, 3892, 3890, 3888, 3990, 3988, 3986, 3984, - 4086, 4084, 4082, 4080, 4182, 4180, 4178, 4176, - 4278, 4276, 4274, 4272, 4374, 4372, 4370, 4368, - 4470, 4468, 4466, 4464, 4566, 4564, 4562, 4560, - 4662, 4660, 4658, 4656, 4758, 4756, 4754, 4752, - 4854, 4852, 4850, 4848, 4950, 4948, 4946, 4944, - 5014, 5012, 5010, 5008, 5110, 5108, 5106, 5104, - 5206, 5204, 5202, 5200, 5302, 5300, 5298, 5296, - 5398, 5396, 5394, 5392, 5494, 5492, 5490, 5488, - 5590, 5588, 5586, 5584, 5686, 5684, 5682, 5680, - 5782, 5780, 5778, 5776, 5878, 5876, 5874, 5872, - 5974, 5972, 5970, 5968, 6070, 6068, 6066, 6064, - 6166, 6164, 6162, 6160, 6262, 6260, 6258, 6256, - 6358, 6356, 6354, 6352, 6454, 6452, 6450, 6448, - 6550, 6548, 6546, 6544, 6710, 6708, 6706, 6704, - 6806, 6804, 6802, 6800, 6902, 6900, 6898, 6896, - 6998, 6996, 6994, 6992, 7094, 7092, 7090, 7088, - 7190, 7188, 7186, 7184, 7286, 7284, 7282, 7280, - 7382, 7380, 7378, 7376, 7478, 7476, 7474, 7472, - 7574, 7572, 7570, 7568, 7670, 7668, 7666, 7664, - 7766, 7764, 7762, 7760, 7862, 7860, 7858, 7856, - 7958, 7956, 7954, 7952, 8054, 8052, 8050, 8048, - 8150, 8148, 8146, 8144, 8246, 8244, 8242, 8240, - 8342, 8340, 8338, 8336, 8406, 8404, 8402, 8400, - 8502, 8500, 8498, 8496, 8598, 8596, 8594, 8592, - 8694, 8692, 8690, 8688, 8790, 8788, 8786, 8784, - 8886, 8884, 8882, 8880, 8982, 8980, 8978, 8976, - 9078, 9076, 9074, 9072, 9174, 9172, 9170, 9168, - 9270, 9268, 9266, 9264, 9366, 9364, 9362, 9360, - 9462, 9460, 9458, 9456, 9558, 9556, 9554, 9552, - 9654, 9652, 9650, 9648, 9750, 9748, 9746, 9744, - 9846, 9844, 9842, 9840, 9942, 9940, 9938, 9936, - 10006, 10004, 10002, 10000, 10102, 10100, 10098, 10096, - 10198, 10196, 10194, 10192, 10294, 10292, 10290, 10288, - 10390, 10388, 10386, 10384, 10486, 10484, 10482, 10480, - 10582, 10580, 10578, 10576, 10678, 10676, 10674, 10672, - 10774, 10772, 10770, 10768, 10870, 10868, 10866, 10864, - 10966, 10964, 10962, 10960, 11062, 11060, 11058, 11056, - 11158, 11156, 11154, 11152, 11254, 11252, 11250, 11248, - 11350, 11348, 11346, 11344, 11446, 11444, 11442, 11440, - 11542, 11540, 11538, 11536, 11702, 11700, 11698, 11696, - 11798, 11796, 11794, 11792, 11894, 11892, 11890, 11888, - 11990, 11988, 11986, 11984, 12086, 12084, 12082, 12080, - 12182, 12180, 12178, 12176, 12278, 12276, 12274, 12272, - 12374, 12372, 12370, 12368, 12470, 12468, 12466, 12464, - 12566, 12564, 12562, 12560, 12662, 12660, 12658, 12656, - 12758, 12756, 12754, 12752, 12854, 12852, 12850, 12848, - 12950, 12948, 12946, 12944, 13046, 13044, 13042, 13040, - 13142, 13140, 13138, 13136, 13238, 13236, 13234, 13232, - 13302, 13300, 13298, 13296, 13398, 13396, 13394, 13392, - 13494, 13492, 13490, 13488, 13590, 13588, 13586, 13584, - 13686, 13684, 13682, 13680, 13782, 13780, 13778, 13776, - 13878, 13876, 13874, 13872, 13974, 13972, 13970, 13968, - 14070, 14068, 14066, 14064, 14166, 14164, 14162, 14160, - 14262, 14260, 14258, 14256, 14358, 14356, 14354, 14352, - 14454, 14452, 14450, 14448, 14550, 14548, 14546, 14544, - 14646, 14644, 14642, 14640, 14742, 14740, 14738, 14736, - 14838, 14836, 14834, 14832, 14934, 14932, 14930, 14928, - 14998, 14996, 14994, 14992, 15094, 15092, 15090, 15088, - 15190, 15188, 15186, 15184, 15286, 15284, 15282, 15280, - 15382, 15380, 15378, 15376, 15478, 15476, 15474, 15472, - 15574, 15572, 15570, 15568, 15670, 15668, 15666, 15664, - 15766, 15764, 15762, 15760, 15862, 15860, 15858, 15856, - 15958, 15956, 15954, 15952, 16054, 16052, 16050, 16048, - 16150, 16148, 16146, 16144, 16246, 16244, 16242, 16240, - 16342, 16340, 16338, 16336, 16438, 16436, 16434, 16432, - 16534, 16532, 16530, 16528, 16694, 16692, 16690, 16688, - 16790, 16788, 16786, 16784, 16886, 16884, 16882, 16880, - 16982, 16980, 16978, 16976, 17078, 17076, 17074, 17072, - 17174, 17172, 17170, 17168, 17270, 17268, 17266, 17264, - 17366, 17364, 17362, 17360, 17462, 17460, 17458, 17456, - 17558, 17556, 17554, 17552, 17654, 17652, 17650, 17648, - 17750, 17748, 17746, 17744, 17846, 17844, 17842, 17840, - 17942, 17940, 17938, 17936, 18038, 18036, 18034, 18032, - 18134, 18132, 18130, 18128, 18230, 18228, 18226, 18224, - 18294, 18292, 18290, 18288, 18390, 18388, 18386, 18384, - 18486, 18484, 18482, 18480, 18582, 18580, 18578, 18576, - 18678, 18676, 18674, 18672, 18774, 18772, 18770, 18768, - 18870, 18868, 18866, 18864, 18966, 18964, 18962, 18960, - 19062, 19060, 19058, 19056, 19158, 19156, 19154, 19152, - 19254, 19252, 19250, 19248, 19350, 19348, 19346, 19344, - 19446, 19444, 19442, 19440, 19542, 19540, 19538, 19536, - 19638, 19636, 19634, 19632, 19734, 19732, 19730, 19728, - 19830, 19828, 19826, 19824, }, - /* 3 */ - {30, 28, 26, 24, 126, 124, 122, 120, - 222, 220, 218, 216, 318, 316, 314, 312, - 414, 412, 410, 408, 510, 508, 506, 504, - 606, 604, 602, 600, 702, 700, 698, 696, - 798, 796, 794, 792, 894, 892, 890, 888, - 990, 988, 986, 984, 1086, 1084, 1082, 1080, - 1182, 1180, 1178, 1176, 1278, 1276, 1274, 1272, - 1374, 1372, 1370, 1368, 1470, 1468, 1466, 1464, - 1566, 1564, 1562, 1560, 1662, 1660, 1658, 1656, - 1822, 1820, 1818, 1816, 1918, 1916, 1914, 1912, - 2014, 2012, 2010, 2008, 2110, 2108, 2106, 2104, - 2206, 2204, 2202, 2200, 2302, 2300, 2298, 2296, - 2398, 2396, 2394, 2392, 2494, 2492, 2490, 2488, - 2590, 2588, 2586, 2584, 2686, 2684, 2682, 2680, - 2782, 2780, 2778, 2776, 2878, 2876, 2874, 2872, - 2974, 2972, 2970, 2968, 3070, 3068, 3066, 3064, - 3166, 3164, 3162, 3160, 3262, 3260, 3258, 3256, - 3358, 3356, 3354, 3352, 3422, 3420, 3418, 3416, - 3518, 3516, 3514, 3512, 3614, 3612, 3610, 3608, - 3710, 3708, 3706, 3704, 3806, 3804, 3802, 3800, - 3902, 3900, 3898, 3896, 3998, 3996, 3994, 3992, - 4094, 4092, 4090, 4088, 4190, 4188, 4186, 4184, - 4286, 4284, 4282, 4280, 4382, 4380, 4378, 4376, - 4478, 4476, 4474, 4472, 4574, 4572, 4570, 4568, - 4670, 4668, 4666, 4664, 4766, 4764, 4762, 4760, - 4862, 4860, 4858, 4856, 4958, 4956, 4954, 4952, - 5022, 5020, 5018, 5016, 5118, 5116, 5114, 5112, - 5214, 5212, 5210, 5208, 5310, 5308, 5306, 5304, - 5406, 5404, 5402, 5400, 5502, 5500, 5498, 5496, - 5598, 5596, 5594, 5592, 5694, 5692, 5690, 5688, - 5790, 5788, 5786, 5784, 5886, 5884, 5882, 5880, - 5982, 5980, 5978, 5976, 6078, 6076, 6074, 6072, - 6174, 6172, 6170, 6168, 6270, 6268, 6266, 6264, - 6366, 6364, 6362, 6360, 6462, 6460, 6458, 6456, - 6558, 6556, 6554, 6552, 6718, 6716, 6714, 6712, - 6814, 6812, 6810, 6808, 6910, 6908, 6906, 6904, - 7006, 7004, 7002, 7000, 7102, 7100, 7098, 7096, - 7198, 7196, 7194, 7192, 7294, 7292, 7290, 7288, - 7390, 7388, 7386, 7384, 7486, 7484, 7482, 7480, - 7582, 7580, 7578, 7576, 7678, 7676, 7674, 7672, - 7774, 7772, 7770, 7768, 7870, 7868, 7866, 7864, - 7966, 7964, 7962, 7960, 8062, 8060, 8058, 8056, - 8158, 8156, 8154, 8152, 8254, 8252, 8250, 8248, - 8350, 8348, 8346, 8344, 8414, 8412, 8410, 8408, - 8510, 8508, 8506, 8504, 8606, 8604, 8602, 8600, - 8702, 8700, 8698, 8696, 8798, 8796, 8794, 8792, - 8894, 8892, 8890, 8888, 8990, 8988, 8986, 8984, - 9086, 9084, 9082, 9080, 9182, 9180, 9178, 9176, - 9278, 9276, 9274, 9272, 9374, 9372, 9370, 9368, - 9470, 9468, 9466, 9464, 9566, 9564, 9562, 9560, - 9662, 9660, 9658, 9656, 9758, 9756, 9754, 9752, - 9854, 9852, 9850, 9848, 9950, 9948, 9946, 9944, - 10014, 10012, 10010, 10008, 10110, 10108, 10106, 10104, - 10206, 10204, 10202, 10200, 10302, 10300, 10298, 10296, - 10398, 10396, 10394, 10392, 10494, 10492, 10490, 10488, - 10590, 10588, 10586, 10584, 10686, 10684, 10682, 10680, - 10782, 10780, 10778, 10776, 10878, 10876, 10874, 10872, - 10974, 10972, 10970, 10968, 11070, 11068, 11066, 11064, - 11166, 11164, 11162, 11160, 11262, 11260, 11258, 11256, - 11358, 11356, 11354, 11352, 11454, 11452, 11450, 11448, - 11550, 11548, 11546, 11544, 11710, 11708, 11706, 11704, - 11806, 11804, 11802, 11800, 11902, 11900, 11898, 11896, - 11998, 11996, 11994, 11992, 12094, 12092, 12090, 12088, - 12190, 12188, 12186, 12184, 12286, 12284, 12282, 12280, - 12382, 12380, 12378, 12376, 12478, 12476, 12474, 12472, - 12574, 12572, 12570, 12568, 12670, 12668, 12666, 12664, - 12766, 12764, 12762, 12760, 12862, 12860, 12858, 12856, - 12958, 12956, 12954, 12952, 13054, 13052, 13050, 13048, - 13150, 13148, 13146, 13144, 13246, 13244, 13242, 13240, - 13310, 13308, 13306, 13304, 13406, 13404, 13402, 13400, - 13502, 13500, 13498, 13496, 13598, 13596, 13594, 13592, - 13694, 13692, 13690, 13688, 13790, 13788, 13786, 13784, - 13886, 13884, 13882, 13880, 13982, 13980, 13978, 13976, - 14078, 14076, 14074, 14072, 14174, 14172, 14170, 14168, - 14270, 14268, 14266, 14264, 14366, 14364, 14362, 14360, - 14462, 14460, 14458, 14456, 14558, 14556, 14554, 14552, - 14654, 14652, 14650, 14648, 14750, 14748, 14746, 14744, - 14846, 14844, 14842, 14840, 14942, 14940, 14938, 14936, - 15006, 15004, 15002, 15000, 15102, 15100, 15098, 15096, - 15198, 15196, 15194, 15192, 15294, 15292, 15290, 15288, - 15390, 15388, 15386, 15384, 15486, 15484, 15482, 15480, - 15582, 15580, 15578, 15576, 15678, 15676, 15674, 15672, - 15774, 15772, 15770, 15768, 15870, 15868, 15866, 15864, - 15966, 15964, 15962, 15960, 16062, 16060, 16058, 16056, - 16158, 16156, 16154, 16152, 16254, 16252, 16250, 16248, - 16350, 16348, 16346, 16344, 16446, 16444, 16442, 16440, - 16542, 16540, 16538, 16536, 16702, 16700, 16698, 16696, - 16798, 16796, 16794, 16792, 16894, 16892, 16890, 16888, - 16990, 16988, 16986, 16984, 17086, 17084, 17082, 17080, - 17182, 17180, 17178, 17176, 17278, 17276, 17274, 17272, - 17374, 17372, 17370, 17368, 17470, 17468, 17466, 17464, - 17566, 17564, 17562, 17560, 17662, 17660, 17658, 17656, - 17758, 17756, 17754, 17752, 17854, 17852, 17850, 17848, - 17950, 17948, 17946, 17944, 18046, 18044, 18042, 18040, - 18142, 18140, 18138, 18136, 18238, 18236, 18234, 18232, - 18302, 18300, 18298, 18296, 18398, 18396, 18394, 18392, - 18494, 18492, 18490, 18488, 18590, 18588, 18586, 18584, - 18686, 18684, 18682, 18680, 18782, 18780, 18778, 18776, - 18878, 18876, 18874, 18872, 18974, 18972, 18970, 18968, - 19070, 19068, 19066, 19064, 19166, 19164, 19162, 19160, - 19262, 19260, 19258, 19256, 19358, 19356, 19354, 19352, - 19454, 19452, 19450, 19448, 19550, 19548, 19546, 19544, - 19646, 19644, 19642, 19640, 19742, 19740, 19738, 19736, - 19838, 19836, 19834, 19832, }, - /* 4 */ - {38, 36, 34, 32, 134, 132, 130, 128, - 230, 228, 226, 224, 326, 324, 322, 320, - 422, 420, 418, 416, 518, 516, 514, 512, - 614, 612, 610, 608, 710, 708, 706, 704, - 806, 804, 802, 800, 902, 900, 898, 896, - 998, 996, 994, 992, 1094, 1092, 1090, 1088, - 1190, 1188, 1186, 1184, 1286, 1284, 1282, 1280, - 1382, 1380, 1378, 1376, 1478, 1476, 1474, 1472, - 1574, 1572, 1570, 1568, 1670, 1668, 1666, 1664, - 1734, 1732, 1730, 1728, 1830, 1828, 1826, 1824, - 1926, 1924, 1922, 1920, 2022, 2020, 2018, 2016, - 2118, 2116, 2114, 2112, 2214, 2212, 2210, 2208, - 2310, 2308, 2306, 2304, 2406, 2404, 2402, 2400, - 2502, 2500, 2498, 2496, 2598, 2596, 2594, 2592, - 2694, 2692, 2690, 2688, 2790, 2788, 2786, 2784, - 2886, 2884, 2882, 2880, 2982, 2980, 2978, 2976, - 3078, 3076, 3074, 3072, 3174, 3172, 3170, 3168, - 3270, 3268, 3266, 3264, 3430, 3428, 3426, 3424, - 3526, 3524, 3522, 3520, 3622, 3620, 3618, 3616, - 3718, 3716, 3714, 3712, 3814, 3812, 3810, 3808, - 3910, 3908, 3906, 3904, 4006, 4004, 4002, 4000, - 4102, 4100, 4098, 4096, 4198, 4196, 4194, 4192, - 4294, 4292, 4290, 4288, 4390, 4388, 4386, 4384, - 4486, 4484, 4482, 4480, 4582, 4580, 4578, 4576, - 4678, 4676, 4674, 4672, 4774, 4772, 4770, 4768, - 4870, 4868, 4866, 4864, 4966, 4964, 4962, 4960, - 5030, 5028, 5026, 5024, 5126, 5124, 5122, 5120, - 5222, 5220, 5218, 5216, 5318, 5316, 5314, 5312, - 5414, 5412, 5410, 5408, 5510, 5508, 5506, 5504, - 5606, 5604, 5602, 5600, 5702, 5700, 5698, 5696, - 5798, 5796, 5794, 5792, 5894, 5892, 5890, 5888, - 5990, 5988, 5986, 5984, 6086, 6084, 6082, 6080, - 6182, 6180, 6178, 6176, 6278, 6276, 6274, 6272, - 6374, 6372, 6370, 6368, 6470, 6468, 6466, 6464, - 6566, 6564, 6562, 6560, 6630, 6628, 6626, 6624, - 6726, 6724, 6722, 6720, 6822, 6820, 6818, 6816, - 6918, 6916, 6914, 6912, 7014, 7012, 7010, 7008, - 7110, 7108, 7106, 7104, 7206, 7204, 7202, 7200, - 7302, 7300, 7298, 7296, 7398, 7396, 7394, 7392, - 7494, 7492, 7490, 7488, 7590, 7588, 7586, 7584, - 7686, 7684, 7682, 7680, 7782, 7780, 7778, 7776, - 7878, 7876, 7874, 7872, 7974, 7972, 7970, 7968, - 8070, 8068, 8066, 8064, 8166, 8164, 8162, 8160, - 8262, 8260, 8258, 8256, 8422, 8420, 8418, 8416, - 8518, 8516, 8514, 8512, 8614, 8612, 8610, 8608, - 8710, 8708, 8706, 8704, 8806, 8804, 8802, 8800, - 8902, 8900, 8898, 8896, 8998, 8996, 8994, 8992, - 9094, 9092, 9090, 9088, 9190, 9188, 9186, 9184, - 9286, 9284, 9282, 9280, 9382, 9380, 9378, 9376, - 9478, 9476, 9474, 9472, 9574, 9572, 9570, 9568, - 9670, 9668, 9666, 9664, 9766, 9764, 9762, 9760, - 9862, 9860, 9858, 9856, 9958, 9956, 9954, 9952, - 10022, 10020, 10018, 10016, 10118, 10116, 10114, 10112, - 10214, 10212, 10210, 10208, 10310, 10308, 10306, 10304, - 10406, 10404, 10402, 10400, 10502, 10500, 10498, 10496, - 10598, 10596, 10594, 10592, 10694, 10692, 10690, 10688, - 10790, 10788, 10786, 10784, 10886, 10884, 10882, 10880, - 10982, 10980, 10978, 10976, 11078, 11076, 11074, 11072, - 11174, 11172, 11170, 11168, 11270, 11268, 11266, 11264, - 11366, 11364, 11362, 11360, 11462, 11460, 11458, 11456, - 11558, 11556, 11554, 11552, 11622, 11620, 11618, 11616, - 11718, 11716, 11714, 11712, 11814, 11812, 11810, 11808, - 11910, 11908, 11906, 11904, 12006, 12004, 12002, 12000, - 12102, 12100, 12098, 12096, 12198, 12196, 12194, 12192, - 12294, 12292, 12290, 12288, 12390, 12388, 12386, 12384, - 12486, 12484, 12482, 12480, 12582, 12580, 12578, 12576, - 12678, 12676, 12674, 12672, 12774, 12772, 12770, 12768, - 12870, 12868, 12866, 12864, 12966, 12964, 12962, 12960, - 13062, 13060, 13058, 13056, 13158, 13156, 13154, 13152, - 13318, 13316, 13314, 13312, 13414, 13412, 13410, 13408, - 13510, 13508, 13506, 13504, 13606, 13604, 13602, 13600, - 13702, 13700, 13698, 13696, 13798, 13796, 13794, 13792, - 13894, 13892, 13890, 13888, 13990, 13988, 13986, 13984, - 14086, 14084, 14082, 14080, 14182, 14180, 14178, 14176, - 14278, 14276, 14274, 14272, 14374, 14372, 14370, 14368, - 14470, 14468, 14466, 14464, 14566, 14564, 14562, 14560, - 14662, 14660, 14658, 14656, 14758, 14756, 14754, 14752, - 14854, 14852, 14850, 14848, 14950, 14948, 14946, 14944, - 15014, 15012, 15010, 15008, 15110, 15108, 15106, 15104, - 15206, 15204, 15202, 15200, 15302, 15300, 15298, 15296, - 15398, 15396, 15394, 15392, 15494, 15492, 15490, 15488, - 15590, 15588, 15586, 15584, 15686, 15684, 15682, 15680, - 15782, 15780, 15778, 15776, 15878, 15876, 15874, 15872, - 15974, 15972, 15970, 15968, 16070, 16068, 16066, 16064, - 16166, 16164, 16162, 16160, 16262, 16260, 16258, 16256, - 16358, 16356, 16354, 16352, 16454, 16452, 16450, 16448, - 16550, 16548, 16546, 16544, 16614, 16612, 16610, 16608, - 16710, 16708, 16706, 16704, 16806, 16804, 16802, 16800, - 16902, 16900, 16898, 16896, 16998, 16996, 16994, 16992, - 17094, 17092, 17090, 17088, 17190, 17188, 17186, 17184, - 17286, 17284, 17282, 17280, 17382, 17380, 17378, 17376, - 17478, 17476, 17474, 17472, 17574, 17572, 17570, 17568, - 17670, 17668, 17666, 17664, 17766, 17764, 17762, 17760, - 17862, 17860, 17858, 17856, 17958, 17956, 17954, 17952, - 18054, 18052, 18050, 18048, 18150, 18148, 18146, 18144, - 18310, 18308, 18306, 18304, 18406, 18404, 18402, 18400, - 18502, 18500, 18498, 18496, 18598, 18596, 18594, 18592, - 18694, 18692, 18690, 18688, 18790, 18788, 18786, 18784, - 18886, 18884, 18882, 18880, 18982, 18980, 18978, 18976, - 19078, 19076, 19074, 19072, 19174, 19172, 19170, 19168, - 19270, 19268, 19266, 19264, 19366, 19364, 19362, 19360, - 19462, 19460, 19458, 19456, 19558, 19556, 19554, 19552, - 19654, 19652, 19650, 19648, 19750, 19748, 19746, 19744, - 19846, 19844, 19842, 19840, }, - /* 5 */ - {46, 44, 42, 40, 142, 140, 138, 136, - 238, 236, 234, 232, 334, 332, 330, 328, - 430, 428, 426, 424, 526, 524, 522, 520, - 622, 620, 618, 616, 718, 716, 714, 712, - 814, 812, 810, 808, 910, 908, 906, 904, - 1006, 1004, 1002, 1000, 1102, 1100, 1098, 1096, - 1198, 1196, 1194, 1192, 1294, 1292, 1290, 1288, - 1390, 1388, 1386, 1384, 1486, 1484, 1482, 1480, - 1582, 1580, 1578, 1576, 1678, 1676, 1674, 1672, - 1742, 1740, 1738, 1736, 1838, 1836, 1834, 1832, - 1934, 1932, 1930, 1928, 2030, 2028, 2026, 2024, - 2126, 2124, 2122, 2120, 2222, 2220, 2218, 2216, - 2318, 2316, 2314, 2312, 2414, 2412, 2410, 2408, - 2510, 2508, 2506, 2504, 2606, 2604, 2602, 2600, - 2702, 2700, 2698, 2696, 2798, 2796, 2794, 2792, - 2894, 2892, 2890, 2888, 2990, 2988, 2986, 2984, - 3086, 3084, 3082, 3080, 3182, 3180, 3178, 3176, - 3278, 3276, 3274, 3272, 3438, 3436, 3434, 3432, - 3534, 3532, 3530, 3528, 3630, 3628, 3626, 3624, - 3726, 3724, 3722, 3720, 3822, 3820, 3818, 3816, - 3918, 3916, 3914, 3912, 4014, 4012, 4010, 4008, - 4110, 4108, 4106, 4104, 4206, 4204, 4202, 4200, - 4302, 4300, 4298, 4296, 4398, 4396, 4394, 4392, - 4494, 4492, 4490, 4488, 4590, 4588, 4586, 4584, - 4686, 4684, 4682, 4680, 4782, 4780, 4778, 4776, - 4878, 4876, 4874, 4872, 4974, 4972, 4970, 4968, - 5038, 5036, 5034, 5032, 5134, 5132, 5130, 5128, - 5230, 5228, 5226, 5224, 5326, 5324, 5322, 5320, - 5422, 5420, 5418, 5416, 5518, 5516, 5514, 5512, - 5614, 5612, 5610, 5608, 5710, 5708, 5706, 5704, - 5806, 5804, 5802, 5800, 5902, 5900, 5898, 5896, - 5998, 5996, 5994, 5992, 6094, 6092, 6090, 6088, - 6190, 6188, 6186, 6184, 6286, 6284, 6282, 6280, - 6382, 6380, 6378, 6376, 6478, 6476, 6474, 6472, - 6574, 6572, 6570, 6568, 6638, 6636, 6634, 6632, - 6734, 6732, 6730, 6728, 6830, 6828, 6826, 6824, - 6926, 6924, 6922, 6920, 7022, 7020, 7018, 7016, - 7118, 7116, 7114, 7112, 7214, 7212, 7210, 7208, - 7310, 7308, 7306, 7304, 7406, 7404, 7402, 7400, - 7502, 7500, 7498, 7496, 7598, 7596, 7594, 7592, - 7694, 7692, 7690, 7688, 7790, 7788, 7786, 7784, - 7886, 7884, 7882, 7880, 7982, 7980, 7978, 7976, - 8078, 8076, 8074, 8072, 8174, 8172, 8170, 8168, - 8270, 8268, 8266, 8264, 8430, 8428, 8426, 8424, - 8526, 8524, 8522, 8520, 8622, 8620, 8618, 8616, - 8718, 8716, 8714, 8712, 8814, 8812, 8810, 8808, - 8910, 8908, 8906, 8904, 9006, 9004, 9002, 9000, - 9102, 9100, 9098, 9096, 9198, 9196, 9194, 9192, - 9294, 9292, 9290, 9288, 9390, 9388, 9386, 9384, - 9486, 9484, 9482, 9480, 9582, 9580, 9578, 9576, - 9678, 9676, 9674, 9672, 9774, 9772, 9770, 9768, - 9870, 9868, 9866, 9864, 9966, 9964, 9962, 9960, - 10030, 10028, 10026, 10024, 10126, 10124, 10122, 10120, - 10222, 10220, 10218, 10216, 10318, 10316, 10314, 10312, - 10414, 10412, 10410, 10408, 10510, 10508, 10506, 10504, - 10606, 10604, 10602, 10600, 10702, 10700, 10698, 10696, - 10798, 10796, 10794, 10792, 10894, 10892, 10890, 10888, - 10990, 10988, 10986, 10984, 11086, 11084, 11082, 11080, - 11182, 11180, 11178, 11176, 11278, 11276, 11274, 11272, - 11374, 11372, 11370, 11368, 11470, 11468, 11466, 11464, - 11566, 11564, 11562, 11560, 11630, 11628, 11626, 11624, - 11726, 11724, 11722, 11720, 11822, 11820, 11818, 11816, - 11918, 11916, 11914, 11912, 12014, 12012, 12010, 12008, - 12110, 12108, 12106, 12104, 12206, 12204, 12202, 12200, - 12302, 12300, 12298, 12296, 12398, 12396, 12394, 12392, - 12494, 12492, 12490, 12488, 12590, 12588, 12586, 12584, - 12686, 12684, 12682, 12680, 12782, 12780, 12778, 12776, - 12878, 12876, 12874, 12872, 12974, 12972, 12970, 12968, - 13070, 13068, 13066, 13064, 13166, 13164, 13162, 13160, - 13326, 13324, 13322, 13320, 13422, 13420, 13418, 13416, - 13518, 13516, 13514, 13512, 13614, 13612, 13610, 13608, - 13710, 13708, 13706, 13704, 13806, 13804, 13802, 13800, - 13902, 13900, 13898, 13896, 13998, 13996, 13994, 13992, - 14094, 14092, 14090, 14088, 14190, 14188, 14186, 14184, - 14286, 14284, 14282, 14280, 14382, 14380, 14378, 14376, - 14478, 14476, 14474, 14472, 14574, 14572, 14570, 14568, - 14670, 14668, 14666, 14664, 14766, 14764, 14762, 14760, - 14862, 14860, 14858, 14856, 14958, 14956, 14954, 14952, - 15022, 15020, 15018, 15016, 15118, 15116, 15114, 15112, - 15214, 15212, 15210, 15208, 15310, 15308, 15306, 15304, - 15406, 15404, 15402, 15400, 15502, 15500, 15498, 15496, - 15598, 15596, 15594, 15592, 15694, 15692, 15690, 15688, - 15790, 15788, 15786, 15784, 15886, 15884, 15882, 15880, - 15982, 15980, 15978, 15976, 16078, 16076, 16074, 16072, - 16174, 16172, 16170, 16168, 16270, 16268, 16266, 16264, - 16366, 16364, 16362, 16360, 16462, 16460, 16458, 16456, - 16558, 16556, 16554, 16552, 16622, 16620, 16618, 16616, - 16718, 16716, 16714, 16712, 16814, 16812, 16810, 16808, - 16910, 16908, 16906, 16904, 17006, 17004, 17002, 17000, - 17102, 17100, 17098, 17096, 17198, 17196, 17194, 17192, - 17294, 17292, 17290, 17288, 17390, 17388, 17386, 17384, - 17486, 17484, 17482, 17480, 17582, 17580, 17578, 17576, - 17678, 17676, 17674, 17672, 17774, 17772, 17770, 17768, - 17870, 17868, 17866, 17864, 17966, 17964, 17962, 17960, - 18062, 18060, 18058, 18056, 18158, 18156, 18154, 18152, - 18318, 18316, 18314, 18312, 18414, 18412, 18410, 18408, - 18510, 18508, 18506, 18504, 18606, 18604, 18602, 18600, - 18702, 18700, 18698, 18696, 18798, 18796, 18794, 18792, - 18894, 18892, 18890, 18888, 18990, 18988, 18986, 18984, - 19086, 19084, 19082, 19080, 19182, 19180, 19178, 19176, - 19278, 19276, 19274, 19272, 19374, 19372, 19370, 19368, - 19470, 19468, 19466, 19464, 19566, 19564, 19562, 19560, - 19662, 19660, 19658, 19656, 19758, 19756, 19754, 19752, - 19854, 19852, 19850, 19848, }, - /* 6 */ - {54, 52, 50, 48, 150, 148, 146, 144, - 246, 244, 242, 240, 342, 340, 338, 336, - 438, 436, 434, 432, 534, 532, 530, 528, - 630, 628, 626, 624, 726, 724, 722, 720, - 822, 820, 818, 816, 918, 916, 914, 912, - 1014, 1012, 1010, 1008, 1110, 1108, 1106, 1104, - 1206, 1204, 1202, 1200, 1302, 1300, 1298, 1296, - 1398, 1396, 1394, 1392, 1494, 1492, 1490, 1488, - 1590, 1588, 1586, 1584, 1686, 1684, 1682, 1680, - 1750, 1748, 1746, 1744, 1846, 1844, 1842, 1840, - 1942, 1940, 1938, 1936, 2038, 2036, 2034, 2032, - 2134, 2132, 2130, 2128, 2230, 2228, 2226, 2224, - 2326, 2324, 2322, 2320, 2422, 2420, 2418, 2416, - 2518, 2516, 2514, 2512, 2614, 2612, 2610, 2608, - 2710, 2708, 2706, 2704, 2806, 2804, 2802, 2800, - 2902, 2900, 2898, 2896, 2998, 2996, 2994, 2992, - 3094, 3092, 3090, 3088, 3190, 3188, 3186, 3184, - 3286, 3284, 3282, 3280, 3446, 3444, 3442, 3440, - 3542, 3540, 3538, 3536, 3638, 3636, 3634, 3632, - 3734, 3732, 3730, 3728, 3830, 3828, 3826, 3824, - 3926, 3924, 3922, 3920, 4022, 4020, 4018, 4016, - 4118, 4116, 4114, 4112, 4214, 4212, 4210, 4208, - 4310, 4308, 4306, 4304, 4406, 4404, 4402, 4400, - 4502, 4500, 4498, 4496, 4598, 4596, 4594, 4592, - 4694, 4692, 4690, 4688, 4790, 4788, 4786, 4784, - 4886, 4884, 4882, 4880, 4982, 4980, 4978, 4976, - 5046, 5044, 5042, 5040, 5142, 5140, 5138, 5136, - 5238, 5236, 5234, 5232, 5334, 5332, 5330, 5328, - 5430, 5428, 5426, 5424, 5526, 5524, 5522, 5520, - 5622, 5620, 5618, 5616, 5718, 5716, 5714, 5712, - 5814, 5812, 5810, 5808, 5910, 5908, 5906, 5904, - 6006, 6004, 6002, 6000, 6102, 6100, 6098, 6096, - 6198, 6196, 6194, 6192, 6294, 6292, 6290, 6288, - 6390, 6388, 6386, 6384, 6486, 6484, 6482, 6480, - 6582, 6580, 6578, 6576, 6646, 6644, 6642, 6640, - 6742, 6740, 6738, 6736, 6838, 6836, 6834, 6832, - 6934, 6932, 6930, 6928, 7030, 7028, 7026, 7024, - 7126, 7124, 7122, 7120, 7222, 7220, 7218, 7216, - 7318, 7316, 7314, 7312, 7414, 7412, 7410, 7408, - 7510, 7508, 7506, 7504, 7606, 7604, 7602, 7600, - 7702, 7700, 7698, 7696, 7798, 7796, 7794, 7792, - 7894, 7892, 7890, 7888, 7990, 7988, 7986, 7984, - 8086, 8084, 8082, 8080, 8182, 8180, 8178, 8176, - 8278, 8276, 8274, 8272, 8438, 8436, 8434, 8432, - 8534, 8532, 8530, 8528, 8630, 8628, 8626, 8624, - 8726, 8724, 8722, 8720, 8822, 8820, 8818, 8816, - 8918, 8916, 8914, 8912, 9014, 9012, 9010, 9008, - 9110, 9108, 9106, 9104, 9206, 9204, 9202, 9200, - 9302, 9300, 9298, 9296, 9398, 9396, 9394, 9392, - 9494, 9492, 9490, 9488, 9590, 9588, 9586, 9584, - 9686, 9684, 9682, 9680, 9782, 9780, 9778, 9776, - 9878, 9876, 9874, 9872, 9974, 9972, 9970, 9968, - 10038, 10036, 10034, 10032, 10134, 10132, 10130, 10128, - 10230, 10228, 10226, 10224, 10326, 10324, 10322, 10320, - 10422, 10420, 10418, 10416, 10518, 10516, 10514, 10512, - 10614, 10612, 10610, 10608, 10710, 10708, 10706, 10704, - 10806, 10804, 10802, 10800, 10902, 10900, 10898, 10896, - 10998, 10996, 10994, 10992, 11094, 11092, 11090, 11088, - 11190, 11188, 11186, 11184, 11286, 11284, 11282, 11280, - 11382, 11380, 11378, 11376, 11478, 11476, 11474, 11472, - 11574, 11572, 11570, 11568, 11638, 11636, 11634, 11632, - 11734, 11732, 11730, 11728, 11830, 11828, 11826, 11824, - 11926, 11924, 11922, 11920, 12022, 12020, 12018, 12016, - 12118, 12116, 12114, 12112, 12214, 12212, 12210, 12208, - 12310, 12308, 12306, 12304, 12406, 12404, 12402, 12400, - 12502, 12500, 12498, 12496, 12598, 12596, 12594, 12592, - 12694, 12692, 12690, 12688, 12790, 12788, 12786, 12784, - 12886, 12884, 12882, 12880, 12982, 12980, 12978, 12976, - 13078, 13076, 13074, 13072, 13174, 13172, 13170, 13168, - 13334, 13332, 13330, 13328, 13430, 13428, 13426, 13424, - 13526, 13524, 13522, 13520, 13622, 13620, 13618, 13616, - 13718, 13716, 13714, 13712, 13814, 13812, 13810, 13808, - 13910, 13908, 13906, 13904, 14006, 14004, 14002, 14000, - 14102, 14100, 14098, 14096, 14198, 14196, 14194, 14192, - 14294, 14292, 14290, 14288, 14390, 14388, 14386, 14384, - 14486, 14484, 14482, 14480, 14582, 14580, 14578, 14576, - 14678, 14676, 14674, 14672, 14774, 14772, 14770, 14768, - 14870, 14868, 14866, 14864, 14966, 14964, 14962, 14960, - 15030, 15028, 15026, 15024, 15126, 15124, 15122, 15120, - 15222, 15220, 15218, 15216, 15318, 15316, 15314, 15312, - 15414, 15412, 15410, 15408, 15510, 15508, 15506, 15504, - 15606, 15604, 15602, 15600, 15702, 15700, 15698, 15696, - 15798, 15796, 15794, 15792, 15894, 15892, 15890, 15888, - 15990, 15988, 15986, 15984, 16086, 16084, 16082, 16080, - 16182, 16180, 16178, 16176, 16278, 16276, 16274, 16272, - 16374, 16372, 16370, 16368, 16470, 16468, 16466, 16464, - 16566, 16564, 16562, 16560, 16630, 16628, 16626, 16624, - 16726, 16724, 16722, 16720, 16822, 16820, 16818, 16816, - 16918, 16916, 16914, 16912, 17014, 17012, 17010, 17008, - 17110, 17108, 17106, 17104, 17206, 17204, 17202, 17200, - 17302, 17300, 17298, 17296, 17398, 17396, 17394, 17392, - 17494, 17492, 17490, 17488, 17590, 17588, 17586, 17584, - 17686, 17684, 17682, 17680, 17782, 17780, 17778, 17776, - 17878, 17876, 17874, 17872, 17974, 17972, 17970, 17968, - 18070, 18068, 18066, 18064, 18166, 18164, 18162, 18160, - 18326, 18324, 18322, 18320, 18422, 18420, 18418, 18416, - 18518, 18516, 18514, 18512, 18614, 18612, 18610, 18608, - 18710, 18708, 18706, 18704, 18806, 18804, 18802, 18800, - 18902, 18900, 18898, 18896, 18998, 18996, 18994, 18992, - 19094, 19092, 19090, 19088, 19190, 19188, 19186, 19184, - 19286, 19284, 19282, 19280, 19382, 19380, 19378, 19376, - 19478, 19476, 19474, 19472, 19574, 19572, 19570, 19568, - 19670, 19668, 19666, 19664, 19766, 19764, 19762, 19760, - 19862, 19860, 19858, 19856, }, - /* 7 */ - {62, 60, 58, 56, 158, 156, 154, 152, - 254, 252, 250, 248, 350, 348, 346, 344, - 446, 444, 442, 440, 542, 540, 538, 536, - 638, 636, 634, 632, 734, 732, 730, 728, - 830, 828, 826, 824, 926, 924, 922, 920, - 1022, 1020, 1018, 1016, 1118, 1116, 1114, 1112, - 1214, 1212, 1210, 1208, 1310, 1308, 1306, 1304, - 1406, 1404, 1402, 1400, 1502, 1500, 1498, 1496, - 1598, 1596, 1594, 1592, 1694, 1692, 1690, 1688, - 1758, 1756, 1754, 1752, 1854, 1852, 1850, 1848, - 1950, 1948, 1946, 1944, 2046, 2044, 2042, 2040, - 2142, 2140, 2138, 2136, 2238, 2236, 2234, 2232, - 2334, 2332, 2330, 2328, 2430, 2428, 2426, 2424, - 2526, 2524, 2522, 2520, 2622, 2620, 2618, 2616, - 2718, 2716, 2714, 2712, 2814, 2812, 2810, 2808, - 2910, 2908, 2906, 2904, 3006, 3004, 3002, 3000, - 3102, 3100, 3098, 3096, 3198, 3196, 3194, 3192, - 3294, 3292, 3290, 3288, 3454, 3452, 3450, 3448, - 3550, 3548, 3546, 3544, 3646, 3644, 3642, 3640, - 3742, 3740, 3738, 3736, 3838, 3836, 3834, 3832, - 3934, 3932, 3930, 3928, 4030, 4028, 4026, 4024, - 4126, 4124, 4122, 4120, 4222, 4220, 4218, 4216, - 4318, 4316, 4314, 4312, 4414, 4412, 4410, 4408, - 4510, 4508, 4506, 4504, 4606, 4604, 4602, 4600, - 4702, 4700, 4698, 4696, 4798, 4796, 4794, 4792, - 4894, 4892, 4890, 4888, 4990, 4988, 4986, 4984, - 5054, 5052, 5050, 5048, 5150, 5148, 5146, 5144, - 5246, 5244, 5242, 5240, 5342, 5340, 5338, 5336, - 5438, 5436, 5434, 5432, 5534, 5532, 5530, 5528, - 5630, 5628, 5626, 5624, 5726, 5724, 5722, 5720, - 5822, 5820, 5818, 5816, 5918, 5916, 5914, 5912, - 6014, 6012, 6010, 6008, 6110, 6108, 6106, 6104, - 6206, 6204, 6202, 6200, 6302, 6300, 6298, 6296, - 6398, 6396, 6394, 6392, 6494, 6492, 6490, 6488, - 6590, 6588, 6586, 6584, 6654, 6652, 6650, 6648, - 6750, 6748, 6746, 6744, 6846, 6844, 6842, 6840, - 6942, 6940, 6938, 6936, 7038, 7036, 7034, 7032, - 7134, 7132, 7130, 7128, 7230, 7228, 7226, 7224, - 7326, 7324, 7322, 7320, 7422, 7420, 7418, 7416, - 7518, 7516, 7514, 7512, 7614, 7612, 7610, 7608, - 7710, 7708, 7706, 7704, 7806, 7804, 7802, 7800, - 7902, 7900, 7898, 7896, 7998, 7996, 7994, 7992, - 8094, 8092, 8090, 8088, 8190, 8188, 8186, 8184, - 8286, 8284, 8282, 8280, 8446, 8444, 8442, 8440, - 8542, 8540, 8538, 8536, 8638, 8636, 8634, 8632, - 8734, 8732, 8730, 8728, 8830, 8828, 8826, 8824, - 8926, 8924, 8922, 8920, 9022, 9020, 9018, 9016, - 9118, 9116, 9114, 9112, 9214, 9212, 9210, 9208, - 9310, 9308, 9306, 9304, 9406, 9404, 9402, 9400, - 9502, 9500, 9498, 9496, 9598, 9596, 9594, 9592, - 9694, 9692, 9690, 9688, 9790, 9788, 9786, 9784, - 9886, 9884, 9882, 9880, 9982, 9980, 9978, 9976, - 10046, 10044, 10042, 10040, 10142, 10140, 10138, 10136, - 10238, 10236, 10234, 10232, 10334, 10332, 10330, 10328, - 10430, 10428, 10426, 10424, 10526, 10524, 10522, 10520, - 10622, 10620, 10618, 10616, 10718, 10716, 10714, 10712, - 10814, 10812, 10810, 10808, 10910, 10908, 10906, 10904, - 11006, 11004, 11002, 11000, 11102, 11100, 11098, 11096, - 11198, 11196, 11194, 11192, 11294, 11292, 11290, 11288, - 11390, 11388, 11386, 11384, 11486, 11484, 11482, 11480, - 11582, 11580, 11578, 11576, 11646, 11644, 11642, 11640, - 11742, 11740, 11738, 11736, 11838, 11836, 11834, 11832, - 11934, 11932, 11930, 11928, 12030, 12028, 12026, 12024, - 12126, 12124, 12122, 12120, 12222, 12220, 12218, 12216, - 12318, 12316, 12314, 12312, 12414, 12412, 12410, 12408, - 12510, 12508, 12506, 12504, 12606, 12604, 12602, 12600, - 12702, 12700, 12698, 12696, 12798, 12796, 12794, 12792, - 12894, 12892, 12890, 12888, 12990, 12988, 12986, 12984, - 13086, 13084, 13082, 13080, 13182, 13180, 13178, 13176, - 13342, 13340, 13338, 13336, 13438, 13436, 13434, 13432, - 13534, 13532, 13530, 13528, 13630, 13628, 13626, 13624, - 13726, 13724, 13722, 13720, 13822, 13820, 13818, 13816, - 13918, 13916, 13914, 13912, 14014, 14012, 14010, 14008, - 14110, 14108, 14106, 14104, 14206, 14204, 14202, 14200, - 14302, 14300, 14298, 14296, 14398, 14396, 14394, 14392, - 14494, 14492, 14490, 14488, 14590, 14588, 14586, 14584, - 14686, 14684, 14682, 14680, 14782, 14780, 14778, 14776, - 14878, 14876, 14874, 14872, 14974, 14972, 14970, 14968, - 15038, 15036, 15034, 15032, 15134, 15132, 15130, 15128, - 15230, 15228, 15226, 15224, 15326, 15324, 15322, 15320, - 15422, 15420, 15418, 15416, 15518, 15516, 15514, 15512, - 15614, 15612, 15610, 15608, 15710, 15708, 15706, 15704, - 15806, 15804, 15802, 15800, 15902, 15900, 15898, 15896, - 15998, 15996, 15994, 15992, 16094, 16092, 16090, 16088, - 16190, 16188, 16186, 16184, 16286, 16284, 16282, 16280, - 16382, 16380, 16378, 16376, 16478, 16476, 16474, 16472, - 16574, 16572, 16570, 16568, 16638, 16636, 16634, 16632, - 16734, 16732, 16730, 16728, 16830, 16828, 16826, 16824, - 16926, 16924, 16922, 16920, 17022, 17020, 17018, 17016, - 17118, 17116, 17114, 17112, 17214, 17212, 17210, 17208, - 17310, 17308, 17306, 17304, 17406, 17404, 17402, 17400, - 17502, 17500, 17498, 17496, 17598, 17596, 17594, 17592, - 17694, 17692, 17690, 17688, 17790, 17788, 17786, 17784, - 17886, 17884, 17882, 17880, 17982, 17980, 17978, 17976, - 18078, 18076, 18074, 18072, 18174, 18172, 18170, 18168, - 18334, 18332, 18330, 18328, 18430, 18428, 18426, 18424, - 18526, 18524, 18522, 18520, 18622, 18620, 18618, 18616, - 18718, 18716, 18714, 18712, 18814, 18812, 18810, 18808, - 18910, 18908, 18906, 18904, 19006, 19004, 19002, 19000, - 19102, 19100, 19098, 19096, 19198, 19196, 19194, 19192, - 19294, 19292, 19290, 19288, 19390, 19388, 19386, 19384, - 19486, 19484, 19482, 19480, 19582, 19580, 19578, 19576, - 19678, 19676, 19674, 19672, 19774, 19772, 19770, 19768, - 19870, 19868, 19866, 19864, }, - /* 8 */ - {70, 68, 66, 64, 166, 164, 162, 160, - 262, 260, 258, 256, 358, 356, 354, 352, - 454, 452, 450, 448, 550, 548, 546, 544, - 646, 644, 642, 640, 742, 740, 738, 736, - 838, 836, 834, 832, 934, 932, 930, 928, - 1030, 1028, 1026, 1024, 1126, 1124, 1122, 1120, - 1222, 1220, 1218, 1216, 1318, 1316, 1314, 1312, - 1414, 1412, 1410, 1408, 1510, 1508, 1506, 1504, - 1606, 1604, 1602, 1600, 1702, 1700, 1698, 1696, - 1766, 1764, 1762, 1760, 1862, 1860, 1858, 1856, - 1958, 1956, 1954, 1952, 2054, 2052, 2050, 2048, - 2150, 2148, 2146, 2144, 2246, 2244, 2242, 2240, - 2342, 2340, 2338, 2336, 2438, 2436, 2434, 2432, - 2534, 2532, 2530, 2528, 2630, 2628, 2626, 2624, - 2726, 2724, 2722, 2720, 2822, 2820, 2818, 2816, - 2918, 2916, 2914, 2912, 3014, 3012, 3010, 3008, - 3110, 3108, 3106, 3104, 3206, 3204, 3202, 3200, - 3302, 3300, 3298, 3296, 3366, 3364, 3362, 3360, - 3462, 3460, 3458, 3456, 3558, 3556, 3554, 3552, - 3654, 3652, 3650, 3648, 3750, 3748, 3746, 3744, - 3846, 3844, 3842, 3840, 3942, 3940, 3938, 3936, - 4038, 4036, 4034, 4032, 4134, 4132, 4130, 4128, - 4230, 4228, 4226, 4224, 4326, 4324, 4322, 4320, - 4422, 4420, 4418, 4416, 4518, 4516, 4514, 4512, - 4614, 4612, 4610, 4608, 4710, 4708, 4706, 4704, - 4806, 4804, 4802, 4800, 4902, 4900, 4898, 4896, - 5062, 5060, 5058, 5056, 5158, 5156, 5154, 5152, - 5254, 5252, 5250, 5248, 5350, 5348, 5346, 5344, - 5446, 5444, 5442, 5440, 5542, 5540, 5538, 5536, - 5638, 5636, 5634, 5632, 5734, 5732, 5730, 5728, - 5830, 5828, 5826, 5824, 5926, 5924, 5922, 5920, - 6022, 6020, 6018, 6016, 6118, 6116, 6114, 6112, - 6214, 6212, 6210, 6208, 6310, 6308, 6306, 6304, - 6406, 6404, 6402, 6400, 6502, 6500, 6498, 6496, - 6598, 6596, 6594, 6592, 6662, 6660, 6658, 6656, - 6758, 6756, 6754, 6752, 6854, 6852, 6850, 6848, - 6950, 6948, 6946, 6944, 7046, 7044, 7042, 7040, - 7142, 7140, 7138, 7136, 7238, 7236, 7234, 7232, - 7334, 7332, 7330, 7328, 7430, 7428, 7426, 7424, - 7526, 7524, 7522, 7520, 7622, 7620, 7618, 7616, - 7718, 7716, 7714, 7712, 7814, 7812, 7810, 7808, - 7910, 7908, 7906, 7904, 8006, 8004, 8002, 8000, - 8102, 8100, 8098, 8096, 8198, 8196, 8194, 8192, - 8294, 8292, 8290, 8288, 8358, 8356, 8354, 8352, - 8454, 8452, 8450, 8448, 8550, 8548, 8546, 8544, - 8646, 8644, 8642, 8640, 8742, 8740, 8738, 8736, - 8838, 8836, 8834, 8832, 8934, 8932, 8930, 8928, - 9030, 9028, 9026, 9024, 9126, 9124, 9122, 9120, - 9222, 9220, 9218, 9216, 9318, 9316, 9314, 9312, - 9414, 9412, 9410, 9408, 9510, 9508, 9506, 9504, - 9606, 9604, 9602, 9600, 9702, 9700, 9698, 9696, - 9798, 9796, 9794, 9792, 9894, 9892, 9890, 9888, - 10054, 10052, 10050, 10048, 10150, 10148, 10146, 10144, - 10246, 10244, 10242, 10240, 10342, 10340, 10338, 10336, - 10438, 10436, 10434, 10432, 10534, 10532, 10530, 10528, - 10630, 10628, 10626, 10624, 10726, 10724, 10722, 10720, - 10822, 10820, 10818, 10816, 10918, 10916, 10914, 10912, - 11014, 11012, 11010, 11008, 11110, 11108, 11106, 11104, - 11206, 11204, 11202, 11200, 11302, 11300, 11298, 11296, - 11398, 11396, 11394, 11392, 11494, 11492, 11490, 11488, - 11590, 11588, 11586, 11584, 11654, 11652, 11650, 11648, - 11750, 11748, 11746, 11744, 11846, 11844, 11842, 11840, - 11942, 11940, 11938, 11936, 12038, 12036, 12034, 12032, - 12134, 12132, 12130, 12128, 12230, 12228, 12226, 12224, - 12326, 12324, 12322, 12320, 12422, 12420, 12418, 12416, - 12518, 12516, 12514, 12512, 12614, 12612, 12610, 12608, - 12710, 12708, 12706, 12704, 12806, 12804, 12802, 12800, - 12902, 12900, 12898, 12896, 12998, 12996, 12994, 12992, - 13094, 13092, 13090, 13088, 13190, 13188, 13186, 13184, - 13254, 13252, 13250, 13248, 13350, 13348, 13346, 13344, - 13446, 13444, 13442, 13440, 13542, 13540, 13538, 13536, - 13638, 13636, 13634, 13632, 13734, 13732, 13730, 13728, - 13830, 13828, 13826, 13824, 13926, 13924, 13922, 13920, - 14022, 14020, 14018, 14016, 14118, 14116, 14114, 14112, - 14214, 14212, 14210, 14208, 14310, 14308, 14306, 14304, - 14406, 14404, 14402, 14400, 14502, 14500, 14498, 14496, - 14598, 14596, 14594, 14592, 14694, 14692, 14690, 14688, - 14790, 14788, 14786, 14784, 14886, 14884, 14882, 14880, - 15046, 15044, 15042, 15040, 15142, 15140, 15138, 15136, - 15238, 15236, 15234, 15232, 15334, 15332, 15330, 15328, - 15430, 15428, 15426, 15424, 15526, 15524, 15522, 15520, - 15622, 15620, 15618, 15616, 15718, 15716, 15714, 15712, - 15814, 15812, 15810, 15808, 15910, 15908, 15906, 15904, - 16006, 16004, 16002, 16000, 16102, 16100, 16098, 16096, - 16198, 16196, 16194, 16192, 16294, 16292, 16290, 16288, - 16390, 16388, 16386, 16384, 16486, 16484, 16482, 16480, - 16582, 16580, 16578, 16576, 16646, 16644, 16642, 16640, - 16742, 16740, 16738, 16736, 16838, 16836, 16834, 16832, - 16934, 16932, 16930, 16928, 17030, 17028, 17026, 17024, - 17126, 17124, 17122, 17120, 17222, 17220, 17218, 17216, - 17318, 17316, 17314, 17312, 17414, 17412, 17410, 17408, - 17510, 17508, 17506, 17504, 17606, 17604, 17602, 17600, - 17702, 17700, 17698, 17696, 17798, 17796, 17794, 17792, - 17894, 17892, 17890, 17888, 17990, 17988, 17986, 17984, - 18086, 18084, 18082, 18080, 18182, 18180, 18178, 18176, - 18246, 18244, 18242, 18240, 18342, 18340, 18338, 18336, - 18438, 18436, 18434, 18432, 18534, 18532, 18530, 18528, - 18630, 18628, 18626, 18624, 18726, 18724, 18722, 18720, - 18822, 18820, 18818, 18816, 18918, 18916, 18914, 18912, - 19014, 19012, 19010, 19008, 19110, 19108, 19106, 19104, - 19206, 19204, 19202, 19200, 19302, 19300, 19298, 19296, - 19398, 19396, 19394, 19392, 19494, 19492, 19490, 19488, - 19590, 19588, 19586, 19584, 19686, 19684, 19682, 19680, - 19782, 19780, 19778, 19776, }, - /* 9 */ - {78, 76, 74, 72, 174, 172, 170, 168, - 270, 268, 266, 264, 366, 364, 362, 360, - 462, 460, 458, 456, 558, 556, 554, 552, - 654, 652, 650, 648, 750, 748, 746, 744, - 846, 844, 842, 840, 942, 940, 938, 936, - 1038, 1036, 1034, 1032, 1134, 1132, 1130, 1128, - 1230, 1228, 1226, 1224, 1326, 1324, 1322, 1320, - 1422, 1420, 1418, 1416, 1518, 1516, 1514, 1512, - 1614, 1612, 1610, 1608, 1710, 1708, 1706, 1704, - 1774, 1772, 1770, 1768, 1870, 1868, 1866, 1864, - 1966, 1964, 1962, 1960, 2062, 2060, 2058, 2056, - 2158, 2156, 2154, 2152, 2254, 2252, 2250, 2248, - 2350, 2348, 2346, 2344, 2446, 2444, 2442, 2440, - 2542, 2540, 2538, 2536, 2638, 2636, 2634, 2632, - 2734, 2732, 2730, 2728, 2830, 2828, 2826, 2824, - 2926, 2924, 2922, 2920, 3022, 3020, 3018, 3016, - 3118, 3116, 3114, 3112, 3214, 3212, 3210, 3208, - 3310, 3308, 3306, 3304, 3374, 3372, 3370, 3368, - 3470, 3468, 3466, 3464, 3566, 3564, 3562, 3560, - 3662, 3660, 3658, 3656, 3758, 3756, 3754, 3752, - 3854, 3852, 3850, 3848, 3950, 3948, 3946, 3944, - 4046, 4044, 4042, 4040, 4142, 4140, 4138, 4136, - 4238, 4236, 4234, 4232, 4334, 4332, 4330, 4328, - 4430, 4428, 4426, 4424, 4526, 4524, 4522, 4520, - 4622, 4620, 4618, 4616, 4718, 4716, 4714, 4712, - 4814, 4812, 4810, 4808, 4910, 4908, 4906, 4904, - 5070, 5068, 5066, 5064, 5166, 5164, 5162, 5160, - 5262, 5260, 5258, 5256, 5358, 5356, 5354, 5352, - 5454, 5452, 5450, 5448, 5550, 5548, 5546, 5544, - 5646, 5644, 5642, 5640, 5742, 5740, 5738, 5736, - 5838, 5836, 5834, 5832, 5934, 5932, 5930, 5928, - 6030, 6028, 6026, 6024, 6126, 6124, 6122, 6120, - 6222, 6220, 6218, 6216, 6318, 6316, 6314, 6312, - 6414, 6412, 6410, 6408, 6510, 6508, 6506, 6504, - 6606, 6604, 6602, 6600, 6670, 6668, 6666, 6664, - 6766, 6764, 6762, 6760, 6862, 6860, 6858, 6856, - 6958, 6956, 6954, 6952, 7054, 7052, 7050, 7048, - 7150, 7148, 7146, 7144, 7246, 7244, 7242, 7240, - 7342, 7340, 7338, 7336, 7438, 7436, 7434, 7432, - 7534, 7532, 7530, 7528, 7630, 7628, 7626, 7624, - 7726, 7724, 7722, 7720, 7822, 7820, 7818, 7816, - 7918, 7916, 7914, 7912, 8014, 8012, 8010, 8008, - 8110, 8108, 8106, 8104, 8206, 8204, 8202, 8200, - 8302, 8300, 8298, 8296, 8366, 8364, 8362, 8360, - 8462, 8460, 8458, 8456, 8558, 8556, 8554, 8552, - 8654, 8652, 8650, 8648, 8750, 8748, 8746, 8744, - 8846, 8844, 8842, 8840, 8942, 8940, 8938, 8936, - 9038, 9036, 9034, 9032, 9134, 9132, 9130, 9128, - 9230, 9228, 9226, 9224, 9326, 9324, 9322, 9320, - 9422, 9420, 9418, 9416, 9518, 9516, 9514, 9512, - 9614, 9612, 9610, 9608, 9710, 9708, 9706, 9704, - 9806, 9804, 9802, 9800, 9902, 9900, 9898, 9896, - 10062, 10060, 10058, 10056, 10158, 10156, 10154, 10152, - 10254, 10252, 10250, 10248, 10350, 10348, 10346, 10344, - 10446, 10444, 10442, 10440, 10542, 10540, 10538, 10536, - 10638, 10636, 10634, 10632, 10734, 10732, 10730, 10728, - 10830, 10828, 10826, 10824, 10926, 10924, 10922, 10920, - 11022, 11020, 11018, 11016, 11118, 11116, 11114, 11112, - 11214, 11212, 11210, 11208, 11310, 11308, 11306, 11304, - 11406, 11404, 11402, 11400, 11502, 11500, 11498, 11496, - 11598, 11596, 11594, 11592, 11662, 11660, 11658, 11656, - 11758, 11756, 11754, 11752, 11854, 11852, 11850, 11848, - 11950, 11948, 11946, 11944, 12046, 12044, 12042, 12040, - 12142, 12140, 12138, 12136, 12238, 12236, 12234, 12232, - 12334, 12332, 12330, 12328, 12430, 12428, 12426, 12424, - 12526, 12524, 12522, 12520, 12622, 12620, 12618, 12616, - 12718, 12716, 12714, 12712, 12814, 12812, 12810, 12808, - 12910, 12908, 12906, 12904, 13006, 13004, 13002, 13000, - 13102, 13100, 13098, 13096, 13198, 13196, 13194, 13192, - 13262, 13260, 13258, 13256, 13358, 13356, 13354, 13352, - 13454, 13452, 13450, 13448, 13550, 13548, 13546, 13544, - 13646, 13644, 13642, 13640, 13742, 13740, 13738, 13736, - 13838, 13836, 13834, 13832, 13934, 13932, 13930, 13928, - 14030, 14028, 14026, 14024, 14126, 14124, 14122, 14120, - 14222, 14220, 14218, 14216, 14318, 14316, 14314, 14312, - 14414, 14412, 14410, 14408, 14510, 14508, 14506, 14504, - 14606, 14604, 14602, 14600, 14702, 14700, 14698, 14696, - 14798, 14796, 14794, 14792, 14894, 14892, 14890, 14888, - 15054, 15052, 15050, 15048, 15150, 15148, 15146, 15144, - 15246, 15244, 15242, 15240, 15342, 15340, 15338, 15336, - 15438, 15436, 15434, 15432, 15534, 15532, 15530, 15528, - 15630, 15628, 15626, 15624, 15726, 15724, 15722, 15720, - 15822, 15820, 15818, 15816, 15918, 15916, 15914, 15912, - 16014, 16012, 16010, 16008, 16110, 16108, 16106, 16104, - 16206, 16204, 16202, 16200, 16302, 16300, 16298, 16296, - 16398, 16396, 16394, 16392, 16494, 16492, 16490, 16488, - 16590, 16588, 16586, 16584, 16654, 16652, 16650, 16648, - 16750, 16748, 16746, 16744, 16846, 16844, 16842, 16840, - 16942, 16940, 16938, 16936, 17038, 17036, 17034, 17032, - 17134, 17132, 17130, 17128, 17230, 17228, 17226, 17224, - 17326, 17324, 17322, 17320, 17422, 17420, 17418, 17416, - 17518, 17516, 17514, 17512, 17614, 17612, 17610, 17608, - 17710, 17708, 17706, 17704, 17806, 17804, 17802, 17800, - 17902, 17900, 17898, 17896, 17998, 17996, 17994, 17992, - 18094, 18092, 18090, 18088, 18190, 18188, 18186, 18184, - 18254, 18252, 18250, 18248, 18350, 18348, 18346, 18344, - 18446, 18444, 18442, 18440, 18542, 18540, 18538, 18536, - 18638, 18636, 18634, 18632, 18734, 18732, 18730, 18728, - 18830, 18828, 18826, 18824, 18926, 18924, 18922, 18920, - 19022, 19020, 19018, 19016, 19118, 19116, 19114, 19112, - 19214, 19212, 19210, 19208, 19310, 19308, 19306, 19304, - 19406, 19404, 19402, 19400, 19502, 19500, 19498, 19496, - 19598, 19596, 19594, 19592, 19694, 19692, 19690, 19688, - 19790, 19788, 19786, 19784, }, - /* 10 */ - {86, 84, 82, 80, 182, 180, 178, 176, - 278, 276, 274, 272, 374, 372, 370, 368, - 470, 468, 466, 464, 566, 564, 562, 560, - 662, 660, 658, 656, 758, 756, 754, 752, - 854, 852, 850, 848, 950, 948, 946, 944, - 1046, 1044, 1042, 1040, 1142, 1140, 1138, 1136, - 1238, 1236, 1234, 1232, 1334, 1332, 1330, 1328, - 1430, 1428, 1426, 1424, 1526, 1524, 1522, 1520, - 1622, 1620, 1618, 1616, 1718, 1716, 1714, 1712, - 1782, 1780, 1778, 1776, 1878, 1876, 1874, 1872, - 1974, 1972, 1970, 1968, 2070, 2068, 2066, 2064, - 2166, 2164, 2162, 2160, 2262, 2260, 2258, 2256, - 2358, 2356, 2354, 2352, 2454, 2452, 2450, 2448, - 2550, 2548, 2546, 2544, 2646, 2644, 2642, 2640, - 2742, 2740, 2738, 2736, 2838, 2836, 2834, 2832, - 2934, 2932, 2930, 2928, 3030, 3028, 3026, 3024, - 3126, 3124, 3122, 3120, 3222, 3220, 3218, 3216, - 3318, 3316, 3314, 3312, 3382, 3380, 3378, 3376, - 3478, 3476, 3474, 3472, 3574, 3572, 3570, 3568, - 3670, 3668, 3666, 3664, 3766, 3764, 3762, 3760, - 3862, 3860, 3858, 3856, 3958, 3956, 3954, 3952, - 4054, 4052, 4050, 4048, 4150, 4148, 4146, 4144, - 4246, 4244, 4242, 4240, 4342, 4340, 4338, 4336, - 4438, 4436, 4434, 4432, 4534, 4532, 4530, 4528, - 4630, 4628, 4626, 4624, 4726, 4724, 4722, 4720, - 4822, 4820, 4818, 4816, 4918, 4916, 4914, 4912, - 5078, 5076, 5074, 5072, 5174, 5172, 5170, 5168, - 5270, 5268, 5266, 5264, 5366, 5364, 5362, 5360, - 5462, 5460, 5458, 5456, 5558, 5556, 5554, 5552, - 5654, 5652, 5650, 5648, 5750, 5748, 5746, 5744, - 5846, 5844, 5842, 5840, 5942, 5940, 5938, 5936, - 6038, 6036, 6034, 6032, 6134, 6132, 6130, 6128, - 6230, 6228, 6226, 6224, 6326, 6324, 6322, 6320, - 6422, 6420, 6418, 6416, 6518, 6516, 6514, 6512, - 6614, 6612, 6610, 6608, 6678, 6676, 6674, 6672, - 6774, 6772, 6770, 6768, 6870, 6868, 6866, 6864, - 6966, 6964, 6962, 6960, 7062, 7060, 7058, 7056, - 7158, 7156, 7154, 7152, 7254, 7252, 7250, 7248, - 7350, 7348, 7346, 7344, 7446, 7444, 7442, 7440, - 7542, 7540, 7538, 7536, 7638, 7636, 7634, 7632, - 7734, 7732, 7730, 7728, 7830, 7828, 7826, 7824, - 7926, 7924, 7922, 7920, 8022, 8020, 8018, 8016, - 8118, 8116, 8114, 8112, 8214, 8212, 8210, 8208, - 8310, 8308, 8306, 8304, 8374, 8372, 8370, 8368, - 8470, 8468, 8466, 8464, 8566, 8564, 8562, 8560, - 8662, 8660, 8658, 8656, 8758, 8756, 8754, 8752, - 8854, 8852, 8850, 8848, 8950, 8948, 8946, 8944, - 9046, 9044, 9042, 9040, 9142, 9140, 9138, 9136, - 9238, 9236, 9234, 9232, 9334, 9332, 9330, 9328, - 9430, 9428, 9426, 9424, 9526, 9524, 9522, 9520, - 9622, 9620, 9618, 9616, 9718, 9716, 9714, 9712, - 9814, 9812, 9810, 9808, 9910, 9908, 9906, 9904, - 10070, 10068, 10066, 10064, 10166, 10164, 10162, 10160, - 10262, 10260, 10258, 10256, 10358, 10356, 10354, 10352, - 10454, 10452, 10450, 10448, 10550, 10548, 10546, 10544, - 10646, 10644, 10642, 10640, 10742, 10740, 10738, 10736, - 10838, 10836, 10834, 10832, 10934, 10932, 10930, 10928, - 11030, 11028, 11026, 11024, 11126, 11124, 11122, 11120, - 11222, 11220, 11218, 11216, 11318, 11316, 11314, 11312, - 11414, 11412, 11410, 11408, 11510, 11508, 11506, 11504, - 11606, 11604, 11602, 11600, 11670, 11668, 11666, 11664, - 11766, 11764, 11762, 11760, 11862, 11860, 11858, 11856, - 11958, 11956, 11954, 11952, 12054, 12052, 12050, 12048, - 12150, 12148, 12146, 12144, 12246, 12244, 12242, 12240, - 12342, 12340, 12338, 12336, 12438, 12436, 12434, 12432, - 12534, 12532, 12530, 12528, 12630, 12628, 12626, 12624, - 12726, 12724, 12722, 12720, 12822, 12820, 12818, 12816, - 12918, 12916, 12914, 12912, 13014, 13012, 13010, 13008, - 13110, 13108, 13106, 13104, 13206, 13204, 13202, 13200, - 13270, 13268, 13266, 13264, 13366, 13364, 13362, 13360, - 13462, 13460, 13458, 13456, 13558, 13556, 13554, 13552, - 13654, 13652, 13650, 13648, 13750, 13748, 13746, 13744, - 13846, 13844, 13842, 13840, 13942, 13940, 13938, 13936, - 14038, 14036, 14034, 14032, 14134, 14132, 14130, 14128, - 14230, 14228, 14226, 14224, 14326, 14324, 14322, 14320, - 14422, 14420, 14418, 14416, 14518, 14516, 14514, 14512, - 14614, 14612, 14610, 14608, 14710, 14708, 14706, 14704, - 14806, 14804, 14802, 14800, 14902, 14900, 14898, 14896, - 15062, 15060, 15058, 15056, 15158, 15156, 15154, 15152, - 15254, 15252, 15250, 15248, 15350, 15348, 15346, 15344, - 15446, 15444, 15442, 15440, 15542, 15540, 15538, 15536, - 15638, 15636, 15634, 15632, 15734, 15732, 15730, 15728, - 15830, 15828, 15826, 15824, 15926, 15924, 15922, 15920, - 16022, 16020, 16018, 16016, 16118, 16116, 16114, 16112, - 16214, 16212, 16210, 16208, 16310, 16308, 16306, 16304, - 16406, 16404, 16402, 16400, 16502, 16500, 16498, 16496, - 16598, 16596, 16594, 16592, 16662, 16660, 16658, 16656, - 16758, 16756, 16754, 16752, 16854, 16852, 16850, 16848, - 16950, 16948, 16946, 16944, 17046, 17044, 17042, 17040, - 17142, 17140, 17138, 17136, 17238, 17236, 17234, 17232, - 17334, 17332, 17330, 17328, 17430, 17428, 17426, 17424, - 17526, 17524, 17522, 17520, 17622, 17620, 17618, 17616, - 17718, 17716, 17714, 17712, 17814, 17812, 17810, 17808, - 17910, 17908, 17906, 17904, 18006, 18004, 18002, 18000, - 18102, 18100, 18098, 18096, 18198, 18196, 18194, 18192, - 18262, 18260, 18258, 18256, 18358, 18356, 18354, 18352, - 18454, 18452, 18450, 18448, 18550, 18548, 18546, 18544, - 18646, 18644, 18642, 18640, 18742, 18740, 18738, 18736, - 18838, 18836, 18834, 18832, 18934, 18932, 18930, 18928, - 19030, 19028, 19026, 19024, 19126, 19124, 19122, 19120, - 19222, 19220, 19218, 19216, 19318, 19316, 19314, 19312, - 19414, 19412, 19410, 19408, 19510, 19508, 19506, 19504, - 19606, 19604, 19602, 19600, 19702, 19700, 19698, 19696, - 19798, 19796, 19794, 19792, }, - /* 11 */ - {94, 92, 90, 88, 190, 188, 186, 184, - 286, 284, 282, 280, 382, 380, 378, 376, - 478, 476, 474, 472, 574, 572, 570, 568, - 670, 668, 666, 664, 766, 764, 762, 760, - 862, 860, 858, 856, 958, 956, 954, 952, - 1054, 1052, 1050, 1048, 1150, 1148, 1146, 1144, - 1246, 1244, 1242, 1240, 1342, 1340, 1338, 1336, - 1438, 1436, 1434, 1432, 1534, 1532, 1530, 1528, - 1630, 1628, 1626, 1624, 1726, 1724, 1722, 1720, - 1790, 1788, 1786, 1784, 1886, 1884, 1882, 1880, - 1982, 1980, 1978, 1976, 2078, 2076, 2074, 2072, - 2174, 2172, 2170, 2168, 2270, 2268, 2266, 2264, - 2366, 2364, 2362, 2360, 2462, 2460, 2458, 2456, - 2558, 2556, 2554, 2552, 2654, 2652, 2650, 2648, - 2750, 2748, 2746, 2744, 2846, 2844, 2842, 2840, - 2942, 2940, 2938, 2936, 3038, 3036, 3034, 3032, - 3134, 3132, 3130, 3128, 3230, 3228, 3226, 3224, - 3326, 3324, 3322, 3320, 3390, 3388, 3386, 3384, - 3486, 3484, 3482, 3480, 3582, 3580, 3578, 3576, - 3678, 3676, 3674, 3672, 3774, 3772, 3770, 3768, - 3870, 3868, 3866, 3864, 3966, 3964, 3962, 3960, - 4062, 4060, 4058, 4056, 4158, 4156, 4154, 4152, - 4254, 4252, 4250, 4248, 4350, 4348, 4346, 4344, - 4446, 4444, 4442, 4440, 4542, 4540, 4538, 4536, - 4638, 4636, 4634, 4632, 4734, 4732, 4730, 4728, - 4830, 4828, 4826, 4824, 4926, 4924, 4922, 4920, - 5086, 5084, 5082, 5080, 5182, 5180, 5178, 5176, - 5278, 5276, 5274, 5272, 5374, 5372, 5370, 5368, - 5470, 5468, 5466, 5464, 5566, 5564, 5562, 5560, - 5662, 5660, 5658, 5656, 5758, 5756, 5754, 5752, - 5854, 5852, 5850, 5848, 5950, 5948, 5946, 5944, - 6046, 6044, 6042, 6040, 6142, 6140, 6138, 6136, - 6238, 6236, 6234, 6232, 6334, 6332, 6330, 6328, - 6430, 6428, 6426, 6424, 6526, 6524, 6522, 6520, - 6622, 6620, 6618, 6616, 6686, 6684, 6682, 6680, - 6782, 6780, 6778, 6776, 6878, 6876, 6874, 6872, - 6974, 6972, 6970, 6968, 7070, 7068, 7066, 7064, - 7166, 7164, 7162, 7160, 7262, 7260, 7258, 7256, - 7358, 7356, 7354, 7352, 7454, 7452, 7450, 7448, - 7550, 7548, 7546, 7544, 7646, 7644, 7642, 7640, - 7742, 7740, 7738, 7736, 7838, 7836, 7834, 7832, - 7934, 7932, 7930, 7928, 8030, 8028, 8026, 8024, - 8126, 8124, 8122, 8120, 8222, 8220, 8218, 8216, - 8318, 8316, 8314, 8312, 8382, 8380, 8378, 8376, - 8478, 8476, 8474, 8472, 8574, 8572, 8570, 8568, - 8670, 8668, 8666, 8664, 8766, 8764, 8762, 8760, - 8862, 8860, 8858, 8856, 8958, 8956, 8954, 8952, - 9054, 9052, 9050, 9048, 9150, 9148, 9146, 9144, - 9246, 9244, 9242, 9240, 9342, 9340, 9338, 9336, - 9438, 9436, 9434, 9432, 9534, 9532, 9530, 9528, - 9630, 9628, 9626, 9624, 9726, 9724, 9722, 9720, - 9822, 9820, 9818, 9816, 9918, 9916, 9914, 9912, - 10078, 10076, 10074, 10072, 10174, 10172, 10170, 10168, - 10270, 10268, 10266, 10264, 10366, 10364, 10362, 10360, - 10462, 10460, 10458, 10456, 10558, 10556, 10554, 10552, - 10654, 10652, 10650, 10648, 10750, 10748, 10746, 10744, - 10846, 10844, 10842, 10840, 10942, 10940, 10938, 10936, - 11038, 11036, 11034, 11032, 11134, 11132, 11130, 11128, - 11230, 11228, 11226, 11224, 11326, 11324, 11322, 11320, - 11422, 11420, 11418, 11416, 11518, 11516, 11514, 11512, - 11614, 11612, 11610, 11608, 11678, 11676, 11674, 11672, - 11774, 11772, 11770, 11768, 11870, 11868, 11866, 11864, - 11966, 11964, 11962, 11960, 12062, 12060, 12058, 12056, - 12158, 12156, 12154, 12152, 12254, 12252, 12250, 12248, - 12350, 12348, 12346, 12344, 12446, 12444, 12442, 12440, - 12542, 12540, 12538, 12536, 12638, 12636, 12634, 12632, - 12734, 12732, 12730, 12728, 12830, 12828, 12826, 12824, - 12926, 12924, 12922, 12920, 13022, 13020, 13018, 13016, - 13118, 13116, 13114, 13112, 13214, 13212, 13210, 13208, - 13278, 13276, 13274, 13272, 13374, 13372, 13370, 13368, - 13470, 13468, 13466, 13464, 13566, 13564, 13562, 13560, - 13662, 13660, 13658, 13656, 13758, 13756, 13754, 13752, - 13854, 13852, 13850, 13848, 13950, 13948, 13946, 13944, - 14046, 14044, 14042, 14040, 14142, 14140, 14138, 14136, - 14238, 14236, 14234, 14232, 14334, 14332, 14330, 14328, - 14430, 14428, 14426, 14424, 14526, 14524, 14522, 14520, - 14622, 14620, 14618, 14616, 14718, 14716, 14714, 14712, - 14814, 14812, 14810, 14808, 14910, 14908, 14906, 14904, - 15070, 15068, 15066, 15064, 15166, 15164, 15162, 15160, - 15262, 15260, 15258, 15256, 15358, 15356, 15354, 15352, - 15454, 15452, 15450, 15448, 15550, 15548, 15546, 15544, - 15646, 15644, 15642, 15640, 15742, 15740, 15738, 15736, - 15838, 15836, 15834, 15832, 15934, 15932, 15930, 15928, - 16030, 16028, 16026, 16024, 16126, 16124, 16122, 16120, - 16222, 16220, 16218, 16216, 16318, 16316, 16314, 16312, - 16414, 16412, 16410, 16408, 16510, 16508, 16506, 16504, - 16606, 16604, 16602, 16600, 16670, 16668, 16666, 16664, - 16766, 16764, 16762, 16760, 16862, 16860, 16858, 16856, - 16958, 16956, 16954, 16952, 17054, 17052, 17050, 17048, - 17150, 17148, 17146, 17144, 17246, 17244, 17242, 17240, - 17342, 17340, 17338, 17336, 17438, 17436, 17434, 17432, - 17534, 17532, 17530, 17528, 17630, 17628, 17626, 17624, - 17726, 17724, 17722, 17720, 17822, 17820, 17818, 17816, - 17918, 17916, 17914, 17912, 18014, 18012, 18010, 18008, - 18110, 18108, 18106, 18104, 18206, 18204, 18202, 18200, - 18270, 18268, 18266, 18264, 18366, 18364, 18362, 18360, - 18462, 18460, 18458, 18456, 18558, 18556, 18554, 18552, - 18654, 18652, 18650, 18648, 18750, 18748, 18746, 18744, - 18846, 18844, 18842, 18840, 18942, 18940, 18938, 18936, - 19038, 19036, 19034, 19032, 19134, 19132, 19130, 19128, - 19230, 19228, 19226, 19224, 19326, 19324, 19322, 19320, - 19422, 19420, 19418, 19416, 19518, 19516, 19514, 19512, - 19614, 19612, 19610, 19608, 19710, 19708, 19706, 19704, - 19806, 19804, 19802, 19800, }, + /* 0 */ + { + 6, 4, 2, 0, 102, 100, 98, 96, 198, 196, 194, + 192, 294, 292, 290, 288, 390, 388, 386, 384, 486, 484, + 482, 480, 582, 580, 578, 576, 678, 676, 674, 672, 774, + 772, 770, 768, 870, 868, 866, 864, 966, 964, 962, 960, + 1062, 1060, 1058, 1056, 1158, 1156, 1154, 1152, 1254, 1252, 1250, + 1248, 1350, 1348, 1346, 1344, 1446, 1444, 1442, 1440, 1542, 1540, + 1538, 1536, 1638, 1636, 1634, 1632, 1798, 1796, 1794, 1792, 1894, + 1892, 1890, 1888, 1990, 1988, 1986, 1984, 2086, 2084, 2082, 2080, + 2182, 2180, 2178, 2176, 2278, 2276, 2274, 2272, 2374, 2372, 2370, + 2368, 2470, 2468, 2466, 2464, 2566, 2564, 2562, 2560, 2662, 2660, + 2658, 2656, 2758, 2756, 2754, 2752, 2854, 2852, 2850, 2848, 2950, + 2948, 2946, 2944, 3046, 3044, 3042, 3040, 3142, 3140, 3138, 3136, + 3238, 3236, 3234, 3232, 3334, 3332, 3330, 3328, 3398, 3396, 3394, + 3392, 3494, 3492, 3490, 3488, 3590, 3588, 3586, 3584, 3686, 3684, + 3682, 3680, 3782, 3780, 3778, 3776, 3878, 3876, 3874, 3872, 3974, + 3972, 3970, 3968, 4070, 4068, 4066, 4064, 4166, 4164, 4162, 4160, + 4262, 4260, 4258, 4256, 4358, 4356, 4354, 4352, 4454, 4452, 4450, + 4448, 4550, 4548, 4546, 4544, 4646, 4644, 4642, 4640, 4742, 4740, + 4738, 4736, 4838, 4836, 4834, 4832, 4934, 4932, 4930, 4928, 4998, + 4996, 4994, 4992, 5094, 5092, 5090, 5088, 5190, 5188, 5186, 5184, + 5286, 5284, 5282, 5280, 5382, 5380, 5378, 5376, 5478, 5476, 5474, + 5472, 5574, 5572, 5570, 5568, 5670, 5668, 5666, 5664, 5766, 5764, + 5762, 5760, 5862, 5860, 5858, 5856, 5958, 5956, 5954, 5952, 6054, + 6052, 6050, 6048, 6150, 6148, 6146, 6144, 6246, 6244, 6242, 6240, + 6342, 6340, 6338, 6336, 6438, 6436, 6434, 6432, 6534, 6532, 6530, + 6528, 6694, 6692, 6690, 6688, 6790, 6788, 6786, 6784, 6886, 6884, + 6882, 6880, 6982, 6980, 6978, 6976, 7078, 7076, 7074, 7072, 7174, + 7172, 7170, 7168, 7270, 7268, 7266, 7264, 7366, 7364, 7362, 7360, + 7462, 7460, 7458, 7456, 7558, 7556, 7554, 7552, 7654, 7652, 7650, + 7648, 7750, 7748, 7746, 7744, 7846, 7844, 7842, 7840, 7942, 7940, + 7938, 7936, 8038, 8036, 8034, 8032, 8134, 8132, 8130, 8128, 8230, + 8228, 8226, 8224, 8326, 8324, 8322, 8320, 8390, 8388, 8386, 8384, + 8486, 8484, 8482, 8480, 8582, 8580, 8578, 8576, 8678, 8676, 8674, + 8672, 8774, 8772, 8770, 8768, 8870, 8868, 8866, 8864, 8966, 8964, + 8962, 8960, 9062, 9060, 9058, 9056, 9158, 9156, 9154, 9152, 9254, + 9252, 9250, 9248, 9350, 9348, 9346, 9344, 9446, 9444, 9442, 9440, + 9542, 9540, 9538, 9536, 9638, 9636, 9634, 9632, 9734, 9732, 9730, + 9728, 9830, 9828, 9826, 9824, 9926, 9924, 9922, 9920, 9990, 9988, + 9986, 9984, 10086, 10084, 10082, 10080, 10182, 10180, 10178, 10176, 10278, + 10276, 10274, 10272, 10374, 10372, 10370, 10368, 10470, 10468, 10466, 10464, + 10566, 10564, 10562, 10560, 10662, 10660, 10658, 10656, 10758, 10756, 10754, + 10752, 10854, 10852, 10850, 10848, 10950, 10948, 10946, 10944, 11046, 11044, + 11042, 11040, 11142, 11140, 11138, 11136, 11238, 11236, 11234, 11232, 11334, + 11332, 11330, 11328, 11430, 11428, 11426, 11424, 11526, 11524, 11522, 11520, + 11686, 11684, 11682, 11680, 11782, 11780, 11778, 11776, 11878, 11876, 11874, + 11872, 11974, 11972, 11970, 11968, 12070, 12068, 12066, 12064, 12166, 12164, + 12162, 12160, 12262, 12260, 12258, 12256, 12358, 12356, 12354, 12352, 12454, + 12452, 12450, 12448, 12550, 12548, 12546, 12544, 12646, 12644, 12642, 12640, + 12742, 12740, 12738, 12736, 12838, 12836, 12834, 12832, 12934, 12932, 12930, + 12928, 13030, 13028, 13026, 13024, 13126, 13124, 13122, 13120, 13222, 13220, + 13218, 13216, 13286, 13284, 13282, 13280, 13382, 13380, 13378, 13376, 13478, + 13476, 13474, 13472, 13574, 13572, 13570, 13568, 13670, 13668, 13666, 13664, + 13766, 13764, 13762, 13760, 13862, 13860, 13858, 13856, 13958, 13956, 13954, + 13952, 14054, 14052, 14050, 14048, 14150, 14148, 14146, 14144, 14246, 14244, + 14242, 14240, 14342, 14340, 14338, 14336, 14438, 14436, 14434, 14432, 14534, + 14532, 14530, 14528, 14630, 14628, 14626, 14624, 14726, 14724, 14722, 14720, + 14822, 14820, 14818, 14816, 14918, 14916, 14914, 14912, 14982, 14980, 14978, + 14976, 15078, 15076, 15074, 15072, 15174, 15172, 15170, 15168, 15270, 15268, + 15266, 15264, 15366, 15364, 15362, 15360, 15462, 15460, 15458, 15456, 15558, + 15556, 15554, 15552, 15654, 15652, 15650, 15648, 15750, 15748, 15746, 15744, + 15846, 15844, 15842, 15840, 15942, 15940, 15938, 15936, 16038, 16036, 16034, + 16032, 16134, 16132, 16130, 16128, 16230, 16228, 16226, 16224, 16326, 16324, + 16322, 16320, 16422, 16420, 16418, 16416, 16518, 16516, 16514, 16512, 16678, + 16676, 16674, 16672, 16774, 16772, 16770, 16768, 16870, 16868, 16866, 16864, + 16966, 16964, 16962, 16960, 17062, 17060, 17058, 17056, 17158, 17156, 17154, + 17152, 17254, 17252, 17250, 17248, 17350, 17348, 17346, 17344, 17446, 17444, + 17442, 17440, 17542, 17540, 17538, 17536, 17638, 17636, 17634, 17632, 17734, + 17732, 17730, 17728, 17830, 17828, 17826, 17824, 17926, 17924, 17922, 17920, + 18022, 18020, 18018, 18016, 18118, 18116, 18114, 18112, 18214, 18212, 18210, + 18208, 18278, 18276, 18274, 18272, 18374, 18372, 18370, 18368, 18470, 18468, + 18466, 18464, 18566, 18564, 18562, 18560, 18662, 18660, 18658, 18656, 18758, + 18756, 18754, 18752, 18854, 18852, 18850, 18848, 18950, 18948, 18946, 18944, + 19046, 19044, 19042, 19040, 19142, 19140, 19138, 19136, 19238, 19236, 19234, + 19232, 19334, 19332, 19330, 19328, 19430, 19428, 19426, 19424, 19526, 19524, + 19522, 19520, 19622, 19620, 19618, 19616, 19718, 19716, 19714, 19712, 19814, + 19812, 19810, 19808, + }, + /* 1 */ + { + 14, 12, 10, 8, 110, 108, 106, 104, 206, 204, 202, + 200, 302, 300, 298, 296, 398, 396, 394, 392, 494, 492, + 490, 488, 590, 588, 586, 584, 686, 684, 682, 680, 782, + 780, 778, 776, 878, 876, 874, 872, 974, 972, 970, 968, + 1070, 1068, 1066, 1064, 1166, 1164, 1162, 1160, 1262, 1260, 1258, + 1256, 1358, 1356, 1354, 1352, 1454, 1452, 1450, 1448, 1550, 1548, + 1546, 1544, 1646, 1644, 1642, 1640, 1806, 1804, 1802, 1800, 1902, + 1900, 1898, 1896, 1998, 1996, 1994, 1992, 2094, 2092, 2090, 2088, + 2190, 2188, 2186, 2184, 2286, 2284, 2282, 2280, 2382, 2380, 2378, + 2376, 2478, 2476, 2474, 2472, 2574, 2572, 2570, 2568, 2670, 2668, + 2666, 2664, 2766, 2764, 2762, 2760, 2862, 2860, 2858, 2856, 2958, + 2956, 2954, 2952, 3054, 3052, 3050, 3048, 3150, 3148, 3146, 3144, + 3246, 3244, 3242, 3240, 3342, 3340, 3338, 3336, 3406, 3404, 3402, + 3400, 3502, 3500, 3498, 3496, 3598, 3596, 3594, 3592, 3694, 3692, + 3690, 3688, 3790, 3788, 3786, 3784, 3886, 3884, 3882, 3880, 3982, + 3980, 3978, 3976, 4078, 4076, 4074, 4072, 4174, 4172, 4170, 4168, + 4270, 4268, 4266, 4264, 4366, 4364, 4362, 4360, 4462, 4460, 4458, + 4456, 4558, 4556, 4554, 4552, 4654, 4652, 4650, 4648, 4750, 4748, + 4746, 4744, 4846, 4844, 4842, 4840, 4942, 4940, 4938, 4936, 5006, + 5004, 5002, 5000, 5102, 5100, 5098, 5096, 5198, 5196, 5194, 5192, + 5294, 5292, 5290, 5288, 5390, 5388, 5386, 5384, 5486, 5484, 5482, + 5480, 5582, 5580, 5578, 5576, 5678, 5676, 5674, 5672, 5774, 5772, + 5770, 5768, 5870, 5868, 5866, 5864, 5966, 5964, 5962, 5960, 6062, + 6060, 6058, 6056, 6158, 6156, 6154, 6152, 6254, 6252, 6250, 6248, + 6350, 6348, 6346, 6344, 6446, 6444, 6442, 6440, 6542, 6540, 6538, + 6536, 6702, 6700, 6698, 6696, 6798, 6796, 6794, 6792, 6894, 6892, + 6890, 6888, 6990, 6988, 6986, 6984, 7086, 7084, 7082, 7080, 7182, + 7180, 7178, 7176, 7278, 7276, 7274, 7272, 7374, 7372, 7370, 7368, + 7470, 7468, 7466, 7464, 7566, 7564, 7562, 7560, 7662, 7660, 7658, + 7656, 7758, 7756, 7754, 7752, 7854, 7852, 7850, 7848, 7950, 7948, + 7946, 7944, 8046, 8044, 8042, 8040, 8142, 8140, 8138, 8136, 8238, + 8236, 8234, 8232, 8334, 8332, 8330, 8328, 8398, 8396, 8394, 8392, + 8494, 8492, 8490, 8488, 8590, 8588, 8586, 8584, 8686, 8684, 8682, + 8680, 8782, 8780, 8778, 8776, 8878, 8876, 8874, 8872, 8974, 8972, + 8970, 8968, 9070, 9068, 9066, 9064, 9166, 9164, 9162, 9160, 9262, + 9260, 9258, 9256, 9358, 9356, 9354, 9352, 9454, 9452, 9450, 9448, + 9550, 9548, 9546, 9544, 9646, 9644, 9642, 9640, 9742, 9740, 9738, + 9736, 9838, 9836, 9834, 9832, 9934, 9932, 9930, 9928, 9998, 9996, + 9994, 9992, 10094, 10092, 10090, 10088, 10190, 10188, 10186, 10184, 10286, + 10284, 10282, 10280, 10382, 10380, 10378, 10376, 10478, 10476, 10474, 10472, + 10574, 10572, 10570, 10568, 10670, 10668, 10666, 10664, 10766, 10764, 10762, + 10760, 10862, 10860, 10858, 10856, 10958, 10956, 10954, 10952, 11054, 11052, + 11050, 11048, 11150, 11148, 11146, 11144, 11246, 11244, 11242, 11240, 11342, + 11340, 11338, 11336, 11438, 11436, 11434, 11432, 11534, 11532, 11530, 11528, + 11694, 11692, 11690, 11688, 11790, 11788, 11786, 11784, 11886, 11884, 11882, + 11880, 11982, 11980, 11978, 11976, 12078, 12076, 12074, 12072, 12174, 12172, + 12170, 12168, 12270, 12268, 12266, 12264, 12366, 12364, 12362, 12360, 12462, + 12460, 12458, 12456, 12558, 12556, 12554, 12552, 12654, 12652, 12650, 12648, + 12750, 12748, 12746, 12744, 12846, 12844, 12842, 12840, 12942, 12940, 12938, + 12936, 13038, 13036, 13034, 13032, 13134, 13132, 13130, 13128, 13230, 13228, + 13226, 13224, 13294, 13292, 13290, 13288, 13390, 13388, 13386, 13384, 13486, + 13484, 13482, 13480, 13582, 13580, 13578, 13576, 13678, 13676, 13674, 13672, + 13774, 13772, 13770, 13768, 13870, 13868, 13866, 13864, 13966, 13964, 13962, + 13960, 14062, 14060, 14058, 14056, 14158, 14156, 14154, 14152, 14254, 14252, + 14250, 14248, 14350, 14348, 14346, 14344, 14446, 14444, 14442, 14440, 14542, + 14540, 14538, 14536, 14638, 14636, 14634, 14632, 14734, 14732, 14730, 14728, + 14830, 14828, 14826, 14824, 14926, 14924, 14922, 14920, 14990, 14988, 14986, + 14984, 15086, 15084, 15082, 15080, 15182, 15180, 15178, 15176, 15278, 15276, + 15274, 15272, 15374, 15372, 15370, 15368, 15470, 15468, 15466, 15464, 15566, + 15564, 15562, 15560, 15662, 15660, 15658, 15656, 15758, 15756, 15754, 15752, + 15854, 15852, 15850, 15848, 15950, 15948, 15946, 15944, 16046, 16044, 16042, + 16040, 16142, 16140, 16138, 16136, 16238, 16236, 16234, 16232, 16334, 16332, + 16330, 16328, 16430, 16428, 16426, 16424, 16526, 16524, 16522, 16520, 16686, + 16684, 16682, 16680, 16782, 16780, 16778, 16776, 16878, 16876, 16874, 16872, + 16974, 16972, 16970, 16968, 17070, 17068, 17066, 17064, 17166, 17164, 17162, + 17160, 17262, 17260, 17258, 17256, 17358, 17356, 17354, 17352, 17454, 17452, + 17450, 17448, 17550, 17548, 17546, 17544, 17646, 17644, 17642, 17640, 17742, + 17740, 17738, 17736, 17838, 17836, 17834, 17832, 17934, 17932, 17930, 17928, + 18030, 18028, 18026, 18024, 18126, 18124, 18122, 18120, 18222, 18220, 18218, + 18216, 18286, 18284, 18282, 18280, 18382, 18380, 18378, 18376, 18478, 18476, + 18474, 18472, 18574, 18572, 18570, 18568, 18670, 18668, 18666, 18664, 18766, + 18764, 18762, 18760, 18862, 18860, 18858, 18856, 18958, 18956, 18954, 18952, + 19054, 19052, 19050, 19048, 19150, 19148, 19146, 19144, 19246, 19244, 19242, + 19240, 19342, 19340, 19338, 19336, 19438, 19436, 19434, 19432, 19534, 19532, + 19530, 19528, 19630, 19628, 19626, 19624, 19726, 19724, 19722, 19720, 19822, + 19820, 19818, 19816, + }, + /* 2 */ + { + 22, 20, 18, 16, 118, 116, 114, 112, 214, 212, 210, + 208, 310, 308, 306, 304, 406, 404, 402, 400, 502, 500, + 498, 496, 598, 596, 594, 592, 694, 692, 690, 688, 790, + 788, 786, 784, 886, 884, 882, 880, 982, 980, 978, 976, + 1078, 1076, 1074, 1072, 1174, 1172, 1170, 1168, 1270, 1268, 1266, + 1264, 1366, 1364, 1362, 1360, 1462, 1460, 1458, 1456, 1558, 1556, + 1554, 1552, 1654, 1652, 1650, 1648, 1814, 1812, 1810, 1808, 1910, + 1908, 1906, 1904, 2006, 2004, 2002, 2000, 2102, 2100, 2098, 2096, + 2198, 2196, 2194, 2192, 2294, 2292, 2290, 2288, 2390, 2388, 2386, + 2384, 2486, 2484, 2482, 2480, 2582, 2580, 2578, 2576, 2678, 2676, + 2674, 2672, 2774, 2772, 2770, 2768, 2870, 2868, 2866, 2864, 2966, + 2964, 2962, 2960, 3062, 3060, 3058, 3056, 3158, 3156, 3154, 3152, + 3254, 3252, 3250, 3248, 3350, 3348, 3346, 3344, 3414, 3412, 3410, + 3408, 3510, 3508, 3506, 3504, 3606, 3604, 3602, 3600, 3702, 3700, + 3698, 3696, 3798, 3796, 3794, 3792, 3894, 3892, 3890, 3888, 3990, + 3988, 3986, 3984, 4086, 4084, 4082, 4080, 4182, 4180, 4178, 4176, + 4278, 4276, 4274, 4272, 4374, 4372, 4370, 4368, 4470, 4468, 4466, + 4464, 4566, 4564, 4562, 4560, 4662, 4660, 4658, 4656, 4758, 4756, + 4754, 4752, 4854, 4852, 4850, 4848, 4950, 4948, 4946, 4944, 5014, + 5012, 5010, 5008, 5110, 5108, 5106, 5104, 5206, 5204, 5202, 5200, + 5302, 5300, 5298, 5296, 5398, 5396, 5394, 5392, 5494, 5492, 5490, + 5488, 5590, 5588, 5586, 5584, 5686, 5684, 5682, 5680, 5782, 5780, + 5778, 5776, 5878, 5876, 5874, 5872, 5974, 5972, 5970, 5968, 6070, + 6068, 6066, 6064, 6166, 6164, 6162, 6160, 6262, 6260, 6258, 6256, + 6358, 6356, 6354, 6352, 6454, 6452, 6450, 6448, 6550, 6548, 6546, + 6544, 6710, 6708, 6706, 6704, 6806, 6804, 6802, 6800, 6902, 6900, + 6898, 6896, 6998, 6996, 6994, 6992, 7094, 7092, 7090, 7088, 7190, + 7188, 7186, 7184, 7286, 7284, 7282, 7280, 7382, 7380, 7378, 7376, + 7478, 7476, 7474, 7472, 7574, 7572, 7570, 7568, 7670, 7668, 7666, + 7664, 7766, 7764, 7762, 7760, 7862, 7860, 7858, 7856, 7958, 7956, + 7954, 7952, 8054, 8052, 8050, 8048, 8150, 8148, 8146, 8144, 8246, + 8244, 8242, 8240, 8342, 8340, 8338, 8336, 8406, 8404, 8402, 8400, + 8502, 8500, 8498, 8496, 8598, 8596, 8594, 8592, 8694, 8692, 8690, + 8688, 8790, 8788, 8786, 8784, 8886, 8884, 8882, 8880, 8982, 8980, + 8978, 8976, 9078, 9076, 9074, 9072, 9174, 9172, 9170, 9168, 9270, + 9268, 9266, 9264, 9366, 9364, 9362, 9360, 9462, 9460, 9458, 9456, + 9558, 9556, 9554, 9552, 9654, 9652, 9650, 9648, 9750, 9748, 9746, + 9744, 9846, 9844, 9842, 9840, 9942, 9940, 9938, 9936, 10006, 10004, + 10002, 10000, 10102, 10100, 10098, 10096, 10198, 10196, 10194, 10192, 10294, + 10292, 10290, 10288, 10390, 10388, 10386, 10384, 10486, 10484, 10482, 10480, + 10582, 10580, 10578, 10576, 10678, 10676, 10674, 10672, 10774, 10772, 10770, + 10768, 10870, 10868, 10866, 10864, 10966, 10964, 10962, 10960, 11062, 11060, + 11058, 11056, 11158, 11156, 11154, 11152, 11254, 11252, 11250, 11248, 11350, + 11348, 11346, 11344, 11446, 11444, 11442, 11440, 11542, 11540, 11538, 11536, + 11702, 11700, 11698, 11696, 11798, 11796, 11794, 11792, 11894, 11892, 11890, + 11888, 11990, 11988, 11986, 11984, 12086, 12084, 12082, 12080, 12182, 12180, + 12178, 12176, 12278, 12276, 12274, 12272, 12374, 12372, 12370, 12368, 12470, + 12468, 12466, 12464, 12566, 12564, 12562, 12560, 12662, 12660, 12658, 12656, + 12758, 12756, 12754, 12752, 12854, 12852, 12850, 12848, 12950, 12948, 12946, + 12944, 13046, 13044, 13042, 13040, 13142, 13140, 13138, 13136, 13238, 13236, + 13234, 13232, 13302, 13300, 13298, 13296, 13398, 13396, 13394, 13392, 13494, + 13492, 13490, 13488, 13590, 13588, 13586, 13584, 13686, 13684, 13682, 13680, + 13782, 13780, 13778, 13776, 13878, 13876, 13874, 13872, 13974, 13972, 13970, + 13968, 14070, 14068, 14066, 14064, 14166, 14164, 14162, 14160, 14262, 14260, + 14258, 14256, 14358, 14356, 14354, 14352, 14454, 14452, 14450, 14448, 14550, + 14548, 14546, 14544, 14646, 14644, 14642, 14640, 14742, 14740, 14738, 14736, + 14838, 14836, 14834, 14832, 14934, 14932, 14930, 14928, 14998, 14996, 14994, + 14992, 15094, 15092, 15090, 15088, 15190, 15188, 15186, 15184, 15286, 15284, + 15282, 15280, 15382, 15380, 15378, 15376, 15478, 15476, 15474, 15472, 15574, + 15572, 15570, 15568, 15670, 15668, 15666, 15664, 15766, 15764, 15762, 15760, + 15862, 15860, 15858, 15856, 15958, 15956, 15954, 15952, 16054, 16052, 16050, + 16048, 16150, 16148, 16146, 16144, 16246, 16244, 16242, 16240, 16342, 16340, + 16338, 16336, 16438, 16436, 16434, 16432, 16534, 16532, 16530, 16528, 16694, + 16692, 16690, 16688, 16790, 16788, 16786, 16784, 16886, 16884, 16882, 16880, + 16982, 16980, 16978, 16976, 17078, 17076, 17074, 17072, 17174, 17172, 17170, + 17168, 17270, 17268, 17266, 17264, 17366, 17364, 17362, 17360, 17462, 17460, + 17458, 17456, 17558, 17556, 17554, 17552, 17654, 17652, 17650, 17648, 17750, + 17748, 17746, 17744, 17846, 17844, 17842, 17840, 17942, 17940, 17938, 17936, + 18038, 18036, 18034, 18032, 18134, 18132, 18130, 18128, 18230, 18228, 18226, + 18224, 18294, 18292, 18290, 18288, 18390, 18388, 18386, 18384, 18486, 18484, + 18482, 18480, 18582, 18580, 18578, 18576, 18678, 18676, 18674, 18672, 18774, + 18772, 18770, 18768, 18870, 18868, 18866, 18864, 18966, 18964, 18962, 18960, + 19062, 19060, 19058, 19056, 19158, 19156, 19154, 19152, 19254, 19252, 19250, + 19248, 19350, 19348, 19346, 19344, 19446, 19444, 19442, 19440, 19542, 19540, + 19538, 19536, 19638, 19636, 19634, 19632, 19734, 19732, 19730, 19728, 19830, + 19828, 19826, 19824, + }, + /* 3 */ + { + 30, 28, 26, 24, 126, 124, 122, 120, 222, 220, 218, + 216, 318, 316, 314, 312, 414, 412, 410, 408, 510, 508, + 506, 504, 606, 604, 602, 600, 702, 700, 698, 696, 798, + 796, 794, 792, 894, 892, 890, 888, 990, 988, 986, 984, + 1086, 1084, 1082, 1080, 1182, 1180, 1178, 1176, 1278, 1276, 1274, + 1272, 1374, 1372, 1370, 1368, 1470, 1468, 1466, 1464, 1566, 1564, + 1562, 1560, 1662, 1660, 1658, 1656, 1822, 1820, 1818, 1816, 1918, + 1916, 1914, 1912, 2014, 2012, 2010, 2008, 2110, 2108, 2106, 2104, + 2206, 2204, 2202, 2200, 2302, 2300, 2298, 2296, 2398, 2396, 2394, + 2392, 2494, 2492, 2490, 2488, 2590, 2588, 2586, 2584, 2686, 2684, + 2682, 2680, 2782, 2780, 2778, 2776, 2878, 2876, 2874, 2872, 2974, + 2972, 2970, 2968, 3070, 3068, 3066, 3064, 3166, 3164, 3162, 3160, + 3262, 3260, 3258, 3256, 3358, 3356, 3354, 3352, 3422, 3420, 3418, + 3416, 3518, 3516, 3514, 3512, 3614, 3612, 3610, 3608, 3710, 3708, + 3706, 3704, 3806, 3804, 3802, 3800, 3902, 3900, 3898, 3896, 3998, + 3996, 3994, 3992, 4094, 4092, 4090, 4088, 4190, 4188, 4186, 4184, + 4286, 4284, 4282, 4280, 4382, 4380, 4378, 4376, 4478, 4476, 4474, + 4472, 4574, 4572, 4570, 4568, 4670, 4668, 4666, 4664, 4766, 4764, + 4762, 4760, 4862, 4860, 4858, 4856, 4958, 4956, 4954, 4952, 5022, + 5020, 5018, 5016, 5118, 5116, 5114, 5112, 5214, 5212, 5210, 5208, + 5310, 5308, 5306, 5304, 5406, 5404, 5402, 5400, 5502, 5500, 5498, + 5496, 5598, 5596, 5594, 5592, 5694, 5692, 5690, 5688, 5790, 5788, + 5786, 5784, 5886, 5884, 5882, 5880, 5982, 5980, 5978, 5976, 6078, + 6076, 6074, 6072, 6174, 6172, 6170, 6168, 6270, 6268, 6266, 6264, + 6366, 6364, 6362, 6360, 6462, 6460, 6458, 6456, 6558, 6556, 6554, + 6552, 6718, 6716, 6714, 6712, 6814, 6812, 6810, 6808, 6910, 6908, + 6906, 6904, 7006, 7004, 7002, 7000, 7102, 7100, 7098, 7096, 7198, + 7196, 7194, 7192, 7294, 7292, 7290, 7288, 7390, 7388, 7386, 7384, + 7486, 7484, 7482, 7480, 7582, 7580, 7578, 7576, 7678, 7676, 7674, + 7672, 7774, 7772, 7770, 7768, 7870, 7868, 7866, 7864, 7966, 7964, + 7962, 7960, 8062, 8060, 8058, 8056, 8158, 8156, 8154, 8152, 8254, + 8252, 8250, 8248, 8350, 8348, 8346, 8344, 8414, 8412, 8410, 8408, + 8510, 8508, 8506, 8504, 8606, 8604, 8602, 8600, 8702, 8700, 8698, + 8696, 8798, 8796, 8794, 8792, 8894, 8892, 8890, 8888, 8990, 8988, + 8986, 8984, 9086, 9084, 9082, 9080, 9182, 9180, 9178, 9176, 9278, + 9276, 9274, 9272, 9374, 9372, 9370, 9368, 9470, 9468, 9466, 9464, + 9566, 9564, 9562, 9560, 9662, 9660, 9658, 9656, 9758, 9756, 9754, + 9752, 9854, 9852, 9850, 9848, 9950, 9948, 9946, 9944, 10014, 10012, + 10010, 10008, 10110, 10108, 10106, 10104, 10206, 10204, 10202, 10200, 10302, + 10300, 10298, 10296, 10398, 10396, 10394, 10392, 10494, 10492, 10490, 10488, + 10590, 10588, 10586, 10584, 10686, 10684, 10682, 10680, 10782, 10780, 10778, + 10776, 10878, 10876, 10874, 10872, 10974, 10972, 10970, 10968, 11070, 11068, + 11066, 11064, 11166, 11164, 11162, 11160, 11262, 11260, 11258, 11256, 11358, + 11356, 11354, 11352, 11454, 11452, 11450, 11448, 11550, 11548, 11546, 11544, + 11710, 11708, 11706, 11704, 11806, 11804, 11802, 11800, 11902, 11900, 11898, + 11896, 11998, 11996, 11994, 11992, 12094, 12092, 12090, 12088, 12190, 12188, + 12186, 12184, 12286, 12284, 12282, 12280, 12382, 12380, 12378, 12376, 12478, + 12476, 12474, 12472, 12574, 12572, 12570, 12568, 12670, 12668, 12666, 12664, + 12766, 12764, 12762, 12760, 12862, 12860, 12858, 12856, 12958, 12956, 12954, + 12952, 13054, 13052, 13050, 13048, 13150, 13148, 13146, 13144, 13246, 13244, + 13242, 13240, 13310, 13308, 13306, 13304, 13406, 13404, 13402, 13400, 13502, + 13500, 13498, 13496, 13598, 13596, 13594, 13592, 13694, 13692, 13690, 13688, + 13790, 13788, 13786, 13784, 13886, 13884, 13882, 13880, 13982, 13980, 13978, + 13976, 14078, 14076, 14074, 14072, 14174, 14172, 14170, 14168, 14270, 14268, + 14266, 14264, 14366, 14364, 14362, 14360, 14462, 14460, 14458, 14456, 14558, + 14556, 14554, 14552, 14654, 14652, 14650, 14648, 14750, 14748, 14746, 14744, + 14846, 14844, 14842, 14840, 14942, 14940, 14938, 14936, 15006, 15004, 15002, + 15000, 15102, 15100, 15098, 15096, 15198, 15196, 15194, 15192, 15294, 15292, + 15290, 15288, 15390, 15388, 15386, 15384, 15486, 15484, 15482, 15480, 15582, + 15580, 15578, 15576, 15678, 15676, 15674, 15672, 15774, 15772, 15770, 15768, + 15870, 15868, 15866, 15864, 15966, 15964, 15962, 15960, 16062, 16060, 16058, + 16056, 16158, 16156, 16154, 16152, 16254, 16252, 16250, 16248, 16350, 16348, + 16346, 16344, 16446, 16444, 16442, 16440, 16542, 16540, 16538, 16536, 16702, + 16700, 16698, 16696, 16798, 16796, 16794, 16792, 16894, 16892, 16890, 16888, + 16990, 16988, 16986, 16984, 17086, 17084, 17082, 17080, 17182, 17180, 17178, + 17176, 17278, 17276, 17274, 17272, 17374, 17372, 17370, 17368, 17470, 17468, + 17466, 17464, 17566, 17564, 17562, 17560, 17662, 17660, 17658, 17656, 17758, + 17756, 17754, 17752, 17854, 17852, 17850, 17848, 17950, 17948, 17946, 17944, + 18046, 18044, 18042, 18040, 18142, 18140, 18138, 18136, 18238, 18236, 18234, + 18232, 18302, 18300, 18298, 18296, 18398, 18396, 18394, 18392, 18494, 18492, + 18490, 18488, 18590, 18588, 18586, 18584, 18686, 18684, 18682, 18680, 18782, + 18780, 18778, 18776, 18878, 18876, 18874, 18872, 18974, 18972, 18970, 18968, + 19070, 19068, 19066, 19064, 19166, 19164, 19162, 19160, 19262, 19260, 19258, + 19256, 19358, 19356, 19354, 19352, 19454, 19452, 19450, 19448, 19550, 19548, + 19546, 19544, 19646, 19644, 19642, 19640, 19742, 19740, 19738, 19736, 19838, + 19836, 19834, 19832, + }, + /* 4 */ + { + 38, 36, 34, 32, 134, 132, 130, 128, 230, 228, 226, + 224, 326, 324, 322, 320, 422, 420, 418, 416, 518, 516, + 514, 512, 614, 612, 610, 608, 710, 708, 706, 704, 806, + 804, 802, 800, 902, 900, 898, 896, 998, 996, 994, 992, + 1094, 1092, 1090, 1088, 1190, 1188, 1186, 1184, 1286, 1284, 1282, + 1280, 1382, 1380, 1378, 1376, 1478, 1476, 1474, 1472, 1574, 1572, + 1570, 1568, 1670, 1668, 1666, 1664, 1734, 1732, 1730, 1728, 1830, + 1828, 1826, 1824, 1926, 1924, 1922, 1920, 2022, 2020, 2018, 2016, + 2118, 2116, 2114, 2112, 2214, 2212, 2210, 2208, 2310, 2308, 2306, + 2304, 2406, 2404, 2402, 2400, 2502, 2500, 2498, 2496, 2598, 2596, + 2594, 2592, 2694, 2692, 2690, 2688, 2790, 2788, 2786, 2784, 2886, + 2884, 2882, 2880, 2982, 2980, 2978, 2976, 3078, 3076, 3074, 3072, + 3174, 3172, 3170, 3168, 3270, 3268, 3266, 3264, 3430, 3428, 3426, + 3424, 3526, 3524, 3522, 3520, 3622, 3620, 3618, 3616, 3718, 3716, + 3714, 3712, 3814, 3812, 3810, 3808, 3910, 3908, 3906, 3904, 4006, + 4004, 4002, 4000, 4102, 4100, 4098, 4096, 4198, 4196, 4194, 4192, + 4294, 4292, 4290, 4288, 4390, 4388, 4386, 4384, 4486, 4484, 4482, + 4480, 4582, 4580, 4578, 4576, 4678, 4676, 4674, 4672, 4774, 4772, + 4770, 4768, 4870, 4868, 4866, 4864, 4966, 4964, 4962, 4960, 5030, + 5028, 5026, 5024, 5126, 5124, 5122, 5120, 5222, 5220, 5218, 5216, + 5318, 5316, 5314, 5312, 5414, 5412, 5410, 5408, 5510, 5508, 5506, + 5504, 5606, 5604, 5602, 5600, 5702, 5700, 5698, 5696, 5798, 5796, + 5794, 5792, 5894, 5892, 5890, 5888, 5990, 5988, 5986, 5984, 6086, + 6084, 6082, 6080, 6182, 6180, 6178, 6176, 6278, 6276, 6274, 6272, + 6374, 6372, 6370, 6368, 6470, 6468, 6466, 6464, 6566, 6564, 6562, + 6560, 6630, 6628, 6626, 6624, 6726, 6724, 6722, 6720, 6822, 6820, + 6818, 6816, 6918, 6916, 6914, 6912, 7014, 7012, 7010, 7008, 7110, + 7108, 7106, 7104, 7206, 7204, 7202, 7200, 7302, 7300, 7298, 7296, + 7398, 7396, 7394, 7392, 7494, 7492, 7490, 7488, 7590, 7588, 7586, + 7584, 7686, 7684, 7682, 7680, 7782, 7780, 7778, 7776, 7878, 7876, + 7874, 7872, 7974, 7972, 7970, 7968, 8070, 8068, 8066, 8064, 8166, + 8164, 8162, 8160, 8262, 8260, 8258, 8256, 8422, 8420, 8418, 8416, + 8518, 8516, 8514, 8512, 8614, 8612, 8610, 8608, 8710, 8708, 8706, + 8704, 8806, 8804, 8802, 8800, 8902, 8900, 8898, 8896, 8998, 8996, + 8994, 8992, 9094, 9092, 9090, 9088, 9190, 9188, 9186, 9184, 9286, + 9284, 9282, 9280, 9382, 9380, 9378, 9376, 9478, 9476, 9474, 9472, + 9574, 9572, 9570, 9568, 9670, 9668, 9666, 9664, 9766, 9764, 9762, + 9760, 9862, 9860, 9858, 9856, 9958, 9956, 9954, 9952, 10022, 10020, + 10018, 10016, 10118, 10116, 10114, 10112, 10214, 10212, 10210, 10208, 10310, + 10308, 10306, 10304, 10406, 10404, 10402, 10400, 10502, 10500, 10498, 10496, + 10598, 10596, 10594, 10592, 10694, 10692, 10690, 10688, 10790, 10788, 10786, + 10784, 10886, 10884, 10882, 10880, 10982, 10980, 10978, 10976, 11078, 11076, + 11074, 11072, 11174, 11172, 11170, 11168, 11270, 11268, 11266, 11264, 11366, + 11364, 11362, 11360, 11462, 11460, 11458, 11456, 11558, 11556, 11554, 11552, + 11622, 11620, 11618, 11616, 11718, 11716, 11714, 11712, 11814, 11812, 11810, + 11808, 11910, 11908, 11906, 11904, 12006, 12004, 12002, 12000, 12102, 12100, + 12098, 12096, 12198, 12196, 12194, 12192, 12294, 12292, 12290, 12288, 12390, + 12388, 12386, 12384, 12486, 12484, 12482, 12480, 12582, 12580, 12578, 12576, + 12678, 12676, 12674, 12672, 12774, 12772, 12770, 12768, 12870, 12868, 12866, + 12864, 12966, 12964, 12962, 12960, 13062, 13060, 13058, 13056, 13158, 13156, + 13154, 13152, 13318, 13316, 13314, 13312, 13414, 13412, 13410, 13408, 13510, + 13508, 13506, 13504, 13606, 13604, 13602, 13600, 13702, 13700, 13698, 13696, + 13798, 13796, 13794, 13792, 13894, 13892, 13890, 13888, 13990, 13988, 13986, + 13984, 14086, 14084, 14082, 14080, 14182, 14180, 14178, 14176, 14278, 14276, + 14274, 14272, 14374, 14372, 14370, 14368, 14470, 14468, 14466, 14464, 14566, + 14564, 14562, 14560, 14662, 14660, 14658, 14656, 14758, 14756, 14754, 14752, + 14854, 14852, 14850, 14848, 14950, 14948, 14946, 14944, 15014, 15012, 15010, + 15008, 15110, 15108, 15106, 15104, 15206, 15204, 15202, 15200, 15302, 15300, + 15298, 15296, 15398, 15396, 15394, 15392, 15494, 15492, 15490, 15488, 15590, + 15588, 15586, 15584, 15686, 15684, 15682, 15680, 15782, 15780, 15778, 15776, + 15878, 15876, 15874, 15872, 15974, 15972, 15970, 15968, 16070, 16068, 16066, + 16064, 16166, 16164, 16162, 16160, 16262, 16260, 16258, 16256, 16358, 16356, + 16354, 16352, 16454, 16452, 16450, 16448, 16550, 16548, 16546, 16544, 16614, + 16612, 16610, 16608, 16710, 16708, 16706, 16704, 16806, 16804, 16802, 16800, + 16902, 16900, 16898, 16896, 16998, 16996, 16994, 16992, 17094, 17092, 17090, + 17088, 17190, 17188, 17186, 17184, 17286, 17284, 17282, 17280, 17382, 17380, + 17378, 17376, 17478, 17476, 17474, 17472, 17574, 17572, 17570, 17568, 17670, + 17668, 17666, 17664, 17766, 17764, 17762, 17760, 17862, 17860, 17858, 17856, + 17958, 17956, 17954, 17952, 18054, 18052, 18050, 18048, 18150, 18148, 18146, + 18144, 18310, 18308, 18306, 18304, 18406, 18404, 18402, 18400, 18502, 18500, + 18498, 18496, 18598, 18596, 18594, 18592, 18694, 18692, 18690, 18688, 18790, + 18788, 18786, 18784, 18886, 18884, 18882, 18880, 18982, 18980, 18978, 18976, + 19078, 19076, 19074, 19072, 19174, 19172, 19170, 19168, 19270, 19268, 19266, + 19264, 19366, 19364, 19362, 19360, 19462, 19460, 19458, 19456, 19558, 19556, + 19554, 19552, 19654, 19652, 19650, 19648, 19750, 19748, 19746, 19744, 19846, + 19844, 19842, 19840, + }, + /* 5 */ + { + 46, 44, 42, 40, 142, 140, 138, 136, 238, 236, 234, + 232, 334, 332, 330, 328, 430, 428, 426, 424, 526, 524, + 522, 520, 622, 620, 618, 616, 718, 716, 714, 712, 814, + 812, 810, 808, 910, 908, 906, 904, 1006, 1004, 1002, 1000, + 1102, 1100, 1098, 1096, 1198, 1196, 1194, 1192, 1294, 1292, 1290, + 1288, 1390, 1388, 1386, 1384, 1486, 1484, 1482, 1480, 1582, 1580, + 1578, 1576, 1678, 1676, 1674, 1672, 1742, 1740, 1738, 1736, 1838, + 1836, 1834, 1832, 1934, 1932, 1930, 1928, 2030, 2028, 2026, 2024, + 2126, 2124, 2122, 2120, 2222, 2220, 2218, 2216, 2318, 2316, 2314, + 2312, 2414, 2412, 2410, 2408, 2510, 2508, 2506, 2504, 2606, 2604, + 2602, 2600, 2702, 2700, 2698, 2696, 2798, 2796, 2794, 2792, 2894, + 2892, 2890, 2888, 2990, 2988, 2986, 2984, 3086, 3084, 3082, 3080, + 3182, 3180, 3178, 3176, 3278, 3276, 3274, 3272, 3438, 3436, 3434, + 3432, 3534, 3532, 3530, 3528, 3630, 3628, 3626, 3624, 3726, 3724, + 3722, 3720, 3822, 3820, 3818, 3816, 3918, 3916, 3914, 3912, 4014, + 4012, 4010, 4008, 4110, 4108, 4106, 4104, 4206, 4204, 4202, 4200, + 4302, 4300, 4298, 4296, 4398, 4396, 4394, 4392, 4494, 4492, 4490, + 4488, 4590, 4588, 4586, 4584, 4686, 4684, 4682, 4680, 4782, 4780, + 4778, 4776, 4878, 4876, 4874, 4872, 4974, 4972, 4970, 4968, 5038, + 5036, 5034, 5032, 5134, 5132, 5130, 5128, 5230, 5228, 5226, 5224, + 5326, 5324, 5322, 5320, 5422, 5420, 5418, 5416, 5518, 5516, 5514, + 5512, 5614, 5612, 5610, 5608, 5710, 5708, 5706, 5704, 5806, 5804, + 5802, 5800, 5902, 5900, 5898, 5896, 5998, 5996, 5994, 5992, 6094, + 6092, 6090, 6088, 6190, 6188, 6186, 6184, 6286, 6284, 6282, 6280, + 6382, 6380, 6378, 6376, 6478, 6476, 6474, 6472, 6574, 6572, 6570, + 6568, 6638, 6636, 6634, 6632, 6734, 6732, 6730, 6728, 6830, 6828, + 6826, 6824, 6926, 6924, 6922, 6920, 7022, 7020, 7018, 7016, 7118, + 7116, 7114, 7112, 7214, 7212, 7210, 7208, 7310, 7308, 7306, 7304, + 7406, 7404, 7402, 7400, 7502, 7500, 7498, 7496, 7598, 7596, 7594, + 7592, 7694, 7692, 7690, 7688, 7790, 7788, 7786, 7784, 7886, 7884, + 7882, 7880, 7982, 7980, 7978, 7976, 8078, 8076, 8074, 8072, 8174, + 8172, 8170, 8168, 8270, 8268, 8266, 8264, 8430, 8428, 8426, 8424, + 8526, 8524, 8522, 8520, 8622, 8620, 8618, 8616, 8718, 8716, 8714, + 8712, 8814, 8812, 8810, 8808, 8910, 8908, 8906, 8904, 9006, 9004, + 9002, 9000, 9102, 9100, 9098, 9096, 9198, 9196, 9194, 9192, 9294, + 9292, 9290, 9288, 9390, 9388, 9386, 9384, 9486, 9484, 9482, 9480, + 9582, 9580, 9578, 9576, 9678, 9676, 9674, 9672, 9774, 9772, 9770, + 9768, 9870, 9868, 9866, 9864, 9966, 9964, 9962, 9960, 10030, 10028, + 10026, 10024, 10126, 10124, 10122, 10120, 10222, 10220, 10218, 10216, 10318, + 10316, 10314, 10312, 10414, 10412, 10410, 10408, 10510, 10508, 10506, 10504, + 10606, 10604, 10602, 10600, 10702, 10700, 10698, 10696, 10798, 10796, 10794, + 10792, 10894, 10892, 10890, 10888, 10990, 10988, 10986, 10984, 11086, 11084, + 11082, 11080, 11182, 11180, 11178, 11176, 11278, 11276, 11274, 11272, 11374, + 11372, 11370, 11368, 11470, 11468, 11466, 11464, 11566, 11564, 11562, 11560, + 11630, 11628, 11626, 11624, 11726, 11724, 11722, 11720, 11822, 11820, 11818, + 11816, 11918, 11916, 11914, 11912, 12014, 12012, 12010, 12008, 12110, 12108, + 12106, 12104, 12206, 12204, 12202, 12200, 12302, 12300, 12298, 12296, 12398, + 12396, 12394, 12392, 12494, 12492, 12490, 12488, 12590, 12588, 12586, 12584, + 12686, 12684, 12682, 12680, 12782, 12780, 12778, 12776, 12878, 12876, 12874, + 12872, 12974, 12972, 12970, 12968, 13070, 13068, 13066, 13064, 13166, 13164, + 13162, 13160, 13326, 13324, 13322, 13320, 13422, 13420, 13418, 13416, 13518, + 13516, 13514, 13512, 13614, 13612, 13610, 13608, 13710, 13708, 13706, 13704, + 13806, 13804, 13802, 13800, 13902, 13900, 13898, 13896, 13998, 13996, 13994, + 13992, 14094, 14092, 14090, 14088, 14190, 14188, 14186, 14184, 14286, 14284, + 14282, 14280, 14382, 14380, 14378, 14376, 14478, 14476, 14474, 14472, 14574, + 14572, 14570, 14568, 14670, 14668, 14666, 14664, 14766, 14764, 14762, 14760, + 14862, 14860, 14858, 14856, 14958, 14956, 14954, 14952, 15022, 15020, 15018, + 15016, 15118, 15116, 15114, 15112, 15214, 15212, 15210, 15208, 15310, 15308, + 15306, 15304, 15406, 15404, 15402, 15400, 15502, 15500, 15498, 15496, 15598, + 15596, 15594, 15592, 15694, 15692, 15690, 15688, 15790, 15788, 15786, 15784, + 15886, 15884, 15882, 15880, 15982, 15980, 15978, 15976, 16078, 16076, 16074, + 16072, 16174, 16172, 16170, 16168, 16270, 16268, 16266, 16264, 16366, 16364, + 16362, 16360, 16462, 16460, 16458, 16456, 16558, 16556, 16554, 16552, 16622, + 16620, 16618, 16616, 16718, 16716, 16714, 16712, 16814, 16812, 16810, 16808, + 16910, 16908, 16906, 16904, 17006, 17004, 17002, 17000, 17102, 17100, 17098, + 17096, 17198, 17196, 17194, 17192, 17294, 17292, 17290, 17288, 17390, 17388, + 17386, 17384, 17486, 17484, 17482, 17480, 17582, 17580, 17578, 17576, 17678, + 17676, 17674, 17672, 17774, 17772, 17770, 17768, 17870, 17868, 17866, 17864, + 17966, 17964, 17962, 17960, 18062, 18060, 18058, 18056, 18158, 18156, 18154, + 18152, 18318, 18316, 18314, 18312, 18414, 18412, 18410, 18408, 18510, 18508, + 18506, 18504, 18606, 18604, 18602, 18600, 18702, 18700, 18698, 18696, 18798, + 18796, 18794, 18792, 18894, 18892, 18890, 18888, 18990, 18988, 18986, 18984, + 19086, 19084, 19082, 19080, 19182, 19180, 19178, 19176, 19278, 19276, 19274, + 19272, 19374, 19372, 19370, 19368, 19470, 19468, 19466, 19464, 19566, 19564, + 19562, 19560, 19662, 19660, 19658, 19656, 19758, 19756, 19754, 19752, 19854, + 19852, 19850, 19848, + }, + /* 6 */ + { + 54, 52, 50, 48, 150, 148, 146, 144, 246, 244, 242, + 240, 342, 340, 338, 336, 438, 436, 434, 432, 534, 532, + 530, 528, 630, 628, 626, 624, 726, 724, 722, 720, 822, + 820, 818, 816, 918, 916, 914, 912, 1014, 1012, 1010, 1008, + 1110, 1108, 1106, 1104, 1206, 1204, 1202, 1200, 1302, 1300, 1298, + 1296, 1398, 1396, 1394, 1392, 1494, 1492, 1490, 1488, 1590, 1588, + 1586, 1584, 1686, 1684, 1682, 1680, 1750, 1748, 1746, 1744, 1846, + 1844, 1842, 1840, 1942, 1940, 1938, 1936, 2038, 2036, 2034, 2032, + 2134, 2132, 2130, 2128, 2230, 2228, 2226, 2224, 2326, 2324, 2322, + 2320, 2422, 2420, 2418, 2416, 2518, 2516, 2514, 2512, 2614, 2612, + 2610, 2608, 2710, 2708, 2706, 2704, 2806, 2804, 2802, 2800, 2902, + 2900, 2898, 2896, 2998, 2996, 2994, 2992, 3094, 3092, 3090, 3088, + 3190, 3188, 3186, 3184, 3286, 3284, 3282, 3280, 3446, 3444, 3442, + 3440, 3542, 3540, 3538, 3536, 3638, 3636, 3634, 3632, 3734, 3732, + 3730, 3728, 3830, 3828, 3826, 3824, 3926, 3924, 3922, 3920, 4022, + 4020, 4018, 4016, 4118, 4116, 4114, 4112, 4214, 4212, 4210, 4208, + 4310, 4308, 4306, 4304, 4406, 4404, 4402, 4400, 4502, 4500, 4498, + 4496, 4598, 4596, 4594, 4592, 4694, 4692, 4690, 4688, 4790, 4788, + 4786, 4784, 4886, 4884, 4882, 4880, 4982, 4980, 4978, 4976, 5046, + 5044, 5042, 5040, 5142, 5140, 5138, 5136, 5238, 5236, 5234, 5232, + 5334, 5332, 5330, 5328, 5430, 5428, 5426, 5424, 5526, 5524, 5522, + 5520, 5622, 5620, 5618, 5616, 5718, 5716, 5714, 5712, 5814, 5812, + 5810, 5808, 5910, 5908, 5906, 5904, 6006, 6004, 6002, 6000, 6102, + 6100, 6098, 6096, 6198, 6196, 6194, 6192, 6294, 6292, 6290, 6288, + 6390, 6388, 6386, 6384, 6486, 6484, 6482, 6480, 6582, 6580, 6578, + 6576, 6646, 6644, 6642, 6640, 6742, 6740, 6738, 6736, 6838, 6836, + 6834, 6832, 6934, 6932, 6930, 6928, 7030, 7028, 7026, 7024, 7126, + 7124, 7122, 7120, 7222, 7220, 7218, 7216, 7318, 7316, 7314, 7312, + 7414, 7412, 7410, 7408, 7510, 7508, 7506, 7504, 7606, 7604, 7602, + 7600, 7702, 7700, 7698, 7696, 7798, 7796, 7794, 7792, 7894, 7892, + 7890, 7888, 7990, 7988, 7986, 7984, 8086, 8084, 8082, 8080, 8182, + 8180, 8178, 8176, 8278, 8276, 8274, 8272, 8438, 8436, 8434, 8432, + 8534, 8532, 8530, 8528, 8630, 8628, 8626, 8624, 8726, 8724, 8722, + 8720, 8822, 8820, 8818, 8816, 8918, 8916, 8914, 8912, 9014, 9012, + 9010, 9008, 9110, 9108, 9106, 9104, 9206, 9204, 9202, 9200, 9302, + 9300, 9298, 9296, 9398, 9396, 9394, 9392, 9494, 9492, 9490, 9488, + 9590, 9588, 9586, 9584, 9686, 9684, 9682, 9680, 9782, 9780, 9778, + 9776, 9878, 9876, 9874, 9872, 9974, 9972, 9970, 9968, 10038, 10036, + 10034, 10032, 10134, 10132, 10130, 10128, 10230, 10228, 10226, 10224, 10326, + 10324, 10322, 10320, 10422, 10420, 10418, 10416, 10518, 10516, 10514, 10512, + 10614, 10612, 10610, 10608, 10710, 10708, 10706, 10704, 10806, 10804, 10802, + 10800, 10902, 10900, 10898, 10896, 10998, 10996, 10994, 10992, 11094, 11092, + 11090, 11088, 11190, 11188, 11186, 11184, 11286, 11284, 11282, 11280, 11382, + 11380, 11378, 11376, 11478, 11476, 11474, 11472, 11574, 11572, 11570, 11568, + 11638, 11636, 11634, 11632, 11734, 11732, 11730, 11728, 11830, 11828, 11826, + 11824, 11926, 11924, 11922, 11920, 12022, 12020, 12018, 12016, 12118, 12116, + 12114, 12112, 12214, 12212, 12210, 12208, 12310, 12308, 12306, 12304, 12406, + 12404, 12402, 12400, 12502, 12500, 12498, 12496, 12598, 12596, 12594, 12592, + 12694, 12692, 12690, 12688, 12790, 12788, 12786, 12784, 12886, 12884, 12882, + 12880, 12982, 12980, 12978, 12976, 13078, 13076, 13074, 13072, 13174, 13172, + 13170, 13168, 13334, 13332, 13330, 13328, 13430, 13428, 13426, 13424, 13526, + 13524, 13522, 13520, 13622, 13620, 13618, 13616, 13718, 13716, 13714, 13712, + 13814, 13812, 13810, 13808, 13910, 13908, 13906, 13904, 14006, 14004, 14002, + 14000, 14102, 14100, 14098, 14096, 14198, 14196, 14194, 14192, 14294, 14292, + 14290, 14288, 14390, 14388, 14386, 14384, 14486, 14484, 14482, 14480, 14582, + 14580, 14578, 14576, 14678, 14676, 14674, 14672, 14774, 14772, 14770, 14768, + 14870, 14868, 14866, 14864, 14966, 14964, 14962, 14960, 15030, 15028, 15026, + 15024, 15126, 15124, 15122, 15120, 15222, 15220, 15218, 15216, 15318, 15316, + 15314, 15312, 15414, 15412, 15410, 15408, 15510, 15508, 15506, 15504, 15606, + 15604, 15602, 15600, 15702, 15700, 15698, 15696, 15798, 15796, 15794, 15792, + 15894, 15892, 15890, 15888, 15990, 15988, 15986, 15984, 16086, 16084, 16082, + 16080, 16182, 16180, 16178, 16176, 16278, 16276, 16274, 16272, 16374, 16372, + 16370, 16368, 16470, 16468, 16466, 16464, 16566, 16564, 16562, 16560, 16630, + 16628, 16626, 16624, 16726, 16724, 16722, 16720, 16822, 16820, 16818, 16816, + 16918, 16916, 16914, 16912, 17014, 17012, 17010, 17008, 17110, 17108, 17106, + 17104, 17206, 17204, 17202, 17200, 17302, 17300, 17298, 17296, 17398, 17396, + 17394, 17392, 17494, 17492, 17490, 17488, 17590, 17588, 17586, 17584, 17686, + 17684, 17682, 17680, 17782, 17780, 17778, 17776, 17878, 17876, 17874, 17872, + 17974, 17972, 17970, 17968, 18070, 18068, 18066, 18064, 18166, 18164, 18162, + 18160, 18326, 18324, 18322, 18320, 18422, 18420, 18418, 18416, 18518, 18516, + 18514, 18512, 18614, 18612, 18610, 18608, 18710, 18708, 18706, 18704, 18806, + 18804, 18802, 18800, 18902, 18900, 18898, 18896, 18998, 18996, 18994, 18992, + 19094, 19092, 19090, 19088, 19190, 19188, 19186, 19184, 19286, 19284, 19282, + 19280, 19382, 19380, 19378, 19376, 19478, 19476, 19474, 19472, 19574, 19572, + 19570, 19568, 19670, 19668, 19666, 19664, 19766, 19764, 19762, 19760, 19862, + 19860, 19858, 19856, + }, + /* 7 */ + { + 62, 60, 58, 56, 158, 156, 154, 152, 254, 252, 250, + 248, 350, 348, 346, 344, 446, 444, 442, 440, 542, 540, + 538, 536, 638, 636, 634, 632, 734, 732, 730, 728, 830, + 828, 826, 824, 926, 924, 922, 920, 1022, 1020, 1018, 1016, + 1118, 1116, 1114, 1112, 1214, 1212, 1210, 1208, 1310, 1308, 1306, + 1304, 1406, 1404, 1402, 1400, 1502, 1500, 1498, 1496, 1598, 1596, + 1594, 1592, 1694, 1692, 1690, 1688, 1758, 1756, 1754, 1752, 1854, + 1852, 1850, 1848, 1950, 1948, 1946, 1944, 2046, 2044, 2042, 2040, + 2142, 2140, 2138, 2136, 2238, 2236, 2234, 2232, 2334, 2332, 2330, + 2328, 2430, 2428, 2426, 2424, 2526, 2524, 2522, 2520, 2622, 2620, + 2618, 2616, 2718, 2716, 2714, 2712, 2814, 2812, 2810, 2808, 2910, + 2908, 2906, 2904, 3006, 3004, 3002, 3000, 3102, 3100, 3098, 3096, + 3198, 3196, 3194, 3192, 3294, 3292, 3290, 3288, 3454, 3452, 3450, + 3448, 3550, 3548, 3546, 3544, 3646, 3644, 3642, 3640, 3742, 3740, + 3738, 3736, 3838, 3836, 3834, 3832, 3934, 3932, 3930, 3928, 4030, + 4028, 4026, 4024, 4126, 4124, 4122, 4120, 4222, 4220, 4218, 4216, + 4318, 4316, 4314, 4312, 4414, 4412, 4410, 4408, 4510, 4508, 4506, + 4504, 4606, 4604, 4602, 4600, 4702, 4700, 4698, 4696, 4798, 4796, + 4794, 4792, 4894, 4892, 4890, 4888, 4990, 4988, 4986, 4984, 5054, + 5052, 5050, 5048, 5150, 5148, 5146, 5144, 5246, 5244, 5242, 5240, + 5342, 5340, 5338, 5336, 5438, 5436, 5434, 5432, 5534, 5532, 5530, + 5528, 5630, 5628, 5626, 5624, 5726, 5724, 5722, 5720, 5822, 5820, + 5818, 5816, 5918, 5916, 5914, 5912, 6014, 6012, 6010, 6008, 6110, + 6108, 6106, 6104, 6206, 6204, 6202, 6200, 6302, 6300, 6298, 6296, + 6398, 6396, 6394, 6392, 6494, 6492, 6490, 6488, 6590, 6588, 6586, + 6584, 6654, 6652, 6650, 6648, 6750, 6748, 6746, 6744, 6846, 6844, + 6842, 6840, 6942, 6940, 6938, 6936, 7038, 7036, 7034, 7032, 7134, + 7132, 7130, 7128, 7230, 7228, 7226, 7224, 7326, 7324, 7322, 7320, + 7422, 7420, 7418, 7416, 7518, 7516, 7514, 7512, 7614, 7612, 7610, + 7608, 7710, 7708, 7706, 7704, 7806, 7804, 7802, 7800, 7902, 7900, + 7898, 7896, 7998, 7996, 7994, 7992, 8094, 8092, 8090, 8088, 8190, + 8188, 8186, 8184, 8286, 8284, 8282, 8280, 8446, 8444, 8442, 8440, + 8542, 8540, 8538, 8536, 8638, 8636, 8634, 8632, 8734, 8732, 8730, + 8728, 8830, 8828, 8826, 8824, 8926, 8924, 8922, 8920, 9022, 9020, + 9018, 9016, 9118, 9116, 9114, 9112, 9214, 9212, 9210, 9208, 9310, + 9308, 9306, 9304, 9406, 9404, 9402, 9400, 9502, 9500, 9498, 9496, + 9598, 9596, 9594, 9592, 9694, 9692, 9690, 9688, 9790, 9788, 9786, + 9784, 9886, 9884, 9882, 9880, 9982, 9980, 9978, 9976, 10046, 10044, + 10042, 10040, 10142, 10140, 10138, 10136, 10238, 10236, 10234, 10232, 10334, + 10332, 10330, 10328, 10430, 10428, 10426, 10424, 10526, 10524, 10522, 10520, + 10622, 10620, 10618, 10616, 10718, 10716, 10714, 10712, 10814, 10812, 10810, + 10808, 10910, 10908, 10906, 10904, 11006, 11004, 11002, 11000, 11102, 11100, + 11098, 11096, 11198, 11196, 11194, 11192, 11294, 11292, 11290, 11288, 11390, + 11388, 11386, 11384, 11486, 11484, 11482, 11480, 11582, 11580, 11578, 11576, + 11646, 11644, 11642, 11640, 11742, 11740, 11738, 11736, 11838, 11836, 11834, + 11832, 11934, 11932, 11930, 11928, 12030, 12028, 12026, 12024, 12126, 12124, + 12122, 12120, 12222, 12220, 12218, 12216, 12318, 12316, 12314, 12312, 12414, + 12412, 12410, 12408, 12510, 12508, 12506, 12504, 12606, 12604, 12602, 12600, + 12702, 12700, 12698, 12696, 12798, 12796, 12794, 12792, 12894, 12892, 12890, + 12888, 12990, 12988, 12986, 12984, 13086, 13084, 13082, 13080, 13182, 13180, + 13178, 13176, 13342, 13340, 13338, 13336, 13438, 13436, 13434, 13432, 13534, + 13532, 13530, 13528, 13630, 13628, 13626, 13624, 13726, 13724, 13722, 13720, + 13822, 13820, 13818, 13816, 13918, 13916, 13914, 13912, 14014, 14012, 14010, + 14008, 14110, 14108, 14106, 14104, 14206, 14204, 14202, 14200, 14302, 14300, + 14298, 14296, 14398, 14396, 14394, 14392, 14494, 14492, 14490, 14488, 14590, + 14588, 14586, 14584, 14686, 14684, 14682, 14680, 14782, 14780, 14778, 14776, + 14878, 14876, 14874, 14872, 14974, 14972, 14970, 14968, 15038, 15036, 15034, + 15032, 15134, 15132, 15130, 15128, 15230, 15228, 15226, 15224, 15326, 15324, + 15322, 15320, 15422, 15420, 15418, 15416, 15518, 15516, 15514, 15512, 15614, + 15612, 15610, 15608, 15710, 15708, 15706, 15704, 15806, 15804, 15802, 15800, + 15902, 15900, 15898, 15896, 15998, 15996, 15994, 15992, 16094, 16092, 16090, + 16088, 16190, 16188, 16186, 16184, 16286, 16284, 16282, 16280, 16382, 16380, + 16378, 16376, 16478, 16476, 16474, 16472, 16574, 16572, 16570, 16568, 16638, + 16636, 16634, 16632, 16734, 16732, 16730, 16728, 16830, 16828, 16826, 16824, + 16926, 16924, 16922, 16920, 17022, 17020, 17018, 17016, 17118, 17116, 17114, + 17112, 17214, 17212, 17210, 17208, 17310, 17308, 17306, 17304, 17406, 17404, + 17402, 17400, 17502, 17500, 17498, 17496, 17598, 17596, 17594, 17592, 17694, + 17692, 17690, 17688, 17790, 17788, 17786, 17784, 17886, 17884, 17882, 17880, + 17982, 17980, 17978, 17976, 18078, 18076, 18074, 18072, 18174, 18172, 18170, + 18168, 18334, 18332, 18330, 18328, 18430, 18428, 18426, 18424, 18526, 18524, + 18522, 18520, 18622, 18620, 18618, 18616, 18718, 18716, 18714, 18712, 18814, + 18812, 18810, 18808, 18910, 18908, 18906, 18904, 19006, 19004, 19002, 19000, + 19102, 19100, 19098, 19096, 19198, 19196, 19194, 19192, 19294, 19292, 19290, + 19288, 19390, 19388, 19386, 19384, 19486, 19484, 19482, 19480, 19582, 19580, + 19578, 19576, 19678, 19676, 19674, 19672, 19774, 19772, 19770, 19768, 19870, + 19868, 19866, 19864, + }, + /* 8 */ + { + 70, 68, 66, 64, 166, 164, 162, 160, 262, 260, 258, + 256, 358, 356, 354, 352, 454, 452, 450, 448, 550, 548, + 546, 544, 646, 644, 642, 640, 742, 740, 738, 736, 838, + 836, 834, 832, 934, 932, 930, 928, 1030, 1028, 1026, 1024, + 1126, 1124, 1122, 1120, 1222, 1220, 1218, 1216, 1318, 1316, 1314, + 1312, 1414, 1412, 1410, 1408, 1510, 1508, 1506, 1504, 1606, 1604, + 1602, 1600, 1702, 1700, 1698, 1696, 1766, 1764, 1762, 1760, 1862, + 1860, 1858, 1856, 1958, 1956, 1954, 1952, 2054, 2052, 2050, 2048, + 2150, 2148, 2146, 2144, 2246, 2244, 2242, 2240, 2342, 2340, 2338, + 2336, 2438, 2436, 2434, 2432, 2534, 2532, 2530, 2528, 2630, 2628, + 2626, 2624, 2726, 2724, 2722, 2720, 2822, 2820, 2818, 2816, 2918, + 2916, 2914, 2912, 3014, 3012, 3010, 3008, 3110, 3108, 3106, 3104, + 3206, 3204, 3202, 3200, 3302, 3300, 3298, 3296, 3366, 3364, 3362, + 3360, 3462, 3460, 3458, 3456, 3558, 3556, 3554, 3552, 3654, 3652, + 3650, 3648, 3750, 3748, 3746, 3744, 3846, 3844, 3842, 3840, 3942, + 3940, 3938, 3936, 4038, 4036, 4034, 4032, 4134, 4132, 4130, 4128, + 4230, 4228, 4226, 4224, 4326, 4324, 4322, 4320, 4422, 4420, 4418, + 4416, 4518, 4516, 4514, 4512, 4614, 4612, 4610, 4608, 4710, 4708, + 4706, 4704, 4806, 4804, 4802, 4800, 4902, 4900, 4898, 4896, 5062, + 5060, 5058, 5056, 5158, 5156, 5154, 5152, 5254, 5252, 5250, 5248, + 5350, 5348, 5346, 5344, 5446, 5444, 5442, 5440, 5542, 5540, 5538, + 5536, 5638, 5636, 5634, 5632, 5734, 5732, 5730, 5728, 5830, 5828, + 5826, 5824, 5926, 5924, 5922, 5920, 6022, 6020, 6018, 6016, 6118, + 6116, 6114, 6112, 6214, 6212, 6210, 6208, 6310, 6308, 6306, 6304, + 6406, 6404, 6402, 6400, 6502, 6500, 6498, 6496, 6598, 6596, 6594, + 6592, 6662, 6660, 6658, 6656, 6758, 6756, 6754, 6752, 6854, 6852, + 6850, 6848, 6950, 6948, 6946, 6944, 7046, 7044, 7042, 7040, 7142, + 7140, 7138, 7136, 7238, 7236, 7234, 7232, 7334, 7332, 7330, 7328, + 7430, 7428, 7426, 7424, 7526, 7524, 7522, 7520, 7622, 7620, 7618, + 7616, 7718, 7716, 7714, 7712, 7814, 7812, 7810, 7808, 7910, 7908, + 7906, 7904, 8006, 8004, 8002, 8000, 8102, 8100, 8098, 8096, 8198, + 8196, 8194, 8192, 8294, 8292, 8290, 8288, 8358, 8356, 8354, 8352, + 8454, 8452, 8450, 8448, 8550, 8548, 8546, 8544, 8646, 8644, 8642, + 8640, 8742, 8740, 8738, 8736, 8838, 8836, 8834, 8832, 8934, 8932, + 8930, 8928, 9030, 9028, 9026, 9024, 9126, 9124, 9122, 9120, 9222, + 9220, 9218, 9216, 9318, 9316, 9314, 9312, 9414, 9412, 9410, 9408, + 9510, 9508, 9506, 9504, 9606, 9604, 9602, 9600, 9702, 9700, 9698, + 9696, 9798, 9796, 9794, 9792, 9894, 9892, 9890, 9888, 10054, 10052, + 10050, 10048, 10150, 10148, 10146, 10144, 10246, 10244, 10242, 10240, 10342, + 10340, 10338, 10336, 10438, 10436, 10434, 10432, 10534, 10532, 10530, 10528, + 10630, 10628, 10626, 10624, 10726, 10724, 10722, 10720, 10822, 10820, 10818, + 10816, 10918, 10916, 10914, 10912, 11014, 11012, 11010, 11008, 11110, 11108, + 11106, 11104, 11206, 11204, 11202, 11200, 11302, 11300, 11298, 11296, 11398, + 11396, 11394, 11392, 11494, 11492, 11490, 11488, 11590, 11588, 11586, 11584, + 11654, 11652, 11650, 11648, 11750, 11748, 11746, 11744, 11846, 11844, 11842, + 11840, 11942, 11940, 11938, 11936, 12038, 12036, 12034, 12032, 12134, 12132, + 12130, 12128, 12230, 12228, 12226, 12224, 12326, 12324, 12322, 12320, 12422, + 12420, 12418, 12416, 12518, 12516, 12514, 12512, 12614, 12612, 12610, 12608, + 12710, 12708, 12706, 12704, 12806, 12804, 12802, 12800, 12902, 12900, 12898, + 12896, 12998, 12996, 12994, 12992, 13094, 13092, 13090, 13088, 13190, 13188, + 13186, 13184, 13254, 13252, 13250, 13248, 13350, 13348, 13346, 13344, 13446, + 13444, 13442, 13440, 13542, 13540, 13538, 13536, 13638, 13636, 13634, 13632, + 13734, 13732, 13730, 13728, 13830, 13828, 13826, 13824, 13926, 13924, 13922, + 13920, 14022, 14020, 14018, 14016, 14118, 14116, 14114, 14112, 14214, 14212, + 14210, 14208, 14310, 14308, 14306, 14304, 14406, 14404, 14402, 14400, 14502, + 14500, 14498, 14496, 14598, 14596, 14594, 14592, 14694, 14692, 14690, 14688, + 14790, 14788, 14786, 14784, 14886, 14884, 14882, 14880, 15046, 15044, 15042, + 15040, 15142, 15140, 15138, 15136, 15238, 15236, 15234, 15232, 15334, 15332, + 15330, 15328, 15430, 15428, 15426, 15424, 15526, 15524, 15522, 15520, 15622, + 15620, 15618, 15616, 15718, 15716, 15714, 15712, 15814, 15812, 15810, 15808, + 15910, 15908, 15906, 15904, 16006, 16004, 16002, 16000, 16102, 16100, 16098, + 16096, 16198, 16196, 16194, 16192, 16294, 16292, 16290, 16288, 16390, 16388, + 16386, 16384, 16486, 16484, 16482, 16480, 16582, 16580, 16578, 16576, 16646, + 16644, 16642, 16640, 16742, 16740, 16738, 16736, 16838, 16836, 16834, 16832, + 16934, 16932, 16930, 16928, 17030, 17028, 17026, 17024, 17126, 17124, 17122, + 17120, 17222, 17220, 17218, 17216, 17318, 17316, 17314, 17312, 17414, 17412, + 17410, 17408, 17510, 17508, 17506, 17504, 17606, 17604, 17602, 17600, 17702, + 17700, 17698, 17696, 17798, 17796, 17794, 17792, 17894, 17892, 17890, 17888, + 17990, 17988, 17986, 17984, 18086, 18084, 18082, 18080, 18182, 18180, 18178, + 18176, 18246, 18244, 18242, 18240, 18342, 18340, 18338, 18336, 18438, 18436, + 18434, 18432, 18534, 18532, 18530, 18528, 18630, 18628, 18626, 18624, 18726, + 18724, 18722, 18720, 18822, 18820, 18818, 18816, 18918, 18916, 18914, 18912, + 19014, 19012, 19010, 19008, 19110, 19108, 19106, 19104, 19206, 19204, 19202, + 19200, 19302, 19300, 19298, 19296, 19398, 19396, 19394, 19392, 19494, 19492, + 19490, 19488, 19590, 19588, 19586, 19584, 19686, 19684, 19682, 19680, 19782, + 19780, 19778, 19776, + }, + /* 9 */ + { + 78, 76, 74, 72, 174, 172, 170, 168, 270, 268, 266, + 264, 366, 364, 362, 360, 462, 460, 458, 456, 558, 556, + 554, 552, 654, 652, 650, 648, 750, 748, 746, 744, 846, + 844, 842, 840, 942, 940, 938, 936, 1038, 1036, 1034, 1032, + 1134, 1132, 1130, 1128, 1230, 1228, 1226, 1224, 1326, 1324, 1322, + 1320, 1422, 1420, 1418, 1416, 1518, 1516, 1514, 1512, 1614, 1612, + 1610, 1608, 1710, 1708, 1706, 1704, 1774, 1772, 1770, 1768, 1870, + 1868, 1866, 1864, 1966, 1964, 1962, 1960, 2062, 2060, 2058, 2056, + 2158, 2156, 2154, 2152, 2254, 2252, 2250, 2248, 2350, 2348, 2346, + 2344, 2446, 2444, 2442, 2440, 2542, 2540, 2538, 2536, 2638, 2636, + 2634, 2632, 2734, 2732, 2730, 2728, 2830, 2828, 2826, 2824, 2926, + 2924, 2922, 2920, 3022, 3020, 3018, 3016, 3118, 3116, 3114, 3112, + 3214, 3212, 3210, 3208, 3310, 3308, 3306, 3304, 3374, 3372, 3370, + 3368, 3470, 3468, 3466, 3464, 3566, 3564, 3562, 3560, 3662, 3660, + 3658, 3656, 3758, 3756, 3754, 3752, 3854, 3852, 3850, 3848, 3950, + 3948, 3946, 3944, 4046, 4044, 4042, 4040, 4142, 4140, 4138, 4136, + 4238, 4236, 4234, 4232, 4334, 4332, 4330, 4328, 4430, 4428, 4426, + 4424, 4526, 4524, 4522, 4520, 4622, 4620, 4618, 4616, 4718, 4716, + 4714, 4712, 4814, 4812, 4810, 4808, 4910, 4908, 4906, 4904, 5070, + 5068, 5066, 5064, 5166, 5164, 5162, 5160, 5262, 5260, 5258, 5256, + 5358, 5356, 5354, 5352, 5454, 5452, 5450, 5448, 5550, 5548, 5546, + 5544, 5646, 5644, 5642, 5640, 5742, 5740, 5738, 5736, 5838, 5836, + 5834, 5832, 5934, 5932, 5930, 5928, 6030, 6028, 6026, 6024, 6126, + 6124, 6122, 6120, 6222, 6220, 6218, 6216, 6318, 6316, 6314, 6312, + 6414, 6412, 6410, 6408, 6510, 6508, 6506, 6504, 6606, 6604, 6602, + 6600, 6670, 6668, 6666, 6664, 6766, 6764, 6762, 6760, 6862, 6860, + 6858, 6856, 6958, 6956, 6954, 6952, 7054, 7052, 7050, 7048, 7150, + 7148, 7146, 7144, 7246, 7244, 7242, 7240, 7342, 7340, 7338, 7336, + 7438, 7436, 7434, 7432, 7534, 7532, 7530, 7528, 7630, 7628, 7626, + 7624, 7726, 7724, 7722, 7720, 7822, 7820, 7818, 7816, 7918, 7916, + 7914, 7912, 8014, 8012, 8010, 8008, 8110, 8108, 8106, 8104, 8206, + 8204, 8202, 8200, 8302, 8300, 8298, 8296, 8366, 8364, 8362, 8360, + 8462, 8460, 8458, 8456, 8558, 8556, 8554, 8552, 8654, 8652, 8650, + 8648, 8750, 8748, 8746, 8744, 8846, 8844, 8842, 8840, 8942, 8940, + 8938, 8936, 9038, 9036, 9034, 9032, 9134, 9132, 9130, 9128, 9230, + 9228, 9226, 9224, 9326, 9324, 9322, 9320, 9422, 9420, 9418, 9416, + 9518, 9516, 9514, 9512, 9614, 9612, 9610, 9608, 9710, 9708, 9706, + 9704, 9806, 9804, 9802, 9800, 9902, 9900, 9898, 9896, 10062, 10060, + 10058, 10056, 10158, 10156, 10154, 10152, 10254, 10252, 10250, 10248, 10350, + 10348, 10346, 10344, 10446, 10444, 10442, 10440, 10542, 10540, 10538, 10536, + 10638, 10636, 10634, 10632, 10734, 10732, 10730, 10728, 10830, 10828, 10826, + 10824, 10926, 10924, 10922, 10920, 11022, 11020, 11018, 11016, 11118, 11116, + 11114, 11112, 11214, 11212, 11210, 11208, 11310, 11308, 11306, 11304, 11406, + 11404, 11402, 11400, 11502, 11500, 11498, 11496, 11598, 11596, 11594, 11592, + 11662, 11660, 11658, 11656, 11758, 11756, 11754, 11752, 11854, 11852, 11850, + 11848, 11950, 11948, 11946, 11944, 12046, 12044, 12042, 12040, 12142, 12140, + 12138, 12136, 12238, 12236, 12234, 12232, 12334, 12332, 12330, 12328, 12430, + 12428, 12426, 12424, 12526, 12524, 12522, 12520, 12622, 12620, 12618, 12616, + 12718, 12716, 12714, 12712, 12814, 12812, 12810, 12808, 12910, 12908, 12906, + 12904, 13006, 13004, 13002, 13000, 13102, 13100, 13098, 13096, 13198, 13196, + 13194, 13192, 13262, 13260, 13258, 13256, 13358, 13356, 13354, 13352, 13454, + 13452, 13450, 13448, 13550, 13548, 13546, 13544, 13646, 13644, 13642, 13640, + 13742, 13740, 13738, 13736, 13838, 13836, 13834, 13832, 13934, 13932, 13930, + 13928, 14030, 14028, 14026, 14024, 14126, 14124, 14122, 14120, 14222, 14220, + 14218, 14216, 14318, 14316, 14314, 14312, 14414, 14412, 14410, 14408, 14510, + 14508, 14506, 14504, 14606, 14604, 14602, 14600, 14702, 14700, 14698, 14696, + 14798, 14796, 14794, 14792, 14894, 14892, 14890, 14888, 15054, 15052, 15050, + 15048, 15150, 15148, 15146, 15144, 15246, 15244, 15242, 15240, 15342, 15340, + 15338, 15336, 15438, 15436, 15434, 15432, 15534, 15532, 15530, 15528, 15630, + 15628, 15626, 15624, 15726, 15724, 15722, 15720, 15822, 15820, 15818, 15816, + 15918, 15916, 15914, 15912, 16014, 16012, 16010, 16008, 16110, 16108, 16106, + 16104, 16206, 16204, 16202, 16200, 16302, 16300, 16298, 16296, 16398, 16396, + 16394, 16392, 16494, 16492, 16490, 16488, 16590, 16588, 16586, 16584, 16654, + 16652, 16650, 16648, 16750, 16748, 16746, 16744, 16846, 16844, 16842, 16840, + 16942, 16940, 16938, 16936, 17038, 17036, 17034, 17032, 17134, 17132, 17130, + 17128, 17230, 17228, 17226, 17224, 17326, 17324, 17322, 17320, 17422, 17420, + 17418, 17416, 17518, 17516, 17514, 17512, 17614, 17612, 17610, 17608, 17710, + 17708, 17706, 17704, 17806, 17804, 17802, 17800, 17902, 17900, 17898, 17896, + 17998, 17996, 17994, 17992, 18094, 18092, 18090, 18088, 18190, 18188, 18186, + 18184, 18254, 18252, 18250, 18248, 18350, 18348, 18346, 18344, 18446, 18444, + 18442, 18440, 18542, 18540, 18538, 18536, 18638, 18636, 18634, 18632, 18734, + 18732, 18730, 18728, 18830, 18828, 18826, 18824, 18926, 18924, 18922, 18920, + 19022, 19020, 19018, 19016, 19118, 19116, 19114, 19112, 19214, 19212, 19210, + 19208, 19310, 19308, 19306, 19304, 19406, 19404, 19402, 19400, 19502, 19500, + 19498, 19496, 19598, 19596, 19594, 19592, 19694, 19692, 19690, 19688, 19790, + 19788, 19786, 19784, + }, + /* 10 */ + { + 86, 84, 82, 80, 182, 180, 178, 176, 278, 276, 274, + 272, 374, 372, 370, 368, 470, 468, 466, 464, 566, 564, + 562, 560, 662, 660, 658, 656, 758, 756, 754, 752, 854, + 852, 850, 848, 950, 948, 946, 944, 1046, 1044, 1042, 1040, + 1142, 1140, 1138, 1136, 1238, 1236, 1234, 1232, 1334, 1332, 1330, + 1328, 1430, 1428, 1426, 1424, 1526, 1524, 1522, 1520, 1622, 1620, + 1618, 1616, 1718, 1716, 1714, 1712, 1782, 1780, 1778, 1776, 1878, + 1876, 1874, 1872, 1974, 1972, 1970, 1968, 2070, 2068, 2066, 2064, + 2166, 2164, 2162, 2160, 2262, 2260, 2258, 2256, 2358, 2356, 2354, + 2352, 2454, 2452, 2450, 2448, 2550, 2548, 2546, 2544, 2646, 2644, + 2642, 2640, 2742, 2740, 2738, 2736, 2838, 2836, 2834, 2832, 2934, + 2932, 2930, 2928, 3030, 3028, 3026, 3024, 3126, 3124, 3122, 3120, + 3222, 3220, 3218, 3216, 3318, 3316, 3314, 3312, 3382, 3380, 3378, + 3376, 3478, 3476, 3474, 3472, 3574, 3572, 3570, 3568, 3670, 3668, + 3666, 3664, 3766, 3764, 3762, 3760, 3862, 3860, 3858, 3856, 3958, + 3956, 3954, 3952, 4054, 4052, 4050, 4048, 4150, 4148, 4146, 4144, + 4246, 4244, 4242, 4240, 4342, 4340, 4338, 4336, 4438, 4436, 4434, + 4432, 4534, 4532, 4530, 4528, 4630, 4628, 4626, 4624, 4726, 4724, + 4722, 4720, 4822, 4820, 4818, 4816, 4918, 4916, 4914, 4912, 5078, + 5076, 5074, 5072, 5174, 5172, 5170, 5168, 5270, 5268, 5266, 5264, + 5366, 5364, 5362, 5360, 5462, 5460, 5458, 5456, 5558, 5556, 5554, + 5552, 5654, 5652, 5650, 5648, 5750, 5748, 5746, 5744, 5846, 5844, + 5842, 5840, 5942, 5940, 5938, 5936, 6038, 6036, 6034, 6032, 6134, + 6132, 6130, 6128, 6230, 6228, 6226, 6224, 6326, 6324, 6322, 6320, + 6422, 6420, 6418, 6416, 6518, 6516, 6514, 6512, 6614, 6612, 6610, + 6608, 6678, 6676, 6674, 6672, 6774, 6772, 6770, 6768, 6870, 6868, + 6866, 6864, 6966, 6964, 6962, 6960, 7062, 7060, 7058, 7056, 7158, + 7156, 7154, 7152, 7254, 7252, 7250, 7248, 7350, 7348, 7346, 7344, + 7446, 7444, 7442, 7440, 7542, 7540, 7538, 7536, 7638, 7636, 7634, + 7632, 7734, 7732, 7730, 7728, 7830, 7828, 7826, 7824, 7926, 7924, + 7922, 7920, 8022, 8020, 8018, 8016, 8118, 8116, 8114, 8112, 8214, + 8212, 8210, 8208, 8310, 8308, 8306, 8304, 8374, 8372, 8370, 8368, + 8470, 8468, 8466, 8464, 8566, 8564, 8562, 8560, 8662, 8660, 8658, + 8656, 8758, 8756, 8754, 8752, 8854, 8852, 8850, 8848, 8950, 8948, + 8946, 8944, 9046, 9044, 9042, 9040, 9142, 9140, 9138, 9136, 9238, + 9236, 9234, 9232, 9334, 9332, 9330, 9328, 9430, 9428, 9426, 9424, + 9526, 9524, 9522, 9520, 9622, 9620, 9618, 9616, 9718, 9716, 9714, + 9712, 9814, 9812, 9810, 9808, 9910, 9908, 9906, 9904, 10070, 10068, + 10066, 10064, 10166, 10164, 10162, 10160, 10262, 10260, 10258, 10256, 10358, + 10356, 10354, 10352, 10454, 10452, 10450, 10448, 10550, 10548, 10546, 10544, + 10646, 10644, 10642, 10640, 10742, 10740, 10738, 10736, 10838, 10836, 10834, + 10832, 10934, 10932, 10930, 10928, 11030, 11028, 11026, 11024, 11126, 11124, + 11122, 11120, 11222, 11220, 11218, 11216, 11318, 11316, 11314, 11312, 11414, + 11412, 11410, 11408, 11510, 11508, 11506, 11504, 11606, 11604, 11602, 11600, + 11670, 11668, 11666, 11664, 11766, 11764, 11762, 11760, 11862, 11860, 11858, + 11856, 11958, 11956, 11954, 11952, 12054, 12052, 12050, 12048, 12150, 12148, + 12146, 12144, 12246, 12244, 12242, 12240, 12342, 12340, 12338, 12336, 12438, + 12436, 12434, 12432, 12534, 12532, 12530, 12528, 12630, 12628, 12626, 12624, + 12726, 12724, 12722, 12720, 12822, 12820, 12818, 12816, 12918, 12916, 12914, + 12912, 13014, 13012, 13010, 13008, 13110, 13108, 13106, 13104, 13206, 13204, + 13202, 13200, 13270, 13268, 13266, 13264, 13366, 13364, 13362, 13360, 13462, + 13460, 13458, 13456, 13558, 13556, 13554, 13552, 13654, 13652, 13650, 13648, + 13750, 13748, 13746, 13744, 13846, 13844, 13842, 13840, 13942, 13940, 13938, + 13936, 14038, 14036, 14034, 14032, 14134, 14132, 14130, 14128, 14230, 14228, + 14226, 14224, 14326, 14324, 14322, 14320, 14422, 14420, 14418, 14416, 14518, + 14516, 14514, 14512, 14614, 14612, 14610, 14608, 14710, 14708, 14706, 14704, + 14806, 14804, 14802, 14800, 14902, 14900, 14898, 14896, 15062, 15060, 15058, + 15056, 15158, 15156, 15154, 15152, 15254, 15252, 15250, 15248, 15350, 15348, + 15346, 15344, 15446, 15444, 15442, 15440, 15542, 15540, 15538, 15536, 15638, + 15636, 15634, 15632, 15734, 15732, 15730, 15728, 15830, 15828, 15826, 15824, + 15926, 15924, 15922, 15920, 16022, 16020, 16018, 16016, 16118, 16116, 16114, + 16112, 16214, 16212, 16210, 16208, 16310, 16308, 16306, 16304, 16406, 16404, + 16402, 16400, 16502, 16500, 16498, 16496, 16598, 16596, 16594, 16592, 16662, + 16660, 16658, 16656, 16758, 16756, 16754, 16752, 16854, 16852, 16850, 16848, + 16950, 16948, 16946, 16944, 17046, 17044, 17042, 17040, 17142, 17140, 17138, + 17136, 17238, 17236, 17234, 17232, 17334, 17332, 17330, 17328, 17430, 17428, + 17426, 17424, 17526, 17524, 17522, 17520, 17622, 17620, 17618, 17616, 17718, + 17716, 17714, 17712, 17814, 17812, 17810, 17808, 17910, 17908, 17906, 17904, + 18006, 18004, 18002, 18000, 18102, 18100, 18098, 18096, 18198, 18196, 18194, + 18192, 18262, 18260, 18258, 18256, 18358, 18356, 18354, 18352, 18454, 18452, + 18450, 18448, 18550, 18548, 18546, 18544, 18646, 18644, 18642, 18640, 18742, + 18740, 18738, 18736, 18838, 18836, 18834, 18832, 18934, 18932, 18930, 18928, + 19030, 19028, 19026, 19024, 19126, 19124, 19122, 19120, 19222, 19220, 19218, + 19216, 19318, 19316, 19314, 19312, 19414, 19412, 19410, 19408, 19510, 19508, + 19506, 19504, 19606, 19604, 19602, 19600, 19702, 19700, 19698, 19696, 19798, + 19796, 19794, 19792, + }, + /* 11 */ + { + 94, 92, 90, 88, 190, 188, 186, 184, 286, 284, 282, + 280, 382, 380, 378, 376, 478, 476, 474, 472, 574, 572, + 570, 568, 670, 668, 666, 664, 766, 764, 762, 760, 862, + 860, 858, 856, 958, 956, 954, 952, 1054, 1052, 1050, 1048, + 1150, 1148, 1146, 1144, 1246, 1244, 1242, 1240, 1342, 1340, 1338, + 1336, 1438, 1436, 1434, 1432, 1534, 1532, 1530, 1528, 1630, 1628, + 1626, 1624, 1726, 1724, 1722, 1720, 1790, 1788, 1786, 1784, 1886, + 1884, 1882, 1880, 1982, 1980, 1978, 1976, 2078, 2076, 2074, 2072, + 2174, 2172, 2170, 2168, 2270, 2268, 2266, 2264, 2366, 2364, 2362, + 2360, 2462, 2460, 2458, 2456, 2558, 2556, 2554, 2552, 2654, 2652, + 2650, 2648, 2750, 2748, 2746, 2744, 2846, 2844, 2842, 2840, 2942, + 2940, 2938, 2936, 3038, 3036, 3034, 3032, 3134, 3132, 3130, 3128, + 3230, 3228, 3226, 3224, 3326, 3324, 3322, 3320, 3390, 3388, 3386, + 3384, 3486, 3484, 3482, 3480, 3582, 3580, 3578, 3576, 3678, 3676, + 3674, 3672, 3774, 3772, 3770, 3768, 3870, 3868, 3866, 3864, 3966, + 3964, 3962, 3960, 4062, 4060, 4058, 4056, 4158, 4156, 4154, 4152, + 4254, 4252, 4250, 4248, 4350, 4348, 4346, 4344, 4446, 4444, 4442, + 4440, 4542, 4540, 4538, 4536, 4638, 4636, 4634, 4632, 4734, 4732, + 4730, 4728, 4830, 4828, 4826, 4824, 4926, 4924, 4922, 4920, 5086, + 5084, 5082, 5080, 5182, 5180, 5178, 5176, 5278, 5276, 5274, 5272, + 5374, 5372, 5370, 5368, 5470, 5468, 5466, 5464, 5566, 5564, 5562, + 5560, 5662, 5660, 5658, 5656, 5758, 5756, 5754, 5752, 5854, 5852, + 5850, 5848, 5950, 5948, 5946, 5944, 6046, 6044, 6042, 6040, 6142, + 6140, 6138, 6136, 6238, 6236, 6234, 6232, 6334, 6332, 6330, 6328, + 6430, 6428, 6426, 6424, 6526, 6524, 6522, 6520, 6622, 6620, 6618, + 6616, 6686, 6684, 6682, 6680, 6782, 6780, 6778, 6776, 6878, 6876, + 6874, 6872, 6974, 6972, 6970, 6968, 7070, 7068, 7066, 7064, 7166, + 7164, 7162, 7160, 7262, 7260, 7258, 7256, 7358, 7356, 7354, 7352, + 7454, 7452, 7450, 7448, 7550, 7548, 7546, 7544, 7646, 7644, 7642, + 7640, 7742, 7740, 7738, 7736, 7838, 7836, 7834, 7832, 7934, 7932, + 7930, 7928, 8030, 8028, 8026, 8024, 8126, 8124, 8122, 8120, 8222, + 8220, 8218, 8216, 8318, 8316, 8314, 8312, 8382, 8380, 8378, 8376, + 8478, 8476, 8474, 8472, 8574, 8572, 8570, 8568, 8670, 8668, 8666, + 8664, 8766, 8764, 8762, 8760, 8862, 8860, 8858, 8856, 8958, 8956, + 8954, 8952, 9054, 9052, 9050, 9048, 9150, 9148, 9146, 9144, 9246, + 9244, 9242, 9240, 9342, 9340, 9338, 9336, 9438, 9436, 9434, 9432, + 9534, 9532, 9530, 9528, 9630, 9628, 9626, 9624, 9726, 9724, 9722, + 9720, 9822, 9820, 9818, 9816, 9918, 9916, 9914, 9912, 10078, 10076, + 10074, 10072, 10174, 10172, 10170, 10168, 10270, 10268, 10266, 10264, 10366, + 10364, 10362, 10360, 10462, 10460, 10458, 10456, 10558, 10556, 10554, 10552, + 10654, 10652, 10650, 10648, 10750, 10748, 10746, 10744, 10846, 10844, 10842, + 10840, 10942, 10940, 10938, 10936, 11038, 11036, 11034, 11032, 11134, 11132, + 11130, 11128, 11230, 11228, 11226, 11224, 11326, 11324, 11322, 11320, 11422, + 11420, 11418, 11416, 11518, 11516, 11514, 11512, 11614, 11612, 11610, 11608, + 11678, 11676, 11674, 11672, 11774, 11772, 11770, 11768, 11870, 11868, 11866, + 11864, 11966, 11964, 11962, 11960, 12062, 12060, 12058, 12056, 12158, 12156, + 12154, 12152, 12254, 12252, 12250, 12248, 12350, 12348, 12346, 12344, 12446, + 12444, 12442, 12440, 12542, 12540, 12538, 12536, 12638, 12636, 12634, 12632, + 12734, 12732, 12730, 12728, 12830, 12828, 12826, 12824, 12926, 12924, 12922, + 12920, 13022, 13020, 13018, 13016, 13118, 13116, 13114, 13112, 13214, 13212, + 13210, 13208, 13278, 13276, 13274, 13272, 13374, 13372, 13370, 13368, 13470, + 13468, 13466, 13464, 13566, 13564, 13562, 13560, 13662, 13660, 13658, 13656, + 13758, 13756, 13754, 13752, 13854, 13852, 13850, 13848, 13950, 13948, 13946, + 13944, 14046, 14044, 14042, 14040, 14142, 14140, 14138, 14136, 14238, 14236, + 14234, 14232, 14334, 14332, 14330, 14328, 14430, 14428, 14426, 14424, 14526, + 14524, 14522, 14520, 14622, 14620, 14618, 14616, 14718, 14716, 14714, 14712, + 14814, 14812, 14810, 14808, 14910, 14908, 14906, 14904, 15070, 15068, 15066, + 15064, 15166, 15164, 15162, 15160, 15262, 15260, 15258, 15256, 15358, 15356, + 15354, 15352, 15454, 15452, 15450, 15448, 15550, 15548, 15546, 15544, 15646, + 15644, 15642, 15640, 15742, 15740, 15738, 15736, 15838, 15836, 15834, 15832, + 15934, 15932, 15930, 15928, 16030, 16028, 16026, 16024, 16126, 16124, 16122, + 16120, 16222, 16220, 16218, 16216, 16318, 16316, 16314, 16312, 16414, 16412, + 16410, 16408, 16510, 16508, 16506, 16504, 16606, 16604, 16602, 16600, 16670, + 16668, 16666, 16664, 16766, 16764, 16762, 16760, 16862, 16860, 16858, 16856, + 16958, 16956, 16954, 16952, 17054, 17052, 17050, 17048, 17150, 17148, 17146, + 17144, 17246, 17244, 17242, 17240, 17342, 17340, 17338, 17336, 17438, 17436, + 17434, 17432, 17534, 17532, 17530, 17528, 17630, 17628, 17626, 17624, 17726, + 17724, 17722, 17720, 17822, 17820, 17818, 17816, 17918, 17916, 17914, 17912, + 18014, 18012, 18010, 18008, 18110, 18108, 18106, 18104, 18206, 18204, 18202, + 18200, 18270, 18268, 18266, 18264, 18366, 18364, 18362, 18360, 18462, 18460, + 18458, 18456, 18558, 18556, 18554, 18552, 18654, 18652, 18650, 18648, 18750, + 18748, 18746, 18744, 18846, 18844, 18842, 18840, 18942, 18940, 18938, 18936, + 19038, 19036, 19034, 19032, 19134, 19132, 19130, 19128, 19230, 19228, 19226, + 19224, 19326, 19324, 19322, 19320, 19422, 19420, 19418, 19416, 19518, 19516, + 19514, 19512, 19614, 19612, 19610, 19608, 19710, 19708, 19706, 19704, 19806, + 19804, 19802, 19800, + }, }; - diff --git a/gr-dtv/lib/atsc/interleaver_fifo.h b/gr-dtv/lib/atsc/interleaver_fifo.h index bc23b2d5d0..98155b442d 100644 --- a/gr-dtv/lib/atsc/interleaver_fifo.h +++ b/gr-dtv/lib/atsc/interleaver_fifo.h @@ -29,56 +29,57 @@ * \brief template class for interleaver fifo */ -template<class symbol_type> -class interleaver_fifo { - public: - - interleaver_fifo (unsigned int size); - ~interleaver_fifo (); +template <class symbol_type> +class interleaver_fifo +{ +public: + interleaver_fifo(unsigned int size); + ~interleaver_fifo(); - //! reset interleaver (flushes contents and resets commutator) - void reset (); + //! reset interleaver (flushes contents and resets commutator) + void reset(); - //! stuff a symbol into the fifo and return the oldest - symbol_type stuff (symbol_type input){ - if (m_size == 0) - return input; + //! stuff a symbol into the fifo and return the oldest + symbol_type stuff(symbol_type input) + { + if (m_size == 0) + return input; - symbol_type retval = m_fifo[m_position]; - m_fifo[m_position] = input; - m_position++; - if (m_position >= m_size) - m_position = 0; + symbol_type retval = m_fifo[m_position]; + m_fifo[m_position] = input; + m_position++; + if (m_position >= m_size) + m_position = 0; - return retval; - } + return retval; + } protected: - unsigned int m_size; - unsigned int m_position; - symbol_type *m_fifo; + unsigned int m_size; + unsigned int m_position; + symbol_type* m_fifo; }; -template<class symbol_type> -interleaver_fifo<symbol_type>::interleaver_fifo (unsigned int size) +template <class symbol_type> +interleaver_fifo<symbol_type>::interleaver_fifo(unsigned int size) { - m_size = size; - m_position = 0; - m_fifo = new symbol_type[size]; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); + m_size = size; + m_position = 0; + m_fifo = new symbol_type[size]; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); } -template<class symbol_type> -interleaver_fifo<symbol_type>::~interleaver_fifo () +template <class symbol_type> +interleaver_fifo<symbol_type>::~interleaver_fifo() { - delete [] m_fifo; + delete[] m_fifo; } -template<class symbol_type> void -interleaver_fifo<symbol_type>::reset () +template <class symbol_type> +void interleaver_fifo<symbol_type>::reset() { - m_position = 0; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); + m_position = 0; + memset(m_fifo, 0, m_size * sizeof(symbol_type)); } #endif /* _INTERLEAVER_FIFO_H_ */ |