[linux-yocto] [PATCH 55/87] lsi/nand: add acp3400 nand flash controller support

Paul Butler butler.paul at gmail.com
Mon May 27 09:56:26 PDT 2013


From: Jiang Lu <lu.jiang at windriver.com>

Extracted from lsi.patch in lsi_acp_linux_6.8.1.18 tarball.

[Jiang: The main modifications include:
* Introduce lsi_nand_{read_byte, errstat, init_size} in order
  not to modify the nand_base.c
* add return to lsi_nand_write_page_hwecc() to fix
 compile warnings
* change file name to lsi_acp_nand.c]
Signed-off-by: Jiang Lu <lu.jiang at windriver.com>
---
 drivers/mtd/nand/Kconfig        |    7 +
 drivers/mtd/nand/Makefile       |    1 +
 drivers/mtd/nand/lsi_acp_nand.c | 3789 +++++++++++++++++++++++++++++++++++++++
 drivers/mtd/nand/nand_ids.c     |    1 +
 4 files changed, 3798 insertions(+)
 create mode 100644 drivers/mtd/nand/lsi_acp_nand.c

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 0e43a3f..102ad83 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -527,4 +527,11 @@ config MTD_NAND_FSMC
 	  Enables support for NAND Flash chips on the ST Microelectronics
 	  Flexible Static Memory Controller (FSMC)
 
+config MTD_NAND_EP501X
+	tristate "Driver for Eureka EP501/EP501G1/EP501G3 Controllers"
+	depends on MTD_NAND
+	help
+	  Enables NAND flash support for the Eureka EP501, EP501G1
+	  and EP501G3 controllers.
+
 endif # MTD_NAND
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index d4b4d87..01a11f8 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -51,5 +51,6 @@ obj-$(CONFIG_MTD_NAND_MPC5121_NFC)	+= mpc5121_nfc.o
 obj-$(CONFIG_MTD_NAND_RICOH)		+= r852.o
 obj-$(CONFIG_MTD_NAND_JZ4740)		+= jz4740_nand.o
 obj-$(CONFIG_MTD_NAND_GPMI_NAND)	+= gpmi-nand/
+obj-$(CONFIG_MTD_NAND_EP501X)		+= lsi_acp_nand.o
 
 nand-objs := nand_base.o nand_bbt.o
diff --git a/drivers/mtd/nand/lsi_acp_nand.c b/drivers/mtd/nand/lsi_acp_nand.c
new file mode 100644
index 0000000..94b8e3c
--- /dev/null
+++ b/drivers/mtd/nand/lsi_acp_nand.c
@@ -0,0 +1,3789 @@
+/*
+ * drivers/lsi/acp/nand.c
+ *
+ * NAND Controller Driver for LSI's ACP
+ *
+ * Copyright (C) 2009 LSI Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307	 USA
+ *
+ */
+
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/delay.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/of.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <asm/cacheflush.h>
+
+/* -- DEBUG --------------------------------------------------------- */
+
+#include <asm/lsi/debug.h>
+
+/* -- LOGIO --------------------------------------------------------- */
+
+#undef LOGIO
+/*#define LOGIO*/
+#ifdef LOGIO
+int enable_logio;
+static inline unsigned long _READL(const char *, int, unsigned long);
+static inline unsigned long
+_READL(const char *file, int line, unsigned long address)
+{
+	unsigned long value;
+
+	value = readl(address);
+
+	if (0 != enable_logio)
+		printk(KERN_INFO "%s:%d - Read 0x%08lx from 0x%08lx\n",
+		       file, line, value, address);
+
+	return value;
+}
+#define READL(address) _READL(__FILE__, __LINE__, (address))
+static inline void _WRITEL(const char *, int, unsigned long, unsigned long);
+static inline void
+_WRITEL(const char *file, int line, unsigned long value, unsigned long address)
+{
+	writel(value, address);
+
+	if (0 != enable_logio)
+		printk(KERN_ERR "%s:%d - Wrote 0x%08lx to 0x%08lx\n",
+		       file, line, value, address);
+
+	return;
+}
+#define WRITEL(value, address) _WRITEL(__FILE__, __LINE__, (value), (address))
+#else  /* LOGIO */
+#define READL(address) readl((address))
+#define WRITEL(value, address) writel((value), (address))
+#endif /* LOGIO */
+
+/*
+  ----------------------------------------------------------------------
+*/
+
+#define NAND_DATA_REG	      0x00000000
+#define NAND_CMD_REG	      0x00008000
+#define NAND_INDEX_REG	      0x00008004
+#define NAND_STATUS1_REG      0x00008008
+#define NAND_STATUS2_REG      0x0000800C
+#define NAND_ID0_REG	      0x00008010
+#define NAND_ID1_REG	      0x00008014
+#define NAND_ID2_REG	      0x00008018
+#define NAND_ID3_REG	      0x0000801C
+#define NAND_ID4_REG	      0x00008020
+#define NAND_ID5_REG	      0x00008024
+#define NAND_ID6_REG	      0x00008028
+#define NAND_ID7_REG	      0x0000802C
+#define NAND_INTR_EN_REG      0x00008030
+#define NAND_INTR_STATUS_REG  0x00008034
+#define NAND_INTR_REG	      0x00008038
+#define NAND_ECC_ADDR_LOG_REG 0x0000803C
+#define NAND_ECC_VAL_REG      0x00008040
+#define NAND_ECC_INJECT_REG   0x00008044
+#define NAND_EXT_INDEX_REG    0x00008048
+#define NAND_TIMING1_REG      0x0000804C
+#define NAND_TIMING2_REG      0x00008050
+#define NAND_CONFIG_REG	      0x00008054
+#define NAND_PECC_REG	      0x00008058
+
+#define EP501_NAND_DATA_REG         0x0000
+#define EP501_NAND_CMD_REG          0x8000
+#define EP501_NAND_INDEX_REG        0x8004
+#define EP501_NAND_STATUS0_REG      0x8008
+#define EP501_NAND_STATUS1_REG      0x800C
+#define EP501_NAND_ID0_REG          0x8010
+#define EP501_NAND_ID1_REG          0x8014
+#define EP501_NAND_ID2_REG          0x8018
+#define EP501_NAND_ID3_REG          0x801C
+#define EP501_NAND_ID4_REG          0x8020
+#define EP501_NAND_ID5_REG          0x8024
+#define EP501_NAND_ID6_REG          0x8028
+#define EP501_NAND_ID7_REG          0x802C
+#define EP501_NAND_INTR_EN_REG      0x8030
+#define EP501_NAND_INTR_STATUS_REG  0x8034
+#define EP501_NAND_INTR_REG         0x8038
+#define EP501_NAND_ECC_ADDR_LOG_REG 0x803C
+#define EP501_NAND_ECC_VAL_REG      0x8040
+#define EP501_NAND_ECC_INJECT_REG   0x8044
+#define EP501_NAND_EXT_INDEX_REG    0x8048
+#define EP501_NAND_TIMING0_REG      0x804C
+#define EP501_NAND_TIMING1_REG      0x8050
+#define EP501_NAND_CONFIG_REG       0x8054
+#define EP501_NAND_PECC_REG         0x8058
+
+#define EP501G1_NAND_DATA_REG         0x0000
+#define EP501G1_NAND_CMD_REG          0x8000
+#define EP501G1_NAND_INDEX_REG        0x8004
+#define EP501G1_NAND_STATUS0_REG      0x8008
+#define EP501G1_NAND_ID0_REG          0x8010
+#define EP501G1_NAND_ID2_REG          0x8018
+#define EP501G1_NAND_ID4_REG          0x8020
+#define EP501G1_NAND_ID6_REG          0x8028
+#define EP501G1_NAND_INTR_EN_REG      0x8030
+#define EP501G1_NAND_INTR_STATUS_REG  0x8034
+#define EP501G1_NAND_INTR_REG         0x8038
+#define EP501G1_NAND_EXT_INDEX_REG    0x8048
+#define EP501G1_NAND_TIMING0_REG      0x804C
+#define EP501G1_NAND_TIMING1_REG      0x8050
+#define EP501G1_NAND_CONFIG_REG       0x8054
+#define EP501G1_NAND_1BIT_ECC0_STATUS 0x8058
+#define EP501G1_NAND_1BIT_ECC1_STATUS 0x805c
+#define EP501G1_NAND_1BIT_ECC2_STATUS 0x8060
+#define EP501G1_NAND_1BIT_ECC3_STATUS 0x8064
+#define EP501G1_NAND_1BIT_ECC4_STATUS 0x8068
+#define EP501G1_NAND_1BIT_ECC5_STATUS 0x806c
+#define EP501G1_NAND_1BIT_ECC6_STATUS 0x8070
+#define EP501G1_NAND_1BIT_ECC7_STATUS 0x8074
+#define EP501G1_NAND_BCH_STATUS       0x807c
+#define EP501G1_NAND_SYN_R12_S0       0x8080
+#define EP501G1_NAND_SYN_R34_S0       0x8084
+#define EP501G1_NAND_SYN_R56_S0       0x8088
+#define EP501G1_NAND_SYN_R78_S0       0x808c
+#define EP501G1_NAND_SYN_R12_S1       0x8090
+#define EP501G1_NAND_SYN_R34_S1       0x8094
+#define EP501G1_NAND_SYN_R56_S1       0x8098
+#define EP501G1_NAND_SYN_R78_S1       0x809c
+#define EP501G1_NAND_SYN_R12_S2       0x80a0
+#define EP501G1_NAND_SYN_R34_S2       0x80a4
+#define EP501G1_NAND_SYN_R56_S2       0x80a8
+#define EP501G1_NAND_SYN_R78_S2       0x80ac
+#define EP501G1_NAND_SYN_R12_S3       0x80b0
+#define EP501G1_NAND_SYN_R34_S3       0x80b4
+#define EP501G1_NAND_SYN_R56_S3       0x80b8
+#define EP501G1_NAND_SYN_R78_S3       0x80bc
+#define EP501G1_NAND_SYN_R12_S4       0x80c0
+#define EP501G1_NAND_SYN_R34_S4       0x80c4
+#define EP501G1_NAND_SYN_R56_S4       0x80c8
+#define EP501G1_NAND_SYN_R78_S4       0x80cc
+#define EP501G1_NAND_SYN_R12_S5       0x80d0
+#define EP501G1_NAND_SYN_R34_S5       0x80d4
+#define EP501G1_NAND_SYN_R56_S5       0x80d8
+#define EP501G1_NAND_SYN_R78_S5       0x80dc
+#define EP501G1_NAND_SYN_R12_S6       0x80e0
+#define EP501G1_NAND_SYN_R34_S6       0x80e4
+#define EP501G1_NAND_SYN_R56_S6       0x80e8
+#define EP501G1_NAND_SYN_R78_S6       0x80ec
+#define EP501G1_NAND_SYN_R12_S7       0x80f0
+#define EP501G1_NAND_SYN_R34_S7       0x80f4
+#define EP501G1_NAND_SYN_R56_S7       0x80f8
+#define EP501G1_NAND_SYN_R78_S7       0x80fc
+
+#define EP501G3_NAND_DATA_REG         0x0000
+#define EP501G3_NAND_CMD_REG          0x8000
+#define EP501G3_NAND_INDEX_REG        0x8004
+#define EP501G3_NAND_STATUS0_REG      0x8008
+#define EP501G3_NAND_ID0_REG          0x8010
+#define EP501G3_NAND_ID2_REG          0x8018
+#define EP501G3_NAND_ID4_REG          0x8020
+#define EP501G3_NAND_ID6_REG          0x8028
+#define EP501G3_NAND_INTR_EN_REG      0x8030
+#define EP501G3_NAND_INTR_STATUS_REG  0x8034
+#define EP501G3_NAND_INTR_REG         0x8038
+#define EP501G3_NAND_EXT_INDEX_REG    0x8048
+#define EP501G3_NAND_TIMING0_REG      0x804C
+#define EP501G3_NAND_TIMING1_REG      0x8050
+#define EP501G3_NAND_CONFIG_REG       0x8054
+#define EP501G3_NAND_TIMING2_REG      0x805c
+#define EP501G3_NAND_BCH_STATUS       0x807c
+#define EP501G3_NAND_SYN_R12_S0       0x8080
+#define EP501G3_NAND_SYN_R34_S0       0x8084
+#define EP501G3_NAND_SYN_R56_S0       0x8088
+#define EP501G3_NAND_SYN_R78_S0       0x808c
+#define EP501G3_NAND_SYN_R12_S1       0x8090
+#define EP501G3_NAND_SYN_R34_S1       0x8094
+#define EP501G3_NAND_SYN_R56_S1       0x8098
+#define EP501G3_NAND_SYN_R78_S1       0x809c
+#define EP501G3_NAND_SYN_R12_S2       0x80a0
+#define EP501G3_NAND_SYN_R34_S2       0x80a4
+#define EP501G3_NAND_SYN_R56_S2       0x80a8
+#define EP501G3_NAND_SYN_R78_S2       0x80ac
+#define EP501G3_NAND_SYN_R12_S3       0x80b0
+#define EP501G3_NAND_SYN_R34_S3       0x80b4
+#define EP501G3_NAND_SYN_R56_S3       0x80b8
+#define EP501G3_NAND_SYN_R78_S3       0x80bc
+#define EP501G3_NAND_SYN_R12_S4       0x80c0
+#define EP501G3_NAND_SYN_R34_S4       0x80c4
+#define EP501G3_NAND_SYN_R56_S4       0x80c8
+#define EP501G3_NAND_SYN_R78_S4       0x80cc
+#define EP501G3_NAND_SYN_R12_S5       0x80d0
+#define EP501G3_NAND_SYN_R34_S5       0x80d4
+#define EP501G3_NAND_SYN_R56_S5       0x80d8
+#define EP501G3_NAND_SYN_R78_S5       0x80dc
+#define EP501G3_NAND_SYN_R12_S6       0x80e0
+#define EP501G3_NAND_SYN_R34_S6       0x80e4
+#define EP501G3_NAND_SYN_R56_S6       0x80e8
+#define EP501G3_NAND_SYN_R78_S6       0x80ec
+#define EP501G3_NAND_SYN_R12_S7       0x80f0
+#define EP501G3_NAND_SYN_R34_S7       0x80f4
+#define EP501G3_NAND_SYN_R56_S7       0x80f8
+#define EP501G3_NAND_SYN_R78_S7       0x80fc
+#define EP501G3_NAND_SYN_R12_S8       0x8100
+#define EP501G3_NAND_SYN_R34_S8       0x8104
+#define EP501G3_NAND_SYN_R56_S8       0x8108
+#define EP501G3_NAND_SYN_R78_S8       0x810c
+#define EP501G3_NAND_SYN_R12_S9       0x8110
+#define EP501G3_NAND_SYN_R34_S9       0x8114
+#define EP501G3_NAND_SYN_R56_S9       0x8118
+#define EP501G3_NAND_SYN_R78_S9       0x811c
+#define EP501G3_NAND_SYN_R12_S10      0x8120
+#define EP501G3_NAND_SYN_R34_S10      0x8124
+#define EP501G3_NAND_SYN_R56_S10      0x8128
+#define EP501G3_NAND_SYN_R78_S10      0x812c
+#define EP501G3_NAND_SYN_R12_S11      0x8130
+#define EP501G3_NAND_SYN_R34_S11      0x8134
+#define EP501G3_NAND_SYN_R56_S11      0x8138
+#define EP501G3_NAND_SYN_R78_S11      0x813c
+#define EP501G3_NAND_SYN_R12_S12      0x8140
+#define EP501G3_NAND_SYN_R34_S12      0x8144
+#define EP501G3_NAND_SYN_R56_S12      0x8148
+#define EP501G3_NAND_SYN_R78_S12      0x814c
+#define EP501G3_NAND_SYN_R12_S13      0x8150
+#define EP501G3_NAND_SYN_R34_S13      0x8154
+#define EP501G3_NAND_SYN_R56_S13      0x8158
+#define EP501G3_NAND_SYN_R78_S13      0x815c
+#define EP501G3_NAND_SYN_R12_S14      0x8160
+#define EP501G3_NAND_SYN_R34_S14      0x8164
+#define EP501G3_NAND_SYN_R56_S14      0x8168
+#define EP501G3_NAND_SYN_R78_S14      0x816c
+#define EP501G3_NAND_SYN_R12_S15      0x8170
+#define EP501G3_NAND_SYN_R34_S15      0x8174
+#define EP501G3_NAND_SYN_R56_S15      0x8178
+#define EP501G3_NAND_SYN_R78_S15      0x817c
+
+/*
+  ==============================================================================
+  ==============================================================================
+  Some Oddities...
+
+  -1-
+  Reading EP501 registers while the device is calculating ECC will
+  hang the AHB.	 As the only way to know that an ECC calculation is in
+  progress is to read the "extra bits" added to the interrupt status
+  register, this can cause problems.  To get around this, the
+  PECC_BUSY signal from the controller is also available in a general
+  purpose system register.  0x149.0.0xc/0x0020_0040_0000_c00c, bit 24.
+  So, before reading the interrupt status register (or any other
+  register for that matter) make sure the bit mentioned above is
+  clear.  See BZ21212.
+
+  -2-
+  Extra bits have been added to the interrupt status register.	See
+  BZ21196.  From that defect...
+
+  == Bit 0
+  This bit is set when un-correctable ECC is detected. This bit can be
+  cleared by writing "0" to this register. Writing "1" has no
+  effect. An interrupt is generated if this bit and the enable bit
+  (bit 0) in the Interrupt Enable Register are "1". This bit is not
+  set if ECC is disabled.
+
+  == Bit 1
+  This bit is set when correctable ECC is detected. This bit can be
+  cleared by writing "0" to this register. Writing "1" has no
+  effect. An interrupt is generated if this bit and the enable bit
+  (bit 1) in the Interrupt Enable Register are "1". This bit is not
+  set if ECC is disabled.
+
+  == Bit 2
+  This bit is set when a rising edge is detected on the non gated
+  READY/BUSY# input from the NAND Flash. This bit can be cleared by
+  writing a "0" to this register. Writing a "1" has no effect. An
+  interrupt is generated if this bit and the enable bit (bit 2) in the
+  Interrupt Enable Register are "1".
+
+  == Bit 3
+  This bit is set when a falling edge is detected on the non gated
+  READY/BUSY# input from the NAND Flash. This bit can be cleared by
+  writing a "0" to this register. Writing a "1" has no effect. An
+  interrupt is generated if this bit and the enable bit (bit 3) in the
+  Interrupt Enable Register are "1".
+
+  == Bit 4
+  This bit is set when a falling edge is detected on the PECC_BUSY
+  signal which indicates when the NAND controller has taken control of
+  the NAND Flash for ECC byte access. This bit can be cleared by
+  writing a "0" to this register. Writing a "1" has no effect. An
+  interrupt is generated if this bit and the enable bit (bit 4) in the
+  Interrupt Enable Register are "1".
+
+  == Bit 5
+  This bit is read only and is the synchronized level on the non gated
+  READY/BUSY# input from the NAND Flash. This bit can be used to poll
+  the status of this signal and is not used to generate an interrupt.
+
+  == Bit 6
+  This bit is read only and indicates the level on the PECC_BUSY
+  signal which indicates when the NAND controller has taken control of
+  the NAND Flash for ECC byte access. This bit can be used to poll the
+  level of this signal and is not used to generate an interrupt.
+
+  ==============================================================================
+  ==============================================================================
+*/
+
+static void *gpreg_base;
+
+#define LSI_NAND_PECC_BUSY_REGISTER (gpreg_base + 0x00c)
+
+#ifdef CONFIG_ACP_X1V1
+#define LSI_NAND_PECC_BUSY_MASK	    (1 << 25)
+#else
+#define LSI_NAND_PECC_BUSY_MASK	    (1 << 28)
+#endif
+
+#define MAX_READ_BUF	16
+/*
+  ----------------------------------------------------------------------
+  MTD structures
+*/
+
+static struct mtd_info lsi_nand_mtd = { 0 };
+static struct nand_chip lsi_nand_chip = { 0 };
+
+static struct lsi_nand_private {
+	int cur;	/* -1 means there is no meaningful data in buffer */
+	uint8_t buf[MAX_READ_BUF];
+} lsi_nand_private;
+
+#define NAND_CMD_START_ECC_READ	  0x23
+
+#define NAND_CMD_CE_OFF_501	  0xEE
+#define NAND_CMD_CE_OFF_501G1	  0xEE
+#define NAND_CMD_CE_OFF_501G3	  0xFE
+static int nand_cmd_ce_off;
+
+typedef union {
+	unsigned long raw;
+
+	struct {
+#ifdef CONFIG_ACP
+		unsigned long th:8;
+		unsigned long trp:8;
+		unsigned long twp:8;
+		unsigned long ts:8;
+#else
+		unsigned long ts:8;
+		unsigned long twp:8;
+		unsigned long trp:8;
+		unsigned long th:8;
+#endif
+	} __packed bits;
+} nand_timing_control_register_0_t;
+
+typedef union {
+	unsigned long raw;
+
+	struct {
+#ifdef CONFIG_ACP
+		unsigned long twb:8;
+		unsigned long trr:8;
+		unsigned long trh:8;
+		unsigned long twh:8;
+#else
+		unsigned long twh:8;
+		unsigned long trh:8;
+		unsigned long trr:8;
+		unsigned long twb:8;
+#endif
+	} __packed bits;
+} __packed nand_timing_control_register_1_t;
+
+typedef union {
+	unsigned long raw;
+
+	struct {
+#ifdef CONFIG_ACP
+		unsigned long:8;
+		unsigned long trhw:8;
+		unsigned long twhr:8;
+		unsigned long tccs:8;
+#else
+		unsigned long tccs:8;
+		unsigned long twhr:8;
+		unsigned long trhw:8;
+		unsigned long:8;
+#endif
+	} __packed bits;
+} __packed nand_timing_control_register_2_t;
+
+typedef enum {
+	LSI_NAND_NONE, LSI_NAND_EP501, LSI_NAND_EP501G1, LSI_NAND_EP501G3
+} lsi_nand_type_t;
+
+static lsi_nand_type_t lsi_nand_type;
+
+typedef struct page_wise_ecc_status_st {
+	unsigned err_bit:3;
+	unsigned column:9;
+	unsigned status:2;
+	unsigned rsvd:18;
+} page_wise_ecc_status_t;
+
+/*
+  =============================================================================
+  =============================================================================
+  Concerning ECC
+
+  The EP501 only supports 1 bit ECC mode.  The EP501G1 supports both 1
+  bit and 4 bit modes.  The EP501G3 supports 4 bit, 8 bit, and 12 bit.
+  The NAND part normally used on ACP boards has 2K pages (supported by
+  all three controllers) with 64 bytes of OOB.  For a 2K page, 1 bit
+  ECC uses 12 bytes, 4 bit ECC uses 32 bytes, 8 bit ECC uses 64 bytes
+  and 12 bit ECC uses 80 bytes.  In order to to keep the bad block
+  markers (first two bytes) and leave some OOB available for file
+  systems etc., this driver only supports 1 bit ECC or 4 bit ECC.
+
+  For now, the EP501 version will use 1 bit ECC (only option), the
+  EP501G1 version will use 4 bit (for compabitility with the EP501G3)
+  and teh EP501G3 versions will use 4 bit (due to the amount of OOB
+  required and for compatibility with the EP501G1).
+
+  EP501
+
+  The driver has not been tested with small page (512 byte) devices.
+  The only usable option is 2K.  So, the OOB should be 64 bytes.  The
+  first 2 bytes are reserved for marking bad blocks.  The last 12
+  bytes are reserved for ECC.  All other bytes are free.  See
+  lsi_ep501_2k_ecclayout below.
+
+  EP501G1
+
+  This driver has been tested with 2K and 4K page sizes using 1 bit
+  and 4 bit ECC.
+  =============================================================================
+  =============================================================================
+*/
+
+static struct nand_ecclayout lsi_2k_1bit_ecclayout = {
+	.eccbytes = 12,
+	.eccpos = {
+		52, 53, 54, 55, 56, 57,
+		58, 59, 60, 61, 62, 63},
+	.oobfree = {{2, 50} }
+};
+
+/*
+static struct nand_ecclayout lsi_4k_1bit_ecclayout = {
+	.eccbytes = 24,
+	.eccpos = {
+		52, 53, 54, 55, 56, 57,
+		58, 59, 60, 61, 62, 63},
+	.oobfree = {{2, 50}}
+};
+*/
+
+static struct nand_ecclayout lsi_2k_4bit_ecclayout = {
+	.eccbytes = 32,
+	.eccpos = {
+		32, 33, 34, 35, 36, 37, 38, 39,
+		40, 41, 42, 43, 44, 45, 46, 47,
+		48, 49, 50, 51, 52, 53, 54, 55,
+		56, 57, 58, 59, 60, 61, 62, 63 },
+	.oobfree = {{2, 30} }
+};
+
+static struct nand_ecclayout lsi_4k_4bit_ecclayout = {
+	.eccbytes = 64,
+	.eccpos = {
+		64,  65,  66,  67,  68,  69,  70,  71,
+		72,  73,  74,  75,  76,  77,  78,  79,
+		80,  81,  82,  83,  84,  85,  86,  87,
+		88,  89,  90,  91,  92,  93,  94,  95,
+		96,  97,  98,  99, 100, 101, 102, 103,
+		104, 105, 106, 107, 108, 109, 110, 111,
+		112, 113, 114, 115, 116, 117, 118, 119,
+		120, 121, 122, 123, 124, 125, 126, 127
+	},
+	.oobfree = {{2, 63} }
+};
+
+#ifdef NOT_USED
+
+static struct nand_ecclayout lsi_8k_4bit_ecclayout = {
+	.eccbytes = 128,
+	.eccpos = {
+		128, 129, 130, 131, 132, 133, 134, 135,
+		136, 137, 138, 139, 140, 141, 142, 143,
+		144, 145, 146, 147, 148, 149, 150, 151,
+		152, 153, 154, 155, 156, 157, 158, 159,
+		160, 161, 162, 163, 164, 165, 166, 167,
+		168, 169, 170, 171, 172, 173, 174, 175,
+		176, 177, 178, 179, 180, 181, 182, 183,
+		184, 185, 186, 187, 188, 189, 190, 191,
+		192, 193, 194, 195, 196, 197, 198, 199,
+		200, 201, 202, 203, 204, 205, 206, 207,
+		208, 209, 210, 211, 212, 213, 214, 215,
+		216, 217, 218, 219, 220, 221, 222, 223,
+		224, 225, 226, 227, 228, 229, 230, 231,
+		232, 233, 234, 235, 236, 237, 238, 239,
+		240, 241, 242, 243, 244, 245, 246, 247,
+		248, 249, 250, 251, 252, 253, 254, 255
+	},
+	.oobfree = {{2, 126} }
+};
+
+#endif
+
+/*
+  -----------------------------------------------------------------------------
+  lsi_nand_hwcontrol
+*/
+
+static void
+lsi_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
+	struct nand_chip *chip = mtd->priv;
+
+	if (cmd != NAND_CMD_NONE)
+		WRITEL(cmd, (chip->IO_ADDR_W + NAND_CMD_REG));
+
+	return;
+}
+
+/*
+  ------------------------------------------------------------------------------
+  lsi_nand_device_ready
+
+  The READ/BUSY# input from the NAND device(s) (ORed if there are more
+  than one) is availble as an extra bit in the interrupt status
+  register.  Note that this register shouldn't be read unless the
+  controller is not in the middle of calculating ECC (see "Some
+  Oddities..." above).
+*/
+
+static int
+lsi_nand_device_ready(struct mtd_info *mtd)
+{
+	struct nand_chip *chip = mtd->priv;
+	unsigned long interrupt_status;
+
+	/* Get the status. */
+	interrupt_status = READL(chip->IO_ADDR_R + NAND_INTR_STATUS_REG);
+
+	return interrupt_status & NAND_STATUS_TRUE_READY;
+}
+
+/**
+ * lsi_nand_command - [DEFAULT] Send command to NAND large page device
+ * @mtd:	MTD device structure
+ * @command:	the command to be sent
+ * @column:	the column address for this command, -1 if none
+ * @page_addr:	the page address for this command, -1 if none
+ *
+ * Send command to NAND device. This is the version for the new large page
+ * devices We dont have the separate regions as we have in the small page
+ * devices.  We must emulate NAND_CMD_READOOB to keep the code compatible.
+ */
+static void
+lsi_nand_command(struct mtd_info *mtd, unsigned int command,
+		 int column, int page_addr)
+{
+	register struct nand_chip *chip = mtd->priv;
+	unsigned int status = 0;
+	struct lsi_nand_private *priv = &lsi_nand_private;
+
+	DEBUG_PRINT("command=0x%x\n", command);
+	command &= 0xff;
+
+	/* Emulate NAND_CMD_READOOB */
+	if (command == NAND_CMD_READOOB) {
+		column += mtd->writesize;
+		command = NAND_CMD_READ0;
+	}
+
+	/* return if unhandled command is issued */
+	if (command != NAND_CMD_READ0 &&
+	    command != NAND_CMD_SEQIN &&
+	    command != NAND_CMD_ERASE1 &&
+	    command != NAND_CMD_STATUS &&
+	    command != NAND_CMD_READID &&
+	    command != NAND_CMD_RESET &&
+	    command != NAND_CMD_START_ECC_READ &&
+	    command != NAND_CMD_PAGEPROG &&
+	    command != NAND_CMD_ERASE2) {
+		printk(KERN_ERR
+		       "lsi_nand_command(): WARN: Unhandled command 0x%x "
+		       "issued for page=0x%x, column=0x%x.\n",
+		       command, page_addr, column);
+		return;
+	}
+
+	priv->cur = -1;
+	/* Command latch cycle */
+	chip->cmd_ctrl(mtd, command,
+		       NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
+
+	if (column != -1 || page_addr != -1) {
+		unsigned long index = 0;
+		unsigned long extended_index = 0;
+
+		/* column number */
+		/*
+		  Since the ACP uses 8 bit device access, only that
+		  mode is supported.
+		*/
+
+		if (LSI_NAND_EP501 == lsi_nand_type) {
+			/* column number */
+			if (column != -1)
+				index = column & 0xfff;
+
+			/* page and block number */
+			if (page_addr != -1)
+				index += ((page_addr & 0x7ffff) << 12);
+		} else {
+			/* column number */
+			if (-1 != column) {
+				switch (mtd->writesize) {
+				case 512:
+					index |= (column & 0x1ff);
+					break;
+				case 2048:
+					index |= (column & 0xfff);
+					break;
+				case 4096:
+					index |= (column & 0x1fff);
+					break;
+				default:
+					break;
+				}
+			}
+
+			/* page_addr and block number */
+			if (-1 != page_addr) {
+				switch (mtd->writesize) {
+				case 512:
+					index |= (page_addr & 0x7fffff) << 9;
+					break;
+				case 2048:
+					index |= (page_addr & 0xfffff) << 12;
+					extended_index |=
+						(page_addr & 0xfff00000);
+					break;
+				case 4096:
+					index |= (page_addr & 0x7ffff) << 13;
+					extended_index |=
+						(page_addr & 0xfff80000);
+					break;
+				default:
+					break;
+				}
+			}
+		}
+
+		/* write index reg */
+		WRITEL(index, chip->IO_ADDR_W + NAND_INDEX_REG);
+
+		/* write ext index reg */
+		WRITEL(extended_index, chip->IO_ADDR_W + NAND_EXT_INDEX_REG);
+
+		mb();
+	}
+
+	/* for read command, send 0xe0 so data is populated */
+	if (command == NAND_CMD_READ0) {
+		chip->cmd_ctrl(mtd, NAND_CMD_RNDOUTSTART,
+			       NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
+		do {
+			udelay(chip->chip_delay);
+			status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+		} while (0 != (status & LSI_NAND_PECC_BUSY_MASK));
+
+		/* wait until CHIP_BUSY goes low */
+		do {
+			udelay(chip->chip_delay);
+			status = chip->dev_ready(mtd);
+		} while (!status);
+	} else if (command == NAND_CMD_STATUS) {
+		udelay(chip->chip_delay);
+		priv->cur = 0;
+		priv->buf[0] = readb(chip->IO_ADDR_R + NAND_STATUS1_REG);
+	} else if (command == NAND_CMD_READID) {
+		priv->cur = 0;
+		priv->buf[0] = readb(chip->IO_ADDR_R + NAND_ID0_REG);
+		priv->buf[1] = readb(chip->IO_ADDR_R + NAND_ID2_REG);
+		priv->buf[2] = readb(chip->IO_ADDR_R + NAND_ID4_REG);
+		priv->buf[3] = readb(chip->IO_ADDR_R + NAND_ID6_REG);
+	}
+
+	return;
+}
+
+/**
+ * lsi_nand_read_buf - [DEFAULT] read chip data into buffer
+ * @mtd:	MTD device structure
+ * @buf:	buffer to store date
+ * @len:	number of bytes to read
+ *
+ * Default read function for 8bit buswith
+ */
+static void lsi_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
+{
+	int i = 0;
+	struct nand_chip *chip = (struct nand_chip *) mtd->priv;
+	uint32_t *p = (uint32_t *)buf;
+
+#if defined(LOGIO)
+	if (0 != enable_logio)
+		printk("KERN_NOTICE Reading NAND Buffer (len=%d)...\n", len);
+#endif
+
+	for (i = 0; i < (len >> 2); i++)
+		p[i] = readl(chip->IO_ADDR_R);
+
+	return;
+}
+
+/**
+ * lsi_nand_write_buf - [DEFAULT] write buffer to chip
+ * @mtd:	MTD device structure
+ * @buf:	data buffer
+ * @len:	number of bytes to write
+ *
+ * Default write function for 8bit buswith
+ */
+static void
+lsi_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
+{
+	int i = 0;
+	struct nand_chip *chip = mtd->priv;
+	uint32_t *p = (uint32_t *)buf;
+
+#if defined(LOGIO)
+	if (0 != enable_logio)
+		printk(KERN_NOTICE "Writing NAND Buffer (len=%d)...\n", len);
+#endif
+
+	for (i = 0; i < (len >> 2); i++)
+		writel(p[i], chip->IO_ADDR_W);
+
+	return;
+}
+
+/**
+ * lsi_nand_verify_buf - [DEFAULT] Verify chip data against buffer
+ * @mtd:	MTD device structure
+ * @buf:	buffer containing the data to compare
+ * @len:	number of bytes to compare
+ *
+ * Default verify function for 8bit buswith
+ */
+static int lsi_nand_verify_buf(struct mtd_info *mtd,
+			       const uint8_t *buf, int len)
+{
+	int i;
+	struct nand_chip *chip = mtd->priv;
+	uint32_t *p = (uint32_t *)buf;
+
+	for (i = 0; i < (len >> 2); i++) {
+		udelay(chip->chip_delay);
+		if (p[i] != readl((uint32_t *)chip->IO_ADDR_R))
+			return -EFAULT;
+	}
+
+	return 0;
+}
+
+static int lsi_nand_read_status(struct mtd_info *mtd)
+{
+	struct nand_chip *chip = mtd->priv;
+
+	chip->cmd_ctrl(mtd, NAND_CMD_STATUS, 0);
+
+	return READL(chip->IO_ADDR_R + NAND_STATUS1_REG) & 0xff;
+}
+
+
+/**
+ * lsi_nand_wait - [DEFAULT]  wait until the command is done
+ * @mtd:	MTD device structure
+ * @chip:	NAND chip structure
+ *
+ * Wait for command done. This applies to erase and program only
+ * Erase can take up to 400ms and program up to 20ms according to
+ * general NAND and SmartMedia specs
+ */
+static int lsi_nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
+{
+	unsigned long status = 0;
+	loff_t offset = 0;
+
+	/*
+	  When reading or writing, wait for the
+	  controller's PECC_BUSY signal to clear.
+	*/
+#ifdef NOT_USED
+	if (FL_READING == chip->state || FL_WRITING == chip->state) {
+		for (;;) {
+			status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+
+			if (0 == (status & LSI_NAND_PECC_BUSY_MASK))
+				break;
+
+			udelay(chip->chip_delay);
+		}
+	}
+#else
+	for (;;) {
+		status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+
+		if (0 == (status & LSI_NAND_PECC_BUSY_MASK))
+			break;
+
+		udelay(chip->chip_delay);
+	}
+#endif
+
+	/*
+	  In all cases, wait for the NAND device to be "ready".
+
+	  N.B. The FL_READING case is handled in lsi_nand_command().
+	*/
+
+	if (FL_WRITING == chip->state || FL_ERASING == chip->state) {
+		for (;;) {
+			if (chip->dev_ready(mtd))
+				break;
+
+			udelay(chip->chip_delay);
+		}
+	}
+
+	/*
+	  Then get the status.
+	*/
+
+	for (;;) {
+		status = lsi_nand_read_status(mtd);
+
+		if (0 != (status & NAND_STATUS_READY))
+			break;
+
+		udelay(chip->chip_delay);
+	}
+
+	if (status & NAND_STATUS_FAIL) {
+		offset = (READL(chip->IO_ADDR_R + NAND_INDEX_REG) /
+			  mtd->writesize) * mtd->writesize;
+		printk(KERN_ERR
+		       "lsi_nand_wait(): Action %d failed for "
+		       "Offset: 0x%llx, status 0x%lx\n",
+		       chip->state, offset, status);
+	}
+
+	return status;
+}
+
+/*
+  lsi_nand_ecc_hwctl
+*/
+
+void
+lsi_nand_ecc_hwctl(struct mtd_info *mtd, int mode)
+{
+	/* nothing to do to enable ECC */
+	return;
+}
+
+/**
+ * lsi_nand_ecc_calculate
+ */
+
+int
+lsi_nand_ecc_calculate(struct mtd_info *mtd, const uint8_t *dat,
+		       uint8_t *ecc_code)
+{
+	struct nand_chip *chip = mtd->priv;
+
+	/* start ECC calculation */
+	if (chip->state == FL_READING)
+		chip->cmdfunc(mtd, NAND_CMD_START_ECC_READ, -1, -1);
+	else if (chip->state == FL_WRITING)
+		chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
+
+	/* wait for PECC_BUSY to go down */
+	return chip->waitfunc(mtd, chip);
+}
+
+/**
+ * lsi_nand_ecc_correct
+ */
+
+int
+lsi_nand_ecc_correct(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,
+		     uint8_t *calc_ecc)
+{
+	/* nothing to do to correct ECC */
+	return 0;
+}
+
+/*
+  ------------------------------------------------------------------------------
+  report_ecc_errors_ep501
+*/
+
+static int
+report_ecc_errors_ep501(struct mtd_info *mtd, struct nand_chip *chip,
+			uint8_t *buffer, int page)
+{
+	int rc = 0;
+	unsigned long ecc_status;
+	page_wise_ecc_status_t *ecc_status_reg =
+		(page_wise_ecc_status_t *)&ecc_status;
+	int column;
+	int i;
+
+	for (i = 0; i < (mtd->writesize >> 9); i++) {
+		ecc_status = READL(chip->IO_ADDR_R + EP501_NAND_PECC_REG);
+		column = (i << 9) + ecc_status_reg->column;
+
+		if (1 == ecc_status_reg->status) {
+			printk(KERN_NOTICE
+			       "Single ECC Error: "
+			       "Page=0x%x Column=0x%x Bit=0x%x\n",
+			       page, column, ecc_status_reg->err_bit);
+
+			if (column < mtd->writesize) {
+				buffer[column] ^=
+					(1 << ecc_status_reg->err_bit);
+				++mtd->ecc_stats.corrected;
+			} else {
+				printk(KERN_ERR
+				       "Single ECC Error Not Corrected: "
+				       "Column 0x%x not in "
+				       "Page Size 0x%x\n",
+				       column, mtd->writesize);
+				rc = -1;
+			}
+		} else if ((ecc_status & 0x3000) == 2) {
+			printk(KERN_ERR
+			       "Uncorrectable ECC Error: "
+			       "Page=0x%x Column=0x%x\n",
+			       page, column);
+			rc = -1;
+		}
+	}
+
+	return rc;
+}
+
+int i_to_a[8192] = {
+	-1, 0, 1, 7953, 2, 7715, 7954, 3551, 3, 3313, 7716, 5441,
+	7955, 1529, 3552, 7477, 4, 7239, 3314, 1441, 7717, 7102, 5442,
+	1291, 7956, 7545, 1530, 3075, 3553, 5203, 7478, 2784, 5, 2546,
+	7240, 5080, 3315, 4596, 1442, 4965, 7718, 466, 7103, 7307,
+	5443, 2837, 1292, 822, 7957, 801, 7546, 7001, 1531, 1203,
+	3076, 4294, 3554, 1053, 5204, 3033, 7479, 6073, 2785, 6864, 6,
+	6626, 2547, 7658, 7241, 2691, 5081, 5835, 3316, 2893, 4597,
+	815, 1443, 2795, 4966, 2905, 7719, 3058, 467, 563, 7104, 6763,
+	7308, 1956, 5444, 4056, 2838, 838, 1293, 6335, 823, 965, 7958,
+	3626, 802, 2308, 7547, 4842, 7002, 7279, 1532, 4727, 1204,
+	2462, 3077, 8003, 4295, 4358, 3555, 584, 1054, 7877, 5205,
+	2629, 3034, 2599, 7480, 4992, 6074, 228, 2786, 7069, 6865,
+	6970, 7, 6732, 6627, 4178, 2548, 7845, 7659, 6831, 7242, 5051,
+	2692, 4754, 5082, 8181, 5836, 5864, 3317, 1826, 2894, 346,
+	4598, 7639, 816, 4352, 1444, 2361, 2796, 4313, 4967, 5263,
+	2906, 2391, 7720, 6584, 3059, 3388, 468, 2070, 564, 7693,
+	7105, 7041, 6764, 1387, 7309, 6882, 1957, 4604, 5445, 4120,
+	4057, 1433, 2839, 883, 839, 7765, 1294, 7442, 6336, 4489, 824,
+	2224, 966, 260, 7959, 5281, 3627, 6388, 803, 7420, 2309, 2970,
+	7548, 5597, 4843, 4681, 7003, 4373, 7280, 2453, 1533, 2667,
+	4728, 213, 1205, 7320, 2463, 2557, 3078, 34, 8004, 2655, 4296,
+	577, 4359, 4017, 3556, 727, 585, 4795, 1055, 3138, 7878, 6097,
+	5206, 440, 2630, 3818, 3035, 600, 2600, 7645, 7481, 4303,
+	4993, 2820, 6075, 325, 229, 7021, 2787, 1718, 7070, 8147,
+	6866, 2746, 6971, 6525, 8, 6287, 6733, 3363, 6628, 2882, 4179,
+	2508, 2549, 6263, 7846, 1480, 7660, 7909, 6832, 4562, 7243,
+	6013, 5052, 4065, 2693, 2582, 4755, 2138, 5083, 6783, 8182,
+	6197, 5837, 5184, 5865, 87, 3318, 7602, 1827, 489, 2895, 4557,
+	347, 7177, 4599, 5859, 7640, 2448, 817, 7472, 4353, 2900,
+	1445, 7407, 2362, 5907, 2797, 2639, 4314, 362, 4968, 3697,
+	5264, 202, 2907, 3580, 2392, 1752, 7721, 6899, 6585, 5043,
+	3060, 6150, 3389, 1846, 469, 2732, 2071, 6180, 565, 1726,
+	7694, 7182, 7106, 2215, 7042, 5823, 6765, 5568, 1388, 4135,
+	7310, 3237, 6883, 5359, 1958, 4443, 4605, 1761, 5446, 3779,
+	4121, 136, 4058, 1688, 1434, 339, 2840, 3670, 884, 7987, 840,
+	2417, 7766, 352, 1295, 4024, 7443, 2429, 6337, 8166, 4490,
+	7494, 825, 2319, 2225, 2611, 967, 2330, 261, 7082, 7960, 4389,
+	5282, 6494, 3628, 3940, 6389, 7145, 804, 6593, 7421, 1411,
+	2310, 4211, 2971, 7607, 7549, 5626, 5598, 1695, 4844, 283,
+	4682, 7943, 7004, 6125, 4374, 4813, 7281, 4516, 2454, 7979,
+	1534, 2153, 2668, 3174, 4729, 5507, 214, 5025, 1206, 4956,
+	7321, 2123, 2464, 4075, 2558, 3323, 3079, 1335, 35, 1588,
+	8005, 108, 2656, 6609, 4297, 4114, 578, 795, 4360, 1329, 4018,
+	7401, 3557, 22, 728, 6678, 586, 1995, 4796, 1986, 1056, 3018,
+	3139, 7204, 7879, 4251, 6098, 494, 5207, 4225, 441, 3882,
+	2631, 1195, 3819, 6271, 3036, 7527, 601, 6242, 2601, 5487,
+	7646, 645, 7482, 1544, 4304, 6346, 4994, 3150, 2821, 1857,
+	6076, 7455, 326, 2351, 230, 6456, 7022, 1832, 2788, 4366,
+	1719, 4244, 7071, 550, 8148, 6644, 6867, 3187, 2747, 6803,
+	6972, 1149, 6526, 6444, 9, 6206, 6288, 2811, 6734, 5427, 3364,
+	911, 6629, 4158, 2883, 2949, 4180, 6565, 2509, 3585, 2550,
+	1949, 6264, 4128, 7847, 4006, 1481, 989, 7661, 6406, 7910,
+	5343, 6833, 7568, 4563, 312, 7244, 1160, 6014, 1306, 5053,
+	6108, 4066, 1215, 2694, 1619, 2583, 2680, 4756, 1108, 2139,
+	2912, 5084, 1594, 6784, 3402, 8183, 6279, 6198, 6218, 5838,
+	3764, 5185, 7217, 5866, 2113, 88, 6037, 3319, 7397, 7603,
+	7975, 1828, 6440, 490, 641, 2896, 1748, 4558, 83, 348, 7078,
+	7178, 1757, 4600, 256, 5860, 2387, 7641, 6521, 2449, 4013,
+	818, 6860, 7473, 2780, 4354, 6966, 2901, 961, 1446, 407, 7408,
+	7924, 2363, 5326, 5908, 5249, 2798, 2340, 2640, 7289, 4315,
+	6004, 363, 2397, 4969, 41, 3698, 3987, 5265, 3644, 203, 8057,
+	2908, 6033, 3581, 308, 2393, 953, 1753, 957, 7722, 2263, 6900,
+	4151, 6586, 6256, 5044, 3306, 3061, 6907, 6151, 666, 3390,
+	3005, 1847, 3702, 470, 7369, 2733, 143, 2072, 1402, 6181,
+	3973, 566, 1497, 1727, 6355, 7695, 1173, 7183, 3991, 7107,
+	7741, 2216, 1321, 7043, 5295, 5824, 4278, 6766, 155, 5569,
+	5887, 1389, 4575, 4136, 4973, 7311, 1341, 3238, 5388, 6884,
+	1457, 5360, 5166, 1959, 7705, 4444, 6689, 4606, 7115, 1762,
+	45, 5447, 7163, 3780, 617, 4122, 2381, 137, 1091, 4059, 5817,
+	1689, 3876, 1435, 557, 340, 207, 2841, 538, 3671, 1097, 885,
+	1350, 7988, 7854, 841, 6371, 2418, 2295, 7767, 4908, 353,
+	8061, 1296, 3507, 4025, 1915, 7444, 2936, 2430, 8132, 6338,
+	4787, 8167, 1907, 4491, 5155, 7495, 5269, 826, 3085, 2320,
+	6297, 2226, 2922, 2612, 3837, 968, 6716, 2331, 4718, 262,
+	1885, 7083, 3648, 7961, 6226, 4390, 6049, 5283, 3125, 6495,
+	3250, 3629, 2270, 3941, 4434, 6390, 5127, 7146, 2644, 805,
+	4324, 6594, 5453, 7422, 4400, 1412, 7671, 2311, 4984, 4212,
+	6025, 2972, 1242, 7608, 7293, 7550, 8040, 5627, 7587, 5599,
+	4422, 1696, 4946, 4845, 5735, 284, 6545, 4683, 5959, 7944,
+	2802, 7005, 6615, 6126, 5775, 4375, 3827, 4814, 8070, 7282,
+	1900, 4517, 2992, 2455, 3811, 7980, 2344, 1535, 1514, 2154,
+	2242, 2669, 3606, 3175, 3342, 4730, 5994, 5508, 3459, 215,
+	8155, 5026, 367, 1207, 4938, 4957, 7169, 7322, 5669, 2124,
+	996, 2465, 124, 4076, 5897, 2559, 3950, 3324, 2401, 3080, 533,
+	1336, 7364, 36, 251, 1589, 1944, 8006, 6939, 109, 4524, 2657,
+	4933, 6610, 4319, 4298, 2662, 4115, 1821, 579, 3053, 796,
+	7234, 4361, 4220, 1330, 5621, 4019, 2210, 7402, 6008, 3558,
+	6844, 23, 7380, 729, 6506, 6679, 2092, 587, 7729, 1996, 2081,
+	4797, 2373, 1987, 7412, 1057, 4529, 3019, 3786, 3140, 2191,
+	7205, 7514, 7880, 7256, 4252, 3205, 6099, 4587, 495, 7928,
+	5208, 5401, 4226, 3541, 442, 8089, 3883, 176, 2632, 101, 1196,
+	876, 3820, 1224, 6272, 1450, 3037, 114, 7528, 3485, 602, 1231,
+	6243, 2179, 2602, 5612, 5488, 3432, 7647, 7749, 646, 411,
+	7483, 7864, 1545, 6661, 4305, 4805, 6347, 3197, 4995, 1608,
+	3151, 1137, 2822, 6651, 1858, 5912, 6077, 6944, 7456, 623,
+	327, 7810, 2352, 1488, 231, 4620, 6457, 2494, 7023, 5942,
+	1833, 5253, 2789, 1523, 4367, 8175, 1720, 7903, 4245, 4205,
+	7072, 6559, 551, 2999, 8149, 5121, 6645, 2367, 6868, 8011,
+	3188, 1977, 2748, 5585, 6804, 5377, 6973, 3897, 1150, 64,
+	6527, 4474, 6445, 5330, 10, 5092, 6207, 4692, 6289, 1969,
+	2812, 4236, 6735, 3709, 5428, 3659, 3365, 8017, 912, 7914,
+	6630, 1001, 4159, 7773, 2884, 1739, 2950, 4886, 4181, 5139,
+	6566, 5718, 2510, 3570, 3586, 5347, 2551, 4346, 1950, 1285,
+	6265, 7937, 4129, 2132, 7848, 3967, 4007, 983, 1482, 7508,
+	990, 7665, 7662, 2129, 6407, 4880, 7911, 4233, 5344, 4883,
+	6834, 5701, 7569, 6321, 4564, 2761, 313, 6410, 7245, 932,
+	1161, 7626, 6015, 6423, 1307, 2764, 5054, 2959, 6109, 4334,
+	4067, 6874, 1216, 4567, 2695, 5674, 1620, 4914, 2584, 1644,
+	2681, 6413, 4757, 4667, 1109, 1370, 2140, 899, 2913, 316,
+	5085, 5015, 1595, 5763, 6785, 712, 3403, 5704, 8184, 6725,
+	6280, 4382, 6199, 2256, 6219, 6837, 5839, 7327, 3765, 6706,
+	5186, 385, 7218, 6324, 5867, 1250, 2114, 867, 89, 1872, 6038,
+	7572, 3320, 5022, 7398, 6606, 7604, 7142, 7976, 7940, 1829,
+	1854, 6441, 6641, 491, 1983, 642, 6268, 2897, 7174, 1749, 359,
+	4559, 2505, 84, 2135, 349, 336, 7079, 7491, 7179, 1843, 1758,
+	4132, 4601, 7690, 257, 7762, 5861, 6828, 2388, 4349, 7642,
+	6094, 6522, 7018, 2450, 2967, 4014, 2554, 819, 4962, 6861,
+	4291, 7474, 3548, 2781, 1288, 4355, 7276, 6967, 2596, 2902,
+	5832, 962, 1953, 1447, 173, 408, 2176, 7409, 2089, 7925, 7511,
+	2364, 4202, 5327, 5374, 5909, 3194, 5250, 1485, 2799, 4943,
+	2341, 8067, 2641, 3247, 7290, 7668, 4316, 1941, 6005, 7231,
+	364, 3339, 2398, 993, 4970, 4275, 42, 5163, 3699, 3303, 3988,
+	3970, 5266, 8129, 3645, 3834, 204, 1088, 8058, 7851, 2909,
+	1212, 6034, 6215, 3582, 908, 309, 986, 2394, 5246, 954, 8054,
+	1754, 638, 958, 4010, 7723, 1602, 2264, 5988, 6901, 5811,
+	4152, 1742, 6587, 3012, 6257, 2726, 5045, 5591, 3307, 2887,
+	3062, 2406, 6908, 847, 6152, 397, 667, 4889, 3391, 3098, 3006,
+	2032, 1848, 4196, 3703, 2953, 471, 7055, 7370, 2015, 2734,
+	1631, 144, 1004, 2073, 658, 1403, 4746, 6182, 5787, 3974,
+	6633, 567, 3329, 1498, 4086, 1728, 5215, 6356, 7776, 7696,
+	7433, 1174, 7267, 7184, 2520, 3992, 4162, 7108, 2106, 7742,
+	3804, 2217, 6066, 1322, 3573, 7044, 2038, 5296, 1662, 5825,
+	2754, 4279, 2513, 6767, 3955, 156, 6377, 5570, 5537, 5888,
+	5350, 1390, 7832, 4576, 5546, 4137, 2279, 4974, 3589, 7312,
+	1187, 1342, 7802, 3239, 7349, 5389, 5142, 6885, 4708, 1458,
+	4821, 5361, 4045, 5167, 4184, 1960, 2564, 7706, 5418, 4445,
+	1563, 6690, 5721, 4607, 2980, 7116, 5497, 1763, 6307, 46,
+	6569, 5448, 5770, 7164, 1816, 3781, 3480, 618, 1972, 4123,
+	3397, 2382, 3982, 138, 5383, 1092, 6292, 4060, 5902, 5818,
+	2424, 1690, 1583, 3877, 4239, 1436, 6996, 558, 7872, 341,
+	1428, 208, 2815, 2842, 187, 539, 295, 3672, 7126, 1098, 5095,
+	886, 1706, 1351, 5876, 7989, 5062, 7855, 13, 842, 4081, 6372,
+	5413, 2419, 5408, 2296, 4695, 7768, 4875, 4909, 6701, 354,
+	4286, 8062, 6210, 1297, 5071, 3508, 1276, 4026, 2004, 1916,
+	8020, 7445, 3104, 2937, 4101, 2431, 6810, 8133, 3368, 6339,
+	129, 4788, 2301, 8168, 7357, 1908, 7917, 4492, 7795, 5156,
+	5756, 7496, 3221, 5270, 915, 827, 2163, 3086, 4499, 2321,
+	2201, 6298, 3712, 2227, 3114, 2923, 8077, 2613, 5659, 3838,
+	6738, 969, 2470, 6717, 4700, 2332, 6931, 4719, 3662, 263, 758,
+	1886, 4864, 7084, 1804, 3649, 5431, 7962, 6792, 6227, 5968,
+	4391, 2573, 6050, 388, 5284, 673, 3126, 699, 6496, 3903, 3251,
+	5189, 3630, 3347, 2271, 891, 3942, 6958, 4435, 6327, 6391,
+	3855, 5128, 3920, 7147, 2711, 2645, 7221, 806, 74, 4325, 3517,
+	6595, 504, 5454, 7330, 7423, 3687, 4401, 6168, 1413, 5105,
+	7672, 5842, 2312, 3180, 4985, 1711, 4213, 3890, 6026, 6709,
+	2973, 751, 1243, 5239, 7609, 2045, 7294, 3768, 7551, 5799,
+	8041, 6752, 5628, 2854, 7588, 1875, 5600, 4895, 4423, 3526,
+	1697, 6979, 4947, 92, 4846, 3611, 5736, 1356, 285, 3164, 6546,
+	7575, 4684, 5980, 5960, 1023, 7945, 3355, 2803, 6041, 7006,
+	6162, 6616, 922, 6127, 1068, 5776, 1253, 4376, 977, 3828,
+	7012, 4815, 4740, 8071, 5870, 7283, 2674, 1901, 5881, 4518,
+	6539, 2993, 870, 2456, 7301, 3812, 1381, 7981, 2442, 2345,
+	2117, 1536, 719, 1515, 3499, 2155, 4267, 2243, 715, 2670,
+	6158, 3607, 5795, 3176, 70, 3343, 6788, 4731, 2247, 5995,
+	7994, 5509, 3749, 3460, 5707, 216, 7819, 8156, 1553, 5027,
+	5312, 368, 3406, 1208, 4271, 4939, 169, 4958, 7686, 7170,
+	5018, 7323, 5011, 5670, 928, 2125, 4342, 997, 5088, 2466,
+	2159, 125, 5067, 4077, 183, 5898, 5766, 2560, 1183, 3951,
+	2102, 3325, 7051, 2402, 1598, 3081, 3503, 534, 7159, 1337,
+	7737, 7365, 2259, 37, 403, 252, 7393, 1590, 1156, 1945, 6202,
+	8007, 1519, 6940, 7860, 110, 5397, 4525, 6840, 2658, 529,
+	4934, 1510, 6611, 8036, 4320, 6222, 4299, 723, 2663, 5277,
+	4116, 6580, 1822, 6728, 580, 3622, 3054, 6622, 797, 2542,
+	7235, 8187, 4362, 1540, 4221, 18, 1331, 2149, 5622, 4385,
+	4020, 3775, 2211, 6895, 7403, 7598, 6009, 6283, 3559, 3410,
+	6845, 1031, 24, 1931, 7381, 1647, 730, 6914, 6507, 6478, 6680,
+	4480, 2093, 2587, 588, 372, 7730, 2847, 1997, 6059, 2082,
+	6416, 4798, 3599, 2374, 6433, 1988, 6143, 7413, 2684, 1058,
+	5316, 4530, 3269, 3020, 1677, 3787, 5677, 3141, 7894, 2192,
+	1074, 7206, 8113, 7515, 2698, 7881, 5031, 7257, 192, 4253,
+	449, 3206, 4917, 6100, 4414, 4588, 4549, 496, 1669, 7929,
+	1623, 5209, 1557, 5402, 6925, 4227, 379, 3542, 902, 443, 853,
+	8090, 2531, 3884, 6533, 177, 2143, 2633, 8160, 102, 544, 1197,
+	2623, 877, 319, 3821, 3047, 1225, 5579, 6273, 3638, 1451,
+	2916, 3038, 7823, 115, 3228, 7529, 5689, 3486, 4670, 603,
+	2478, 1232, 6133, 6244, 2057, 2180, 4760, 2603, 220, 5613,
+	300, 5489, 859, 3433, 1373, 7648, 7616, 7750, 3441, 647, 3721,
+	412, 1112, 7484, 5711, 7865, 2025, 1546, 3913, 6662, 6426,
+	4306, 3068, 4806, 6190, 6348, 5336, 3198, 6018, 4996, 3464,
+	1609, 3677, 3152, 780, 1138, 2767, 2823, 1267, 6652, 6669,
+	1859, 428, 5913, 1310, 6078, 3753, 6945, 5475, 7457, 1127,
+	624, 935, 328, 6988, 7811, 1259, 2353, 6117, 1489, 7248, 232,
+	5513, 4621, 7131, 6458, 8096, 2495, 7629, 7024, 3735, 5943,
+	1789, 1834, 5303, 5254, 1164, 2790, 7998, 1524, 2832, 4368,
+	595, 8176, 6877, 1721, 2412, 7904, 7467, 4246, 6451, 4206,
+	4070, 7073, 5999, 6560, 1103, 552, 5150, 3000, 4570, 8150,
+	4928, 5122, 5954, 6646, 5116, 2368, 1219, 6869, 2251, 8012,
+	7503, 3189, 1083, 1978, 2962, 2749, 4040, 5586, 5782, 6805,
+	5654, 5378, 5057, 6974, 4735, 3898, 5100, 1151, 2537, 65,
+	4337, 6528, 2052, 4475, 8108, 6446, 5649, 5331, 6112, 11,
+	5874, 5093, 293, 6208, 6699, 4693, 5411, 6290, 3980, 1970,
+	1814, 2813, 7870, 4237, 2422, 6736, 8075, 3710, 4497, 5429,
+	4862, 3660, 4698, 3366, 4099, 8018, 1274, 913, 5754, 7915,
+	2299, 6631, 4744, 1002, 2013, 4160, 7265, 7774, 4084, 2885,
+	2724, 1740, 5986, 2951, 2030, 4887, 845, 4182, 4819, 5140,
+	7800, 6567, 5495, 5719, 5416, 2511, 1660, 3571, 3802, 3587,
+	5544, 5348, 6375, 2552, 7016, 4347, 7760, 1951, 2594, 1286,
+	4289, 6266, 6639, 7938, 6604, 4130, 7489, 2133, 357, 7849,
+	3832, 3968, 5161, 4008, 8052, 984, 6213, 1483, 5372, 7509,
+	2174, 991, 7229, 7666, 8065, 7663, 981, 2130, 1283, 6408,
+	6319, 4881, 4878, 7912, 3657, 4234, 4690, 5345, 5716, 4884,
+	7771, 6835, 4380, 5702, 5761, 7570, 865, 6322, 6704, 4565,
+	4332, 2762, 7624, 314, 1368, 6411, 4912, 7246, 1257, 933,
+	5473, 1162, 1787, 7627, 7129, 6016, 6188, 6424, 2023, 1308,
+	6667, 2765, 3675, 5055, 5780, 2960, 7501, 6110, 8106, 4335,
+	5098, 4068, 7465, 6875, 2830, 1217, 5952, 4568, 1101, 2696,
+	1072, 5675, 3267, 1621, 4547, 4915, 190, 2585, 6476, 1645,
+	1029, 2682, 6431, 6414, 2845, 4758, 6131, 4668, 3226, 1110,
+	3439, 1371, 298, 2141, 2529, 900, 6923, 2914, 5577, 317, 542,
+	5086, 926, 5016, 167, 1596, 2100, 5764, 5065, 6786, 5793, 713,
+	3497, 3404, 1551, 5705, 7992, 8185, 6620, 6726, 5275, 6281,
+	6893, 4383, 16, 6200, 7391, 2257, 7157, 6220, 1508, 6838,
+	7858, 5840, 6166, 7328, 3515, 3766, 5237, 6707, 1709, 5187,
+	697, 386, 5966, 7219, 3918, 6325, 889, 5868, 7010, 1251, 920,
+	2115, 1379, 868, 5879, 90, 3524, 1873, 6750, 6039, 1021, 7573,
+	1354, 3321, 2121, 5023, 3172, 7399, 793, 6607, 1586, 7605,
+	1409, 7143, 6492, 7977, 4811, 7941, 1693, 1830, 2349, 1855,
+	6344, 6442, 6801, 6642, 4242, 492, 7202, 1984, 6676, 643,
+	6240, 6269, 3880, 2898, 2446, 7175, 487, 1750, 200, 360, 5905,
+	4560, 1478, 2506, 3361, 85, 6195, 2136, 4063, 350, 7985, 337,
+	134, 7080, 2609, 7492, 2427, 7180, 6178, 1844, 5041, 1759,
+	5357, 4133, 5821, 4602, 1385, 7691, 3386, 258, 4487, 7763,
+	1431, 5862, 4752, 6829, 4176, 2389, 4311, 4350, 344, 7643,
+	3816, 6095, 4793, 6523, 8145, 7019, 2818, 2451, 4679, 2968,
+	6386, 4015, 2653, 2555, 211, 820, 7305, 4963, 5078, 6862,
+	3031, 4292, 6999, 7475, 5439, 3549, 7951, 2782, 3073, 1289,
+	1439, 4356, 2460, 7277, 2306, 6968, 226, 2597, 7875, 2903,
+	813, 5833, 7656, 963, 836, 1954, 561, 1448, 874, 174, 3539,
+	409, 3430, 2177, 3483, 7410, 2079, 2090, 7378, 7926, 3203,
+	7512, 3784, 2365, 2997, 4203, 8173, 5328, 62, 5375, 1975,
+	5910, 1135, 3195, 6659, 5251, 2492, 1486, 621, 2800, 6543,
+	4944, 7585, 2342, 2990, 8068, 5773, 2642, 4432, 3248, 6047,
+	7291, 6023, 7669, 5451, 4317, 4522, 1942, 7362, 6006, 5619,
+	7232, 1819, 365, 3457, 3340, 2240, 2399, 5895, 994, 7167,
+	4971, 5885, 4276, 1319, 43, 6687, 5164, 5386, 3700, 664, 3304,
+	4149, 3989, 6353, 3971, 141, 5267, 1905, 8130, 1913, 3646,
+	4716, 3835, 6295, 205, 3874, 1089, 615, 8059, 2293, 7852,
+	1095, 2910, 2678, 1213, 1304, 6035, 7215, 6216, 3400, 3583,
+	2947, 909, 2809, 310, 5341, 987, 4126, 2395, 7287, 5247, 7922,
+	955, 306, 8055, 3985, 1755, 81, 639, 7973, 959, 2778, 4011,
+	2385, 7724, 96, 1603, 6554, 2265, 5730, 5989, 6934, 6902, 150,
+	5812, 4782, 4153, 1614, 1743, 2335, 6588, 4951, 3013, 7450,
+	6258, 5854, 2727, 3665, 5046, 7036, 5592, 435, 3308, 461,
+	2888, 4722, 3063, 6983, 2407, 4035, 6909, 7889, 848, 2473,
+	6153, 5006, 398, 3617, 668, 3682, 4890, 972, 3392, 1701, 3099,
+	3109, 3007, 653, 2033, 4703, 1849, 6089, 4197, 8124, 3704,
+	3962, 2954, 6720, 472, 3530, 7056, 4775, 7371, 6485, 2016,
+	1807, 2735, 1010, 1632, 513, 145, 5001, 1005, 7087, 2074,
+	4427, 659, 2942, 1404, 1473, 4747, 5434, 6183, 6471, 5788,
+	692, 3975, 2719, 6634, 3652, 568, 4899, 3330, 8027, 1499,
+	3279, 4087, 761, 1729, 7092, 5216, 4852, 6357, 3469, 7777,
+	266, 7697, 5604, 7434, 4106, 1175, 3727, 7268, 4867, 7185,
+	5461, 2521, 3449, 3993, 5930, 4163, 1889, 7109, 1879, 2107,
+	947, 7743, 4468, 3805, 2204, 2218, 2740, 6067, 7063, 1323,
+	1143, 3574, 2324, 7045, 7592, 2039, 2436, 5297, 5643, 1663,
+	3715, 5826, 632, 2755, 1866, 4280, 1798, 2514, 6301, 6768,
+	2858, 3956, 5924, 157, 684, 6378, 2166, 5571, 1015, 5538,
+	1362, 5889, 2772, 5351, 830, 1391, 5632, 7833, 6815, 4577,
+	418, 5547, 4502, 4138, 7193, 2280, 739, 4975, 6774, 3590,
+	3089, 7313, 6756, 1188, 5561, 1343, 6514, 7803, 5662, 3240,
+	1637, 7350, 5530, 5390, 3157, 5143, 2616, 6886, 8045, 4709,
+	8138, 1459, 1466, 4822, 6741, 5362, 4635, 4046, 4657, 5168,
+	3288, 4185, 3841, 1961, 5803, 2565, 1923, 7707, 2874, 5419,
+	3117, 4446, 518, 1564, 5742, 6691, 785, 5722, 2230, 4608,
+	7555, 2981, 3373, 7117, 1118, 5498, 8080, 1764, 7337, 6308,
+	4831, 47, 2864, 6570, 2926, 5449, 6045, 5771, 7583, 7165,
+	2238, 1817, 7360, 3782, 7376, 3481, 3537, 619, 6657, 1973,
+	8171, 4124, 2807, 3398, 1302, 2383, 7971, 3983, 7920, 139,
+	4147, 5384, 1317, 1093, 613, 6293, 1911, 4061, 3359, 5903,
+	485, 5819, 5039, 2425, 132, 1691, 6490, 1584, 3170, 3878,
+	6674, 4240, 6342, 1437, 7949, 6997, 5076, 559, 7654, 7873,
+	2304, 342, 4174, 1429, 3384, 209, 6384, 2816, 4791, 2843,
+	1027, 188, 3265, 540, 6921, 296, 3224, 3673, 2021, 7127, 5471,
+	1099, 2828, 5096, 7499, 887, 5964, 1707, 3513, 1352, 6748,
+	5877, 918, 7990, 3495, 5063, 165, 7856, 7155, 14, 5273, 843,
+	5984, 4082, 2011, 6373, 3800, 5414, 7798, 2420, 1812, 5409,
+	291, 2297, 1272, 4696, 4495, 7769, 4688, 4876, 1281, 4910,
+	7622, 6702, 5759, 355, 6602, 4287, 7758, 8063, 2172, 6211,
+	5159, 1298, 7579, 5072, 481, 3509, 3261, 1277, 2007, 4027,
+	477, 2005, 479, 1917, 5918, 8021, 4029, 7446, 6550, 3105,
+	4031, 2938, 4771, 4102, 8023, 2432, 943, 6811, 5920, 8134,
+	5557, 3369, 1919, 6340, 3168, 130, 483, 4789, 3382, 2302,
+	5074, 8169, 3535, 7358, 7581, 1909, 1315, 7918, 1300, 4493,
+	289, 7796, 2009, 5157, 7756, 5757, 1279, 7497, 5469, 3222,
+	3263, 5271, 163, 916, 3511, 828, 1360, 2164, 5922, 3087, 737,
+	4500, 6813, 2322, 7061, 2202, 945, 6299, 1864, 3713, 2434,
+	2228, 5740, 3115, 1921, 2924, 4829, 8078, 3371, 2614, 5528,
+	5660, 5559, 3839, 4655, 6739, 8136, 970, 3615, 2471, 4033,
+	6718, 8122, 4701, 3107, 2333, 4780, 6932, 6552, 4720, 433,
+	3663, 7448, 264, 4850, 759, 8025, 1887, 3447, 4865, 4104,
+	7085, 511, 1805, 4773, 3650, 690, 5432, 2940, 7963, 5846,
+	6793, 4854, 6228, 4454, 5969, 5218, 4392, 3998, 2574, 7094,
+	6051, 6950, 389, 1731, 5285, 7676, 674, 268, 3127, 5226, 700,
+	7779, 6497, 3931, 3904, 3471, 3252, 3421, 5190, 6359, 3631,
+	5109, 3348, 8029, 2272, 3214, 892, 3332, 3943, 5935, 6959,
+	4901, 4436, 5480, 6328, 570, 6392, 1417, 3856, 763, 5129,
+	7535, 3921, 4089, 7148, 4648, 2712, 3281, 2646, 2286, 7222,
+	1501, 807, 6172, 75, 3451, 4326, 1654, 3518, 2523, 6596, 4168,
+	505, 5463, 5455, 6083, 7331, 7187, 7424, 4405, 3688, 1891,
+	4402, 4642, 6169, 4165, 1414, 4645, 5106, 5932, 7673, 3928,
+	5843, 3995, 2313, 3691, 3181, 4108, 4986, 1047, 1712, 7436,
+	4214, 1894, 3891, 5606, 6027, 3758, 6710, 7699, 2974, 7427,
+	752, 4869, 1244, 5695, 5240, 7270, 7610, 4408, 2046, 3729,
+	7295, 745, 3769, 1177, 7552, 7334, 5800, 515, 8042, 4632,
+	6753, 1634, 5629, 7190, 2855, 1012, 7589, 629, 1876, 2737,
+	5601, 5458, 4896, 7089, 4424, 6468, 3527, 1007, 1698, 6086,
+	6980, 5003, 4948, 7033, 93, 147, 4847, 508, 3612, 4777, 5737,
+	5525, 1357, 7058, 286, 5466, 3165, 3532, 6547, 940, 7576, 474,
+	4685, 6599, 5981, 1809, 5961, 3492, 1024, 2018, 7946, 4171,
+	3356, 6487, 2804, 4144, 6042, 7373, 7007, 3521, 6163, 694,
+	6617, 7388, 923, 5790, 6128, 2526, 1069, 6473, 5777, 7462,
+	1254, 6185, 4377, 4329, 978, 3654, 3829, 5369, 7013, 6636,
+	4816, 1657, 4741, 2721, 8072, 4096, 5871, 3977, 7284, 78,
+	2675, 2944, 1902, 3871, 5882, 661, 4519, 3454, 6540, 4429,
+	2994, 1132, 871, 2076, 2457, 810, 7302, 5436, 3813, 4676,
+	1382, 4749, 7982, 6175, 2443, 1475, 2346, 7199, 2118, 1406,
+	1537, 3772, 720, 3619, 1516, 526, 3500, 400, 2156, 1180, 4268,
+	5008, 2244, 7816, 716, 6155, 2671, 7298, 6159, 974, 3608,
+	5977, 5796, 4892, 3177, 748, 71, 3684, 3344, 3852, 6789, 670,
+	4732, 2049, 2248, 4037, 5996, 4925, 7995, 2409, 5510, 3732,
+	3750, 6985, 3461, 1264, 5708, 3065, 217, 7613, 7820, 2475,
+	8157, 3044, 1554, 850, 5028, 4411, 5313, 7891, 369, 3596,
+	3407, 6911, 1209, 5243, 4272, 8126, 4940, 1938, 170, 4199,
+	4959, 7273, 7687, 6091, 7171, 333, 5019, 1851, 7324, 1247,
+	5012, 6722, 5671, 4664, 929, 2956, 2126, 5698, 4343, 3964,
+	998, 5136, 5089, 3706, 2467, 755, 2160, 3111, 126, 7792, 5068,
+	3101, 4078, 4872, 184, 1703, 5899, 6993, 5767, 3394, 2561,
+	2977, 1184, 4705, 3952, 7829, 2103, 2035, 3326, 7430, 7052,
+	655, 2403, 3095, 1599, 3009, 3082, 6713, 3504, 4784, 535,
+	6368, 7160, 5814, 1338, 7702, 7738, 152, 7366, 1494, 2260,
+	6904, 38, 6030, 404, 2337, 253, 6857, 7394, 1745, 1591, 3761,
+	1157, 1616, 1946, 6403, 6203, 4155, 8008, 3894, 1520, 6556,
+	6941, 4617, 7861, 1605, 111, 5609, 5398, 98, 4526, 7253, 6841,
+	7726, 2659, 4217, 530, 6936, 4935, 121, 1511, 5991, 6612,
+	1897, 8037, 5732, 4321, 4981, 6223, 2267, 4300, 1715, 724,
+	437, 2664, 31, 5278, 5594, 4117, 7439, 6581, 7038, 1823, 2358,
+	6729, 5048, 581, 4989, 3623, 4724, 3055, 4053, 6623, 2890,
+	798, 1050, 2543, 463, 7236, 7542, 8188, 3310, 4363, 3184,
+	1541, 7452, 4222, 7524, 19, 3015, 1332, 4111, 2150, 4953,
+	5623, 6122, 4386, 6590, 4021, 2316, 3776, 3667, 2212, 3234,
+	6896, 2729, 7404, 3694, 7599, 5856, 6010, 6780, 6284, 6260,
+	3560, 5193, 3411, 5744, 6846, 1572, 1032, 1566, 25, 6362,
+	1932, 520, 7382, 4626, 1648, 4448, 731, 3255, 6915, 2232,
+	6508, 4462, 6479, 5724, 6681, 3424, 4481, 787, 2094, 1781,
+	2588, 6693, 589, 3907, 373, 1925, 7731, 4261, 2848, 2567,
+	1998, 3474, 6060, 5805, 2083, 7136, 6417, 1963, 4799, 6500,
+	3600, 3119, 2375, 6250, 6434, 5421, 1989, 3934, 6144, 2876,
+	7414, 7839, 2685, 7709, 1059, 703, 5317, 4833, 4531, 1038,
+	3270, 6310, 3021, 7782, 1678, 7339, 3788, 237, 5678, 1766,
+	3142, 3130, 7895, 2928, 2193, 3295, 1075, 6572, 7207, 5229,
+	8114, 2866, 7516, 3863, 2699, 49, 7882, 677, 5032, 3375, 7258,
+	4540, 193, 2983, 4254, 271, 450, 7557, 3207, 5518, 4918, 4610,
+	6101, 5288, 4415, 8082, 4589, 2063, 4550, 5500, 497, 7679,
+	1670, 1120, 7930, 6821, 1624, 7119, 5210, 392, 1558, 5532,
+	5403, 1578, 6926, 7352, 4228, 1734, 380, 1639, 3543, 2500,
+	903, 3242, 444, 6054, 854, 2618, 8091, 775, 2532, 5145, 3885,
+	6953, 6534, 3159, 178, 3744, 2144, 5392, 2634, 2577, 8161,
+	5563, 103, 278, 545, 1190, 1198, 7097, 2624, 6758, 878, 7634,
+	320, 7315, 3822, 4395, 3048, 5664, 1226, 2186, 5580, 7805,
+	6274, 4001, 3639, 6516, 1452, 1397, 2917, 1345, 3039, 5972,
+	7824, 4659, 116, 6852, 3229, 4048, 7530, 5221, 5690, 4637,
+	3487, 6463, 4671, 5364, 604, 6231, 2479, 3843, 1233, 5175,
+	6134, 4187, 6245, 4457, 2058, 3290, 2181, 770, 4761, 5170,
+	2604, 6796, 221, 8140, 5614, 57, 301, 4711, 5490, 4857, 860,
+	8047, 3434, 8101, 1374, 6888, 7649, 7966, 7617, 6743, 7751,
+	4766, 3442, 4824, 648, 5849, 3722, 1468, 413, 5638, 1113,
+	1461, 7485, 7225, 5712, 1364, 7866, 5750, 2026, 5540, 1547,
+	1504, 3914, 1017, 6663, 5948, 6427, 5573, 4307, 2649, 3069,
+	832, 4807, 6236, 6191, 5353, 6349, 2289, 5337, 2774, 3199,
+	2488, 6019, 5891, 4997, 2715, 3465, 5926, 1610, 457, 3678,
+	3958, 3153, 3284, 781, 2860, 1139, 1794, 2768, 6770, 2824,
+	7151, 1268, 2168, 6653, 609, 6670, 6380, 1860, 4651, 429, 686,
+	5914, 5553, 1311, 159, 6079, 3924, 3754, 741, 6946, 3417,
+	5476, 2282, 7458, 4092, 1128, 7195, 625, 7029, 936, 4140, 329,
+	5132, 6989, 3091, 7812, 3848, 1260, 3592, 2354, 7538, 6118,
+	6776, 1490, 6399, 7249, 4977, 233, 3859, 5514, 6817, 4622,
+	1777, 7132, 7835, 6459, 766, 8097, 5634, 2496, 3740, 7630,
+	1393, 7025, 6395, 3736, 4504, 5944, 2484, 1790, 5549, 1835,
+	1420, 5304, 420, 5255, 4508, 1165, 4579, 2791, 6331, 7999,
+	7065, 1525, 5199, 2833, 6069, 4369, 573, 596, 2742, 8177,
+	5259, 6878, 2220, 1722, 4439, 2413, 2326, 7905, 5180, 7468,
+	3576, 4247, 5483, 6452, 1145, 4207, 4512, 4071, 1325, 7074,
+	6962, 6000, 949, 6561, 7564, 1104, 2109, 553, 4904, 5151,
+	1881, 3001, 1169, 4571, 7111, 8151, 3946, 4929, 2206, 5123,
+	1238, 5955, 3807, 6647, 5938, 5117, 4470, 2369, 4583, 1220,
+	7745, 6870, 895, 2252, 1868, 8013, 3566, 7504, 2757, 3190,
+	3335, 1084, 634, 1979, 1839, 2963, 5828, 2750, 2275, 4041,
+	6303, 5587, 4192, 5783, 2516, 6806, 3217, 5655, 1800, 5379,
+	1424, 5058, 4282, 6975, 3351, 4736, 2438, 3899, 2707, 5101,
+	2041, 1152, 8032, 2538, 7594, 66, 5308, 4338, 7047, 6529,
+	3634, 2053, 3717, 4476, 6139, 8109, 1665, 6447, 5112, 5650,
+	5645, 5332, 424, 6113, 5299, 12, 5061, 5875, 1705, 5094, 7125,
+	294, 186, 6209, 4285, 6700, 4874, 4694, 5407, 5412, 4080,
+	6291, 5382, 3981, 3396, 1971, 3479, 1815, 5769, 2814, 1427,
+	7871, 6995, 4238, 1582, 2423, 5901, 6737, 5658, 8076, 3113,
+	3711, 2200, 4498, 2162, 5430, 1803, 4863, 757, 3661, 6930,
+	4699, 2469, 3367, 6809, 4100, 3103, 8019, 2003, 1275, 5070,
+	914, 3220, 5755, 7794, 7916, 7356, 2300, 128, 6632, 5786,
+	4745, 657, 1003, 1630, 2014, 7054, 4161, 2519, 7266, 7432,
+	7775, 5214, 4085, 3328, 2886, 5590, 2725, 3011, 1741, 5810,
+	5987, 1601, 2952, 4195, 2031, 3097, 4888, 396, 846, 2405,
+	4183, 4044, 4820, 4707, 5141, 7348, 7801, 1186, 6568, 6306,
+	5496, 2979, 5720, 1562, 5417, 2563, 2512, 2753, 1661, 2037,
+	3572, 6065, 3803, 2105, 3588, 2278, 5545, 7831, 5349, 5536,
+	6376, 3954, 2553, 2966, 7017, 6093, 4348, 6827, 7761, 7689,
+	1952, 5831, 2595, 7275, 1287, 3547, 4290, 4961, 6267, 1982,
+	6640, 1853, 7939, 7141, 6605, 5021, 4131, 1842, 7490, 335,
+	2134, 2504, 358, 7173, 7850, 1087, 3833, 8128, 3969, 3302,
+	5162, 4274, 4009, 637, 8053, 5245, 985, 907, 6214, 1211, 1484,
+	3193, 5373, 4201, 7510, 2088, 2175, 172, 992, 3338, 7230,
+	1940, 7667, 3246, 8066, 4942, 7664, 7507, 982, 3966, 2131,
+	7936, 1284, 4345, 6409, 2760, 6320, 5700, 4882, 4232, 4879,
+	2128, 7913, 8016, 3658, 3708, 4235, 1968, 4691, 5091, 5346,
+	3569, 5717, 5138, 4885, 1738, 7772, 1000, 6836, 2255, 4381,
+	6724, 5703, 711, 5762, 5014, 7571, 1871, 866, 1249, 6323, 384,
+	6705, 7326, 4566, 6873, 4333, 2958, 2763, 6422, 7625, 931,
+	315, 898, 1369, 4666, 6412, 1643, 4913, 5673, 7247, 6116,
+	1258, 6987, 934, 1126, 5474, 3752, 1163, 5302, 1788, 3734,
+	7628, 8095, 7130, 5512, 6017, 5335, 6189, 3067, 6425, 3912,
+	2024, 5710, 1309, 427, 6668, 1266, 2766, 779, 3676, 3463,
+	5056, 5653, 5781, 4039, 2961, 1082, 7502, 2250, 6111, 5648,
+	8107, 2051, 4336, 2536, 5099, 4734, 4069, 6450, 7466, 2411,
+	6876, 594, 2831, 7997, 1218, 5115, 5953, 4927, 4569, 5149,
+	1102, 5998, 2697, 8112, 1073, 7893, 5676, 1676, 3268, 5315,
+	1622, 1668, 4548, 4413, 4916, 448, 191, 5030, 2586, 4479,
+	6477, 6913, 1646, 1930, 1030, 3409, 2683, 6142, 6432, 3598,
+	6415, 6058, 2846, 371, 4759, 2056, 6132, 2477, 4669, 5688,
+	3227, 7822, 1111, 3720, 3440, 7615, 1372, 858, 299, 219, 2142,
+	6532, 2530, 852, 901, 378, 6924, 1556, 2915, 3637, 5578, 3046,
+	318, 2622, 543, 8159, 5087, 4341, 927, 5010, 5017, 7685, 168,
+	4270, 1597, 7050, 2101, 1182, 5765, 182, 5066, 2158, 6787, 69,
+	5794, 6157, 714, 4266, 3498, 718, 3405, 5311, 1552, 7818,
+	5706, 3748, 7993, 2246, 8186, 2541, 6621, 3621, 6727, 6579,
+	5276, 722, 6282, 7597, 6894, 3774, 4384, 2148, 17, 1539, 6201,
+	1155, 7392, 402, 2258, 7736, 7158, 3502, 6221, 8035, 1509,
+	528, 6839, 5396, 7859, 1518, 5841, 5104, 6167, 3686, 7329,
+	503, 3516, 73, 3767, 2044, 5238, 750, 6708, 3889, 1710, 3179,
+	5188, 3902, 698, 672, 387, 2572, 5967, 6791, 7220, 2710, 3919,
+	3854, 6326, 6957, 890, 3346, 5869, 4739, 7011, 976, 1252,
+	1067, 921, 6161, 2116, 2441, 1380, 7300, 869, 6538, 5880,
+	2673, 91, 6978, 3525, 4894, 1874, 2853, 6751, 5798, 6040,
+	3354, 1022, 5979, 7574, 3163, 1355, 3610, 3322, 4074, 2122,
+	4955, 5024, 5506, 3173, 2152, 7400, 1328, 794, 4113, 6608,
+	107, 1587, 1334, 7606, 4210, 1410, 6592, 7144, 3939, 6493,
+	4388, 7978, 4515, 4812, 6124, 7942, 282, 1694, 5625, 1831,
+	6455, 2350, 7454, 1856, 3149, 6345, 1543, 6443, 1148, 6802,
+	3186, 6643, 549, 4243, 4365, 493, 4250, 7203, 3017, 1985,
+	1994, 6677, 21, 644, 5486, 6241, 7526, 6270, 1194, 3881, 4224,
+	2899, 7471, 2447, 5858, 7176, 4556, 488, 7601, 1751, 3579,
+	201, 3696, 361, 2638, 5906, 7406, 4561, 7908, 1479, 6262,
+	2507, 2881, 3362, 6286, 86, 5183, 6196, 6782, 2137, 2581,
+	4064, 6012, 351, 2416, 7986, 3669, 338, 1687, 135, 3778, 7081,
+	2329, 2610, 2318, 7493, 8165, 2428, 4023, 7181, 1725, 6179,
+	2731, 1845, 6149, 5042, 6898, 1760, 4442, 5358, 3236, 4134,
+	5567, 5822, 2214, 4603, 6881, 1386, 7040, 7692, 2069, 3387,
+	6583, 259, 2223, 4488, 7441, 7764, 882, 1432, 4119, 5863,
+	8180, 4753, 5050, 6830, 7844, 4177, 6731, 2390, 5262, 4312,
+	2360, 4351, 7638, 345, 1825, 7644, 599, 3817, 439, 6096, 3137,
+	4794, 726, 6524, 2745, 8146, 1717, 7020, 324, 2819, 4302,
+	2452, 4372, 4680, 5596, 2969, 7419, 6387, 5280, 4016, 576,
+	2654, 33, 2556, 7319, 212, 2666, 821, 2836, 7306, 465, 4964,
+	4595, 5079, 2545, 6863, 6072, 3032, 1052, 4293, 1202, 7000,
+	800, 7476, 1528, 5440, 3312, 3550, 7714, 7952, 8190, 2783,
+	5202, 3074, 7544, 1290, 7101, 1440, 7238, 4357, 8002, 2461,
+	4726, 7278, 4841, 2307, 3625, 6969, 7068, 227, 4991, 2598,
+	2628, 7876, 583, 2904, 2794, 814, 2892, 5834, 2690, 7657,
+	6625, 964, 6334, 837, 4055, 1955, 6762, 562, 3057, 1449, 1223,
+	875, 100, 175, 8088, 3540, 5400, 410, 7748, 3431, 5611, 2178,
+	1230, 3484, 113, 7411, 2372, 2080, 7728, 2091, 6505, 7379,
+	6843, 7927, 4586, 3204, 7255, 7513, 2190, 3785, 4528, 2366,
+	5120, 2998, 6558, 4204, 7902, 8174, 1522, 5329, 4473, 63,
+	3896, 5376, 5584, 1976, 8010, 5911, 6650, 1136, 1607, 3196,
+	4804, 6660, 7863, 5252, 5941, 2493, 4619, 1487, 7809, 622,
+	6943, 2801, 5958, 6544, 5734, 4945, 4421, 7586, 8039, 2343,
+	3810, 2991, 1899, 8069, 3826, 5774, 6614, 2643, 5126, 4433,
+	2269, 3249, 3124, 6048, 6225, 7292, 1241, 6024, 4983, 7670,
+	4399, 5452, 4323, 4318, 4932, 4523, 6938, 1943, 250, 7363,
+	532, 6007, 2209, 5620, 4219, 7233, 3052, 1820, 2661, 366,
+	8154, 3458, 5993, 3341, 3605, 2241, 1513, 2400, 3949, 5896,
+	123, 995, 5668, 7168, 4937, 4972, 4574, 5886, 154, 4277, 5294,
+	1320, 7740, 44, 7114, 6688, 7704, 5165, 1456, 5387, 1340,
+	3701, 3004, 665, 6906, 3305, 6255, 4150, 2262, 3990, 1172,
+	6354, 1496, 3972, 1401, 142, 7368, 5268, 5154, 1906, 4786,
+	8131, 2935, 1914, 3506, 3647, 1884, 4717, 6715, 3836, 2921,
+	6296, 3084, 206, 556, 3875, 5816, 1090, 2380, 616, 7162, 8060,
+	4907, 2294, 6370, 7853, 1349, 1096, 537, 2911, 1107, 2679,
+	1618, 1214, 6107, 1305, 1159, 6036, 2112, 7216, 3763, 6217,
+	6278, 3401, 1593, 3584, 6564, 2948, 4157, 910, 5426, 2810,
+	6205, 311, 7567, 5342, 6405, 988, 4005, 4127, 1948, 2396,
+	6003, 7288, 2339, 5248, 5325, 7923, 406, 956, 952, 307, 6032,
+	8056, 3643, 3986, 40, 1756, 7077, 82, 1747, 640, 6439, 7974,
+	7396, 960, 6965, 2779, 6859, 4012, 6520, 2386, 255, 7725,
+	7252, 97, 5608, 1604, 4616, 6555, 3893, 2266, 4980, 5731,
+	1896, 5990, 120, 6935, 4216, 6903, 1493, 151, 7701, 5813,
+	6367, 4783, 6712, 4154, 6402, 1615, 3760, 1744, 6856, 2336,
+	6029, 6589, 6121, 4952, 4110, 3014, 7523, 7451, 3183, 6259,
+	6779, 5855, 3693, 2728, 3233, 3666, 2315, 5047, 2357, 7037,
+	7438, 5593, 30, 436, 1714, 3309, 7541, 462, 1049, 2889, 4052,
+	4723, 4988, 3064, 1263, 6984, 3731, 2408, 4924, 4036, 2048,
+	6910, 3595, 7890, 4410, 849, 3043, 2474, 7612, 6154, 7815,
+	5007, 1179, 399, 525, 3618, 3771, 669, 3851, 3683, 747, 4891,
+	5976, 973, 7297, 3393, 6992, 1702, 4871, 3100, 7791, 3110,
+	754, 3008, 3094, 654, 7429, 2034, 7828, 4704, 2976, 1850, 332,
+	6090, 7272, 4198, 1937, 8125, 5242, 3705, 5135, 3963, 5697,
+	2955, 4663, 6721, 1246, 473, 939, 3531, 5465, 7057, 5524,
+	4776, 507, 7372, 4143, 6486, 4170, 2017, 3491, 1808, 6598,
+	2736, 628, 1011, 7189, 1633, 4631, 514, 7333, 146, 7032, 5002,
+	6085, 1006, 6467, 7088, 5457, 2075, 1131, 4428, 3453, 660,
+	3870, 2943, 77, 1405, 7198, 1474, 6174, 4748, 4675, 5435, 809,
+	6184, 7461, 6472, 2525, 5789, 7387, 693, 3520, 3976, 4095,
+	2720, 1656, 6635, 5368, 3653, 4328, 569, 5479, 4900, 5934,
+	3331, 3213, 8028, 5108, 1500, 2285, 3280, 4647, 4088, 7534,
+	762, 1416, 1730, 6949, 7093, 3997, 5217, 4453, 4853, 5845,
+	6358, 3420, 3470, 3930, 7778, 5225, 267, 7675, 7698, 3757,
+	5605, 1893, 7435, 1046, 4107, 3690, 1176, 744, 3728, 4407,
+	7269, 5694, 4868, 7426, 7186, 6082, 5462, 4167, 2522, 1653,
+	3450, 6171, 3994, 3927, 5931, 4644, 4164, 4641, 1890, 4404,
+	7110, 1168, 1880, 4903, 2108, 7563, 948, 6961, 7744, 4582,
+	4469, 5937, 3806, 1237, 2205, 3945, 2219, 5258, 2741, 572,
+	6068, 5198, 7064, 6330, 1324, 4511, 1144, 5482, 3575, 5179,
+	2325, 4438, 7046, 5307, 7593, 8031, 2040, 2706, 2437, 3350,
+	5298, 423, 5644, 5111, 1664, 6138, 3716, 3633, 5827, 1838,
+	633, 3334, 2756, 3565, 1867, 894, 4281, 1423, 1799, 3216,
+	2515, 4191, 6302, 2274, 6769, 1793, 2859, 3283, 3957, 456,
+	5925, 2714, 158, 5552, 685, 4650, 6379, 608, 2167, 7150, 5572,
+	5947, 1016, 1503, 5539, 5749, 1363, 7224, 5890, 2487, 2773,
+	2288, 5352, 6235, 831, 2648, 1392, 3739, 5633, 765, 7834,
+	1776, 6816, 3858, 4578, 4507, 419, 1419, 5548, 2483, 4503,
+	6394, 4139, 7028, 7194, 4091, 2281, 3416, 740, 3923, 4976,
+	6398, 6775, 7537, 3591, 3847, 3090, 5131, 7314, 7633, 6757,
+	7096, 1189, 277, 5562, 2576, 1344, 1396, 6515, 4000, 7804,
+	2185, 5663, 4394, 3241, 2499, 1638, 1733, 7351, 1577, 5531,
+	391, 5391, 3743, 3158, 6952, 5144, 774, 2617, 6053, 6887,
+	8100, 8046, 4856, 4710, 56, 8139, 6795, 1460, 5637, 1467,
+	5848, 4823, 4765, 6742, 7965, 5363, 6462, 4636, 5220, 4047,
+	6851, 4658, 5971, 5169, 769, 3289, 4456, 4186, 5174, 3842,
+	6230, 1962, 7135, 5804, 3473, 2566, 4260, 1924, 3906, 7708,
+	7838, 2875, 3933, 5420, 6249, 3118, 6499, 4447, 4625, 519,
+	6361, 1565, 1571, 5743, 5192, 6692, 1780, 786, 3423, 5723,
+	4461, 2231, 3254, 4609, 5517, 7556, 270, 2982, 4539, 3374,
+	676, 7118, 6820, 1119, 7678, 5499, 2062, 8081, 5287, 1765,
+	236, 7338, 7781, 6309, 1037, 4832, 702, 48, 3862, 2865, 5228,
+	6571, 3294, 2927, 3129, 5450, 6022, 6046, 4431, 5772, 2989,
+	7584, 6542, 7166, 5894, 2239, 3456, 1818, 5618, 7361, 4521,
+	3783, 3202, 7377, 2078, 3482, 3429, 3538, 873, 620, 2491,
+	6658, 1134, 1974, 61, 8172, 2996, 4125, 5340, 2808, 2946,
+	3399, 7214, 1303, 2677, 2384, 2777, 7972, 80, 3984, 305, 7921,
+	7286, 140, 6352, 4148, 663, 5385, 6686, 1318, 5884, 1094,
+	2292, 614, 3873, 6294, 4715, 1912, 1904, 4062, 6194, 3360,
+	1477, 5904, 199, 486, 2445, 5820, 5356, 5040, 6177, 2426,
+	2608, 133, 7984, 1692, 4810, 6491, 1408, 1585, 792, 3171,
+	2120, 3879, 6239, 6675, 7201, 4241, 6800, 6343, 2348, 1438,
+	3072, 7950, 5438, 6998, 3030, 5077, 7304, 560, 835, 7655, 812,
+	7874, 225, 2305, 2459, 343, 4310, 4175, 4751, 1430, 4486,
+	3385, 1384, 210, 2652, 6385, 4678, 2817, 8144, 4792, 3815,
+	2844, 6430, 1028, 6475, 189, 4546, 3266, 1071, 541, 5576,
+	6922, 2528, 297, 3438, 3225, 6130, 3674, 6666, 2022, 6187,
+	7128, 1786, 5472, 1256, 1100, 5951, 2829, 7464, 5097, 8105,
+	7500, 5779, 888, 3917, 5965, 696, 1708, 5236, 3514, 6165,
+	1353, 1020, 6749, 3523, 5878, 1378, 919, 7009, 7991, 1550,
+	3496, 5792, 5064, 2099, 166, 925, 7857, 1507, 7156, 7390, 15,
+	6892, 5274, 6619, 844, 2029, 5985, 2723, 4083, 7264, 2012,
+	4743, 6374, 5543, 3801, 1659, 5415, 5494, 7799, 4818, 2421,
+	7869, 1813, 3979, 5410, 6698, 292, 5873, 2298, 5753, 1273,
+	4098, 4697, 4861, 4496, 8074, 7770, 5715, 4689, 3656, 4877,
+	6318, 1282, 980, 4911, 1367, 7623, 4331, 6703, 864, 5760,
+	4379, 356, 7488, 6603, 6638, 4288, 2593, 7759, 7015, 8064,
+	7228, 2173, 5371, 6212, 8051, 5160, 3831, 1299, 1314, 7580,
+	3534, 5073, 3381, 482, 3167, 3510, 162, 3262, 5468, 1278,
+	7755, 2008, 288, 4028, 5917, 478, 476, 2006, 3260, 480, 7578,
+	1918, 5556, 5919, 942, 8022, 4770, 4030, 6549, 7447, 432,
+	6551, 4779, 3106, 8121, 4032, 3614, 2939, 689, 4772, 510,
+	4103, 3446, 8024, 4849, 2433, 1863, 944, 7060, 6812, 736,
+	5921, 1359, 8135, 4654, 5558, 5527, 3370, 4828, 1920, 5739,
+	6341, 6673, 3169, 6489, 131, 5038, 484, 3358, 4790, 6383,
+	3383, 4173, 2303, 7653, 5075, 7948, 8170, 6656, 3536, 7375,
+	7359, 2237, 7582, 6044, 1910, 612, 1316, 4146, 7919, 7970,
+	1301, 2806, 4494, 1271, 290, 1811, 7797, 3799, 2010, 5983,
+	5158, 2171, 7757, 6601, 5758, 7621, 1280, 4687, 7498, 2827,
+	5470, 2020, 3223, 6920, 3264, 1026, 5272, 7154, 164, 3494,
+	917, 6747, 3512, 5963, 829, 2771, 1361, 1014, 2165, 683, 5923,
+	2857, 3088, 6773, 738, 7192, 4501, 417, 6814, 5631, 2323,
+	1142, 7062, 2739, 2203, 4467, 946, 1878, 6300, 1797, 1865,
+	631, 3714, 5642, 2435, 7591, 2229, 784, 5741, 517, 3116, 2873,
+	1922, 5802, 2925, 2863, 4830, 7336, 8079, 1117, 3372, 7554,
+	2615, 3156, 5529, 1636, 5661, 6513, 5560, 6755, 3840, 3287,
+	4656, 4634, 6740, 1465, 8137, 8044, 971, 3681, 3616, 5005,
+	2472, 7888, 4034, 6982, 6719, 3961, 8123, 6088, 4702, 652,
+	3108, 1700, 2334, 1613, 4781, 149, 6933, 5729, 6553, 95, 4721,
+	460, 434, 7035, 3664, 5853, 7449, 4950, 265, 3468, 4851, 7091,
+	760, 3278, 8026, 4898, 1888, 5929, 3448, 5460, 4866, 3726,
+	4105, 5603, 7086, 5000, 512, 1009, 1806, 6484, 4774, 3529,
+	3651, 2718, 691, 6470, 5433, 1472, 2941, 4426, 7964, 4764,
+	5847, 5636, 6794, 55, 4855, 8099, 6229, 5173, 4455, 768, 5970,
+	6850, 5219, 6461, 4393, 2184, 3999, 1395, 2575, 276, 7095,
+	7632, 6052, 773, 6951, 3742, 390, 1576, 1732, 2498, 5286,
+	2061, 7677, 6819, 675, 4538, 269, 5516, 3128, 3293, 5227,
+	3861, 701, 1036, 7780, 235, 6498, 6248, 3932, 7837, 3905,
+	4259, 3472, 7134, 3253, 4460, 3422, 1779, 5191, 1570, 6360,
+	4624, 3632, 6137, 5110, 422, 3349, 2705, 8030, 5306, 2273,
+	4190, 3215, 1422, 893, 3564, 3333, 1837, 3944, 1236, 5936,
+	4581, 6960, 7562, 4902, 1167, 4437, 5178, 5481, 4510, 6329,
+	5197, 571, 5257, 6393, 2482, 1418, 4506, 3857, 1775, 764,
+	3738, 5130, 3846, 7536, 6397, 3922, 3415, 4090, 7027, 7149,
+	607, 4649, 5551, 2713, 455, 3282, 1792, 2647, 6234, 2287,
+	2486, 7223, 5748, 1502, 5946, 808, 4674, 6173, 7197, 76, 3869,
+	3452, 1130, 4327, 5367, 1655, 4094, 3519, 7386, 2524, 7460,
+	6597, 3490, 4169, 4142, 506, 5523, 5464, 938, 5456, 6466,
+	6084, 7031, 7332, 4630, 7188, 627, 7425, 5693, 4406, 743,
+	3689, 1045, 1892, 3756, 4403, 4640, 4643, 3926, 6170, 1652,
+	4166, 6081, 1415, 7533, 4646, 2284, 5107, 3212, 5933, 5478,
+	7674, 5224, 3929, 3419, 5844, 4452, 3996, 6948, 2314, 3232,
+	3692, 6778, 3182, 7522, 4109, 6120, 4987, 4051, 1048, 7540,
+	1713, 29, 7437, 2356, 4215, 119, 1895, 4979, 3892, 4615, 5607,
+	7251, 6028, 6855, 3759, 6401, 6711, 6366, 7700, 1492, 2975,
+	7827, 7428, 3093, 753, 7790, 4870, 6991, 1245, 4662, 5696,
+	5134, 5241, 1936, 7271, 331, 7611, 3042, 4409, 3594, 2047,
+	4923, 3730, 1262, 7296, 5975, 746, 3850, 3770, 524, 1178,
+	7814, 7553, 1116, 7335, 2862, 5801, 2872, 516, 783, 8043,
+	1464, 4633, 3286, 6754, 6512, 1635, 3155, 5630, 416, 7191,
+	6772, 2856, 682, 1013, 2770, 7590, 5641, 630, 1796, 1877,
+	4466, 2738, 1141, 5602, 3725, 5459, 5928, 4897, 3277, 7090,
+	3467, 4425, 1471, 6469, 2717, 3528, 6483, 1008, 4999, 1699,
+	651, 6087, 3960, 6981, 7887, 5004, 3680, 4949, 5852, 7034,
+	459, 94, 5728, 148, 1612, 4848, 3445, 509, 688, 3613, 8120,
+	4778, 431, 5738, 4827, 5526, 4653, 1358, 735, 7059, 1862, 287,
+	7754, 5467, 161, 3166, 3380, 3533, 1313, 6548, 4769, 941,
+	5555, 7577, 3259, 475, 5916, 4686, 7620, 6600, 2170, 5982,
+	3798, 1810, 1270, 5962, 6746, 3493, 7153, 1025, 6919, 2019,
+	2826, 7947, 7652, 4172, 6382, 3357, 5037, 6488, 6672, 2805,
+	7969, 4145, 611, 6043, 2236, 7374, 6655, 7008, 1377, 3522,
+	1019, 6164, 5235, 695, 3916, 6618, 6891, 7389, 1506, 924,
+	2098, 5791, 1549, 6129, 3437, 2527, 5575, 1070, 4545, 6474,
+	6429, 5778, 8104, 7463, 5950, 1255, 1785, 6186, 6665, 4378,
+	863, 4330, 1366, 979, 6317, 3655, 5714, 3830, 8050, 5370,
+	7227, 7014, 2592, 6637, 7487, 4817, 5493, 1658, 5542, 4742,
+	7263, 2722, 2028, 8073, 4860, 4097, 5752, 5872, 6697, 3978,
+	7868, 7285, 304, 79, 2776, 2676, 7213, 2945, 5339, 1903, 4714,
+	3872, 2291, 5883, 6685, 662, 6351, 4520, 5617, 3455, 5893,
+	6541, 2988, 4430, 6021, 2995, 60, 1133, 2490, 872, 3428, 2077,
+	3201, 2458, 224, 811, 834, 7303, 3029, 5437, 3071, 3814, 8143,
+	4677, 2651, 1383, 4485, 4750, 4309, 7983, 2607, 6176, 5355,
+	2444, 198, 1476, 6193, 2347, 6799, 7200, 6238, 2119, 791,
+	1407, 4809, 1538, 2147, 3773, 7596, 721, 6578, 3620, 2540,
+	1517, 5395, 527, 8034, 3501, 7735, 401, 1154, 2157, 181, 1181,
+	7049, 4269, 7684, 5009, 4340, 2245, 3747, 7817, 5310, 717,
+	4265, 6156, 68, 2672, 6537, 7299, 2440, 6160, 1066, 975, 4738,
+	3609, 3162, 5978, 3353, 5797, 2852, 4893, 6977, 3178, 3888,
+	749, 2043, 72, 502, 3685, 5103, 3345, 6956, 3853, 2709, 6790,
+	2571, 671, 3901, 4733, 2535, 2050, 5647, 2249, 1081, 4038,
+	5652, 5997, 5148, 4926, 5114, 7996, 593, 2410, 6449, 5511,
+	8094, 3733, 5301, 3751, 1125, 6986, 6115, 3462, 778, 1265,
+	426, 5709, 3911, 3066, 5334, 218, 857, 7614, 3719, 7821, 5687,
+	2476, 2055, 8158, 2621, 3045, 3636, 1555, 377, 851, 6531,
+	5029, 447, 4412, 1667, 5314, 1675, 7892, 8111, 370, 6057,
+	3597, 6141, 3408, 1929, 6912, 4478, 1210, 906, 5244, 636,
+	4273, 3301, 8127, 1086, 4941, 3245, 1939, 3337, 171, 2087,
+	4200, 3192, 4960, 3546, 7274, 5830, 7688, 6826, 6092, 2965,
+	7172, 2503, 334, 1841, 5020, 7140, 1852, 1981, 7325, 383,
+	1248, 1870, 5013, 710, 6723, 2254, 5672, 1642, 4665, 897, 930,
+	6421, 2957, 6872, 2127, 4231, 5699, 2759, 4344, 7935, 3965,
+	7506, 999, 1737, 5137, 3568, 5090, 1967, 3707, 8015, 2468,
+	6929, 756, 1802, 2161, 2199, 3112, 5657, 127, 7355, 7793,
+	3219, 5069, 2002, 3102, 6808, 4079, 5406, 4873, 4284, 185,
+	7124, 1704, 5060, 5900, 1581, 6994, 1426, 5768, 3478, 3395,
+	5381, 2562, 1561, 2978, 6305, 1185, 7347, 4706, 4043, 3953,
+	5535, 7830, 2277, 2104, 6064, 2036, 2752, 3327, 5213, 7431,
+	2518, 7053, 1629, 656, 5785, 2404, 395, 3096, 4194, 1600,
+	5809, 3010, 5589, 3083, 2920, 6714, 1883, 3505, 2934, 4785,
+	5153, 536, 1348, 6369, 4906, 7161, 2379, 5815, 555, 1339,
+	1455, 7703, 7113, 7739, 5293, 153, 4573, 7367, 1400, 1495,
+	1171, 2261, 6254, 6905, 3003, 39, 3642, 6031, 951, 405, 5324,
+	2338, 6002, 254, 6519, 6858, 6964, 7395, 6438, 1746, 7076,
+	1592, 6277, 3762, 2111, 1158, 6106, 1617, 1106, 1947, 4004,
+	6404, 7566, 6204, 5425, 4156, 6563, 8009, 5583, 3895, 4472,
+	1521, 7901, 6557, 5119, 6942, 7808, 4618, 5940, 7862, 4803,
+	1606, 6649, 112, 1229, 5610, 7747, 5399, 8087, 99, 1222, 4527,
+	2189, 7254, 4585, 6842, 6504, 7727, 2371, 2660, 3051, 4218,
+	2208, 531, 249, 6937, 4931, 4936, 5667, 122, 3948, 1512, 3604,
+	5992, 8153, 6613, 3825, 1898, 3809, 8038, 4420, 5733, 5957,
+	4322, 4398, 4982, 1240, 6224, 3123, 2268, 5125, 4301, 323,
+	1716, 2744, 725, 3136, 438, 598, 2665, 7318, 32, 575, 5279,
+	7418, 5595, 4371, 4118, 881, 7440, 2222, 6582, 2068, 7039,
+	6880, 1824, 7637, 2359, 5261, 6730, 7843, 5049, 8179, 582,
+	2627, 4990, 7067, 3624, 4840, 4725, 8001, 3056, 6761, 4054,
+	6333, 6624, 2689, 2891, 2793, 799, 1201, 1051, 6071, 2544,
+	4594, 464, 2835, 7237, 7100, 7543, 5201, 8189, 7713, 3311,
+	1527, 4364, 548, 3185, 1147, 1542, 3148, 7453, 6454, 4223,
+	1193, 7525, 5485, 20, 1993, 3016, 4249, 1333, 106, 4112, 1327,
+	2151, 5505, 4954, 4073, 5624, 281, 6123, 4514, 4387, 3938,
+	6591, 4209, 4022, 8164, 2317, 2328, 3777, 1686, 3668, 2415,
+	2213, 5566, 3235, 4441, 6897, 6148, 2730, 1724, 7405, 2637,
+	3695, 3578, 7600, 4555, 5857, 7470, 6011, 2580, 6781, 5182,
+	6285, 2880, 6261, 7907, 3561, 2702, 5194, 7559, 3412, 1772,
+	5745, 452, 6847, 52, 1573, 273, 1033, 4535, 1567, 4256, 26,
+	7519, 6363, 4612, 1933, 7787, 521, 4920, 7383, 3866, 4627,
+	5520, 1649, 1042, 4449, 3209, 732, 8117, 3256, 3377, 6916,
+	3795, 2233, 5034, 6509, 2869, 4463, 679, 6480, 3274, 5725,
+	7884, 6682, 7210, 3425, 2985, 4482, 3026, 788, 195, 2095,
+	5232, 1782, 4542, 2589, 6314, 6694, 7260, 590, 1078, 3908,
+	1122, 374, 5684, 1926, 1672, 7732, 6575, 4262, 7681, 2849,
+	1063, 2568, 499, 1999, 2196, 3475, 7121, 6061, 7344, 5806,
+	1626, 2084, 3298, 7137, 6823, 6418, 707, 1964, 7932, 4800,
+	7898, 6501, 8084, 3601, 246, 3120, 4417, 2376, 2931, 6251,
+	5290, 6435, 5321, 5422, 6103, 1990, 3145, 3935, 5502, 6145,
+	1683, 2877, 4552, 7415, 3133, 7840, 2065, 2686, 4837, 7710,
+	4591, 1060, 5681, 704, 7341, 5318, 243, 4834, 1680, 4532,
+	1769, 1039, 7784, 3271, 3792, 6311, 3023, 3022, 3791, 7783,
+	1768, 1679, 242, 7340, 5680, 3789, 240, 238, 239, 5679, 241,
+	1767, 3790, 3143, 1681, 3131, 4835, 7896, 244, 2929, 5319,
+	2194, 7342, 3296, 705, 1076, 5682, 6573, 1061, 7208, 3024,
+	5230, 6312, 8115, 3793, 2867, 3272, 7517, 7785, 3864, 1040,
+	2700, 1770, 50, 4533, 7883, 3273, 678, 2868, 5033, 3794, 3376,
+	8116, 7259, 6313, 4541, 5231, 194, 3025, 2984, 7209, 4255,
+	4534, 272, 51, 451, 1771, 7558, 2701, 3208, 1041, 5519, 3865,
+	4919, 7786, 4611, 7518, 6102, 5320, 5289, 2930, 4416, 245,
+	8083, 7897, 4590, 4836, 2064, 3132, 4551, 1682, 5501, 3144,
+	498, 1062, 7680, 6574, 1671, 5683, 1121, 1077, 7931, 706,
+	6822, 3297, 1625, 7343, 7120, 2195, 5211, 1627, 393, 5807,
+	1559, 7345, 5533, 6062, 5404, 7122, 1579, 3476, 6927, 2197,
+	7353, 2000, 4229, 7933, 1735, 1965, 381, 708, 1640, 6419,
+	3544, 6824, 2501, 7138, 904, 3299, 3243, 2085, 445, 1673,
+	6055, 1927, 855, 5685, 2619, 375, 8092, 1123, 776, 3909, 2533,
+	1079, 5146, 591, 3886, 500, 6954, 2569, 6535, 1064, 3160,
+	2850, 179, 7682, 3745, 4263, 2145, 6576, 5393, 7733, 2635,
+	4553, 2578, 2878, 8162, 1684, 5564, 6146, 104, 5503, 279,
+	3936, 546, 3146, 1191, 1991, 1199, 4592, 7098, 7711, 2625,
+	4838, 6759, 2687, 879, 2066, 7635, 7841, 321, 3134, 7316,
+	7416, 3823, 4418, 4396, 3121, 3049, 247, 5665, 3602, 1227,
+	8085, 2187, 6502, 5581, 7899, 7806, 4801, 6275, 6104, 4002,
+	5423, 3640, 5322, 6517, 6436, 1453, 5291, 1398, 6252, 2918,
+	2932, 1346, 2377, 3040, 4921, 5973, 522, 7825, 7788, 4660,
+	1934, 117, 4613, 6853, 6364, 3230, 7520, 4049, 27, 7531, 3210,
+	5222, 4450, 5691, 1043, 4638, 1650, 3488, 5521, 6464, 4628,
+	4672, 3867, 5365, 7384, 605, 453, 6232, 5746, 2480, 1773,
+	3844, 3413, 1234, 7560, 5176, 5195, 6135, 2703, 4188, 3562,
+	6246, 4257, 4458, 1568, 2059, 4536, 3291, 1034, 2182, 274,
+	771, 1574, 4762, 53, 5171, 6848, 2605, 196, 6797, 789, 222,
+	3027, 8141, 4483, 5615, 2986, 58, 3426, 302, 7211, 4712, 6683,
+	5491, 7261, 4858, 6695, 861, 6315, 8048, 2590, 3435, 4543,
+	8102, 1783, 1375, 5233, 6889, 2096, 7650, 5035, 7967, 2234,
+	7618, 3796, 6744, 6917, 7752, 3378, 4767, 3257, 3443, 8118,
+	4825, 733, 649, 7885, 5850, 5726, 3723, 3275, 1469, 6481, 414,
+	680, 5639, 4464, 1114, 2870, 1462, 6510, 7486, 2591, 7226,
+	8049, 5713, 6316, 1365, 862, 7867, 6696, 5751, 4859, 2027,
+	7262, 5541, 5492, 1548, 2097, 1505, 6890, 3915, 5234, 1018,
+	1376, 6664, 1784, 5949, 8103, 6428, 4544, 5574, 3436, 4308,
+	4484, 2650, 8142, 3070, 3028, 833, 223, 4808, 790, 6237, 6798,
+	6192, 197, 5354, 2606, 6350, 6684, 2290, 4713, 5338, 7212,
+	2775, 303, 3200, 3427, 2489, 59, 6020, 2987, 5892, 5616, 4998,
+	6482, 2716, 1470, 3466, 3276, 5927, 3724, 1611, 5727, 458,
+	5851, 3679, 7886, 3959, 650, 3154, 6511, 3285, 1463, 782,
+	2871, 2861, 1115, 1140, 4465, 1795, 5640, 2769, 681, 6771,
+	415, 2825, 6918, 7152, 6745, 1269, 3797, 2169, 7619, 6654,
+	2235, 610, 7968, 6671, 5036, 6381, 7651, 1861, 734, 4652,
+	4826, 430, 8119, 687, 3444, 5915, 3258, 5554, 4768, 1312,
+	3379, 160, 7753, 6080, 1651, 3925, 4639, 3755, 1044, 742,
+	5692, 6947, 4451, 3418, 5223, 5477, 3211, 2283, 7532, 7459,
+	7385, 4093, 5366, 1129, 3868, 7196, 4673, 626, 4629, 7030,
+	6465, 937, 5522, 4141, 3489, 330, 1935, 5133, 4661, 6990,
+	7789, 3092, 7826, 7813, 523, 3849, 5974, 1261, 4922, 3593,
+	3041, 2355, 28, 7539, 4050, 6119, 7521, 6777, 3231, 1491,
+	6365, 6400, 6854, 7250, 4614, 4978, 118, 234, 1035, 3860,
+	3292, 5515, 4537, 6818, 2060, 4623, 1569, 1778, 4459, 7133,
+	4258, 7836, 6247, 6460, 6849, 767, 5172, 8098, 54, 5635, 4763,
+	2497, 1575, 3741, 772, 7631, 275, 1394, 2183, 7026, 3414,
+	6396, 3845, 3737, 1774, 4505, 2481, 5945, 5747, 2485, 6233,
+	1791, 454, 5550, 606, 1836, 3563, 1421, 4189, 5305, 2704, 421,
+	6136, 5256, 5196, 4509, 5177, 1166, 7561, 4580, 1235, 2792,
+	2688, 6332, 6760, 8000, 4839, 7066, 2626, 1526, 7712, 5200,
+	7099, 2834, 4593, 6070, 1200, 4370, 7417, 574, 7317, 597,
+	3135, 2743, 322, 8178, 7842, 5260, 7636, 6879, 2067, 2221,
+	880, 1723, 6147, 4440, 5565, 2414, 1685, 2327, 8163, 7906,
+	2879, 5181, 2579, 7469, 4554, 3577, 2636, 4248, 1992, 5484,
+	1192, 6453, 3147, 1146, 547, 4208, 3937, 4513, 280, 4072,
+	5504, 1326, 105, 7075, 6437, 6963, 6518, 6001, 5323, 950,
+	3641, 6562, 5424, 7565, 4003, 1105, 6105, 2110, 6276, 554,
+	2378, 4905, 1347, 5152, 2933, 1882, 2919, 3002, 6253, 1170,
+	1399, 4572, 5292, 7112, 1454, 8152, 3603, 3947, 5666, 4930,
+	248, 2207, 3050, 5124, 3122, 1239, 4397, 5956, 4419, 3808,
+	3824, 6648, 4802, 5939, 7807, 5118, 7900, 4471, 5582, 2370,
+	6503, 4584, 2188, 1221, 8086, 7746, 1228, 6871, 6420, 896,
+	1641, 2253, 709, 1869, 382, 8014, 1966, 3567, 1736, 7505,
+	7934, 2758, 4230, 3191, 2086, 3336, 3244, 1085, 3300, 635,
+	905, 1980, 7139, 1840, 2502, 2964, 6825, 5829, 3545, 2751,
+	6063, 2276, 5534, 4042, 7346, 6304, 1560, 5588, 5808, 4193,
+	394, 5784, 1628, 2517, 5212, 6807, 2001, 3218, 7354, 5656,
+	2198, 1801, 6928, 5380, 3477, 1425, 1580, 5059, 7123, 4283,
+	5405, 6976, 2851, 3352, 3161, 4737, 1065, 2439, 6536, 3900,
+	2570, 2708, 6955, 5102, 501, 2042, 3887, 1153, 7734, 8033,
+	5394, 2539, 6577, 7595, 2146, 67, 4264, 5309, 3746, 4339,
+	7683, 7048, 180, 6530, 376, 3635, 2620, 2054, 5686, 3718, 856,
+	4477, 1928, 6140, 6056, 8110, 1674, 1666, 446, 6448, 592,
+	5113, 5147, 5651, 1080, 5646, 2534, 5333, 3910, 425, 777,
+	6114, 1124, 5300, 8093
+};
+
+int a_to_i[8192] = {
+	1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 1455,
+	2910, 5820, 2263, 4526, 1779, 3558, 7116, 4663, 449, 898,
+	1796, 3592, 7184, 7567, 7857, 6349, 5173, 3525, 7050, 4795,
+	217, 434, 868, 1736, 3472, 6944, 5103, 625, 1250, 2500, 5000,
+	703, 1406, 2812, 5624, 3679, 7358, 7379, 7177, 7613, 7893,
+	6149, 5541, 3813, 7626, 7739, 6617, 5661, 2453, 4906, 1019,
+	2038, 4076, 8152, 6687, 4497, 1677, 3354, 6708, 4551, 1569,
+	3138, 6276, 5287, 3297, 6594, 5675, 2553, 5106, 587, 1174,
+	2348, 4696, 287, 574, 1148, 2296, 4592, 1615, 3230, 6460,
+	6103, 2561, 5122, 3499, 6998, 4867, 937, 1874, 3748, 7496,
+	7999, 7121, 4621, 437, 874, 1748, 3496, 6992, 4879, 945, 1890,
+	3780, 7560, 7871, 6353, 5133, 3509, 7018, 4987, 857, 1714,
+	3428, 6856, 4159, 1489, 2978, 5956, 2855, 5710, 2355, 4710,
+	355, 710, 1420, 2840, 5680, 2511, 5022, 659, 1318, 2636, 5272,
+	3231, 6462, 6099, 2569, 5138, 3467, 6934, 4995, 681, 1362,
+	2724, 5448, 3903, 7806, 6483, 5897, 3005, 6010, 2907, 5814,
+	2243, 4486, 1699, 3398, 6796, 4279, 1217, 2434, 4868, 935,
+	1870, 3740, 7480, 8159, 6673, 4493, 1717, 3434, 6868, 4103,
+	1441, 2882, 5764, 2215, 4430, 1843, 3686, 7372, 7223, 7617,
+	7725, 6645, 5701, 2341, 4682, 315, 630, 1260, 2520, 5040, 719,
+	1438, 2876, 5752, 2399, 4798, 211, 422, 844, 1688, 3376, 6752,
+	4463, 1905, 3810, 7620, 7719, 6625, 5741, 2421, 4842, 123,
+	246, 492, 984, 1968, 3936, 7872, 6191, 5617, 3661, 7322, 7323,
+	7321, 7325, 7317, 7301, 7333, 7397, 7269, 7525, 8037, 7013,
+	4965, 869, 1738, 3476, 6952, 5119, 593, 1186, 2372, 4744, 191,
+	382, 764, 1528, 3056, 6112, 2671, 5342, 3091, 6182, 5603,
+	3689, 7378, 7179, 7609, 7901, 6165, 5509, 3749, 7498, 7995,
+	7129, 4637, 405, 810, 1620, 3240, 6480, 5903, 2993, 5986,
+	2923, 5846, 2051, 4102, 1443, 2886, 5772, 2231, 4462, 1907,
+	3814, 7628, 7735, 6593, 5677, 2549, 5098, 635, 1270, 2540,
+	5080, 543, 1086, 2172, 4344, 1119, 2238, 4476, 1879, 3758,
+	7516, 7959, 7041, 4781, 245, 490, 980, 1960, 3920, 7840, 6383,
+	5233, 3405, 6810, 4251, 1177, 2354, 4708, 359, 718, 1436,
+	2872, 5744, 2383, 4766, 147, 294, 588, 1176, 2352, 4704, 367,
+	734, 1468, 2936, 5872, 2127, 4254, 1171, 2342, 4684, 311, 622,
+	1244, 2488, 4976, 847, 1694, 3388, 6776, 4447, 1809, 3618,
+	7236, 7463, 8161, 6765, 4469, 1861, 3722, 7444, 8071, 6817,
+	4333, 1141, 2282, 4564, 1543, 3086, 6172, 5527, 3713, 7426,
+	8107, 6905, 4189, 1301, 2602, 5204, 3335, 6670, 4531, 1737,
+	3474, 6948, 5095, 609, 1218, 2436, 4872, 959, 1918, 3836,
+	7672, 7775, 6417, 6029, 2741, 5482, 3963, 7926, 6211, 5417,
+	4093, 8186, 6747, 4377, 1949, 3898, 7796, 6471, 5921, 3053,
+	6106, 2587, 5174, 3523, 7046, 4771, 233, 466, 932, 1864, 3728,
+	7456, 8175, 6769, 4429, 1845, 3690, 7380, 7175, 7585, 7917,
+	6261, 5445, 3877, 7754, 6459, 6105, 2589, 5178, 3547, 7094,
+	4803, 41, 82, 164, 328, 656, 1312, 2624, 5248, 3247, 6494,
+	5907, 2953, 5906, 2955, 5910, 2947, 5894, 2979, 5958, 2851,
+	5702, 2339, 4678, 291, 582, 1164, 2328, 4656, 463, 926, 1852,
+	3704, 7408, 7247, 7473, 8141, 6709, 4549, 1573, 3146, 6292,
+	5255, 3233, 6466, 5931, 3065, 6130, 2635, 5270, 3203, 6406,
+	6051, 2793, 5586, 3595, 7190, 7555, 7849, 6397, 5205, 3333,
+	6666, 4539, 1753, 3506, 7012, 4967, 865, 1730, 3460, 6920,
+	5055, 721, 1442, 2884, 5768, 2239, 4478, 1875, 3750, 7500,
+	7991, 7105, 4653, 501, 1002, 2004, 4008, 8016, 6927, 5041,
+	717, 1434, 2868, 5736, 2431, 4862, 83, 166, 332, 664, 1328,
+	2656, 5312, 3119, 6238, 5395, 3977, 7954, 7051, 4793, 221,
+	442, 884, 1768, 3536, 7072, 4847, 113, 226, 452, 904, 1808,
+	3616, 7232, 7471, 8177, 6733, 4405, 1989, 3978, 7956, 7047,
+	4769, 237, 474, 948, 1896, 3792, 7584, 7919, 6257, 5453, 3893,
+	7786, 6523, 5977, 2845, 5690, 2523, 5046, 707, 1414, 2828,
+	5656, 2463, 4926, 979, 1958, 3916, 7832, 6303, 5265, 3213,
+	6426, 6043, 2713, 5426, 4043, 8086, 6787, 4265, 1277, 2554,
+	5108, 583, 1166, 2332, 4664, 479, 958, 1916, 3832, 7664, 7759,
+	6449, 6093, 2613, 5226, 3451, 6902, 4163, 1321, 2642, 5284,
+	3303, 6606, 5683, 2505, 5010, 651, 1302, 2604, 5208, 3359,
+	6718, 4563, 1545, 3090, 6180, 5607, 3681, 7362, 7211, 7673,
+	7773, 6421, 6021, 2725, 5450, 3899, 7798, 6467, 5929, 3069,
+	6138, 2651, 5302, 3267, 6534, 5795, 2281, 4562, 1547, 3094,
+	6188, 5623, 3649, 7298, 7339, 7417, 7261, 7445, 8069, 6821,
+	4325, 1125, 2250, 4500, 1671, 3342, 6684, 4503, 1665, 3330,
+	6660, 4519, 1761, 3522, 7044, 4775, 225, 450, 900, 1800, 3600,
+	7200, 7663, 7793, 6477, 5941, 3013, 6026, 2747, 5494, 3907,
+	7814, 6307, 5353, 3197, 6394, 5211, 3353, 6706, 4555, 1593,
+	3186, 6372, 5223, 3425, 6850, 4139, 1529, 3058, 6116, 2663,
+	5326, 3123, 6246, 5475, 3945, 7890, 6155, 5561, 3805, 7610,
+	7899, 6169, 5533, 3733, 7466, 8187, 6745, 4381, 1941, 3882,
+	7764, 6407, 6049, 2797, 5594, 3611, 7222, 7619, 7721, 6653,
+	5717, 2309, 4618, 443, 886, 1772, 3544, 7088, 4815, 49, 98,
+	196, 392, 784, 1568, 3136, 6272, 5295, 3313, 6626, 5739, 2425,
+	4850, 75, 150, 300, 600, 1200, 2400, 4800, 47, 94, 188, 376,
+	752, 1504, 3008, 6016, 2735, 5470, 3859, 7718, 6627, 5737,
+	2429, 4858, 91, 182, 364, 728, 1456, 2912, 5824, 2095, 4190,
+	1299, 2598, 5196, 3383, 6766, 4467, 1865, 3730, 7460, 8167,
+	6753, 4461, 1909, 3818, 7636, 7687, 6561, 5869, 2165, 4330,
+	1147, 2294, 4588, 1655, 3310, 6620, 5655, 2433, 4866, 939,
+	1878, 3756, 7512, 7967, 7057, 4749, 181, 362, 724, 1448, 2896,
+	5792, 2287, 4574, 1555, 3110, 6220, 5431, 4033, 8066, 6827,
+	4345, 1117, 2234, 4468, 1863, 3726, 7452, 8087, 6785, 4269,
+	1269, 2538, 5076, 519, 1038, 2076, 4152, 1503, 3006, 6012,
+	2903, 5806, 2291, 4582, 1635, 3270, 6540, 5815, 2241, 4482,
+	1707, 3414, 6828, 4343, 1089, 2178, 4356, 1959, 3918, 7836,
+	6295, 5249, 3245, 6490, 5915, 2969, 5938, 3019, 6038, 2691,
+	5382, 4003, 8006, 6947, 5097, 637, 1274, 2548, 5096, 639,
+	1278, 2556, 5112, 607, 1214, 2428, 4856, 95, 190, 380, 760,
+	1520, 3040, 6080, 2607, 5214, 3347, 6694, 4579, 1641, 3282,
+	6564, 5863, 2145, 4290, 1067, 2134, 4268, 1271, 2542, 5084,
+	535, 1070, 2140, 4280, 1247, 2494, 4988, 855, 1710, 3420,
+	6840, 4319, 1041, 2082, 4164, 1319, 2638, 5276, 3223, 6446,
+	6131, 2633, 5266, 3211, 6422, 6019, 2729, 5458, 3851, 7702,
+	6531, 5801, 2301, 4602, 1627, 3254, 6508, 6007, 2881, 5762,
+	2219, 4438, 1795, 3590, 7180, 7607, 7873, 6189, 5621, 3653,
+	7306, 7355, 7385, 7197, 7573, 7813, 6309, 5349, 3173, 6346,
+	5179, 3545, 7090, 4811, 57, 114, 228, 456, 912, 1824, 3648,
+	7296, 7343, 7409, 7245, 7477, 8133, 6693, 4581, 1637, 3274,
+	6548, 5767, 2209, 4418, 1835, 3670, 7340, 7415, 7233, 7469,
+	8181, 6725, 4389, 2021, 4042, 8084, 6791, 4257, 1261, 2522,
+	5044, 711, 1422, 2844, 5688, 2527, 5054, 723, 1446, 2892,
+	5784, 2207, 4414, 2003, 4006, 8012, 6967, 5057, 557, 1114,
+	2228, 4456, 1919, 3838, 7676, 7767, 6401, 6061, 2805, 5610,
+	3707, 7414, 7235, 7465, 8189, 6741, 4357, 1957, 3914, 7828,
+	6279, 5281, 3309, 6618, 5659, 2457, 4914, 971, 1942, 3884,
+	7768, 6431, 6033, 2701, 5402, 3995, 7990, 7107, 4649, 509,
+	1018, 2036, 4072, 8144, 6671, 4529, 1741, 3482, 6964, 5063,
+	545, 1090, 2180, 4360, 1983, 3966, 7932, 6231, 5377, 4013,
+	8026, 6939, 5017, 669, 1338, 2676, 5352, 3199, 6398, 5203,
+	3337, 6674, 4491, 1721, 3442, 6884, 4199, 1377, 2754, 5508,
+	3751, 7502, 7987, 7113, 4669, 469, 938, 1876, 3752, 7504,
+	7951, 7089, 4813, 53, 106, 212, 424, 848, 1696, 3392, 6784,
+	4271, 1265, 2530, 5060, 551, 1102, 2204, 4408, 2015, 4030,
+	8060, 6999, 4865, 941, 1882, 3764, 7528, 8063, 6993, 4877,
+	949, 1898, 3796, 7592, 7935, 6225, 5389, 4021, 8042, 7035,
+	4953, 797, 1594, 3188, 6376, 5247, 3409, 6818, 4331, 1145,
+	2290, 4580, 1639, 3278, 6556, 5783, 2177, 4354, 1963, 3926,
+	7852, 6391, 5185, 3373, 6746, 4379, 1945, 3890, 7780, 6503,
+	5985, 2925, 5850, 2075, 4150, 1475, 2950, 5900, 2999, 5998,
+	2931, 5862, 2147, 4294, 1059, 2118, 4236, 1207, 2414, 4828,
+	23, 46, 92, 184, 368, 736, 1472, 2944, 5888, 2991, 5982, 2835,
+	5670, 2531, 5062, 547, 1094, 2188, 4376, 1951, 3902, 7804,
+	6487, 5889, 2989, 5978, 2843, 5686, 2499, 4998, 675, 1350,
+	2700, 5400, 3999, 7998, 7123, 4617, 445, 890, 1780, 3560,
+	7120, 4623, 433, 866, 1732, 3464, 6928, 5007, 689, 1378, 2756,
+	5512, 3775, 7550, 8019, 6921, 5053, 725, 1450, 2900, 5800,
+	2303, 4606, 1619, 3238, 6476, 5943, 3009, 6018, 2731, 5462,
+	3843, 7686, 6563, 5865, 2173, 4346, 1115, 2230, 4460, 1911,
+	3822, 7644, 7703, 6529, 5805, 2293, 4586, 1659, 3318, 6636,
+	5751, 2369, 4738, 171, 342, 684, 1368, 2736, 5472, 3951, 7902,
+	6163, 5513, 3773, 7546, 8027, 6937, 5021, 661, 1322, 2644,
+	5288, 3327, 6654, 5715, 2313, 4626, 395, 790, 1580, 3160,
+	6320, 5327, 3121, 6242, 5483, 3961, 7922, 6219, 5433, 4061,
+	8122, 6875, 4121, 1437, 2874, 5748, 2375, 4750, 179, 358, 716,
+	1432, 2864, 5728, 2415, 4830, 19, 38, 76, 152, 304, 608, 1216,
+	2432, 4864, 943, 1886, 3772, 7544, 8031, 6929, 5005, 693,
+	1386, 2772, 5544, 3839, 7678, 7763, 6409, 6077, 2773, 5546,
+	3835, 7670, 7747, 6441, 6141, 2645, 5290, 3323, 6646, 5699,
+	2345, 4690, 267, 534, 1068, 2136, 4272, 1231, 2462, 4924, 983,
+	1966, 3932, 7864, 6367, 5137, 3469, 6938, 5019, 665, 1330,
+	2660, 5320, 3135, 6270, 5459, 3849, 7698, 6539, 5817, 2269,
+	4538, 1755, 3510, 7020, 4983, 833, 1666, 3332, 6664, 4543,
+	1745, 3490, 6980, 4903, 993, 1986, 3972, 7944, 7103, 4817, 13,
+	26, 52, 104, 208, 416, 832, 1664, 3328, 6656, 4527, 1777,
+	3554, 7108, 4647, 481, 962, 1924, 3848, 7696, 6543, 5809,
+	2253, 4506, 1691, 3382, 6764, 4471, 1857, 3714, 7428, 8103,
+	6881, 4205, 1397, 2794, 5588, 3591, 7182, 7603, 7881, 6205,
+	5589, 3589, 7178, 7611, 7897, 6173, 5525, 3717, 7434, 8123,
+	6873, 4125, 1429, 2858, 5716, 2311, 4622, 435, 870, 1740,
+	3480, 6960, 5071, 561, 1122, 2244, 4488, 1727, 3454, 6908,
+	4183, 1281, 2562, 5124, 3495, 6990, 4915, 969, 1938, 3876,
+	7752, 6463, 6097, 2573, 5146, 3483, 6966, 5059, 553, 1106,
+	2212, 4424, 1855, 3710, 7420, 7255, 7425, 8109, 6901, 4165,
+	1317, 2634, 5268, 3207, 6414, 6067, 2761, 5522, 3723, 7446,
+	8067, 6825, 4349, 1109, 2218, 4436, 1799, 3598, 7196, 7575,
+	7809, 6317, 5365, 3141, 6282, 5307, 3289, 6578, 5835, 2105,
+	4210, 1355, 2710, 5420, 4087, 8174, 6771, 4425, 1853, 3706,
+	7412, 7239, 7457, 8173, 6773, 4421, 1829, 3658, 7316, 7303,
+	7329, 7405, 7285, 7493, 7973, 7141, 4709, 357, 714, 1428,
+	2856, 5712, 2319, 4638, 403, 806, 1612, 3224, 6448, 6095,
+	2609, 5218, 3435, 6870, 4099, 1449, 2898, 5796, 2279, 4558,
+	1587, 3174, 6348, 5175, 3521, 7042, 4779, 249, 498, 996, 1992,
+	3984, 7968, 7151, 4721, 333, 666, 1332, 2664, 5328, 3087,
+	6174, 5523, 3721, 7442, 8075, 6841, 4317, 1045, 2090, 4180,
+	1287, 2574, 5148, 3479, 6958, 5107, 585, 1170, 2340, 4680,
+	319, 638, 1276, 2552, 5104, 591, 1182, 2364, 4728, 351, 702,
+	1404, 2808, 5616, 3663, 7326, 7315, 7305, 7357, 7381, 7173,
+	7589, 7909, 6245, 5477, 3941, 7882, 6203, 5593, 3613, 7226,
+	7643, 7705, 6557, 5781, 2181, 4362, 1979, 3958, 7916, 6263,
+	5441, 3885, 7770, 6427, 6041, 2717, 5434, 4059, 8118, 6851,
+	4137, 1533, 3066, 6132, 2631, 5262, 3251, 6502, 5987, 2921,
+	5842, 2059, 4118, 1411, 2822, 5644, 2487, 4974, 883, 1766,
+	3532, 7064, 4767, 145, 290, 580, 1160, 2320, 4640, 495, 990,
+	1980, 3960, 7920, 6223, 5425, 4045, 8090, 6811, 4249, 1181,
+	2362, 4724, 327, 654, 1308, 2616, 5232, 3407, 6814, 4243,
+	1161, 2322, 4644, 487, 974, 1948, 3896, 7792, 6479, 5937,
+	3021, 6042, 2715, 5430, 4035, 8070, 6819, 4329, 1149, 2298,
+	4596, 1607, 3214, 6428, 6039, 2689, 5378, 4011, 8022, 6915,
+	5033, 765, 1530, 3060, 6120, 2687, 5374, 3155, 6310, 5347,
+	3177, 6354, 5131, 3513, 7026, 4939, 825, 1650, 3300, 6600,
+	5695, 2513, 5026, 747, 1494, 2988, 5976, 2847, 5694, 2515,
+	5030, 739, 1478, 2956, 5912, 2975, 5950, 3027, 6054, 2787,
+	5574, 3619, 7238, 7459, 8169, 6781, 4437, 1797, 3594, 7188,
+	7559, 7841, 6381, 5237, 3397, 6794, 4283, 1241, 2482, 4964,
+	871, 1742, 3484, 6968, 5087, 529, 1058, 2116, 4232, 1215,
+	2430, 4860, 87, 174, 348, 696, 1392, 2784, 5568, 3631, 7262,
+	7443, 8073, 6845, 4309, 1029, 2058, 4116, 1415, 2830, 5660,
+	2455, 4910, 1011, 2022, 4044, 8088, 6815, 4241, 1165, 2330,
+	4660, 455, 910, 1820, 3640, 7280, 7503, 7985, 7117, 4661, 453,
+	906, 1812, 3624, 7248, 7439, 8113, 6861, 4149, 1477, 2954,
+	5908, 2951, 5902, 2995, 5990, 2915, 5830, 2083, 4166, 1315,
+	2630, 5260, 3255, 6510, 6003, 2889, 5778, 2187, 4374, 1923,
+	3846, 7692, 6583, 5825, 2093, 4186, 1307, 2614, 5228, 3447,
+	6894, 4211, 1353, 2706, 5412, 4071, 8142, 6707, 4553, 1597,
+	3194, 6388, 5191, 3361, 6722, 4395, 2041, 4082, 8164, 6759,
+	4449, 1901, 3802, 7604, 7879, 6177, 5613, 3701, 7402, 7291,
+	7513, 7965, 7061, 4741, 165, 330, 660, 1320, 2640, 5280, 3311,
+	6622, 5651, 2441, 4882, 907, 1814, 3628, 7256, 7455, 8081,
+	6797, 4277, 1221, 2442, 4884, 903, 1806, 3612, 7224, 7647,
+	7697, 6541, 5813, 2245, 4490, 1723, 3446, 6892, 4215, 1345,
+	2690, 5380, 4007, 8014, 6963, 5065, 573, 1146, 2292, 4584,
+	1663, 3326, 6652, 5719, 2305, 4610, 427, 854, 1708, 3416,
+	6832, 4303, 1073, 2146, 4292, 1063, 2126, 4252, 1175, 2350,
+	4700, 279, 558, 1116, 2232, 4464, 1871, 3742, 7484, 8151,
+	6657, 4525, 1781, 3562, 7124, 4615, 417, 834, 1668, 3336,
+	6672, 4495, 1713, 3426, 6852, 4135, 1505, 3010, 6020, 2727,
+	5454, 3891, 7782, 6499, 5993, 2941, 5882, 2139, 4278, 1219,
+	2438, 4876, 951, 1902, 3804, 7608, 7903, 6161, 5517, 3765,
+	7530, 8059, 7001, 4893, 917, 1834, 3668, 7336, 7423, 7249,
+	7437, 8117, 6853, 4133, 1509, 3018, 6036, 2695, 5390, 4019,
+	8038, 7011, 4969, 893, 1786, 3572, 7144, 4735, 337, 674, 1348,
+	2696, 5392, 3983, 7966, 7059, 4745, 189, 378, 756, 1512, 3024,
+	6048, 2799, 5598, 3603, 7206, 7651, 7785, 6525, 5973, 2821,
+	5642, 2491, 4982, 835, 1670, 3340, 6680, 4511, 1681, 3362,
+	6724, 4391, 2017, 4034, 8068, 6823, 4321, 1133, 2266, 4532,
+	1735, 3470, 6940, 5015, 641, 1282, 2564, 5128, 3519, 7038,
+	4947, 777, 1554, 3108, 6216, 5439, 4049, 8098, 6891, 4217,
+	1373, 2746, 5492, 3911, 7822, 6323, 5321, 3133, 6266, 5467,
+	3865, 7730, 6603, 5689, 2525, 5050, 731, 1462, 2924, 5848,
+	2079, 4158, 1491, 2982, 5964, 2871, 5742, 2419, 4838, 99, 198,
+	396, 792, 1584, 3168, 6336, 5167, 3569, 7138, 4715, 377, 754,
+	1508, 3016, 6032, 2703, 5406, 3987, 7974, 7139, 4713, 381,
+	762, 1524, 3048, 6096, 2575, 5150, 3475, 6950, 5091, 617,
+	1234, 2468, 4936, 831, 1662, 3324, 6648, 5727, 2321, 4642,
+	491, 982, 1964, 3928, 7856, 6351, 5169, 3533, 7066, 4763, 153,
+	306, 612, 1224, 2448, 4896, 1007, 2014, 4028, 8056, 7007,
+	4881, 909, 1818, 3636, 7272, 7551, 8017, 6925, 5045, 709,
+	1418, 2836, 5672, 2559, 5118, 595, 1190, 2380, 4760, 159, 318,
+	636, 1272, 2544, 5088, 623, 1246, 2492, 4984, 863, 1726, 3452,
+	6904, 4191, 1297, 2594, 5188, 3367, 6734, 4403, 1993, 3986,
+	7972, 7143, 4705, 365, 730, 1460, 2920, 5840, 2063, 4126,
+	1427, 2854, 5708, 2359, 4718, 371, 742, 1484, 2968, 5936,
+	3023, 6046, 2707, 5414, 4067, 8134, 6691, 4585, 1661, 3322,
+	6644, 5703, 2337, 4674, 299, 598, 1196, 2392, 4784, 207, 414,
+	828, 1656, 3312, 6624, 5743, 2417, 4834, 107, 214, 428, 856,
+	1712, 3424, 6848, 4143, 1521, 3042, 6084, 2599, 5198, 3379,
+	6758, 4451, 1897, 3794, 7588, 7911, 6241, 5485, 3957, 7914,
+	6267, 5465, 3869, 7738, 6619, 5657, 2461, 4922, 987, 1974,
+	3948, 7896, 6175, 5521, 3725, 7450, 8091, 6809, 4253, 1173,
+	2346, 4692, 263, 526, 1052, 2104, 4208, 1359, 2718, 5436,
+	4055, 8110, 6899, 4169, 1341, 2682, 5364, 3143, 6286, 5299,
+	3273, 6546, 5771, 2233, 4466, 1867, 3734, 7468, 8183, 6721,
+	4397, 2037, 4074, 8148, 6663, 4513, 1773, 3546, 7092, 4807,
+	33, 66, 132, 264, 528, 1056, 2112, 4224, 1199, 2398, 4796,
+	215, 430, 860, 1720, 3440, 6880, 4207, 1393, 2786, 5572, 3623,
+	7246, 7475, 8137, 6717, 4565, 1541, 3082, 6164, 5511, 3745,
+	7490, 7979, 7161, 4701, 277, 554, 1108, 2216, 4432, 1807,
+	3614, 7228, 7639, 7681, 6573, 5877, 2117, 4234, 1211, 2422,
+	4844, 119, 238, 476, 952, 1904, 3808, 7616, 7727, 6641, 5709,
+	2357, 4714, 379, 758, 1516, 3032, 6064, 2767, 5534, 3731,
+	7462, 8163, 6761, 4477, 1877, 3754, 7508, 7943, 7073, 4845,
+	117, 234, 468, 936, 1872, 3744, 7488, 7983, 7153, 4685, 309,
+	618, 1236, 2472, 4944, 783, 1566, 3132, 6264, 5471, 3857,
+	7714, 6635, 5753, 2397, 4794, 219, 438, 876, 1752, 3504, 7008,
+	4975, 881, 1762, 3524, 7048, 4799, 209, 418, 836, 1672, 3344,
+	6688, 4591, 1649, 3298, 6596, 5671, 2529, 5058, 555, 1110,
+	2220, 4440, 1823, 3646, 7292, 7511, 7937, 7085, 4853, 69, 138,
+	276, 552, 1104, 2208, 4416, 1839, 3678, 7356, 7383, 7169,
+	7597, 7925, 6213, 5413, 4069, 8138, 6715, 4569, 1565, 3130,
+	6260, 5447, 3873, 7746, 6443, 6137, 2653, 5306, 3291, 6582,
+	5827, 2089, 4178, 1291, 2582, 5164, 3575, 7150, 4723, 329,
+	658, 1316, 2632, 5264, 3215, 6430, 6035, 2697, 5394, 3979,
+	7958, 7043, 4777, 253, 506, 1012, 2024, 4048, 8096, 6895,
+	4209, 1357, 2714, 5428, 4039, 8078, 6835, 4297, 1085, 2170,
+	4340, 1095, 2190, 4380, 1943, 3886, 7772, 6423, 6017, 2733,
+	5466, 3867, 7734, 6595, 5673, 2557, 5114, 603, 1206, 2412,
+	4824, 31, 62, 124, 248, 496, 992, 1984, 3968, 7936, 7087,
+	4849, 77, 154, 308, 616, 1232, 2464, 4928, 815, 1630, 3260,
+	6520, 5983, 2833, 5666, 2539, 5078, 515, 1030, 2060, 4120,
+	1439, 2878, 5756, 2391, 4782, 243, 486, 972, 1944, 3888, 7776,
+	6511, 6001, 2893, 5786, 2203, 4406, 1987, 3974, 7948, 7095,
+	4801, 45, 90, 180, 360, 720, 1440, 2880, 5760, 2223, 4446,
+	1811, 3622, 7244, 7479, 8129, 6701, 4597, 1605, 3210, 6420,
+	6023, 2721, 5442, 3883, 7766, 6403, 6057, 2813, 5626, 3675,
+	7350, 7363, 7209, 7677, 7765, 6405, 6053, 2789, 5578, 3643,
+	7286, 7491, 7977, 7165, 4693, 261, 522, 1044, 2088, 4176,
+	1295, 2590, 5180, 3543, 7086, 4851, 73, 146, 292, 584, 1168,
+	2336, 4672, 303, 606, 1212, 2424, 4848, 79, 158, 316, 632,
+	1264, 2528, 5056, 559, 1118, 2236, 4472, 1887, 3774, 7548,
+	8023, 6913, 5037, 757, 1514, 3028, 6056, 2815, 5630, 3667,
+	7334, 7395, 7273, 7549, 8021, 6917, 5029, 741, 1482, 2964,
+	5928, 3071, 6142, 2643, 5286, 3299, 6598, 5667, 2537, 5074,
+	523, 1046, 2092, 4184, 1311, 2622, 5244, 3415, 6830, 4339,
+	1097, 2194, 4388, 2023, 4046, 8092, 6807, 4225, 1197, 2394,
+	4788, 199, 398, 796, 1592, 3184, 6368, 5231, 3441, 6882, 4203,
+	1401, 2802, 5604, 3687, 7374, 7219, 7625, 7741, 6613, 5637,
+	2469, 4938, 827, 1654, 3308, 6616, 5663, 2449, 4898, 1003,
+	2006, 4012, 8024, 6943, 5009, 653, 1306, 2612, 5224, 3455,
+	6910, 4179, 1289, 2578, 5156, 3559, 7118, 4659, 457, 914,
+	1828, 3656, 7312, 7311, 7345, 7373, 7221, 7621, 7717, 6629,
+	5733, 2405, 4810, 59, 118, 236, 472, 944, 1888, 3776, 7552,
+	7855, 6385, 5197, 3381, 6762, 4475, 1881, 3762, 7524, 8039,
+	7009, 4973, 885, 1770, 3540, 7080, 4863, 81, 162, 324, 648,
+	1296, 2592, 5184, 3375, 6750, 4371, 1929, 3858, 7716, 6631,
+	5729, 2413, 4826, 27, 54, 108, 216, 432, 864, 1728, 3456,
+	6912, 5039, 753, 1506, 3012, 6024, 2751, 5502, 3923, 7846,
+	6371, 5225, 3453, 6906, 4187, 1305, 2610, 5220, 3431, 6862,
+	4147, 1481, 2962, 5924, 3047, 6094, 2611, 5222, 3427, 6854,
+	4131, 1513, 3026, 6052, 2791, 5582, 3635, 7270, 7523, 8041,
+	7037, 4949, 773, 1546, 3092, 6184, 5631, 3665, 7330, 7403,
+	7289, 7517, 7957, 7045, 4773, 229, 458, 916, 1832, 3664, 7328,
+	7407, 7281, 7501, 7989, 7109, 4645, 485, 970, 1940, 3880,
+	7760, 6415, 6065, 2765, 5530, 3739, 7478, 8131, 6697, 4605,
+	1621, 3242, 6484, 5895, 2977, 5954, 2859, 5718, 2307, 4614,
+	419, 838, 1676, 3352, 6704, 4559, 1585, 3170, 6340, 5159,
+	3553, 7106, 4651, 505, 1010, 2020, 4040, 8080, 6799, 4273,
+	1229, 2458, 4916, 967, 1934, 3868, 7736, 6623, 5649, 2445,
+	4890, 923, 1846, 3692, 7384, 7199, 7569, 7821, 6325, 5317,
+	3109, 6218, 5435, 4057, 8114, 6859, 4153, 1501, 3002, 6004,
+	2887, 5774, 2227, 4454, 1891, 3782, 7564, 7863, 6337, 5165,
+	3573, 7146, 4731, 345, 690, 1380, 2760, 5520, 3727, 7454,
+	8083, 6793, 4285, 1237, 2474, 4948, 775, 1550, 3100, 6200,
+	5599, 3601, 7202, 7659, 7801, 6493, 5909, 2949, 5898, 3003,
+	6006, 2883, 5766, 2211, 4422, 1827, 3654, 7308, 7351, 7361,
+	7213, 7669, 7749, 6437, 6117, 2661, 5322, 3131, 6262, 5443,
+	3881, 7762, 6411, 6073, 2781, 5562, 3803, 7606, 7875, 6185,
+	5629, 3669, 7338, 7419, 7257, 7453, 8085, 6789, 4261, 1253,
+	2506, 5012, 647, 1294, 2588, 5176, 3551, 7102, 4819, 9, 18,
+	36, 72, 144, 288, 576, 1152, 2304, 4608, 431, 862, 1724, 3448,
+	6896, 4175, 1329, 2658, 5316, 3111, 6222, 5427, 4041, 8082,
+	6795, 4281, 1245, 2490, 4980, 839, 1678, 3356, 6712, 4575,
+	1553, 3106, 6212, 5415, 4065, 8130, 6699, 4601, 1629, 3258,
+	6516, 5959, 2849, 5698, 2347, 4694, 259, 518, 1036, 2072,
+	4144, 1487, 2974, 5948, 3031, 6062, 2803, 5606, 3683, 7366,
+	7203, 7657, 7805, 6485, 5893, 2981, 5962, 2875, 5750, 2371,
+	4742, 163, 326, 652, 1304, 2608, 5216, 3439, 6878, 4115, 1417,
+	2834, 5668, 2535, 5070, 563, 1126, 2252, 4504, 1695, 3390,
+	6780, 4439, 1793, 3586, 7172, 7591, 7905, 6253, 5493, 3909,
+	7818, 6331, 5337, 3101, 6202, 5595, 3609, 7218, 7627, 7737,
+	6621, 5653, 2437, 4874, 955, 1910, 3820, 7640, 7711, 6545,
+	5773, 2229, 4458, 1915, 3830, 7660, 7799, 6465, 5933, 3061,
+	6122, 2683, 5366, 3139, 6278, 5283, 3305, 6610, 5643, 2489,
+	4978, 843, 1686, 3372, 6744, 4383, 1937, 3874, 7748, 6439,
+	6113, 2669, 5338, 3099, 6198, 5571, 3625, 7250, 7435, 8121,
+	6877, 4117, 1413, 2826, 5652, 2439, 4878, 947, 1894, 3788,
+	7576, 7839, 6289, 5261, 3253, 6506, 6011, 2905, 5810, 2251,
+	4502, 1667, 3334, 6668, 4535, 1729, 3458, 6916, 5031, 737,
+	1474, 2948, 5896, 3007, 6014, 2899, 5798, 2275, 4550, 1571,
+	3142, 6284, 5303, 3265, 6530, 5803, 2297, 4594, 1611, 3222,
+	6444, 6135, 2625, 5250, 3243, 6486, 5891, 2985, 5970, 2827,
+	5654, 2435, 4870, 931, 1862, 3724, 7448, 8095, 6801, 4237,
+	1205, 2410, 4820, 7, 14, 28, 56, 112, 224, 448, 896, 1792,
+	3584, 7168, 7599, 7921, 6221, 5429, 4037, 8074, 6843, 4313,
+	1053, 2106, 4212, 1351, 2702, 5404, 3991, 7982, 7155, 4681,
+	317, 634, 1268, 2536, 5072, 527, 1054, 2108, 4216, 1375, 2750,
+	5500, 3927, 7854, 6387, 5193, 3389, 6778, 4443, 1817, 3634,
+	7268, 7527, 8033, 7021, 4981, 837, 1674, 3348, 6696, 4607,
+	1617, 3234, 6468, 5927, 3041, 6082, 2603, 5206, 3331, 6662,
+	4515, 1769, 3538, 7076, 4839, 97, 194, 388, 776, 1552, 3104,
+	6208, 5423, 4081, 8162, 6763, 4473, 1885, 3770, 7540, 8007,
+	6945, 5101, 629, 1258, 2516, 5032, 767, 1534, 3068, 6136,
+	2655, 5310, 3283, 6566, 5859, 2153, 4306, 1035, 2070, 4140,
+	1527, 3054, 6108, 2583, 5166, 3571, 7142, 4707, 361, 722,
+	1444, 2888, 5776, 2191, 4382, 1939, 3878, 7756, 6455, 6081,
+	2605, 5210, 3355, 6710, 4547, 1577, 3154, 6308, 5351, 3169,
+	6338, 5163, 3577, 7154, 4683, 313, 626, 1252, 2504, 5008, 655,
+	1310, 2620, 5240, 3423, 6846, 4307, 1033, 2066, 4132, 1511,
+	3022, 6044, 2711, 5422, 4083, 8166, 6755, 4457, 1917, 3834,
+	7668, 7751, 6433, 6125, 2677, 5354, 3195, 6390, 5187, 3369,
+	6738, 4363, 1977, 3954, 7908, 6247, 5473, 3949, 7898, 6171,
+	5529, 3741, 7482, 8155, 6681, 4509, 1685, 3370, 6740, 4359,
+	1953, 3906, 7812, 6311, 5345, 3181, 6362, 5147, 3481, 6962,
+	5067, 569, 1138, 2276, 4552, 1599, 3198, 6396, 5207, 3329,
+	6658, 4523, 1785, 3570, 7140, 4711, 353, 706, 1412, 2824,
+	5648, 2447, 4894, 915, 1830, 3660, 7320, 7327, 7313, 7309,
+	7349, 7365, 7205, 7653, 7781, 6501, 5989, 2917, 5834, 2107,
+	4214, 1347, 2694, 5388, 4023, 8046, 7027, 4937, 829, 1658,
+	3316, 6632, 5759, 2385, 4770, 235, 470, 940, 1880, 3760, 7520,
+	8047, 7025, 4941, 821, 1642, 3284, 6568, 5887, 2129, 4258,
+	1259, 2518, 5036, 759, 1518, 3036, 6072, 2783, 5566, 3795,
+	7590, 7907, 6249, 5501, 3925, 7850, 6395, 5209, 3357, 6714,
+	4571, 1561, 3122, 6244, 5479, 3937, 7874, 6187, 5625, 3677,
+	7354, 7387, 7193, 7581, 7829, 6277, 5285, 3301, 6602, 5691,
+	2521, 5042, 715, 1430, 2860, 5720, 2335, 4670, 467, 934, 1868,
+	3736, 7472, 8143, 6705, 4557, 1589, 3178, 6356, 5127, 3489,
+	6978, 4907, 1017, 2034, 4068, 8136, 6719, 4561, 1549, 3098,
+	6196, 5575, 3617, 7234, 7467, 8185, 6749, 4373, 1925, 3850,
+	7700, 6535, 5793, 2285, 4570, 1563, 3126, 6252, 5495, 3905,
+	7810, 6315, 5369, 3165, 6330, 5339, 3097, 6194, 5579, 3641,
+	7282, 7499, 7993, 7133, 4629, 389, 778, 1556, 3112, 6224,
+	5391, 4017, 8034, 7019, 4985, 861, 1722, 3444, 6888, 4223,
+	1361, 2722, 5444, 3879, 7758, 6451, 6089, 2621, 5242, 3419,
+	6838, 4291, 1065, 2130, 4260, 1255, 2510, 5020, 663, 1326,
+	2652, 5304, 3295, 6590, 5843, 2057, 4114, 1419, 2838, 5676,
+	2551, 5102, 627, 1254, 2508, 5016, 671, 1342, 2684, 5368,
+	3167, 6334, 5331, 3081, 6162, 5515, 3769, 7538, 8011, 6969,
+	5085, 533, 1066, 2132, 4264, 1279, 2558, 5116, 599, 1198,
+	2396, 4792, 223, 446, 892, 1784, 3568, 7136, 4719, 369, 738,
+	1476, 2952, 5904, 2959, 5918, 2963, 5926, 3043, 6086, 2595,
+	5190, 3363, 6726, 4387, 2025, 4050, 8100, 6887, 4193, 1389,
+	2778, 5556, 3783, 7566, 7859, 6345, 5181, 3541, 7082, 4859,
+	89, 178, 356, 712, 1424, 2848, 5696, 2351, 4702, 275, 550,
+	1100, 2200, 4400, 1999, 3998, 7996, 7127, 4609, 429, 858,
+	1716, 3432, 6864, 4111, 1457, 2914, 5828, 2087, 4174, 1331,
+	2662, 5324, 3127, 6254, 5491, 3913, 7826, 6283, 5305, 3293,
+	6586, 5851, 2073, 4146, 1483, 2966, 5932, 3063, 6126, 2675,
+	5350, 3171, 6342, 5155, 3561, 7122, 4619, 441, 882, 1764,
+	3528, 7056, 4751, 177, 354, 708, 1416, 2832, 5664, 2543, 5086,
+	531, 1062, 2124, 4248, 1183, 2366, 4732, 343, 686, 1372, 2744,
+	5488, 3919, 7838, 6291, 5257, 3261, 6522, 5979, 2841, 5682,
+	2507, 5014, 643, 1286, 2572, 5144, 3487, 6974, 5075, 521,
+	1042, 2084, 4168, 1343, 2686, 5372, 3159, 6318, 5363, 3145,
+	6290, 5259, 3257, 6514, 5963, 2873, 5746, 2379, 4758, 131,
+	262, 524, 1048, 2096, 4192, 1391, 2782, 5564, 3799, 7598,
+	7923, 6217, 5437, 4053, 8106, 6907, 4185, 1309, 2618, 5236,
+	3399, 6798, 4275, 1225, 2450, 4900, 999, 1998, 3996, 7992,
+	7135, 4625, 397, 794, 1588, 3176, 6352, 5135, 3505, 7010,
+	4971, 889, 1778, 3556, 7112, 4671, 465, 930, 1860, 3720, 7440,
+	8079, 6833, 4301, 1077, 2154, 4308, 1031, 2062, 4124, 1431,
+	2862, 5724, 2327, 4654, 499, 998, 1996, 3992, 7984, 7119,
+	4657, 461, 922, 1844, 3688, 7376, 7183, 7601, 7885, 6197,
+	5573, 3621, 7242, 7483, 8153, 6685, 4501, 1669, 3338, 6676,
+	4487, 1697, 3394, 6788, 4263, 1249, 2498, 4996, 679, 1358,
+	2716, 5432, 4063, 8126, 6867, 4105, 1469, 2938, 5876, 2119,
+	4238, 1203, 2406, 4812, 55, 110, 220, 440, 880, 1760, 3520,
+	7040, 4783, 241, 482, 964, 1928, 3856, 7712, 6639, 5745, 2381,
+	4762, 155, 310, 620, 1240, 2480, 4960, 879, 1758, 3516, 7032,
+	4959, 785, 1570, 3140, 6280, 5311, 3281, 6562, 5867, 2169,
+	4338, 1099, 2198, 4396, 2039, 4078, 8156, 6679, 4481, 1709,
+	3418, 6836, 4295, 1057, 2114, 4228, 1191, 2382, 4764, 151,
+	302, 604, 1208, 2416, 4832, 111, 222, 444, 888, 1776, 3552,
+	7104, 4655, 497, 994, 1988, 3976, 7952, 7055, 4785, 205, 410,
+	820, 1640, 3280, 6560, 5871, 2161, 4322, 1131, 2262, 4524,
+	1783, 3566, 7132, 4631, 385, 770, 1540, 3080, 6160, 5519,
+	3761, 7522, 8043, 7033, 4957, 789, 1578, 3156, 6312, 5375,
+	3153, 6306, 5355, 3193, 6386, 5195, 3385, 6770, 4427, 1849,
+	3698, 7396, 7271, 7521, 8045, 7029, 4933, 805, 1610, 3220,
+	6440, 6143, 2641, 5282, 3307, 6614, 5635, 2473, 4946, 779,
+	1558, 3116, 6232, 5407, 3985, 7970, 7147, 4729, 349, 698,
+	1396, 2792, 5584, 3599, 7198, 7571, 7817, 6333, 5333, 3077,
+	6154, 5563, 3801, 7602, 7883, 6201, 5597, 3605, 7210, 7675,
+	7769, 6429, 6037, 2693, 5386, 4027, 8054, 6979, 4905, 1021,
+	2042, 4084, 8168, 6783, 4433, 1805, 3610, 7220, 7623, 7713,
+	6637, 5749, 2373, 4746, 187, 374, 748, 1496, 2992, 5984, 2927,
+	5854, 2067, 4134, 1507, 3014, 6028, 2743, 5486, 3955, 7910,
+	6243, 5481, 3965, 7930, 6235, 5401, 3997, 7994, 7131, 4633,
+	413, 826, 1652, 3304, 6608, 5647, 2481, 4962, 875, 1750, 3500,
+	7000, 4895, 913, 1826, 3652, 7304, 7359, 7377, 7181, 7605,
+	7877, 6181, 5605, 3685, 7370, 7227, 7641, 7709, 6549, 5765,
+	2213, 4426, 1851, 3702, 7404, 7287, 7489, 7981, 7157, 4677,
+	293, 586, 1172, 2344, 4688, 271, 542, 1084, 2168, 4336, 1103,
+	2206, 4412, 2007, 4014, 8028, 6935, 4993, 685, 1370, 2740,
+	5480, 3967, 7934, 6227, 5385, 4029, 8058, 7003, 4889, 925,
+	1850, 3700, 7400, 7295, 7505, 7949, 7093, 4805, 37, 74, 148,
+	296, 592, 1184, 2368, 4736, 175, 350, 700, 1400, 2800, 5600,
+	3695, 7390, 7187, 7561, 7869, 6357, 5125, 3493, 6986, 4923,
+	985, 1970, 3940, 7880, 6207, 5585, 3597, 7194, 7579, 7833,
+	6301, 5269, 3205, 6410, 6075, 2777, 5554, 3787, 7574, 7811,
+	6313, 5373, 3157, 6314, 5371, 3161, 6322, 5323, 3129, 6258,
+	5451, 3897, 7794, 6475, 5945, 3037, 6074, 2779, 5558, 3779,
+	7558, 7843, 6377, 5245, 3413, 6826, 4347, 1113, 2226, 4452,
+	1895, 3790, 7580, 7831, 6273, 5293, 3317, 6634, 5755, 2393,
+	4786, 203, 406, 812, 1624, 3248, 6496, 5999, 2929, 5858, 2155,
+	4310, 1027, 2054, 4108, 1463, 2926, 5852, 2071, 4142, 1523,
+	3046, 6092, 2615, 5230, 3443, 6886, 4195, 1385, 2770, 5540,
+	3815, 7630, 7731, 6601, 5693, 2517, 5034, 763, 1526, 3052,
+	6104, 2591, 5182, 3539, 7078, 4835, 105, 210, 420, 840, 1680,
+	3360, 6720, 4399, 2033, 4066, 8132, 6695, 4577, 1645, 3290,
+	6580, 5831, 2081, 4162, 1323, 2646, 5292, 3319, 6638, 5747,
+	2377, 4754, 139, 278, 556, 1112, 2224, 4448, 1903, 3806, 7612,
+	7895, 6145, 5549, 3829, 7658, 7803, 6489, 5917, 2965, 5930,
+	3067, 6134, 2627, 5254, 3235, 6470, 5923, 3049, 6098, 2571,
+	5142, 3459, 6918, 5027, 745, 1490, 2980, 5960, 2879, 5758,
+	2387, 4774, 227, 454, 908, 1816, 3632, 7264, 7535, 8049, 6989,
+	4917, 965, 1930, 3860, 7720, 6655, 5713, 2317, 4634, 411, 822,
+	1644, 3288, 6576, 5839, 2097, 4194, 1387, 2774, 5548, 3831,
+	7662, 7795, 6473, 5949, 3029, 6058, 2811, 5622, 3651, 7302,
+	7331, 7401, 7293, 7509, 7941, 7077, 4837, 101, 202, 404, 808,
+	1616, 3232, 6464, 5935, 3057, 6114, 2667, 5334, 3075, 6150,
+	5539, 3817, 7634, 7691, 6585, 5853, 2069, 4138, 1531, 3062,
+	6124, 2679, 5358, 3187, 6374, 5219, 3433, 6866, 4107, 1465,
+	2930, 5860, 2151, 4302, 1075, 2150, 4300, 1079, 2158, 4316,
+	1047, 2094, 4188, 1303, 2606, 5212, 3351, 6702, 4595, 1609,
+	3218, 6436, 6119, 2657, 5314, 3115, 6230, 5379, 4009, 8018,
+	6923, 5049, 733, 1466, 2932, 5864, 2175, 4350, 1107, 2214,
+	4428, 1847, 3694, 7388, 7191, 7553, 7853, 6389, 5189, 3365,
+	6730, 4411, 2009, 4018, 8036, 7015, 4961, 877, 1754, 3508,
+	7016, 4991, 849, 1698, 3396, 6792, 4287, 1233, 2466, 4932,
+	807, 1614, 3228, 6456, 6111, 2577, 5154, 3563, 7126, 4611,
+	425, 850, 1700, 3400, 6800, 4239, 1201, 2402, 4804, 39, 78,
+	156, 312, 624, 1248, 2496, 4992, 687, 1374, 2748, 5496, 3935,
+	7870, 6355, 5129, 3517, 7034, 4955, 793, 1586, 3172, 6344,
+	5183, 3537, 7074, 4843, 121, 242, 484, 968, 1936, 3872, 7744,
+	6447, 6129, 2637, 5274, 3227, 6454, 6083, 2601, 5202, 3339,
+	6678, 4483, 1705, 3410, 6820, 4327, 1121, 2242, 4484, 1703,
+	3406, 6812, 4247, 1153, 2306, 4612, 423, 846, 1692, 3384,
+	6768, 4431, 1841, 3682, 7364, 7207, 7649, 7789, 6517, 5957,
+	2853, 5706, 2363, 4726, 323, 646, 1292, 2584, 5168, 3535,
+	7070, 4755, 137, 274, 548, 1096, 2192, 4384, 2031, 4062, 8124,
+	6871, 4097, 1453, 2906, 5812, 2247, 4494, 1715, 3430, 6860,
+	4151, 1473, 2946, 5892, 2983, 5966, 2867, 5734, 2403, 4806,
+	35, 70, 140, 280, 560, 1120, 2240, 4480, 1711, 3422, 6844,
+	4311, 1025, 2050, 4100, 1447, 2894, 5788, 2199, 4398, 2035,
+	4070, 8140, 6711, 4545, 1581, 3162, 6324, 5319, 3105, 6210,
+	5419, 4089, 8178, 6731, 4409, 2013, 4026, 8052, 6983, 4897,
+	1005, 2010, 4020, 8040, 7039, 4945, 781, 1562, 3124, 6248,
+	5503, 3921, 7842, 6379, 5241, 3421, 6842, 4315, 1049, 2098,
+	4196, 1383, 2766, 5532, 3735, 7470, 8179, 6729, 4413, 2005,
+	4010, 8020, 6919, 5025, 749, 1498, 2996, 5992, 2943, 5886,
+	2131, 4262, 1251, 2502, 5004, 695, 1390, 2780, 5560, 3807,
+	7614, 7891, 6153, 5565, 3797, 7594, 7931, 6233, 5405, 3989,
+	7978, 7163, 4697, 285, 570, 1140, 2280, 4560, 1551, 3102,
+	6204, 5591, 3585, 7170, 7595, 7929, 6237, 5397, 3973, 7946,
+	7099, 4825, 29, 58, 116, 232, 464, 928, 1856, 3712, 7424,
+	8111, 6897, 4173, 1333, 2666, 5332, 3079, 6158, 5555, 3785,
+	7570, 7819, 6329, 5341, 3093, 6186, 5627, 3673, 7346, 7371,
+	7225, 7645, 7701, 6533, 5797, 2277, 4554, 1595, 3190, 6380,
+	5239, 3393, 6786, 4267, 1273, 2546, 5092, 615, 1230, 2460,
+	4920, 991, 1982, 3964, 7928, 6239, 5393, 3981, 7962, 7067,
+	4761, 157, 314, 628, 1256, 2512, 5024, 751, 1502, 3004, 6008,
+	2911, 5822, 2259, 4518, 1763, 3526, 7052, 4791, 193, 386, 772,
+	1544, 3088, 6176, 5615, 3697, 7394, 7275, 7545, 8029, 6933,
+	4997, 677, 1354, 2708, 5416, 4095, 8190, 6739, 4361, 1981,
+	3962, 7924, 6215, 5409, 4077, 8154, 6683, 4505, 1693, 3386,
+	6772, 4423, 1825, 3650, 7300, 7335, 7393, 7277, 7541, 8005,
+	6949, 5093, 613, 1226, 2452, 4904, 1023, 2046, 4092, 8184,
+	6751, 4369, 1933, 3866, 7732, 6599, 5665, 2541, 5082, 539,
+	1078, 2156, 4312, 1055, 2110, 4220, 1367, 2734, 5468, 3863,
+	7726, 6643, 5705, 2365, 4730, 347, 694, 1388, 2776, 5552,
+	3791, 7582, 7827, 6281, 5309, 3285, 6570, 5883, 2137, 4274,
+	1227, 2454, 4908, 1015, 2030, 4060, 8120, 6879, 4113, 1421,
+	2842, 5684, 2503, 5006, 691, 1382, 2764, 5528, 3743, 7486,
+	8147, 6665, 4541, 1749, 3498, 6996, 4871, 929, 1858, 3716,
+	7432, 8127, 6865, 4109, 1461, 2922, 5844, 2055, 4110, 1459,
+	2918, 5836, 2103, 4206, 1395, 2790, 5580, 3639, 7278, 7539,
+	8009, 6973, 5077, 517, 1034, 2068, 4136, 1535, 3070, 6140,
+	2647, 5294, 3315, 6630, 5731, 2409, 4818, 11, 22, 44, 88, 176,
+	352, 704, 1408, 2816, 5632, 2479, 4958, 787, 1574, 3148, 6296,
+	5279, 3217, 6434, 6123, 2681, 5362, 3147, 6294, 5251, 3241,
+	6482, 5899, 3001, 6002, 2891, 5782, 2179, 4358, 1955, 3910,
+	7820, 6327, 5313, 3117, 6234, 5403, 3993, 7986, 7115, 4665,
+	477, 954, 1908, 3816, 7632, 7695, 6577, 5837, 2101, 4202,
+	1403, 2806, 5612, 3703, 7406, 7283, 7497, 7997, 7125, 4613,
+	421, 842, 1684, 3368, 6736, 4367, 1969, 3938, 7876, 6183,
+	5601, 3693, 7386, 7195, 7577, 7837, 6293, 5253, 3237, 6474,
+	5947, 3033, 6066, 2763, 5526, 3715, 7430, 8099, 6889, 4221,
+	1365, 2730, 5460, 3847, 7694, 6579, 5833, 2109, 4218, 1371,
+	2742, 5484, 3959, 7918, 6259, 5449, 3901, 7802, 6491, 5913,
+	2973, 5946, 3035, 6070, 2755, 5510, 3747, 7494, 7971, 7145,
+	4733, 341, 682, 1364, 2728, 5456, 3855, 7710, 6547, 5769,
+	2237, 4474, 1883, 3766, 7532, 8055, 6977, 4909, 1013, 2026,
+	4052, 8104, 6911, 4177, 1293, 2586, 5172, 3527, 7054, 4787,
+	201, 402, 804, 1608, 3216, 6432, 6127, 2673, 5346, 3179, 6358,
+	5123, 3497, 6994, 4875, 953, 1906, 3812, 7624, 7743, 6609,
+	5645, 2485, 4970, 891, 1782, 3564, 7128, 4639, 401, 802, 1604,
+	3208, 6416, 6031, 2737, 5474, 3947, 7894, 6147, 5545, 3837,
+	7674, 7771, 6425, 6045, 2709, 5418, 4091, 8182, 6723, 4393,
+	2045, 4090, 8180, 6727, 4385, 2029, 4058, 8116, 6855, 4129,
+	1517, 3034, 6068, 2759, 5518, 3763, 7526, 8035, 7017, 4989,
+	853, 1706, 3412, 6824, 4351, 1105, 2210, 4420, 1831, 3662,
+	7324, 7319, 7297, 7341, 7413, 7237, 7461, 8165, 6757, 4453,
+	1893, 3786, 7572, 7815, 6305, 5357, 3189, 6378, 5243, 3417,
+	6834, 4299, 1081, 2162, 4324, 1127, 2254, 4508, 1687, 3374,
+	6748, 4375, 1921, 3842, 7684, 6567, 5857, 2157, 4314, 1051,
+	2102, 4204, 1399, 2798, 5596, 3607, 7214, 7667, 7753, 6461,
+	6101, 2565, 5130, 3515, 7030, 4931, 809, 1618, 3236, 6472,
+	5951, 3025, 6050, 2795, 5590, 3587, 7174, 7587, 7913, 6269,
+	5461, 3845, 7690, 6587, 5849, 2077, 4154, 1499, 2998, 5996,
+	2935, 5870, 2163, 4326, 1123, 2246, 4492, 1719, 3438, 6876,
+	4119, 1409, 2818, 5636, 2471, 4942, 819, 1638, 3276, 6552,
+	5791, 2193, 4386, 2027, 4054, 8108, 6903, 4161, 1325, 2650,
+	5300, 3271, 6542, 5811, 2249, 4498, 1675, 3350, 6700, 4599,
+	1601, 3202, 6404, 6055, 2785, 5570, 3627, 7254, 7427, 8105,
+	6909, 4181, 1285, 2570, 5140, 3463, 6926, 5043, 713, 1426,
+	2852, 5704, 2367, 4734, 339, 678, 1356, 2712, 5424, 4047,
+	8094, 6803, 4233, 1213, 2426, 4852, 71, 142, 284, 568, 1136,
+	2272, 4544, 1583, 3166, 6332, 5335, 3073, 6146, 5547, 3833,
+	7666, 7755, 6457, 6109, 2581, 5162, 3579, 7158, 4675, 297,
+	594, 1188, 2376, 4752, 143, 286, 572, 1144, 2288, 4576, 1647,
+	3294, 6588, 5847, 2049, 4098, 1451, 2902, 5804, 2295, 4590,
+	1651, 3302, 6604, 5687, 2497, 4994, 683, 1366, 2732, 5464,
+	3871, 7742, 6611, 5641, 2493, 4986, 859, 1718, 3436, 6872,
+	4127, 1425, 2850, 5700, 2343, 4686, 307, 614, 1228, 2456,
+	4912, 975, 1950, 3900, 7800, 6495, 5905, 2957, 5914, 2971,
+	5942, 3011, 6022, 2723, 5446, 3875, 7750, 6435, 6121, 2685,
+	5370, 3163, 6326, 5315, 3113, 6226, 5387, 4025, 8050, 6987,
+	4921, 989, 1978, 3956, 7912, 6271, 5457, 3853, 7706, 6555,
+	5785, 2205, 4410, 2011, 4022, 8044, 7031, 4929, 813, 1626,
+	3252, 6504, 6015, 2897, 5794, 2283, 4566, 1539, 3078, 6156,
+	5559, 3777, 7554, 7851, 6393, 5213, 3349, 6698, 4603, 1625,
+	3250, 6500, 5991, 2913, 5826, 2091, 4182, 1283, 2566, 5132,
+	3511, 7022, 4979, 841, 1682, 3364, 6728, 4415, 2001, 4002,
+	8004, 6951, 5089, 621, 1242, 2484, 4968, 895, 1790, 3580,
+	7160, 4703, 273, 546, 1092, 2184, 4368, 1935, 3870, 7740,
+	6615, 5633, 2477, 4954, 795, 1590, 3180, 6360, 5151, 3473,
+	6946, 5099, 633, 1266, 2532, 5064, 575, 1150, 2300, 4600,
+	1631, 3262, 6524, 5975, 2817, 5634, 2475, 4950, 771, 1542,
+	3084, 6168, 5535, 3729, 7458, 8171, 6777, 4445, 1813, 3626,
+	7252, 7431, 8097, 6893, 4213, 1349, 2698, 5396, 3975, 7950,
+	7091, 4809, 61, 122, 244, 488, 976, 1952, 3904, 7808, 6319,
+	5361, 3149, 6298, 5275, 3225, 6450, 6091, 2617, 5234, 3403,
+	6806, 4227, 1193, 2386, 4772, 231, 462, 924, 1848, 3696, 7392,
+	7279, 7537, 8013, 6965, 5061, 549, 1098, 2196, 4392, 2047,
+	4094, 8188, 6743, 4353, 1965, 3930, 7860, 6343, 5153, 3565,
+	7130, 4635, 409, 818, 1636, 3272, 6544, 5775, 2225, 4450,
+	1899, 3798, 7596, 7927, 6209, 5421, 4085, 8170, 6779, 4441,
+	1821, 3642, 7284, 7495, 7969, 7149, 4725, 325, 650, 1300,
+	2600, 5200, 3343, 6686, 4499, 1673, 3346, 6692, 4583, 1633,
+	3266, 6532, 5799, 2273, 4546, 1579, 3158, 6316, 5367, 3137,
+	6274, 5291, 3321, 6642, 5707, 2361, 4722, 331, 662, 1324,
+	2648, 5296, 3279, 6558, 5779, 2185, 4370, 1931, 3862, 7724,
+	6647, 5697, 2349, 4698, 283, 566, 1132, 2264, 4528, 1743,
+	3486, 6972, 5079, 513, 1026, 2052, 4104, 1471, 2942, 5884,
+	2135, 4270, 1267, 2534, 5068, 567, 1134, 2268, 4536, 1759,
+	3518, 7036, 4951, 769, 1538, 3076, 6152, 5567, 3793, 7586,
+	7915, 6265, 5469, 3861, 7722, 6651, 5721, 2333, 4666, 475,
+	950, 1900, 3800, 7600, 7887, 6193, 5581, 3637, 7274, 7547,
+	8025, 6941, 5013, 645, 1290, 2580, 5160, 3583, 7166, 4691,
+	265, 530, 1060, 2120, 4240, 1167, 2334, 4668, 471, 942, 1884,
+	3768, 7536, 8015, 6961, 5069, 565, 1130, 2260, 4520, 1791,
+	3582, 7164, 4695, 257, 514, 1028, 2056, 4112, 1423, 2846,
+	5692, 2519, 5038, 755, 1510, 3020, 6040, 2719, 5438, 4051,
+	8102, 6883, 4201, 1405, 2810, 5620, 3655, 7310, 7347, 7369,
+	7229, 7637, 7685, 6565, 5861, 2149, 4298, 1083, 2166, 4332,
+	1143, 2286, 4572, 1559, 3118, 6236, 5399, 3969, 7938, 7083,
+	4857, 93, 186, 372, 744, 1488, 2976, 5952, 2863, 5726, 2323,
+	4646, 483, 966, 1932, 3864, 7728, 6607, 5681, 2509, 5018, 667,
+	1334, 2668, 5336, 3103, 6206, 5587, 3593, 7186, 7563, 7865,
+	6365, 5141, 3461, 6922, 5051, 729, 1458, 2916, 5832, 2111,
+	4222, 1363, 2726, 5452, 3895, 7790, 6515, 5961, 2877, 5754,
+	2395, 4790, 195, 390, 780, 1560, 3120, 6240, 5487, 3953, 7906,
+	6251, 5497, 3933, 7866, 6363, 5145, 3485, 6970, 5083, 537,
+	1074, 2148, 4296, 1087, 2174, 4348, 1111, 2222, 4444, 1815,
+	3630, 7260, 7447, 8065, 6829, 4341, 1093, 2186, 4372, 1927,
+	3854, 7708, 6551, 5761, 2221, 4442, 1819, 3638, 7276, 7543,
+	8001, 6957, 5109, 581, 1162, 2324, 4648, 511, 1022, 2044,
+	4088, 8176, 6735, 4401, 1997, 3994, 7988, 7111, 4641, 493,
+	986, 1972, 3944, 7888, 6159, 5553, 3789, 7578, 7835, 6297,
+	5277, 3221, 6442, 6139, 2649, 5298, 3275, 6550, 5763, 2217,
+	4434, 1803, 3606, 7212, 7671, 7745, 6445, 6133, 2629, 5258,
+	3259, 6518, 5955, 2857, 5714, 2315, 4630, 387, 774, 1548,
+	3096, 6192, 5583, 3633, 7266, 7531, 8057, 7005, 4885, 901,
+	1802, 3604, 7208, 7679, 7761, 6413, 6069, 2757, 5514, 3771,
+	7542, 8003, 6953, 5117, 597, 1194, 2388, 4776, 255, 510, 1020,
+	2040, 4080, 8160, 6767, 4465, 1869, 3738, 7476, 8135, 6689,
+	4589, 1653, 3306, 6612, 5639, 2465, 4930, 811, 1622, 3244,
+	6488, 5919, 2961, 5922, 3051, 6102, 2563, 5126, 3491, 6982,
+	4899, 1001, 2002, 4004, 8008, 6975, 5073, 525, 1050, 2100,
+	4200, 1407, 2814, 5628, 3671, 7342, 7411, 7241, 7485, 8149,
+	6661, 4517, 1765, 3530, 7060, 4743, 161, 322, 644, 1288, 2576,
+	5152, 3567, 7134, 4627, 393, 786, 1572, 3144, 6288, 5263,
+	3249, 6498, 5995, 2937, 5874, 2123, 4246, 1155, 2310, 4620,
+	439, 878, 1756, 3512, 7024, 4943, 817, 1634, 3268, 6536, 5823,
+	2257, 4514, 1771, 3542, 7084, 4855, 65, 130, 260, 520, 1040,
+	2080, 4160, 1327, 2654, 5308, 3287, 6574, 5875, 2121, 4242,
+	1163, 2326, 4652, 503, 1006, 2012, 4024, 8048, 6991, 4913,
+	973, 1946, 3892, 7784, 6527, 5969, 2829, 5658, 2459, 4918,
+	963, 1926, 3852, 7704, 6559, 5777, 2189, 4378, 1947, 3894,
+	7788, 6519, 5953, 2861, 5722, 2331, 4662, 451, 902, 1804,
+	3608, 7216, 7631, 7729, 6605, 5685, 2501, 5002, 699, 1398,
+	2796, 5592, 3615, 7230, 7635, 7689, 6589, 5845, 2053, 4106,
+	1467, 2934, 5868, 2167, 4334, 1139, 2278, 4556, 1591, 3182,
+	6364, 5143, 3457, 6914, 5035, 761, 1522, 3044, 6088, 2623,
+	5246, 3411, 6822, 4323, 1129, 2258, 4516, 1767, 3534, 7068,
+	4759, 129, 258, 516, 1032, 2064, 4128, 1519, 3038, 6076, 2775,
+	5550, 3827, 7654, 7779, 6505, 6013, 2901, 5802, 2299, 4598,
+	1603, 3206, 6412, 6071, 2753, 5506, 3755, 7510, 7939, 7081,
+	4861, 85, 170, 340, 680, 1360, 2720, 5440, 3887, 7774, 6419,
+	6025, 2749, 5498, 3931, 7862, 6339, 5161, 3581, 7162, 4699,
+	281, 562, 1124, 2248, 4496, 1679, 3358, 6716, 4567, 1537,
+	3074, 6148, 5543, 3809, 7618, 7723, 6649, 5725, 2325, 4650,
+	507, 1014, 2028, 4056, 8112, 6863, 4145, 1485, 2970, 5940,
+	3015, 6030, 2739, 5478, 3939, 7878, 6179, 5609, 3709, 7418,
+	7259, 7449, 8093, 6805, 4229, 1189, 2378, 4756, 135, 270, 540,
+	1080, 2160, 4320, 1135, 2270, 4540, 1751, 3502, 7004, 4887,
+	897, 1794, 3588, 7176, 7615, 7889, 6157, 5557, 3781, 7562,
+	7867, 6361, 5149, 3477, 6954, 5115, 601, 1202, 2404, 4808, 63,
+	126, 252, 504, 1008, 2016, 4032, 8064, 6831, 4337, 1101, 2202,
+	4404, 1991, 3982, 7964, 7063, 4737, 173, 346, 692, 1384, 2768,
+	5536, 3823, 7646, 7699, 6537, 5821, 2261, 4522, 1787, 3574,
+	7148, 4727, 321, 642, 1284, 2568, 5136, 3471, 6942, 5011, 649,
+	1298, 2596, 5192, 3391, 6782, 4435, 1801, 3602, 7204, 7655,
+	7777, 6509, 6005, 2885, 5770, 2235, 4470, 1859, 3718, 7436,
+	8119, 6849, 4141, 1525, 3050, 6100, 2567, 5134, 3507, 7014,
+	4963, 873, 1746, 3492, 6984, 4927, 977, 1954, 3908, 7816,
+	6335, 5329, 3085, 6170, 5531, 3737, 7474, 8139, 6713, 4573,
+	1557, 3114, 6228, 5383, 4001, 8002, 6955, 5113, 605, 1210,
+	2420, 4840, 127, 254, 508, 1016, 2032, 4064, 8128, 6703, 4593,
+	1613, 3226, 6452, 6087, 2593, 5186, 3371, 6742, 4355, 1961,
+	3922, 7844, 6375, 5217, 3437, 6874, 4123, 1433, 2866, 5732,
+	2407, 4814, 51, 102, 204, 408, 816, 1632, 3264, 6528, 5807,
+	2289, 4578, 1643, 3286, 6572, 5879, 2113, 4226, 1195, 2390,
+	4780, 247, 494, 988, 1976, 3952, 7904, 6255, 5489, 3917, 7834,
+	6299, 5273, 3229, 6458, 6107, 2585, 5170, 3531, 7062, 4739,
+	169, 338, 676, 1352, 2704, 5408, 4079, 8158, 6675, 4489, 1725,
+	3450, 6900, 4167, 1313, 2626, 5252, 3239, 6478, 5939, 3017,
+	6034, 2699, 5398, 3971, 7942, 7075, 4841, 125, 250, 500, 1000,
+	2000, 4000, 8000, 6959, 5105, 589, 1178, 2356, 4712, 383, 766,
+	1532, 3064, 6128, 2639, 5278, 3219, 6438, 6115, 2665, 5330,
+	3083, 6166, 5507, 3753, 7506, 7947, 7097, 4829, 21, 42, 84,
+	168, 336, 672, 1344, 2688, 5376, 4015, 8030, 6931, 5001, 701,
+	1402, 2804, 5608, 3711, 7422, 7251, 7433, 8125, 6869, 4101,
+	1445, 2890, 5780, 2183, 4366, 1971, 3942, 7884, 6199, 5569,
+	3629, 7258, 7451, 8089, 6813, 4245, 1157, 2314, 4628, 391,
+	782, 1564, 3128, 6256, 5455, 3889, 7778, 6507, 6009, 2909,
+	5818, 2267, 4534, 1731, 3462, 6924, 5047, 705, 1410, 2820,
+	5640, 2495, 4990, 851, 1702, 3404, 6808, 4255, 1169, 2338,
+	4676, 295, 590, 1180, 2360, 4720, 335, 670, 1340, 2680, 5360,
+	3151, 6302, 5267, 3209, 6418, 6027, 2745, 5490, 3915, 7830,
+	6275, 5289, 3325, 6650, 5723, 2329, 4658, 459, 918, 1836,
+	3672, 7344, 7375, 7217, 7629, 7733, 6597, 5669, 2533, 5066,
+	571, 1142, 2284, 4568, 1567, 3134, 6268, 5463, 3841, 7682,
+	6571, 5881, 2141, 4282, 1243, 2486, 4972, 887, 1774, 3548,
+	7096, 4831, 17, 34, 68, 136, 272, 544, 1088, 2176, 4352, 1967,
+	3934, 7868, 6359, 5121, 3501, 7002, 4891, 921, 1842, 3684,
+	7368, 7231, 7633, 7693, 6581, 5829, 2085, 4170, 1339, 2678,
+	5356, 3191, 6382, 5235, 3401, 6802, 4235, 1209, 2418, 4836,
+	103, 206, 412, 824, 1648, 3296, 6592, 5679, 2545, 5090, 619,
+	1238, 2476, 4952, 799, 1598, 3196, 6392, 5215, 3345, 6690,
+	4587, 1657, 3314, 6628, 5735, 2401, 4802, 43, 86, 172, 344,
+	688, 1376, 2752, 5504, 3759, 7518, 7955, 7049, 4797, 213, 426,
+	852, 1704, 3408, 6816, 4335, 1137, 2274, 4548, 1575, 3150,
+	6300, 5271, 3201, 6402, 6059, 2809, 5618, 3659, 7318, 7299,
+	7337, 7421, 7253, 7429, 8101, 6885, 4197, 1381, 2762, 5524,
+	3719, 7438, 8115, 6857, 4157, 1493, 2986, 5972, 2823, 5646,
+	2483, 4966, 867, 1734, 3468, 6936, 5023, 657, 1314, 2628,
+	5256, 3263, 6526, 5971, 2825, 5650, 2443, 4886, 899, 1798,
+	3596, 7192, 7583, 7825, 6285, 5301, 3269, 6538, 5819, 2265,
+	4530, 1739, 3478, 6956, 5111, 577, 1154, 2308, 4616, 447, 894,
+	1788, 3576, 7152, 4687, 305, 610, 1220, 2440, 4880, 911, 1822,
+	3644, 7288, 7519, 7953, 7053, 4789, 197, 394, 788, 1576, 3152,
+	6304, 5359, 3185, 6370, 5227, 3449, 6898, 4171, 1337, 2674,
+	5348, 3175, 6350, 5171, 3529, 7058, 4747, 185, 370, 740, 1480,
+	2960, 5920, 3055, 6110, 2579, 5158, 3555, 7110, 4643, 489,
+	978, 1956, 3912, 7824, 6287, 5297, 3277, 6554, 5787, 2201,
+	4402, 1995, 3990, 7980, 7159, 4673, 301, 602, 1204, 2408,
+	4816, 15, 30, 60, 120, 240, 480, 960, 1920, 3840, 7680, 6575,
+	5873, 2125, 4250, 1179, 2358, 4716, 375, 750, 1500, 3000,
+	6000, 2895, 5790, 2195, 4390, 2019, 4038, 8076, 6839, 4289,
+	1069, 2138, 4276, 1223, 2446, 4892, 919, 1838, 3676, 7352,
+	7391, 7185, 7565, 7861, 6341, 5157, 3557, 7114, 4667, 473,
+	946, 1892, 3784, 7568, 7823, 6321, 5325, 3125, 6250, 5499,
+	3929, 7858, 6347, 5177, 3549, 7098, 4827, 25, 50, 100, 200,
+	400, 800, 1600, 3200, 6400, 6063, 2801, 5602, 3691, 7382,
+	7171, 7593, 7933, 6229, 5381, 4005, 8010, 6971, 5081, 541,
+	1082, 2164, 4328, 1151, 2302, 4604, 1623, 3246, 6492, 5911,
+	2945, 5890, 2987, 5974, 2819, 5638, 2467, 4934, 803, 1606,
+	3212, 6424, 6047, 2705, 5410, 4075, 8150, 6659, 4521, 1789,
+	3578, 7156, 4679, 289, 578, 1156, 2312, 4624, 399, 798, 1596,
+	3192, 6384, 5199, 3377, 6754, 4459, 1913, 3826, 7652, 7783,
+	6497, 5997, 2933, 5866, 2171, 4342, 1091, 2182, 4364, 1975,
+	3950, 7900, 6167, 5505, 3757, 7514, 7963, 7065, 4765, 149,
+	298, 596, 1192, 2384, 4768, 239, 478, 956, 1912, 3824, 7648,
+	7791, 6513, 5965, 2869, 5738, 2427, 4854, 67, 134, 268, 536,
+	1072, 2144, 4288, 1071, 2142, 4284, 1239, 2478, 4956, 791,
+	1582, 3164, 6328, 5343, 3089, 6178, 5611, 3705, 7410, 7243,
+	7481, 8157, 6677, 4485, 1701, 3402, 6804, 4231, 1185, 2370,
+	4740, 167, 334, 668, 1336, 2672, 5344, 3183, 6366, 5139, 3465,
+	6930, 5003, 697, 1394, 2788, 5576, 3647, 7294, 7507, 7945,
+	7101, 4821, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560,
+	5120, 3503, 7006, 4883, 905, 1810, 3620, 7240, 7487, 8145,
+	6669, 4533, 1733, 3466, 6932, 4999, 673, 1346, 2692, 5384,
+	4031, 8062, 6995, 4873, 957, 1914, 3828, 7656, 7807, 6481,
+	5901, 2997, 5994, 2939, 5878, 2115, 4230, 1187, 2374, 4748,
+	183, 366, 732, 1464, 2928, 5856, 2159, 4318, 1043, 2086, 4172,
+	1335, 2670, 5340, 3095, 6190, 5619, 3657, 7314, 7307, 7353,
+	7389, 7189, 7557, 7845, 6373, 5221, 3429, 6858, 4155, 1497,
+	2994, 5988, 2919, 5838, 2099, 4198, 1379, 2758, 5516, 3767,
+	7534, 8051, 6985, 4925, 981, 1962, 3924, 7848, 6399, 5201,
+	3341, 6682, 4507, 1689, 3378, 6756, 4455, 1889, 3778, 7556,
+	7847, 6369, 5229, 3445, 6890, 4219, 1369, 2738, 5476, 3943,
+	7886, 6195, 5577, 3645, 7290, 7515, 7961, 7069, 4757, 133,
+	266, 532, 1064, 2128, 4256, 1263, 2526, 5052, 727, 1454, 2908,
+	5816, 2271, 4542, 1747, 3494, 6988, 4919, 961, 1922, 3844,
+	7688, 6591, 5841, 2061, 4122, 1435, 2870, 5740, 2423, 4846,
+	115, 230, 460, 920, 1840, 3680, 7360, 7215, 7665, 7757, 6453,
+	6085, 2597, 5194, 3387, 6774, 4419, 1833, 3666, 7332, 7399,
+	7265, 7533, 8053, 6981, 4901, 997, 1994, 3988, 7976, 7167,
+	4689, 269, 538, 1076, 2152, 4304, 1039, 2078, 4156, 1495,
+	2990, 5980, 2839, 5678, 2547, 5094, 611, 1222, 2444, 4888,
+	927, 1854, 3708, 7416, 7263, 7441, 8077, 6837, 4293, 1061,
+	2122, 4244, 1159, 2318, 4636, 407, 814, 1628, 3256, 6512,
+	5967, 2865, 5730, 2411, 4822, 3, 6, 12, 24, 48, 96, 192, 384,
+	768, 1536, 3072, 6144, 5551, 3825, 7650, 7787, 6521, 5981,
+	2837, 5674, 2555, 5110, 579, 1158, 2316, 4632, 415, 830, 1660,
+	3320, 6640, 5711, 2353, 4706, 363, 726, 1452, 2904, 5808,
+	2255, 4510, 1683, 3366, 6732, 4407, 1985, 3970, 7940, 7079,
+	4833, 109, 218, 436, 872, 1744, 3488, 6976, 4911, 1009, 2018,
+	4036, 8072, 6847, 4305, 1037, 2074, 4148, 1479, 2958, 5916,
+	2967, 5934, 3059, 6118, 2659, 5318, 3107, 6214, 5411, 4073,
+	8146, 6667, 4537, 1757, 3514, 7028, 4935, 801, 1602, 3204,
+	6408, 6079, 2769, 5538, 3819, 7638, 7683, 6569, 5885, 2133,
+	4266, 1275, 2550, 5100, 631, 1262, 2524, 5048, 735, 1470,
+	2940, 5880, 2143, 4286, 1235, 2470, 4940, 823, 1646, 3292,
+	6584, 5855, 2065, 4130, 1515, 3030, 6060, 2807, 5614, 3699,
+	7398, 7267, 7529, 8061, 6997, 4869, 933, 1866, 3732, 7464,
+	8191, 6737, 4365, 1973, 3946, 7892, 6151, 5537, 3821, 7642,
+	7707, 6553, 5789, 2197, 4394, 2043, 4086, 8172, 6775, 4417,
+	1837, 3674, 7348, 7367, 7201, 7661, 7797, 6469, 5925, 3045,
+	6090, 2619, 5238, 3395, 6790, 4259, 1257, 2514, 5028, 743,
+	1486, 2972, 5944, 3039, 6078, 2771, 5542, 3811, 7622, 7715,
+	6633, 5757, 2389, 4778, 251, 502, 1004, 2008, 4016, 8032,
+	7023, 4977, 845, 1690, 3380, 6760, 4479, 1873, 3746, 7492,
+	7975, 7137, 4717, 373, 746, 1492, 2984, 5968, 2831, 5662,
+	2451, 4902, 995, 1990, 3980, 7960, 7071, 4753, 141, 282, 564,
+	1128, 2256, 4512, 1775, 3550, 7100, 4823, 0
+};
+
+static int err_loc_ply[100][100];
+
+static int
+fix_section(unsigned long offset, void *data, int *syndromes_in)
+{
+	int i, j, elp_sum;
+	int syndromes[9];
+	int Matrix_a[11];
+	int Matrix_b[11];
+	int Matrix_c[12];
+	int Element[7];
+	int alpha;
+	int temp_index;
+	int data_location, rev_location;
+	int result_byte, result_bit;
+	int err_location[20];
+	int err_count;
+	int d_flg;
+	int block_length, data_length;
+
+	/* correct 4 bits in 512 bytes */
+	data_length = 4096;
+	block_length = 8191;
+
+	/*
+	  If there are no errors, just return.
+	*/
+
+	j = 0;
+
+	for (i = 0; i < 8; ++i) {
+		if (0 != syndromes_in[i]) {
+			j = 1;
+			break;
+		}
+	}
+
+	if (0 == j)
+		return 0;
+
+	/*
+	  Decode.
+	*/
+
+	memcpy((void *)syndromes, (void *)syndromes_in, sizeof(int) * 9);
+	d_flg = 0;
+
+	/* initialise table entries */
+	for (i = 0; i < 8; i++)
+		syndromes[i] = i_to_a[syndromes[i]];
+
+	Matrix_c[0] = 0;
+	Matrix_c[1] = syndromes[0];
+	err_loc_ply[0][0] = 1;
+	err_loc_ply[1][0] = 1;
+	for (i = 1; i < 8; i++) {
+		err_loc_ply[0][i] = 0;
+		err_loc_ply[1][i] = 0;
+	}
+	Matrix_a[0] = 0;
+	Matrix_a[1] = 0;
+	Matrix_b[0] = -1;
+	Matrix_b[1] = 0;
+	alpha = -1;
+
+	do {
+		/* skip even loops */
+		alpha += 2;
+		if (Matrix_c[alpha] != -1) {
+			temp_index = alpha - 2;
+			if (temp_index < 0)
+				temp_index = 0;
+			while ((Matrix_c[temp_index] == -1) && (temp_index > 0))
+				temp_index = temp_index - 2;
+			if (temp_index < 0)
+				temp_index = 0;
+
+			if (temp_index > 0) {
+				j = temp_index;
+				do {
+					j = j - 2;
+					if (j < 0)
+						j = 0;
+					if ((Matrix_c[j] != -1) &&
+					   (Matrix_b[temp_index] < Matrix_b[j]))
+						temp_index = j;
+				} while (j > 0);
+			}
+
+			if (Matrix_a[alpha] > Matrix_a[temp_index] +
+				alpha - temp_index)
+				Matrix_a[alpha + 2] = Matrix_a[alpha];
+			else
+				Matrix_a[alpha + 2] = Matrix_a[temp_index] +
+					 alpha - temp_index;
+
+			for (i = 0; i < 8; ++i)
+				err_loc_ply[alpha + 2][i] = 0;
+
+			for (i = 0; i <= Matrix_a[temp_index]; i++) {
+				if (err_loc_ply[temp_index][i] != 0)
+					err_loc_ply[alpha + 2][i + \
+						alpha - temp_index] =
+					a_to_i[(Matrix_c[alpha] + \
+						block_length - \
+						Matrix_c[temp_index] + \
+						i_to_a[err_loc_ply[temp_index] \
+						[i]]) % block_length];
+			}
+
+			for (i = 0; i <= Matrix_a[alpha]; i++)
+				err_loc_ply[alpha + 2][i] ^=
+					err_loc_ply[alpha][i];
+		} else {
+			Matrix_a[alpha + 2] = Matrix_a[alpha];
+
+			for (i = 0; i <= Matrix_a[alpha]; i++)
+				err_loc_ply[alpha + 2][i] =
+					err_loc_ply[alpha][i];
+		}
+
+		Matrix_b[alpha + 2] = alpha+1 - Matrix_a[alpha + 2];
+
+		/* Form (alpha+2)th discrepancy. */
+		if (alpha < 8) {
+			if (syndromes[alpha + 1] != -1)
+				Matrix_c[alpha + 2] =
+					a_to_i[syndromes[alpha + 1]];
+			else
+				Matrix_c[alpha + 2] = 0;
+
+			for (i = 1; i <= Matrix_a[alpha + 2]; i++) {
+				if ((syndromes[alpha + 1 - i] != -1) &&
+					(err_loc_ply[alpha + 2][i] != 0))
+					Matrix_c[alpha + 2] ^=
+						a_to_i[(syndromes[alpha + 1 - i]
+						+ i_to_a[err_loc_ply[alpha + 2]\
+						[i]]) % block_length];
+			}
+			Matrix_c[alpha + 2] = i_to_a[Matrix_c[alpha + 2]];
+		}
+	} while ((alpha < 7) && (Matrix_a[alpha + 2] <= 4));
+
+	alpha = alpha+2;
+	Matrix_a[7] = Matrix_a[alpha];
+	if (Matrix_a[7] <= 4) {
+		for (i = 1; i <= Matrix_a[7]; i++)
+			Element[i] = i_to_a[err_loc_ply[alpha][i]];
+
+		err_count = 0 ;
+		for (i = 1; i <= block_length; i++) {
+			elp_sum = 1 ;
+			for (j = 1; j <= Matrix_a[7]; j++)
+				if (Element[j] != -1) {
+					Element[j] = (Element[j] + j) %
+						block_length ;
+					elp_sum ^= a_to_i[Element[j]] ;
+				}
+
+			if (!elp_sum) {
+				err_location[err_count] = block_length - i ;
+				err_count++ ;
+			}
+		}
+
+		if (err_count == Matrix_a[7])
+			d_flg = 1 ;
+	}
+
+	if (d_flg == 0) {
+		return -1;
+	} else {
+		for (i = 0; i < err_count; i++) {
+			if (err_location[i] >= 52)
+				data_location = err_location[i] - 52;
+			else
+				data_location = err_location[i] + data_length;
+
+			if (data_location <= 4095) {
+				rev_location = 4095 - data_location;
+				result_bit = rev_location % 8;
+				result_byte = (rev_location - result_bit) / 8;
+
+				printk(KERN_NOTICE
+				       "Corrected ECC Error: "
+				       "offset 0x%lx byte 0x%x bit %d\n",
+				       offset, result_byte, result_bit);
+
+				result_byte =
+					(result_byte & 0xfffffffc) |
+					((result_byte & 0x3) ^ 0x3);
+				*((unsigned char *)(data +
+						    result_byte)) ^=
+					(1 << result_bit);
+			} else {
+				rev_location = 4147 - data_location;
+				result_bit = rev_location % 8;
+				result_byte = (rev_location - result_bit) / 8;
+				printk(KERN_ERR
+				       "BCH byte = %d, bit = %d\n",
+				       result_byte, result_bit);
+			}
+		}
+
+		if (0 != err_count)
+			return 1;
+		else
+			return 0;
+	}
+}
+
+/*
+  ------------------------------------------------------------------------------
+  report_ecc_errors_ep501g1
+*/
+
+static int
+report_ecc_errors_ep501g1(struct mtd_info *mtd, struct nand_chip *chip,
+			  uint8_t *buffer, int page)
+{
+	unsigned long bch_status;
+	int rc = 0;
+	int i;
+	int is_blank = 1;
+	uint8_t *data = buffer;
+	int section;
+	int syndrome;
+	unsigned long syndromes[8][8];
+
+	/* If there are no errors, return. */
+	bch_status = READL(chip->IO_ADDR_R + EP501G1_NAND_BCH_STATUS);
+
+	if (0 == bch_status)
+		goto report_ecc_errors_ep501g1_end;
+
+	switch (mtd->writesize) {
+	case 512:
+		bch_status &= 0x1;
+		break;
+	case 2048:
+		bch_status &= 0xf;
+		break;
+	case 4096:
+		bch_status &= 0xff;
+		break;
+	default:
+		printk(KERN_ERR "Unexpected Page Size!\n");
+		rc = -1;
+		goto report_ecc_errors_ep501g1_end;
+		break;
+	}
+
+	/* Ignore fully erased blocks. */
+	if (NULL != data) {
+		for (i = 0; i < mtd->writesize; ++i) {
+			if (0xff != *data++) {
+				is_blank = 0;
+				break;
+			}
+		}
+	}
+
+	if (0 != is_blank)
+		goto report_ecc_errors_ep501g1_end;
+
+	/* Read the syndrome registers and split them into syndromes. */
+	for (section = 0; section < 8; ++section) {
+		unsigned long address;
+		unsigned long value;
+
+		address = EP501G1_NAND_SYN_R12_S0 + (section * 0x10);
+
+		for (syndrome = 0; syndrome < 8; syndrome += 2) {
+			value = READL(chip->IO_ADDR_R + address +
+				      (syndrome * 2));
+			syndromes[section][syndrome] =
+				(value & 0x1fff);
+			syndromes[section][syndrome + 1] =
+				((value & 0x1fff0000) >> 16);
+		}
+	}
+
+#ifdef NOT_USED
+	/* Debug output (BCH status register and syndromes). */
+	printk(KERN_INFO "BCH Status Register: 0x%02lx\n", bch_status);
+
+	for (section = 0; section < 8; ++section) {
+		printk(KERN_INFO "Syndromes, Section %d: ", section);
+
+		for (syndrome = 0; syndrome < 8; ++syndrome) {
+			printk(KERN_INFO "0x%04lx ",
+			       syndromes[section][syndrome]);
+		}
+
+		printk(KERN_INFO "\n");
+	}
+#endif
+
+	for (i = 0; i < 4; ++i) {
+		if ((1 << i) == (bch_status & (1 << i))) {
+			rc = fix_section(((page * mtd->writesize) + (512 * i)),
+					 (void *)(buffer + (512 * i)),
+					 (int *)&syndromes[i]);
+
+			if (-1 == rc)
+				printk(KERN_ERR
+				       "Uncorrectable ECC Error: Page %d\n",
+				       page);
+		}
+	}
+
+ report_ecc_errors_ep501g1_end:
+
+	return rc;
+}
+
+/*
+  ------------------------------------------------------------------------------
+  report_ecc_errors_ep501g3
+*/
+
+static int
+report_ecc_errors_ep501g3(struct mtd_info *mtd, struct nand_chip *chip,
+			  uint8_t *buffer, int page)
+{
+	unsigned long bch_status;
+	int rc = 0;
+	unsigned long value;
+	int i;
+	int is_blank = 1;
+	uint8_t *data = buffer;
+	int section;
+	int syndrome;
+	unsigned long syndromes[8][8];
+
+	/* Verify 4-bit mode in the EP501G3 case. */
+	value = (READL(chip->IO_ADDR_R + EP501_NAND_CONFIG_REG) & 0x1800) >> 11;
+
+	if (1 != value) {
+		printk("Only 4-Bit ECC is supported.\n");
+		rc = -1;
+		goto report_ecc_errors_ep501g3_end;
+	}
+
+	/* If there are no errors, return. */
+	bch_status = READL(chip->IO_ADDR_R + EP501G1_NAND_BCH_STATUS);
+
+	if (0 == bch_status)
+		goto report_ecc_errors_ep501g3_end;
+
+	switch (mtd->writesize) {
+	case 512:
+		bch_status &= 0x1;
+		break;
+	case 2048:
+		bch_status &= 0xf;
+		break;
+	case 4096:
+		bch_status &= 0xff;
+		break;
+	default:
+		printk(KERN_ERR "Unexpected Page Size!\n");
+		rc = -1;
+		goto report_ecc_errors_ep501g3_end;
+		break;
+	}
+
+	/* Ignore fully erased blocks. */
+	if (NULL != data) {
+		for (i = 0; i < mtd->writesize; ++i) {
+			if (0xff != *data++) {
+				is_blank = 0;
+				break;
+			}
+		}
+	}
+
+	if (0 != is_blank)
+		goto report_ecc_errors_ep501g3_end;
+
+	/* Read the syndrome registers and split them into syndromes. */
+	for (section = 0; section < 8; ++section) {
+		unsigned long address;
+		unsigned long value;
+
+		address = EP501G1_NAND_SYN_R12_S0 + (section * 0x10);
+
+		for (syndrome = 0; syndrome < ((mtd->writesize / 512) * 2);
+		     syndrome += 2, address += 4) {
+			value = READL(chip->IO_ADDR_R + address);
+			syndromes[section][syndrome] =
+				(value & 0x1fff);
+			syndromes[section][syndrome + 1] =
+				((value & 0x1fff0000) >> 16);
+		}
+	}
+
+#ifdef NOT_USED
+	/* Debug output (BCH status register and syndromes). */
+	printk(KERN_INFO "BCH Status Register: 0x%02lx\n", bch_status);
+
+	for (section = 0; section < 8; ++section) {
+		printk(KERN_INFO "Syndromes, Section %d: ", section);
+
+		for (syndrome = 0; syndrome < 8; ++syndrome)
+			printk(KERN_INFO "0x%04lx ",
+
+		printk(KERN_INFO "\n");
+	}
+#endif
+
+	for (i = 0; i < 4; ++i) {
+		if ((1 << i) == (bch_status & (1 << i))) {
+			rc = fix_section(((page * mtd->writesize) + (512 * i)),
+					 (void *)(buffer + (512 * i)),
+					 (int *)&syndromes[i]);
+
+			if (-1 == rc)
+				printk(KERN_ERR
+				       "Uncorrectable ECC Error: Page %d\n",
+				       page);
+		}
+	}
+
+ report_ecc_errors_ep501g3_end:
+
+	return rc;
+}
+
+/*
+  ------------------------------------------------------------------------------
+  report_ecc_errors
+*/
+
+static int
+report_ecc_errors(struct mtd_info *mtd, struct nand_chip *chip,
+		  uint8_t *buffer, int page)
+{
+	int rc = 0;
+
+	switch (lsi_nand_type) {
+	case LSI_NAND_EP501:
+		rc = report_ecc_errors_ep501(mtd, chip, buffer, page);
+		break;
+	case LSI_NAND_EP501G1:
+		rc = report_ecc_errors_ep501g1(mtd, chip, buffer, page);
+		break;
+	case LSI_NAND_EP501G3:
+		rc = report_ecc_errors_ep501g3(mtd, chip, buffer, page);
+		break;
+	default:
+		rc = -1;
+		break;
+	}
+
+	return rc;
+}
+
+
+/**
+ * nand_read_page_hwecc - hardware ecc based page read function
+ * @mtd:	mtd info structure
+ * @chip:	nand chip info structure
+ * @buf:	buffer to store read data
+ *
+ * Not for syndrome calculating ecc controllers which need a special oob layout
+ */
+
+static int
+lsi_nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+			 uint8_t *buf, int page)
+{
+	int rc;
+	/*int page = 0;*/
+
+	/* Read the current page number and save it. */
+	/*page = READL(chip->IO_ADDR_R + NAND_INDEX_REG) >> 12;*/
+
+	/* read the page */
+	chip->read_buf(mtd, buf, mtd->writesize);
+
+	/* read oob data */
+	chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
+
+	/* start ECC calculations */
+	chip->ecc.calculate(mtd, NULL, NULL);
+
+	/* Read the ECC Status and see if there were any errors */
+	rc = report_ecc_errors(mtd, chip, buf, page);
+
+	/* cmd to controller to turn off CE */
+	chip->cmd_ctrl(mtd, nand_cmd_ce_off, 0);
+	return rc;
+}
+
+/**
+ * lsi_nand_write_page_hwecc - hardware ecc based page write function
+ * @mtd:	mtd info structure
+ * @chip:	nand chip info structure
+ * @buf:	data buffer
+ */
+static int
+lsi_nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
+			  const uint8_t *buf)
+{
+	/* write the page data */
+	chip->write_buf(mtd, buf, mtd->writesize);
+
+	/*
+	 * Write the oob data. Last 12 bytes are used by HW ECC.
+	 * Do not touch them.
+	 */
+	chip->write_buf(mtd, chip->oob_poi, mtd->oobsize - chip->ecc.bytes);
+	return 0;
+}
+
+/**
+ * lsi_nand_write_page - [REPLACEABLE] write one page
+ * @mtd:	MTD device structure
+ * @chip:	NAND chip descriptor
+ * @buf:	the data to write
+ * @page:	page number to write
+ * @cached:	cached programming
+ * @raw:	use _raw version of write_page
+ */
+
+static int
+lsi_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
+		    const uint8_t *buf, int page, int cached, int raw)
+{
+	int status;
+
+	chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);
+
+	if (unlikely(raw))
+		chip->ecc.write_page_raw(mtd, chip, buf);
+	else
+		chip->ecc.write_page(mtd, chip, buf);
+
+	/* calculate ECC */
+	status = chip->ecc.calculate(mtd, NULL, NULL);
+
+	/* cmd to controller to turn off CE */
+	chip->cmd_ctrl(mtd, nand_cmd_ce_off, 0);
+
+	/*
+	 * See if operation failed and additional status checks are
+	 * available
+	 */
+	if (status & NAND_STATUS_FAIL) {
+		printk(KERN_ERR "ERROR: Page write failed for page 0x%x\n",
+		       page);
+
+		if (chip->errstat)
+			status = chip->errstat(mtd, chip, FL_WRITING, status,
+					       page);
+
+		return -EIO;
+	}
+
+#ifdef CONFIG_MTD_NAND_VERIFY_WRITE
+	/* Send command to read back the data */
+	chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
+
+	if (chip->verify_buf(mtd, buf, mtd->writesize))
+		return -EIO;
+#endif
+
+	return 0;
+}
+
+
+/**
+ * lsi_nand_read_oob_std - [REPLACABLE] the most common OOB data read function
+ * @mtd:	mtd info structure
+ * @chip:	nand chip info structure
+ * @page:	page number to read
+ * @sndcmd:	flag whether to issue read command or not
+ */
+
+static int
+lsi_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
+		  int page, int sndcmd)
+{
+	int rc;
+
+	/* send command to read oob */
+	chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
+
+	/* read oob data */
+	chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
+
+	/* start ECC calculations */
+	chip->ecc.calculate(mtd, NULL, NULL);
+
+	/* Read the ECC Status and see if there were any errors */
+	rc = report_ecc_errors(mtd, chip, NULL, page);
+
+	/* cmd to controller to turn off CE */
+	chip->cmd_ctrl(mtd, nand_cmd_ce_off, 0);
+
+	return sndcmd;
+}
+
+/**
+ * lsi_nand_write_oob_std - [REPLACABLE] the most common OOB data write
+ *			      function
+ * @mtd:	mtd info structure
+ * @chip:	nand chip info structure
+ * @page:	page number to write
+ */
+
+static int
+lsi_nand_write_oob(struct mtd_info *mtd, struct nand_chip *chip, int page)
+{
+	/* start OOB write */
+	chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page);
+
+	/*
+	 * Write the oob data. Last 12 bytes are used by HW ECC.
+	 * Do not touch them.
+	 */
+	chip->write_buf(mtd, chip->oob_poi, mtd->oobsize - chip->ecc.bytes);
+
+	/* calculate ECC */
+	chip->ecc.calculate(mtd, NULL, NULL);
+
+	/* cmd to controller to turn off CE */
+	chip->cmd_ctrl(mtd, nand_cmd_ce_off, 0);
+
+	return (chip->dev_ready(mtd) & NAND_STATUS_FAIL) ? -EIO : 0;
+}
+
+/*
+  ======================================================================
+  ======================================================================
+  Public
+  ======================================================================
+  ======================================================================
+*/
+
+/*
+  ------------------------------------------------------------------------------
+  lsi_nand_set_config
+*/
+
+int
+lsi_nand_set_config(struct mtd_info *mtd, struct nand_chip *chip)
+{
+	unsigned long config = 0;
+	unsigned long mbits;
+
+	mbits = ((chip->chipsize >> 20) * 8);
+
+	if (LSI_NAND_EP501 == lsi_nand_type) {
+		/* The EP501 only supports 512 and 2k page sizes. */
+		if (512 != mtd->writesize &&
+		    2048 != mtd->writesize)
+			return -1;
+
+		while (64 < mbits) {
+			++config; /* 0b000=64Mbit, 0b001=128Mbit, etc. */
+			mbits >>= 1;
+		}
+
+		if (512 < mtd->writesize)
+			config |= 0x100; /* large block */
+
+		config |= 0x200;	/* not write protected */
+		chip->ecc.layout = &lsi_2k_1bit_ecclayout;
+		chip->ecc.size = mtd->writesize;
+		chip->ecc.bytes = chip->ecc.layout->eccbytes;
+	} else if (LSI_NAND_EP501G1 == lsi_nand_type) {
+		/* The EP501G1 only supports 512, 2k, and 4k page sizes, */
+		if (512 != mtd->writesize &&
+		    2048 != mtd->writesize &&
+		    4096 != mtd->writesize)
+			return -1;
+
+		/* and device sizes as follows. */
+		if (512 == mtd->writesize) {
+			switch (mbits) {
+			case 64:
+				break;
+			case 128:
+				config |= 1;
+				break;
+			case 256:
+				config |= 2;
+				break;
+			case 512:
+				config |= 3;
+				break;
+			case 1024:
+				config |= 4;
+				break;
+			case 2048:
+				config |= 5;
+				break;
+			case 4096:
+				config |= 6;
+				break;
+			case 8192:
+				config |= 7;
+				 break;
+			default:
+				return -1;
+				break;
+			}
+		} else {
+			switch (mbits) {
+			case 512:
+				config |= 3;
+				break;
+			case 1024:
+				config |= 4;
+				break;
+			case 2048:
+				config |= 5;
+				break;
+			case 4096:
+				config |= 6;
+				break;
+			case 8192:
+				config |= 7;
+				break;
+			case 16384:
+				break;
+			case 32768:
+				config |= 1;
+				break;
+			case 65536:
+				config |= 2;
+				break;
+			default:
+				return -1;
+				break;
+			}
+		}
+
+		switch (mtd->writesize) {
+		case 512:
+			break;
+		case 2048:
+			config |= 0x1 << 8;
+			chip->ecc.layout = &lsi_2k_4bit_ecclayout;
+			break;
+		case 4096:
+			config |= 0x2 << 8;
+			chip->ecc.layout = &lsi_4k_4bit_ecclayout;
+			break;
+		default:
+			return -1;
+			break;
+		}
+
+		config |= 1 << 10; /* not write protected */
+
+		config |= 1 << 11; /* 4 bit ECC */
+
+		if (512 < mtd->writesize)
+			config |= 1 << 12; /* 3 cycle row address */
+
+		chip->ecc.size = mtd->writesize;
+
+		if (mtd->oobsize == 224)
+			chip->ecc.bytes = 224 - chip->ecc.layout->eccbytes;
+		else
+			chip->ecc.bytes = chip->ecc.layout->eccbytes;
+
+	} else if (LSI_NAND_EP501G3 == lsi_nand_type) {
+		/* The EP501G3 only supports 2k, 4k, and 8k page sizes, */
+		if (2048 != mtd->writesize &&
+		    4096 != mtd->writesize &&
+		    8192 != mtd->writesize)
+			return -1;
+
+		/* and device sizes as follows. */
+		switch (mbits) {
+		case 512:
+			config |= 3;
+			break;
+		case 1024:
+			config |= 4;
+			break;
+		case 2048:
+			config |= 5;
+			break;
+		case 4096:
+			config |= 6;
+			break;
+		case 8192:
+			config |= 7;
+			break;
+		case 16384:
+			break;
+		case 32768:
+			config |= 1;
+			break;
+		case 65536:
+			config |= 2;
+			break;
+		default:
+			printk(KERN_ERR "Invalid Device Size: 0x%lx\n", mbits);
+			return -1;
+			break;
+		}
+
+		switch (mtd->writesize) {
+		case 2048:
+			config |= 0x1 << 8;
+			chip->ecc.layout = &lsi_2k_4bit_ecclayout;
+			break;
+		case 4096:
+			config |= 0x2 << 8;
+			chip->ecc.layout = &lsi_4k_4bit_ecclayout;
+			break;
+#ifdef NOT_USED
+		case 8192:
+			config |= 0x3 << 8;
+			chip->ecc.layout = &lsi_8k_4bit_ecclayout;
+			break;
+#endif
+		default:
+			return -1;
+			break;
+		}
+
+		config |= 1 << 10; /* not write protected */
+		config |= 1 << 13; /* 3 cycle row address */
+
+		/*
+		  2K/4bit  - 32 bytes (8192)
+		  2K/8bit  - 64 bytes (16384)
+		  2K/12bit - 80 bytes (24576)
+		  ...
+		  8K/12bit - 320 bytes (98304)
+		*/
+
+		if (mtd->oobsize < chip->ecc.layout->eccbytes) {
+			printk(KERN_ERR
+			       "ECC requires %d bytes, only %d are available.\n",
+			       chip->ecc.layout->eccbytes, mtd->oobsize);
+			return -1;
+		}
+
+		config |= 1 << 11; /* 4 bit ECC */
+		mtd->oobavail = mtd->oobsize - chip->ecc.layout->eccbytes;
+		mtd->oobavail -= (mtd->oobavail % 4);
+		config |= (chip->ecc.layout->eccbytes / 4) << 16;
+		chip->ecc.size = mtd->writesize;
+		chip->ecc.bytes = chip->ecc.layout->eccbytes;
+	} else {
+		return -1;
+	}
+
+	WRITEL(config, chip->IO_ADDR_W + EP501_NAND_CONFIG_REG);
+
+	return 0;
+}
+
+static uint8_t
+lsi_nand_read_byte(struct mtd_info *mtd)
+{
+	struct lsi_nand_private *priv = &lsi_nand_private;
+	struct nand_chip *chip = mtd->priv;
+
+	if (priv->cur >= 0) {
+		WARN_ON(priv->cur >= MAX_READ_BUF);
+		return priv->buf[priv->cur++];
+	} else
+		return readb(chip->IO_ADDR_R);
+}
+
+static int lsi_nand_errstat
+	(struct mtd_info *mtd, struct nand_chip *chip,
+	int state, int status, int page) {
+	/* if erase failed for a block, mark it as bad block */
+	if ((FL_ERASING == chip->state) && (status & NAND_STATUS_FAIL))
+		mtd_block_markbad(mtd, page << chip->page_shift);
+
+	return status;
+}
+
+static int
+lsi_nand_init_size(struct mtd_info *mtd, struct nand_chip *chip, u8 *id_data)
+{
+	int busw, extid;
+
+	/* The 3rd id byte holds MLC / multichip data */
+	chip->cellinfo = readb(chip->IO_ADDR_R + NAND_ID4_REG);
+	/* The 4th id byte is the important one */
+	extid = readb(chip->IO_ADDR_R + NAND_ID6_REG);
+
+	/* Add workaournd for Micron MT29Fxxxxxx NAND flash */
+	if (id_data[0] == NAND_MFR_MICRON && id_data[1] == 0x48) {
+		/* Calc pagesize */
+		mtd->writesize = 1024 << (extid & 0x03);
+		extid >>= 2;
+		/*Calc oobsize */
+		mtd->oobsize = ((extid & 0x03) == 0x03) ? 218 : 224;
+		extid >>= 3;
+		/* Calc blocksize. Blocksize is multiples of 256KiB */
+		mtd->erasesize = (256 * 1024) << (extid & 0x03);
+		busw = 0;
+	} else {
+		/* Calc pagesize */
+		mtd->writesize = 1024 << (extid & 0x03);
+		extid >>= 2;
+		/* Calc oobsize */
+		mtd->oobsize = (8 << (extid & 0x01)) * (mtd->writesize >> 9);
+		extid >>= 2;
+		/* Calc blocksize. Blocksize is multiples of 64KiB */
+		mtd->erasesize = (64 * 1024) << (extid & 0x03);
+		extid >>= 2;
+		/* Get buswidth information */
+		busw = (extid & 0x01) ? NAND_BUSWIDTH_16 : 0;
+	}
+
+	lsi_nand_set_config(mtd, chip);
+
+	return busw;
+}
+
+/*
+  ----------------------------------------------------------------------
+  lsi_nand_init
+*/
+
+#define NAND_BASE 0x002000440000ULL
+#define NAND_SIZE 0x20000
+#define GPREG_BASE 0x00200040c000ULL
+#define GPREG_SIZE 0x1000
+
+static int __init
+lsi_nand_init(void)
+{
+	void *nand_base;
+	struct device_node *np = NULL;
+	struct mtd_part_parser_data ppdata;
+	static const char *part_probe_types[]
+	= { "cmdlinepart", "ofpart", NULL };
+
+	memset(&ppdata, 0, sizeof(ppdata));
+
+	np = of_find_node_by_type(np, "nand");
+
+	while (np && !of_device_is_compatible(np, "acp-nand"))
+		np = of_find_node_by_type(np, "nand");
+
+	if (np) {
+		const u32 *reg;
+		int reglen;
+		u64 nand_address;
+		unsigned long nand_length;
+		u64 gpreg_address;
+		unsigned long gpreg_length;
+		const u32 *enabled;
+
+		enabled = of_get_property(np, "enabled", NULL);
+
+		if (NULL == enabled) {
+			printk("ACP NAND Controller Isn't Enabled.\n");
+			return -1;
+		}
+
+		reg = of_get_property(np, "reg", &reglen);
+
+		if (reg && (16 == reglen)) {
+			nand_address = of_translate_address(np, reg);
+			nand_length = reg[1];
+			reg += 2;
+			gpreg_address = of_translate_address(np, reg);
+			gpreg_length = reg[1];
+			printk(KERN_INFO "nand_address=0x%08llx nand_length=0x%lx\n"
+			       "gpreg_address=0x%08llx gpreg_length=0x%lx\n",
+			       nand_address, nand_length,
+			       gpreg_address, gpreg_length);
+			nand_base = ioremap(nand_address, nand_length);
+			gpreg_base = ioremap(gpreg_address, gpreg_length);
+		} else {
+			return -1;
+		}
+
+		ppdata.of_node = np;
+	} else {
+		printk(KERN_INFO "ACP NAND: Using Static Addresses.\n");
+		nand_base = ioremap(0x002000440000ULL, 0x20000);
+		gpreg_base = ioremap(0x00200040c000ULL, 0x1000);
+	}
+
+	/*
+	  Determine the version of the controller.
+
+	  As there is not version register, see if bits 5:3 of the
+	  configuration register are writable.  There are in the EP501
+	  case and aren't in the EP501G1 case.
+	*/
+
+	{
+		unsigned long cr;
+		unsigned long cr_save;
+
+		cr = cr_save = READL((void *)(nand_base + NAND_CONFIG_REG));
+		cr = 0x2038;
+		WRITEL(cr, (void *)(nand_base + EP501_NAND_CONFIG_REG));
+		cr = READL((void *)nand_base + EP501_NAND_CONFIG_REG);
+		WRITEL(cr_save, (void *)(nand_base + EP501_NAND_CONFIG_REG));
+
+		if (0 == (cr & 0x2038))
+			lsi_nand_type = LSI_NAND_EP501G1;
+		else if (0x38 == (cr & 0x2038))
+			lsi_nand_type = LSI_NAND_EP501;
+		else if (0x2000 == (cr & 0x2038))
+			lsi_nand_type = LSI_NAND_EP501G3;
+		else
+			lsi_nand_type = LSI_NAND_NONE;
+	}
+
+	switch (lsi_nand_type) {
+	case LSI_NAND_EP501:
+		printk(KERN_INFO "EP501 NAND Controller.\n");
+		nand_cmd_ce_off = NAND_CMD_CE_OFF_501;
+		break;
+	case LSI_NAND_EP501G1:
+		printk(KERN_INFO "EP501G1 NAND Controller.\n");
+		nand_cmd_ce_off = NAND_CMD_CE_OFF_501G1;
+		break;
+	case LSI_NAND_EP501G3:
+		printk(KERN_INFO "EP501G3 NAND Controller.\n");
+		nand_cmd_ce_off = NAND_CMD_CE_OFF_501G3;
+		break;
+	default:
+		printk(KERN_INFO "Unknown NAND Controller!\n");
+		return -1;
+		break;
+	}
+
+	/* Initialize structures */
+	memset(&lsi_nand_mtd, 0, sizeof(struct mtd_info));
+	memset(&lsi_nand_chip, 0, sizeof(struct nand_chip));
+
+	/* Link the private data with the MTD structure */
+	lsi_nand_mtd.priv = &lsi_nand_chip;
+	lsi_nand_mtd.owner = THIS_MODULE;
+	lsi_nand_mtd.name = "acp-nand";
+
+	/* init chip callbacks */
+	lsi_nand_chip.IO_ADDR_R = (void *) nand_base;
+	lsi_nand_chip.IO_ADDR_W = (void *) nand_base;
+	lsi_nand_chip.write_buf = lsi_nand_write_buf;
+	lsi_nand_chip.read_buf = lsi_nand_read_buf;
+	lsi_nand_chip.verify_buf = lsi_nand_verify_buf;
+	lsi_nand_chip.write_page = lsi_nand_write_page;
+	lsi_nand_chip.cmd_ctrl = lsi_nand_hwcontrol;
+	lsi_nand_chip.dev_ready = lsi_nand_device_ready;
+	lsi_nand_chip.cmdfunc = lsi_nand_command;
+	lsi_nand_chip.waitfunc = lsi_nand_wait;
+	lsi_nand_chip.chip_delay = 10;
+	lsi_nand_chip.bbt_options = NAND_BBT_USE_FLASH;
+	lsi_nand_chip.read_byte = lsi_nand_read_byte;
+	lsi_nand_chip.errstat = lsi_nand_errstat;
+	lsi_nand_chip.init_size = lsi_nand_init_size;
+
+	/* initialize ECC */
+	lsi_nand_chip.ecc.mode = NAND_ECC_HW;
+	lsi_nand_chip.ecc.steps = 1;
+	lsi_nand_chip.ecc.total = 12;
+	lsi_nand_chip.ecc.hwctl = lsi_nand_ecc_hwctl;
+	lsi_nand_chip.ecc.calculate = lsi_nand_ecc_calculate;
+	lsi_nand_chip.ecc.correct = lsi_nand_ecc_correct;
+	lsi_nand_chip.ecc.read_page = lsi_nand_read_page_hwecc;
+	lsi_nand_chip.ecc.write_page = lsi_nand_write_page_hwecc;
+	lsi_nand_chip.ecc.read_page_raw = lsi_nand_read_page_hwecc;
+	lsi_nand_chip.ecc.write_page_raw = lsi_nand_write_page_hwecc;
+	lsi_nand_chip.ecc.read_oob = lsi_nand_read_oob;
+	lsi_nand_chip.ecc.write_oob = lsi_nand_write_oob;
+
+	printk(KERN_ERR "Enabling NAND ECC...\n");
+	/* clear any existing ECC status */
+	WRITEL(0x0, lsi_nand_chip.IO_ADDR_W + NAND_INTR_STATUS_REG);
+	/* enable ECC */
+	WRITEL(0x0, lsi_nand_chip.IO_ADDR_W + NAND_INTR_EN_REG);
+
+	/*
+	  ======================================================================
+	  Timing Control
+
+	  This may need to be changed, based on the devices used.  Each field is
+	  described below.
+	*/
+
+	/*
+	  TCR0 - NAND Timing Control Register 0
+	*/
+
+	{
+		nand_timing_control_register_0_t tcr0;
+
+		/* TH [31:24] - CLE, CE & ALE hold Time */
+		tcr0.bits.th = 0x08;
+
+		/* TRP [23:16] - Read Pulse Width */
+		tcr0.bits.trp = 0x0c;
+
+		/* TWP [15:8] - Write Pulse Width */
+		tcr0.bits.twp = 0x0c;
+
+		/* TS [7:0] - Setup Time for CLE, CE & ALE */
+		tcr0.bits.ts = 0x05;
+
+		WRITEL(tcr0.raw,
+		       (lsi_nand_chip.IO_ADDR_W + NAND_TIMING1_REG));
+	}
+
+	/*
+	  TCR1 - NAND Timing Control Register 1
+	*/
+
+	{
+		nand_timing_control_register_1_t tcr1;
+
+		/* TWB [31:24] - WE Rising Edge to RY/BY Falling Edge */
+		tcr1.bits.twb = 0x1e;
+
+		/* TRR [23:16] - RY/BY Rising Edge To Read Falling Edge */
+		tcr1.bits.trr = 0x07;
+
+		/* TRH [15:8] - Read Pulse High Time */
+		tcr1.bits.trh = 0x03;
+
+		/* TWH [7:0] - Write Pulse High Time */
+		tcr1.bits.twh = 0x03;
+
+		WRITEL(tcr1.raw,
+		       (lsi_nand_chip.IO_ADDR_W + NAND_TIMING2_REG));
+	}
+
+	/*
+	  TCR2 - NAND Timing Control Register 2 (EP501G3 Only)
+	*/
+
+	{
+		nand_timing_control_register_2_t tcr2;
+
+		tcr2.bits.tccs = 0x10;
+		tcr2.bits.twhr = 0x10;
+		tcr2.bits.trhw = 0x14;
+		WRITEL(tcr2.raw,
+		       (lsi_nand_chip.IO_ADDR_W + EP501G3_NAND_TIMING2_REG));
+	}
+
+	printk(KERN_ERR "Searching for NAND flash...\n");
+	/* Scan to find existence of the device */
+	if (nand_scan(&lsi_nand_mtd, 1)) {
+		printk(KERN_ERR "nand_scan failure...\n");
+		return -ENXIO;
+	}
+
+	/* Register the partitions */
+
+	mtd_device_parse_register(&lsi_nand_mtd, part_probe_types, &ppdata,
+				  NULL, 0);
+
+	/* Return happy */
+	return 0;
+}
+
+module_init(lsi_nand_init);
+
+/*
+  ----------------------------------------------------------------------
+  lsi_nand_exit
+*/
+
+static void __exit
+lsi_nand_exit(void)
+{
+	/* Release resources, unregister device */
+	nand_release(&lsi_nand_mtd);
+}
+
+module_exit(lsi_nand_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jay Jayatheerthan <jay.jayatheerthan at lsi.com>");
+MODULE_DESCRIPTION("MTD map driver for LSI's ACP board");
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index af4fe8c..db2dce9 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -115,6 +115,7 @@ struct nand_flash_dev nand_flash_ids[] = {
 	{"NAND 2GiB 3,3V 8-bit",	0xD5, 0, 2048, 0, LP_OPTIONS},
 	{"NAND 2GiB 1,8V 16-bit",	0xB5, 0, 2048, 0, LP_OPTIONS16},
 	{"NAND 2GiB 3,3V 16-bit",	0xC5, 0, 2048, 0, LP_OPTIONS16},
+	{"NAND 2GiB 3,3V 16-bit",	0x48, 0, 2048, 0, LP_OPTIONS},
 
 	/* 32 Gigabit */
 	{"NAND 4GiB 1,8V 8-bit",	0xA7, 0, 4096, 0, LP_OPTIONS},
-- 
1.8.3




More information about the linux-yocto mailing list