diff --git a/Changelog b/Changelog
index ae8ecfb..43a2a6b 100644
--- a/Changelog
+++ b/Changelog
@@ -50,6 +50,7 @@ version <next>
 - Flash Screen Video decoder
 - GXF demuxer
 - Chinese AVS decoder
+- Native H.264 encoder
 
 version 0.4.9-pre1:
 
diff --git a/doc/ffmpeg-doc.texi b/doc/ffmpeg-doc.texi
index c47797c..1937f94 100644
--- a/doc/ffmpeg-doc.texi
+++ b/doc/ffmpeg-doc.texi
@@ -742,7 +742,7 @@ following image formats are supported:
 @item WMV8                   @tab  X  @tab  X @tab not completely working
 @item H.261                  @tab  X  @tab  X
 @item H.263(+)               @tab  X  @tab  X @tab also known as RealVideo 1.0
-@item H.264                  @tab     @tab  X
+@item H.264                  @tab  X  @tab  X
 @item RealVideo 1.0          @tab  X  @tab  X
 @item RealVideo 2.0          @tab  X  @tab  X
 @item MJPEG                  @tab  X  @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index ba7162d..081fdab 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -17,7 +17,7 @@ OBJS= bitstream.o utils.o mem.o allcodec
       fft.o mdct.o raw.o golomb.o cabac.o\
       faandct.o parser.o \
       vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \
-      opt.o \
+      opt.o h264cavlc.o h264enc.o \
       bitstream_filter.o \
 
 
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 172193f..f239cbd 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -83,9 +83,9 @@ void avcodec_register_all(void)
 #ifdef CONFIG_MPEG1VIDEO_ENCODER
     register_avcodec(&mpeg1video_encoder);
 #endif //CONFIG_MPEG1VIDEO_ENCODER
-#ifdef CONFIG_H264_ENCODER
-//    register_avcodec(&h264_encoder);
-#endif //CONFIG_H264_ENCODER
+//#ifdef CONFIG_H264_ENCODER
+    register_avcodec(&h264_encoder);
+//#endif //CONFIG_H264_ENCODER
 #ifdef CONFIG_MPEG2VIDEO_ENCODER
     register_avcodec(&mpeg2video_encoder);
 #endif //CONFIG_MPEG2VIDEO_ENCODER
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a829fd6..c534e9e 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -119,6 +119,7 @@ enum CodecID {
     CODEC_ID_KMVC,
     CODEC_ID_FLASHSV,
     CODEC_ID_CAVS,
+    CODEC_ID_FFH264,
 
     /* various pcm "codecs" */
     CODEC_ID_PCM_S16LE= 0x10000,
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 5c22184..fbf646c 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -38,6 +38,9 @@ void ff_spatial_dwt(int *buffer, int wid
 uint8_t cropTbl[256 + 2 * MAX_NEG_CROP] = {0, };
 uint32_t squareTbl[512] = {0, };
 
+extern const uint8_t div6[52];
+extern const uint8_t rem6[52];
+
 const uint8_t ff_zigzag_direct[64] = {
     0,   1,  8, 16,  9,  2,  3, 10,
     17, 24, 32, 25, 18, 11,  4,  5,
@@ -3789,6 +3792,220 @@ static void ff_jref_idct1_add(uint8_t *d
     dest[0] = cm[dest[0] + ((block[0] + 4)>>3)];
 }
 
+extern const int16_t ff_h264_MF00[6];
+extern const int16_t ff_h264_V00[6];
+   
+#define COPY_SIGN(A, B) ((A ^ (B>>31)) - (B>>31))
+
+#define FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(X, Y) \
+	block[X][Y] = COPY_SIGN(((ABS((int32_t)outblock[X][Y])*MF[mod][X][Y]+f) >> qbits), outblock[X][Y])
+	
+#define FF_H264_TRANSFORM_DCT_QUANT_C_LINE(X) \
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(X,0); \
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(X,1); \
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(X,2); \
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(X,3);
+
+// we'll always work with transposed input blocks, to avoid having to make a distinction between
+// C and mmx implementations
+void ff_h264_transform_dct_quant_c(int16_t block[4][4], int QP, int dontscaleDC) // y,x indexing
+{
+    static const int16_t MF[6][4][4] = 
+    {
+        { { 13107, 8066, 13107, 8066}, {  8066, 5243,  8066, 5243}, { 13107, 8066, 13107, 8066}, {  8066, 5243,  8066, 5243} },
+        { { 11916, 7490, 11916, 7490}, {  7490, 4660,  7490, 4660}, { 11916, 7490, 11916, 7490}, {  7490, 4660,  7490, 4660} },
+        { { 10082, 6554, 10082, 6554}, {  6554, 4194,  6554, 4194}, { 10082, 6554, 10082, 6554}, {  6554, 4194,  6554, 4194} },
+        { {  9362, 5825,  9362, 5825}, {  5825, 3647,  5825, 3647}, {  9362, 5825,  9362, 5825}, {  5825, 3647,  5825, 3647} },
+        { {  8192, 5243,  8192, 5243}, {  5243, 3355,  5243, 3355}, {  8192, 5243,  8192, 5243}, {  5243, 3355,  5243, 3355} },
+        { {  7282, 4559,  7282, 4559}, {  4559, 2893,  4559, 2893}, {  7282, 4559,  7282, 4559}, {  4559, 2893,  4559, 2893} }
+    };
+    int32_t qbits = 15 + div6[QP];
+    int32_t f = (1<<qbits)/3;
+    int mod = rem6[QP];
+    DCTELEM outblock[4][4];
+    
+    ff_h264_dct_c(block, outblock);
+    
+    if (dontscaleDC)
+        block[0][0] = outblock[0][0];
+    else
+		FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(0,0);
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(0,1);
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(0,2);
+	FF_H264_TRANSFORM_DCT_QUANT_C_ELEMENT(0,3);
+
+	FF_H264_TRANSFORM_DCT_QUANT_C_LINE(1);
+	FF_H264_TRANSFORM_DCT_QUANT_C_LINE(2);
+	FF_H264_TRANSFORM_DCT_QUANT_C_LINE(3);
+}
+
+#define H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(X, Y) \
+        elem[X][Y] = ((int32_t)block[X][Y]*V[mod][X][Y]) << shift;
+
+#define H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE(X) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(X, 0) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(X, 1) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(X, 2) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(X, 3)
+
+#define H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(X, Y) \
+	elem[X][Y] = ((int32_t)block[X][Y]*V[mod][X][Y]+add) >> shift;
+
+#define H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE2(X) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(X, 0) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(X, 1) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(X, 2) \
+	H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(X, 3)
+
+void ff_h264_transform_inverse_quant_dct_add_c(int16_t block[4][4], int QP, int dontscaleDC, uint8_t *dst, int stride) // y,x indexing
+{
+    static const int16_t V[6][4][4] = 
+    {
+        { { 10*16, 13*16, 10*16, 13*16}, { 13*16, 16*16, 13*16, 16*16}, { 10*16, 13*16, 10*16, 13*16}, { 13*16, 16*16, 13*16, 16*16} },
+        { { 11*16, 14*16, 11*16, 14*16}, { 14*16, 18*16, 14*16, 18*16}, { 11*16, 14*16, 11*16, 14*16}, { 14*16, 18*16, 14*16, 18*16} },
+        { { 13*16, 16*16, 13*16, 16*16}, { 16*16, 20*16, 16*16, 20*16}, { 13*16, 16*16, 13*16, 16*16}, { 16*16, 20*16, 16*16, 20*16} },
+        { { 14*16, 18*16, 14*16, 18*16}, { 18*16, 23*16, 18*16, 23*16}, { 14*16, 18*16, 14*16, 18*16}, { 18*16, 23*16, 18*16, 23*16} },
+        { { 16*16, 20*16, 16*16, 20*16}, { 20*16, 25*16, 20*16, 25*16}, { 16*16, 20*16, 16*16, 20*16}, { 20*16, 25*16, 20*16, 25*16} },
+        { { 18*16, 23*16, 18*16, 23*16}, { 23*16, 29*16, 23*16, 29*16}, { 18*16, 23*16, 18*16, 23*16}, { 23*16, 29*16, 23*16, 29*16} }
+    };
+    DCTELEM elem[4][4];
+    int mod = rem6[QP];
+
+    if (QP >= 24)
+    {
+        int shift = div6[QP]-4;
+        
+        if (dontscaleDC)
+            elem[0][0] = block[0][0];
+        else
+			H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(0, 0);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(0, 1);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(0, 2);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT(0, 3);
+        
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE(1);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE(2);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE(3);
+    }
+    else
+    {
+        int add = (1<<(3-div6[QP]));
+        int shift = (4-div6[QP]);
+        if (dontscaleDC)
+            elem[0][0] = block[0][0];
+        else
+			H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(0, 0);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(0, 1);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(0, 2);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_ELEMENT2(0, 3);
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE2(1); 
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE2(2); 
+		H264_TRANSFORM_INVERSE_QUANT_DCT_ADD_C_LINE2(3); 
+        if (dontscaleDC)
+            elem[0][0] = block[0][0];
+    }
+    
+    ff_h264_idct_add_c(dst,&(elem[0][0]),stride);
+}
+
+#define FF_H264_HADAMARD_QUANT_4X4_C_ELEMENT(A, B) \
+    Y[A][B] = COPY_SIGN((((ABS(Y[A][B])>>1) * MF + f2) >> shift), Y[A][B]);
+
+#define FF_H264_HADAMARD_QUANT_4X4_C_LINE(X) \
+	FF_H264_HADAMARD_QUANT_4X4_C_ELEMENT(X, 0); \
+	FF_H264_HADAMARD_QUANT_4X4_C_ELEMENT(X, 1); \
+	FF_H264_HADAMARD_QUANT_4X4_C_ELEMENT(X, 2); \
+	FF_H264_HADAMARD_QUANT_4X4_C_ELEMENT(X, 3);
+	
+/**
+ * |ZD(i,j)| = (|YD(i,j)| MF(0,0) + 2 f) >> (qbits + 1)
+ *
+ */
+void ff_h264_hadamard_quant_4x4_c(DCTELEM Y[4][4], int QP)
+{
+    int qbits = 15 + div6[QP];
+    int f2 = ((1 << qbits) / 3)*2;
+    int shift = (qbits + 1);
+    int mod = rem6[QP];
+
+    int32_t MF = ff_h264_MF00[mod];
+    
+	FF_H264_HADAMARD_QUANT_4X4_C_LINE(0);
+	FF_H264_HADAMARD_QUANT_4X4_C_LINE(1);
+	FF_H264_HADAMARD_QUANT_4X4_C_LINE(2);
+	FF_H264_HADAMARD_QUANT_4X4_C_LINE(3);
+}
+
+#define H264_HADAMARD_INVQUANT_4X4_C_LOWQP_ELEMENT(A, B) \
+	Y[A][B] = (Y[A][B]*V + f) >> shift;
+
+#define H264_HADAMARD_INVQUANT_4X4_C_LOWQP_LINE(A) \
+	H264_HADAMARD_INVQUANT_4X4_C_LOWQP_ELEMENT(A, 0) \
+	H264_HADAMARD_INVQUANT_4X4_C_LOWQP_ELEMENT(A, 1) \
+	H264_HADAMARD_INVQUANT_4X4_C_LOWQP_ELEMENT(A, 2) \
+	H264_HADAMARD_INVQUANT_4X4_C_LOWQP_ELEMENT(A, 3)
+
+#define H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_ELEMENT(A,B) \
+	Y[A][B] = (Y[A][B]*V) << shift ;
+
+#define H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_LINE(A) \
+	H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_ELEMENT(A, 0) \
+	H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_ELEMENT(A, 1) \
+	H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_ELEMENT(A, 2) \
+	H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_ELEMENT(A, 3)
+
+/*
+ * Only if qpprime_y_zero_transform_bypass_flag == 0
+ */
+void ff_h264_hadamard_invquant_4x4_c(DCTELEM Y[4][4], int QP)
+{
+    int mod = rem6[QP];
+    
+    if (QP < 36)
+    {
+        int qbits = div6[QP];
+        int shift = 6-qbits;
+        int f = (1 << (5-qbits));
+        
+        int32_t V = ff_h264_V00[mod];
+        
+		H264_HADAMARD_INVQUANT_4X4_C_LOWQP_LINE(0);
+		H264_HADAMARD_INVQUANT_4X4_C_LOWQP_LINE(1);
+		H264_HADAMARD_INVQUANT_4X4_C_LOWQP_LINE(2);
+		H264_HADAMARD_INVQUANT_4X4_C_LOWQP_LINE(3);
+    }
+    else
+    {
+        int shift = div6[QP] - 6;
+        int32_t V = ff_h264_V00[mod];
+        
+		H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_LINE(0);
+		H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_LINE(1);
+		H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_LINE(2);
+		H264_HADAMARD_INVQUANT_4X4_C_HIGHQP_LINE(3);
+    }
+}
+
+#define FF_H264_HADAMARD_QUANT_2X2_C_ELEMENT(A, B) \
+    Y[A][B] = COPY_SIGN(((ABS(Y[A][B])*MF + f2) >> shift),Y[A][B])
+	
+/**
+ * |ZD(i,j)| = (|YD(i,j)| MF(0,0) + 2 f) >> (qbits + 1)
+ *
+ */
+void ff_h264_hadamard_quant_2x2_c(int16_t Y[2][2], int QP)
+{
+    int qbits = 15 + div6[QP];
+    int f2 = ((1 << qbits) / 3)*2;
+    int shift = qbits+1;
+    int32_t MF = ff_h264_MF00[rem6[QP]];
+
+	FF_H264_HADAMARD_QUANT_2X2_C_ELEMENT(0, 0);
+	FF_H264_HADAMARD_QUANT_2X2_C_ELEMENT(0, 1);
+	FF_H264_HADAMARD_QUANT_2X2_C_ELEMENT(1, 0);
+	FF_H264_HADAMARD_QUANT_2X2_C_ELEMENT(1, 1);
+}
+
 static void just_return() { return; }
 
 /* init static data */
@@ -3873,6 +4090,15 @@ void dsputil_init(DSPContext* c, AVCodec
     c->h264_idct_dc_add= ff_h264_idct_dc_add_c;
     c->h264_idct8_dc_add= ff_h264_idct8_dc_add_c;
 
+    c->h264_dct = ff_h264_dct_c;
+    c->h264_idct_notranspose_add = ff_h264_idct_add_c;
+    c->h264_hadamard_mult4x4 = ff_h264_hadamard_mult4x4_c;
+    c->h264_hadamard_quant_2x2 = ff_h264_hadamard_quant_2x2_c;
+    c->h264_hadamard_quant_4x4 = ff_h264_hadamard_quant_4x4_c;
+    c->h264_hadamard_invquant_4x4 = ff_h264_hadamard_invquant_4x4_c;
+    c->h264_transform_dct_quant = ff_h264_transform_dct_quant_c;
+    c->h264_transform_inverse_quant_dct_add = ff_h264_transform_inverse_quant_dct_add_c;
+ 
     c->get_pixels = get_pixels_c;
     c->diff_pixels = diff_pixels_c;
     c->put_pixels_clamped = put_pixels_clamped_c;
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index fb84b20..5dc414b 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -57,6 +57,13 @@ void ff_h264_idct8_dc_add_c(uint8_t *dst
 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
 void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block);
 void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block);
+void ff_h264_dct_c(DCTELEM inblock[4][4], DCTELEM outblock[4][4]);
+void ff_h264_hadamard_mult4x4_c(DCTELEM Y[4][4]);
+void ff_h264_transform_dct_quant_c(int16_t block[4][4], int QP, int dontscaleDC);
+void ff_h264_hadamard_quant_4x4_c(DCTELEM Y[4][4], int QP);
+void ff_h264_hadamard_quant_2x2_c(int16_t Y[2][2], int QP);
+void ff_h264_hadamard_invquant_4x4_c(DCTELEM Y[4][4], int QP);
+void ff_h264_transform_inverse_quant_dct_add_c(int16_t block[4][4], int QP, int dontscaleDC, uint8_t *dst, int stride);
 
 /* encoding scans */
 extern const uint8_t ff_alternate_horizontal_scan[64];
@@ -356,6 +363,14 @@ typedef struct DSPContext {
     void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
     void (*h264_idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
     void (*h264_idct8_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
+    void (*h264_dct)(DCTELEM inblock[4][4], DCTELEM outblock[4][4]);
+    void (*h264_idct_notranspose_add)(uint8_t *dst, DCTELEM *block, int stride);
+    void (*h264_hadamard_mult4x4)(DCTELEM Y[4][4]);
+    void (*h264_hadamard_quant_2x2)(int16_t Y[2][2], int QP);
+    void (*h264_hadamard_quant_4x4)(DCTELEM Y[4][4], int QP);
+    void (*h264_hadamard_invquant_4x4)(DCTELEM Y[4][4], int QP);
+    void (*h264_transform_dct_quant)(int16_t block[4][4], int QP, int dontscaleDC);
+    void (*h264_transform_inverse_quant_dct_add)(int16_t block[4][4], int QP, int dontscaleDC, uint8_t *dst, int stride);
 
     /* snow wavelet */
     void (*vertical_compose97i)(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ad25c7c..e95a3f2 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -163,20 +163,6 @@ typedef struct H264Context{
     MpegEncContext s;
     int nal_ref_idc;
     int nal_unit_type;
-#define NAL_SLICE                1
-#define NAL_DPA                  2
-#define NAL_DPB                  3
-#define NAL_DPC                  4
-#define NAL_IDR_SLICE            5
-#define NAL_SEI                  6
-#define NAL_SPS                  7
-#define NAL_PPS                  8
-#define NAL_AUD                  9
-#define NAL_END_SEQUENCE        10
-#define NAL_END_STREAM          11
-#define NAL_FILLER_DATA         12
-#define NAL_SPS_EXT             13
-#define NAL_AUXILIARY_SLICE     19
     uint8_t *rbsp_buffer;
     unsigned int rbsp_buffer_size;
 
@@ -418,6 +404,15 @@ static always_inline uint32_t pack16to32
 #endif
 }
 
+const uint8_t rem6[52]={
+0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
+};
+
+const uint8_t div6[52]={
+0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
+};
+
+
 /**
  * fill a rectangle.
  * @param h height of the rectangle, should be a constant
@@ -1810,7 +1805,7 @@ static uint8_t *decode_nal(H264Context *
  * @param dst_length the length of the dst array
  * @returns length of escaped data in bytes or -1 if an error occured
  */
-static int encode_nal(H264Context *h, uint8_t *dst, uint8_t *src, int length, int dst_length){
+int encode_nal(H264Context *h, uint8_t *dst, uint8_t *src, int length, int dst_length){
     int i, escape_count, si, di;
     uint8_t *temp;
 
@@ -4099,7 +4094,7 @@ static int decode_ref_pic_list_reorderin
     return 0;
 }
 
-static void fill_mbaff_ref_list(H264Context *h){
+static int fill_mbaff_ref_list(H264Context *h){
     int list, i, j;
     for(list=0; list<2; list++){
         for(i=0; i<h->ref_count[list]; i++){
diff --git a/libavcodec/h264cavlc.c b/libavcodec/h264cavlc.c
new file mode 100644
index 0000000..23ecc08
--- /dev/null
+++ b/libavcodec/h264cavlc.c
@@ -0,0 +1,331 @@
+/*
+ * H.264 encoder
+ * Copyright (c) 2006 Expertisecentrum Digitale Media, UHasselt
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "common.h"
+#include "dsputil.h"
+#include "avcodec.h"
+#include "bitstream.h"
+#include "mpegvideo.h"
+#include "h264data.h"
+#include "h264encdata.h"
+
+//#define DEBUG_H264CAVLC
+
+static int length_table[7][4095];
+static int code_table[7][4095];
+int16_t ff_h264_cavlc_cliptable[H264_CAVLC_CLIPTABLE_SIZE];
+
+void h264cavlc_generate_cliptable()
+{
+	int value;
+	for(value=-32768; value<32768; value++)
+	{
+		if (value < -2047)
+			ff_h264_cavlc_cliptable[value + H264_CAVLC_CLIPTABLE_OFFSET] = -2047;
+		else if (value > 2047)
+			ff_h264_cavlc_cliptable[value + H264_CAVLC_CLIPTABLE_OFFSET] = 2047;
+		else
+			ff_h264_cavlc_cliptable[value + H264_CAVLC_CLIPTABLE_OFFSET] = value;
+	}
+}
+
+void h264cavlc_generate_tables()
+{
+	int vlcnum, level;
+	for (vlcnum=0; vlcnum<7; vlcnum++)
+	{
+		for(level=-2047; level<2048; level++)
+		{
+			if (vlcnum == 0)
+			{
+				int len, inf;
+				int sign = level < 0; 
+				int levabs = ABS(level);
+
+				if (levabs < 8)
+				{
+					len = levabs * 2 + sign - 1;
+					inf = 1;
+				}
+				else if (levabs < 8+8)
+				{
+					len = 14 + 1 + 4;
+					inf = (1 << 4) | ((levabs - 8) << 1) | sign;
+				}
+				else
+				{
+					len = 14 + 2 + 12;
+					inf = (0x1 << 12) | ((levabs - 16)<< 1) | sign;
+				}
+				length_table[vlcnum][level+2047] = len;
+				code_table[vlcnum][level+2047] = inf;
+			}
+			else
+			{
+				int iCodeword;
+				int iLength;
+				int shift = vlcnum-1;
+				int escape = (15<<shift)+1;
+				int numPrefix;
+				int sufmask = ~((0xffffffff)<<shift);
+				int suffix;
+				int len,inf;
+				int sign = level < 0;
+				int levabs = ABS(level);
+
+				numPrefix = (levabs-1)>>shift;
+				suffix = (levabs-1)&sufmask;
+
+#ifdef DEBUG_H264CAVLC
+				printf("numPrefix %d | suffix %d | levabs %d | escape %d | sufmask %d | vlcnum %d | level %d | sign %d\n",
+						numPrefix,suffix,levabs,escape,sufmask,vlcnum,level,sign);
+#endif // DEBUG_H264CAVLC
+				if (levabs < escape)
+				{
+					iLength = numPrefix + vlcnum + 1;
+					iCodeword = (1<<(shift+1))|(suffix<<1)|sign;
+				}
+				else
+				{
+					iLength = 28;
+					iCodeword = (1<<12)|((levabs-escape)<<1)|sign;
+				}
+				len = iLength;
+				inf = iCodeword;
+
+#ifdef DEBUG_H264CAVLC
+				printf("len %d | code %d\n",len,inf);
+#endif // DEBUG_H264CAVLC
+
+				length_table[vlcnum][level+2047] = len;
+				code_table[vlcnum][level+2047] = inf;
+			}
+		}
+	}
+}
+
+static inline void h264cavlc_encode_vlc_level(PutBitContext *b, int vlcnum, int16_t level)
+{
+	int16_t index;
+	index = level+2047;
+	put_bits(b,length_table[vlcnum][index],code_table[vlcnum][index]);
+#ifdef DEBUG_H264CAVLC
+//	av_log(NULL, AV_LOG_DEBUG, "Encoded level with number %d\n",code_table[vlcnum][index]);	
+#endif 
+}
+
+static inline void h264cavlc_encode_vlc_totalzeros(PutBitContext *b, int vlcnum, int total_zeros)
+{
+	put_bits(b,total_zeros_len[vlcnum][total_zeros],total_zeros_bits[vlcnum][total_zeros]);
+}
+
+static inline void h264cavlc_encode_vlc_run(PutBitContext *b, int vlcnum, int runbefore)
+{
+	put_bits(b,run_len[vlcnum][runbefore],run_bits[vlcnum][runbefore]);
+}
+
+static inline void h264cavlc_encode_vlc_coefftoken(PutBitContext *b, int lookup_table, int total_coeffs, int trailing_ones)
+{
+	put_bits(b,coeff_token_len[lookup_table][trailing_ones+total_coeffs*4],coeff_token_bits[lookup_table][trailing_ones+total_coeffs*4]);
+}
+
+static inline void h264cavlc_encode_vlc_coefftoken_chromadc(PutBitContext *b, int total_coeffs, int trailing_ones)
+{
+	put_bits(b,chroma_dc_coeff_token_len[trailing_ones + total_coeffs * 4],chroma_dc_coeff_token_bits[trailing_ones + total_coeffs * 4]);
+}
+
+static inline void h264cavlc_encode_vlc_totalzeros_chromadc(PutBitContext *b, int vlcnum, int value)
+{
+	if(vlcnum + value == 3) put_bits(b, value  , 0);
+	else                    put_bits(b, value+1, 1);
+}
+
+static inline int h264cavlc_get_lookup_table(int na, int nb)
+{
+	int nc = 0;
+	int8_t lookup_table[8] = {0, 0, 1, 1, 2, 2, 2, 2};
+
+	if (na >= 0 && nb >= 0)
+	{
+		nc = na+nb+1;
+		nc >>= 1;
+	}
+	else 
+	{
+		if (na >= 0) // nB < 0
+			nc = na;
+		else if (nb >= 0) // nA < 0
+			nc = nb;
+	}
+
+	return (nc < 8) ? lookup_table[nc] : 3;
+}
+
+int h264cavlc_encode(PutBitContext *b, int16_t *coefficients, int len, int na, int nb, int is_chroma_dc)
+{
+	static const int8_t increment_vlcnum[6] = { 0, 3, 6, 12, 24, 48 };
+
+	int i, t;
+	int total_coeffs;
+	int trailing_ones;
+	int total_zeros;
+	int numlevels;
+	int16_t levels[256];
+	int16_t zeros[256];
+
+#ifdef DEBUG_H264CAVLC
+	for (i = 0 ; i < len ; i++)
+		av_log(NULL, AV_LOG_DEBUG, "%6d",coefficients[i]);
+	av_log(NULL, AV_LOG_DEBUG, "\n");
+#endif 
+
+	// Count traling ones, total non-zero coefficients and the number of non-trailing zeros
+
+	total_coeffs = 0;
+	trailing_ones = 0;
+	total_zeros = 0; // For now, we'll count the number of zeros at the end
+	for (i = 0 ; i < len ; i++)
+	{
+		int16_t val = coefficients[i];
+		if (val != 0)
+		{
+			levels[total_coeffs] = val;
+			zeros[total_coeffs] = total_zeros;
+			if (val == -1 || val == +1)
+				trailing_ones++;
+			else
+				trailing_ones = 0;
+			total_coeffs++;
+			total_zeros = 0;
+		}
+		else
+			total_zeros++;
+	}
+	if (trailing_ones > 3)
+		trailing_ones = 3;
+	
+	total_zeros = len - total_zeros - total_coeffs; // The actual value of zeros (except the zeros at the end)
+	numlevels = total_coeffs - trailing_ones;
+
+	// Encode coeff_token. This is different for Chroma DC values  
+	
+	if (!is_chroma_dc)
+	{	
+		int lookupTable = h264cavlc_get_lookup_table(na,nb);
+#ifdef DEBUG_H264CAVLC
+//		av_log(NULL, AV_LOG_DEBUG, "Luma: vlc=%d #c=%d #t1=%d\n", lookupTable, total_coeffs, trailing_ones);
+#endif 
+		h264cavlc_encode_vlc_coefftoken(b,lookupTable,total_coeffs,trailing_ones);
+	}
+	else
+	{
+#ifdef DEBUG_H264CAVLC
+//		av_log(NULL, AV_LOG_DEBUG, "Chroma: #c=%d #t1=%d\n", total_coeffs, trailing_ones);
+#endif 
+		h264cavlc_encode_vlc_coefftoken_chromadc(b,total_coeffs,trailing_ones);
+	}
+	if (total_coeffs == 0) // Only zeros here, nothing left to do
+		return 0;
+  
+	// Encode the trailing one sign bits
+	
+	for (i = total_coeffs-1, t = trailing_ones ; t > 0 ; i--, t--)
+	{
+		put_bits(b,1, levels[i] <= 0);
+	}
+	
+	// Encode levels of the remaining nonzero coefficients
+
+	if (numlevels > 0)
+	{
+		int level_two_or_higher = 1;
+		int firstlevel = 1;
+		int vlcnum;
+		
+		if (total_coeffs > 3 && trailing_ones == 3)
+			level_two_or_higher = 0;
+	
+		vlcnum = total_coeffs > 10 && trailing_ones < 3;
+	
+		for (i = numlevels-1 ; i >= 0 ; i--)
+		{
+			int16_t val = levels[i];
+			int16_t level = ABS(val);
+	
+			if (level_two_or_higher)
+			{
+				if (val > 0)
+					val--;
+				else // < 0
+					val++;
+				level_two_or_higher = 0;
+			}
+			
+#ifdef DEBUG_H264CAVLC
+//			av_log(NULL, AV_LOG_DEBUG, "Encoding level %d with vlc %d\n",val,vlcnum);
+#endif 
+			h264cavlc_encode_vlc_level(b,vlcnum,val);
+			  
+			// update VLC table
+			if (vlcnum < 6 && level > increment_vlcnum[vlcnum])
+				vlcnum++;
+	
+			if (firstlevel)
+			{
+				firstlevel = 0;
+				if (level > 3)
+					vlcnum = 2;
+			}
+		}
+	}
+
+	// If necessary, encode the amount of non-trailing zeros
+	
+	if (total_coeffs < len)
+	{
+		int vlcnum = total_coeffs-1;
+		
+#ifdef DEBUG_H264CAVLC
+//		av_log(NULL, AV_LOG_DEBUG, "Encoding total_zeros %d with vlc %d\n",total_zeros,vlcnum);
+#endif 
+
+		if (!is_chroma_dc)
+			h264cavlc_encode_vlc_totalzeros(b,vlcnum,total_zeros);
+		else
+			h264cavlc_encode_vlc_totalzeros_chromadc(b,vlcnum,total_zeros);
+	}
+
+	// If necessary, encode the run_before values
+
+	for (i = total_coeffs-1 ; i > 0 && total_zeros > 0 ; i--)
+	{
+		int runbefore = zeros[i];
+		int vlcnum = FFMIN(total_zeros-1, 6);
+	
+#ifdef DEBUG_H264CAVLC
+//		av_log(NULL, AV_LOG_DEBUG, "Encoding run %d with vlc %d\n",runbefore,vlcnum);
+#endif 
+	
+		h264cavlc_encode_vlc_run(b,vlcnum,runbefore);
+		total_zeros -= runbefore;
+	}
+
+	return total_coeffs;
+}
+
diff --git a/libavcodec/h264data.h b/libavcodec/h264data.h
index 1dd9daf..6ee2204 100644
--- a/libavcodec/h264data.h
+++ b/libavcodec/h264data.h
@@ -51,6 +51,24 @@
 
 #define EXTENDED_SAR          255
 
+/* NAL unit types */
+enum {
+NAL_SLICE=1,
+NAL_DPA,
+NAL_DPB,
+NAL_DPC,
+NAL_IDR_SLICE,
+NAL_SEI,
+NAL_SPS,
+NAL_PPS,
+NAL_AUD,
+NAL_END_SEQUENCE,
+NAL_END_STREAM,
+NAL_FILLER_DATA,
+NAL_SPS_EXT,
+NAL_AUXILIARY_SLICE=19
+};
+
 static const AVRational pixel_aspect[14]={
  {0, 1},
  {1, 1},
@@ -486,15 +504,6 @@ static const PMbInfo b_sub_mb_type_info[
 {MB_TYPE_8x8  |MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_P1L0|MB_TYPE_P1L1, 4, },
 };
 
-
-static const uint8_t rem6[52]={
-0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
-};
-
-static const uint8_t div6[52]={
-0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
-};
-
 static const uint8_t default_scaling4[2][16]={
 {   6,13,20,28,
    13,20,28,32,
diff --git a/libavcodec/h264enc.c b/libavcodec/h264enc.c
new file mode 100644
index 0000000..4910ca9
--- /dev/null
+++ b/libavcodec/h264enc.c
@@ -0,0 +1,3003 @@
+/*
+ * H.264 encoder
+ * Copyright (c) 2006 Expertisecentrum Digitale Media, UHasselt
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "common.h"
+#include "avcodec.h"
+#include "bitstream.h"
+#include "golomb.h"
+#include "mpegvideo.h"
+#include "h264data.h"
+#include "dsputil.h"
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "h264enc.h"
+
+#define DEFAULT_QP	30
+//#define DISABLE_DEBLOCKING
+//#define H264_DEBUG_WRITE_DECODED_IMAGE
+//#define H264_ENABLE_QPEL
+#define NUMBER_OF_FRAMES 2
+#define RATECONTROLINTERVAL 0.5
+#define CHROMA_QP_INDEX_OFFSET_MAX 12
+#define CHROMA_QP_INDEX_OFFSET_MIN -12
+
+#define H264_COPY_4X4BLOCK_TRANSPOSED_PART(A, xoffset, yoffset, dest, src1, src2) \
+	dest[0][A] = src1[yoffset+A][xoffset+0]-src2[yoffset+A][xoffset+0]; \
+	dest[1][A] = src1[yoffset+A][xoffset+1]-src2[yoffset+A][xoffset+1]; \
+	dest[2][A] = src1[yoffset+A][xoffset+2]-src2[yoffset+A][xoffset+2]; \
+	dest[3][A] = src1[yoffset+A][xoffset+3]-src2[yoffset+A][xoffset+3];
+
+#define H264_COPY_4X4BLOCK_TRANSPOSED(xoffset,yoffset,dest,src1,src2) \
+{ \
+	H264_COPY_4X4BLOCK_TRANSPOSED_PART(0, xoffset, yoffset, dest, src1, src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED_PART(1, xoffset, yoffset, dest, src1, src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED_PART(2, xoffset, yoffset, dest, src1, src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED_PART(3, xoffset, yoffset, dest, src1, src2); \
+}
+
+#define H264_COPY_16X16BLOCK(dest,src1,src2) \
+{ \
+	H264_COPY_4X4BLOCK_TRANSPOSED(0,0,dest[0][0],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(4,0,dest[0][1],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(8,0,dest[0][2],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(12,0,dest[0][3],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(0,4,dest[1][0],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(4,4,dest[1][1],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(8,4,dest[1][2],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(12,4,dest[1][3],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(0,8,dest[2][0],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(4,8,dest[2][1],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(8,8,dest[2][2],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(12,8,dest[2][3],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(0,12,dest[3][0],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(4,12,dest[3][1],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(8,12,dest[3][2],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(12,12,dest[3][3],src1,src2); \
+}
+	
+#define H264_COPY_8X8BLOCK(dest,src1,src2) \
+{ \
+	H264_COPY_4X4BLOCK_TRANSPOSED(0,0,dest[0][0],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(4,0,dest[0][1],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(0,4,dest[1][0],src1,src2); \
+	H264_COPY_4X4BLOCK_TRANSPOSED(4,4,dest[1][1],src1,src2); \
+}
+
+int h264cavlc_encode(PutBitContext *b, int16_t *coefficients, int len, int nA, int nB, int isChromaDC);
+void h264cavlc_generate_tables();
+void h264cavlc_generate_cliptable();
+void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride);
+extern int16_t ff_h264_cavlc_cliptable[H264_CAVLC_CLIPTABLE_SIZE];
+
+#ifdef H264_DEBUG_WRITE_DECODED_IMAGE
+static void ff_h264_append_image(uint8_t *data, AVCodecContext *avctx)
+{
+	int f = open("/tmp/teststream.yuv",O_CREAT|O_WRONLY|O_APPEND,S_IRUSR|S_IWUSR);
+	write(f,data,avctx->width*avctx->height*3/2);
+	close(f);
+}
+#endif
+
+/**
+ * For a specific picture, this function sets the correct Y,U and V start addresses for each macroblock
+ */
+static void ff_h264_assign_macroblocks(AVPicture *p, MacroBlock **mb_map, int mb_width, int mb_height, int setneighbours)
+{
+	int y,x,i;
+	int Ylinesize = p->linesize[0];
+	int Ulinesize = p->linesize[1];
+	int Vlinesize = p->linesize[2];
+
+	if (!setneighbours)
+	{
+		for (y = 0 ; y < mb_height ; y++)
+		{
+			int y16 = y << 4;
+			int y8 = y << 3;
+			
+			for (x = 0 ; x < mb_width ; x++)
+			{
+				int x16 = x << 4;
+				int x8 = x << 3;
+				
+				for (i = 0 ; i < 8 ; i++)
+				{
+					int ypos = y8+i;
+					mb_map[y][x].U[i] = p->data[1]+(x8+ypos*Ulinesize);
+					mb_map[y][x].V[i] = p->data[2]+(x8+ypos*Vlinesize);
+				}
+				for (i = 0 ; i < 16 ; i++)
+					mb_map[y][x].Y[i] = p->data[0]+(x16+(y16+i)*Ylinesize);
+				
+				mb_map[y][x].topblock = NULL;
+				mb_map[y][x].leftblock = NULL;
+				mb_map[y][x].rightblock = NULL;
+				mb_map[y][x].available = 0;
+			}
+		}
+	}
+	else
+	{
+		y = 0;
+		x = 0;
+		for (i = 0 ; i < 8 ; i++)
+		{
+			mb_map[y][x].U[i] = p->data[1]+((x<<3)+((y<<3)+i)*Ulinesize);
+			mb_map[y][x].V[i] = p->data[2]+((x<<3)+((y<<3)+i)*Vlinesize);
+		}
+		for (i = 0 ; i < 16 ; i++)
+			mb_map[y][x].Y[i] = p->data[0]+((x<<4)+((y<<4)+i)*Ylinesize);
+				
+		mb_map[y][x].topblock = NULL;
+		mb_map[y][x].leftblock = NULL;
+
+		if (x < mb_width-1)
+			mb_map[y][x].rightblock = &(mb_map[y][x+1]);
+		else
+			mb_map[y][x].rightblock = NULL;
+		mb_map[y][x].available = 0;
+		
+		y = 0;
+		for (x = 1 ; x < mb_width ; x++)
+		{
+			for (i = 0 ; i < 8 ; i++)
+			{
+				mb_map[y][x].U[i] = p->data[1]+((x<<3)+((y<<3)+i)*Ulinesize);
+				mb_map[y][x].V[i] = p->data[2]+((x<<3)+((y<<3)+i)*Vlinesize);
+			}
+			for (i = 0 ; i < 16 ; i++)
+				mb_map[y][x].Y[i] = p->data[0]+((x<<4)+((y<<4)+i)*Ylinesize);
+				
+			mb_map[y][x].topblock = NULL;
+			mb_map[y][x].leftblock = &(mb_map[y][x-1]);
+			if (x < mb_width-1)
+				mb_map[y][x].rightblock = &(mb_map[y][x+1]);
+			else
+				mb_map[y][x].rightblock = NULL;
+			mb_map[y][x].available = 0;
+		}
+		
+		x = 0;
+		for (y = 1 ; y < mb_height ; y++)
+		{		
+			for (i = 0 ; i < 8 ; i++)
+			{
+				mb_map[y][x].U[i] = p->data[1]+((x<<3)+((y<<3)+i)*Ulinesize);
+				mb_map[y][x].V[i] = p->data[2]+((x<<3)+((y<<3)+i)*Vlinesize);
+			}
+			for (i = 0 ; i < 16 ; i++)
+				mb_map[y][x].Y[i] = p->data[0]+((x<<4)+((y<<4)+i)*Ylinesize);
+				
+			mb_map[y][x].topblock = &(mb_map[y-1][x]);
+			mb_map[y][x].leftblock = NULL;
+			if (x < mb_width-1)
+				mb_map[y][x].rightblock = &(mb_map[y][x+1]);
+			else
+				mb_map[y][x].rightblock = NULL;
+			mb_map[y][x].available = 0;
+		}
+		
+		for (y = 1 ; y < mb_height ; y++)
+		{
+			for (x = 1 ; x < mb_width ; x++)
+			{
+				for (i = 0 ; i < 8 ; i++)
+				{
+					mb_map[y][x].U[i] = p->data[1]+((x<<3)+((y<<3)+i)*Ulinesize);
+					mb_map[y][x].V[i] = p->data[2]+((x<<3)+((y<<3)+i)*Vlinesize);
+				}
+				for (i = 0 ; i < 16 ; i++)
+					mb_map[y][x].Y[i] = p->data[0]+((x<<4)+((y<<4)+i)*Ylinesize);
+				
+				mb_map[y][x].topblock = &(mb_map[y-1][x]);
+				mb_map[y][x].leftblock = &(mb_map[y][x-1]);
+				if (x < mb_width-1)
+					mb_map[y][x].rightblock = &(mb_map[y][x+1]);
+				else
+					mb_map[y][x].rightblock = NULL;
+				mb_map[y][x].available = 0;
+			}
+		}
+	}
+}
+
+static void ff_h264_clear_nonzero_markers(MacroBlock **mb_map, int mb_width, int mb_height)
+{
+	int x,y;
+	
+	for (y = 0 ; y < mb_height ; y++)
+	{
+		for (x = 0 ; x < mb_width ; x++)
+		{
+			// mark as not available
+
+			memset(&(mb_map[y][x].Y_nonzero[0][0]),0xff,sizeof(int)*16); // set to -1
+			memset(&(mb_map[y][x].U_nonzero[0][0]),0xff,sizeof(int)*4); // set to -1
+			memset(&(mb_map[y][x].V_nonzero[0][0]),0xff,sizeof(int)*4); // set to -1
+	
+			mb_map[y][x].available = 0;
+		}
+	}
+}
+
+static int ff_h264_encoder_init(AVCodecContext *avctx)
+{
+	H264Context *t = (H264Context *)avctx->priv_data;
+	uint8_t *buf;
+	int s,x,y,i;
+	int width, height;
+
+    switch(avctx->pix_fmt){
+    case PIX_FMT_YUV420P:
+		break;
+    default:
+        av_log(avctx, AV_LOG_ERROR, "format not supported\n");
+        return -1;
+    }
+
+	t->frame_cropping_flag = 0;	
+	t->frame_crop_left_offset = 0;
+	t->frame_crop_right_offset = 0;
+	t->frame_crop_top_offset = 0;
+	t->frame_crop_bottom_offset = 0;
+
+	width = avctx->width;
+	height = avctx->height;
+	av_log(avctx, AV_LOG_DEBUG, "width: %d height: %d wr: %d hr: %d mb_width: %d mb_height: %d \n", width, height,  width%16, height%16, t->mb_width, t->mb_height);
+	
+	t->mb_width = width/16;
+	t->mb_height = height/16;
+	t->frame_width = width;
+	t->frame_height = height;
+
+	if (( width % 16) !=0 )
+	{
+		t->frame_cropping_flag = 1;	
+		t->frame_crop_left_offset = 0;
+		t->frame_crop_right_offset = (width%16)/2;
+		t->mb_width++;
+	}
+
+	if (( height % 16) !=0 )
+	{
+		t->frame_cropping_flag = 1;	
+		t->frame_crop_top_offset = 0;
+		t->frame_crop_bottom_offset = (height%16)/2;
+		t->mb_height++;
+	}
+
+	width = t->mb_width * 16;
+	height = t->mb_height * 16;
+	t->refframe_width = width;
+	t->refframe_height = height;
+
+	av_log(avctx, AV_LOG_DEBUG, "frame cropping: %d left: %d right: %d top: %d bottom: %d\n", 
+		t->frame_cropping_flag,
+		t->frame_crop_left_offset,
+		t->frame_crop_right_offset,
+		t->frame_crop_top_offset,
+		t->frame_crop_bottom_offset);
+
+	s = avpicture_get_size(avctx->pix_fmt, width, height);
+	avpicture_alloc(&t->pi, avctx->pix_fmt, width, height);
+	avpicture_alloc(&t->po, avctx->pix_fmt, width, height);
+	
+	t->bitstream = (uint8_t *)t->pi.data[0];
+	t->bytestream = (uint8_t *)t->po.data[0];
+	t->bufsize = s*2;
+	t->frame_num = 0;
+	
+	
+	av_log(avctx, AV_LOG_DEBUG, "width: %d height: %d wr: %d hr: %d mb_width: %d mb_height: %d \n", width, height,  width%16, height%16, t->mb_width, t->mb_height);
+	
+	t->mb_map = (MacroBlock **)av_malloc(sizeof(MacroBlock*) * t->mb_height);
+	for (y = 0 ; y < t->mb_height ; y++)
+	{
+		t->mb_map[y] = (MacroBlock *)av_malloc(sizeof(MacroBlock) * t->mb_width);
+		for (x = 0 ; x < t->mb_width ; x++)
+		{
+			t->mb_map[y][x].Y_width = 16;
+			t->mb_map[y][x].Y_height = 16;
+		}
+	}
+
+	t->framebufsize = NUMBER_OF_FRAMES;
+	t->reconstructed_frames = (FrameInfo **)av_malloc(sizeof(FrameInfo *)*t->framebufsize);
+
+	for (i = 0 ; i < t->framebufsize ; i++)
+	{
+		t->reconstructed_frames[i] = (FrameInfo *)av_malloc(sizeof(FrameInfo));
+	
+		buf = (uint8_t *)av_malloc(s);
+		avpicture_fill(&(t->reconstructed_frames[i]->reconstructed_picture), buf, PIX_FMT_YUV420P, width, height);
+	
+		t->reconstructed_frames[i]->reconstructed_mb_map = (MacroBlock **)av_malloc(sizeof(MacroBlock*) * t->mb_height);
+		for (y = 0 ; y < t->mb_height ; y++)
+		{
+			t->reconstructed_frames[i]->reconstructed_mb_map[y] = (MacroBlock *)av_malloc(sizeof(MacroBlock) * t->mb_width);
+			for (x = 0 ; x < t->mb_width ; x++)
+			{
+				t->reconstructed_frames[i]->reconstructed_mb_map[y][x].Y_width = 16;
+				t->reconstructed_frames[i]->reconstructed_mb_map[y][x].Y_height = 16;
+			}
+		}
+		ff_h264_assign_macroblocks(&(t->reconstructed_frames[i]->reconstructed_picture),t->reconstructed_frames[i]->reconstructed_mb_map,t->mb_width,t->mb_height,1);
+	}
+
+	if (!avctx->global_quality)
+	{
+		t->QP = DEFAULT_QP;
+		t->use_fixed_qp = 0;
+	}
+	else
+	{
+		t->QP = avctx->global_quality / FF_QP2LAMBDA;
+		t->use_fixed_qp = 1;
+	}
+	t->PPS_QP = t->QP;
+		
+	t->chroma_qp_index_offset = avctx->chromaoffset;
+	t->chroma_qp_index_offset = clip(t->chroma_qp_index_offset, CHROMA_QP_INDEX_OFFSET_MIN, CHROMA_QP_INDEX_OFFSET_MAX);
+	av_log(avctx, AV_LOG_DEBUG, "chroma_qp_index_offset: %d\n", t->chroma_qp_index_offset);
+	t->IDRcount = 64;
+	t->IDR_frame_num = 0;
+
+	// init dsp
+	dsputil_init(&(t->dspcontext),avctx);
+	t->Y_stride = t->reconstructed_frames[0]->reconstructed_picture.linesize[0];
+	t->U_stride = t->reconstructed_frames[0]->reconstructed_picture.linesize[1];
+	t->V_stride = t->reconstructed_frames[0]->reconstructed_picture.linesize[2];
+
+	// Create an AVPicture instance with the same dimensions as the reference pictures to hold a copy 
+	// of the input frame
+	buf = (uint8_t *)av_malloc(s);
+	avpicture_fill(&(t->input_frame_copy), buf, PIX_FMT_YUV420P, width, height);
+	memset(buf,0,s);
+
+	// Assign the macroblock map to this copy of the input image
+	ff_h264_assign_macroblocks(&(t->input_frame_copy),t->mb_map,t->mb_width,t->mb_height,0);
+
+	// Blocksize history, we use a separate history for I and P frame
+	t->milliseconds_per_frame = (1000*avctx->time_base.num)/avctx->time_base.den;
+	t->blocksize_history_length = (RATECONTROLINTERVAL*avctx->time_base.den)/avctx->time_base.num;
+	t->blocksize_history = (int64_t *)av_malloc(sizeof(int64_t)*t->blocksize_history_length);
+	t->blocksize_history_pos = 0;
+	t->blocksize_history_num_filled = 0;
+	t->blocksize_history_total_milliseconds = 0;
+	t->blocksize_history_sum = 0;
+	for (i = 0 ; i < t->blocksize_history_length ; i++)
+		t->blocksize_history[i] = 0;
+
+	h264cavlc_generate_tables();
+	h264cavlc_generate_cliptable();
+	return 0; 
+}
+
+static uint8_t *ff_h264_write_nal_unit(int nal_ref_idc, int nal_unit_type, uint8_t *dest, int *destsize,
+		                  PutBitContext *b2)
+{
+	PutBitContext b;
+	int i, destpos, rbsplen;
+	uint8_t *rbsp;
+	
+	// Align b2 on a byte boundary
+	
+	align_put_bits(b2);
+	rbsplen = put_bits_count(b2)/8;
+	flush_put_bits(b2);
+	rbsp = b2->buf;
+	
+	init_put_bits(&b,dest,*destsize);
+	
+	put_bits(&b,16,0);
+	put_bits(&b,16,0x01);
+	
+	put_bits(&b,1,0); // forbidden zero bit 
+	put_bits(&b,2,nal_ref_idc); // nal_ref_idc
+	put_bits(&b,5,nal_unit_type); // nal_unit_type 
+	
+	flush_put_bits(&b);
+
+	destpos = 5;
+	
+	for (i = 0 ; i < rbsplen ; i++)
+	{
+		if (i + 2 < rbsplen && (rbsp[i] == 0 && rbsp[i+1] == 0 && rbsp[i+2] < 4))
+		{
+			dest[destpos++] = rbsp[i++];
+			dest[destpos++] = rbsp[i];
+			dest[destpos++] = 0x03; // emulation prevention byte
+		}
+		else
+			dest[destpos++] = rbsp[i];
+	}
+	
+	*destsize -= destpos;
+	return dest+destpos;
+}
+
+static void ff_h264_encode_I_PCM(MacroBlock *mb, PutBitContext *b, MacroBlock *copy_mb)
+{		
+	int w = mb->Y_width;
+	int h = mb->Y_height;
+	int x,y;
+	
+	set_ue_golomb(b, 25); // mb_type = I_PCM
+	align_put_bits(b);
+
+	// Y
+
+	for (y = 0 ; y < h ; y++)
+	{
+		for (x = 0 ; x < w ; x++)
+			put_bits(b,8,mb->Y[y][x]);
+		for ( ; x < 16 ; x++)
+			put_bits(b,8,0);
+	}
+	for ( ; y < 16 ; y++)
+	{
+		for (x = 0 ; x < 16 ; x++)
+			put_bits(b,8,0);
+	}
+	
+	// copy Y
+	
+	for (y = 0 ; y < h ; y++)
+		for (x = 0 ; x < w ; x++)
+			copy_mb->Y[y][x] = mb->Y[y][x];
+
+	w >>= 1;
+	h >>= 1;
+
+	// U
+	
+	for (y = 0 ; y < h ; y++)
+	{
+		for (x = 0 ; x < w ; x++)
+			put_bits(b,8,mb->U[y][x]);
+		for ( ; x < 8 ; x++)
+			put_bits(b,8,0);
+	}
+	for ( ; y < 8 ; y++)
+	{
+		for (x = 0 ; x < 8 ; x++)
+			put_bits(b,8,0);
+	}
+	
+	// V
+	
+	for (y = 0 ; y < h ; y++)
+	{
+		for (x = 0 ; x < w ; x++)
+			put_bits(b,8,mb->V[y][x]);
+		for ( ; x < 8 ; x++)
+			put_bits(b,8,0);
+	}
+	for ( ; y < 8 ; y++)
+	{
+		for (x = 0 ; x < 8 ; x++)
+			put_bits(b,8,0);
+	}
+
+	// copy U and V
+
+	for (y = 0 ; y < h ; y++)
+	{
+		for (x = 0 ; x < w ; x++)
+		{
+			copy_mb->U[y][x] = mb->U[y][x];
+			copy_mb->V[y][x] = mb->V[y][x];
+		}
+	}
+
+	// store the nonzero counts (set to 16 for I_PCM blocks)
+	
+	for (y = 0 ; y < 4 ; y++)
+	{
+		for (x = 0 ; x < 4 ; x++)
+		{
+			copy_mb->Y_nonzero[y][x] = 16;
+		}
+	}
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			copy_mb->U_nonzero[y][x] = 16;
+			copy_mb->V_nonzero[y][x] = 16;
+		}
+	}
+
+	copy_mb->available = 1;
+}
+
+// inblock is transposed, outblock isn't
+void ff_h264_dct_c(DCTELEM inblock[4][4],DCTELEM outblock[4][4])
+{
+	DCTELEM pieces[4][4];
+	
+	pieces[0][0] = inblock[0][0]+inblock[1][0]+inblock[2][0]+inblock[3][0];
+	pieces[0][1] = inblock[0][1]+inblock[1][1]+inblock[2][1]+inblock[3][1];
+	pieces[0][2] = inblock[0][2]+inblock[1][2]+inblock[2][2]+inblock[3][2];
+	pieces[0][3] = inblock[0][3]+inblock[1][3]+inblock[2][3]+inblock[3][3];
+
+	pieces[1][0] = (inblock[0][0]<<1)+inblock[1][0]-inblock[2][0]-(inblock[3][0]<<1);
+	pieces[1][1] = (inblock[0][1]<<1)+inblock[1][1]-inblock[2][1]-(inblock[3][1]<<1);
+	pieces[1][2] = (inblock[0][2]<<1)+inblock[1][2]-inblock[2][2]-(inblock[3][2]<<1);
+	pieces[1][3] = (inblock[0][3]<<1)+inblock[1][3]-inblock[2][3]-(inblock[3][3]<<1);
+	
+	pieces[2][0] = inblock[0][0]-inblock[1][0]-inblock[2][0]+inblock[3][0];
+	pieces[2][1] = inblock[0][1]-inblock[1][1]-inblock[2][1]+inblock[3][1];
+	pieces[2][2] = inblock[0][2]-inblock[1][2]-inblock[2][2]+inblock[3][2];
+	pieces[2][3] = inblock[0][3]-inblock[1][3]-inblock[2][3]+inblock[3][3];
+
+	pieces[3][0] = inblock[0][0]-(inblock[1][0]<<1)+(inblock[2][0]<<1)-inblock[3][0];
+	pieces[3][1] = inblock[0][1]-(inblock[1][1]<<1)+(inblock[2][1]<<1)-inblock[3][1];
+	pieces[3][2] = inblock[0][2]-(inblock[1][2]<<1)+(inblock[2][2]<<1)-inblock[3][2];
+	pieces[3][3] = inblock[0][3]-(inblock[1][3]<<1)+(inblock[2][3]<<1)-inblock[3][3];
+	
+	outblock[0][0] = pieces[0][0]+pieces[0][1]+pieces[0][2]+pieces[0][3];
+	outblock[0][1] = pieces[1][0]+pieces[1][1]+pieces[1][2]+pieces[1][3];
+	outblock[0][2] = pieces[2][0]+pieces[2][1]+pieces[2][2]+pieces[2][3];
+	outblock[0][3] = pieces[3][0]+pieces[3][1]+pieces[3][2]+pieces[3][3];
+
+	outblock[1][0] = (pieces[0][0] << 1)+pieces[0][1]-pieces[0][2]-(pieces[0][3]<<1);
+	outblock[1][1] = (pieces[1][0] << 1)+pieces[1][1]-pieces[1][2]-(pieces[1][3]<<1);
+	outblock[1][2] = (pieces[2][0] << 1)+pieces[2][1]-pieces[2][2]-(pieces[2][3]<<1);
+	outblock[1][3] = (pieces[3][0] << 1)+pieces[3][1]-pieces[3][2]-(pieces[3][3]<<1);
+
+	outblock[2][0] = pieces[0][0]-pieces[0][1]-pieces[0][2]+pieces[0][3];
+	outblock[2][1] = pieces[1][0]-pieces[1][1]-pieces[1][2]+pieces[1][3];
+	outblock[2][2] = pieces[2][0]-pieces[2][1]-pieces[2][2]+pieces[2][3];
+	outblock[2][3] = pieces[3][0]-pieces[3][1]-pieces[3][2]+pieces[3][3];
+
+	outblock[3][0] = pieces[0][0]-(pieces[0][1]<<1)+(pieces[0][2]<<1)-pieces[0][3];
+	outblock[3][1] = pieces[1][0]-(pieces[1][1]<<1)+(pieces[1][2]<<1)-pieces[1][3];
+	outblock[3][2] = pieces[2][0]-(pieces[2][1]<<1)+(pieces[2][2]<<1)-pieces[2][3];
+	outblock[3][3] = pieces[3][0]-(pieces[3][1]<<1)+(pieces[3][2]<<1)-pieces[3][3];
+}	
+
+
+void ff_h264_hadamard_mult4x4_c(DCTELEM Y[4][4])
+{
+	DCTELEM pieces[4][4];
+	
+	pieces[0][0] = Y[0][0]+Y[0][1]+Y[0][2]+Y[0][3];
+	pieces[0][1] = Y[1][0]+Y[1][1]+Y[1][2]+Y[1][3];
+	pieces[0][2] = Y[2][0]+Y[2][1]+Y[2][2]+Y[2][3];
+	pieces[0][3] = Y[3][0]+Y[3][1]+Y[3][2]+Y[3][3];
+
+	pieces[1][0] = Y[0][0]+Y[0][1]-Y[0][2]-Y[0][3];
+	pieces[1][1] = Y[1][0]+Y[1][1]-Y[1][2]-Y[1][3];
+	pieces[1][2] = Y[2][0]+Y[2][1]-Y[2][2]-Y[2][3];
+	pieces[1][3] = Y[3][0]+Y[3][1]-Y[3][2]-Y[3][3];
+
+	pieces[2][0] = Y[0][0]-Y[0][1]-Y[0][2]+Y[0][3];
+	pieces[2][1] = Y[1][0]-Y[1][1]-Y[1][2]+Y[1][3];
+	pieces[2][2] = Y[2][0]-Y[2][1]-Y[2][2]+Y[2][3];
+	pieces[2][3] = Y[3][0]-Y[3][1]-Y[3][2]+Y[3][3];
+
+	pieces[3][0] = Y[0][0]-Y[0][1]+Y[0][2]-Y[0][3];
+	pieces[3][1] = Y[1][0]-Y[1][1]+Y[1][2]-Y[1][3];
+	pieces[3][2] = Y[2][0]-Y[2][1]+Y[2][2]-Y[2][3];
+	pieces[3][3] = Y[3][0]-Y[3][1]+Y[3][2]-Y[3][3];
+	
+	Y[0][0] = pieces[0][0]+pieces[0][1]+pieces[0][2]+pieces[0][3];
+	Y[0][1] = pieces[1][0]+pieces[1][1]+pieces[1][2]+pieces[1][3];
+	Y[0][2] = pieces[2][0]+pieces[2][1]+pieces[2][2]+pieces[2][3];
+	Y[0][3] = pieces[3][0]+pieces[3][1]+pieces[3][2]+pieces[3][3];
+
+	Y[1][0] = pieces[0][0]+pieces[0][1]-pieces[0][2]-pieces[0][3];
+	Y[1][1] = pieces[1][0]+pieces[1][1]-pieces[1][2]-pieces[1][3];
+	Y[1][2] = pieces[2][0]+pieces[2][1]-pieces[2][2]-pieces[2][3];
+	Y[1][3] = pieces[3][0]+pieces[3][1]-pieces[3][2]-pieces[3][3];
+
+	Y[2][0] = pieces[0][0]-pieces[0][1]-pieces[0][2]+pieces[0][3];
+	Y[2][1] = pieces[1][0]-pieces[1][1]-pieces[1][2]+pieces[1][3];
+	Y[2][2] = pieces[2][0]-pieces[2][1]-pieces[2][2]+pieces[2][3];
+	Y[2][3] = pieces[3][0]-pieces[3][1]-pieces[3][2]+pieces[3][3];
+
+	Y[3][0] = pieces[0][0]-pieces[0][1]+pieces[0][2]-pieces[0][3];
+	Y[3][1] = pieces[1][0]-pieces[1][1]+pieces[1][2]-pieces[1][3];
+	Y[3][2] = pieces[2][0]-pieces[2][1]+pieces[2][2]-pieces[2][3];
+	Y[3][3] = pieces[3][0]-pieces[3][1]+pieces[3][2]-pieces[3][3];
+}
+
+static inline void ff_h264_hadamard_mult_2x2(int16_t Y[2][2])
+{
+	int16_t pieces[2][2];
+	
+	pieces[0][0] = Y[0][0]+Y[0][1];
+	pieces[0][1] = Y[1][0]+Y[1][1];
+	pieces[1][0] = Y[0][0]-Y[0][1];
+	pieces[1][1] = Y[1][0]-Y[1][1];
+	Y[0][0] = pieces[0][0]+pieces[0][1];
+	Y[0][1] = pieces[1][0]+pieces[1][1];
+	Y[1][0] = pieces[0][0]-pieces[0][1];
+	Y[1][1] = pieces[1][0]-pieces[1][1];
+}
+
+const int16_t ff_h264_MF00[6] = {13107, 11916, 10082, 9362, 8192, 7282};
+const int16_t ff_h264_V00[6] = {10*16, 11*16, 13*16, 14*16, 16*16, 18*16};
+
+static inline void ff_h264_hadamard_invquant_2x2(int16_t Y[2][2], int QP)
+{
+	int32_t V = ff_h264_V00[QP%6];
+	int div = QP/6;
+	
+	V <<= div;
+	Y[0][0] = (Y[0][0]*V) >> 5;
+	Y[0][1] = (Y[0][1]*V) >> 5;
+	Y[1][0] = (Y[1][0]*V) >> 5;
+	Y[1][1] = (Y[1][1]*V) >> 5;
+}
+
+#define NEIGHBOUR_SUBTYPE_Y 0
+#define NEIGHBOUR_SUBTYPE_U 1
+#define NEIGHBOUR_SUBTYPE_V 2
+
+#define H264_NEIGHBOUR_COUNT_NONZERO_PLANE(PLANE, P) \
+	{ \
+		if (x == 0) \
+		{ \
+			MacroBlock *leftmb = mb->leftblock; \
+			if (!leftmb) \
+				*nA = -1; \
+			else \
+				*nA = leftmb->PLANE[y][P]; \
+		} \
+		else \
+			*nA = mb->PLANE[y][x-1]; \
+		if (y == 0) \
+		{ \
+			MacroBlock *topmb = mb->topblock; \
+			if (!topmb) \
+				*nB = -1; \
+			else \
+				*nB = topmb->PLANE[P][x]; \
+		} \
+		else \
+			*nB = mb->PLANE[y-1][x]; \
+	}
+
+static inline void ff_h264_neighbour_count_nonzero(MacroBlock *mb, int type, int x, int y, int *nA, int *nB)
+{
+	if (type == NEIGHBOUR_SUBTYPE_Y)
+		H264_NEIGHBOUR_COUNT_NONZERO_PLANE(Y_nonzero, 3)
+	else if (type == NEIGHBOUR_SUBTYPE_U)
+		H264_NEIGHBOUR_COUNT_NONZERO_PLANE(U_nonzero, 1)
+	else
+		H264_NEIGHBOUR_COUNT_NONZERO_PLANE(V_nonzero, 1)
+}
+
+#define H264_JUST_CLIP(x) \
+{\
+	x = ff_h264_cavlc_cliptable[H264_CAVLC_CLIPTABLE_OFFSET+(int)(x)]; \
+}
+
+#define H264_COUNT_AND_CLIP(x,count) \
+{\
+	int16_t val = x;\
+	if (val != 0)\
+		count++;\
+	x = ff_h264_cavlc_cliptable[H264_CAVLC_CLIPTABLE_OFFSET+(int)val]; \
+}
+
+#define H264_COUNT_AND_CLIP_SUBBLOCK(x,count)\
+{\
+	H264_COUNT_AND_CLIP(x[0][1],count);\
+	H264_COUNT_AND_CLIP(x[0][2],count);\
+	H264_COUNT_AND_CLIP(x[0][3],count);\
+	H264_COUNT_AND_CLIP(x[1][0],count);\
+	H264_COUNT_AND_CLIP(x[1][1],count);\
+	H264_COUNT_AND_CLIP(x[1][2],count);\
+	H264_COUNT_AND_CLIP(x[1][3],count);\
+	H264_COUNT_AND_CLIP(x[2][0],count);\
+	H264_COUNT_AND_CLIP(x[2][1],count);\
+	H264_COUNT_AND_CLIP(x[2][2],count);\
+	H264_COUNT_AND_CLIP(x[2][3],count);\
+	H264_COUNT_AND_CLIP(x[3][0],count);\
+	H264_COUNT_AND_CLIP(x[3][1],count);\
+	H264_COUNT_AND_CLIP(x[3][2],count);\
+	H264_COUNT_AND_CLIP(x[3][3],count);\
+}
+	
+static const int8_t zigzagx[16] = { 0,1,0,0,1,2,3,2,1,0,1,2,3,3,2,3 };
+static const int8_t zigzagy[16] = { 0,0,1,2,1,0,0,1,2,3,3,2,1,2,3,3 };
+
+#define H264_ENCODE_INTRA16X16_RESIDUAL_COEFFICIENTS(PLANE) \
+		coefficients[0] = PLANE[0][0]; \
+		coefficients[1] = PLANE[0][1]; \
+		coefficients[2] = PLANE[1][0]; \
+		coefficients[3] = PLANE[1][1]; \
+		h264cavlc_encode(b,coefficients,4,-1,-1,1); // nA and nB are not used in this case
+	
+static void ff_h264_encode_intra16x16_residual(PutBitContext *b,DCTELEM YD[4][4],DCTELEM UD[2][2],DCTELEM VD[2][2],
+						 Residual *residual, int lumamode, int chromamode, MacroBlock *mb)
+{	
+	int lumaACcount = 0;
+	int chromaDCcount = 0;
+	int chromaACcount = 0;
+	int CodedBlockPatternChroma = 0;
+	int CodedBlockPatternLuma = 0;
+	int x,y,i,j;
+	static const int8_t mbtype_map[4][3][2] = 
+	{ 
+		{ 
+			{  1, 13 },  // 0 0 0, 0 0 1
+			{  5, 17 },  // 0 1 0, 0 1 1
+			{  9, 21 }   // 0 2 0, 0 2 1
+		}, 
+		{
+			{  2, 14 },  // 1 0 0, 1 0 1
+			{  6, 18 },  // 1 1 0, 1 1 1
+			{ 10, 22 }   // 1 2 0, 1 2 1
+		},
+		{
+			{  3, 15 },  // 2 0 0, 2 0 1
+			{  7, 19 },  // 2 1 0, 2 1 1
+			{ 11, 23 }   // 2 2 0, 2 2 1
+		},
+		{
+			{  4, 16 },  // 3 0 0, 3 0 1
+			{  8, 20 },  // 3 1 0, 3 1 1
+			{ 12, 24 }   // 3 2 0, 3 2 1
+		}
+	};
+	int16_t coefficients[256];				   
+	int nA,nB;
+
+
+	for (y = 0 ; y < 4 ; y++)
+		for (x = 0 ; x < 4 ; x++)
+			H264_COUNT_AND_CLIP_SUBBLOCK(residual->part4x4Y[y][x],lumaACcount);
+
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			H264_COUNT_AND_CLIP_SUBBLOCK(residual->part4x4U[y][x],chromaACcount);
+			H264_COUNT_AND_CLIP_SUBBLOCK(residual->part4x4V[y][x],chromaACcount);
+		}
+	}
+
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			H264_COUNT_AND_CLIP(UD[y][x],chromaDCcount);
+			H264_COUNT_AND_CLIP(VD[y][x],chromaDCcount);
+		}
+	}
+
+	for (y = 0 ; y < 4 ; y++)
+		for (x = 0 ; x < 4 ; x++)
+			H264_JUST_CLIP(YD[y][x]);
+
+	if(chromaACcount) 
+		CodedBlockPatternChroma= 2;
+	else 
+		CodedBlockPatternChroma= !!chromaDCcount;
+
+	if (lumaACcount == 0)
+		CodedBlockPatternLuma = 0;
+	else
+		CodedBlockPatternLuma = 1; // actually it is 15 in the ITU spec, but I'd like to use it as an array index
+
+	set_ue_golomb(b, mbtype_map[lumamode][CodedBlockPatternChroma][CodedBlockPatternLuma]); // mb_type
+	set_ue_golomb(b, chromamode); // intra_chroma_pred_mode
+	set_se_golomb(b, 0); // mb_qp_delta
+
+	// encode luma DC coefficients
+
+	ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_Y,0,0,&nA,&nB);
+	for (i = 0 ; i < 16 ; i++)
+		coefficients[i] = YD[zigzagy[i]][zigzagx[i]];
+	h264cavlc_encode(b,coefficients,16,nA,nB,0);
+
+	if (CodedBlockPatternLuma > 0)
+	{
+		for (j = 0 ; j < 4 ; j++)
+		{
+			int X = (j&1) << 1;
+			int Y = j&2;
+			
+			for (i = 0 ; i < 4 ; i++)
+			{
+				int x = (i%2)+X;
+				int y = (i/2)+Y;
+				
+				int k;
+	
+				for (k = 0 ; k < 15 ; k++)
+					coefficients[k] = residual->part4x4Y[y][x][zigzagy[k+1]][zigzagx[k+1]];
+				ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_Y,x,y,&nA,&nB);
+				mb->Y_nonzero[y][x] = h264cavlc_encode(b,coefficients,15,nA,nB,0);
+			}
+		}
+	}
+	else
+	{
+		int x,y;
+
+		for (y = 0 ; y < 4 ; y++)
+			for (x = 0 ; x < 4 ; x++)
+				mb->Y_nonzero[y][x] = 0;
+	}
+	
+	if (CodedBlockPatternChroma == 0)
+	{
+		int x,y;
+
+		for (y = 0 ; y < 2 ; y++)
+		{
+			for (x = 0 ; x < 2 ; x++)
+			{
+				mb->U_nonzero[y][x] = 0;
+				mb->V_nonzero[y][x] = 0;
+			}
+		}
+		return;
+	}
+	
+	if (CodedBlockPatternChroma != 0)
+	{
+		H264_ENCODE_INTRA16X16_RESIDUAL_COEFFICIENTS(UD);
+		H264_ENCODE_INTRA16X16_RESIDUAL_COEFFICIENTS(VD);
+	}
+	
+	if (CodedBlockPatternChroma == 2)
+	{
+		for (i = 0 ; i < 4 ; i++)
+		{
+			int x = (i%2);
+			int y = (i/2);
+				
+			int k;
+	
+			for (k = 0 ; k < 15 ; k++)
+				coefficients[k] = residual->part4x4U[y][x][zigzagy[k+1]][zigzagx[k+1]];
+			ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_U,x,y,&nA,&nB);
+			mb->U_nonzero[y][x] = h264cavlc_encode(b,coefficients,15,nA,nB,0);
+		}
+		
+		for (i = 0 ; i < 4 ; i++)
+		{
+			int x = (i%2);
+			int y = (i/2);
+				
+			int k;
+	
+			for (k = 0 ; k < 15 ; k++)
+				coefficients[k] = residual->part4x4V[y][x][zigzagy[k+1]][zigzagx[k+1]];
+			ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_V,x,y,&nA,&nB);
+			mb->V_nonzero[y][x] = h264cavlc_encode(b,coefficients,15,nA,nB,0);
+		}
+	}
+	else
+	{
+		int x,y;
+
+		for (y = 0 ; y < 2 ; y++)
+		{
+			for (x = 0 ; x < 2 ; x++)
+			{
+				mb->U_nonzero[y][x] = 0;
+				mb->V_nonzero[y][x] = 0;
+			}
+		}	
+	}
+}
+	
+static void ff_h264_encode_Intra_16x16(H264Context *t, MacroBlock *targetmb, PutBitContext *b,
+		                         MacroBlock *destmb)
+{
+	int x,y;
+	int w,h,w2,h2;
+	DCTELEM YD[4][4];
+	DCTELEM UD[2][2];
+	DCTELEM VD[2][2];
+	int qPI;
+	int QPc;
+	int QPy = t->QP;
+	int lumapredmode = 2;
+	int chromapredmode = 0;
+	int leftavail = 0;
+	int topavail = 0;
+	
+	qPI = t->QP + t->chroma_qp_index_offset;
+	qPI = clip(qPI, 0, 51);
+	QPc = chroma_qp[qPI];
+	
+	w = targetmb->Y_width;
+	h = targetmb->Y_height;
+	w2 = w>>1;
+	h2 = h>>1;
+
+	if (destmb->leftblock != NULL && destmb->leftblock->available)
+		leftavail = 1;
+	if (destmb->topblock != NULL && destmb->topblock->available)
+		topavail = 1;
+
+	// TODO: use better strategy to determine intra16x16 encoding mode
+	
+	if (leftavail)
+	{
+		MacroBlock *srcleft = destmb->leftblock;
+		
+		if (topavail && w == 16 && h == 16 && srcleft->topblock != 0 && srcleft->topblock->available)
+		{
+			// Plane prediction
+			
+			MacroBlock *srctop = destmb->topblock;
+			MacroBlock *srctopleft = srcleft->topblock;
+			int32_t aY,bY,cY,HY,VY;
+			int32_t aU,bU,cU,HU,VU;
+			int32_t aV,bV,cV,HV,VV;
+			
+			// luma
+
+			HY = 0;
+			for (x = 0 ; x < 7 ; x++)
+				HY += (x+1)*(srctop->Y[15][8+x]-srctop->Y[15][6-x]);
+			HY += (7+1)*(srctop->Y[15][8+7]-srctopleft->Y[15][15]);
+
+			VY = 0;
+			for (y = 0 ; y < 7 ; y++)
+				VY += (y+1)*(srcleft->Y[8+y][15]-srcleft->Y[6-y][15]);
+			VY += (7+1)*(srcleft->Y[8+7][15]-srctopleft->Y[15][15]);
+			
+			aY = 16*(srcleft->Y[15][15]+srctop->Y[15][15]);
+			bY = (5*HY+32)>>6;
+			cY = (5*VY+32)>>6;
+
+			for (y = 0 ; y < 16 ; y++)
+			{
+				for (x = 0 ; x < 16 ; x++)
+				{
+					int32_t val;
+
+					val = (aY+bY*(x-7)+cY*(y-7)+16)>>5;
+					val = clip_uint8(val);
+					destmb->Y[y][x] = (uint8_t)val;
+				}
+			}		
+
+			HU = 0;
+			for (x = 0 ; x < 3 ; x++)
+				HU += (x+1)*(srctop->U[7][4+x]-srctop->U[7][2-x]);
+			HU += (3+1)*(srctop->U[7][4+3]-srctopleft->U[7][7]);
+
+			VU = 0;
+			for (y = 0 ; y < 3 ; y++)
+				VU += (y+1)*(srcleft->U[4+y][7]-srcleft->U[2-y][7]);
+			VU += (3+1)*(srcleft->U[4+3][7]-srctopleft->U[7][7]);
+			
+			aU = 16*(srcleft->U[7][7]+srctop->U[7][7]);
+			bU = (34*HU+32)>>6;
+			cU = (34*VU+32)>>6;
+
+			for (y = 0 ; y < 8 ; y++)
+			{
+				for (x = 0 ; x < 8 ; x++)
+				{
+					int32_t val;
+
+					val = (aU+bU*(x-3)+cU*(y-3)+16)>>5;
+					val = clip_uint8(val);
+					destmb->U[y][x] = (uint8_t)val;
+				}
+			}		
+
+			
+			HV = 0;
+			for (x = 0 ; x < 3 ; x++)
+				HV += (x+1)*(srctop->V[7][4+x]-srctop->V[7][2-x]);
+			HV += (3+1)*(srctop->V[7][4+3]-srctopleft->V[7][7]);
+
+			VV = 0;
+			for (y = 0 ; y < 3 ; y++)
+				VV += (y+1)*(srcleft->V[4+y][7]-srcleft->V[2-y][7]);
+			VV += (3+1)*(srcleft->V[4+3][7]-srctopleft->V[7][7]);
+			
+			aV = 16*(srcleft->V[7][7]+srctop->V[7][7]);
+			bV = (34*HV+32)>>6;
+			cV = (34*VV+32)>>6;
+
+			for (y = 0 ; y < 8 ; y++)
+			{
+				for (x = 0 ; x < 8 ; x++)
+				{
+					int32_t val;
+
+					val = (aV+bV*(x-3)+cV*(y-3)+16)>>5;
+					val = clip_uint8(val);
+					destmb->V[y][x] = (uint8_t)val;
+				}
+			}		
+
+			lumapredmode = PLANE_PRED8x8;
+			chromapredmode = PLANE_PRED8x8;
+		}
+		else
+		{
+			// Horizontal prediction
+		
+			MacroBlock *srcmb = destmb->leftblock;    // this is from the picture which is being reconstructed
+			                                          // and which should be used for the prediction
+			for (y = 0 ; y < h ; y++)
+			{
+				uint8_t val = srcmb->Y[y][15];
+				for (x = 0 ; x < w ; x++)
+					destmb->Y[y][x] = val;
+			}
+			for (y = 0 ; y < h2 ; y++)
+			{
+				uint8_t val1 = srcmb->U[y][7];
+				uint8_t val2 = srcmb->V[y][7];
+				for (x = 0 ; x < w2 ; x++)
+				{
+					destmb->U[y][x] = val1;
+					destmb->V[y][x] = val2;
+				}
+			}
+			lumapredmode = HOR_PRED8x8;
+			chromapredmode = HOR_PRED8x8;
+		}
+	}
+	else // no left neighbour
+	{
+		if (topavail)
+		{
+			// Vertical prediction
+			
+			MacroBlock *srcmb = destmb->topblock;    // this is from the picture which is being reconstructed
+			                                         // and which should be used for the prediction
+	
+			for (x = 0 ; x < w ; x++)
+			{
+				uint8_t val = srcmb->Y[15][x];
+				for (y = 0 ; y < h ; y++)
+					destmb->Y[y][x] = val;
+			}
+			for (x = 0 ; x < w2 ; x++)
+			{
+				uint8_t val1 = srcmb->U[7][x];
+				uint8_t val2 = srcmb->V[7][x];
+				for (y = 0 ; y < h2 ; y++)
+				{
+					destmb->U[y][x] = val1;
+					destmb->V[y][x] = val2;
+				}
+			}
+			lumapredmode = VERT_PRED;
+			chromapredmode = VERT_PRED8x8;
+		}
+		else // nothing available, encode a standard DC block
+		{
+			for (x = 0 ; x < w ; x++)
+			{
+				for (y = 0 ; y < h ; y++)
+					destmb->Y[y][x] = (1<<7);
+			}
+			for (x = 0 ; x < w2 ; x++)
+			{
+				for (y = 0 ; y < h2 ; y++)
+				{
+					destmb->U[y][x] = (1<<7);
+					destmb->V[y][x] = (1<<7);
+				}
+			}
+			lumapredmode = DC_PRED;
+			chromapredmode = DC_PRED8x8;
+		}
+	}
+
+	H264_COPY_16X16BLOCK(t->residual.part4x4Y,(int16_t)targetmb->Y,(int16_t)destmb->Y);
+	H264_COPY_8X8BLOCK(t->residual.part4x4U,(int16_t)targetmb->U,(int16_t)destmb->U);
+	H264_COPY_8X8BLOCK(t->residual.part4x4V,(int16_t)targetmb->V,(int16_t)destmb->V);
+			
+	// Transform residual: DCT
+
+	for (y = 0 ; y < 4 ; y++)
+	{
+		for (x = 0 ; x < 4 ; x++)
+		{
+			t->dspcontext.h264_transform_dct_quant(t->residual.part4x4Y[y][x],QPy,1);
+		}
+	}
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			t->dspcontext.h264_transform_dct_quant(t->residual.part4x4U[y][x],QPc,1);
+			t->dspcontext.h264_transform_dct_quant(t->residual.part4x4V[y][x],QPc,1);
+		}
+	}
+
+	// Hadamard
+
+	// For luma
+	for (y = 0 ; y < 4 ; y++)
+		for (x = 0 ; x < 4 ; x++)
+			YD[y][x] = t->residual.part4x4Y[y][x][0][0];
+	
+//	av_log(NULL, AV_LOG_DEBUG, "Original DC coefficients\n");
+//	for (y = 0 ; y < 4 ; y++)
+//	{
+//		for (x = 0 ; x < 4 ; x++)
+//			av_log(NULL, AV_LOG_DEBUG, "%6d",YD[y][x]);
+//		av_log(NULL, AV_LOG_DEBUG, "\n");
+//	}
+//	av_log(NULL, AV_LOG_DEBUG, "\n");
+	
+	t->dspcontext.h264_hadamard_mult4x4(YD);
+	t->dspcontext.h264_hadamard_quant_4x4(YD,QPy);
+
+	// For U
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			UD[y][x] = t->residual.part4x4U[y][x][0][0];
+	ff_h264_hadamard_mult_2x2(UD);
+	t->dspcontext.h264_hadamard_quant_2x2(UD,QPc);
+  
+	// For V
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			VD[y][x] = t->residual.part4x4V[y][x][0][0];
+	ff_h264_hadamard_mult_2x2(VD);
+	t->dspcontext.h264_hadamard_quant_2x2(VD,QPc);
+	// Encode macroblock 
+	
+	ff_h264_encode_intra16x16_residual(b,YD,UD,VD,&(t->residual),lumapredmode,chromapredmode,destmb);
+	
+	// Inverse hadamard
+	
+	// For luma
+	t->dspcontext.h264_hadamard_mult4x4(YD);
+	t->dspcontext.h264_hadamard_invquant_4x4(YD,QPy);
+	for (y = 0 ; y < 4 ; y++)
+		for (x = 0 ; x < 4 ; x++)
+			t->residual.part4x4Y[y][x][0][0] = YD[y][x];
+
+	// For U
+	ff_h264_hadamard_mult_2x2(UD);
+	ff_h264_hadamard_invquant_2x2(UD,QPc);
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			t->residual.part4x4U[y][x][0][0] = UD[y][x];
+	// For V
+	ff_h264_hadamard_mult_2x2(VD);
+	ff_h264_hadamard_invquant_2x2(VD,QPc);
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			t->residual.part4x4V[y][x][0][0] = VD[y][x];
+
+	// Inverse DCT and add
+	
+	for (y = 0 ; y < 4 ; y++)
+	{
+		for (x = 0 ; x < 4 ; x++)
+		{
+			t->dspcontext.h264_transform_inverse_quant_dct_add(t->residual.part4x4Y[y][x],QPy,1,&(destmb->Y[y*4][x*4]),t->Y_stride);
+		}
+	}
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			t->dspcontext.h264_transform_inverse_quant_dct_add(t->residual.part4x4U[y][x],QPc,1,&(destmb->U[y*4][x*4]),t->U_stride);
+			t->dspcontext.h264_transform_inverse_quant_dct_add(t->residual.part4x4V[y][x],QPc,1,&(destmb->V[y*4][x*4]),t->V_stride);
+		}
+	}	
+	
+	destmb->available = 1;
+}
+
+static void ff_h264_encode_inter16x16_residual(H264Context *t, PutBitContext *b,int mv_x,int mv_y,int mv_x2,int mv_y2,
+						 Residual *residual,
+						 DCTELEM UD[2][2],DCTELEM VD[2][2],int pred_frame_index,MacroBlock *mb,
+						 int last_macroblock)
+{
+	static const int8_t me_map[] = { 0, 2, 3, 7, 4, 8,17,13, 5,18, 9,14,10,15,16,
+		                     11, 1,32,33,36,34,37,44,40,35,45,38,41,39,42,
+				     43,19, 6,24,25,20,26,21,46,28,27,47,22,29,23,
+				     30,31,12};
+	int coded_block_pattern;
+	int CodedBlockPatternLuma;
+	int CodedBlockPatternChroma;
+	int16_t coefficients[256];
+	int x,y,i,j;
+	int done;
+	int chromaACcount;
+	int chromaDCcount;
+	int nA,nB;
+	
+	// coded_block_pattern
+	
+	CodedBlockPatternLuma = 0;
+
+	// first 8x8 block
+	done = 0;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[0][0][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[0][1][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[1][0][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[1][1][y][x] != 0) 
+				done = 1;
+	if (done)
+		CodedBlockPatternLuma |= (1 << 0);
+	// second 8x8 block
+	done = 0;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[0][2][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[0][3][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[1][2][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[1][3][y][x] != 0) 
+				done = 1;
+	if (done)
+		CodedBlockPatternLuma |= (1 << 1);
+	// third 8x8 block
+	done = 0;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[2][0][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[2][1][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[3][0][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[3][1][y][x] != 0) 
+				done = 1;
+	if (done)
+		CodedBlockPatternLuma |= (1 << 2);
+	// fourth 8x8 block
+	done = 0;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[2][2][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[2][3][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[3][2][y][x] != 0) 
+				done = 1;
+	for (y = 0 ; !done && y < 4 ; y++) 
+		for (x = 0 ; !done && x < 4 ; x++) 
+			if (residual->part4x4Y[3][3][y][x] != 0) 
+				done = 1;
+	if (done)
+		CodedBlockPatternLuma |= (1 << 3);
+
+	// check for too large values in luma
+	for (y = 0 ; y < 4 ; y++)
+	{
+		for (x = 0 ; x < 4 ; x++)
+		{
+			H264_JUST_CLIP(residual->part4x4Y[y][x][0][0]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][0][1]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][0][2]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][0][3]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][1][0]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][1][1]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][1][2]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][1][3]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][2][0]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][2][1]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][2][2]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][2][3]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][3][0]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][3][1]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][3][2]);
+			H264_JUST_CLIP(residual->part4x4Y[y][x][3][3]);
+		}
+	}
+
+	chromaDCcount = 0;
+	chromaACcount = 0;
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			H264_COUNT_AND_CLIP_SUBBLOCK(residual->part4x4U[y][x],chromaACcount);
+			H264_COUNT_AND_CLIP_SUBBLOCK(residual->part4x4V[y][x],chromaACcount);
+		}
+	}
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			H264_COUNT_AND_CLIP(UD[y][x],chromaDCcount);
+			H264_COUNT_AND_CLIP(VD[y][x],chromaDCcount);
+		}
+	}
+	
+	if (chromaACcount) 
+		CodedBlockPatternChroma= 2;
+	else 
+		CodedBlockPatternChroma= !!chromaDCcount;
+
+	if (mv_x2 == 0 && mv_y2 == 0 && CodedBlockPatternChroma == 0 && CodedBlockPatternLuma == 0) // entirely predictable
+	{
+		t->mb_skip_run++;
+		if (last_macroblock)
+			set_se_golomb(b, t->mb_skip_run);
+	}
+	else
+	{
+		set_ue_golomb(b, t->mb_skip_run); // mb_skip_run 
+		t->mb_skip_run = 0;
+		
+		set_ue_golomb(b, 0); // mb_type = P_L0_16x16
+
+		// mb_pred()
+	
+		set_se_golomb(b, mv_x);  
+		set_se_golomb(b, mv_y); 
+	
+		coded_block_pattern = (CodedBlockPatternChroma << 4)|CodedBlockPatternLuma;
+		set_ue_golomb(b,me_map[coded_block_pattern]);
+	}
+	
+	// residual()
+
+	if (CodedBlockPatternLuma == 0 && CodedBlockPatternChroma == 0) // nothing left to do
+	{
+		int x,y;
+
+		for (y = 0 ; y < 4 ; y++)
+			for (x = 0 ; x < 4 ; x++)
+				mb->Y_nonzero[y][x] = 0;
+
+		for (y = 0 ; y < 2 ; y++)
+		{
+			for (x = 0 ; x < 2 ; x++)
+			{
+				mb->U_nonzero[y][x] = 0;
+				mb->V_nonzero[y][x] = 0;
+			}
+		}
+		return; 
+	}
+	
+	set_se_golomb(b, 0); // mb_qp_delta
+
+	// encode luma levels
+	for (j = 0 ; j < 4 ; j++)
+	{
+		int X = (j&1) << 1;
+		int Y = j&2;
+			
+		if ((CodedBlockPatternLuma >> j)&1)
+		{
+			for (i = 0 ; i < 4 ; i++)
+			{
+				int x = (i%2)+X;
+				int y = (i/2)+Y;
+			
+				int k;
+
+				for (k = 0 ; k < 16 ; k++)
+					coefficients[k] = residual->part4x4Y[y][x][zigzagy[k]][zigzagx[k]];
+				ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_Y,x,y,&nA,&nB);
+				mb->Y_nonzero[y][x] = h264cavlc_encode(b,coefficients,16,nA,nB,0);
+			}
+		}
+		else
+		{
+			for (i = 0 ; i < 4 ; i++)
+			{
+				int x = (i%2)+X;
+				int y = (i/2)+Y;
+				mb->Y_nonzero[y][x] = 0;
+			}			
+		}
+	}
+
+	// chroma DC levels
+	if (CodedBlockPatternChroma != 0)
+	{
+		coefficients[0] = UD[0][0];
+		coefficients[1] = UD[0][1];
+		coefficients[2] = UD[1][0];
+		coefficients[3] = UD[1][1];
+		h264cavlc_encode(b,coefficients,4,-1,-1,1); // nA and nB are not used in this case
+		
+		coefficients[0] = VD[0][0];
+		coefficients[1] = VD[0][1];
+		coefficients[2] = VD[1][0];
+		coefficients[3] = VD[1][1];
+		h264cavlc_encode(b,coefficients,4,-1,-1,1); // nA and nB are not used in this case
+	}
+	
+	if (CodedBlockPatternChroma == 2)
+	{
+		for (i = 0 ; i < 4 ; i++)
+		{
+			int x = (i%2);
+			int y = (i/2);
+				
+			int k;
+	
+			for (k = 0 ; k < 15 ; k++)
+				coefficients[k] = residual->part4x4U[y][x][zigzagy[k+1]][zigzagx[k+1]];
+			ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_U,x,y,&nA,&nB);
+			mb->U_nonzero[y][x] = h264cavlc_encode(b,coefficients,15,nA,nB,0);
+		}
+		
+		for (i = 0 ; i < 4 ; i++)
+		{
+			int x = (i%2);
+			int y = (i/2);
+				
+			int k;
+	
+			for (k = 0 ; k < 15 ; k++)
+				coefficients[k] = residual->part4x4V[y][x][zigzagy[k+1]][zigzagx[k+1]];
+			ff_h264_neighbour_count_nonzero(mb,NEIGHBOUR_SUBTYPE_V,x,y,&nA,&nB);
+			mb->V_nonzero[y][x] = h264cavlc_encode(b,coefficients,15,nA,nB,0);
+		}
+	}
+	else
+	{
+		int x,y;
+
+		for (y = 0 ; y < 2 ; y++)
+		{
+			for (x = 0 ; x < 2 ; x++)
+			{
+				mb->U_nonzero[y][x] = 0;
+				mb->V_nonzero[y][x] = 0;
+			}
+		}	
+	}
+}
+
+#ifdef H264_ENABLE_QPEL
+
+#define H264_QPEL_6TAP(a,b,c,d,e,f) ((a)-5*(b)+20*(c)+20*(d)-5*(e)+(f))
+#define H264_QPEL_AVG(a,b) (((a)+(b)+1)>>1)
+
+static inline void ff_h264_calc_Yqpelpixels(const uint8_t *src, int srcstride, uint8_t *dst, int dststride1,int dststride2)
+{
+	int b1,h1,s1,m1;
+	int aa,bb,gg,hh;
+	int j1,j,b,h;
+	const uint8_t *pos = src - 2 - 2*srcstride;
+	const uint8_t *pos2 = pos + 2;
+	int s,m;
+	int a,c,d,n,f,i,k,q;
+	int e,g,p,r;
+	
+	aa = H264_QPEL_6TAP((int)pos[0],(int)pos[1],(int)pos[2],(int)pos[3],(int)pos[4],(int)pos[5]);
+	pos += srcstride;
+	bb = H264_QPEL_6TAP((int)pos[0],(int)pos[1],(int)pos[2],(int)pos[3],(int)pos[4],(int)pos[5]);
+	pos += srcstride;
+	b1 = H264_QPEL_6TAP((int)pos[0],(int)pos[1],(int)pos[2],(int)pos[3],(int)pos[4],(int)pos[5]);
+	pos += srcstride;
+	s1 = H264_QPEL_6TAP((int)pos[0],(int)pos[1],(int)pos[2],(int)pos[3],(int)pos[4],(int)pos[5]);
+	pos += srcstride;
+	gg = H264_QPEL_6TAP((int)pos[0],(int)pos[1],(int)pos[2],(int)pos[3],(int)pos[4],(int)pos[5]);
+	pos += srcstride;
+	hh = H264_QPEL_6TAP((int)pos[0],(int)pos[1],(int)pos[2],(int)pos[3],(int)pos[4],(int)pos[5]);
+	h1 = H264_QPEL_6TAP((int)pos2[0],(int)pos2[srcstride],(int)pos2[srcstride*2],(int)pos2[srcstride*3],
+			       (int)pos2[srcstride*4],(int)pos2[srcstride*5]);
+	pos2++;
+	m1 = H264_QPEL_6TAP((int)pos2[0],(int)pos2[srcstride],(int)pos2[srcstride*2],(int)pos2[srcstride*3],
+			       (int)pos2[srcstride*4],(int)pos2[srcstride*5]);
+	
+	j1 = H264_QPEL_6TAP(aa,bb,b1,s1,gg,hh);
+	b = clip_uint8((b1+16)>>5);
+	h = clip_uint8((h1+16)>>5);
+	j = clip_uint8((j1+512)>>10);
+	s = clip_uint8((s1+16)>>5);
+	m = clip_uint8((m1+16)>>5);
+	
+	a = H264_QPEL_AVG((int)src[0],b);
+	c = H264_QPEL_AVG((int)src[1],b);
+	d = H264_QPEL_AVG((int)src[0],h);
+	n = H264_QPEL_AVG((int)src[srcstride],h);
+	f = H264_QPEL_AVG(b,j);
+	i = H264_QPEL_AVG(h,j);
+	k = H264_QPEL_AVG(j,m);
+	q = H264_QPEL_AVG(j,s);
+
+	e = H264_QPEL_AVG(b,h);
+	g = H264_QPEL_AVG(b,m);
+	p = H264_QPEL_AVG(h,s);
+	r = H264_QPEL_AVG(m,s);
+
+	dst[0] = src[0];
+	dst[dststride1] = a;
+	dst[dststride1*2] = b;
+	dst[dststride1*3] = c;
+	dst += dststride2;
+	dst[0] = d;
+	dst[dststride1] = e;
+	dst[dststride1*2] = f;
+	dst[dststride1*3] = g;
+	dst += dststride2;
+	dst[0] = h;
+	dst[dststride1] = i;
+	dst[dststride1*2] = j;
+	dst[dststride1*3] = k;
+	dst += dststride2;
+	dst[0] = n;
+	dst[dststride1] = p;
+	dst[dststride1*2] = q;
+	dst[dststride1*3] = r;	
+}
+
+#define H264_QPEL_UV(xfrac,yfrac) ((uint8_t)(((8-(xfrac))*(8-(yfrac))*A + (xfrac)*(8-(yfrac))*B + (8-(xfrac))*(yfrac)*C + (xfrac)*(yfrac)*D + 32 ) >> 6))
+
+static inline void ff_h264_calc_UVqpelpixels(const uint8_t *src, int srcstride, int xpart, 
+		                         int ypart, uint8_t *dst, int dststride1, int dststride2)
+{
+	int xoffset = xpart*4;
+	int yoffset = ypart*4;
+	int A = (int)src[0];
+	int B = (int)src[1];
+	int C = (int)src[srcstride];
+	int D = (int)src[srcstride+1];
+
+	dst[0] = H264_QPEL_UV(0+xoffset,0+yoffset);
+	dst[dststride1] = H264_QPEL_UV(1+xoffset,0+yoffset);
+	dst[dststride1*2] = H264_QPEL_UV(2+xoffset,0+yoffset);
+	dst[dststride1*3] = H264_QPEL_UV(3+xoffset,0+yoffset);
+	dst += dststride2;
+	dst[0] = H264_QPEL_UV(0+xoffset,1+yoffset);
+	dst[dststride1] = H264_QPEL_UV(1+xoffset,1+yoffset);
+	dst[dststride1*2] = H264_QPEL_UV(2+xoffset,1+yoffset);
+	dst[dststride1*3] = H264_QPEL_UV(3+xoffset,1+yoffset);
+	dst += dststride2;
+	dst[0] = H264_QPEL_UV(0+xoffset,2+yoffset);
+	dst[dststride1] = H264_QPEL_UV(1+xoffset,2+yoffset);
+	dst[dststride1*2] = H264_QPEL_UV(2+xoffset,2+yoffset);
+	dst[dststride1*3] = H264_QPEL_UV(3+xoffset,2+yoffset);
+	dst += dststride2;
+	dst[0] = H264_QPEL_UV(0+xoffset,3+yoffset);
+	dst[dststride1] = H264_QPEL_UV(1+xoffset,3+yoffset);
+	dst[dststride1*2] = H264_QPEL_UV(2+xoffset,3+yoffset);
+	dst[dststride1*3] = H264_QPEL_UV(3+xoffset,3+yoffset);
+}
+
+static inline void ff_h264_build_Yqpel(const void *src, int srcstride, uint8_t Yqpel[8][8][16][16])
+{
+	int i,j;
+
+	for (i = 0 ; i < 16 ; i++)
+	{
+		for (j = 0 ; j < 16 ; j++)
+		{
+			ff_h264_calc_Yqpelpixels(src+j+i*srcstride,srcstride,&(Yqpel[0][0][i][j]),16*16,16*16*8);
+			ff_h264_calc_Yqpelpixels(src+j+1+i*srcstride,srcstride,&(Yqpel[0][4][i][j]),16*16,16*16*8);
+			ff_h264_calc_Yqpelpixels(src+j+(i+1)*srcstride,srcstride,&(Yqpel[4][0][i][j]),16*16,16*16*8);
+			ff_h264_calc_Yqpelpixels(src+j+1+(i+1)*srcstride,srcstride,&(Yqpel[4][4][i][j]),16*16,16*16*8);
+		}
+	}
+}
+
+static inline void ff_h264_build_UVqpel(const uint8_t *src, int srcstride, int xdouble, int ydouble, uint8_t UVqpel[8][8][8][8])
+{
+	int i,j;
+
+	for (i = 0 ; i < 8 ; i++)
+	{
+		for (j = 0 ; j < 8 ; j++)
+		{
+			int x2pos = (xdouble-1)+j*2;
+			int y2pos = (ydouble-1)+i*2;
+			
+			ff_h264_calc_UVqpelpixels(src+(x2pos)/2+(y2pos/2)*srcstride,srcstride,x2pos%2,y2pos%2,&(UVqpel[0][0][i][j]),8*8,8*8*8);
+			
+			x2pos = xdouble+j*2;
+			y2pos = (ydouble-1)+i*2;
+
+			ff_h264_calc_UVqpelpixels(src+(x2pos)/2+(y2pos/2)*srcstride,srcstride,x2pos%2,y2pos%2,&(UVqpel[0][4][i][j]),8*8,8*8*8);
+			
+			x2pos = (xdouble-1)+j*2;
+			y2pos = ydouble+i*2;
+
+			ff_h264_calc_UVqpelpixels(src+(x2pos)/2+(y2pos/2)*srcstride,srcstride,x2pos%2,y2pos%2,&(UVqpel[4][0][i][j]),8*8,8*8*8);
+			
+			x2pos = xdouble+j*2;
+			y2pos = ydouble+i*2;
+
+			ff_h264_calc_UVqpelpixels(src+(x2pos)/2+(y2pos/2)*srcstride,srcstride,x2pos%2,y2pos%2,&(UVqpel[4][4][i][j]),8*8,8*8*8);
+		}
+	}
+}
+
+#endif // H264_ENABLE_QPEL
+
+static void ff_h264_predict(H264Context *t, MacroBlock *destmb, FrameInfo *refframe, int mbx, int mby, int mvx, int mvy)
+{	
+	int x = mbx << 4;
+	int y = mby << 4;
+	AVPicture *refpic = &(refframe->reconstructed_picture);
+	uint8_t *data;
+	int linesize;
+	int i,j;
+	int startx,starty;
+	int w,h,w2,h2;
+	int xmod,ymod;
+	
+	w = destmb->Y_width;
+	h = destmb->Y_height;
+	w2 = w>>1;
+	h2 = h>>1;
+
+	startx = x+(mvx/4);
+	starty = y+(mvy/4);
+	
+	linesize = refpic->linesize[0];
+	data = refpic->data[0]+starty*linesize+startx;
+	
+	for (i = 0 ; i < h ; i++)
+	{
+		for (j = 0 ; j < w ; j++)
+			destmb->Y[i][j] = data[j];
+		data += linesize;
+	}	
+
+	linesize = refpic->linesize[1];
+	data = refpic->data[1]+(starty/2)*linesize+startx/2;
+	
+	xmod = startx%2;
+	ymod = starty%2;
+	
+	if (xmod == 0 && ymod == 0)
+	{
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->U[i][j] = data[j];
+			data += linesize;
+		}
+		
+		linesize = refpic->linesize[2];
+		data = refpic->data[2]+(starty/2)*linesize+startx/2;
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->V[i][j] = data[j];
+			data += linesize;
+		}
+	}
+	else if (xmod == 0 && ymod != 0)
+	{
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->U[i][j] = (uint8_t)(((int)data[j]+(int)data[j+linesize]+1)/2);
+			data += linesize;
+		}
+		
+		linesize = refpic->linesize[2];
+		data = refpic->data[2]+(starty/2)*linesize+startx/2;
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->V[i][j] = (uint8_t)(((int)data[j]+(int)data[j+linesize]+1)/2);
+			data += linesize;
+		}
+	}
+	else if (xmod != 0 && ymod == 0)
+	{
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->U[i][j] = (uint8_t)(((int)data[j]+(int)data[j+1]+1)/2);
+			data += linesize;
+		}
+		
+		linesize = refpic->linesize[2];
+		data = refpic->data[2]+(starty/2)*linesize+startx/2;
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->V[i][j] = (uint8_t)(((int)data[j]+(int)data[j+1]+1)/2);
+			data += linesize;
+		}
+	}
+	else // xmod != 0 && ymod != 0
+	{
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->U[i][j] = (uint8_t)(((int)data[j]+(int)data[j+1]+(int)data[j+linesize+1]+(int)data[j+linesize]+2)/4);
+			data += linesize;
+		}
+		
+		linesize = refpic->linesize[2];
+		data = refpic->data[2]+(starty/2)*linesize+startx/2;
+		for (i = 0 ; i < h2 ; i++)
+		{
+			for (j = 0 ; j < w2 ; j++)
+				destmb->V[i][j] = (uint8_t)(((int)data[j]+(int)data[j+1]+(int)data[j+linesize+1]+(int)data[j+linesize]+2)/4);
+			data += linesize;
+		}
+	}
+}	
+
+#define MAXSEARCHSTEPS 8
+#define SEARCHWIDTH 1
+
+static void ff_h264_find_motion_vector_and_prediction(H264Context *t, MacroBlock *targetmb, FrameInfo *refframe, 
+		                                         int mbx, int mby, int *mvx, int *mvy, 
+							 int pred_mvx, int pred_mvy, MacroBlock *destmb)
+{
+	int x = mbx << 4;
+	int y = mby << 4;
+	int bestx, besty;
+	int curx, cury;
+	int minbitsize = 0x7FFFFFFF;
+	int QP = t->QP;
+	int done = 0;
+	int numsteps = 0;
+	int bestqpelx = 0;
+	int bestqpely = 0;
+	
+	bestx = x;
+	besty = y;
+	curx = x;
+	cury = y;
+	
+	{
+		int scanx = x;
+		int scany = y;
+		int xvec = -pred_mvx; // it's actually this difference which will be encoded!
+		int yvec = -pred_mvy;		
+		int sae = t->dspcontext.pix_abs[0][0](0,targetmb->Y[0], 
+			refframe->reconstructed_picture.data[0]	+ scany * refframe->reconstructed_picture.linesize[0] + scanx,
+			refframe->reconstructed_picture.linesize[0], 16);
+		sae += t->dspcontext.pix_abs[1][0](0,targetmb->U[0], 
+			refframe->reconstructed_picture.data[1]	+ (scany/2) * refframe->reconstructed_picture.linesize[1] + scanx/2,
+			refframe->reconstructed_picture.linesize[1], 8);
+		sae += t->dspcontext.pix_abs[1][0](0,targetmb->V[0], 
+			refframe->reconstructed_picture.data[2]	+ (scany/2) * refframe->reconstructed_picture.linesize[2] + scanx/2,
+			refframe->reconstructed_picture.linesize[2], 8);
+			
+		minbitsize = (mv_len_table[xvec+MVTABLE_OFFSET] + mv_len_table[yvec+MVTABLE_OFFSET] + sae_codeblocksize_relation[QP][sae_mapping[sae>>4]]);
+	}
+	
+	while (!done && numsteps < MAXSEARCHSTEPS)
+	{
+		int startx = curx - SEARCHWIDTH;
+		int starty = cury - SEARCHWIDTH;
+		int stopx = curx + SEARCHWIDTH + 1;
+		int stopy = cury + SEARCHWIDTH + 1;
+		int foundbetter = 0;
+		int scanx, scany;
+
+		if (startx < 0)
+			startx = 0;
+		if (starty < 0)
+			starty = 0;
+		if (stopx > t->refframe_width - 16 + 1)
+			stopx = t->refframe_width - 16 + 1;
+		if (stopy > t->refframe_height - 16 + 1)
+			stopy = t->refframe_height -16 + 1;
+	
+		for(scany = starty; scany < stopy; scany++)
+		{
+			for(scanx = startx; scanx < stopx; scanx++)
+			{
+				if (!(curx == scanx && cury == scany))
+				{
+					int xvec = (scanx-x)*4-pred_mvx; // it's actually this difference which will be encoded!
+					int yvec = (scany-y)*4-pred_mvy;
+					int bitsize;
+					int xmod = scanx%2;
+					int ymod = scany%2;
+					int absnum = xmod+ymod*2;
+					int sae = t->dspcontext.pix_abs[0][0](0,targetmb->Y[0], 
+						refframe->reconstructed_picture.data[0]	+ scany * refframe->reconstructed_picture.linesize[0] + scanx,
+						refframe->reconstructed_picture.linesize[0], 16);
+					
+					sae += t->dspcontext.pix_abs[1][absnum](0,targetmb->U[0], 
+						refframe->reconstructed_picture.data[1]	+ (scany/2) * refframe->reconstructed_picture.linesize[1] + scanx/2,
+						refframe->reconstructed_picture.linesize[1], 8);
+					sae += t->dspcontext.pix_abs[1][absnum](0,targetmb->V[0], 
+						refframe->reconstructed_picture.data[2]	+ (scany/2) * refframe->reconstructed_picture.linesize[2] + scanx/2,
+						refframe->reconstructed_picture.linesize[2], 8);
+					
+					bitsize = (mv_len_table[xvec+MVTABLE_OFFSET] + mv_len_table[yvec+MVTABLE_OFFSET] + sae_codeblocksize_relation[QP][sae_mapping[sae>>4]]);
+			
+					if (bitsize < minbitsize)
+					{
+						minbitsize = bitsize;
+						bestx = scanx;
+						besty = scany;
+						foundbetter = 1;
+					}
+				}
+			}
+		}
+
+		if (foundbetter)
+		{
+			curx = bestx;
+			cury = besty;
+			numsteps++;
+		}
+		else
+			done = 1;
+	}
+#ifdef H264_ENABLE_QPEL
+	if (bestx >= 3 && bestx < t->refframe_width - 16 - 3 && besty >= 3 && besty < t->refframe_height - 16 - 3) // do a qpel search
+	{		
+		uint8_t Yqpel[8][8][16][16];
+		uint8_t Uqpel[8][8][8][8];
+		uint8_t Vqpel[8][8][8][8];
+		uint8_t Ytarget[16][16];
+		uint8_t Utarget[8][8];
+		uint8_t Vtarget[8][8];
+		int done = 0;
+		int numsteps = 0;
+		int curqx = 4;
+		int curqy = 4;
+		int bestqx = 4;
+		int bestqy = 4;
+		int scanx, scany;
+		int foundbetter;
+		int i,j;
+		
+		// first build Yqpel,Uqpel and Vqpel
+		ff_h264_build_Yqpel(refframe->reconstructed_picture.data[0] + (besty-1)*refframe->reconstructed_picture.linesize[0] + (bestx-1), refframe->reconstructed_picture.linesize[0],
+				       Yqpel);
+		ff_h264_build_UVqpel(refframe->reconstructed_picture.data[1],refframe->reconstructed_picture.linesize[1],bestx,besty,Uqpel);
+		ff_h264_build_UVqpel(refframe->reconstructed_picture.data[2],refframe->reconstructed_picture.linesize[2],bestx,besty,Vqpel);
+
+		// copy the target mb
+
+		for (i = 0 ; i < 16 ; i++)
+			for (j = 0 ; j < 16 ; j++)
+				Ytarget[i][j] = targetmb->Y[i][j];
+
+		for (i = 0 ; i < 8 ; i++)
+		{
+			for (j = 0 ; j < 8 ; j++)
+			{
+				Utarget[i][j] = targetmb->U[i][j];
+				Vtarget[i][j] = targetmb->V[i][j];
+			}
+		}
+
+		while (!done && numsteps < 3)
+		{
+			foundbetter = 0;
+		
+			for(scany = curqy-1; scany <= curqy+1; scany++)
+			{
+				for(scanx = curqx-1; scanx <= curqx+1; scanx++)
+				{
+					if (!(scanx == curqx && scany == curqy))
+					{
+						int bitsize;
+						int xvec = (bestx-x)*4+(scanx-4)-pred_mvx; // it's actually this difference which will be encoded!
+						int yvec = (besty-y)*4+(scany-4)-pred_mvy;
+						int sae = t->dspcontext.pix_abs[0][0](0,&(Ytarget[0][0]), 
+							&(Yqpel[scany][scanx][0][0]),16,16);
+						sae += t->dspcontext.pix_abs[1][0](0,&(Utarget[0][0]), 
+						       &(Uqpel[scany][scanx][0][0]),8,8);
+						sae += t->dspcontext.pix_abs[1][0](0,&(Vtarget[0][0]), 
+						       &(Vqpel[scany][scanx][0][0]),8,8);
+	
+						bitsize = (mv_len_table[xvec+MVTABLE_OFFSET] + mv_len_table[yvec+MVTABLE_OFFSET] + sae_codeblocksize_relation[QP][sae_mapping[sae>>4]]);
+						
+						if (bitsize < minbitsize)
+						{
+							minbitsize = bitsize;
+							bestqx = scanx;
+							bestqy = scany;
+							foundbetter = 1;
+						}
+					}
+				}
+			}
+			if (foundbetter)
+			{
+				numsteps++;
+				curqx = bestqx;
+				curqy = bestqy;
+			}
+			else
+				done = 1;
+			
+		}
+
+		bestqpelx = bestqx-4;
+		bestqpely = bestqy-4;
+
+		// copy the best prediction in the destination macroblock
+		
+		for (i = 0 ; i < 16 ; i++)
+			for (j = 0 ; j < 16 ; j++)
+				destmb->Y[i][j] = Yqpel[bestqy][bestqx][i][j];
+		for (i = 0 ; i < 8 ; i++)
+		{
+			for (j = 0 ; j < 8 ; j++)
+			{
+				destmb->U[i][j] = Uqpel[bestqy][bestqx][i][j];
+				destmb->V[i][j] = Vqpel[bestqy][bestqx][i][j];
+			}
+		}
+	}
+	else
+#endif // H264_ENABLE_QPEL
+	{
+		int mvx = (bestx - x) * 4;
+		int mvy = (besty - y) * 4;
+		
+		ff_h264_predict(t, destmb, refframe, mbx, mby, mvx, mvy);
+	}
+	
+	*mvx = (bestx - x) * 4 + bestqpelx;
+	*mvy = (besty - y) * 4 + bestqpely;
+}
+
+// Adjust the values of mvx and mvy based on the prediction from the neighbouring macroblocks
+static void ff_h264_estimate_motion_vectors(MacroBlock *destmb, int *mvpred_x, int *mvpred_y, int *mvpred_x2, int *mvpred_y2)
+{
+	int mvAx = 0, mvAy = 0;
+	int mvBx = 0, mvBy = 0;
+	int mvCx = 0, mvCy = 0;
+	int mvDx = 0, mvDy = 0;
+	int Aavail = 0;
+	int Bavail = 0;
+	int Cavail = 0;
+	int Davail = 0;
+
+	if (destmb->leftblock != NULL && destmb->leftblock->available)
+	{
+		Aavail = 1;
+		mvAx = destmb->leftblock->mv_x;
+		mvAy = destmb->leftblock->mv_y;
+	}
+	if (destmb->topblock != NULL)
+	{
+		MacroBlock *topblock = destmb->topblock;
+
+		if (topblock->available)
+		{
+			Bavail = 1;
+			mvBx = topblock->mv_x;
+			mvBy = topblock->mv_y;
+		}
+		if (topblock->leftblock != NULL && topblock->leftblock->available)
+		{
+			Davail = 1;
+			mvDx = topblock->leftblock->mv_x;
+			mvDy = topblock->leftblock->mv_y;
+		}
+		if (topblock->rightblock != NULL && topblock->rightblock->available)
+		{
+			Cavail = 1;
+			mvCx = topblock->rightblock->mv_x;
+			mvCy = topblock->rightblock->mv_y;
+		}
+	}
+
+	if (!Cavail)
+	{
+		Cavail = Davail;
+		mvCx = mvDx;
+		mvCy = mvDy;
+	}
+
+	if (!Bavail && !Cavail && Aavail)
+	{
+		mvBx = mvAx;
+		mvBy = mvAy;
+		mvCx = mvAx;
+		mvCy = mvAy;
+	}
+	
+	*mvpred_x = mid_pred(mvAx,mvBx,mvCx);
+	*mvpred_y = mid_pred(mvAy,mvBy,mvCy);
+
+	if (!Aavail || !Bavail || (Aavail && mvAx == 0 && mvAy == 0) || (Bavail && mvBx == 0 && mvBy == 0))
+	{
+		*mvpred_x2 = 0;
+		*mvpred_y2 = 0;
+	}
+	else
+	{
+		*mvpred_x2 = *mvpred_x;
+		*mvpred_y2 = *mvpred_y;
+	}
+}
+
+#ifndef DISABLE_DEBLOCKING
+
+/*
+ *
+ * Book p. 184, spec p. 182
+ */
+static inline void ff_h264_deblocking_filter_line_luma(int p[4], int q[4], int QP, int bS)
+{
+	int delta0, delta0i, deltap1i, deltaq1i, deltap1, deltaq1;
+	int pa0, pa1, pa2, qa0, qa1, qa2;
+	int alpha, beta;
+	
+	if (bS == 0)
+		return;
+	
+	alpha = alpha_table[QP];
+	beta = beta_table[QP];
+	
+	if (!(
+		(ABS(p[0] - q[0]) < alpha) /* (1) */
+		&&
+		(ABS(p[1] - p[0]) < beta) /* (2) */
+		&&
+		(ABS(q[1] - q[0]) < beta) /* (3) */
+		))
+		return;
+		
+	pa0 = p[0];
+	pa1 = p[1];
+	pa2 = p[2];
+	qa0 = q[0];
+	qa1 = q[1];
+	qa2 = q[2];
+	
+	if (bS == 4)
+	{
+		int aP = ABS(p[2] - p[0]);
+		int aQ = ABS(q[2] - q[0]);
+		
+		if (aP < beta && ABS(p[0] - q[0]) < ((alpha>>2) + 2))
+		{
+			// Luminance filtering
+			pa0 = (p[2] + 2*p[1] + 2*p[0] + 2*q[0] + q[1] + 4) >> 3; /* (20) */
+			pa1 = (p[2] + p[1] + p[0] + q[0] + 2) >> 2; /* (21) */
+			pa2 = (2*p[3] + 3*p[2] + p[1] + p[0] + q[0] + 4) >> 3; /* (22) */
+		}
+		else
+			pa0 = (2*p[1] + p[0] + q[1] + 2) >> 2; /* (23) */
+
+		if (aQ < beta && ABS(p[0] - q[0]) < ((alpha>>2) + 2))
+		{
+			// Luminance filtering
+			qa0 = (p[1] + 2*p[0] + 2*q[0] + 2*q[1] + q[2] + 4) >> 3; /* (20) */
+			qa1 = (p[0] + q[0] + q[1] + q[2] + 2) >> 2; /* (21) */
+			qa2 = (2*q[3] + 3*q[2] + q[1] + q[0] + p[0] + 4) >> 3; /* (22) */
+		}
+		else
+			qa0 = (2*q[1] + q[0] + p[1] + 2) >> 2; /* (23) */
+	}
+	else
+	{
+		int aP = ABS(p[2] - p[0]);
+		int aQ = ABS(q[2] - q[0]);
+		int c0, c1;
+		
+		c0 = c1 = tc0_table[QP][bS-1]; 
+
+		// All conditions are met to filter this line of samples
+
+		delta0i = (((q[0] - p[0])<<2) + (p[1] - q[1]) + 4) >> 3;
+		
+		if (aP < beta) /* condition (8) */
+		{
+			/* c0 should be incremented for each condition being true, 8-473 */
+			c0++;
+	
+			deltap1i = (p[2] + ((p[0] + q[0] + 1) >> 1) - (p[1]<<1)) >> 1;
+			deltap1 = clip(deltap1i, -c1, c1);
+			pa1 = p[1] + deltap1;
+		}
+
+		if (aQ < beta) /* condition (9) */
+		{
+			/* c0 should be incremented for each condition being true, 8-473 */
+			c0++;
+
+			deltaq1i = (q[2] + ((p[0] + q[0] + 1) >> 1) - (q[1]<<1)) >> 1;
+			deltaq1 = clip(deltaq1i, -c1, c1);
+			qa1 = q[1] + deltaq1;
+		}
+			
+		delta0 = clip(delta0i, -c0, c0);
+		pa0 = clip_uint8(p[0] + delta0);
+		qa0 = clip_uint8(q[0] - delta0);
+	}
+	p[0] = pa0;
+	p[1] = pa1;
+	p[2] = pa2;
+	q[0] = qa0;
+	q[1] = qa1;
+	q[2] = qa2;
+}
+
+static inline void ff_h264_deblocking_filter_line_chroma(int p[4], int q[4], int QP, int bS)
+{
+	int delta0i, delta0;
+	int pa0, pa1, pa2, qa0, qa1, qa2;
+	int alpha, beta;
+	
+	if (bS == 0)
+		return;
+	
+	alpha = alpha_table[QP];
+	beta = beta_table[QP];
+	
+	if (!(
+		(ABS(p[0] - q[0]) < alpha) /* (1) */
+		&&
+		(ABS(p[1] - p[0]) < beta) /* (2) */
+		&&
+		(ABS(q[1] - q[0]) < beta) /* (3) */
+		))
+		return;
+		
+	pa0 = p[0];
+	pa1 = p[1];
+	pa2 = p[2];
+	qa0 = q[0];
+	qa1 = q[1];
+	qa2 = q[2];
+	
+	if (bS == 4)
+	{
+		pa0 = ((p[1]<<1) + p[0] + q[1] + 2) >> 2; /* (23) */
+		qa0 = ((q[1]<<1) + q[0] + p[1] + 2) >> 2; /* (23) */
+	}
+	else
+	{
+		int c0, c1;
+		
+		c0 = c1 = tc0_table[QP][bS-1]; 
+
+		// All conditions are met to filter this line of samples
+
+		delta0i = (((q[0] - p[0])<<2) + (p[1] - q[1]) + 4) >> 3;
+		
+		c0++; /* p. 191, (8-474) */
+
+		delta0 = clip(delta0i, -c0, c0);
+		pa0 = clip_uint8(p[0] + delta0);
+		qa0 = clip_uint8(q[0] - delta0);
+	}
+	p[0] = pa0;
+	p[1] = pa1;
+	p[2] = pa2;
+	q[0] = qa0;
+	q[1] = qa1;
+	q[2] = qa2;
+}
+
+static void ff_h264_deblock_macroblock(MacroBlock *mb, int filter_left_edge, int filter_top_edge, int isIDR, int QPYav, int QPCav)
+{
+	int p[4],q[4];
+	int x,y;
+	int bS[4][16];
+
+	// First step is filtering of vertical edges
+	
+	// first filter left edge
+	if (filter_left_edge)
+	{
+		MacroBlock *leftmb = mb->leftblock;
+		
+		// first Y
+		for (y = 0 ; y < 16 ; y++)
+		{
+			if (isIDR)
+				bS[0][y] = 4;
+			else
+			{
+				if (leftmb->Y_nonzero[y>>2][3] != 0 || mb->Y_nonzero[y>>2][0] != 0)
+					bS[0][y] = 2;
+				else
+				{
+					if (ABS(leftmb->mv_x - mb->mv_x) >= 4 || ABS(leftmb->mv_y - mb->mv_y) >= 4)
+						bS[0][y] = 1;
+					else
+						bS[0][y] = 0;
+				}
+			}
+			
+			p[0] = leftmb->Y[y][15];
+			p[1] = leftmb->Y[y][14];
+			p[2] = leftmb->Y[y][13];
+			p[3] = leftmb->Y[y][12];
+			q[0] = mb->Y[y][0];
+			q[1] = mb->Y[y][1];
+			q[2] = mb->Y[y][2];
+			q[3] = mb->Y[y][3];
+			
+			ff_h264_deblocking_filter_line_luma(p,q,QPYav,bS[0][y]);
+
+			leftmb->Y[y][15] = p[0];
+			leftmb->Y[y][14] = p[1];
+			leftmb->Y[y][13] = p[2];
+			mb->Y[y][0] = q[0];
+			mb->Y[y][1] = q[1];
+			mb->Y[y][2] = q[2];
+		}
+
+		// then U and V
+		
+		for (y = 0 ; y < 8 ; y++)
+		{
+			p[0] = leftmb->U[y][7];
+			p[1] = leftmb->U[y][6];
+			p[2] = leftmb->U[y][5];
+			p[3] = leftmb->U[y][4];
+			q[0] = mb->U[y][0];
+			q[1] = mb->U[y][1];
+			q[2] = mb->U[y][2];
+			q[3] = mb->U[y][3];
+			
+			ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[0][y<<1]);
+
+			leftmb->U[y][7] = p[0];
+			leftmb->U[y][6] = p[1];
+			leftmb->U[y][5] = p[2];
+			mb->U[y][0] = q[0];
+			mb->U[y][1] = q[1];
+			mb->U[y][2] = q[2];
+			
+			p[0] = leftmb->V[y][7];
+			p[1] = leftmb->V[y][6];
+			p[2] = leftmb->V[y][5];
+			p[3] = leftmb->V[y][4];
+			q[0] = mb->V[y][0];
+			q[1] = mb->V[y][1];
+			q[2] = mb->V[y][2];
+			q[3] = mb->V[y][3];
+			
+			ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[0][y<<1]);
+
+			leftmb->V[y][7] = p[0];
+			leftmb->V[y][6] = p[1];
+			leftmb->V[y][5] = p[2];
+			mb->V[y][0] = q[0];
+			mb->V[y][1] = q[1];
+			mb->V[y][2] = q[2];
+		}
+	}
+	
+	// then the internal vertical edges
+	
+	for (x = 4 ; x < 16 ; x += 4)
+	{
+		int xidx = x >> 2;
+		
+		// first Y
+		for (y = 0 ; y < 16 ; y++)
+		{
+			if (isIDR)
+				bS[xidx][y] = 3;
+			else
+			{
+				if (mb->Y_nonzero[y>>2][(x>>2)-1] != 0 || mb->Y_nonzero[y>>2][x>>2] != 0)
+					bS[xidx][y] = 2;
+				else
+				{
+					// one motion vector per 16x16 block, so there will be no difference
+					// between the motion vectors
+					bS[xidx][y] = 0;
+				}
+			}
+
+			p[0] = mb->Y[y][x-1];
+			p[1] = mb->Y[y][x-2];
+			p[2] = mb->Y[y][x-3];
+			p[3] = mb->Y[y][x-4];
+			q[0] = mb->Y[y][x+0];
+			q[1] = mb->Y[y][x+1];
+			q[2] = mb->Y[y][x+2];
+			q[3] = mb->Y[y][x+3];
+			
+			ff_h264_deblocking_filter_line_luma(p,q,QPYav,bS[xidx][y]);
+
+			mb->Y[y][x-1] = p[0];
+			mb->Y[y][x-2] = p[1];
+			mb->Y[y][x-3] = p[2];
+			mb->Y[y][x+0] = q[0];
+			mb->Y[y][x+1] = q[1];
+			mb->Y[y][x+2] = q[2];
+		}
+	}
+	
+	// then U and V
+		
+	for (y = 0 ; y < 8 ; y++)
+	{
+		p[0] = mb->U[y][3];
+		p[1] = mb->U[y][2];
+		p[2] = mb->U[y][1];
+		p[3] = mb->U[y][0];
+		q[0] = mb->U[y][4];
+		q[1] = mb->U[y][5];
+		q[2] = mb->U[y][6];
+		q[3] = mb->U[y][7];
+			
+		ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[2][y<<1]);
+
+		mb->U[y][3] = p[0];
+		mb->U[y][2] = p[1];
+		mb->U[y][1] = p[2];
+		mb->U[y][4] = q[0];
+		mb->U[y][5] = q[1];
+		mb->U[y][6] = q[2];
+			
+		p[0] = mb->V[y][3];
+		p[1] = mb->V[y][2];
+		p[2] = mb->V[y][1];
+		p[3] = mb->V[y][0];
+		q[0] = mb->V[y][4];
+		q[1] = mb->V[y][5];
+		q[2] = mb->V[y][6];
+		q[3] = mb->V[y][7];
+			
+		ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[2][y<<1]);
+
+		mb->V[y][3] = p[0];
+		mb->V[y][2] = p[1];
+		mb->V[y][1] = p[2];
+		mb->V[y][4] = q[0];
+		mb->V[y][5] = q[1];
+		mb->V[y][6] = q[2];
+	}
+
+	// Next step is filtering of horizontal edges
+	
+	// first, filter top edge
+	
+	if (filter_top_edge)
+	{
+		MacroBlock *topmb = mb->topblock;
+
+		// first Y
+		for (x = 0 ; x < 16 ; x++)
+		{
+			if (isIDR)
+				bS[0][x] = 4;
+			else
+			{
+				if (topmb->Y_nonzero[3][x>>2] != 0 || mb->Y_nonzero[0][x>>2] != 0)
+					bS[0][x] = 2;
+				else
+				{
+					if (ABS(topmb->mv_x - mb->mv_x) >= 4 || ABS(topmb->mv_y - mb->mv_y) >= 4)
+						bS[0][x] = 1;
+					else
+						bS[0][x] = 0;
+				}
+			}
+			
+			p[0] = topmb->Y[15][x];
+			p[1] = topmb->Y[14][x];
+			p[2] = topmb->Y[13][x];
+			p[3] = topmb->Y[12][x];
+			q[0] = mb->Y[0][x];
+			q[1] = mb->Y[1][x];
+			q[2] = mb->Y[2][x];
+			q[3] = mb->Y[3][x];
+			
+			ff_h264_deblocking_filter_line_luma(p,q,QPYav,bS[0][x]);
+
+			topmb->Y[15][x] = p[0];
+			topmb->Y[14][x] = p[1];
+			topmb->Y[13][x] = p[2];
+			mb->Y[0][x] = q[0];
+			mb->Y[1][x] = q[1];
+			mb->Y[2][x] = q[2];
+		}
+
+		// then U and V
+		
+		for (x = 0 ; x < 8 ; x++)
+		{
+			p[0] = topmb->U[7][x];
+			p[1] = topmb->U[6][x];
+			p[2] = topmb->U[5][x];
+			p[3] = topmb->U[4][x];
+			q[0] = mb->U[0][x];
+			q[1] = mb->U[1][x];
+			q[2] = mb->U[2][x];
+			q[3] = mb->U[3][x];
+			
+			ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[0][x<<1]);
+
+			topmb->U[7][x] = p[0];
+			topmb->U[6][x] = p[1];
+			topmb->U[5][x] = p[2];
+			mb->U[0][x] = q[0];
+			mb->U[1][x] = q[1];
+			mb->U[2][x] = q[2];
+			
+			p[0] = topmb->V[7][x];
+			p[1] = topmb->V[6][x];
+			p[2] = topmb->V[5][x];
+			p[3] = topmb->V[4][x];
+			q[0] = mb->V[0][x];
+			q[1] = mb->V[1][x];
+			q[2] = mb->V[2][x];
+			q[3] = mb->V[3][x];
+			
+			ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[0][x<<1]);
+
+			topmb->V[7][x] = p[0];
+			topmb->V[6][x] = p[1];
+			topmb->V[5][x] = p[2];
+			mb->V[0][x] = q[0];
+			mb->V[1][x] = q[1];
+			mb->V[2][x] = q[2];
+		}
+	}
+
+	// then the internal horizontal edges
+	
+	for (y = 4 ; y < 16 ; y += 4)
+	{
+		int yidx = y >> 2;
+		
+		// first Y
+		for (x = 0 ; x < 16 ; x++)
+		{
+			if (isIDR)
+				bS[yidx][x] = 3;
+			else
+			{
+				if (mb->Y_nonzero[(y>>2)-1][(x>>2)] != 0 || mb->Y_nonzero[y>>2][x>>2] != 0)
+					bS[yidx][x] = 2;
+				else
+				{
+					// one motion vector per 16x16 block, so there will be no difference
+					// between the motion vectors
+					bS[yidx][x] = 0;
+				}
+			}
+			
+			p[0] = mb->Y[y-1][x];
+			p[1] = mb->Y[y-2][x];
+			p[2] = mb->Y[y-3][x];
+			p[3] = mb->Y[y-4][x];
+			q[0] = mb->Y[y+0][x];
+			q[1] = mb->Y[y+1][x];
+			q[2] = mb->Y[y+2][x];
+			q[3] = mb->Y[y+3][x];
+			
+			ff_h264_deblocking_filter_line_luma(p,q,QPYav,bS[yidx][x]);
+
+			mb->Y[y-1][x] = p[0];
+			mb->Y[y-2][x] = p[1];
+			mb->Y[y-3][x] = p[2];
+			mb->Y[y+0][x] = q[0];
+			mb->Y[y+1][x] = q[1];
+			mb->Y[y+2][x] = q[2];
+		}
+	}
+	
+	// then U and V
+		
+	for (x = 0 ; x < 8 ; x++)
+	{
+		p[0] = mb->U[3][x];
+		p[1] = mb->U[2][x];
+		p[2] = mb->U[1][x];
+		p[3] = mb->U[0][x];
+		q[0] = mb->U[4][x];
+		q[1] = mb->U[5][x];
+		q[2] = mb->U[6][x];
+		q[3] = mb->U[7][x];
+			
+		ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[2][x<<1]);
+
+		mb->U[3][x] = p[0];
+		mb->U[2][x] = p[1];
+		mb->U[1][x] = p[2];
+		mb->U[4][x] = q[0];
+		mb->U[5][x] = q[1];
+		mb->U[6][x] = q[2];
+			
+		p[0] = mb->V[3][x];
+		p[1] = mb->V[2][x];
+		p[2] = mb->V[1][x];
+		p[3] = mb->V[0][x];
+		q[0] = mb->V[4][x];
+		q[1] = mb->V[5][x];
+		q[2] = mb->V[6][x];
+		q[3] = mb->V[7][x];
+			
+		ff_h264_deblocking_filter_line_chroma(p,q,QPCav,bS[2][x<<1]);
+
+		mb->V[3][x] = p[0];
+		mb->V[2][x] = p[1];
+		mb->V[1][x] = p[2];
+		mb->V[4][x] = q[0];
+		mb->V[5][x] = q[1];
+		mb->V[6][x] = q[2];
+	}
+}
+
+static void ff_h264_deblock(H264Context *t, FrameInfo *frame, int isIDR, int QPYav, int QPCav)
+{
+	int y,x;
+	int w,h;
+
+	w = t->mb_width;
+	h = t->mb_height;
+
+	// for the top row, only vertical filtering is done at the edges, for the top-left block, no filtering is
+	// done at the edge
+	
+	ff_h264_deblock_macroblock(&(frame->reconstructed_mb_map[0][0]),0,0,isIDR,QPYav,QPCav);
+	for (x = 1 ; x < w ; x++)
+		ff_h264_deblock_macroblock(&(frame->reconstructed_mb_map[0][x]),1,0,isIDR,QPYav,QPCav);
+	for (y = 1 ; y < h ; y++)
+	{
+		ff_h264_deblock_macroblock(&(frame->reconstructed_mb_map[y][0]),0,1,isIDR,QPYav,QPCav);
+		for (x = 1 ; x < w ; x++)
+			ff_h264_deblock_macroblock(&(frame->reconstructed_mb_map[y][x]),1,1,isIDR,QPYav,QPCav);
+	}
+}
+
+#endif // DISABLE_DEBLOCKING
+
+static void ff_h264_encode_Inter_16x16(H264Context *t, MacroBlock *targetmb, PutBitContext *b,
+		                         MacroBlock *destmb, FrameInfo **previous_frames,
+					 int num_prev_frames, int mbx, int mby)
+{
+	int y,h,x,w;
+	int w2,h2;
+	int qPI;
+	int QPc;
+	int QPy = t->QP;
+	int16_t UD[2][2];
+	int16_t VD[2][2];
+	int mvx = 0;
+	int mvy = 0;
+	int pred_mvx = 0;
+	int pred_mvy = 0;
+	int pred_mvx2 = 0;
+	int pred_mvy2 = 0;
+
+	qPI = t->QP + t->chroma_qp_index_offset;
+	qPI = clip(qPI, 0, 51);
+	QPc = chroma_qp[qPI];
+
+	w = targetmb->Y_width;
+	h = targetmb->Y_height;
+	w2 = w>>1;
+	h2 = h>>1;
+
+	// Find motion vector and prediction
+	
+	ff_h264_estimate_motion_vectors(destmb, &pred_mvx, &pred_mvy, &pred_mvx2, &pred_mvy2);
+	ff_h264_find_motion_vector_and_prediction(t, targetmb, previous_frames[0], mbx, mby, &mvx, &mvy, 
+			                             pred_mvx, pred_mvy, destmb);
+
+	// Calculate residual
+
+	H264_COPY_16X16BLOCK(t->residual.part4x4Y,(int16_t)targetmb->Y,(int16_t)destmb->Y);
+	H264_COPY_8X8BLOCK(t->residual.part4x4U,(int16_t)targetmb->U,(int16_t)destmb->U);
+	H264_COPY_8X8BLOCK(t->residual.part4x4V,(int16_t)targetmb->V,(int16_t)destmb->V);
+
+	// Transform residual: DCT
+
+	for (y = 0 ; y < 4 ; y++)
+	{
+		for (x = 0 ; x < 4 ; x++)
+		{
+			t->dspcontext.h264_transform_dct_quant(t->residual.part4x4Y[y][x],QPy,0);
+		}
+	}
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			t->dspcontext.h264_transform_dct_quant(t->residual.part4x4U[y][x],QPc,1);
+			t->dspcontext.h264_transform_dct_quant(t->residual.part4x4V[y][x],QPc,1);
+		}
+	}
+	// For U
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			UD[y][x] = t->residual.part4x4U[y][x][0][0];
+	ff_h264_hadamard_mult_2x2(UD);
+	t->dspcontext.h264_hadamard_quant_2x2(UD, QPc);
+  
+	// For V
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			VD[y][x] = t->residual.part4x4V[y][x][0][0];
+	ff_h264_hadamard_mult_2x2(VD);
+	t->dspcontext.h264_hadamard_quant_2x2(VD,QPc);
+
+	// Encode motion vectors, residual, ...
+	
+	destmb->mv_x = mvx;
+	destmb->mv_y = mvy;
+	
+	ff_h264_encode_inter16x16_residual(t, b, mvx-pred_mvx, mvy-pred_mvy, mvx-pred_mvx2, mvy-pred_mvy2,
+			                      &(t->residual), UD, VD, 0, destmb, (mbx == t->mb_width-1 && mby == t->mb_height-1));
+
+	// Inverse hadamard
+	
+	// For U
+	ff_h264_hadamard_mult_2x2(UD);
+	ff_h264_hadamard_invquant_2x2(UD,QPc);
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			t->residual.part4x4U[y][x][0][0] = UD[y][x];
+	// For V
+	ff_h264_hadamard_mult_2x2(VD);
+	ff_h264_hadamard_invquant_2x2(VD,QPc);
+	for (y = 0 ; y < 2 ; y++)
+		for (x = 0 ; x < 2 ; x++)
+			t->residual.part4x4V[y][x][0][0] = VD[y][x];
+		
+	// Inverse DCT and add
+	
+	for (y = 0 ; y < 4 ; y++)
+	{
+		for (x = 0 ; x < 4 ; x++)
+		{
+			t->dspcontext.h264_transform_inverse_quant_dct_add(t->residual.part4x4Y[y][x],QPy,0,&(destmb->Y[y*4][x*4]),t->Y_stride);
+		}
+	}
+	for (y = 0 ; y < 2 ; y++)
+	{
+		for (x = 0 ; x < 2 ; x++)
+		{
+			t->dspcontext.h264_transform_inverse_quant_dct_add(t->residual.part4x4U[y][x],QPc,1,&(destmb->U[y*4][x*4]),t->V_stride);
+			t->dspcontext.h264_transform_inverse_quant_dct_add(t->residual.part4x4V[y][x],QPc,1,&(destmb->V[y*4][x*4]),t->U_stride);
+		}
+	}
+
+	destmb->available = 1;
+}
+
+static void ff_h264_control_bitrate(AVCodecContext *avctx, H264Context *t)
+{
+	if (t->blocksize_history_total_milliseconds)
+	{
+		int64_t bitrate = (t->blocksize_history_sum*1000)/t->blocksize_history_total_milliseconds;
+		
+		if (avctx->bit_rate > bitrate) // increase quality
+		{
+			if (t->QP > 0)
+				t->QP--;
+		}
+		else // decrease quality
+		{
+			if (t->QP < 51)
+				t->QP++;
+		}
+	}
+}
+
+static int ff_h264_encode(AVCodecContext *avctx, uint8_t *buf, int buf_size, void *data)
+{
+	H264Context *t = (H264Context *)avctx->priv_data;
+	PutBitContext b;
+	int mbx, mby;
+	uint8_t *dest;
+	int destlen, i;
+	FrameInfo *tmp;
+	int isIDR = 0;
+	static int show_once = 0;
+
+	if (t->frame_num % t->IDRcount == 0)
+		isIDR = 1;
+
+	if(!show_once)
+	{
+		av_log(avctx, AV_LOG_INFO, "width: %d height: %d buffer_size: %d\n", avctx->width, avctx->height,buf_size);
+		show_once = 1;
+	}
+	
+	destlen = t->bufsize;
+	dest = t->bytestream;
+	
+	// Copy the input image. Macroblocks were already assigned in the initialization step
+	img_copy(&(t->input_frame_copy),(AVPicture *)data,PIX_FMT_YUV420P,t->frame_width,t->frame_height);
+
+	// reconstructed_frames[0] will be used to reconstruct the image
+	ff_h264_clear_nonzero_markers(t->reconstructed_frames[0]->reconstructed_mb_map,t->mb_width,t->mb_height);
+	
+	if (isIDR)
+	{
+		// sequence parameter set rbsp
+		
+		init_put_bits(&b,t->bitstream,t->bufsize);
+		
+		put_bits(&b,8,66); // profile_idc = 66 in Baseline
+		put_bits(&b,1,0); // constraint_set0_flag
+		put_bits(&b,1,0); // constraint_set1_flag
+		put_bits(&b,1,0); // constraint_set2_flag
+		put_bits(&b,1,0); // constraint_set3_flag
+		put_bits(&b,4,0); // reserved_zero_bits
+		put_bits(&b,8,40); // level_idc, p. 262, 10*level number
+	
+		set_ue_golomb(&b,0); // seq_parameter_set_id
+		set_ue_golomb(&b,2); // log2_max_frame_num_minus4
+		set_ue_golomb(&b,2); // pic_order_cnt
+		set_ue_golomb(&b,16); // num_ref_frames [0, 16] (make sure we can use enough)
+		
+		put_bits(&b,1,0); // gaps_in_frame_num_value_allowed_flag
+		
+		set_ue_golomb(&b,t->mb_width-1); // pic_width_in_mbs_minus1
+		set_ue_golomb(&b,t->mb_height-1); // pic_height_in_map_units_minus1
+		
+		put_bits(&b, 1, 1); // frame_mbs_only_flag = 1 in Baseline
+		put_bits(&b, 1, 0); // direct_8x8_inference_flag
+		put_bits(&b, 1, t->frame_cropping_flag); // frame_cropping_flag
+		
+		if (t->frame_cropping_flag)
+		{
+			set_ue_golomb(&b, t->frame_crop_left_offset);
+			set_ue_golomb(&b, t->frame_crop_right_offset);
+			set_ue_golomb(&b, t->frame_crop_top_offset);
+			set_ue_golomb(&b, t->frame_crop_bottom_offset);
+		}	
+		
+		put_bits(&b, 1, 0); // vui_parameters_present_flag
+		put_bits(&b, 1, 1); // rbsp_stop_one_bit
+	
+		dest = ff_h264_write_nal_unit(1,NAL_SPS,dest,&destlen,&b);
+		
+		// Baseline: nal_unit_type not in [2,4] 
+	
+		// picture parameter set
+		
+		init_put_bits(&b,t->bitstream,t->bufsize);
+		
+		set_ue_golomb(&b,0); // pic_parameter_set_id
+		set_ue_golomb(&b,0); // seq_parameter_set_id
+		put_bits(&b,1,0); // entropy_coding_mode 			0 = CAVLC
+		put_bits(&b,1,0); // pic_order_present_flag
+		set_ue_golomb(&b,0); // num_slice_groups_minus1			Only one slice group
+		// List0 is needed for enabling P-slices
+		set_ue_golomb(&b,0); // num_ref_idx_l0_active_minus1		Using at most the previous frame for prediction
+		set_ue_golomb(&b,0); // num_ref_idx_l1_active_minus1		Definitely not using list 1 in baseline
+		put_bits(&b,1,0); // weighted_pred_flag				Is 0 in baseline
+		put_bits(&b,2,0); // weighted_bipred_idc			Is 0 in baseline
+		
+		set_se_golomb(&b,t->PPS_QP-26); // pic_init_qp_minus26
+		set_se_golomb(&b,0); // pic_init_qs_minus26
+		
+		set_se_golomb(&b,t->chroma_qp_index_offset); // chroma_qp_index_offset 
+		
+#ifndef DISABLE_DEBLOCKING
+		put_bits(&b,1,0); // deblocking_filter_control_present_flag
+#else
+		put_bits(&b,1,1); // deblocking_filter_control_present_flag
+#endif // DISABLE_DEBLOCKING
+		
+		put_bits(&b,1,0); // constrained_intra_pred_flag
+		put_bits(&b,1,0); // redundant_pic_cnt_present
+		
+		put_bits(&b,1,1); // rbsp_stop_one_bit
+		
+		dest = ff_h264_write_nal_unit(1,NAL_PPS,dest,&destlen,&b);
+
+	}
+
+	// IDR slice or P slice
+
+	init_put_bits(&b,t->bitstream,t->bufsize);
+
+	// Slice header
+	set_ue_golomb(&b, 0); // first_mb_in_slice
+
+	if (isIDR)
+		set_ue_golomb(&b, 7); // slice_type
+	else
+		set_ue_golomb(&b, 5); // slice_type
+	// 0: current slice is P-slice
+	// 2: current slice is I-slice
+	// 5: current and all other slices are P-slices (0 or 5)
+	// 7: current and all other slices are I-slices (2 or 7)
+	
+	set_ue_golomb(&b, 0); // pic_parameter_set_id
+	put_bits(&b, 6, t->frame_num%t->IDRcount); // frame_num
+	//put_bits(&b, 4, 0); // frame_num
+	if (isIDR)
+		set_ue_golomb(&b, t->IDR_frame_num); // idr_pic_id
+	else
+		put_bits(&b, 1, 0); // num_ref_idx_active_override_flag
+	
+	// dec_ref_pic_marking() ...
+	put_bits(&b, 1, 0); // no_output_of_prior_pics_flag
+	put_bits(&b, 1, 0); // long_term_reference_flag
+	// ... dec_ref_pic_marking()
+	set_se_golomb(&b, t->QP - t->PPS_QP); // slice_qp_delta
+
+#ifdef DISABLE_DEBLOCKING
+	set_ue_golomb(&b, 1); // disable_deblocking_filter_idc
+#endif // DISABLE_DEBLOCKING
+
+	// Slice data
+
+	if (isIDR)
+	{
+		for(mby = 0; mby < t->mb_height ; mby++)
+			for(mbx = 0 ; mbx < t->mb_width ; mbx++)
+				ff_h264_encode_Intra_16x16(t,&(t->mb_map[mby][mbx]),&b,&(t->reconstructed_frames[0]->reconstructed_mb_map[mby][mbx]));
+	}
+	else // Inter encoded frame
+	{
+		t->mb_skip_run = 0;
+
+		for(mby = 0; mby < t->mb_height ; mby++)
+			for(mbx = 0 ; mbx < t->mb_width ; mbx++)
+				ff_h264_encode_Inter_16x16(t,&(t->mb_map[mby][mbx]),&b,&(t->reconstructed_frames[0]->reconstructed_mb_map[mby][mbx]),&(t->reconstructed_frames[1]),t->framebufsize-1,mbx,mby);
+	}
+
+#ifndef DISABLE_DEBLOCKING
+	{
+		int QPy = t->QP;
+		int qPI, QPc;
+
+		qPI = t->QP + t->chroma_qp_index_offset;
+		qPI = clip(qPI, 0, 51);
+		QPc = chroma_qp[qPI];
+
+		ff_h264_deblock(t,t->reconstructed_frames[0],isIDR,QPy,QPc);
+	}
+#endif // DISABLE_DEBLOCKING	
+
+#ifdef H264_DEBUG_WRITE_DECODED_IMAGE
+	ff_h264_append_image(t->reconstructed_frames[0]->reconstructed_picture.data[0], avctx);
+#endif
+
+	// Trailing bits
+	
+	put_bits(&b,1,1); // rbsp_stop_one_bit
+	
+	if (isIDR)
+		dest = ff_h264_write_nal_unit(1,NAL_IDR_SLICE,dest,&destlen,&b);
+	else
+		dest = ff_h264_write_nal_unit(1,NAL_SLICE,dest,&destlen,&b);
+	
+	// cycle frame buffer
+	
+	tmp = t->reconstructed_frames[t->framebufsize-1];
+	for (i = t->framebufsize-1 ; i > 0 ; i--)
+		t->reconstructed_frames[i] = t->reconstructed_frames[i-1];
+	t->reconstructed_frames[0] = tmp;
+	
+	// copy the encoded bytes
+	memcpy(buf,t->bytestream,t->bufsize-destlen);
+
+	// update history information
+	t->blocksize_history_sum -= t->blocksize_history[t->blocksize_history_pos];
+	t->blocksize_history_sum += (t->bufsize-destlen)*8;
+	t->blocksize_history[t->blocksize_history_pos] = (t->bufsize-destlen)*8;
+
+	t->blocksize_history_pos++;
+	if (t->blocksize_history_pos == t->blocksize_history_length)
+		t->blocksize_history_pos = 0;
+	if (t->blocksize_history_num_filled < t->blocksize_history_length)
+	{
+		t->blocksize_history_num_filled++;
+		t->blocksize_history_total_milliseconds += t->milliseconds_per_frame;
+	}
+
+	if (!t->use_fixed_qp)
+		ff_h264_control_bitrate(avctx,t);
+
+	// adjust frame numbers
+	t->frame_num++;
+	if (isIDR)
+		t->IDR_frame_num++;
+	return (t->bufsize-destlen); 
+}
+
+static int ff_h264_encoder_close(AVCodecContext *avctx)
+{
+	PutBitContext b;
+	H264Context *t = (H264Context *)avctx->priv_data;
+	uint8_t *dest;
+	int destlen;
+	int y,i;
+		
+	destlen = t->bufsize;
+	dest = t->bytestream;
+	
+	init_put_bits(&b,t->bitstream,t->bufsize);
+	
+	// write end of stream
+
+	dest = ff_h264_write_nal_unit(0,NAL_END_STREAM,dest,&destlen,&b);
+
+	*dest = 0;
+	dest++;
+	destlen--;
+        
+	// clean up
+
+	av_free(t->bitstream);
+	av_free(t->bytestream);
+	
+	for (y = 0 ; y < t->mb_height ; y++)
+		av_free(t->mb_map[y]);
+	
+	av_free(t->mb_map);
+
+	for (i = 0 ; i < t->framebufsize ; i++)
+	{
+		av_free(t->reconstructed_frames[i]->reconstructed_picture.data[0]);
+	
+		for (y = 0 ; y < t->mb_height ; y++)
+			av_free(t->reconstructed_frames[i]->reconstructed_mb_map[y]);
+	
+		av_free(t->reconstructed_frames[i]->reconstructed_mb_map);
+		av_free(t->reconstructed_frames[i]);
+	}
+
+	av_free(t->reconstructed_frames);
+
+	av_free(t->input_frame_copy.data[0]);
+
+	av_free(t->blocksize_history);
+	return 0;
+}
+
+#ifdef CONFIG_ENCODERS
+AVCodec h264_encoder = {
+	"ffh264",
+	CODEC_TYPE_VIDEO,
+	CODEC_ID_FFH264,
+	sizeof(H264Context),
+	ff_h264_encoder_init,
+	ff_h264_encode,
+	ff_h264_encoder_close,
+};
+#endif
+
diff --git a/libavcodec/h264enc.h b/libavcodec/h264enc.h
new file mode 100644
index 0000000..d2dc675
--- /dev/null
+++ b/libavcodec/h264enc.h
@@ -0,0 +1,104 @@
+/*
+ * H.264 encoder
+ * Copyright (c) 2006 Expertisecentrum Digitale Media, UHasselt
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "h264encdata.h"
+
+/**
+ * Can contain pointers to the relevant starting points in a picture
+ */
+typedef struct MacroBlock
+{
+	uint8_t *Y[16];
+	uint8_t *U[8];
+	uint8_t *V[8];
+	int Y_width;
+	int Y_height;
+	int Y_nonzero[4][4]; ///< y,x
+	int U_nonzero[2][2]; 
+	int V_nonzero[2][2];
+	struct MacroBlock *leftblock,*topblock,*rightblock;
+	int available;
+	int mv_x;
+	int mv_y;
+} MacroBlock;
+
+typedef struct Residual
+{
+	int16_t part4x4Y[4][4][4][4]; ///< ypos and xpos of 4x4 part, followed by y,x of pixel
+	int16_t part4x4U[2][2][4][4]; ///< ypos and xpos of 4x4 part, followed by y,x of pixel
+	int16_t part4x4V[2][2][4][4]; ///< ypos and xpos of 4x4 part, followed by y,x of pixel
+} Residual;
+
+typedef struct FrameInfo
+{
+	AVPicture reconstructed_picture;
+	MacroBlock **reconstructed_mb_map; ///< macroblock map of reconstructed picture
+} FrameInfo;
+
+typedef struct H264Context
+{
+	uint8_t *bitstream;
+	uint8_t *bytestream;
+	int bufsize;
+	int frame_num;
+	int IDR_frame_num;
+	MacroBlock **mb_map; ///< macroblock map for input picture
+	FrameInfo **reconstructed_frames;
+	int framebufsize; ///< length of previous array
+	int mb_width; ///< width in macroblocks
+	int mb_height; ///< height in macroblock
+	int QP; 
+	int PPS_QP; //< The QP value stored in the picture parameter set
+	int chroma_qp_index_offset;
+	int IDRcount;
+	int frame_cropping_flag;
+	int frame_crop_left_offset;
+	int frame_crop_right_offset;
+	int frame_crop_top_offset;
+	int frame_crop_bottom_offset;
+	Residual residual;
+	
+	MpegEncContext s;
+	AVPicture pi, po;
+
+	DSPContext dspcontext;
+	int Y_stride;
+	int U_stride;
+	int V_stride;
+
+	int frame_width;
+	int frame_height;
+	int refframe_width;
+	int refframe_height;
+
+	AVPicture input_frame_copy; ///< buffer to hold copy of input frame
+	int mb_skip_run;
+
+	int64_t *blocksize_history;
+	int blocksize_history_length;
+	int blocksize_history_total_milliseconds;
+	int milliseconds_per_frame;
+	int blocksize_history_pos;
+	int blocksize_history_num_filled;
+	int64_t blocksize_history_sum;	
+
+	int use_fixed_qp;
+} H264Context;
+
+
diff --git a/libavcodec/h264encdata.h b/libavcodec/h264encdata.h
new file mode 100644
index 0000000..691ba44
--- /dev/null
+++ b/libavcodec/h264encdata.h
@@ -0,0 +1,1291 @@
+/*
+ * H.264 encoder
+ * Copyright (c) 2006 Expertisecentrum Digitale Media, UHasselt
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define H264_CAVLC_CLIPTABLE_SIZE        65536
+#define H264_CAVLC_CLIPTABLE_OFFSET    32768
+
+#define SAE_ENCODED_SIZE_SIZE (256*16*16+2*8*8*256)
+#define MVTABLE_OFFSET	(128*4)
+
+static const char mv_len_table[MVTABLE_OFFSET*2+1] = 
+{
+	21,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,13,
+	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+	13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+	11,11,9,9,9,9,9,9,9,9,7,7,7,7,5,
+	5,3,1,3,5,5,7,7,7,7,9,9,9,9,9,
+	9,9,9,11,11,11,11,11,11,11,11,11,11,11,11,
+	11,11,11,11,13,13,13,13,13,13,13,13,13,13,13,
+	13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
+	13,13,13,13,13,13,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+	15,15,15,15,15,15,15,15,15,15,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+	17,17,17,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
+	19,19,19,19,21
+};
+
+static const int sae_mapping[SAE_ENCODED_SIZE_SIZE] = {
+0,1,2,3,4, 5,6,7,8,9,
+10,11,12,13,14, 15,16,17,18,19,
+20,21,22,23,24, 25,26,27,28,29,
+30,31,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,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,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,256,257,258,259,
+260,261,262,263,264, 265,266,267,268,269,
+270,271,272,273,274, 275,276,277,278,279,
+280,281,282,283,284, 285,286,287,288,289,
+290,291,292,293,294, 295,296,297,298,299,
+300,301,302,303,304, 305,306,307,308,309,
+310,311,312,313,314, 315,316,317,318,319,
+320,321,322,323,324, 325,326,327,328,329,
+330,331,332,333,334, 335,336,337,338,339,
+340,341,342,343,344, 345,346,347,348,349,
+350,351,352,353,354, 355,356,357,358,359,
+360,361,362,363,364, 365,366,367,368,369,
+370,371,372,373,374, 375,376,377,378,379,
+380,381,382,383,384, 385,386,387,388,389,
+390,391,392,393,394, 395,396,397,398,399,
+400,401,402,403,404, 405,406,407,408,409,
+410,411,412,413,414, 415,416,417,418,419,
+420,421,422,423,424, 425,426,427,428,429,
+430,431,432,433,434, 435,436,437,438,439,
+440,441,442,443,444, 445,446,447,448,449,
+450,451,452,453,454, 455,456,457,458,459,
+460,461,462,463,464, 465,466,467,468,469,
+470,471,472,473,474, 475,476,477,478,479,
+480,481,482,483,484, 485,486,487,488,489,
+490,491,492,493,494, 495,496,497,498,499,
+500,501,502,503,504, 505,506,507,508,509,
+510,511,512,513,514, 515,516,517,518,519,
+520,521,522,523,524, 525,526,527,528,529,
+530,531,532,533,534, 535,536,537,538,539,
+540,541,542,543,544, 545,546,547,548,549,
+550,551,552,553,554, 555,556,557,558,559,
+560,561,562,563,564, 565,566,567,568,569,
+570,571,572,573,574, 575,576,577,578,579,
+580,581,582,583,584, 585,586,587,588,589,
+590,591,592,593,594, 595,596,597,598,599,
+600,601,602,603,604, 605,606,607,608,609,
+610,611,612,613,614, 615,616,617,618,619,
+620,621,622,623,624, 625,626,627,628,629,
+630,631,632,633,634, 635,636,637,638,639,
+640,641,642,643,644, 645,646,647,648,649,
+650,651,652,653,654, 655,656,657,658,659,
+660,661,662,663,664, 665,666,667,668,669,
+670,671,672,673,674, 675,676,677,678,679,
+680,681,682,683,684, 685,686,687,688,689,
+690,691,692,693,694, 695,696,697,698,699,
+700,701,702,703,704, 705,706,707,708,709,
+710,711,712,713,714, 715,716,717,718,719,
+720,721,722,723,724, 725,726,727,728,729,
+730,731,732,733,734, 735,736,737,738,739,
+740,741,742,743,744, 745,746,747,748,749,
+750,751,752,753,754, 755,756,757,758,759,
+760,761,762,763,764, 765,766,767,768,769,
+770,771,772,773,774, 775,776,777,778,779,
+780,781,782,783,784, 785,786,787,788,789,
+790,791,792,793,794, 795,796,797,798,799,
+800,801,802,803,804, 805,806,807,808,809,
+810,811,812,813,814, 815,816,817,818,819,
+820,821,822,823,824, 825,826,827,828,829,
+830,831,832,833,834, 835,836,837,838,839,
+840,841,842,843,844, 845,846,847,848,849,
+850,851,852,853,854, 855,856,857,858,859,
+860,861,862,863,864, 865,866,867,868,869,
+870,871,872,873,874, 875,876,877,878,879,
+880,881,882,883,884, 885,886,887,888,889,
+890,891,892,893,894, 895,896,897,898,899,
+900,901,902,903,904, 905,906,907,908,909,
+910,911,912,913,914, 915,916,917,918,919,
+920,921,922,923,924, 925,926,927,928,929,
+930,931,932,933,934, 935,936,937,938,939,
+940,941,942,943,944, 945,946,947,948,949,
+950,951,952,953,954, 955,956,957,958,959,
+960,961,962,963,964, 965,966,967,968,969,
+970,971,972,973,974, 975,976,977,978,979,
+980,981,982,983,984, 985,986,987,988,989,
+990,991,992,993,994, 995,996,997,998,999,
+1000,1001,1002,1003,1004, 1005,1006,1007,1008,1009,
+1010,1011,1012,1013,1014, 1015,1016,1017,1018,1019,
+1020,1021,1022,1023,1024, 1025,1026,1027,1028,1029,
+1030,1031,1032,1033,1034, 1035,1036,1037,1038,1039,
+1040,1041,1042,1043,1044, 1045,1046,1047,1048,1049,
+1050,1051,1052,1053,1054, 1055,1056,1057,1058,1059,
+1060,1061,1062,1063,1064, 1065,1066,1067,1068,1069,
+1070,1071,1072,1073,1074, 1075,1076,1077,1078,1079,
+1080,1081,1082,1083,1084, 1085,1086,1087,1088,1089,
+1090,1091,1092,1093,1094, 1095,1096,1097,1098,1099,
+1100,1101,1102,1103,1104, 1105,1106,1107,1108,1109,
+1110,1111,1112,1113,1114, 1115,1116,1117,1118,1119,
+1120,1121,1122,1123,1124, 1125,1126,1127,1128,1129,
+1130,1131,1132,1133,1134, 1135,1136,1137,1138,1139,
+1140,1141,1142,1143,1144, 1145,1146,1147,1148,1149,
+1150,1151,1152,1153,1154, 1155,1156,1157,1158,1159,
+1160,1161,1162,1163,1164, 1165,1166,1167,1168,1169,
+1170,1171,1172,1173,1174, 1175,1176,1177,1178,1179,
+1180,1181,1182,1183,1184, 1185,1186,1187,1188,1189,
+1190,1191,1192,1193,1194, 1195,1196,1197,1198,1199,
+1200,1201,1202,1203,1204, 1205,1206,1207,1208,1209,
+1210,1211,1212,1213,1214, 1215,1216,1217,1218,1219,
+1220,1221,1222,1223,1224, 1225,1226,1227,1228,1229,
+1230,1231,1232,1233,1234, 1235,1236,1237,1238,1239,
+1240,1241,1242,1243,1244, 1245,1246,1247,1248,1249,
+1250,1251,1252,1253,1254, 1255,1256,1257,1258,1259,
+1260,1261,1262,1263,1264, 1265,1266,1267,1268,1269,
+1270,1271,1272,1273,1274, 1275,1276,1277,1278,1279,
+1280,1281,1282,1283,1284, 1285,1286,1287,1288,1289,
+1290,1291,1292,1293,1294, 1295,1296,1297,1298,1299,
+1300,1301,1302,1303,1304, 1305,1306,1307,1308,1309,
+1310,1311,1312,1313,1314, 1315,1316,1317,1318,1319,
+1320,1321,1322,1323,1324, 1325,1326,1327,1328,1329,
+1330,1331,1332,1333,1334, 1335,1336,1337,1338,1339,
+1340,1341,1342,1343,1344, 1345,1346,1347,1348,1349,
+1350,1351,1352,1353,1354, 1355,1356,1357,1358,1359,
+1360,1361,1362,1363,1364, 1365,1366,1367,1368,1369,
+1370,1371,1372,1373,1374, 1375,1376,1377,1378,1379,
+1380,1381,1382,1383,1384, 1385,1386,1387,1388,1389,
+1390,1391,1392,1393,1394, 1395,1396,1397,1398,1399,
+1400,1401,1402,1403,1404, 1405,1406,1407,1408,1409,
+1410,1411,1412,1413,1414, 1415,1416,1417,1418,1419,
+1420,1421,1422,1423,1424, 1425,1426,1427,1428,1429,
+1430,1431,1432,1433,1434, 1435,1436,1437,1438,1439,
+1440,1441,1442,1443,1444, 1445,1446,1447,1448,1449,
+1450,1451,1452,1453,1454, 1455,1456,1457,1458,1459,
+1460,1461,1462,1463,1464, 1465,1466,1467,1468,1469,
+1470,1471,1472,1473,1474, 1475,1476,1477,1478,1479,
+1480,1481,1482,1483,1484, 1485,1486,1487,1488,1489,
+1490,1491,1492,1493,1494, 1495,1496,1497,1498,1499,
+1500,1501,1502,1503,1504, 1505,1506,1507,1508,1509,
+1510,1511,1512,1513,1514, 1515,1516,1517,1518,1519,
+1520,1521,1522,1523,1524, 1525,1526,1527,1528,1529,
+1530,1531,1532,1533,1534, 1535,1536,1537,1538,1539,
+1540,1541,1542,1543,1544, 1545,1546,1547,1548,1549,
+1550,1551,1552,1553,1554, 1555,1556,1557,1558,1559,
+1560,1561,1562,1563,1564, 1565,1566,1567,1568,1569,
+1570,1571,1572,1573,1574, 1575,1576,1577,1578,1579,
+1580,1581,1582,1583,1584, 1585,1586,1587,1588,1589,
+1590,1591,1592,1593,1594, 1595,1596,1597,1598,1599,
+1600,1601,1602,1603,1604, 1605,1606,1607,1608,1609,
+1610,1611,1612,1613,1614, 1615,1616,1617,1618,1619,
+1620,1621,1622,1623,1624, 1625,1626,1627,1628,1629,
+1630,1631,1632,1633,1634, 1635,1636,1637,1638,1639,
+1640,1641,1642,1643,1644, 1645,1646,1647,1648,1649,
+1650,1651,1652,1653,1654, 1655,1656,1657,1658,1659,
+1660,1661,1662,1663,1664, 1665,1666,1667,1668,1669,
+1670,1671,1672,1673,1674, 1675,1676,1677,1678,1679,
+1680,1681,1682,1683,1684, 1685,1686,1687,1688,1689,
+1690,1691,1692,1693,1694, 1695,1696,1697,1698,1699,
+1700,1701,1702,1703,1704, 1705,1706,1707,1708,1709,
+1710,1711,1712,1713,1714, 1715,1716,1717,1718,1719,
+1720,1721,1722,1723,1724, 1725,1726,1727,1728,1729,
+1730,1731,1732,1733,1734, 1735,1736,1737,1738,1739,
+1740,1741,1742,1743,1744, 1745,1746,1747,1748,1749,
+1750,1751,1752,1753,1754, 1755,1756,1757,1758,1759,
+1760,1761,1762,1763,1764, 1765,1766,1767,1768,1769,
+1770,1771,1772,1773,1774, 1775,1776,1777,1778,1779,
+1780,1781,1782,1783,1784, 1785,1786,1787,1788,1789,
+1790,1791,1792,1793,1794, 1795,1796,1797,1798,1799,
+1800,1801,1802,1803,1804, 1805,1806,1807,1808,1809,
+1810,1811,1812,1813,1814, 1815,1816,1817,1818,1819,
+1820,1821,1822,1823,1824, 1825,1826,1827,1828,1829,
+1830,1831,1832,1833,1834, 1835,1836,1837,1838,1839,
+1840,1841,1842,1843,1844, 1845,1846,1847,1848,1849,
+1850,1851,1852,1853,1854, 1855,1856,1857,1858,1859,
+1860,1861,1862,1863,1864, 1865,1866,1867,1868,1869,
+1870,1871,1872,1873,1874, 1875,1876,1877,1878,1879,
+1880,1881,1882,1883,1884, 1885,1886,1887,1888,1889,
+1890,1891,1892,1893,1894, 1895,1896,1897,1898,1899,
+1900,1901,1902,1903,1904, 1905,1906,1907,1908,1909,
+1910,1911,1912,1913,1914, 1915,1916,1917,1918,1919,
+1920,1921,1922,1923,1924, 1925,1926,1927,1928,1929,
+1930,1931,1932,1933,1934, 1935,1936,1937,1938,1939,
+1940,1941,1942,1943,1944, 1945,1946,1947,1948,1949,
+1950,1951,1952,1953,1954, 1955,1956,1957,1958,1959,
+1960,1961,1962,1963,1964, 1965,1966,1967,1968,1969,
+1970,1971,1972,1973,1974, 1975,1976,1977,1978,1979,
+1980,1981,1982,1983,1984, 1985,1986,1987,1988,1989,
+1990,1991,1992,1993,1994, 1995,1996,1997,1998,1999,
+2000,2001,2002,2003,2004, 2005,2006,2007,2008,2009,
+2010,2011,2012,2013,2014, 2015,2016,2017,2018,2019,
+2020,2021,2022,2023,2024, 2025,2026,2027,2028,2029,
+2030,2031,2032,2033,2034, 2035,2036,2037,2038,2039,
+2040,2041,2042,2043,2044, 2045,2046,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047,2047, 2047,2047,2047,2047,2047,
+2047,2047,2047,2047};
+
+static const int sae_codeblocksize_relation[52][2048] =
+{
+	{
+		55,113,155,202,247,289,333,374,413,452,489,523,555,584,612,637,660,681,701,719,735,751,765,779,792,804,816,827,838,849,859,868,878,888,897,907,916,925,934,943,952,961,970,978,986,994,1002,1009,1017,1024,1031,1038,1045,1051,1058,1064,1070,1076,1082,1088,1094,1100,1105,1110,1116,1121,1126,1131,1136,1141,1145,1150,1155,1159,1164,1168,1172,1177,1181,1185,1190,1194,1198,1202,1206,1210,1215,1219,1223,1226,1230,1234,1238,1241,1245,1248,1252,1255,1259,1262,1266,1269,1272,1276,1279,1282,1286,1289,1292,1295,1298,1301,1305,1308,1311,1314,1317,1320,1323,1326,1328,1331,1334,1337,1340,1342,1345,1348,1350,1353,1356,1358,1361,1364,1366,1369,1371,1374,1376,1379,1381,1384,1386,1388,1391,1393,1396,1398,1400,1403,1405,1407,1409,1412,1414,1416,1418,1421,1423,1425,1427,1429,1431,1433,1435,1437,1439,1442,1444,1446,1448,1450,1452,1454,1455,1457,1459,1461,1463,1465,1467,1468,1470,1472,1473,1475,1477,1479,1481,1483,1485,1487,1489,1491,1493,1494,1496,1498,1499,1501,1503,1505,1506,1508,1510,1512,1513,1515,1517,1519,1521,1522,1524,1525,1527,1529,1530,1532,1533,1535,1537,1538,1540,1541,1543,1545,1546,1548,1549,1551,1552,1554,1555,1557,1558,1559,1561,1562,1564,1565,1566,1568,1569,1571,1572,1573,1575,1576,1578,1580,1581,1583,1584,1586,
+		1587,1589,1590,1592,1593,1594,1595,1597,1598,1599,1600,1602,1603,1604,1606,1607,1609,1610,1611,1613,1614,1615,1617,1618,1619,1621,1622,1623,1624,1626,1627,1628,1629,1631,1632,1633,1634,1635,1636,1637,1638,1640,1640,1641,1642,1643,1645,1646,1647,1648,1649,1650,1651,1652,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1685,1686,1687,1688,1689,1690,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1704,1705,1706,1707,1707,1708,1709,1709,1710,1711,1712,1713,1714,1714,1715,1716,1717,1718,1718,1719,1720,1720,1721,1722,1723,1724,1724,1725,1726,1727,1728,1728,1729,1730,1731,1732,1732,1733,1734,1735,1735,1736,1737,1737,1738,1739,1740,1740,1741,1741,1742,1743,1743,1744,1745,1745,1746,1746,1747,1748,1748,1749,1749,1750,1751,1751,1752,1753,1753,1754,1755,1755,1756,1757,1757,1758,1759,1760,1760,1761,1761,1762,1762,1763,1764,1764,1765,1765,1766,1767,1768,1768,1769,1769,1769,1770,1770,1771,1771,1771,1771,1772,1772,1772,1773,1774,1774,1775,1775,1776,1776,1777,1777,1778,1779,1779,1780,1780,1781,1781,1782,1782,1783,1784,1784,1785,1785,1786,1786,1786,1787,1788,1788,1789,1789,1789,1789,1790,1791,1791,1792,1792,1792,1793,1793,1793,1794,1794,
+		1795,1795,1795,1796,1796,1796,1797,1797,1797,1798,1798,1798,1799,1799,1800,1800,1801,1801,1802,1802,1803,1804,1804,1804,1805,1806,1806,1806,1807,1807,1808,1808,1809,1809,1810,1810,1811,1811,1811,1812,1812,1812,1813,1813,1813,1814,1814,1814,1815,1815,1816,1817,1817,1817,1817,1817,1818,1818,1818,1818,1818,1818,1818,1818,1819,1820,1820,1820,1820,1821,1821,1822,1823,1823,1823,1824,1824,1824,1825,1825,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1827,1827,1827,1827,1827,1827,1828,1828,1828,1828,1828,1829,1829,1829,1829,1829,1830,1830,1831,1831,1831,1831,1832,1833,1833,1833,1834,1835,1835,1835,1835,1835,1836,1836,1836,1836,1836,1836,1836,1837,1837,1837,1838,1838,1838,1838,1839,1839,1839,1839,1839,1839,1840,1840,1840,1840,1841,1841,1841,1841,1841,1841,1841,1841,1841,1841,1842,1842,1843,1843,1843,1843,1844,1844,1845,1845,1845,1845,1845,1845,1845,1845,1845,1846,1846,1847,1848,1848,1848,1848,1848,1848,1849,1849,1849,1849,1849,1849,1849,1849,1850,1850,1850,1850,1850,1850,1850,1851,1852,1853,1853,1853,1854,1854,1854,1855,1855,1855,1855,1856,1856,1856,1857,1857,1857,1857,1857,1857,1857,1857,1857,1857,1857,1858,1858,1858,1858,1858,1859,1859,1859,1860,1860,1860,1860,1860,1860,1860,1860,1861,1861,1861,1861,1862,1862,1862,1864,1864,1865,1865,1865,1865,1865,1865,1865,
+		1865,1865,1865,1865,1865,1865,1865,1865,1866,1866,1867,1867,1867,1867,1867,1867,1867,1867,1867,1867,1867,1867,1868,1868,1868,1869,1869,1869,1870,1870,1870,1871,1871,1871,1871,1871,1871,1871,1871,1871,1871,1871,1871,1872,1872,1872,1873,1874,1874,1875,1875,1876,1877,1877,1877,1877,1877,1877,1877,1877,1877,1877,1877,1877,1878,1878,1878,1879,1881,1881,1881,1881,1882,1882,1883,1883,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1884,1885,1885,1886,1886,1887,1887,1888,1889,1889,1890,1890,1890,1890,1890,1890,1890,1890,1890,1890,1890,1890,1890,1890,1891,1892,1892,1892,1892,1893,1893,1893,1893,1893,1893,1893,1893,1893,1893,1893,1893,1893,1893,1893,1894,1894,1894,1895,1895,1896,1897,1897,1898,1898,1898,1899,1899,1899,1899,1899,1899,1899,1899,1899,1899,1900,1900,1900,1900,1900,1900,1901,1901,1901,1901,1901,1901,1901,1901,1901,1901,1901,1901,1901,1902,1903,1904,1904,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1905,1906,1907,1908,1908,1909,1909,1910,1911,1911,1911,1911,1911,1911,1911,1911,1911,1911,1912,1912,1912,1913,1914,1914,1914,1915,1915,1916,1916,1916,1916,1917,1918,1918,1918,1919,1920,1920,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1922,1922,1922,1923,1924,1924,1924,
+		1924,1924,1925,1925,1925,1925,1925,1925,1926,1926,1926,1926,1926,1926,1927,1928,1928,1929,1929,1929,1929,1929,1929,1930,1930,1930,1930,1931,1932,1932,1932,1932,1933,1934,1934,1934,1934,1934,1934,1934,1935,1936,1936,1936,1936,1936,1936,1937,1937,1937,1937,1937,1937,1937,1938,1938,1938,1938,1938,1938,1939,1939,1939,1940,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1942,1942,1943,1943,1944,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1946,1947,1947,1947,1947,1947,1947,1947,1947,1947,1947,1947,1947,1947,1949,1949,1949,1949,1949,1949,1949,1949,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1951,1951,1951,1951,1951,1952,1952,1952,1952,1952,1952,1952,1952,1953,1953,1953,1953,1953,1953,1954,1955,1955,1955,1955,1955,1956,1956,1956,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1957,1959,1960,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1961,1962,1962,1962,1962,1962,1962,1963,1963,1964,1964,1964,1964,1965,1966,1966,1967,1967,1967,1968,1969,1970,1970,1970,1970,1970,1971,1972,1973,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1974,1975,
+		1975,1975,1976,1977,1977,1977,1977,1978,1978,1978,1978,1978,1978,1978,1978,1978,1978,1978,1978,1979,1980,1981,1981,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1982,1983,1984,1985,1986,1986,1988,1988,1990,1990,1990,1990,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1991,1992,1992,1992,1992,1993,1993,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1994,1995,1996,1998,1998,1998,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2000,2001,2001,2002,2002,2002,2002,2002,2002,2004,2004,2004,2004,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2007,2008,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,
+		2010,2010,2010,2010,2010,2010,2010,2010,2010,2010,2011,2012,2012,2012,2012,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2014,2014,2014,2014,2015,2017,2018,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,
+		2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,2021,
+		2021,2021,2021,2021,2021,2021,2021,2021,2021
+	},
+	{
+		55,113,156,202,246,288,331,371,409,447,483,516,547,575,602,626,648,669,687,704,720,735,749,762,774,786,797,808,818,828,837,846,856,865,874,884,893,902,910,919,928,936,945,953,961,969,977,985,992,999,1006,1013,1020,1027,1034,1040,1046,1052,1059,1064,1070,1076,1081,1087,1092,1097,1102,1107,1112,1117,1121,1126,1131,1135,1140,1144,1148,1152,1157,1161,1165,1169,1173,1177,1181,1185,1189,1193,1197,1200,1204,1208,1211,1215,1219,1222,1226,1229,1232,1236,1239,1242,1246,1249,1252,1255,1258,1262,1265,1268,1271,1274,1277,1280,1283,1286,1289,1292,1295,1298,1300,1303,1306,1309,1311,1314,1317,1319,1322,1325,1327,1330,1333,1335,1338,1340,1343,1345,1348,1350,1352,1355,1357,1359,1362,1364,1366,1369,1371,1373,1376,1378,1380,1382,1384,1386,1389,1391,1393,1395,1397,1399,1401,1403,1405,1407,1409,1411,1413,1415,1417,1419,1421,1423,1425,1427,1429,1431,1433,1434,1436,1438,1439,1441,1443,1444,1446,1448,1450,1452,1454,1456,1457,1459,1461,1463,1465,1466,1468,1469,1471,1473,1475,1476,1478,1480,1482,1484,1485,1487,1489,1490,1492,1494,1495,1497,1498,1500,1501,1503,1505,1506,1508,1509,1511,1512,1514,1515,1517,1518,1520,1521,1523,1524,1526,1527,1528,1530,1531,1533,1534,1535,1537,1538,1540,1541,1542,1544,1545,1547,1548,1550,1551,1552,
+		1554,1555,1557,1558,1559,1561,1562,1563,1565,1566,1567,1568,1570,1571,1572,1574,1575,1576,1578,1579,1580,1582,1583,1584,1586,1587,1588,1589,1590,1592,1593,1594,1595,1596,1597,1598,1599,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1629,1630,1631,1631,1632,1633,1634,1636,1637,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1649,1650,1651,1652,1653,1654,1654,1655,1656,1657,1658,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1669,1670,1671,1672,1673,1673,1674,1675,1675,1676,1677,1678,1679,1680,1681,1681,1682,1683,1683,1684,1685,1685,1686,1687,1688,1688,1689,1690,1691,1692,1692,1693,1694,1695,1695,1696,1697,1698,1698,1699,1700,1700,1701,1702,1703,1704,1704,1705,1705,1706,1707,1707,1708,1709,1709,1709,1710,1710,1711,1712,1713,1713,1714,1714,1715,1715,1716,1717,1717,1718,1719,1719,1720,1720,1721,1722,1723,1724,1724,1725,1725,1726,1726,1727,1728,1728,1729,1729,1730,1731,1731,1732,1733,1733,1733,1733,1734,1734,1734,1735,1735,1735,1736,1736,1737,1737,1738,1739,1739,1740,1740,1741,1741,1742,1742,1743,1743,1744,1745,1745,1745,1746,1747,1747,1748,1748,1749,1749,1749,1750,1750,1751,1752,1752,1752,1752,1753,1754,1754,1754,1755,1755,1755,1755,1756,1757,1757,
+		1757,1757,1758,1759,1759,1760,1760,1760,1760,1761,1761,1761,1762,1762,1762,1763,1763,1764,1765,1765,1765,1766,1767,1767,1768,1768,1769,1769,1770,1770,1771,1771,1771,1772,1772,1773,1773,1773,1774,1774,1774,1775,1775,1775,1776,1776,1776,1777,1777,1778,1778,1779,1779,1780,1780,1780,1780,1780,1781,1781,1781,1781,1781,1781,1782,1782,1782,1782,1783,1783,1784,1785,1785,1785,1785,1786,1786,1786,1787,1787,1788,1788,1788,1788,1788,1788,1788,1788,1789,1789,1789,1789,1789,1789,1790,1790,1790,1790,1790,1791,1791,1791,1791,1791,1791,1792,1792,1793,1793,1793,1793,1793,1794,1795,1796,1796,1796,1797,1797,1797,1798,1798,1798,1798,1798,1798,1798,1798,1799,1799,1799,1799,1800,1800,1800,1800,1801,1801,1801,1801,1801,1802,1802,1802,1802,1802,1803,1803,1803,1803,1804,1804,1804,1804,1804,1804,1804,1804,1805,1805,1805,1805,1806,1806,1806,1807,1807,1807,1807,1807,1807,1807,1807,1808,1809,1810,1810,1810,1810,1810,1810,1810,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1812,1812,1812,1812,1812,1814,1814,1815,1815,1815,1816,1816,1816,1817,1817,1817,1817,1818,1818,1818,1818,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1820,1820,1820,1820,1820,1820,1821,1821,1822,1822,1822,1822,1822,1822,1822,1822,1823,1823,1823,1823,1824,1824,1824,1825,1826,1827,1827,1827,1827,1827,1827,1827,
+		1827,1827,1827,1827,1827,1827,1827,1827,1828,1828,1828,1828,1828,1828,1829,1829,1829,1829,1829,1829,1829,1829,1830,1830,1830,1831,1831,1831,1832,1832,1832,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1834,1834,1834,1835,1836,1836,1836,1837,1838,1838,1839,1839,1839,1839,1839,1839,1839,1839,1839,1839,1839,1839,1840,1840,1841,1843,1843,1843,1843,1844,1844,1845,1845,1845,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1846,1847,1847,1848,1848,1849,1849,1849,1851,1851,1851,1851,1851,1851,1851,1851,1851,1851,1851,1851,1852,1852,1852,1852,1853,1853,1853,1854,1854,1854,1854,1854,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1856,1856,1857,1858,1858,1858,1860,1860,1860,1860,1860,1860,1860,1860,1860,1860,1860,1860,1860,1861,1861,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1862,1863,1863,1864,1865,1865,1866,1866,1866,1866,1866,1866,1866,1866,1866,1866,1866,1866,1866,1866,1866,1867,1867,1867,1868,1869,1870,1870,1870,1871,1871,1872,1872,1872,1872,1872,1872,1872,1872,1872,1873,1873,1873,1874,1875,1876,1876,1876,1876,1877,1877,1877,1877,1878,1879,1879,1879,1880,1881,1882,1882,1883,1883,1883,1883,1883,1883,1883,1883,1883,1883,1883,1883,1883,1884,1884,1884,1884,1885,1885,1885,
+		1885,1885,1885,1885,1885,1885,1885,1887,1887,1887,1887,1887,1887,1888,1888,1889,1889,1889,1889,1889,1889,1889,1890,1890,1891,1891,1891,1892,1893,1893,1893,1894,1894,1894,1894,1894,1895,1895,1895,1895,1896,1896,1897,1897,1897,1897,1898,1898,1898,1898,1898,1898,1898,1898,1898,1898,1898,1899,1899,1899,1899,1900,1900,1901,1901,1902,1902,1902,1902,1902,1902,1902,1902,1902,1902,1902,1902,1903,1904,1905,1906,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1907,1908,1908,1908,1908,1908,1908,1909,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1910,1911,1912,1912,1912,1912,1912,1912,1912,1912,1912,1913,1913,1913,1914,1914,1914,1914,1914,1914,1914,1914,1915,1915,1915,1915,1915,1916,1916,1916,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1918,1919,1920,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1921,1922,1922,1922,1922,1922,1922,1922,1923,1923,1925,1925,1925,1925,1925,1925,1926,1927,1927,1928,1928,1929,1930,1930,1930,1930,1930,1931,1933,1933,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1934,1935,
+		1935,1936,1937,1937,1937,1937,1937,1938,1938,1938,1938,1938,1938,1938,1938,1938,1938,1938,1938,1939,1940,1940,1940,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1941,1942,1943,1944,1944,1945,1945,1948,1949,1949,1949,1949,1949,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1950,1951,1953,1953,1953,1953,1953,1953,1953,1954,1954,1954,1954,1954,1954,1954,1954,1954,1954,1954,1954,1954,1954,1954,1955,1956,1958,1958,1958,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1959,1960,1961,1961,1962,1962,1962,1962,1962,1962,1963,1964,1964,1964,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1967,1969,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,
+		1970,1970,1970,1970,1970,1970,1970,1970,1970,1970,1971,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1973,1974,1974,1974,1974,1974,1975,1976,1977,1978,1978,1978,1978,1978,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1979,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1980,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,
+		1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,1981,
+		1981,1981,1981,1981,1981,1981,1981,1981,1981
+	},
+	{
+		39,92,134,173,210,245,282,317,349,379,409,437,464,488,511,532,552,570,587,602,617,630,643,655,666,677,687,697,707,716,725,733,741,750,758,766,775,783,791,799,806,814,822,829,837,844,851,858,865,872,879,886,893,899,906,913,919,925,932,938,944,950,956,961,967,972,977,983,988,993,998,1003,1007,1012,1016,1021,1025,1030,1034,1038,1043,1047,1051,1055,1059,1063,1067,1071,1074,1078,1082,1085,1089,1093,1096,1100,1103,1106,1110,1113,1116,1120,1123,1126,1129,1133,1136,1139,1142,1145,1148,1151,1155,1158,1161,1164,1167,1170,1172,1175,1178,1181,1184,1186,1189,1192,1195,1197,1200,1203,1205,1208,1211,1213,1216,1218,1221,1223,1226,1228,1231,1233,1235,1238,1240,1242,1245,1247,1249,1252,1254,1256,1258,1261,1263,1265,1267,1269,1272,1274,1276,1278,1280,1282,1284,1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1306,1308,1310,1312,1313,1315,1317,1319,1320,1322,1324,1326,1328,1329,1331,1333,1335,1337,1339,1341,1342,1344,1346,1347,1349,1351,1353,1354,1356,1358,1360,1361,1363,1365,1367,1368,1370,1371,1373,1375,1376,1378,1380,1381,1383,1384,1386,1388,1389,1391,1392,1394,1395,1397,1398,1400,1401,1403,1404,1406,1407,1408,1410,1411,1413,1414,1416,1417,1418,1420,1421,1423,1424,1426,1427,1428,1430,1431,1433,
+		1434,1436,1437,1439,1440,1441,1443,1444,1445,1447,1448,1449,1450,1452,1453,1455,1456,1457,1459,1460,1461,1463,1464,1465,1467,1468,1469,1470,1471,1473,1474,1475,1476,1477,1478,1479,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1492,1493,1494,1495,1496,1497,1498,1499,1500,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1532,1533,1534,1535,1536,1537,1538,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1551,1552,1553,1553,1554,1555,1555,1556,1557,1558,1559,1560,1561,1561,1562,1563,1564,1564,1565,1566,1566,1567,1568,1569,1569,1570,1571,1572,1572,1573,1574,1575,1576,1576,1577,1578,1579,1579,1580,1581,1581,1582,1582,1583,1585,1585,1586,1586,1587,1588,1588,1589,1590,1591,1591,1591,1592,1592,1593,1594,1594,1595,1595,1596,1596,1597,1598,1599,1599,1600,1601,1601,1602,1603,1604,1604,1605,1606,1606,1607,1607,1608,1609,1609,1610,1610,1611,1612,1613,1613,1614,1614,1615,1615,1615,1616,1616,1617,1617,1617,1617,1618,1618,1619,1619,1620,1620,1621,1621,1622,1622,1623,1624,1624,1624,1625,1626,1626,1627,1627,1628,1628,1629,1630,1630,1631,1631,1631,1632,1632,1633,1634,1634,1635,1635,1635,1635,1636,1637,1637,1637,1638,1638,1638,1638,1639,1640,
+		1640,1640,1640,1641,1641,1642,1642,1643,1643,1643,1643,1644,1645,1645,1645,1646,1646,1647,1647,1648,1648,1649,1650,1650,1650,1651,1651,1652,1652,1652,1653,1654,1654,1654,1655,1655,1656,1656,1656,1657,1657,1657,1658,1658,1659,1659,1659,1660,1660,1661,1661,1662,1662,1662,1663,1663,1663,1663,1663,1663,1663,1663,1663,1664,1664,1665,1665,1665,1665,1666,1667,1667,1668,1668,1669,1669,1669,1669,1670,1670,1671,1671,1671,1671,1671,1671,1671,1671,1672,1672,1672,1672,1672,1672,1673,1673,1673,1673,1673,1673,1674,1674,1674,1674,1674,1674,1675,1676,1676,1676,1677,1677,1677,1678,1678,1679,1679,1679,1680,1680,1680,1680,1681,1681,1681,1681,1681,1681,1682,1682,1682,1682,1683,1683,1683,1683,1684,1684,1684,1684,1684,1685,1685,1685,1685,1685,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1687,1687,1688,1688,1688,1688,1689,1689,1689,1690,1690,1690,1690,1690,1690,1690,1690,1691,1692,1693,1693,1693,1693,1693,1693,1693,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1696,1697,1697,1698,1698,1698,1699,1699,1700,1700,1700,1700,1700,1700,1701,1701,1701,1702,1702,1702,1702,1702,1702,1702,1702,1702,1702,1703,1703,1703,1703,1703,1704,1704,1705,1705,1705,1705,1705,1705,1705,1705,1706,1706,1706,1706,1706,1707,1707,1708,1708,1709,1709,1710,1710,1710,1710,1710,1710,
+		1710,1710,1710,1710,1710,1710,1710,1710,1710,1711,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1713,1714,1714,1714,1714,1715,1715,1716,1716,1716,1716,1716,1716,1716,1716,1716,1716,1716,1716,1717,1717,1717,1717,1718,1719,1719,1719,1720,1721,1721,1722,1722,1722,1722,1722,1722,1722,1722,1722,1722,1722,1722,1722,1723,1724,1725,1726,1726,1726,1726,1726,1727,1728,1728,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1730,1730,1731,1731,1732,1732,1733,1734,1734,1734,1734,1734,1734,1734,1734,1734,1734,1734,1734,1734,1734,1735,1735,1736,1736,1736,1737,1737,1737,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1738,1739,1739,1740,1741,1741,1741,1742,1743,1743,1743,1743,1743,1743,1743,1743,1743,1744,1744,1744,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1745,1746,1746,1746,1747,1748,1749,1749,1749,1749,1750,1750,1750,1750,1750,1750,1750,1750,1750,1750,1750,1750,1750,1750,1751,1752,1753,1753,1753,1753,1754,1754,1754,1755,1755,1755,1755,1755,1755,1755,1755,1756,1756,1756,1756,1758,1758,1758,1759,1759,1759,1760,1760,1760,1761,1762,1762,1762,1763,1764,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1767,1767,1767,1767,1768,1768,1768,
+		1768,1768,1769,1769,1769,1769,1769,1769,1769,1769,1769,1769,1770,1770,1771,1772,1772,1772,1772,1772,1772,1772,1773,1773,1773,1773,1774,1775,1775,1776,1776,1776,1777,1778,1778,1778,1778,1778,1778,1778,1778,1779,1779,1780,1780,1780,1780,1781,1781,1781,1781,1781,1781,1781,1781,1782,1782,1782,1782,1782,1783,1783,1784,1784,1784,1784,1785,1785,1785,1785,1785,1785,1785,1785,1785,1785,1785,1786,1787,1788,1789,1789,1789,1789,1789,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1790,1791,1791,1791,1791,1791,1791,1792,1792,1793,1793,1793,1793,1793,1793,1793,1794,1794,1794,1794,1794,1794,1794,1794,1794,1794,1794,1794,1794,1794,1795,1795,1795,1795,1795,1796,1796,1796,1796,1796,1796,1796,1797,1797,1797,1797,1797,1797,1797,1797,1798,1798,1798,1798,1799,1799,1799,1799,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1802,1803,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1804,1805,1805,1805,1805,1805,1805,1805,1805,1805,1805,1805,1805,1806,1806,1807,1807,1807,1807,1809,1809,1809,1809,1810,1810,1811,1812,1813,1813,1813,1813,1814,1815,1816,1816,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,1817,
+		1818,1818,1819,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1820,1822,1823,1823,1823,1824,1824,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1826,1827,1829,1829,1830,1830,1832,1832,1832,1832,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1833,1835,1835,1835,1836,1836,1836,1836,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1837,1838,1841,1841,1841,1841,1841,1841,1841,1841,1841,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1842,1843,1843,1844,1844,1844,1844,1844,1844,1846,1846,1846,1847,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1848,1849,1850,1851,1851,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,
+		1852,1852,1852,1852,1852,1852,1852,1852,1852,1852,1853,1854,1854,1854,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1855,1856,1856,1856,1856,1857,1858,1859,1860,1860,1860,1860,1860,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1861,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,
+		1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,1863,
+		1863,1863,1863,1863,1863,1863,1863,1863,1863
+	},
+	{
+		39,94,138,177,213,248,285,320,351,381,411,438,464,488,510,531,550,568,585,600,614,627,639,650,661,672,682,691,700,709,717,725,733,741,749,757,765,773,780,788,795,802,810,817,824,831,838,845,852,858,865,872,878,885,891,898,904,910,916,922,928,934,940,946,951,957,962,967,973,978,983,987,992,997,1002,1006,1011,1015,1019,1023,1028,1032,1036,1040,1044,1048,1051,1055,1059,1063,1066,1070,1073,1077,1080,1084,1087,1090,1094,1097,1100,1103,1106,1109,1112,1116,1118,1121,1125,1128,1131,1134,1136,1139,1142,1145,1148,1151,1154,1156,1159,1162,1165,1167,1170,1172,1175,1178,1180,1183,1185,1188,1190,1193,1196,1198,1200,1203,1205,1208,1210,1212,1214,1217,1219,1221,1223,1226,1228,1230,1232,1235,1237,1239,1241,1243,1245,1247,1249,1251,1253,1255,1258,1260,1261,1264,1266,1268,1270,1272,1273,1275,1277,1279,1281,1283,1285,1286,1288,1290,1291,1293,1295,1296,1298,1300,1302,1303,1305,1307,1309,1311,1312,1314,1316,1318,1320,1321,1323,1324,1326,1328,1330,1331,1333,1335,1336,1338,1340,1341,1343,1344,1346,1348,1349,1351,1352,1354,1355,1357,1358,1360,1361,1363,1364,1366,1368,1369,1370,1372,1373,1375,1376,1378,1379,1380,1382,1383,1385,1386,1387,1389,1390,1391,1393,1394,1396,1397,1398,1400,1401,1403,1404,1405,
+		1407,1408,1410,1411,1412,1413,1415,1416,1417,1419,1420,1421,1422,1423,1425,1426,1428,1429,1430,1431,1433,1434,1435,1436,1438,1439,1440,1441,1443,1444,1445,1446,1447,1448,1449,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1482,1483,1484,1485,1487,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1496,1497,1498,1499,1500,1501,1502,1503,1503,1504,1505,1506,1507,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1516,1518,1518,1519,1520,1520,1521,1522,1522,1523,1524,1524,1525,1526,1527,1528,1529,1529,1530,1531,1532,1532,1533,1534,1534,1535,1536,1536,1537,1538,1539,1539,1541,1541,1542,1543,1543,1544,1545,1546,1546,1547,1548,1548,1549,1550,1550,1551,1552,1553,1553,1554,1554,1555,1555,1556,1557,1557,1558,1558,1559,1559,1560,1561,1562,1562,1563,1563,1564,1564,1565,1566,1566,1567,1567,1568,1569,1569,1570,1571,1572,1572,1573,1573,1574,1574,1575,1576,1576,1577,1577,1578,1579,1579,1580,1581,1581,1581,1582,1582,1583,1583,1583,1583,1584,1584,1584,1585,1585,1586,1586,1587,1588,1588,1588,1589,1590,1590,1590,1591,1592,1592,1593,1593,1594,1594,1595,1596,1596,1597,1597,1597,1598,1598,1599,1599,1600,1600,1600,1601,1601,1602,1603,1603,1603,1603,1604,1604,1604,1605,1605,
+		1605,1605,1606,1606,1607,1607,1608,1608,1608,1608,1609,1609,1610,1611,1611,1611,1612,1612,1613,1613,1614,1614,1615,1615,1616,1616,1617,1617,1617,1618,1618,1619,1619,1620,1620,1620,1621,1621,1622,1622,1622,1623,1623,1623,1624,1624,1624,1625,1625,1625,1626,1627,1627,1627,1627,1628,1628,1628,1628,1628,1628,1628,1628,1629,1630,1630,1630,1631,1631,1631,1632,1632,1633,1633,1633,1633,1634,1634,1634,1635,1635,1636,1636,1636,1636,1636,1636,1636,1636,1637,1637,1637,1637,1637,1638,1638,1638,1638,1638,1639,1639,1639,1639,1639,1639,1639,1640,1640,1641,1641,1641,1641,1642,1642,1643,1644,1644,1644,1644,1645,1645,1645,1645,1645,1645,1645,1646,1646,1646,1647,1647,1647,1647,1648,1648,1648,1649,1649,1649,1649,1649,1649,1649,1650,1650,1650,1650,1650,1650,1651,1651,1651,1651,1651,1651,1651,1652,1652,1653,1653,1653,1653,1653,1653,1654,1654,1655,1655,1655,1655,1655,1655,1655,1655,1656,1657,1657,1657,1657,1657,1657,1657,1658,1658,1658,1658,1658,1658,1658,1658,1659,1659,1659,1659,1659,1660,1660,1661,1661,1662,1662,1662,1663,1663,1663,1664,1664,1665,1665,1665,1665,1665,1665,1666,1666,1666,1666,1666,1666,1666,1666,1666,1666,1667,1667,1667,1667,1667,1668,1668,1668,1669,1669,1669,1669,1669,1669,1669,1670,1670,1670,1670,1670,1671,1671,1671,1672,1673,1674,1674,1674,1674,1674,1674,1674,
+		1674,1674,1674,1674,1674,1674,1674,1674,1675,1675,1675,1675,1675,1675,1675,1676,1676,1676,1676,1676,1676,1676,1676,1676,1677,1678,1678,1678,1679,1679,1679,1680,1680,1680,1680,1680,1680,1680,1680,1680,1680,1680,1680,1680,1680,1681,1682,1682,1683,1683,1684,1685,1685,1685,1685,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1688,1689,1689,1690,1690,1690,1690,1690,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1692,1693,1693,1694,1694,1695,1695,1696,1696,1697,1697,1697,1697,1697,1697,1697,1697,1697,1697,1697,1698,1698,1698,1698,1698,1699,1699,1699,1700,1700,1700,1700,1700,1700,1700,1700,1700,1701,1701,1701,1701,1701,1701,1701,1701,1701,1702,1703,1703,1704,1704,1704,1705,1705,1705,1705,1705,1705,1705,1705,1705,1706,1706,1706,1706,1707,1707,1707,1707,1707,1707,1708,1708,1708,1708,1708,1708,1708,1708,1708,1708,1708,1708,1708,1709,1710,1710,1711,1711,1711,1711,1711,1711,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1712,1713,1714,1714,1714,1715,1715,1716,1717,1717,1718,1718,1718,1718,1718,1718,1718,1718,1718,1718,1719,1719,1720,1720,1721,1722,1722,1722,1722,1722,1722,1723,1724,1724,1724,1726,1726,1726,1727,1727,1727,1727,1727,1727,1727,1727,1727,1727,1727,1727,1727,1727,1728,1728,1728,1728,1729,1729,1730,
+		1730,1730,1730,1730,1730,1730,1730,1731,1731,1731,1731,1731,1731,1732,1733,1733,1733,1734,1734,1734,1734,1734,1734,1735,1735,1735,1736,1736,1736,1737,1737,1737,1739,1739,1739,1739,1739,1739,1739,1740,1740,1740,1741,1741,1741,1741,1741,1742,1742,1742,1742,1742,1742,1742,1742,1742,1742,1743,1743,1743,1744,1744,1744,1745,1745,1745,1745,1746,1746,1746,1746,1746,1746,1746,1746,1746,1747,1748,1748,1749,1750,1750,1750,1750,1750,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1751,1752,1752,1752,1752,1752,1752,1752,1752,1753,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1754,1755,1755,1755,1755,1755,1755,1756,1756,1756,1756,1756,1756,1756,1757,1757,1758,1758,1758,1758,1758,1758,1758,1759,1759,1759,1759,1759,1760,1760,1761,1761,1761,1762,1762,1762,1762,1762,1762,1762,1762,1762,1762,1762,1762,1762,1762,1764,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1765,1766,1766,1766,1766,1766,1766,1766,1766,1767,1768,1768,1768,1768,1768,1769,1769,1769,1770,1770,1771,1771,1772,1772,1773,1773,1774,1774,1775,1776,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,1777,
+		1778,1778,1779,1779,1779,1779,1779,1780,1780,1780,1780,1780,1780,1780,1780,1780,1780,1780,1781,1781,1782,1782,1783,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1784,1785,1786,1787,1787,1788,1790,1790,1791,1791,1791,1791,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1792,1793,1794,1794,1794,1794,1794,1794,1795,1796,1796,1796,1796,1796,1796,1796,1796,1796,1796,1796,1796,1796,1796,1796,1797,1798,1800,1800,1800,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1802,1802,1802,1803,1803,1804,1804,1804,1804,1804,1805,1805,1805,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1807,1809,1810,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,
+		1811,1811,1811,1811,1811,1811,1811,1811,1811,1811,1812,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1814,1815,1815,1815,1816,1817,1817,1818,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1819,1820,1820,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,
+		1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,1821,
+		1821,1821,1821,1821,1821,1821,1821,1821,1821
+	},
+	{
+		27,60,103,137,171,203,236,269,299,326,353,379,403,425,446,466,484,501,516,531,544,556,568,578,589,598,608,616,625,633,641,648,656,663,671,678,685,692,700,707,714,721,728,734,741,747,754,760,766,773,779,785,791,797,803,809,815,821,827,832,838,844,849,855,860,866,871,877,882,887,892,897,902,907,912,917,922,926,931,936,940,944,949,953,957,962,966,970,974,977,981,985,989,992,996,1000,1003,1006,1010,1013,1016,1020,1023,1026,1029,1032,1035,1038,1041,1044,1047,1050,1053,1056,1059,1062,1065,1068,1071,1073,1076,1079,1082,1084,1087,1090,1092,1095,1097,1100,1102,1105,1107,1110,1112,1115,1117,1120,1122,1125,1127,1129,1132,1134,1136,1139,1141,1143,1145,1148,1150,1152,1154,1156,1158,1160,1163,1165,1167,1169,1171,1173,1175,1177,1179,1181,1183,1185,1187,1189,1191,1193,1195,1197,1199,1200,1202,1204,1206,1208,1209,1211,1213,1214,1216,1218,1220,1222,1223,1225,1227,1229,1231,1232,1234,1236,1238,1239,1241,1242,1244,1246,1247,1249,1251,1253,1254,1256,1258,1259,1261,1262,1264,1265,1267,1269,1270,1272,1273,1275,1276,1278,1280,1281,1283,1284,1286,1287,1289,1290,1291,1293,1294,1296,1297,1298,1300,1301,1303,1304,1305,1307,1308,1310,1311,1312,1314,1315,1317,1318,1319,1321,1322,1324,
+		1325,1327,1328,1329,1330,1332,1333,1334,1336,1337,1338,1339,1340,1342,1343,1345,1346,1347,1348,1350,1351,1352,1353,1355,1356,1357,1358,1360,1361,1362,1363,1364,1366,1367,1368,1369,1370,1371,1372,1373,1374,1376,1376,1377,1378,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1409,1410,1412,1412,1413,1414,1415,1416,1417,1418,1419,1420,1420,1421,1422,1423,1424,1424,1425,1426,1427,1428,1428,1430,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1439,1440,1441,1441,1442,1443,1443,1444,1445,1446,1447,1447,1448,1449,1449,1451,1451,1452,1453,1453,1454,1455,1455,1456,1457,1458,1458,1459,1460,1461,1461,1462,1463,1464,1464,1465,1465,1466,1467,1468,1468,1469,1470,1471,1472,1472,1473,1474,1474,1474,1475,1476,1476,1477,1477,1478,1478,1479,1479,1480,1481,1481,1482,1482,1483,1484,1484,1485,1486,1486,1487,1488,1488,1489,1490,1490,1491,1491,1492,1493,1493,1494,1494,1495,1496,1496,1497,1498,1498,1499,1500,1500,1500,1501,1501,1501,1502,1502,1502,1503,1503,1503,1504,1504,1505,1505,1506,1506,1507,1507,1508,1508,1509,1509,1510,1511,1511,1511,1512,1513,1513,1514,1514,1515,1515,1516,1516,1516,1517,1518,1518,1519,1519,1519,1519,1520,1521,1521,1522,1522,1522,1522,1523,1523,1524,1524,
+		1524,1524,1525,1525,1526,1527,1527,1527,1528,1528,1528,1528,1529,1529,1530,1530,1530,1531,1532,1532,1532,1533,1534,1534,1534,1535,1535,1536,1536,1536,1537,1538,1538,1538,1539,1539,1540,1540,1541,1541,1541,1542,1542,1543,1543,1543,1543,1544,1544,1545,1545,1546,1546,1546,1546,1547,1547,1547,1547,1547,1547,1547,1548,1548,1548,1549,1549,1549,1549,1550,1551,1552,1552,1552,1553,1553,1553,1554,1554,1554,1555,1555,1555,1555,1555,1555,1555,1555,1555,1555,1556,1556,1556,1556,1557,1557,1557,1557,1557,1558,1558,1558,1558,1558,1558,1558,1559,1560,1560,1560,1560,1560,1561,1562,1562,1563,1563,1563,1563,1564,1564,1564,1565,1565,1565,1565,1565,1565,1566,1566,1566,1566,1567,1567,1567,1567,1568,1568,1568,1568,1568,1569,1569,1569,1569,1569,1569,1569,1570,1570,1570,1570,1570,1570,1570,1571,1571,1572,1572,1572,1572,1572,1573,1573,1573,1574,1574,1574,1574,1574,1574,1574,1574,1575,1575,1576,1576,1576,1577,1577,1577,1577,1578,1578,1578,1578,1578,1578,1578,1578,1578,1579,1579,1579,1579,1579,1579,1580,1581,1581,1581,1581,1582,1583,1583,1583,1583,1584,1584,1584,1584,1584,1585,1585,1585,1585,1585,1585,1585,1585,1585,1586,1586,1586,1586,1586,1587,1587,1587,1588,1588,1588,1588,1588,1588,1588,1588,1588,1589,1589,1589,1589,1589,1590,1590,1591,1592,1592,1593,1593,1593,1593,1593,1593,1593,
+		1593,1593,1593,1593,1593,1593,1593,1594,1594,1594,1595,1595,1595,1595,1595,1595,1595,1596,1596,1596,1596,1596,1596,1597,1597,1597,1597,1598,1598,1598,1599,1599,1599,1599,1599,1599,1599,1599,1599,1599,1599,1600,1600,1600,1600,1601,1601,1602,1602,1603,1603,1604,1604,1604,1604,1604,1604,1604,1604,1604,1605,1605,1605,1605,1605,1605,1606,1607,1608,1608,1609,1609,1609,1609,1610,1610,1610,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1611,1612,1612,1612,1613,1614,1614,1614,1615,1615,1616,1616,1617,1617,1617,1617,1617,1617,1617,1617,1617,1617,1617,1617,1617,1618,1618,1618,1618,1619,1619,1619,1619,1619,1619,1619,1619,1619,1619,1620,1620,1620,1620,1620,1620,1620,1620,1621,1621,1623,1623,1623,1623,1624,1624,1624,1625,1625,1625,1625,1625,1625,1625,1625,1625,1625,1626,1626,1626,1626,1626,1626,1627,1627,1627,1627,1627,1627,1627,1627,1627,1627,1627,1627,1628,1628,1629,1630,1630,1630,1630,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1632,1633,1633,1634,1634,1634,1635,1636,1636,1636,1636,1636,1636,1636,1636,1636,1636,1637,1638,1638,1639,1639,1640,1640,1641,1641,1641,1641,1641,1641,1643,1643,1643,1643,1644,1644,1645,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1646,1648,1648,1648,1648,
+		1648,1649,1649,1649,1649,1649,1650,1650,1650,1650,1650,1650,1651,1651,1652,1653,1653,1653,1653,1653,1653,1653,1653,1653,1653,1653,1655,1655,1656,1656,1656,1657,1657,1658,1658,1658,1658,1658,1658,1658,1658,1659,1659,1660,1660,1660,1660,1661,1661,1661,1661,1661,1661,1661,1661,1661,1661,1662,1662,1662,1662,1663,1664,1664,1664,1664,1665,1665,1665,1665,1665,1665,1666,1666,1666,1666,1666,1666,1667,1668,1669,1669,1669,1669,1669,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1670,1671,1671,1671,1671,1672,1672,1672,1672,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1673,1674,1674,1674,1674,1674,1674,1675,1675,1675,1675,1675,1675,1676,1676,1676,1677,1677,1677,1677,1677,1677,1677,1677,1677,1677,1678,1678,1679,1680,1680,1680,1680,1680,1680,1681,1681,1681,1681,1681,1681,1681,1681,1681,1681,1681,1681,1682,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1684,1685,1685,1685,1685,1685,1685,1685,1685,1685,1685,1685,1685,1685,1686,1686,1686,1687,1687,1687,1688,1688,1688,1688,1688,1690,1690,1691,1691,1691,1692,1692,1693,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1695,1696,
+		1696,1697,1697,1697,1698,1698,1699,1699,1699,1699,1699,1699,1699,1699,1699,1699,1699,1699,1699,1699,1701,1701,1701,1702,1703,1703,1703,1703,1703,1703,1703,1703,1703,1703,1703,1703,1703,1703,1703,1704,1705,1705,1706,1707,1708,1709,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1710,1711,1711,1711,1713,1713,1713,1713,1713,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1714,1715,1715,1717,1718,1718,1718,1718,1718,1718,1718,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1719,1720,1720,1721,1721,1721,1721,1721,1721,1721,1723,1723,1723,1724,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1725,1727,1728,1728,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,
+		1729,1729,1729,1729,1729,1729,1729,1729,1729,1729,1730,1731,1731,1731,1731,1732,1732,1732,1732,1732,1732,1732,1732,1732,1732,1732,1732,1732,1732,1733,1733,1734,1735,1735,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1737,1738,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1740,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,
+		1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,1741,
+		1741,1741,1741,1741,1741,1741,1741,1741,1741
+	},
+	{
+		27,61,108,143,177,208,241,274,303,329,355,379,402,423,443,461,479,494,509,523,535,546,557,567,577,586,595,603,610,618,625,632,639,646,653,660,666,673,679,686,693,699,706,712,718,724,730,736,742,748,754,759,765,771,776,782,787,792,798,803,809,814,819,824,830,835,840,845,850,855,860,865,870,875,880,884,889,894,899,903,908,912,917,921,926,930,934,938,942,946,950,954,958,962,965,969,973,976,980,983,986,989,993,996,999,1002,1005,1008,1011,1014,1017,1020,1023,1026,1029,1032,1035,1037,1040,1043,1045,1048,1051,1053,1056,1059,1061,1064,1066,1068,1071,1073,1076,1078,1080,1083,1085,1087,1089,1092,1094,1096,1098,1100,1103,1105,1107,1109,1112,1114,1116,1118,1120,1123,1125,1127,1129,1131,1133,1135,1136,1138,1140,1142,1144,1146,1148,1150,1152,1154,1155,1157,1159,1161,1163,1165,1167,1168,1170,1172,1174,1175,1177,1178,1180,1181,1183,1184,1186,1188,1190,1191,1193,1195,1197,1199,1200,1202,1203,1205,1207,1208,1210,1211,1213,1215,1216,1218,1219,1221,1223,1224,1226,1227,1229,1230,1232,1233,1235,1236,1238,1239,1241,1242,1244,1245,1247,1248,1249,1251,1252,1254,1255,1256,1258,1259,1260,1261,1263,1264,1266,1267,1268,1270,1271,1272,1274,1275,1277,1278,1279,1281,1282,1283,
+		1285,1286,1287,1288,1290,1291,1292,1293,1295,1296,1297,1298,1299,1301,1302,1303,1305,1306,1307,1308,1310,1311,1312,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1331,1332,1332,1333,1334,1336,1337,1338,1339,1340,1342,1342,1343,1344,1345,1346,1348,1349,1349,1350,1351,1352,1353,1354,1356,1356,1357,1358,1359,1360,1361,1362,1363,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1373,1374,1375,1375,1376,1377,1378,1378,1379,1380,1381,1381,1382,1383,1384,1385,1386,1387,1387,1388,1389,1390,1391,1392,1392,1393,1394,1395,1395,1396,1397,1397,1398,1399,1400,1400,1401,1402,1403,1403,1404,1405,1406,1407,1407,1408,1409,1409,1410,1410,1411,1412,1413,1414,1414,1415,1416,1416,1417,1418,1419,1419,1420,1420,1421,1422,1422,1423,1424,1424,1425,1426,1426,1427,1428,1428,1429,1429,1430,1430,1431,1432,1432,1433,1433,1434,1434,1435,1435,1436,1436,1437,1438,1438,1439,1440,1441,1441,1442,1443,1443,1444,1445,1445,1445,1446,1447,1447,1448,1449,1449,1450,1450,1451,1452,1452,1453,1453,1453,1453,1454,1454,1455,1456,1456,1456,1456,1456,1457,1458,1458,1458,1459,1459,1460,1460,1461,1461,1462,1463,1463,1464,1464,1465,1465,1466,1466,1467,1467,1468,1469,1469,1470,1470,1470,1470,1470,1471,1471,1472,1472,1472,1473,1473,1474,1475,1475,1476,1476,1476,1476,1477,1478,
+		1478,1478,1479,1479,1480,1480,1481,1481,1481,1481,1481,1482,1482,1483,1483,1484,1484,1484,1484,1485,1485,1486,1486,1487,1487,1487,1487,1488,1488,1489,1489,1490,1490,1491,1491,1492,1492,1493,1493,1493,1494,1494,1495,1495,1495,1495,1495,1496,1496,1496,1497,1497,1497,1497,1498,1498,1499,1499,1499,1499,1499,1499,1500,1500,1501,1501,1501,1501,1502,1502,1503,1503,1503,1503,1504,1504,1504,1505,1505,1505,1505,1506,1506,1506,1507,1507,1507,1507,1508,1508,1508,1508,1508,1509,1509,1509,1509,1510,1510,1510,1510,1510,1511,1511,1511,1512,1512,1512,1512,1512,1512,1513,1513,1514,1514,1515,1515,1515,1516,1516,1517,1517,1517,1517,1517,1517,1517,1517,1517,1518,1518,1518,1518,1518,1518,1518,1519,1519,1519,1520,1520,1520,1520,1520,1521,1521,1521,1521,1522,1522,1522,1522,1522,1523,1523,1523,1524,1524,1524,1524,1524,1525,1525,1525,1525,1525,1526,1526,1526,1526,1526,1526,1526,1527,1527,1528,1528,1528,1528,1529,1529,1530,1530,1530,1530,1531,1531,1531,1531,1531,1531,1531,1531,1531,1531,1532,1532,1532,1533,1533,1533,1533,1534,1534,1534,1534,1534,1534,1534,1534,1535,1535,1536,1536,1536,1537,1537,1537,1537,1538,1538,1538,1539,1539,1539,1539,1539,1539,1539,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1541,1541,1542,1543,1543,1543,1544,1544,1545,1545,1545,1545,1545,1545,1545,
+		1545,1545,1545,1545,1545,1545,1545,1546,1546,1546,1546,1546,1546,1546,1547,1547,1547,1547,1547,1547,1547,1547,1547,1547,1547,1548,1548,1549,1549,1550,1551,1552,1552,1552,1552,1552,1552,1552,1552,1552,1552,1552,1552,1552,1552,1552,1553,1553,1553,1553,1554,1555,1555,1555,1555,1555,1556,1556,1556,1557,1557,1557,1557,1557,1557,1557,1558,1558,1558,1558,1559,1560,1560,1560,1560,1560,1561,1561,1562,1562,1563,1563,1563,1563,1563,1563,1563,1563,1563,1563,1563,1563,1563,1564,1564,1564,1564,1565,1566,1567,1567,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1569,1569,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1570,1571,1571,1572,1572,1572,1572,1572,1572,1573,1573,1574,1574,1574,1574,1574,1574,1575,1575,1575,1575,1575,1575,1575,1575,1575,1576,1576,1576,1576,1576,1576,1576,1577,1577,1577,1577,1577,1577,1578,1579,1579,1579,1579,1580,1580,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1581,1582,1582,1583,1584,1585,1585,1585,1586,1586,1586,1587,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1589,1590,1590,1591,1591,1591,1591,1591,1592,1592,1592,1592,1592,1592,1592,1592,1594,1594,1594,1594,1594,1594,1595,1595,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1597,1597,1597,1597,
+		1598,1598,1598,1598,1598,1598,1600,1600,1600,1600,1600,1601,1601,1602,1603,1604,1604,1604,1604,1605,1605,1605,1605,1606,1606,1606,1606,1607,1607,1607,1608,1608,1608,1608,1608,1608,1608,1608,1608,1608,1608,1608,1608,1608,1608,1609,1610,1611,1611,1611,1611,1611,1611,1612,1612,1612,1612,1612,1612,1612,1613,1613,1613,1613,1613,1613,1613,1614,1614,1614,1614,1614,1615,1615,1616,1616,1616,1616,1616,1617,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1618,1619,1619,1619,1619,1619,1619,1620,1620,1620,1620,1620,1620,1620,1620,1620,1621,1621,1621,1621,1621,1621,1621,1621,1621,1621,1621,1621,1621,1622,1622,1622,1622,1622,1622,1622,1622,1622,1622,1622,1622,1622,1623,1623,1624,1625,1625,1626,1626,1626,1626,1626,1626,1626,1626,1626,1626,1626,1626,1626,1626,1626,1627,1627,1628,1629,1630,1630,1630,1630,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1631,1632,1632,1632,1632,1632,1632,1632,1632,1632,1632,1632,1632,1633,1633,1633,1633,1633,1633,1633,1633,1633,1633,1633,1633,1633,1634,1635,1636,1636,1636,1636,1636,1636,1636,1636,1636,1636,1637,1637,1638,1640,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1641,1642,1642,1642,1643,1643,
+		1643,1643,1644,1644,1644,1644,1644,1645,1645,1646,1646,1646,1646,1646,1646,1647,1647,1647,1647,1648,1649,1649,1649,1650,1650,1651,1651,1651,1651,1651,1651,1651,1651,1651,1651,1651,1651,1651,1651,1651,1652,1652,1653,1653,1654,1654,1655,1655,1656,1656,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1657,1658,1658,1658,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1659,1660,1660,1660,1660,1660,1660,1660,1661,1662,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1663,1664,1664,1664,1664,1664,1666,1667,1667,1667,1667,1667,1667,1668,1668,1668,1669,1669,1669,1669,1669,1670,1670,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1671,1672,1672,1673,1673,1673,1675,1676,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,
+		1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1678,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1679,1680,1680,1681,1681,1681,1681,1681,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1682,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1683,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1684,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,
+		1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,1686,
+		1686,1686,1686,1686,1686,1686,1686,1686,1686
+	},
+	{
+		23,38,69,103,132,161,188,216,244,271,295,317,339,359,378,396,412,428,442,455,467,478,488,498,507,516,524,532,539,546,553,560,567,574,580,587,593,600,606,612,619,625,631,637,643,649,655,661,666,672,677,683,688,693,699,704,709,714,719,724,729,734,739,743,748,753,757,762,767,771,776,780,785,790,794,798,803,807,812,816,821,825,829,834,838,842,847,851,855,859,863,867,871,875,879,883,887,890,894,898,901,905,908,911,915,918,921,924,927,931,934,937,940,943,946,949,952,955,957,960,963,966,968,971,974,976,979,981,984,986,989,991,994,996,998,1001,1003,1005,1008,1010,1012,1015,1017,1019,1021,1023,1025,1028,1030,1032,1034,1036,1039,1041,1043,1045,1047,1049,1051,1053,1055,1057,1059,1061,1063,1064,1066,1068,1070,1072,1074,1076,1078,1080,1081,1083,1085,1087,1088,1090,1092,1094,1095,1096,1098,1100,1102,1103,1105,1107,1108,1110,1112,1114,1115,1117,1119,1120,1122,1123,1125,1127,1129,1130,1132,1133,1135,1137,1138,1140,1142,1143,1144,1146,1148,1149,1151,1152,1153,1155,1156,1158,1159,1161,1162,1164,1165,1166,1168,1169,1171,1172,1174,1175,1176,1177,1179,1180,1182,1183,1184,1186,1187,1188,1190,1191,1193,1194,1195,1197,1198,1199,1201,1202,
+		1203,1204,1206,1207,1208,1209,1211,1212,1213,1215,1216,1217,1218,1219,1221,1222,1223,1225,1226,1227,1228,1229,1231,1232,1233,1234,1235,1236,1237,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1289,1290,1291,1292,1293,1294,1294,1295,1296,1297,1298,1299,1299,1300,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1310,1311,1312,1313,1313,1314,1315,1315,1316,1316,1317,1318,1319,1320,1321,1322,1322,1323,1324,1324,1325,1326,1327,1327,1328,1328,1329,1330,1331,1331,1332,1333,1334,1334,1335,1336,1336,1337,1338,1339,1339,1340,1341,1341,1342,1342,1343,1344,1344,1345,1346,1346,1347,1347,1348,1348,1349,1350,1350,1351,1351,1352,1352,1353,1353,1354,1355,1355,1356,1356,1357,1358,1359,1359,1360,1361,1361,1362,1363,1363,1363,1364,1365,1365,1366,1367,1367,1368,1368,1369,1370,1370,1371,1371,1372,1372,1372,1372,1373,1374,1374,1374,1375,1375,1375,1376,1376,1377,1377,1377,1377,1378,1379,1379,1380,1381,1381,1382,1382,1383,1383,1384,1384,1385,1385,1386,1387,1387,1388,1388,1388,1389,1389,1389,1390,1390,1390,1391,1391,1391,1392,1392,1393,1393,1394,1394,1395,1395,1396,1396,
+		1397,1397,1397,1398,1398,1399,1400,1400,1400,1400,1400,1401,1401,1402,1402,1402,1402,1403,1403,1403,1404,1405,1405,1406,1406,1406,1407,1407,1408,1408,1408,1409,1409,1409,1410,1410,1411,1411,1411,1412,1413,1413,1413,1413,1413,1414,1414,1415,1415,1415,1415,1416,1416,1416,1416,1417,1417,1417,1417,1417,1418,1418,1418,1418,1419,1419,1419,1420,1420,1421,1421,1422,1422,1422,1422,1423,1423,1423,1423,1424,1424,1425,1425,1425,1425,1426,1426,1426,1426,1427,1427,1427,1427,1427,1427,1427,1428,1428,1429,1429,1429,1429,1430,1430,1430,1430,1431,1431,1431,1431,1431,1431,1432,1432,1433,1433,1433,1434,1434,1435,1435,1436,1436,1436,1436,1436,1436,1436,1436,1436,1436,1436,1437,1437,1437,1437,1438,1438,1438,1438,1439,1439,1439,1440,1440,1440,1440,1440,1440,1441,1441,1441,1441,1441,1441,1442,1442,1442,1443,1443,1443,1443,1443,1443,1444,1444,1444,1444,1444,1445,1445,1445,1445,1446,1446,1446,1446,1447,1447,1447,1448,1448,1448,1449,1449,1449,1449,1450,1450,1450,1450,1450,1450,1450,1451,1451,1451,1451,1452,1452,1452,1452,1452,1452,1453,1453,1453,1453,1453,1453,1454,1454,1455,1455,1455,1455,1456,1456,1456,1457,1457,1457,1457,1457,1458,1458,1458,1458,1458,1458,1458,1458,1458,1458,1458,1458,1458,1459,1459,1459,1460,1460,1461,1461,1462,1462,1462,1463,1463,1463,1463,1463,1463,1463,1463,
+		1463,1463,1463,1463,1463,1464,1464,1464,1464,1464,1464,1464,1465,1465,1465,1465,1465,1465,1465,1465,1465,1465,1465,1466,1466,1466,1467,1468,1468,1469,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1470,1471,1471,1471,1472,1472,1472,1473,1473,1473,1473,1473,1474,1474,1474,1474,1475,1476,1476,1476,1476,1476,1476,1476,1476,1476,1476,1477,1477,1477,1477,1478,1478,1478,1479,1479,1480,1481,1481,1481,1481,1482,1482,1482,1482,1482,1482,1482,1482,1482,1482,1482,1482,1482,1483,1484,1484,1485,1486,1486,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1487,1488,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1489,1490,1490,1490,1491,1491,1491,1491,1492,1492,1492,1492,1493,1493,1493,1493,1493,1493,1493,1494,1494,1494,1494,1494,1494,1495,1495,1495,1495,1496,1496,1496,1496,1496,1496,1496,1496,1497,1497,1497,1497,1498,1498,1498,1498,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499,1500,1500,1500,1501,1501,1502,1502,1503,1503,1503,1504,1504,1505,1506,1506,1506,1506,1506,1506,1506,1506,1506,1506,1506,1507,1507,1508,1508,1508,1508,1509,1509,1509,1510,1510,1510,1510,1510,1510,1510,1510,1510,1512,1513,1513,1513,1513,1513,1514,1514,1514,1514,1514,1514,1514,1514,1514,1514,1514,1514,1515,1515,1516,1516,
+		1516,1516,1516,1516,1516,1517,1517,1518,1518,1518,1518,1518,1519,1520,1522,1522,1523,1523,1523,1523,1523,1523,1524,1524,1524,1524,1524,1524,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1527,1527,1528,1529,1529,1529,1529,1529,1529,1529,1529,1529,1529,1529,1529,1530,1530,1531,1531,1531,1531,1531,1532,1532,1532,1532,1532,1532,1532,1533,1534,1534,1534,1534,1534,1535,1535,1535,1535,1535,1535,1535,1535,1535,1535,1536,1536,1536,1536,1536,1536,1536,1536,1537,1537,1537,1537,1537,1537,1537,1537,1537,1537,1538,1538,1538,1538,1538,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1539,1540,1540,1540,1540,1540,1540,1540,1541,1542,1543,1543,1543,1543,1544,1544,1544,1544,1544,1544,1544,1544,1544,1544,1544,1544,1544,1545,1545,1546,1547,1548,1548,1548,1548,1548,1548,1548,1548,1548,1548,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1549,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1550,1551,1551,1552,1553,1553,1553,1553,1553,1553,1553,1553,1553,1554,1555,1555,1556,1557,1557,1558,1558,1558,1558,1558,1558,1558,1558,1558,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1559,1560,1560,1560,
+		1561,1561,1562,1562,1562,1562,1562,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1566,1566,1566,1567,1567,1567,1567,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1568,1569,1569,1570,1570,1570,1571,1571,1572,1573,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1575,1575,1575,1575,1575,1575,1575,1575,1575,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1576,1577,1579,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1580,1581,1582,1584,1584,1585,1585,1585,1585,1585,1585,1585,1586,1586,1586,1586,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1587,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1588,1589,1589,1590,1591,1591,1591,1593,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,1594,
+		1594,1594,1594,1594,1594,1594,1594,1595,1595,1595,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1596,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1598,1599,1599,1599,1599,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1600,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,
+		1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,1601,
+		1601,1601,1601,1601,1601,1601,1601,1601,1601
+	},
+	{
+		22,37,66,100,130,157,184,212,240,266,290,312,333,353,371,389,405,420,433,446,457,468,478,487,496,504,512,519,526,533,540,546,552,559,565,571,577,583,589,595,601,607,613,618,624,630,635,641,646,651,657,662,667,672,677,682,687,692,697,702,706,711,716,720,725,729,733,738,742,747,751,755,759,764,768,772,776,780,784,789,793,797,801,805,809,813,817,821,826,830,834,837,841,845,849,853,857,861,865,868,872,876,879,883,886,890,893,897,900,903,906,910,913,916,919,922,925,928,931,934,937,939,942,945,947,950,953,955,958,960,963,965,968,970,973,975,977,980,982,984,986,989,991,993,995,997,1000,1002,1004,1006,1009,1011,1013,1015,1017,1019,1021,1023,1025,1027,1029,1030,1032,1034,1036,1038,1040,1042,1044,1046,1047,1049,1051,1053,1055,1056,1058,1060,1062,1063,1065,1067,1068,1070,1071,1073,1075,1076,1078,1080,1081,1083,1085,1087,1088,1090,1092,1093,1095,1096,1098,1100,1101,1103,1104,1106,1107,1109,1110,1112,1114,1115,1117,1118,1119,1121,1122,1124,1125,1127,1128,1130,1131,1133,1134,1136,1137,1138,1140,1141,1143,1144,1145,1147,1148,1149,1150,1152,1153,1154,1156,1157,1158,1160,1161,1163,1164,1165,1167,1168,1169,1170,1172,1173,
+		1174,1176,1177,1178,1179,1180,1182,1183,1184,1185,1187,1188,1189,1190,1191,1193,1194,1195,1196,1198,1199,1200,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1247,1248,1249,1250,1251,1252,1253,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1263,1264,1265,1266,1267,1267,1268,1269,1269,1270,1271,1272,1272,1274,1274,1275,1276,1277,1278,1279,1280,1280,1281,1282,1283,1283,1284,1285,1285,1286,1286,1287,1288,1289,1290,1290,1291,1292,1293,1293,1294,1295,1295,1296,1297,1297,1298,1299,1300,1300,1301,1302,1303,1303,1304,1305,1306,1306,1307,1307,1308,1309,1309,1310,1311,1312,1312,1313,1314,1314,1315,1315,1316,1316,1317,1317,1318,1319,1319,1320,1320,1321,1321,1322,1322,1323,1323,1324,1324,1325,1326,1326,1327,1328,1329,1329,1330,1331,1331,1332,1332,1333,1333,1334,1334,1335,1336,1337,1337,1337,1338,1339,1339,1340,1340,1340,1341,1341,1342,1342,1343,1343,1343,1344,1344,1344,1345,1345,1345,1346,1346,1347,1347,1348,1349,1349,1350,1350,1350,1351,1352,1352,1353,1353,1354,1354,1355,1356,1356,1357,1357,1357,1357,1358,1358,1358,1359,1359,1359,1360,1360,1361,1361,1362,1362,1362,1363,1363,1364,1364,
+		1365,1365,1366,1366,1367,1367,1368,1368,1368,1368,1368,1369,1369,1369,1370,1371,1371,1371,1371,1372,1372,1373,1373,1374,1374,1374,1375,1375,1375,1376,1376,1377,1377,1378,1378,1379,1379,1379,1380,1380,1381,1381,1381,1382,1382,1382,1382,1383,1383,1383,1383,1384,1384,1384,1385,1385,1385,1385,1385,1386,1386,1386,1387,1387,1387,1387,1387,1388,1389,1389,1389,1390,1390,1390,1390,1391,1391,1392,1392,1392,1392,1393,1393,1393,1394,1394,1394,1394,1394,1394,1395,1395,1395,1395,1396,1396,1396,1396,1397,1397,1397,1397,1398,1398,1398,1398,1399,1399,1399,1399,1399,1400,1400,1400,1401,1401,1401,1402,1403,1403,1403,1403,1403,1403,1404,1404,1404,1404,1404,1404,1404,1405,1405,1405,1405,1405,1406,1406,1406,1406,1406,1407,1407,1407,1408,1408,1408,1408,1408,1409,1409,1409,1409,1409,1410,1410,1411,1411,1411,1411,1411,1411,1411,1412,1412,1412,1412,1412,1412,1412,1412,1413,1413,1413,1414,1414,1415,1415,1415,1415,1416,1417,1417,1417,1417,1417,1417,1417,1417,1417,1418,1418,1418,1418,1418,1419,1419,1420,1420,1420,1420,1420,1420,1421,1421,1421,1421,1421,1421,1421,1421,1422,1423,1423,1423,1423,1423,1424,1424,1424,1424,1425,1425,1425,1425,1425,1425,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1427,1427,1427,1428,1428,1429,1429,1430,1430,1430,1431,1431,1431,1431,1431,1431,1431,1431,
+		1431,1431,1432,1432,1432,1432,1432,1432,1432,1432,1432,1432,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1433,1434,1434,1435,1435,1436,1437,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1439,1439,1439,1440,1440,1440,1440,1440,1441,1441,1441,1441,1442,1442,1442,1443,1443,1443,1443,1443,1443,1444,1444,1444,1444,1445,1445,1445,1446,1446,1446,1446,1447,1447,1447,1448,1448,1449,1449,1449,1449,1449,1449,1449,1449,1449,1449,1449,1449,1449,1450,1450,1450,1450,1452,1452,1453,1454,1454,1454,1454,1454,1454,1454,1454,1454,1454,1454,1454,1454,1454,1454,1455,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1456,1457,1457,1457,1457,1457,1457,1458,1458,1458,1459,1459,1460,1460,1460,1460,1461,1461,1461,1461,1461,1461,1461,1461,1461,1462,1462,1462,1462,1462,1462,1463,1463,1463,1463,1463,1463,1463,1463,1463,1464,1464,1464,1465,1465,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1467,1467,1467,1467,1468,1468,1469,1470,1470,1470,1471,1471,1471,1472,1473,1473,1473,1473,1473,1473,1474,1474,1474,1474,1474,1474,1474,1475,1475,1475,1476,1476,1476,1476,1477,1477,1477,1477,1477,1477,1477,1477,1478,1479,1479,1479,1479,1479,1480,1480,1481,1481,1481,1481,1481,1481,1481,1481,1482,1482,1482,1482,1482,1483,1483,
+		1483,1483,1483,1483,1483,1484,1484,1485,1485,1486,1486,1486,1487,1487,1488,1489,1489,1489,1489,1489,1489,1489,1490,1490,1491,1491,1491,1491,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1492,1493,1494,1495,1495,1495,1495,1495,1496,1496,1496,1496,1496,1496,1496,1496,1497,1497,1498,1498,1498,1498,1498,1498,1498,1498,1498,1498,1499,1499,1500,1501,1501,1501,1501,1501,1501,1501,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1502,1503,1503,1503,1503,1503,1503,1503,1504,1504,1504,1504,1504,1504,1504,1504,1505,1505,1505,1505,1505,1505,1505,1505,1505,1505,1505,1505,1505,1505,1506,1506,1506,1506,1506,1506,1506,1506,1507,1507,1507,1507,1507,1507,1507,1507,1508,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1510,1511,1511,1512,1513,1514,1514,1514,1514,1514,1514,1514,1514,1514,1514,1515,1515,1515,1515,1515,1515,1515,1515,1515,1515,1515,1515,1515,1516,1516,1516,1516,1516,1517,1517,1517,1517,1517,1517,1517,1517,1517,1517,1517,1517,1517,1517,1517,1518,1519,1519,1519,1519,1519,1519,1519,1520,1520,1520,1521,1521,1522,1523,1524,1524,1524,1524,1524,1524,1524,1524,1524,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1525,1526,1526,1526,
+		1527,1527,1527,1527,1527,1528,1528,1529,1529,1529,1529,1529,1529,1529,1529,1531,1531,1531,1531,1532,1532,1533,1533,1533,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1534,1535,1535,1535,1536,1537,1537,1537,1537,1538,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1540,1541,1541,1541,1541,1541,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1542,1544,1544,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1545,1546,1546,1546,1546,1547,1549,1549,1549,1549,1550,1550,1550,1550,1550,1550,1550,1550,1551,1552,1552,1552,1552,1552,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1553,1554,1554,1554,1555,1556,1556,1558,1559,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,
+		1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1560,1561,1561,1563,1563,1563,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1564,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1565,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,
+		1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,1566,
+		1566,1566,1566,1566,1566,1566,1566,1566,1566
+	},
+	{
+		20,27,42,62,87,111,132,154,178,202,225,248,269,288,307,324,340,356,369,382,394,404,414,423,432,440,447,454,461,467,474,480,486,492,498,503,509,515,521,526,532,537,543,548,554,559,564,569,574,579,584,589,594,599,604,608,613,618,622,627,631,636,640,644,649,653,657,662,666,670,674,678,682,686,690,693,697,701,705,709,712,716,720,723,727,731,734,738,741,745,749,752,756,759,763,766,770,773,777,780,784,787,791,794,797,801,804,807,811,814,817,821,824,827,830,834,837,840,843,846,850,853,856,859,862,865,867,870,873,876,879,881,884,886,889,892,894,897,899,901,904,906,909,911,913,916,918,920,922,925,927,929,932,934,936,938,940,942,944,946,948,950,952,954,956,958,960,961,963,965,967,969,971,973,975,976,978,980,982,984,985,987,988,990,991,993,995,996,998,1000,1001,1003,1005,1006,1008,1010,1012,1013,1015,1016,1018,1020,1021,1023,1024,1026,1028,1029,1031,1032,1034,1035,1037,1038,1040,1041,1043,1044,1046,1047,1048,1050,1051,1053,1054,1056,1057,1059,1060,1061,1063,1064,1065,1067,1068,1069,1071,1072,1074,1075,1076,1078,1079,1080,1082,1083,1084,1086,1087,1088,1089,1091,1092,1093,
+		1095,1096,1097,1098,1100,1101,1102,1103,1104,1106,1107,1108,1109,1111,1112,1113,1114,1115,1117,1118,1119,1121,1122,1123,1124,1125,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1161,1163,1163,1164,1166,1166,1167,1168,1169,1170,1171,1172,1173,1173,1174,1175,1176,1177,1178,1179,1180,1181,1181,1182,1183,1184,1185,1186,1186,1187,1188,1189,1190,1190,1191,1192,1193,1193,1194,1195,1196,1197,1198,1199,1200,1200,1201,1202,1202,1203,1204,1205,1205,1206,1207,1207,1208,1209,1210,1211,1211,1212,1212,1213,1214,1215,1216,1216,1217,1218,1218,1219,1220,1221,1221,1222,1223,1223,1224,1225,1225,1226,1227,1228,1228,1229,1230,1230,1231,1232,1232,1233,1234,1234,1235,1235,1236,1237,1237,1237,1238,1239,1240,1240,1240,1241,1242,1242,1243,1243,1244,1244,1245,1245,1246,1247,1247,1248,1249,1249,1250,1251,1252,1252,1253,1253,1254,1254,1255,1255,1256,1257,1258,1258,1258,1259,1260,1261,1261,1261,1262,1262,1262,1263,1264,1264,1264,1264,1265,1265,1265,1266,1266,1266,1267,1267,1268,1268,1269,1270,1270,1271,1271,1272,1272,1273,1274,1274,1275,1275,1276,1277,1277,1278,1278,1278,1279,1279,1279,1279,1280,1280,1280,1281,1281,1282,1282,1283,1283,1284,1284,1285,1285,1286,1286,
+		1286,1287,1287,1288,1288,1289,1289,1289,1290,1290,1290,1290,1291,1291,1292,1292,1292,1292,1293,1293,1293,1294,1295,1295,1296,1296,1296,1297,1297,1298,1298,1299,1299,1300,1300,1300,1301,1301,1301,1302,1303,1303,1303,1303,1303,1303,1303,1304,1304,1305,1305,1305,1305,1306,1306,1307,1307,1307,1307,1307,1307,1308,1308,1309,1309,1309,1310,1310,1310,1311,1311,1312,1312,1312,1312,1313,1313,1313,1313,1314,1314,1314,1315,1315,1315,1315,1315,1316,1316,1316,1317,1317,1317,1317,1318,1318,1318,1318,1318,1319,1319,1319,1319,1320,1320,1320,1320,1320,1321,1321,1321,1322,1322,1322,1323,1323,1323,1324,1324,1325,1325,1325,1325,1325,1325,1325,1326,1326,1326,1327,1327,1327,1327,1327,1327,1327,1328,1328,1328,1328,1328,1329,1329,1329,1329,1330,1330,1330,1330,1330,1331,1331,1331,1332,1332,1332,1333,1333,1333,1333,1333,1333,1333,1333,1333,1334,1334,1334,1334,1335,1335,1335,1335,1335,1336,1336,1336,1337,1337,1337,1338,1338,1338,1339,1339,1339,1339,1339,1339,1340,1340,1340,1340,1340,1341,1341,1341,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1342,1343,1343,1344,1344,1345,1345,1345,1345,1345,1346,1347,1347,1347,1347,1347,1347,1347,1347,1347,1348,1348,1348,1348,1348,1348,1348,1348,1348,1349,1349,1349,1349,1350,1350,1351,1351,1352,1352,1353,1353,1353,1353,1353,1353,1353,1353,1353,
+		1353,1353,1353,1353,1353,1354,1354,1354,1354,1354,1354,1354,1355,1355,1355,1355,1355,1355,1355,1355,1355,1355,1356,1356,1356,1356,1357,1358,1359,1359,1359,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1361,1361,1362,1362,1362,1362,1363,1363,1363,1363,1364,1364,1364,1364,1365,1365,1365,1365,1365,1366,1366,1366,1366,1366,1366,1367,1367,1367,1367,1368,1368,1368,1368,1369,1370,1370,1370,1370,1371,1371,1371,1371,1371,1371,1371,1371,1371,1371,1371,1372,1372,1372,1372,1373,1374,1374,1375,1375,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1376,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1378,1379,1379,1379,1379,1379,1380,1380,1380,1380,1381,1381,1381,1382,1383,1383,1383,1383,1383,1383,1383,1383,1384,1384,1384,1384,1384,1384,1384,1384,1385,1385,1385,1385,1385,1385,1385,1385,1385,1385,1386,1387,1387,1387,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1388,1389,1389,1390,1390,1390,1391,1392,1392,1392,1392,1393,1393,1394,1394,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1395,1396,1397,1397,1397,1398,1398,1399,1399,1399,1399,1399,1399,1399,1399,1399,1400,1401,1401,1401,1401,1401,1402,1402,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1404,1405,1405,
+		1405,1405,1405,1405,1405,1405,1406,1406,1407,1407,1407,1407,1408,1409,1410,1411,1411,1411,1411,1411,1411,1411,1411,1412,1412,1412,1412,1412,1413,1413,1414,1414,1414,1414,1414,1414,1414,1414,1414,1414,1414,1414,1414,1414,1415,1415,1416,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1417,1418,1418,1419,1419,1420,1420,1420,1420,1420,1420,1420,1420,1421,1421,1421,1421,1422,1422,1422,1422,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1424,1424,1424,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,1425,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1428,1428,1428,1429,1430,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1431,1432,1432,1432,1433,1433,1434,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1435,1436,1436,1436,1436,1436,1436,1436,1436,1436,1436,1437,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1438,1439,1440,1440,1441,1441,1441,1441,1441,1441,1441,1441,1441,1441,1441,1442,1442,1443,1444,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1445,1446,1446,1446,1446,1447,1447,
+		1447,1447,1448,1448,1448,1448,1449,1450,1450,1450,1450,1450,1450,1450,1450,1451,1451,1451,1451,1453,1453,1453,1454,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1455,1456,1456,1457,1457,1457,1457,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1459,1460,1460,1460,1460,1460,1460,1460,1460,1460,1462,1462,1462,1462,1462,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1463,1464,1464,1465,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1466,1467,1467,1467,1469,1469,1469,1469,1470,1470,1470,1470,1470,1470,1470,1470,1471,1471,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1472,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1473,1474,1474,1475,1475,1475,1477,1477,1477,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,1478,
+		1478,1478,1478,1478,1478,1478,1479,1479,1479,1479,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1480,1481,1481,1481,1481,1481,1482,1482,1482,1482,1482,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1483,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1484,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,
+		1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,1485,
+		1485,1485,1485,1485,1485,1485,1485,1485,1485
+	},
+	{
+		19,25,36,52,71,92,110,129,150,171,192,213,234,253,272,289,305,320,334,347,359,370,379,388,397,405,412,419,425,432,438,444,450,456,461,467,472,478,483,489,494,500,505,510,515,520,525,530,535,540,545,550,554,559,564,568,573,578,582,586,591,595,600,604,608,612,617,621,625,629,633,637,641,644,648,652,656,659,663,667,670,674,677,681,684,688,691,695,698,701,705,708,711,715,718,721,725,728,731,734,737,741,744,747,750,753,757,760,763,766,769,772,775,779,782,785,788,791,794,797,800,803,806,809,812,815,818,821,824,827,829,832,835,838,840,843,846,848,851,853,856,858,861,863,866,868,870,873,875,877,880,882,884,887,889,891,893,895,897,899,901,903,905,907,909,911,913,915,917,919,921,922,924,926,928,930,932,933,935,937,939,940,942,943,945,947,948,950,952,953,955,957,958,960,962,963,965,967,968,970,971,973,975,976,978,979,981,982,984,985,987,988,990,991,993,994,995,997,998,1000,1001,1003,1004,1005,1007,1008,1010,1011,1012,1014,1015,1016,1018,1019,1020,1021,1023,1024,1026,1027,1028,1030,1031,1032,1034,1035,1036,1038,1039,1040,1041,1043,1044,1045,
+		1046,1048,1049,1050,1051,1053,1054,1055,1056,1057,1058,1060,1061,1062,1063,1065,1066,1067,1068,1069,1071,1072,1073,1074,1075,1076,1077,1078,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1093,1094,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1117,1118,1119,1120,1121,1122,1123,1124,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1133,1134,1135,1136,1136,1137,1138,1139,1140,1140,1141,1142,1142,1143,1144,1145,1146,1147,1148,1148,1149,1150,1151,1152,1152,1153,1154,1154,1155,1155,1156,1157,1158,1159,1159,1160,1161,1161,1162,1163,1164,1165,1165,1166,1166,1167,1168,1168,1169,1170,1171,1171,1172,1173,1173,1174,1175,1176,1176,1177,1178,1178,1179,1179,1180,1181,1181,1182,1183,1183,1184,1185,1185,1186,1186,1187,1187,1188,1188,1189,1189,1190,1191,1191,1192,1192,1193,1193,1194,1194,1195,1195,1196,1197,1198,1198,1199,1200,1201,1201,1202,1202,1203,1203,1204,1204,1205,1206,1206,1206,1207,1208,1208,1209,1209,1210,1210,1210,1211,1211,1212,1212,1212,1213,1213,1213,1214,1215,1215,1215,1216,1216,1217,1217,1218,1218,1219,1220,1220,1220,1221,1221,1222,1223,1223,1223,1224,1225,1226,1226,1226,1227,1227,1227,1227,1228,1228,1228,1229,1229,1229,1230,1231,1231,1231,1232,1232,1233,1233,1234,1234,
+		1234,1235,1235,1236,1236,1237,1237,1238,1238,1238,1238,1239,1239,1239,1240,1240,1241,1241,1241,1242,1242,1243,1243,1243,1244,1244,1244,1245,1245,1246,1246,1246,1247,1247,1248,1249,1249,1249,1249,1250,1251,1251,1251,1251,1251,1252,1252,1252,1253,1253,1253,1253,1253,1254,1254,1255,1255,1255,1255,1255,1256,1256,1256,1257,1257,1257,1258,1258,1258,1259,1259,1260,1260,1260,1260,1261,1261,1261,1262,1262,1262,1262,1262,1263,1263,1263,1263,1264,1264,1264,1265,1265,1265,1265,1266,1266,1266,1266,1266,1267,1267,1267,1267,1268,1268,1268,1268,1269,1269,1269,1269,1269,1270,1270,1271,1271,1271,1272,1272,1273,1273,1273,1273,1273,1273,1273,1274,1274,1274,1274,1274,1274,1275,1275,1275,1275,1275,1276,1276,1276,1276,1277,1277,1277,1277,1278,1278,1278,1278,1278,1279,1279,1279,1279,1279,1280,1280,1280,1280,1280,1280,1281,1281,1281,1282,1282,1282,1282,1282,1282,1283,1283,1283,1283,1283,1284,1284,1284,1285,1285,1286,1286,1286,1287,1287,1287,1288,1288,1288,1288,1288,1288,1288,1288,1289,1289,1289,1289,1289,1290,1290,1290,1290,1290,1291,1291,1291,1291,1291,1291,1291,1292,1292,1292,1293,1293,1293,1293,1293,1294,1294,1294,1294,1295,1295,1295,1295,1295,1295,1295,1296,1296,1296,1296,1296,1296,1296,1296,1297,1297,1297,1298,1299,1299,1299,1299,1300,1301,1301,1301,1301,1301,1301,1301,1301,
+		1301,1301,1301,1301,1301,1301,1301,1302,1302,1302,1302,1302,1302,1302,1302,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1304,1304,1305,1306,1306,1307,1307,1307,1307,1307,1307,1307,1307,1307,1307,1307,1308,1308,1308,1308,1308,1309,1309,1309,1309,1309,1309,1309,1310,1311,1311,1311,1311,1312,1312,1312,1312,1313,1313,1313,1313,1313,1313,1313,1314,1314,1314,1314,1315,1315,1315,1316,1316,1317,1317,1317,1317,1318,1318,1318,1318,1318,1318,1318,1318,1318,1318,1319,1319,1319,1319,1320,1320,1321,1322,1322,1322,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1323,1324,1324,1324,1324,1324,1324,1324,1324,1324,1324,1324,1324,1324,1325,1325,1325,1326,1326,1326,1326,1327,1327,1327,1327,1327,1328,1328,1328,1328,1329,1329,1329,1329,1329,1329,1329,1329,1330,1330,1330,1330,1330,1330,1330,1330,1331,1331,1332,1332,1332,1332,1332,1332,1332,1332,1333,1333,1333,1333,1334,1334,1334,1335,1335,1335,1335,1335,1335,1335,1335,1335,1335,1335,1335,1335,1336,1336,1336,1336,1337,1338,1338,1338,1339,1339,1340,1340,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1341,1342,1343,1343,1343,1343,1344,1344,1344,1345,1345,1345,1345,1345,1345,1345,1345,1345,1346,1346,1347,1347,1347,1348,1348,1348,1349,1349,1349,1349,1349,1349,1349,1349,1349,1349,1349,1349,1350,1350,1350,
+		1351,1351,1351,1351,1351,1351,1352,1353,1353,1353,1353,1354,1354,1356,1356,1356,1357,1357,1357,1357,1357,1357,1358,1358,1358,1359,1359,1359,1359,1359,1359,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1360,1361,1361,1363,1363,1363,1363,1363,1363,1363,1363,1363,1363,1363,1363,1363,1363,1364,1365,1365,1365,1365,1365,1365,1366,1366,1366,1366,1366,1367,1367,1367,1368,1368,1368,1368,1368,1368,1368,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1369,1370,1370,1370,1370,1370,1370,1370,1370,1370,1371,1371,1371,1371,1371,1371,1371,1371,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1372,1373,1373,1373,1373,1373,1373,1373,1373,1373,1373,1374,1374,1374,1375,1376,1376,1377,1377,1377,1377,1377,1377,1377,1377,1377,1377,1377,1377,1377,1377,1378,1378,1378,1380,1380,1380,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1381,1382,1382,1382,1382,1382,1382,1383,1383,1383,1383,1383,1383,1383,1383,1383,1383,1383,1383,1385,1385,1386,1386,1386,1386,1386,1386,1386,1386,1386,1386,1386,1386,1388,1389,1390,1390,1390,1390,1390,1390,1390,1390,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1391,1392,1392,1392,1392,
+		1392,1392,1393,1394,1394,1394,1394,1395,1395,1395,1395,1395,1395,1395,1395,1396,1396,1396,1396,1397,1398,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1399,1400,1400,1401,1402,1402,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1403,1404,1404,1404,1404,1404,1404,1405,1405,1405,1406,1406,1406,1406,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1407,1408,1408,1409,1409,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1410,1412,1412,1413,1413,1413,1414,1414,1414,1414,1415,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1416,1418,1418,1418,1418,1419,1420,1420,1421,1422,1422,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,1423,
+		1423,1423,1423,1423,1423,1423,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1424,1425,1425,1425,1425,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1426,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1427,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1428,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,
+		1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,1429,
+		1429,1429,1429,1429,1429,1429,1429,1429,1429
+	},
+	{
+		17,20,25,34,44,58,71,85,100,117,134,152,171,189,207,225,241,256,270,283,295,306,317,326,334,342,350,357,363,369,375,381,387,392,398,403,409,414,419,424,430,435,440,445,450,455,459,464,469,474,478,483,487,492,496,501,505,509,514,518,522,526,530,535,539,543,547,551,555,559,563,566,570,574,578,582,585,589,593,596,600,603,607,610,614,617,621,624,627,631,634,637,640,643,646,649,653,656,659,662,665,668,671,674,677,679,682,685,688,691,694,696,699,702,705,708,711,713,716,719,722,725,727,730,733,735,738,741,744,746,749,752,754,757,760,762,765,768,770,773,775,778,781,783,786,788,791,793,796,798,801,803,806,808,811,813,815,818,820,822,824,826,829,831,833,835,837,839,841,843,845,847,849,851,853,855,857,859,861,862,864,866,868,869,871,873,875,876,878,880,882,883,885,887,889,890,892,894,895,897,898,900,902,903,905,906,908,910,911,913,914,916,917,919,920,922,923,925,926,927,929,930,932,933,934,936,937,939,940,942,943,944,946,947,948,950,951,952,954,955,956,958,959,960,962,963,965,966,967,968,970,971,972,973,
+		975,976,977,978,979,981,982,983,984,985,987,988,989,990,992,993,994,995,996,998,999,1000,1001,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1043,1044,1045,1046,1047,1048,1049,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1060,1061,1062,1063,1064,1065,1065,1066,1067,1068,1068,1069,1070,1070,1071,1072,1073,1074,1075,1076,1077,1078,1078,1079,1080,1081,1081,1082,1083,1083,1084,1085,1086,1086,1087,1088,1089,1089,1090,1091,1092,1092,1093,1094,1095,1095,1096,1096,1097,1098,1099,1099,1100,1101,1101,1102,1103,1103,1104,1105,1105,1106,1107,1107,1108,1109,1109,1110,1111,1111,1112,1113,1113,1114,1115,1115,1116,1116,1117,1117,1118,1118,1119,1119,1120,1120,1121,1121,1122,1123,1123,1124,1124,1125,1126,1127,1127,1128,1128,1129,1130,1131,1131,1132,1132,1133,1133,1134,1135,1135,1136,1136,1137,1138,1138,1139,1139,1139,1140,1140,1141,1141,1142,1142,1142,1143,1143,1143,1144,1144,1145,1145,1145,1146,1146,1147,1147,1148,1149,1149,1150,1150,1151,1151,1152,1152,1153,1153,1154,1155,1155,1156,1156,1156,1157,1157,1157,1157,1158,1158,1159,1159,1160,1160,1160,1161,1162,1162,1163,1163,1163,1164,1164,
+		1164,1165,1165,1166,1166,1167,1167,1168,1168,1168,1168,1168,1169,1169,1170,1170,1171,1171,1171,1171,1172,1173,1173,1173,1174,1174,1174,1175,1175,1176,1176,1177,1177,1177,1178,1179,1179,1179,1180,1180,1181,1181,1181,1181,1182,1182,1182,1182,1183,1183,1183,1183,1183,1184,1184,1185,1185,1185,1185,1186,1186,1186,1187,1187,1187,1187,1188,1188,1189,1189,1189,1190,1190,1190,1191,1191,1191,1192,1192,1192,1192,1193,1193,1193,1194,1194,1194,1194,1194,1195,1195,1195,1195,1196,1196,1196,1197,1197,1197,1197,1197,1198,1198,1199,1199,1199,1199,1199,1200,1200,1200,1200,1200,1201,1201,1202,1202,1202,1203,1203,1203,1204,1204,1204,1204,1204,1204,1204,1204,1205,1205,1205,1205,1206,1206,1206,1207,1207,1207,1207,1207,1207,1208,1208,1208,1208,1208,1209,1209,1210,1210,1210,1210,1210,1211,1211,1211,1212,1212,1212,1212,1212,1212,1212,1212,1213,1213,1213,1213,1213,1213,1214,1214,1214,1215,1215,1215,1215,1216,1216,1217,1217,1218,1218,1218,1218,1218,1218,1218,1218,1218,1219,1219,1219,1219,1220,1220,1220,1220,1220,1220,1221,1221,1221,1221,1221,1221,1222,1222,1222,1222,1223,1223,1223,1224,1224,1224,1225,1225,1225,1225,1226,1226,1226,1226,1226,1226,1226,1227,1227,1227,1227,1227,1227,1227,1227,1227,1228,1228,1228,1228,1229,1229,1230,1231,1231,1231,1231,1231,1231,1231,1231,1231,1231,1231,
+		1231,1232,1232,1232,1232,1232,1232,1233,1233,1233,1233,1233,1233,1233,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1235,1236,1236,1237,1237,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1239,1239,1239,1240,1240,1240,1240,1241,1241,1241,1241,1241,1241,1241,1241,1242,1242,1243,1243,1243,1243,1243,1243,1244,1244,1244,1244,1244,1245,1245,1245,1245,1245,1246,1246,1246,1247,1247,1248,1248,1248,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1249,1250,1250,1251,1251,1252,1252,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1254,1254,1254,1254,1254,1255,1255,1255,1255,1255,1255,1255,1255,1255,1255,1255,1255,1255,1256,1256,1256,1256,1256,1257,1257,1258,1258,1258,1258,1259,1259,1259,1259,1260,1260,1260,1260,1261,1261,1261,1261,1261,1261,1261,1261,1261,1261,1261,1262,1262,1262,1262,1262,1262,1263,1263,1263,1263,1263,1263,1263,1264,1264,1265,1265,1265,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1267,1267,1268,1269,1269,1270,1270,1270,1270,1271,1271,1272,1272,1272,1272,1272,1272,1272,1272,1272,1272,1272,1272,1273,1274,1274,1274,1274,1275,1275,1275,1275,1276,1276,1276,1276,1276,1276,1276,1277,1277,1278,1278,1278,1279,1279,1279,1279,1279,1279,1279,1279,1279,1280,1280,1280,1280,1280,1280,1280,1281,1282,
+		1282,1282,1282,1282,1282,1282,1283,1283,1284,1284,1284,1284,1285,1286,1286,1287,1287,1287,1287,1287,1288,1288,1288,1289,1289,1289,1289,1289,1289,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1290,1291,1291,1292,1292,1294,1294,1294,1294,1294,1294,1294,1294,1294,1294,1294,1294,1295,1295,1295,1295,1295,1296,1296,1296,1296,1296,1296,1296,1297,1297,1298,1298,1298,1298,1298,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1299,1300,1301,1301,1301,1301,1301,1301,1301,1301,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1302,1303,1303,1304,1304,1304,1304,1304,1304,1304,1304,1304,1304,1305,1305,1306,1307,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1308,1309,1310,1311,1311,1311,1311,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1312,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1313,1314,1314,1314,1314,1314,1314,1315,1315,1316,1316,1316,1316,1316,1316,1317,1317,1317,1318,1318,1319,1319,1321,1321,1321,1321,1321,1321,1321,1321,1321,1321,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1322,1323,
+		1323,1323,1324,1324,1324,1324,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1326,1327,1327,1328,1329,1329,1329,1329,1329,1330,1330,1330,1330,1330,1330,1330,1330,1330,1330,1330,1330,1330,1330,1331,1331,1332,1332,1332,1332,1333,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1334,1335,1335,1335,1335,1335,1335,1336,1336,1336,1336,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1337,1339,1339,1339,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1340,1341,1342,1342,1343,1343,1344,1344,1344,1344,1344,1346,1346,1346,1346,1346,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1347,1348,1349,1349,1349,1349,1349,1350,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,1352,
+		1352,1352,1352,1352,1352,1353,1353,1353,1353,1353,1353,1353,1353,1353,1353,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1354,1355,1355,1355,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1356,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,
+		1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,1358,
+		1358,1358,1358,1358,1358,1358,1358,1358,1358
+	},
+	{
+		16,19,24,31,39,49,59,70,83,97,111,127,143,159,176,193,209,224,238,251,264,275,285,295,303,311,319,325,332,338,344,350,355,360,365,371,376,381,386,391,395,400,405,410,415,419,424,428,433,437,441,446,450,454,458,463,467,471,475,479,483,487,491,494,498,502,506,510,514,517,521,525,528,532,536,539,543,547,550,554,557,561,564,567,571,574,577,581,584,587,591,594,597,600,603,606,609,612,615,618,621,623,626,629,632,635,637,640,643,646,648,651,654,656,659,662,664,667,669,672,675,677,680,682,685,687,690,692,694,697,699,702,704,707,709,712,714,716,719,721,724,726,729,731,734,736,738,741,743,746,748,750,753,755,757,760,762,764,767,769,771,773,776,778,780,782,784,787,789,791,793,795,797,799,801,803,806,808,809,811,813,815,817,819,821,823,825,826,828,830,832,834,835,837,839,841,842,844,846,848,849,851,853,854,856,857,859,860,862,864,865,867,868,870,871,873,874,876,877,879,880,881,883,884,886,887,889,890,892,893,894,896,897,898,899,901,902,903,905,906,907,909,910,911,913,914,915,917,918,919,920,922,923,924,
+		925,927,928,929,930,931,933,934,935,936,937,939,940,941,942,943,944,946,947,948,949,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,978,978,979,981,982,983,984,985,986,986,987,988,989,990,991,992,993,994,995,996,996,997,998,999,1000,1001,1002,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1012,1013,1014,1015,1016,1016,1017,1018,1019,1019,1020,1021,1022,1022,1023,1024,1025,1026,1027,1027,1028,1029,1030,1030,1031,1032,1032,1033,1034,1034,1035,1036,1037,1037,1038,1039,1040,1041,1041,1042,1042,1043,1044,1044,1045,1046,1046,1047,1048,1048,1049,1050,1051,1051,1052,1053,1053,1054,1055,1055,1056,1056,1057,1058,1059,1059,1060,1061,1061,1062,1062,1063,1064,1064,1065,1065,1066,1066,1067,1067,1068,1068,1069,1069,1070,1071,1071,1072,1072,1073,1073,1074,1075,1076,1076,1077,1078,1078,1079,1080,1080,1081,1081,1081,1082,1083,1083,1084,1084,1085,1085,1086,1087,1087,1088,1088,1088,1089,1089,1090,1090,1091,1091,1091,1092,1092,1092,1093,1093,1093,1094,1094,1095,1095,1096,1097,1097,1098,1098,1099,1099,1100,1100,1101,1101,1102,1103,1103,1104,1104,1104,1104,1105,1105,1105,1106,1106,1107,1107,1107,1108,1108,1109,1110,1110,1110,1111,1111,1112,1112,
+		1112,1113,1113,1114,1114,1115,1115,1115,1116,1116,1116,1116,1117,1117,1118,1118,1118,1118,1119,1119,1120,1120,1121,1121,1121,1122,1122,1123,1123,1124,1124,1124,1125,1125,1126,1126,1127,1127,1127,1128,1128,1129,1129,1129,1129,1129,1129,1130,1130,1131,1131,1131,1131,1132,1132,1133,1133,1133,1133,1134,1134,1134,1134,1134,1135,1135,1135,1136,1136,1137,1137,1137,1138,1138,1138,1139,1139,1139,1140,1140,1140,1141,1141,1141,1141,1142,1142,1142,1142,1142,1143,1143,1143,1143,1144,1144,1144,1144,1144,1145,1145,1145,1146,1146,1146,1147,1147,1147,1147,1148,1148,1148,1148,1149,1149,1149,1149,1150,1150,1151,1151,1151,1152,1152,1152,1152,1152,1152,1152,1152,1153,1153,1153,1153,1154,1154,1154,1154,1154,1155,1155,1155,1155,1156,1156,1156,1156,1157,1157,1157,1158,1158,1158,1158,1158,1158,1159,1159,1159,1159,1159,1159,1160,1160,1161,1161,1161,1161,1161,1161,1161,1162,1162,1162,1162,1163,1163,1163,1164,1164,1164,1165,1165,1165,1166,1166,1166,1166,1166,1166,1166,1166,1166,1166,1167,1167,1168,1168,1168,1168,1168,1168,1169,1169,1169,1169,1169,1169,1169,1170,1170,1171,1171,1171,1171,1172,1172,1172,1173,1173,1173,1173,1174,1174,1174,1174,1174,1174,1174,1174,1175,1175,1175,1175,1175,1175,1175,1175,1175,1176,1176,1176,1177,1177,1178,1179,1179,1179,1180,1180,1180,1180,1180,1180,1180,
+		1180,1180,1180,1180,1180,1180,1180,1180,1180,1180,1180,1180,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1182,1182,1183,1183,1184,1184,1185,1185,1186,1186,1186,1186,1186,1186,1186,1186,1186,1186,1187,1187,1187,1187,1187,1187,1188,1188,1188,1188,1189,1189,1189,1189,1189,1190,1190,1190,1191,1191,1191,1191,1191,1191,1192,1192,1192,1193,1193,1193,1193,1193,1193,1193,1194,1194,1195,1195,1195,1195,1195,1196,1196,1197,1197,1197,1197,1197,1197,1197,1197,1197,1197,1197,1197,1198,1198,1199,1199,1200,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1202,1202,1202,1202,1202,1202,1202,1202,1202,1202,1202,1202,1202,1202,1203,1203,1203,1203,1203,1203,1204,1204,1205,1205,1205,1205,1205,1205,1206,1206,1207,1207,1207,1207,1207,1207,1208,1208,1208,1208,1208,1208,1208,1208,1209,1209,1209,1209,1209,1209,1209,1209,1210,1210,1210,1210,1210,1211,1211,1211,1212,1212,1212,1212,1212,1212,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1213,1214,1215,1215,1216,1216,1216,1216,1217,1217,1218,1218,1218,1218,1218,1218,1218,1219,1219,1219,1219,1219,1219,1220,1220,1221,1221,1221,1221,1221,1221,1222,1222,1223,1223,1223,1223,1223,1223,1223,1224,1224,1224,1225,1225,1225,1225,1225,1226,1226,1226,1226,1226,1226,1226,1226,1226,1226,1227,1227,1228,1229,
+		1229,1229,1229,1229,1229,1229,1230,1230,1230,1230,1230,1230,1231,1232,1233,1233,1233,1233,1233,1233,1233,1233,1234,1235,1235,1235,1235,1235,1235,1236,1236,1236,1236,1236,1236,1236,1236,1236,1236,1236,1236,1236,1236,1236,1237,1238,1238,1239,1239,1239,1239,1240,1240,1240,1240,1240,1240,1240,1240,1241,1241,1241,1241,1241,1241,1241,1241,1241,1242,1242,1242,1242,1242,1242,1243,1243,1244,1244,1244,1244,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1245,1246,1246,1246,1246,1246,1246,1246,1246,1247,1247,1247,1247,1247,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1249,1249,1249,1249,1249,1249,1249,1250,1250,1250,1250,1250,1250,1250,1250,1251,1252,1252,1252,1252,1252,1252,1252,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1253,1254,1255,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1256,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1258,1259,1259,1259,1259,1259,1259,1259,1259,1259,1259,1259,1260,1260,1261,1261,1261,1261,1261,1261,1261,1261,1262,1262,1263,1263,1264,1265,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1266,1267,1268,
+		1268,1268,1268,1268,1269,1269,1270,1270,1270,1270,1270,1270,1270,1270,1271,1271,1271,1271,1272,1273,1273,1273,1273,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1274,1275,1276,1276,1277,1277,1277,1277,1278,1278,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1279,1280,1280,1280,1281,1281,1281,1281,1281,1281,1281,1281,1281,1281,1281,1281,1281,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1282,1283,1283,1283,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1284,1285,1286,1287,1287,1287,1288,1289,1289,1289,1289,1289,1289,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1291,1292,1292,1293,1294,1294,1294,1294,1295,1296,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,1297,
+		1297,1297,1297,1297,1297,1297,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1298,1299,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1300,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1301,1302,1302,1302,1302,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,
+		1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,1303,
+		1303,1303,1303,1303,1303,1303,1303,1303,1303
+	},
+	{
+		17,18,21,25,31,36,43,50,60,70,82,94,108,122,137,152,168,183,197,210,223,234,245,255,264,272,280,287,293,299,305,311,316,322,327,332,337,342,347,351,356,361,365,370,374,379,383,387,392,396,400,404,408,412,416,420,424,428,432,436,440,444,447,451,455,458,462,466,469,473,476,480,483,487,490,494,497,501,504,507,511,514,518,521,524,527,531,534,537,540,544,547,550,553,556,559,562,565,568,571,574,577,580,583,586,588,591,594,596,599,602,605,607,610,612,615,617,620,623,625,627,630,632,635,637,639,642,644,646,649,651,653,655,658,660,662,664,667,669,671,673,675,678,680,682,684,687,689,691,693,695,698,700,702,704,706,708,711,713,715,717,719,721,723,725,727,729,732,734,736,738,740,742,744,746,748,750,753,755,757,759,761,763,765,767,768,770,772,774,776,778,780,782,784,786,788,790,791,793,795,797,798,800,802,804,805,807,809,810,812,814,816,817,819,820,822,823,825,826,828,829,831,832,834,835,837,838,840,841,843,844,846,847,848,849,851,852,853,855,856,858,859,860,862,863,864,866,867,868,870,871,872,873,874,
+		876,877,878,879,881,882,883,884,885,887,888,889,890,891,892,893,895,896,897,899,900,901,902,903,904,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,940,941,942,943,944,945,946,947,947,948,949,950,951,952,953,954,954,955,956,957,958,959,960,961,962,962,963,964,965,965,966,967,968,968,969,970,971,971,972,973,974,975,975,976,977,978,979,979,980,981,981,982,983,984,984,985,985,986,987,988,989,989,990,991,992,992,993,994,994,995,995,996,997,998,998,999,1000,1001,1001,1002,1003,1003,1004,1005,1005,1006,1006,1007,1008,1008,1009,1010,1010,1011,1011,1012,1013,1013,1014,1014,1015,1015,1016,1016,1017,1017,1018,1019,1019,1020,1020,1021,1021,1022,1022,1023,1024,1025,1025,1026,1026,1027,1028,1028,1029,1030,1030,1030,1031,1032,1032,1033,1033,1034,1034,1035,1036,1036,1037,1037,1037,1038,1038,1039,1039,1040,1040,1040,1041,1041,1042,1042,1042,1043,1043,1044,1044,1045,1045,1046,1046,1047,1047,1048,1048,1049,1049,1050,1050,1051,1051,1052,1053,1053,1053,1054,1054,1054,1055,1055,1055,1056,1056,1056,1057,1057,1058,1058,1059,1059,1060,1060,1061,1061,1061,
+		1062,1062,1063,1063,1063,1064,1064,1064,1065,1065,1065,1066,1066,1067,1067,1067,1068,1068,1069,1069,1069,1070,1070,1071,1071,1071,1072,1072,1072,1073,1074,1074,1074,1075,1075,1076,1076,1076,1077,1077,1077,1078,1078,1078,1078,1079,1079,1079,1080,1080,1081,1081,1081,1081,1082,1082,1082,1083,1083,1083,1083,1084,1084,1084,1084,1085,1085,1085,1086,1087,1087,1087,1087,1087,1088,1088,1089,1089,1089,1089,1090,1090,1090,1090,1091,1091,1091,1091,1092,1092,1092,1092,1093,1093,1093,1094,1094,1094,1094,1094,1095,1095,1095,1095,1096,1096,1096,1096,1096,1097,1097,1097,1097,1098,1098,1099,1099,1100,1100,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1102,1102,1103,1103,1103,1103,1104,1104,1104,1104,1105,1105,1105,1105,1105,1105,1106,1106,1107,1107,1107,1107,1107,1108,1108,1108,1109,1109,1109,1109,1109,1109,1110,1110,1110,1110,1110,1111,1111,1111,1111,1111,1111,1112,1112,1112,1113,1113,1113,1113,1114,1114,1115,1115,1115,1115,1116,1116,1116,1116,1116,1117,1117,1117,1117,1117,1117,1118,1118,1118,1118,1118,1118,1118,1118,1118,1118,1118,1119,1119,1120,1120,1121,1121,1121,1121,1122,1122,1122,1122,1123,1123,1123,1123,1123,1123,1123,1123,1123,1124,1124,1124,1124,1124,1124,1124,1124,1125,1125,1125,1125,1126,1126,1127,1127,1128,1128,1128,1128,1128,1129,1129,1129,1129,1129,
+		1129,1129,1129,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1131,1131,1131,1131,1131,1131,1131,1131,1131,1131,1132,1132,1133,1133,1134,1134,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1136,1136,1136,1136,1136,1137,1138,1138,1138,1138,1138,1138,1138,1138,1139,1139,1139,1139,1140,1140,1140,1140,1140,1141,1141,1141,1141,1141,1142,1142,1142,1142,1143,1143,1143,1143,1144,1144,1144,1144,1145,1145,1145,1145,1145,1146,1146,1146,1146,1146,1146,1146,1146,1146,1146,1147,1147,1148,1148,1149,1149,1149,1149,1150,1150,1150,1150,1150,1150,1150,1150,1150,1150,1150,1150,1151,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1153,1153,1153,1153,1154,1154,1154,1154,1154,1155,1155,1155,1155,1156,1156,1156,1156,1156,1157,1157,1157,1157,1157,1157,1157,1157,1158,1158,1158,1158,1158,1159,1159,1159,1159,1159,1159,1159,1159,1159,1160,1160,1160,1160,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1162,1162,1163,1163,1163,1163,1164,1165,1166,1166,1166,1166,1166,1166,1167,1168,1168,1168,1168,1168,1168,1168,1168,1168,1168,1168,1168,1168,1169,1169,1169,1170,1170,1170,1171,1171,1171,1171,1171,1171,1171,1171,1171,1172,1172,1173,1173,1173,1173,1174,1174,1174,1174,1175,1175,1175,1175,1175,1175,1175,1175,1175,1175,1176,1176,1176,
+		1177,1177,1177,1177,1177,1177,1178,1178,1178,1178,1179,1179,1180,1181,1181,1182,1182,1182,1182,1182,1182,1182,1182,1183,1183,1183,1183,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1185,1185,1186,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1188,1188,1188,1188,1189,1189,1189,1189,1189,1189,1189,1189,1190,1191,1191,1191,1191,1191,1192,1192,1192,1192,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1194,1194,1194,1194,1194,1194,1194,1194,1194,1194,1194,1195,1195,1195,1195,1195,1195,1195,1195,1195,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1196,1197,1197,1197,1197,1197,1197,1197,1198,1198,1198,1198,1198,1198,1198,1199,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1201,1202,1202,1202,1203,1203,1204,1204,1204,1204,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1205,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1206,1207,1207,1207,1207,1208,1208,1208,1208,1208,1208,1208,1208,1208,1209,1209,1209,1209,1210,1211,1211,1212,1213,1213,1213,1213,1213,1213,1213,1213,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1214,1215,1215,
+		1215,1215,1216,1216,1216,1217,1217,1218,1218,1218,1218,1218,1218,1218,1218,1218,1218,1218,1219,1219,1220,1220,1220,1221,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1222,1223,1223,1224,1224,1224,1224,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1225,1226,1226,1226,1226,1226,1226,1226,1227,1227,1227,1227,1227,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1228,1229,1229,1229,1229,1229,1229,1229,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1230,1231,1231,1231,1231,1232,1232,1232,1233,1235,1235,1235,1235,1235,1235,1236,1236,1236,1236,1236,1236,1236,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1237,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1238,1239,1239,1239,1239,1240,1240,1240,1242,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,1243,
+		1243,1243,1243,1243,1243,1243,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1244,1245,1245,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1246,1247,1247,1247,1247,1247,1247,1247,1247,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1248,1249,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,
+		1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,1250,
+		1250,1250,1250,1250,1250,1250,1250,1250,1250
+	},
+	{
+		16,18,20,22,26,30,34,39,45,52,61,70,81,93,105,118,131,145,159,172,185,196,207,217,226,235,242,250,256,263,269,274,280,285,290,295,300,305,309,314,318,323,327,332,336,340,345,349,353,357,361,365,369,373,377,381,385,388,392,396,399,403,407,410,414,417,421,424,428,431,435,438,441,445,448,451,455,458,461,464,468,471,474,477,480,484,487,490,493,496,499,502,505,508,511,514,517,520,524,526,529,532,535,538,541,544,546,549,552,555,557,560,563,565,568,571,573,576,578,581,583,586,588,590,593,595,597,599,602,604,606,609,611,613,615,617,620,622,624,626,628,630,632,634,637,639,641,643,645,647,649,651,653,655,657,659,661,663,665,667,669,671,673,675,677,679,681,683,685,687,689,691,693,694,696,698,700,702,704,706,708,710,712,713,715,717,719,721,723,725,727,729,731,732,734,736,738,740,742,744,746,748,750,752,753,755,757,759,760,762,764,766,767,769,771,772,774,776,777,779,781,782,784,785,787,789,790,792,793,795,796,798,799,801,802,804,805,807,808,809,811,812,814,815,816,818,819,821,822,823,824,826,827,828,
+		830,831,832,834,835,836,838,839,840,841,842,843,844,846,847,848,849,851,852,853,854,856,857,858,859,860,861,862,863,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,901,902,903,904,905,905,906,907,908,909,910,911,912,913,913,914,915,916,917,918,919,919,920,921,922,922,923,924,924,925,926,927,928,929,930,930,931,932,933,934,934,935,936,936,937,938,938,939,940,941,941,942,943,944,944,945,946,946,947,948,948,949,950,950,951,952,952,953,954,954,955,956,957,957,958,958,959,960,960,961,962,963,963,964,964,965,966,967,967,968,968,969,969,970,970,971,972,972,973,973,974,974,975,975,976,977,977,978,978,979,980,980,981,982,982,983,983,984,985,985,986,986,987,987,988,989,989,990,990,991,992,992,993,993,993,994,994,995,995,996,996,996,997,997,997,998,998,999,999,1000,1000,1001,1001,1002,1002,1003,1003,1004,1004,1005,1005,1006,1007,1007,1008,1008,1009,1009,1009,1010,1010,1010,1011,1011,1011,1012,1012,1012,1013,1014,1014,1014,1015,1015,1016,1016,1017,1017,1017,
+		1018,1018,1019,1019,1019,1020,1020,1021,1021,1021,1022,1022,1022,1023,1024,1024,1024,1024,1024,1025,1025,1026,1027,1027,1027,1028,1028,1029,1029,1030,1030,1030,1031,1031,1031,1032,1032,1032,1033,1033,1034,1034,1034,1035,1035,1035,1035,1036,1036,1036,1036,1036,1037,1037,1038,1038,1038,1038,1039,1039,1039,1040,1040,1041,1041,1041,1042,1042,1042,1043,1043,1043,1044,1044,1044,1044,1045,1045,1046,1046,1046,1046,1046,1046,1047,1047,1047,1048,1048,1048,1048,1049,1049,1049,1050,1050,1050,1050,1050,1051,1051,1051,1051,1052,1052,1052,1052,1053,1053,1053,1053,1054,1054,1054,1055,1055,1055,1056,1056,1057,1057,1057,1057,1057,1057,1057,1058,1058,1058,1058,1058,1059,1059,1059,1059,1060,1060,1060,1061,1061,1061,1061,1061,1062,1062,1062,1063,1063,1063,1063,1063,1064,1064,1064,1064,1064,1065,1065,1065,1065,1065,1066,1066,1066,1066,1067,1067,1067,1067,1067,1068,1068,1068,1068,1068,1069,1069,1069,1070,1070,1071,1071,1071,1071,1072,1072,1072,1072,1072,1073,1073,1073,1073,1073,1073,1074,1074,1074,1074,1074,1074,1075,1075,1075,1075,1075,1075,1075,1075,1076,1077,1077,1077,1077,1077,1078,1078,1079,1079,1079,1079,1079,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1081,1081,1081,1082,1082,1082,1083,1083,1084,1085,1085,1085,1085,1085,1085,1085,1085,1085,1085,1085,
+		1085,1086,1086,1086,1086,1086,1086,1086,1086,1087,1087,1087,1087,1087,1088,1088,1088,1088,1088,1088,1088,1088,1088,1089,1089,1089,1090,1091,1091,1091,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1093,1093,1093,1093,1094,1094,1094,1094,1095,1095,1095,1095,1095,1095,1096,1096,1096,1096,1096,1097,1097,1097,1097,1097,1098,1098,1098,1098,1098,1099,1099,1099,1099,1100,1100,1100,1100,1101,1101,1102,1102,1102,1102,1102,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1103,1105,1105,1106,1106,1106,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1108,1108,1108,1108,1108,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1109,1110,1110,1110,1110,1111,1111,1111,1111,1112,1112,1112,1112,1113,1113,1113,1113,1113,1113,1114,1114,1114,1114,1114,1114,1114,1114,1114,1115,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1116,1117,1118,1118,1118,1118,1118,1118,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1120,1120,1120,1121,1121,1122,1122,1123,1123,1123,1123,1123,1124,1124,1124,1124,1124,1124,1124,1125,1125,1125,1125,1125,1125,1126,1126,1126,1126,1126,1127,1127,1127,1128,1128,1128,1128,1128,1128,1128,1129,1129,1129,1129,1129,1130,1131,1131,1131,1131,1131,1131,1131,1131,1131,1132,1132,1132,1132,1132,1132,1133,1133,1133,
+		1134,1134,1134,1134,1134,1134,1135,1135,1135,1135,1136,1136,1137,1137,1138,1138,1138,1139,1139,1139,1139,1139,1139,1139,1139,1140,1140,1140,1140,1141,1141,1141,1141,1141,1141,1141,1141,1141,1141,1141,1141,1141,1141,1142,1143,1143,1143,1143,1144,1144,1144,1144,1144,1144,1144,1144,1144,1145,1145,1145,1145,1145,1146,1146,1146,1146,1147,1147,1147,1147,1147,1147,1147,1147,1148,1148,1148,1148,1149,1149,1149,1149,1149,1149,1149,1149,1149,1149,1149,1149,1149,1149,1150,1150,1150,1150,1151,1151,1151,1151,1151,1151,1151,1151,1151,1151,1151,1151,1151,1151,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1152,1153,1153,1153,1153,1153,1153,1153,1153,1153,1153,1154,1154,1154,1154,1154,1154,1155,1156,1156,1157,1157,1157,1157,1157,1157,1157,1157,1157,1157,1157,1157,1157,1158,1158,1158,1159,1159,1159,1160,1160,1160,1160,1160,1160,1160,1160,1160,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1161,1162,1162,1162,1162,1162,1163,1163,1163,1163,1163,1163,1163,1163,1163,1163,1163,1163,1163,1164,1165,1165,1165,1165,1165,1165,1165,1165,1165,1166,1166,1167,1168,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1169,1170,1171,1171,1171,1171,1171,1171,1171,1171,
+		1171,1171,1171,1171,1171,1172,1173,1173,1173,1173,1173,1173,1173,1174,1174,1174,1174,1174,1174,1175,1176,1176,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1177,1178,1178,1179,1180,1180,1180,1180,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1181,1182,1182,1182,1182,1182,1182,1182,1182,1183,1183,1183,1183,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1184,1185,1185,1185,1186,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1187,1188,1188,1188,1188,1188,1189,1189,1189,1190,1190,1190,1190,1191,1191,1191,1191,1191,1191,1192,1192,1192,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1193,1195,1195,1195,1195,1196,1197,1197,1197,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,1198,
+		1198,1198,1198,1198,1198,1199,1199,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1200,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1201,1202,1202,1202,1203,1203,1203,1203,1203,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,
+		1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,1204,
+		1204,1204,1204,1204,1204,1204,1204,1204,1204
+	},
+	{
+		16,16,17,19,21,25,27,30,33,37,42,47,54,62,71,81,90,101,113,125,136,148,158,168,178,186,194,202,209,215,221,227,232,237,242,247,252,257,262,266,270,275,279,283,287,291,295,299,303,307,311,314,318,322,325,329,333,336,339,343,346,350,353,356,360,363,366,369,373,376,379,382,385,388,391,394,397,401,404,407,410,413,416,418,421,424,427,430,433,436,439,442,444,447,450,453,456,459,461,464,467,469,472,475,478,480,483,486,488,491,493,496,499,501,504,506,509,512,514,517,519,522,524,527,529,531,534,536,538,541,543,545,548,550,552,554,556,559,561,563,565,567,569,571,573,575,577,579,581,583,585,587,589,591,593,595,597,599,600,602,604,606,608,609,611,613,615,617,618,620,622,624,625,627,629,631,633,634,636,638,639,641,643,644,646,647,649,651,652,654,656,657,659,661,662,664,666,667,669,671,673,674,676,678,679,681,683,685,686,688,690,691,693,695,696,698,699,701,703,704,706,708,709,711,713,714,716,718,719,721,723,724,726,727,729,730,732,734,735,737,738,740,742,743,745,746,748,749,751,752,754,755,757,758,
+		760,761,763,764,765,767,768,770,771,772,773,775,776,778,779,780,782,783,784,786,787,788,790,791,792,793,795,796,797,798,799,800,801,802,804,805,806,807,808,809,810,811,812,814,815,816,817,818,819,820,821,822,823,825,826,827,828,829,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,844,845,846,847,848,849,850,851,852,853,853,854,855,856,857,857,858,859,860,860,861,862,863,864,865,865,866,867,868,869,869,870,871,872,872,873,874,874,875,876,877,877,878,879,880,880,881,882,882,883,884,885,886,886,887,887,888,889,890,890,891,892,892,893,894,894,895,896,896,897,897,898,899,899,900,901,901,902,903,904,904,905,905,906,906,907,908,908,909,909,910,910,911,911,912,912,913,914,914,915,915,916,917,918,918,919,919,920,921,921,922,922,923,923,924,924,925,925,926,927,927,928,928,929,929,930,930,931,931,932,932,933,933,933,933,934,934,935,935,936,936,936,937,938,938,939,940,940,941,941,942,942,943,943,944,944,945,946,946,946,947,947,947,948,948,948,949,949,950,950,951,951,952,952,953,953,954,954,955,955,955,
+		956,956,957,957,957,958,958,959,959,959,959,960,960,961,961,962,962,962,962,963,963,964,964,965,965,966,966,966,967,967,968,968,968,969,970,970,970,971,971,972,972,972,972,973,973,973,974,974,974,974,974,975,975,976,976,976,976,977,977,977,978,978,978,979,979,979,980,980,981,981,981,982,982,982,982,982,983,983,984,984,984,985,985,985,985,986,987,987,987,987,987,987,987,988,988,988,989,989,989,989,989,990,990,990,991,991,992,992,992,992,992,992,993,993,994,994,994,995,995,996,996,996,996,996,996,996,997,997,997,997,997,997,998,998,998,999,999,999,1000,1000,1000,1000,1001,1001,1001,1001,1002,1002,1002,1003,1003,1003,1003,1003,1003,1004,1004,1004,1004,1004,1004,1005,1005,1005,1006,1006,1006,1006,1006,1006,1007,1007,1007,1007,1007,1008,1008,1008,1009,1009,1009,1010,1010,1011,1011,1011,1011,1011,1011,1012,1012,1012,1012,1012,1012,1012,1013,1013,1013,1013,1013,1014,1014,1014,1014,1014,1014,1014,1015,1015,1016,1016,1016,1017,1017,1017,1018,1018,1018,1018,1018,1018,1019,1019,1019,1019,1019,1019,1019,1019,1020,1020,1020,1020,1020,1020,1020,1021,1021,1021,1022,1022,1023,1023,1023,1024,1024,1024,1024,1025,1025,1025,1025,1025,1025,
+		1025,1025,1025,1025,1026,1026,1026,1026,1026,1026,1026,1026,1026,1027,1027,1027,1027,1027,1027,1027,1027,1028,1028,1028,1028,1029,1029,1029,1030,1031,1031,1031,1031,1031,1031,1031,1031,1031,1031,1032,1032,1032,1032,1032,1033,1033,1033,1034,1034,1034,1034,1034,1035,1035,1035,1036,1036,1036,1036,1036,1037,1037,1037,1037,1037,1037,1037,1037,1038,1038,1038,1038,1038,1039,1039,1040,1040,1040,1041,1041,1041,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1043,1043,1043,1044,1044,1045,1045,1045,1045,1045,1045,1045,1046,1046,1046,1046,1046,1046,1046,1046,1046,1047,1047,1047,1047,1047,1047,1047,1047,1047,1047,1047,1047,1048,1048,1048,1048,1048,1048,1048,1049,1049,1049,1050,1050,1050,1050,1050,1051,1051,1052,1052,1052,1052,1052,1053,1053,1053,1053,1053,1053,1053,1053,1054,1054,1054,1054,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1056,1056,1057,1057,1057,1057,1057,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1058,1059,1060,1061,1061,1062,1062,1062,1062,1062,1063,1063,1063,1063,1063,1063,1063,1063,1064,1064,1064,1064,1064,1064,1064,1064,1065,1065,1065,1066,1066,1066,1066,1067,1067,1067,1067,1067,1067,1068,1068,1068,1069,1069,1069,1070,1070,1070,1070,1070,1070,1070,1070,1070,1070,1071,1071,1071,1071,1071,1071,1072,1072,
+		1072,1072,1073,1073,1073,1073,1074,1074,1074,1075,1075,1075,1076,1076,1077,1077,1078,1078,1078,1078,1078,1078,1078,1078,1078,1078,1078,1079,1079,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1080,1081,1081,1081,1082,1083,1083,1083,1083,1083,1083,1083,1083,1083,1083,1083,1083,1083,1084,1084,1084,1084,1084,1085,1085,1085,1086,1086,1086,1086,1086,1086,1086,1086,1087,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1088,1089,1089,1089,1089,1089,1089,1089,1089,1090,1090,1090,1090,1090,1090,1090,1090,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1091,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1093,1094,1095,1095,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1096,1097,1097,1098,1098,1098,1098,1098,1098,1099,1099,1099,1099,1099,1099,1099,1099,1099,1099,1099,1099,1099,1099,1099,1100,1100,1100,1100,1100,1100,1100,1100,1100,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1101,1102,1102,1103,1103,1103,1103,1103,1103,1103,1103,1103,1104,1104,1104,1105,1106,1106,1107,1107,1107,1107,1107,1107,1107,1107,1107,1107,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1108,1109,1109,
+		1109,1110,1110,1110,1110,1110,1111,1112,1112,1112,1112,1112,1112,1112,1112,1113,1113,1113,1113,1113,1114,1114,1114,1114,1114,1114,1114,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1115,1116,1117,1117,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1119,1120,1120,1120,1120,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1121,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1122,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1123,1124,1125,1125,1125,1125,1125,1126,1127,1128,1128,1128,1128,1128,1128,1128,1128,1128,1128,1128,1129,1129,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1130,1131,1131,1132,1132,1132,1132,1133,1134,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,
+		1135,1135,1135,1135,1135,1135,1136,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1137,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1138,1139,1139,1139,1139,1139,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,
+		1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,1140,
+		1140,1140,1140,1140,1140,1140,1140,1140,1140
+	},
+	{
+		16,16,16,18,20,22,24,27,29,32,35,38,42,47,53,59,67,74,82,92,101,112,122,132,141,150,159,166,174,180,187,193,198,204,209,214,219,223,228,232,237,241,245,249,254,258,261,265,269,273,277,280,284,288,291,295,298,301,305,308,311,315,318,321,324,327,330,334,337,340,343,346,349,352,355,358,361,364,367,369,372,375,378,381,384,387,389,392,395,398,401,403,406,409,411,414,417,419,422,425,427,430,433,435,438,441,443,446,448,451,453,456,458,461,463,466,468,471,473,476,478,481,483,485,488,490,493,495,497,500,502,504,506,509,511,513,515,517,519,522,524,526,528,530,532,534,536,538,540,542,544,546,548,550,552,554,556,558,559,561,563,565,567,569,570,572,574,576,577,579,581,582,584,586,587,589,591,592,594,596,597,599,601,602,604,605,607,608,610,611,613,615,616,618,619,621,623,624,626,627,629,630,632,634,635,637,638,640,641,643,644,646,648,649,651,652,654,655,657,658,660,661,663,664,666,668,669,671,672,674,675,677,678,680,681,683,684,686,687,689,691,692,694,695,697,698,700,701,703,704,706,707,709,710,
+		712,713,715,716,718,719,721,722,723,725,726,728,729,730,732,733,735,736,738,739,740,742,743,744,746,747,748,749,751,752,753,754,755,757,758,759,760,761,763,764,765,766,767,768,769,771,772,773,774,775,776,777,778,779,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,798,799,800,801,802,803,804,805,806,807,808,809,810,811,811,812,813,814,814,815,816,816,817,818,819,820,821,822,822,823,824,825,826,826,827,828,829,829,830,831,832,832,833,834,834,835,836,837,837,838,839,840,840,841,842,842,843,844,844,845,846,846,847,848,849,849,850,851,852,852,853,854,854,855,855,856,857,857,858,858,859,860,860,861,861,862,863,863,864,864,865,866,866,867,867,868,868,869,869,870,870,871,871,872,873,873,874,875,876,876,877,878,878,879,879,880,880,881,881,882,882,883,883,884,884,885,885,886,886,887,887,888,889,889,889,890,890,890,891,891,892,892,892,893,893,894,894,895,895,896,896,897,897,898,899,899,899,900,901,901,902,902,903,903,903,904,904,905,905,905,906,906,907,907,908,908,908,909,909,910,910,911,911,
+		911,912,912,913,913,913,914,914,915,915,915,916,916,916,917,917,917,918,918,918,919,919,920,920,921,921,922,922,923,923,923,924,924,925,925,925,926,926,926,927,927,928,928,928,929,929,929,929,930,930,930,931,931,931,932,932,932,932,933,933,933,934,934,934,935,935,935,936,936,937,937,937,938,938,938,938,939,939,939,940,940,940,941,941,941,941,942,942,942,943,943,943,944,944,944,944,945,945,945,945,945,945,946,946,947,947,947,947,947,948,948,948,949,949,949,950,950,950,951,951,951,952,952,952,952,952,952,953,953,953,954,954,954,954,954,954,955,955,955,955,955,956,956,957,957,957,957,958,958,958,958,958,959,959,959,960,960,960,960,960,960,961,961,961,961,961,961,962,962,962,963,963,963,963,964,964,964,964,965,965,966,966,966,966,966,966,966,967,967,967,967,968,968,968,968,969,969,969,969,969,969,970,970,970,970,970,970,970,971,971,971,972,972,973,973,973,973,973,974,974,974,974,974,974,974,974,974,974,975,975,975,975,975,975,976,976,976,977,977,978,978,978,978,979,979,980,980,980,980,980,980,980,980,980,980,
+		980,980,981,981,981,981,981,981,981,982,982,982,982,982,983,983,983,983,983,983,983,983,983,984,984,984,985,985,986,986,986,986,987,987,987,987,987,987,987,987,987,988,988,988,988,989,989,989,990,990,990,990,990,990,990,991,991,991,991,991,992,992,992,992,993,993,993,993,993,993,994,994,994,994,994,994,995,995,996,996,997,997,997,997,997,997,997,997,997,997,997,997,997,997,998,998,999,999,1000,1000,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1003,1003,1003,1003,1004,1004,1004,1004,1005,1005,1005,1005,1005,1005,1005,1006,1007,1007,1007,1007,1007,1008,1008,1008,1008,1008,1008,1008,1008,1008,1008,1008,1009,1009,1009,1009,1009,1010,1010,1010,1010,1010,1010,1010,1010,1011,1011,1011,1011,1012,1012,1012,1012,1012,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1014,1014,1014,1014,1015,1016,1016,1016,1017,1017,1017,1017,1018,1018,1018,1018,1018,1018,1018,1018,1018,1019,1019,1019,1019,1019,1020,1020,1020,1021,1021,1021,1021,1021,1021,1021,1022,1022,1022,1022,1022,1022,1023,1023,1024,1024,1024,1024,1024,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1027,1027,
+		1027,1027,1027,1027,1027,1028,1029,1029,1029,1029,1029,1030,1030,1031,1031,1031,1031,1031,1031,1031,1032,1032,1032,1033,1033,1033,1033,1033,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1034,1035,1036,1036,1036,1036,1037,1037,1037,1037,1037,1037,1037,1037,1038,1038,1038,1038,1038,1038,1038,1039,1039,1039,1039,1039,1039,1039,1040,1041,1041,1041,1041,1041,1041,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1042,1043,1043,1043,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1044,1045,1045,1045,1046,1046,1046,1046,1046,1047,1047,1047,1047,1047,1047,1047,1047,1048,1048,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1049,1050,1051,1052,1052,1052,1052,1052,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1054,1054,1054,1054,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1056,1056,1057,1057,1057,1057,1057,1057,1057,1058,1058,1058,1058,1058,1059,1060,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1061,1062,
+		1062,1062,1063,1064,1064,1064,1065,1065,1065,1065,1065,1065,1065,1065,1065,1066,1066,1066,1066,1066,1067,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1068,1069,1069,1070,1070,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1071,1072,1072,1072,1072,1072,1072,1072,1073,1073,1073,1073,1073,1073,1074,1074,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1075,1076,1076,1076,1076,1076,1076,1076,1077,1077,1077,1077,1077,1077,1077,1078,1078,1078,1078,1078,1079,1079,1080,1080,1080,1080,1080,1081,1081,1081,1081,1081,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1082,1083,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1084,1085,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,1086,
+		1086,1086,1086,1087,1087,1088,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1089,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1090,1091,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,
+		1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,1092,
+		1092,1092,1092,1092,1092,1092,1092,1092,1092
+	},
+	{
+		16,16,16,17,18,20,21,24,26,29,31,33,36,39,43,48,53,60,66,73,81,89,98,108,117,126,134,142,150,157,163,169,175,181,186,191,195,200,205,209,213,217,222,226,230,233,237,241,244,248,252,255,259,262,265,269,272,275,278,281,285,288,291,294,297,300,303,306,308,311,314,317,320,323,326,328,331,334,336,339,342,345,347,350,353,355,358,360,363,366,368,371,373,376,378,381,384,386,389,391,393,396,398,401,403,406,408,410,413,415,417,420,422,424,427,429,431,434,436,438,441,443,445,448,450,452,454,456,459,461,463,465,467,469,472,474,476,478,480,482,484,487,489,491,493,495,497,499,501,503,505,507,509,511,513,515,517,519,521,522,524,526,528,530,532,533,535,537,539,540,542,544,546,547,549,551,552,554,556,557,559,560,562,564,565,567,568,570,571,573,575,576,578,579,581,582,584,585,586,588,589,591,592,594,595,597,598,600,601,603,604,605,607,608,610,611,612,614,615,616,618,619,621,622,623,625,626,628,629,630,632,633,635,636,637,639,640,641,643,644,645,647,648,650,651,652,654,655,657,658,659,661,662,663,
+		665,666,667,669,670,671,673,674,675,677,678,679,681,682,684,685,686,688,689,691,692,693,695,696,698,699,700,702,703,704,705,707,708,709,711,712,713,714,716,717,718,719,721,722,723,725,726,727,729,730,731,732,733,735,736,737,738,739,740,742,743,744,745,746,747,748,749,750,751,753,754,755,755,756,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,774,775,776,777,778,779,780,781,781,782,783,784,785,786,787,788,788,789,790,791,792,792,793,794,795,795,796,797,798,799,799,800,801,802,802,803,804,805,805,806,807,807,808,809,810,810,811,812,813,813,814,815,815,816,817,817,818,818,819,820,820,821,822,822,823,824,824,825,825,826,827,827,828,828,829,829,830,831,831,832,832,833,833,834,835,835,836,837,837,838,839,839,840,840,841,842,842,843,843,844,844,845,845,846,847,847,848,848,849,849,850,850,851,851,852,852,852,853,853,854,854,854,855,855,856,856,857,857,858,858,859,859,860,861,861,861,862,863,863,864,864,865,865,866,866,866,867,867,867,868,868,869,869,870,870,871,871,872,872,873,873,873,874,874,
+		874,875,875,875,876,876,877,877,877,878,878,879,879,879,880,881,881,881,881,882,882,883,883,884,884,884,885,885,886,886,887,887,887,888,888,889,889,889,890,890,891,891,891,892,892,892,892,893,893,893,894,894,894,895,895,895,896,896,896,897,897,897,898,898,898,898,899,899,900,900,900,901,901,901,901,902,902,903,903,903,904,904,904,904,905,905,905,906,906,906,907,907,907,907,908,908,908,908,908,909,909,909,910,910,910,911,911,911,911,911,912,912,912,913,913,914,914,914,915,915,915,916,916,916,916,916,916,917,917,917,917,917,918,918,918,918,919,919,919,919,920,920,920,921,921,921,921,922,922,922,922,922,922,923,923,924,924,924,924,925,925,925,925,926,926,926,926,926,926,926,927,927,927,928,928,928,928,929,929,929,930,930,931,931,931,931,931,932,932,932,932,932,932,932,933,933,933,934,934,934,934,934,934,934,935,935,935,935,935,936,936,936,937,937,937,937,938,938,938,938,939,939,939,939,939,939,939,940,940,940,940,940,940,940,940,941,941,941,941,942,942,943,943,943,944,944,945,945,945,945,945,945,945,945,945,
+		945,945,945,945,945,946,946,946,946,947,947,947,947,947,947,948,948,948,948,948,948,948,948,948,948,949,950,950,951,951,951,951,952,952,952,952,952,952,952,952,953,953,953,953,953,954,954,954,954,954,954,954,955,955,955,955,955,956,956,956,956,957,957,957,957,958,958,958,958,958,958,959,959,959,959,959,959,960,960,961,961,962,962,962,962,962,962,962,962,962,962,962,962,962,963,963,964,964,964,965,965,965,965,965,965,965,966,966,966,966,966,966,966,966,966,966,966,967,967,967,967,967,967,967,967,968,968,968,968,968,968,969,969,970,970,970,970,970,970,971,971,971,971,971,971,971,972,972,972,972,972,972,973,973,973,973,973,973,973,973,974,974,974,974,975,975,975,975,975,976,976,976,976,976,976,976,977,977,977,977,977,977,977,977,977,977,978,978,978,978,978,978,978,979,979,980,980,981,981,981,981,982,982,982,982,982,982,982,982,982,982,983,983,983,983,983,983,984,985,985,985,985,985,985,985,986,986,986,986,986,986,987,987,987,987,988,988,988,989,989,989,989,989,989,989,990,990,990,990,990,990,991,991,992,992,
+		992,992,992,992,992,992,993,993,993,993,993,993,994,995,995,996,996,996,996,996,996,996,996,996,996,997,997,997,998,998,998,998,998,998,998,998,998,998,998,998,998,998,998,999,1000,1000,1000,1000,1000,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1001,1002,1002,1002,1003,1003,1003,1003,1003,1003,1004,1004,1004,1004,1005,1005,1005,1005,1005,1005,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1006,1007,1007,1007,1007,1007,1007,1007,1007,1007,1008,1008,1008,1008,1008,1008,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1009,1010,1010,1010,1010,1010,1010,1011,1011,1011,1011,1011,1011,1012,1012,1012,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1013,1014,1014,1014,1015,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1016,1017,1017,1017,1017,1017,1017,1017,1017,1017,1018,1018,1018,1018,1018,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1019,1020,1020,1020,1020,1020,1020,1020,1020,1021,1021,1021,1022,1022,1022,1023,1023,1024,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1025,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,1026,
+		1026,1026,1027,1027,1027,1027,1027,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1029,1030,1031,1031,1031,1031,1031,1031,1031,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1032,1033,1034,1034,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1035,1036,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1038,1039,1039,1039,1039,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1040,1041,1041,1041,1041,1043,1043,1043,1043,1043,1044,1044,1044,1044,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1045,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1046,1048,1048,1048,1048,1048,1048,1048,1049,1049,1049,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,1050,
+		1050,1050,1050,1050,1050,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1051,1052,1052,1052,1052,1052,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1053,1054,1054,1054,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,
+		1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,1055,
+		1055,1055,1055,1055,1055,1055,1055,1055,1055
+	},
+	{
+		16,16,16,16,17,19,20,21,23,25,28,31,33,35,37,40,42,46,50,54,59,64,70,76,84,91,99,106,114,121,128,134,140,146,152,157,162,166,171,175,180,184,188,192,196,200,203,207,211,214,217,221,224,228,231,234,237,240,243,246,249,252,255,258,261,264,267,269,272,275,277,280,283,285,288,291,293,296,298,301,303,306,308,311,313,316,318,321,323,326,328,331,333,335,338,340,342,345,347,349,352,354,356,358,361,363,365,367,370,372,374,376,379,381,383,385,387,389,392,394,396,398,400,402,404,406,408,411,413,415,417,419,421,423,425,427,429,431,433,435,437,439,441,443,445,447,449,451,453,455,457,458,460,462,464,466,468,470,472,473,475,477,479,481,483,484,486,488,490,492,493,495,497,499,500,502,504,505,507,509,510,512,514,515,517,519,520,522,523,525,526,528,529,531,532,534,535,537,538,540,541,543,544,546,547,549,550,551,553,554,555,557,558,560,561,562,564,565,566,568,569,570,572,573,574,576,577,578,580,581,582,583,585,586,587,588,590,591,592,593,595,596,597,599,600,601,603,604,605,606,607,609,610,611,
+		612,614,615,616,617,618,620,621,622,623,624,626,627,628,629,631,632,633,634,636,637,638,639,641,642,643,644,645,646,648,649,650,651,652,653,654,655,657,658,659,660,661,662,664,665,666,668,669,670,671,672,674,675,676,677,678,680,681,682,683,684,686,687,688,689,690,691,692,694,695,696,697,698,699,700,701,703,704,705,706,707,708,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,735,736,737,738,739,740,741,741,742,743,744,745,746,747,748,749,749,750,751,752,753,754,754,755,756,757,758,759,759,760,761,762,762,763,764,764,765,766,767,767,768,769,770,770,771,772,773,773,774,774,775,776,776,777,778,778,779,779,780,781,781,782,782,783,783,784,785,785,786,787,787,788,789,789,790,791,791,792,792,793,794,794,795,795,796,796,797,798,798,799,799,800,800,801,801,802,802,803,803,804,804,805,805,806,806,806,807,807,808,808,809,809,810,811,811,811,812,813,813,814,814,815,815,816,816,817,817,818,818,818,819,819,819,820,820,821,821,822,822,823,823,824,824,825,825,825,826,
+		826,827,827,827,828,828,829,829,829,830,830,831,831,831,832,832,832,833,833,834,834,834,835,835,836,836,837,837,838,838,838,839,839,840,840,840,841,841,842,842,842,842,843,843,844,844,844,844,845,845,845,846,846,846,847,847,847,848,848,848,849,849,849,850,850,850,851,851,851,852,852,852,853,853,853,854,854,854,855,855,855,856,856,856,857,857,857,857,858,858,858,858,859,859,860,860,860,860,860,861,861,861,862,862,862,862,862,863,863,863,864,864,864,864,865,865,866,866,867,867,867,867,868,868,868,868,868,869,869,869,869,869,869,870,870,870,871,871,871,871,871,872,872,872,873,873,873,873,874,874,874,875,875,875,875,876,876,876,876,876,877,877,877,877,878,878,878,879,879,879,879,879,879,880,880,880,881,881,881,881,882,882,882,883,883,883,883,883,883,884,884,884,884,885,885,885,886,886,886,886,886,886,886,886,886,886,887,887,887,888,888,888,889,889,889,890,890,890,890,891,891,891,891,891,891,891,891,892,892,892,892,892,893,893,893,893,894,894,894,894,894,895,896,896,896,896,897,897,897,897,897,897,897,897,897,
+		898,898,898,898,898,898,898,898,899,899,899,899,899,900,900,900,900,900,900,900,900,900,900,901,901,901,902,902,903,903,903,903,904,904,904,904,904,904,904,904,905,905,906,906,906,906,907,907,907,907,907,907,907,907,907,908,908,908,908,909,909,909,909,910,910,910,910,910,910,910,910,911,911,911,911,911,912,912,912,912,913,913,913,914,914,914,914,914,914,914,914,914,915,915,915,915,916,916,916,917,917,917,918,918,918,918,918,918,918,918,918,918,918,918,918,919,919,919,919,919,919,919,919,919,919,919,920,920,920,921,921,921,921,921,921,922,922,922,922,922,922,923,923,923,924,924,924,924,924,924,924,925,925,925,925,925,925,925,925,926,926,926,926,927,927,927,927,927,927,927,927,927,927,928,928,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,930,930,931,931,932,933,933,933,933,933,933,933,933,934,934,934,934,934,934,934,935,935,935,935,935,936,936,936,936,936,937,937,937,937,937,937,937,937,938,938,938,938,939,939,939,939,939,939,939,940,940,940,940,940,940,941,941,941,941,941,941,942,942,942,
+		942,942,942,942,943,943,944,944,944,944,944,945,945,946,946,947,947,947,947,947,947,947,947,947,948,948,948,948,948,948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,950,950,951,951,952,952,952,952,952,952,952,952,952,952,953,953,953,953,953,953,953,953,954,954,954,954,954,954,954,955,955,955,955,956,956,956,956,956,956,956,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,958,958,958,958,958,958,958,958,959,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,960,961,961,961,961,961,961,961,961,961,961,961,961,961,961,962,963,963,963,963,963,963,963,964,964,964,964,964,964,964,965,965,966,966,966,966,967,967,967,967,967,967,967,967,967,967,967,967,967,967,967,968,968,968,968,968,968,968,968,968,968,968,968,969,969,969,969,969,969,969,969,969,969,969,969,969,969,969,970,970,970,971,971,971,971,971,971,972,973,973,973,973,973,974,974,974,974,974,974,974,974,974,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,976,976,976,976,976,976,976,
+		976,977,977,977,977,977,978,978,978,978,978,978,978,978,979,979,979,979,980,980,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,981,983,983,984,984,984,984,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,985,986,986,986,986,986,986,986,987,987,987,987,987,987,987,987,987,987,987,987,987,987,987,987,987,988,988,988,988,988,988,989,989,989,989,989,989,989,989,989,989,989,989,989,989,989,989,990,990,991,991,991,991,991,992,992,992,992,992,992,993,993,993,994,994,994,994,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,995,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,996,997,997,997,997,997,997,997,998,998,998,998,998,998,999,999,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,
+		1000,1000,1000,1000,1000,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1002,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1003,1004,1004,1004,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,
+		1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,1005,
+		1005,1005,1005,1005,1005,1005,1005,1005,1005
+	},
+	{
+		17,17,17,17,17,17,18,19,20,22,23,25,28,30,33,35,37,39,41,44,47,50,54,58,63,68,74,80,87,94,100,107,113,119,125,130,135,140,145,149,153,158,162,166,170,173,177,181,184,188,191,195,198,201,204,207,210,213,216,219,222,225,228,231,233,236,239,241,244,247,249,252,254,257,259,262,264,267,269,271,274,276,279,281,283,286,288,290,292,295,297,299,302,304,306,308,311,313,315,317,319,322,324,326,328,330,332,334,336,339,341,343,345,347,349,351,353,355,357,359,362,364,366,368,370,372,374,375,377,379,381,383,385,387,389,391,393,394,396,398,400,402,404,406,407,409,411,413,415,417,418,420,422,424,426,427,429,431,433,435,436,438,440,442,443,445,447,449,450,452,454,455,457,459,460,462,464,465,467,469,470,472,474,476,477,479,480,482,484,485,487,488,490,491,493,494,496,497,499,501,502,504,505,506,508,510,511,513,514,516,517,518,520,521,523,524,525,527,528,529,530,532,533,535,536,537,538,540,541,542,543,545,546,547,548,550,551,552,553,555,556,557,558,559,561,562,563,564,565,566,568,569,570,571,
+		572,573,575,576,577,578,579,580,582,583,584,585,586,587,588,589,591,592,593,594,595,597,598,599,600,601,602,603,604,605,606,607,608,609,611,611,612,614,615,616,617,618,619,620,621,622,623,624,625,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,707,708,709,710,711,712,713,714,715,716,717,717,718,719,720,721,722,722,723,724,725,726,726,727,728,729,730,730,731,732,733,733,734,735,736,736,737,738,739,739,740,741,741,742,743,743,744,745,746,746,747,748,748,749,750,751,751,752,752,753,754,754,755,756,756,757,757,758,759,759,760,760,761,761,762,763,763,764,764,765,765,766,766,766,767,767,768,768,769,770,770,771,771,772,772,773,774,774,775,775,776,776,777,777,778,778,779,779,779,780,780,781,781,782,782,783,783,783,784,784,785,786,786,787,787,788,788,
+		788,789,789,790,790,790,790,791,791,792,792,793,793,794,794,795,795,795,796,796,797,797,797,798,798,799,799,800,800,800,801,801,802,802,803,803,803,804,804,805,805,805,806,806,806,806,807,807,807,808,808,809,809,809,810,810,810,810,811,811,811,812,812,812,813,813,813,814,814,815,815,816,816,816,816,817,817,817,818,818,818,818,819,819,819,820,820,820,821,821,821,822,822,822,822,823,823,823,823,824,824,824,824,824,825,825,825,826,826,827,827,827,828,828,828,828,829,829,830,830,830,830,831,831,831,831,832,832,832,832,832,832,833,833,833,833,834,834,834,834,834,835,835,836,836,836,837,837,837,838,838,838,838,838,839,839,839,839,839,839,840,840,840,840,840,841,841,842,842,842,842,843,843,843,843,844,844,844,844,845,845,845,845,845,846,846,846,846,847,847,847,848,848,848,848,848,848,849,849,849,849,849,849,850,850,850,850,850,851,851,851,852,852,852,853,853,853,853,854,854,854,854,854,854,854,855,855,855,855,855,855,855,856,856,856,856,857,857,857,858,858,858,859,859,859,859,860,860,860,860,860,860,860,860,860,
+		860,861,861,861,861,861,861,862,862,862,862,863,863,863,863,863,863,863,863,863,864,864,864,864,865,865,866,866,866,867,867,867,867,867,867,867,867,867,868,868,868,868,868,869,869,870,870,870,870,870,870,870,870,871,871,871,871,871,872,872,872,872,873,873,873,873,874,874,874,874,874,874,874,874,875,875,875,876,876,876,876,877,877,877,877,877,877,877,877,877,878,878,878,878,879,879,879,879,880,880,880,880,880,881,881,881,881,881,881,881,881,881,881,881,881,882,882,882,882,882,882,882,882,883,883,883,883,884,884,884,884,884,884,884,884,884,885,885,885,885,886,886,886,887,887,888,888,888,888,888,888,888,888,888,888,889,889,889,889,889,889,890,890,890,890,890,890,890,890,891,891,891,891,891,891,892,892,892,892,892,892,892,892,893,893,893,893,893,893,893,893,893,894,894,894,895,895,895,895,896,896,896,897,897,897,897,897,897,897,897,897,898,898,898,898,898,899,899,899,899,899,900,900,900,900,900,900,900,900,900,901,901,901,901,901,902,902,902,903,903,903,903,903,903,903,904,904,904,904,904,904,905,905,905,905,
+		905,905,905,906,906,906,907,907,907,907,907,908,909,909,909,909,909,909,909,909,910,910,910,910,910,910,910,910,911,911,911,911,911,911,911,911,911,911,911,911,911,912,912,913,913,913,913,913,914,914,914,914,914,914,914,914,914,914,915,915,915,915,915,915,916,916,916,916,916,916,916,916,917,917,917,917,918,918,918,918,918,918,918,918,919,919,919,919,919,919,919,919,919,919,919,919,919,919,920,920,920,920,920,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,922,922,922,922,922,922,923,923,923,923,923,923,923,923,924,924,924,924,924,925,925,925,925,925,925,925,925,926,926,926,926,926,926,926,926,927,927,927,927,927,928,928,928,928,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,929,930,930,930,930,930,930,930,931,931,931,931,931,931,931,932,932,932,932,932,932,933,933,933,933,933,933,933,934,935,935,935,935,936,936,936,936,936,936,936,936,936,936,936,936,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,
+		938,938,938,939,939,940,940,940,940,940,940,940,940,940,940,940,940,941,941,942,942,943,943,943,943,943,943,943,943,943,943,943,943,943,943,943,943,943,943,943,944,944,944,945,945,945,945,945,945,945,945,945,945,945,945,945,946,946,946,946,946,946,946,946,946,946,946,946,946,946,947,947,947,947,947,947,947,947,947,947,948,948,948,948,948,948,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,949,950,950,950,950,950,950,950,951,951,951,952,952,952,952,952,952,952,952,953,953,954,954,954,954,954,954,954,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,955,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,956,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,957,958,958,958,958,958,958,960,960,960,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,961,
+		961,961,961,961,961,962,962,962,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,963,964,964,964,964,964,964,964,964,964,964,964,964,964,964,964,964,964,964,964,965,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,
+		966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,966,
+		966,966,966,966,966,966,966,966,966
+	},
+	{
+		10,12,13,14,15,16,17,18,19,21,22,23,25,27,30,32,34,35,37,39,41,43,46,49,52,55,59,64,69,74,80,86,92,98,104,110,115,120,124,129,133,137,141,145,149,153,157,160,164,167,171,174,177,180,183,186,190,193,195,198,201,204,207,210,212,215,218,220,223,225,228,230,233,235,237,240,242,244,247,249,251,254,256,258,260,263,265,267,269,271,273,276,278,280,282,284,286,288,290,293,295,297,299,301,303,305,307,309,311,313,315,317,319,321,323,325,327,329,331,332,334,336,338,340,342,344,346,348,350,351,353,355,357,359,361,362,364,366,368,369,371,373,375,376,378,380,382,383,385,387,389,390,392,394,395,397,399,401,402,404,406,407,409,411,412,414,415,417,419,420,422,424,425,427,429,430,432,433,435,437,438,440,441,443,444,446,447,449,450,452,454,455,457,458,460,461,463,464,466,467,469,470,472,473,475,476,478,479,481,482,484,485,487,488,490,491,492,494,495,497,498,499,501,502,503,505,506,507,509,510,511,512,514,515,516,518,519,520,521,523,524,525,526,528,529,530,531,532,534,535,536,537,538,539,
+		540,542,543,544,545,546,547,548,549,550,552,553,554,555,556,557,558,559,560,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,628,629,630,631,632,633,634,635,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,672,673,674,675,676,677,678,679,680,681,682,683,684,684,685,686,687,688,689,690,691,692,692,693,694,695,696,697,698,698,699,700,700,701,702,703,704,705,705,706,707,708,709,710,710,711,712,713,714,714,715,716,717,717,718,719,720,720,721,721,722,723,724,724,725,726,726,727,728,728,729,730,730,731,731,732,732,733,733,734,735,736,736,737,737,738,739,739,740,741,741,741,742,742,743,744,745,745,746,746,746,747,748,748,749,749,749,750,750,751,752,752,753,753,754,754,755,755,756,756,757,
+		757,758,758,758,759,759,760,760,761,761,761,762,762,763,763,764,764,765,765,765,766,766,767,767,768,768,769,769,770,770,771,771,771,772,772,773,773,774,774,774,775,775,776,776,776,777,777,777,777,778,778,779,779,779,779,780,780,781,781,781,782,782,782,783,783,783,784,784,785,785,785,786,786,786,787,787,787,788,788,789,789,789,789,790,790,791,791,791,791,791,792,792,792,793,793,793,793,794,794,794,795,795,795,796,796,796,796,797,797,797,798,798,798,799,799,800,800,800,800,801,801,801,801,802,802,802,802,802,803,803,803,803,804,804,804,804,805,805,805,806,806,806,806,807,807,807,808,808,808,808,809,809,809,809,809,810,810,810,810,811,811,811,811,811,812,812,812,812,813,813,813,814,814,814,814,815,815,815,816,816,816,816,816,817,817,817,817,818,818,818,818,818,819,819,819,819,820,820,820,820,820,821,821,821,821,821,821,821,822,822,822,823,823,823,824,824,824,825,825,825,825,826,826,826,826,826,826,826,826,826,826,826,826,827,827,827,828,828,828,829,829,829,830,830,830,830,831,831,831,831,832,832,832,832,832,
+		832,833,833,833,833,833,833,833,833,834,834,834,834,834,834,834,834,835,835,835,835,835,835,836,836,837,837,837,838,838,838,839,839,839,839,839,839,839,839,839,839,840,840,840,840,840,841,841,841,841,841,842,842,842,842,842,843,843,843,843,843,843,844,844,844,844,845,845,845,845,845,846,846,846,846,846,847,847,847,847,848,848,848,848,848,848,848,849,849,849,849,849,849,850,850,851,851,851,851,851,852,852,852,852,852,853,853,853,853,853,853,853,853,853,854,854,854,854,854,854,854,854,854,854,854,854,854,855,855,856,856,856,856,856,856,856,857,857,857,857,857,857,858,858,858,858,858,859,859,859,859,860,860,860,860,861,861,861,861,861,861,861,862,862,862,862,862,862,862,862,862,862,862,863,863,863,864,864,864,864,864,864,864,864,864,864,864,864,865,865,865,865,866,866,866,866,867,867,867,867,867,867,868,868,868,868,868,868,869,869,869,869,870,870,870,870,870,871,871,871,871,871,871,871,871,871,871,871,872,872,872,872,872,873,873,873,874,874,874,874,874,875,875,875,875,875,875,876,876,876,876,877,877,877,877,
+		877,877,877,877,877,877,878,878,879,879,879,880,880,880,880,880,881,881,881,881,881,881,881,881,882,882,882,882,882,882,883,883,883,883,883,883,883,883,883,883,883,883,883,883,884,884,885,885,885,885,885,885,885,885,885,885,886,886,886,886,886,886,887,887,887,887,888,888,888,888,888,888,888,888,889,889,889,889,889,889,890,890,890,890,890,890,890,890,890,890,890,890,890,890,891,891,891,891,891,891,891,891,891,891,892,892,892,892,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,893,894,894,894,894,894,894,894,894,894,894,894,894,894,895,895,895,895,896,896,897,897,897,897,897,897,897,897,897,897,897,897,898,898,899,899,899,899,899,899,900,900,900,900,900,900,900,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,901,902,902,902,902,902,902,902,902,902,902,902,902,902,902,903,903,903,903,903,903,904,904,904,904,904,905,905,906,906,906,906,906,906,906,906,906,907,907,907,907,907,907,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,908,909,909,909,909,909,909,909,
+		909,909,909,910,910,910,911,911,911,911,911,911,911,911,911,912,912,912,912,913,913,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,914,915,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,916,917,917,917,917,917,917,917,917,918,918,918,918,919,919,919,919,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,920,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,921,922,922,922,922,922,923,924,924,925,925,925,925,925,925,925,925,925,925,925,925,925,925,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,926,927,927,927,927,927,927,927,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,928,929,929,929,929,930,930,930,931,931,931,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,932,
+		932,932,932,932,932,932,933,933,933,933,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,934,935,935,935,935,935,935,935,935,935,935,935,935,935,935,935,935,936,936,936,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,937,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,
+		938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,938,
+		938,938,938,938,938,938,938,938,938
+	},
+	{
+		18,18,18,18,18,18,18,18,18,18,18,18,19,20,22,24,26,28,30,32,34,35,37,39,41,43,45,47,50,53,57,61,65,70,75,80,85,90,95,99,104,108,112,116,120,123,127,130,134,137,140,144,147,150,153,156,159,162,165,168,170,173,176,178,181,184,186,189,191,193,196,198,200,203,205,207,209,212,214,216,218,220,222,224,227,229,231,233,235,237,239,241,243,245,247,249,251,252,254,256,258,260,262,264,266,268,269,271,273,275,277,278,280,282,284,286,287,289,291,293,294,296,298,300,301,303,305,307,308,310,312,313,315,317,318,320,322,323,325,327,328,330,332,333,335,336,338,340,341,343,344,346,347,349,350,352,354,355,357,358,360,361,363,364,366,367,369,370,372,373,375,376,378,379,381,382,384,385,386,388,389,391,392,394,395,396,398,399,401,402,404,405,406,408,409,411,412,413,415,416,418,419,420,422,423,425,426,427,429,430,431,433,434,435,437,438,440,441,442,444,445,447,448,449,450,452,453,454,456,457,458,460,461,462,464,465,466,468,469,470,471,473,474,475,477,478,479,480,482,483,484,485,487,488,
+		489,490,491,493,494,495,496,497,498,500,501,502,503,504,505,506,508,509,510,511,512,513,514,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,552,553,554,555,556,557,558,559,559,560,561,562,563,564,565,565,566,567,568,569,570,570,571,572,573,573,574,575,576,577,578,578,579,580,581,582,582,583,584,585,586,587,587,588,589,590,591,591,592,593,594,594,595,596,596,597,598,599,600,600,601,602,603,603,604,605,606,606,607,608,609,610,610,611,612,613,614,615,615,616,617,617,618,619,619,620,621,621,622,623,624,625,625,626,627,628,629,629,630,631,632,632,633,634,634,635,636,637,638,638,639,640,641,641,642,643,644,645,646,647,647,648,649,650,651,651,652,653,654,655,656,656,657,658,659,659,660,661,662,663,663,664,665,666,666,667,668,669,669,670,671,671,672,673,674,674,675,676,677,678,678,679,680,681,682,682,683,684,685,685,686,687,688,688,689,690,690,691,692,692,693,694,694,695,696,696,697,698,699,699,700,701,701,702,
+		703,703,704,704,705,706,706,707,707,708,709,709,710,710,711,711,712,713,713,714,714,715,715,716,717,717,718,718,719,719,720,721,721,722,722,723,723,724,724,725,725,726,726,727,727,728,728,729,729,729,730,730,731,731,732,732,732,733,733,734,734,735,735,735,736,736,737,737,738,738,738,739,739,740,740,741,741,742,742,742,743,743,743,744,744,744,745,745,746,746,746,747,747,747,748,748,748,748,749,749,749,750,750,750,751,751,752,752,752,753,753,753,754,754,754,755,755,755,756,756,757,757,757,757,758,758,758,758,759,759,759,759,760,760,760,760,761,761,761,762,762,763,763,763,764,764,764,765,765,765,765,765,766,766,766,766,766,767,767,767,767,767,768,768,768,769,769,769,769,770,770,770,771,771,771,771,771,772,772,772,773,773,773,773,774,774,774,775,775,775,775,776,776,776,776,777,777,777,777,777,777,778,778,778,778,778,779,779,779,779,780,780,780,781,781,781,782,782,782,782,782,783,783,783,783,783,784,784,784,784,784,784,784,785,785,785,785,785,786,786,787,787,788,788,788,788,788,788,789,789,789,789,789,789,789,
+		789,790,790,790,790,790,791,791,791,791,791,792,792,792,792,792,792,792,793,793,793,793,793,793,794,794,795,795,796,796,796,796,796,796,796,796,796,796,797,797,797,797,797,798,798,799,799,799,799,799,800,800,800,800,800,800,800,800,800,800,801,801,801,801,801,802,802,802,803,803,803,803,804,804,804,805,805,805,805,805,805,806,806,806,806,806,806,806,806,806,806,806,807,807,807,808,808,808,809,809,810,810,810,810,810,810,810,810,811,811,811,811,811,811,811,811,811,811,811,811,812,812,812,812,812,813,813,813,813,813,814,814,814,814,814,814,814,815,815,815,815,815,816,816,816,817,817,817,817,817,817,818,818,818,818,818,818,818,818,818,818,819,819,819,819,820,820,820,820,820,820,820,821,821,821,821,822,822,822,822,822,822,822,822,822,822,823,823,823,823,823,823,824,824,824,825,825,825,825,826,826,826,826,826,826,826,826,827,827,827,827,828,828,828,829,829,829,829,829,829,829,829,829,829,829,829,829,830,830,830,830,831,831,831,831,832,832,832,832,832,832,832,832,833,833,833,833,834,834,834,834,834,834,835,835,
+		835,835,835,835,835,835,836,836,837,837,837,837,837,838,838,838,838,839,839,839,839,839,840,840,840,840,840,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,842,842,843,843,843,843,843,843,843,843,843,843,843,844,844,844,844,844,844,845,845,845,846,846,846,846,846,846,847,847,847,847,847,847,847,847,848,848,848,848,848,848,848,848,848,848,848,848,848,848,848,849,849,849,849,849,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,851,851,851,851,851,852,852,852,852,852,853,853,853,853,853,853,853,853,853,853,853,854,854,854,854,854,855,855,855,855,855,855,855,855,855,856,856,856,856,856,857,857,857,857,857,857,857,857,857,858,858,858,858,858,858,858,858,858,858,858,858,858,859,859,859,859,859,859,859,859,859,859,859,859,860,860,860,860,860,860,860,860,861,861,861,861,861,862,862,862,862,862,863,863,863,863,863,863,863,864,864,864,864,864,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,865,866,866,866,866,866,866,866,866,
+		866,867,867,867,868,868,869,869,869,869,869,869,869,869,870,870,870,870,870,870,871,871,871,871,871,871,871,871,871,871,871,871,871,871,871,871,871,871,872,872,872,873,873,873,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,874,875,875,875,875,875,876,876,876,876,876,876,876,876,876,876,876,876,876,876,876,877,877,877,877,877,877,877,877,878,878,878,878,878,878,878,878,878,878,879,879,879,879,879,879,879,879,879,879,879,879,879,880,880,881,881,881,881,881,881,881,881,882,882,882,882,882,883,883,883,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,884,885,885,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,886,887,887,887,887,887,887,887,887,888,888,888,888,888,888,888,888,888,889,889,889,889,889,889,889,889,889,889,889,889,889,
+		889,889,890,890,890,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,891,892,892,892,892,892,892,892,892,892,892,892,892,892,892,893,893,893,893,893,893,893,893,893,893,893,893,893,893,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,894,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,
+		895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,895,
+		895,895,895,895,895,895,895,895,895
+	},
+	{
+		0,8,10,11,11,12,14,14,14,15,16,17,17,18,19,21,22,24,25,27,29,31,33,34,36,37,39,40,41,43,45,47,49,52,56,60,64,68,73,77,82,87,91,95,99,103,107,110,114,117,120,124,127,130,133,136,139,142,145,148,150,153,156,158,161,164,166,169,171,173,176,178,180,183,185,187,190,192,194,196,198,200,202,204,207,209,211,213,214,216,218,220,222,224,226,228,230,231,233,235,237,239,240,242,244,246,247,249,251,253,254,256,258,260,261,263,265,266,268,270,271,273,275,276,278,280,281,283,285,286,288,289,291,293,294,296,297,299,300,302,304,305,307,308,310,311,313,314,316,317,319,320,322,323,325,326,328,329,331,332,333,335,336,338,339,341,342,344,345,347,348,349,351,352,354,355,356,358,359,361,362,363,365,366,367,369,370,371,373,374,375,377,378,379,381,382,383,385,386,387,389,390,391,393,394,395,397,398,399,401,402,403,405,406,407,408,410,411,412,414,415,416,418,419,420,421,423,424,425,426,428,429,430,431,433,434,435,436,438,439,440,442,443,444,445,447,448,449,450,452,453,454,455,456,
+		458,459,460,461,462,464,465,466,467,468,470,471,472,473,474,475,476,478,479,480,481,482,483,484,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,519,520,521,522,523,524,525,526,526,527,528,529,530,531,531,532,533,534,535,536,537,538,538,539,540,541,542,543,543,544,545,546,546,547,548,549,549,550,551,552,552,553,554,555,556,556,557,558,559,559,560,561,561,562,563,563,564,565,565,566,567,568,568,569,570,571,571,572,573,574,574,575,576,577,577,578,579,580,580,581,581,582,583,584,584,585,586,586,587,588,588,589,590,591,591,592,593,593,594,595,595,596,596,597,598,599,599,600,601,601,602,603,603,604,605,605,606,607,607,608,609,609,610,611,612,612,613,614,614,615,616,617,617,618,619,619,620,621,621,622,623,624,624,625,626,627,627,628,628,629,630,630,631,632,632,633,634,634,635,636,637,637,638,639,640,641,641,642,643,644,644,645,646,647,647,648,649,650,650,651,652,652,653,654,654,655,656,656,657,658,659,659,660,661,662,662,663,
+		664,665,665,666,667,667,668,669,669,670,671,671,672,673,673,674,675,675,676,677,677,678,678,679,680,681,681,682,683,683,684,685,686,686,687,687,688,689,689,690,690,691,691,692,692,693,693,694,694,695,695,696,696,697,697,698,698,699,699,700,701,701,701,702,702,703,703,704,705,705,706,706,706,707,708,708,709,709,709,710,710,711,711,712,712,712,713,713,714,714,715,715,715,716,716,716,717,717,718,718,718,719,719,719,720,720,721,721,722,722,722,723,723,724,724,724,725,725,725,726,726,726,727,727,727,728,728,728,729,729,729,730,730,730,731,731,731,731,732,732,732,733,733,733,734,734,734,735,735,735,736,736,736,737,737,737,738,738,738,738,738,739,739,739,740,740,740,740,741,741,741,742,742,742,742,743,743,743,743,744,744,744,744,745,745,745,745,746,746,746,746,747,747,747,747,748,748,748,749,749,749,749,749,749,750,750,750,750,750,751,751,751,752,752,753,753,753,754,754,754,754,754,754,754,754,754,754,755,755,755,755,755,756,756,756,757,757,757,757,758,758,759,759,759,759,759,760,760,760,760,760,760,760,760,761,
+		761,761,761,761,762,762,762,762,763,763,763,763,763,763,763,763,764,764,764,764,764,765,765,765,765,766,766,766,767,767,767,767,767,767,768,768,768,768,768,768,769,769,769,769,769,769,770,770,770,770,771,771,771,771,771,771,771,772,772,772,772,772,772,773,773,773,774,774,774,774,775,775,775,775,775,775,776,776,776,776,777,777,777,777,777,778,778,778,778,778,778,778,778,778,779,779,779,780,780,780,780,781,781,781,781,781,781,781,781,781,781,781,782,782,782,782,783,783,783,783,783,783,783,783,783,783,783,783,784,784,784,784,785,785,785,786,786,786,786,786,787,787,787,787,787,787,788,788,788,788,788,788,788,788,788,789,789,789,789,789,789,790,790,790,790,790,790,790,791,791,791,791,791,792,792,792,792,792,793,793,793,793,793,793,793,793,793,793,794,794,794,794,795,795,795,795,795,796,796,796,796,797,797,797,797,797,797,797,797,797,797,798,798,798,799,799,799,799,799,800,800,800,800,800,800,800,800,800,800,800,800,801,801,801,801,802,802,802,803,803,803,803,803,803,803,803,803,803,804,804,804,804,805,805,806,
+		806,806,806,806,806,806,806,807,807,807,807,807,807,808,808,808,808,809,809,809,809,809,809,810,810,810,810,810,810,810,810,810,810,810,810,810,810,811,811,811,811,811,812,812,812,812,812,813,813,813,813,813,814,814,814,814,814,814,814,814,815,815,815,815,815,815,815,815,815,816,816,816,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,818,818,818,818,818,818,819,819,819,819,819,819,819,819,819,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,821,821,821,821,821,821,821,822,822,822,822,822,822,822,822,822,822,822,823,823,823,824,824,824,824,824,824,824,824,824,824,824,824,824,825,825,825,825,826,826,826,826,826,826,826,827,827,827,827,827,827,827,827,828,828,828,828,828,828,828,828,828,828,828,828,828,828,828,829,829,829,829,829,829,829,829,829,829,830,830,830,830,830,830,830,830,830,830,831,831,831,831,832,832,832,832,833,833,833,833,833,833,833,833,833,833,833,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,834,835,835,835,835,835,835,835,835,835,835,835,835,
+		836,836,837,837,838,838,838,838,838,838,838,838,838,838,838,838,838,839,839,839,840,840,840,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,842,842,842,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,843,844,844,845,845,845,845,845,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,846,847,847,847,847,847,847,847,847,848,848,848,848,848,848,848,849,849,849,849,849,849,849,849,849,849,849,850,850,850,850,850,851,851,852,852,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,854,855,855,855,855,855,855,855,856,856,856,856,856,856,857,857,857,857,857,857,857,858,858,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,859,
+		859,859,859,859,859,859,859,859,859,859,859,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,860,861,861,861,861,861,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,862,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,
+		863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,863,
+		863,863,863,863,863,863,863,863,863
+	},
+	{
+		0,8,10,11,11,12,13,13,14,14,15,15,16,16,17,18,19,20,21,22,24,25,27,28,30,31,33,34,35,36,37,38,39,41,42,44,47,50,53,56,60,64,68,73,77,81,85,89,92,96,99,102,105,108,111,114,117,120,122,125,128,130,133,136,138,141,143,146,148,150,153,155,157,160,162,164,166,168,170,173,175,177,179,181,183,185,187,189,191,192,194,196,198,200,202,204,205,207,209,211,212,214,216,217,219,221,222,224,225,227,229,230,232,234,235,237,238,240,242,243,245,246,248,249,251,252,254,255,257,258,260,261,263,264,266,267,269,270,272,273,275,276,278,279,280,282,283,284,286,287,289,290,291,293,294,296,297,298,300,301,302,304,305,306,308,309,310,312,313,314,316,317,318,320,321,322,324,325,326,327,329,330,331,333,334,335,336,337,339,340,341,342,344,345,346,347,349,350,351,352,354,355,356,357,359,360,361,362,364,365,366,367,368,370,371,372,373,374,375,377,378,379,380,381,383,384,385,386,387,388,390,391,392,393,394,395,397,398,399,400,401,403,404,405,406,407,408,409,411,412,413,414,415,416,
+		417,419,420,421,422,423,424,425,426,427,429,430,431,432,433,434,435,437,438,439,440,441,442,443,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,485,486,487,488,489,490,491,492,493,493,494,495,496,497,498,499,500,501,501,502,503,504,505,505,506,507,508,509,510,510,511,512,513,514,515,515,516,517,518,519,519,520,521,522,522,523,524,524,525,526,526,527,528,528,529,530,531,531,532,532,533,534,535,535,536,537,537,538,539,540,540,541,542,542,543,544,544,545,545,546,547,547,548,548,549,550,550,551,552,552,553,554,554,555,556,556,557,557,558,558,559,560,560,561,561,562,562,563,564,564,565,565,566,567,567,568,569,569,570,571,571,572,572,573,573,574,575,575,576,576,577,578,578,579,579,580,581,581,582,582,583,583,584,584,585,585,586,586,587,587,588,589,589,590,590,591,592,592,593,593,594,594,595,596,596,597,598,598,599,599,600,600,601,601,602,603,603,604,604,605,605,606,607,607,608,609,609,610,610,611,612,
+		612,613,613,614,614,615,616,616,617,617,618,618,619,620,620,621,621,622,623,623,624,625,625,626,627,627,628,629,629,630,630,631,632,633,633,634,634,635,636,637,637,638,638,639,640,640,641,642,642,643,643,644,645,645,646,646,647,648,648,649,650,650,651,651,652,653,654,654,655,656,656,657,657,658,658,659,660,660,661,662,662,663,663,664,665,665,666,666,667,668,668,669,669,670,670,671,672,672,672,673,674,674,675,675,676,676,677,677,678,678,679,679,680,681,681,682,682,683,684,684,685,685,686,686,686,687,687,688,688,688,689,690,690,691,691,691,692,692,693,693,694,694,694,695,695,696,696,696,697,697,698,698,699,699,699,700,700,701,701,701,701,702,702,703,703,703,704,704,704,705,705,706,706,706,707,707,707,708,708,708,709,709,710,710,710,711,711,711,711,712,712,712,713,713,713,714,714,714,715,715,715,715,716,716,716,716,716,717,717,717,718,718,719,719,719,720,720,720,720,721,721,721,721,721,722,722,722,722,722,723,723,723,723,724,724,724,724,725,725,725,726,726,726,727,727,727,728,728,728,728,728,729,729,729,729,
+		729,729,730,730,730,730,730,731,731,731,731,732,732,732,732,732,732,733,733,733,734,734,734,734,735,735,735,736,736,736,736,736,736,736,737,737,737,737,737,737,737,738,738,738,738,738,739,739,739,739,740,740,740,740,741,741,741,741,741,742,742,742,742,742,742,743,743,743,743,744,744,744,744,744,744,745,745,745,746,746,746,746,746,746,746,746,747,747,747,747,747,747,747,748,748,748,749,749,749,749,749,750,750,750,750,750,750,750,751,751,751,751,751,751,751,752,752,752,752,752,752,752,752,752,753,753,753,753,754,754,754,754,754,755,755,755,755,755,756,756,756,756,756,756,757,757,757,757,757,757,757,757,758,758,758,758,759,759,759,759,759,760,760,760,760,760,760,760,760,761,761,761,761,761,762,762,762,762,762,762,762,762,763,763,763,763,763,763,763,764,764,764,764,764,765,765,765,765,765,766,766,766,766,766,766,766,766,767,767,767,767,767,768,768,768,768,768,768,768,768,769,769,769,769,769,769,770,770,770,770,771,771,771,771,771,771,771,771,772,772,772,772,772,773,773,773,773,773,774,774,774,774,774,774,774,
+		774,775,775,775,775,775,776,776,776,777,777,777,777,777,777,778,778,778,778,778,778,778,778,779,779,779,779,779,779,779,780,780,780,780,780,780,780,780,780,780,780,780,780,781,781,781,781,781,782,782,782,782,782,782,782,782,782,783,783,783,783,783,783,783,784,784,784,785,785,785,785,785,786,786,786,786,786,786,786,787,787,787,787,787,787,787,787,787,787,787,787,787,787,787,788,788,788,788,788,789,789,789,789,789,789,789,789,789,789,789,789,789,790,790,790,790,790,790,790,790,790,790,790,790,791,791,791,791,791,791,791,791,791,791,791,791,792,792,792,793,793,793,793,794,794,794,794,794,794,794,794,794,794,794,795,795,795,795,796,796,796,796,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,798,798,798,798,798,799,799,799,799,799,799,799,799,799,799,799,799,799,799,800,800,800,800,800,800,800,800,801,801,801,801,801,802,802,802,802,803,803,803,803,803,803,803,803,803,803,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,805,805,805,805,805,805,805,805,805,805,
+		805,806,806,806,806,807,808,808,808,808,808,808,808,808,808,808,808,808,809,809,809,809,809,809,809,809,809,809,809,809,809,809,809,809,810,810,810,810,810,811,811,811,812,812,812,812,812,812,812,812,812,812,812,812,812,812,813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,813,814,814,814,814,814,815,815,815,815,815,816,816,816,816,816,816,816,816,816,816,816,816,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,817,818,818,818,818,819,819,820,820,820,820,820,820,820,820,821,821,821,821,821,821,821,821,821,821,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,822,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,825,825,825,825,825,825,826,826,826,826,826,826,826,826,826,826,827,827,827,827,827,827,827,827,827,827,827,827,827,827,827,827,827,827,827,827,
+		828,828,828,828,828,828,828,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,830,830,830,830,830,830,830,830,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,
+		833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,833,
+		833,833,833,833,833,833,833,833,833
+	},
+	{
+		0,9,10,11,11,12,13,13,13,14,14,14,15,15,16,16,17,18,19,20,21,22,23,25,26,27,29,30,31,32,33,34,35,36,37,37,38,39,40,42,44,46,49,51,55,58,62,66,70,73,77,80,84,87,90,93,96,99,101,104,107,109,112,114,117,119,122,124,126,129,131,133,136,138,140,142,144,146,148,151,153,155,157,159,161,162,164,166,168,170,172,174,175,177,179,181,182,184,186,188,189,191,193,194,196,197,199,200,202,204,205,207,208,210,211,213,214,216,217,219,220,222,223,225,226,227,229,230,232,233,234,236,237,239,240,241,243,244,245,247,248,249,251,252,253,255,256,257,259,260,261,262,264,265,266,268,269,270,272,273,274,275,276,278,279,280,281,283,284,285,286,288,289,290,291,292,294,295,296,297,298,300,301,302,303,304,305,307,308,309,310,311,312,314,315,316,317,318,319,320,322,323,324,325,326,327,329,330,331,332,333,334,335,337,338,339,340,341,342,343,344,345,346,347,349,350,351,352,353,354,355,356,357,358,360,361,362,363,364,365,366,367,368,369,370,371,373,374,375,376,377,378,379,380,
+		381,382,383,384,385,386,387,388,389,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,444,445,446,447,448,449,450,451,452,453,454,454,455,456,457,458,459,460,461,462,463,464,465,466,467,467,468,469,470,471,472,472,473,474,475,476,477,477,478,479,480,481,482,482,483,484,485,486,487,487,488,489,489,490,491,492,492,493,494,495,496,496,497,498,498,499,500,501,501,502,503,503,504,505,505,506,507,507,508,509,509,510,511,511,512,512,513,514,514,515,516,516,517,518,518,519,520,520,521,521,522,522,523,523,524,524,525,526,526,527,528,528,529,529,530,531,531,532,532,533,533,534,534,535,536,536,537,537,538,538,539,539,540,540,541,542,542,543,543,544,544,545,545,546,546,547,547,548,548,549,549,550,550,551,551,552,552,553,553,554,554,555,556,556,556,557,557,558,559,559,559,560,560,561,561,562,562,563,563,564,564,565,565,566,566,567,567,568,568,569,569,570,
+		570,570,571,571,572,573,573,574,574,575,575,576,576,576,577,577,578,578,579,579,580,580,581,581,582,583,583,584,584,585,585,586,586,587,587,588,588,589,589,590,590,591,591,591,592,592,593,593,594,594,595,595,596,596,597,597,598,598,599,599,600,600,601,601,602,602,603,603,604,604,605,606,606,607,607,608,608,609,610,610,611,611,612,612,613,613,614,614,615,615,615,616,617,617,618,618,619,619,620,620,621,622,622,623,623,624,625,625,626,626,627,628,628,629,629,630,630,631,632,632,633,633,634,634,635,636,636,637,637,638,638,639,639,640,640,641,642,642,643,644,644,645,645,646,646,647,648,648,649,649,650,651,651,652,652,653,653,654,654,655,655,656,656,657,657,658,658,659,660,660,661,661,662,662,663,663,664,665,665,665,666,666,667,667,668,668,669,669,669,670,670,671,671,672,672,673,673,673,674,674,675,675,675,676,676,677,677,677,678,678,679,679,680,680,681,681,682,682,682,683,683,683,684,684,684,685,685,685,685,686,686,686,686,687,687,687,688,688,689,689,690,690,690,691,692,692,692,693,693,693,693,694,694,694,694,
+		694,695,695,695,695,696,696,696,697,697,697,697,698,698,698,698,699,699,699,699,700,700,700,701,701,701,702,702,702,703,703,703,703,703,703,703,704,704,704,704,704,705,705,705,706,706,706,706,706,707,707,708,708,708,708,708,709,709,709,710,710,710,710,710,710,711,711,711,711,711,712,712,712,712,712,713,713,713,713,713,714,714,714,714,715,715,715,715,715,715,715,716,716,716,716,716,717,717,717,718,718,718,719,719,719,719,719,720,720,720,720,720,720,720,720,720,720,720,720,721,721,721,721,721,721,722,722,722,723,723,723,723,724,724,724,724,724,724,724,724,725,725,725,725,726,726,726,726,726,727,727,727,727,727,727,727,728,728,728,728,728,728,729,729,729,729,729,729,729,729,730,730,730,730,730,730,731,731,731,731,731,731,731,732,732,732,732,732,733,733,733,733,733,733,734,734,734,734,734,734,735,735,735,735,735,735,736,736,736,736,736,736,737,737,737,737,737,737,737,738,738,738,738,738,738,739,739,739,739,739,739,739,740,740,740,740,740,741,741,741,741,741,741,741,741,742,742,742,742,742,742,743,743,743,743,
+		743,744,744,744,744,744,744,745,745,745,745,745,745,746,746,746,746,746,747,747,747,747,747,747,747,748,748,748,748,748,748,748,748,748,749,749,749,749,749,749,749,749,749,749,749,749,750,750,750,750,750,750,751,751,751,751,751,751,752,752,752,752,752,752,752,753,753,753,753,753,753,753,753,753,754,754,754,754,754,754,754,755,755,755,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,758,758,758,758,758,758,758,758,758,759,759,759,759,759,759,759,760,760,760,760,760,760,760,761,761,761,761,761,762,762,762,762,762,762,762,762,762,763,763,763,763,763,763,763,763,763,763,763,763,764,764,764,764,764,764,764,764,765,765,765,765,765,765,766,766,766,766,766,766,766,766,766,766,766,766,766,766,767,767,767,767,767,767,767,767,767,767,767,767,767,768,768,769,769,769,769,769,769,769,769,769,769,770,770,770,770,770,770,771,771,771,771,771,771,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,773,773,773,773,773,
+		773,773,773,774,774,774,774,774,775,775,775,775,776,776,776,776,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,778,778,779,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,781,781,781,781,781,781,781,781,781,781,781,781,781,782,782,782,782,783,783,783,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,784,785,785,785,785,785,785,785,785,785,785,785,786,786,786,786,787,787,787,787,788,788,788,788,788,788,788,788,788,788,788,788,788,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,791,791,791,791,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,792,793,793,793,793,793,793,793,794,794,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,795,
+		795,795,796,796,796,796,796,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,798,798,798,798,798,799,799,799,799,799,799,799,799,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,800,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
+		801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,
+		801,801,801,801,801,801,801,801,801
+	},
+	{
+		0,9,10,11,11,11,13,13,13,13,13,13,14,14,14,15,15,16,17,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,35,36,36,37,38,39,40,41,43,45,48,50,53,56,60,63,66,70,73,76,79,82,85,87,90,92,95,97,100,102,104,107,109,111,113,115,117,119,122,124,126,128,130,132,134,136,138,140,142,144,145,147,149,151,153,155,156,158,160,161,163,165,167,168,170,171,173,175,176,178,179,181,182,184,185,187,188,190,191,193,194,195,197,198,200,201,202,204,205,206,208,209,210,212,213,214,216,217,218,220,221,222,223,225,226,227,229,230,231,232,234,235,236,237,239,240,241,242,243,245,246,247,248,249,250,252,253,254,255,256,257,259,260,261,262,263,264,265,267,268,269,270,271,272,273,275,276,277,278,279,280,281,282,283,284,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,
+		350,351,352,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,383,384,385,386,387,388,389,390,391,392,393,394,394,395,396,397,398,399,400,401,402,403,404,405,405,406,407,408,409,410,411,412,413,414,414,415,416,417,418,419,420,420,421,422,423,424,425,425,426,427,428,429,430,431,432,432,433,434,435,436,437,438,439,439,440,441,442,443,444,445,446,446,447,448,449,450,451,451,452,453,454,454,455,456,457,458,458,459,460,461,461,462,463,464,465,465,466,467,467,468,469,470,471,471,472,473,474,474,475,476,476,477,478,479,479,480,481,481,482,483,483,484,485,485,486,487,487,488,489,489,490,491,491,492,492,493,494,494,495,495,496,497,497,498,499,499,500,501,501,502,502,503,503,504,504,505,506,506,507,507,508,508,509,510,510,511,511,512,512,513,513,514,514,515,515,516,516,517,517,518,518,519,519,519,520,520,521,521,522,523,523,524,524,525,525,526,526,527,527,528,528,529,529,529,530,530,531,531,532,532,533,533,534,534,535,535,535,536,536,537,
+		537,538,538,538,539,539,540,540,540,541,541,542,542,542,543,543,544,544,545,545,546,546,547,547,547,548,548,549,549,550,550,551,551,552,552,553,553,554,554,554,555,555,556,556,556,557,557,557,558,558,558,559,559,560,560,561,561,561,562,562,563,563,564,564,565,565,565,566,566,567,567,568,568,569,569,569,570,570,571,571,571,572,572,573,573,573,574,574,574,575,575,576,576,577,577,577,578,578,578,579,579,580,580,581,581,581,582,582,583,583,584,584,585,585,586,586,587,587,588,588,588,589,589,590,590,591,591,592,592,592,593,593,593,594,595,595,596,596,596,597,597,598,598,599,599,600,600,601,601,602,602,603,603,604,604,605,605,606,606,607,607,608,608,609,609,610,610,611,611,611,612,613,613,614,614,615,615,616,616,617,618,618,619,619,620,620,621,621,622,622,623,623,624,624,625,625,626,627,627,628,628,629,629,630,630,631,631,632,632,633,633,634,634,635,636,636,637,637,638,638,639,640,640,641,641,641,642,642,643,643,644,644,645,646,646,646,647,647,648,649,649,650,650,651,651,652,652,652,653,653,654,654,655,655,656,
+		656,656,657,657,658,658,659,659,660,660,660,660,661,661,662,662,663,663,663,664,664,665,665,666,666,667,667,667,668,668,668,668,669,669,669,669,670,670,670,671,671,672,672,672,673,673,674,674,674,675,675,675,675,675,675,676,676,677,677,677,677,678,678,679,679,679,679,679,680,680,681,681,681,681,682,682,682,683,683,683,683,683,684,684,684,684,685,685,685,686,686,686,687,687,687,687,687,688,688,688,688,689,689,689,689,690,690,690,690,690,690,691,691,691,691,691,691,692,692,692,692,692,693,693,693,693,694,694,694,694,694,695,695,695,695,695,696,696,696,696,697,697,697,698,698,698,698,698,698,699,699,699,699,699,700,700,700,700,700,700,700,701,701,701,701,701,701,702,702,702,702,702,703,703,703,703,703,704,704,704,704,704,704,704,705,705,705,705,705,705,705,706,706,706,707,707,707,707,707,707,707,708,708,708,708,708,709,709,709,709,709,710,710,710,710,710,710,710,710,711,711,711,711,711,711,711,711,712,712,712,712,712,713,713,713,713,713,713,713,714,714,714,714,714,715,715,715,715,715,716,716,716,716,716,716,
+		717,717,717,717,717,718,718,718,718,718,718,718,719,719,719,719,719,719,719,720,720,720,720,720,721,721,721,721,721,721,721,721,721,721,721,721,721,722,722,722,722,722,722,722,723,723,723,723,723,723,724,724,724,724,724,724,724,725,725,725,725,725,725,725,725,725,726,726,726,726,727,727,727,727,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,729,729,729,729,729,729,729,730,730,730,730,730,730,730,730,730,730,730,730,730,730,730,731,731,731,731,731,731,731,732,732,732,732,732,732,733,733,733,733,733,733,733,733,733,733,733,733,734,734,734,734,734,734,734,734,734,734,734,734,734,734,735,735,736,736,736,736,736,737,737,737,737,737,737,737,737,737,737,737,737,737,738,738,738,738,738,738,738,738,738,739,739,739,739,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,741,741,741,741,741,741,741,742,742,742,742,742,742,742,742,743,743,743,743,743,743,743,744,744,744,744,744,744,744,744,744,744,744,744,744,744,744,745,745,745,745,745,745,745,745,745,745,745,746,
+		746,746,746,747,747,747,747,747,747,747,747,747,748,748,748,748,748,748,749,749,749,749,749,749,749,749,749,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,750,751,751,751,751,751,752,752,752,752,752,752,752,752,752,752,752,752,752,753,753,753,753,753,753,753,753,753,753,753,753,754,754,754,754,754,754,754,754,754,755,755,755,755,755,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,757,757,757,757,757,757,757,757,757,758,758,758,758,759,759,759,759,759,760,760,760,760,760,760,760,760,760,760,760,760,760,760,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,761,762,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,765,765,765,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,766,767,767,767,767,767,767,767,767,767,767,767,767,767,
+		768,768,768,768,768,768,768,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,769,770,770,770,770,770,770,770,770,770,770,770,770,770,770,771,771,771,771,771,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,
+		774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,774,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,
+		775,775,775,775,775,775,775,775,775
+	},
+	{
+		0,9,10,11,11,11,13,13,13,13,13,13,13,13,14,14,14,15,15,16,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,32,33,34,34,35,35,36,36,37,38,39,40,42,43,46,48,51,53,56,59,62,65,68,71,74,77,80,82,84,87,89,91,94,96,98,100,102,104,106,109,110,112,114,116,118,120,122,124,126,127,129,131,133,135,137,138,140,142,143,145,147,148,150,152,153,155,157,158,160,161,163,164,166,167,169,170,172,173,174,176,177,179,180,181,183,184,185,187,188,189,191,192,193,195,196,197,198,200,201,202,203,205,206,207,208,210,211,212,213,214,215,217,218,219,220,221,222,223,225,226,227,228,229,230,231,232,234,235,236,237,238,239,240,241,242,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,319,320,321,322,323,324,
+		325,326,327,328,329,330,331,332,333,333,334,335,336,337,338,339,340,341,342,343,343,344,345,346,347,348,349,350,351,352,352,353,354,355,356,357,358,359,360,360,361,362,363,364,365,366,366,367,368,369,370,371,372,373,373,374,375,376,377,378,379,379,380,381,382,383,384,384,385,386,387,388,388,389,390,391,392,393,394,394,395,396,397,398,398,399,400,401,402,402,403,404,405,406,406,407,408,409,410,410,411,412,413,414,414,415,416,417,418,418,419,420,421,422,422,423,424,425,425,426,427,428,428,429,430,431,432,432,433,434,435,435,436,437,438,439,439,440,441,442,442,443,444,444,445,446,447,447,448,449,450,450,451,452,453,453,454,455,456,456,457,458,458,459,460,460,461,462,462,463,464,464,465,466,466,467,468,469,469,470,471,471,472,473,473,474,475,475,476,476,477,478,478,479,479,480,481,481,482,482,483,484,484,485,485,486,487,487,488,488,489,489,490,490,491,491,492,492,493,493,494,494,495,495,496,496,497,498,498,499,499,500,500,501,501,502,502,503,503,504,504,505,505,506,506,507,507,507,508,508,509,509,510,510,510,
+		511,511,512,512,513,513,514,514,515,515,515,516,516,517,517,518,518,518,519,519,520,520,521,521,522,522,522,523,523,524,524,525,525,525,526,526,527,527,528,528,528,529,529,529,530,530,531,531,531,532,532,532,533,533,534,534,534,535,535,535,536,536,536,537,537,537,538,538,539,539,540,540,540,541,541,542,542,542,543,543,543,544,544,544,545,545,545,546,546,546,547,547,548,548,548,549,549,549,550,550,551,551,551,551,552,552,552,553,553,554,554,554,555,555,556,556,556,557,557,557,557,558,558,559,559,559,560,560,561,561,561,562,562,562,563,563,563,564,564,564,565,565,566,566,567,567,567,568,568,568,569,569,569,570,570,571,571,571,572,572,572,572,573,573,574,574,574,575,575,576,576,576,577,577,578,578,578,579,579,580,580,580,581,581,582,582,583,583,583,584,584,584,585,585,586,586,586,587,587,588,588,589,589,590,590,590,591,591,592,592,593,593,594,594,595,595,596,596,597,597,597,598,598,598,599,599,599,600,600,601,601,602,602,603,604,604,605,605,606,606,607,607,608,608,609,609,610,610,611,611,612,613,613,614,614,
+		615,615,615,616,616,617,617,618,619,619,620,620,621,621,622,622,623,623,623,624,624,625,625,626,626,627,628,628,629,629,630,630,631,631,631,632,632,633,633,634,634,635,635,636,636,637,637,638,638,639,639,640,640,640,641,641,642,642,642,643,643,644,644,645,645,646,646,647,647,648,648,649,649,650,650,650,651,651,651,652,652,652,653,653,653,654,654,654,655,655,656,656,656,657,657,658,658,658,659,659,659,660,660,660,661,661,661,661,662,662,663,663,663,663,664,664,664,664,665,665,665,665,666,666,667,667,667,667,667,668,668,668,669,669,669,669,670,670,670,671,671,671,671,672,672,672,673,673,673,673,674,674,674,675,675,675,675,676,676,676,676,676,677,677,677,677,677,678,678,678,678,679,679,679,679,679,679,680,680,680,680,680,681,681,681,681,682,682,682,683,683,683,683,683,683,684,684,684,684,685,685,685,685,685,685,686,686,686,686,686,686,687,687,687,687,687,688,688,688,688,689,689,689,689,689,689,689,690,690,690,690,690,691,691,691,691,692,692,692,692,692,692,693,693,693,693,693,693,694,694,694,694,694,694,695,
+		695,695,695,695,695,696,696,696,696,696,696,697,697,697,697,697,698,698,698,698,698,698,698,698,698,699,699,699,699,699,699,700,700,700,700,700,700,700,701,701,701,701,701,701,702,702,702,702,702,702,702,703,703,703,703,703,703,703,703,703,703,703,703,703,703,704,704,704,704,705,705,705,706,706,706,706,706,706,707,707,707,707,707,707,707,707,707,707,707,707,707,708,708,708,708,708,708,709,709,709,709,709,709,709,709,709,709,709,709,709,710,710,710,710,710,710,710,710,710,710,710,710,711,711,711,711,711,711,711,712,712,712,712,712,712,712,712,712,712,712,713,713,714,714,714,714,714,714,714,714,715,715,715,715,715,715,715,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,717,717,717,717,717,717,717,717,717,717,717,717,718,718,718,718,718,718,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,720,720,720,721,721,721,721,721,721,721,721,721,721,722,722,722,722,722,722,722,723,723,723,723,723,723,723,723,723,723,723,723,723,723,723,723,724,724,724,724,724,724,724,724,724,725,725,725,725,
+		725,725,725,726,726,726,726,726,726,726,727,727,727,727,727,727,727,728,728,728,728,728,728,728,728,728,728,728,729,729,729,729,729,729,729,729,729,729,729,729,729,729,729,730,730,730,730,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,732,732,732,732,732,733,733,733,733,733,733,733,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,734,735,735,735,735,736,736,736,736,736,736,736,736,736,736,736,737,737,737,737,738,738,738,738,738,738,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,739,740,740,740,740,740,740,740,740,740,740,740,740,740,740,740,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,741,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,744,744,744,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,745,746,746,746,746,747,747,747,747,747,747,747,747,747,747,747,747,747,747,
+		747,747,747,747,747,747,747,747,747,747,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,749,749,749,750,750,750,750,750,750,750,750,750,751,751,751,751,751,751,751,751,751,751,751,751,751,751,751,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,753,753,753,753,753,753,753,753,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,
+		754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,754,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,755,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,756,
+		756,756,756,756,756,756,756,756,756
+	},
+	{
+		0,4,7,9,10,11,12,13,13,13,14,14,14,14,14,14,14,14,14,14,14,15,15,16,16,17,17,18,19,19,20,21,22,23,24,25,25,26,27,28,29,29,30,31,31,32,32,33,33,34,34,35,35,36,37,38,40,41,43,45,48,50,53,55,58,61,63,66,68,71,73,75,77,79,82,83,85,87,89,91,93,95,96,98,100,101,103,105,107,108,110,111,113,115,116,118,120,121,123,124,126,128,129,131,132,134,135,137,138,140,141,143,144,145,147,148,150,151,152,154,155,156,158,159,160,162,163,164,165,167,168,169,170,172,173,174,175,176,178,179,180,181,182,183,184,186,187,188,189,190,191,192,193,194,195,196,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,229,230,231,232,233,234,235,236,237,238,239,240,240,241,242,243,244,245,246,247,248,249,249,250,251,252,253,254,255,256,257,257,258,259,260,261,262,263,264,265,265,266,267,268,269,270,271,271,272,273,274,275,276,277,278,278,279,280,281,282,283,284,284,285,286,287,
+		288,289,289,290,291,292,293,294,295,295,296,297,298,299,300,300,301,302,303,304,305,305,306,307,308,309,309,310,311,312,313,314,314,315,316,317,317,318,319,320,321,321,322,323,324,325,325,326,327,328,328,329,330,331,332,332,333,334,335,335,336,337,338,338,339,340,341,341,342,343,344,344,345,346,347,347,348,349,350,350,351,352,353,353,354,355,356,356,357,358,358,359,360,360,361,362,363,363,364,365,366,366,367,368,368,369,370,370,371,372,373,373,374,375,375,376,377,377,378,379,379,380,381,381,382,383,384,384,385,386,386,387,388,388,389,390,390,391,392,393,393,394,395,395,396,397,397,398,398,399,400,400,401,402,402,403,404,404,405,406,406,407,408,408,409,410,410,411,412,412,413,414,414,415,416,416,417,418,418,419,420,420,421,422,423,423,424,425,425,426,426,427,427,428,429,429,430,430,431,432,432,433,434,434,435,436,436,437,437,438,439,439,440,441,441,442,443,443,444,445,445,446,447,447,448,448,449,450,450,451,451,452,452,453,454,454,455,456,456,457,457,458,459,459,460,460,461,461,462,462,463,463,464,465,465,
+		466,466,467,467,468,468,469,469,470,471,471,472,472,473,473,474,474,475,475,476,476,477,477,478,478,479,479,480,481,481,481,482,482,483,483,484,484,485,485,485,486,486,487,487,488,488,488,489,489,490,490,491,491,491,492,492,492,493,493,494,494,495,495,496,496,496,497,497,497,498,498,498,499,499,500,500,500,501,501,502,502,503,503,503,504,504,504,504,505,505,506,506,506,507,507,508,508,508,509,509,509,510,510,510,511,511,511,511,512,512,512,512,513,513,513,514,514,515,515,515,516,516,516,517,517,517,517,518,518,518,519,519,519,520,520,520,521,521,521,522,522,522,522,523,523,523,523,524,524,524,525,525,525,525,526,526,526,527,527,527,527,528,528,529,529,529,529,530,530,530,530,531,531,531,531,532,532,532,533,533,533,534,534,534,535,535,535,536,536,536,536,537,537,537,537,537,538,538,538,538,539,539,539,540,540,540,541,541,541,542,542,542,543,543,543,544,544,544,544,544,544,545,545,545,545,546,546,546,547,547,547,548,548,548,549,549,549,550,550,550,550,551,551,551,552,552,552,553,553,553,553,554,554,554,554,
+		555,555,555,555,556,556,556,556,557,557,557,558,558,558,559,559,559,560,560,560,561,561,561,561,562,562,562,563,563,564,564,564,564,565,565,565,566,566,566,566,567,567,567,568,568,568,569,569,569,570,570,571,571,571,571,572,572,573,573,573,574,574,574,575,575,575,575,576,576,577,577,577,578,578,579,579,580,580,581,581,581,582,582,583,583,583,584,584,585,585,585,586,586,586,587,587,588,588,588,588,589,590,590,591,591,591,592,592,592,593,593,594,594,594,595,595,596,596,597,597,597,598,598,599,600,600,601,601,601,602,602,603,603,603,604,604,604,605,605,606,606,607,608,608,609,610,610,611,611,611,612,612,613,613,614,614,615,615,615,616,616,617,617,618,618,618,619,619,620,620,621,621,622,622,623,623,623,624,624,625,625,626,626,626,627,627,627,628,628,629,629,630,630,631,631,632,632,633,633,633,634,634,634,635,635,636,636,636,637,637,637,638,638,638,639,639,639,640,640,640,641,641,641,642,642,642,642,643,643,644,644,645,645,645,646,646,646,647,647,648,648,648,648,649,649,649,650,650,650,651,651,651,652,652,652,
+		653,653,653,654,654,654,654,654,655,655,656,656,656,656,656,657,657,657,657,658,658,658,658,659,659,659,659,660,660,660,660,660,661,661,661,661,661,661,661,661,661,662,662,662,663,663,663,664,664,664,665,665,665,665,665,665,665,666,666,666,666,666,666,666,667,667,667,668,668,668,668,668,669,669,669,669,670,670,670,670,670,670,670,670,670,671,671,671,671,671,671,671,671,672,672,672,672,672,672,672,673,673,673,673,674,674,674,674,674,674,674,674,674,674,675,675,675,676,676,676,676,676,676,677,677,677,677,677,677,677,677,677,677,678,678,678,678,678,678,679,679,679,679,679,680,680,680,680,680,680,680,680,680,681,681,681,681,681,681,681,681,681,682,682,682,682,682,682,682,682,683,683,683,683,683,683,684,684,684,684,684,684,684,684,684,684,685,685,685,685,685,685,685,685,685,685,686,686,686,686,686,686,686,686,686,686,687,687,687,687,687,688,688,688,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,690,690,690,690,691,691,691,691,691,691,691,691,691,692,692,692,692,692,692,692,692,692,
+		692,692,692,692,693,693,693,693,694,694,694,694,694,694,694,695,695,695,695,695,695,695,695,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,697,697,697,697,698,698,698,698,698,698,698,698,698,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,700,700,700,700,700,700,700,701,701,701,701,701,701,701,701,701,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,703,703,703,703,704,704,704,704,704,704,704,704,704,704,704,704,704,705,705,705,705,705,706,706,706,706,706,706,706,706,706,706,706,706,706,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,707,708,708,708,708,708,708,708,708,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,711,711,711,711,711,711,711,712,712,712,712,712,712,712,712,713,713,713,713,713,713,713,713,713,714,714,714,714,714,714,714,714,714,714,714,714,714,714,
+		714,714,714,714,714,714,714,714,715,715,715,715,715,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,716,717,717,717,717,717,717,717,718,718,718,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,720,720,720,720,721,721,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,722,723,723,723,723,723,723,723,723,
+		723,723,723,723,723,723,723,723,723,723,723,723,723,723,723,723,724,724,724,724,724,724,724,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,
+		726,726,726,726,726,726,726,726,727
+	},
+	{
+		0,4,8,9,10,11,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,15,15,16,16,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,28,29,30,30,31,31,32,32,33,33,33,34,34,35,35,36,37,38,39,40,42,44,46,48,50,52,55,57,60,62,64,67,69,71,73,75,77,79,81,82,84,86,87,89,91,92,94,96,97,99,100,102,103,105,107,108,110,111,113,114,116,117,119,120,122,123,125,126,127,129,130,131,133,134,136,137,138,140,141,142,143,145,146,147,149,150,151,152,153,155,156,157,158,159,161,162,163,164,165,166,167,168,170,171,172,173,174,175,176,177,178,179,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,195,196,197,198,199,200,201,202,203,204,205,206,207,208,208,209,210,211,212,213,214,215,216,217,217,218,219,220,221,222,223,224,224,225,226,227,228,229,230,230,231,232,233,234,235,235,236,237,238,239,240,241,241,242,243,244,245,246,246,247,248,249,250,250,251,252,253,254,255,255,256,257,258,259,259,260,261,262,263,263,264,265,266,
+		267,268,268,269,270,271,272,272,273,274,275,275,276,277,278,279,279,280,281,282,282,283,284,285,286,286,287,288,289,290,290,291,292,293,293,294,295,295,296,297,298,298,299,300,301,301,302,303,304,305,305,306,307,307,308,309,310,310,311,312,312,313,314,315,315,316,317,318,318,319,320,321,321,322,323,323,324,325,325,326,327,327,328,329,329,330,331,332,332,333,334,334,335,336,336,337,338,338,339,340,341,341,342,343,343,344,345,345,346,347,347,348,349,349,350,351,351,352,353,353,354,354,355,356,356,357,358,358,359,360,360,361,362,362,363,364,364,365,366,366,367,367,368,369,369,370,370,371,372,372,373,374,374,375,375,376,377,377,378,379,379,380,380,381,382,382,383,384,384,385,386,386,387,387,388,389,389,390,390,391,392,392,393,394,394,395,396,396,397,397,398,399,399,400,400,401,402,402,403,403,404,404,405,406,406,407,407,408,409,409,410,411,411,412,412,413,414,414,415,415,416,416,417,418,418,419,420,420,421,422,422,423,423,424,424,425,426,426,427,427,428,428,429,430,430,431,432,432,433,433,434,434,435,436,436,
+		437,437,438,438,439,439,440,441,441,442,442,443,443,444,444,445,446,446,447,447,448,449,449,450,450,451,451,452,452,453,453,454,455,455,456,456,457,457,458,458,459,459,460,460,461,461,462,462,463,463,464,464,464,465,465,466,466,467,467,468,468,469,469,470,470,470,471,471,472,472,473,473,474,474,475,475,476,476,476,477,477,478,478,479,479,479,480,480,481,481,481,482,482,482,483,483,483,484,484,484,485,485,485,486,486,487,487,487,488,488,489,489,489,490,490,490,491,491,491,492,492,492,493,493,493,494,494,494,495,495,496,496,496,496,497,497,497,498,498,498,498,499,499,499,500,500,500,501,501,501,502,502,502,502,503,503,503,503,504,504,504,505,505,505,506,506,506,506,507,507,507,507,508,508,508,508,509,509,509,509,510,510,510,511,511,511,511,512,512,512,513,513,513,513,514,514,514,515,515,515,515,515,516,516,516,516,517,517,517,518,518,518,518,519,519,519,520,520,520,520,521,521,521,521,521,522,522,522,522,522,523,523,523,523,524,524,524,524,525,525,525,526,526,526,526,527,527,527,528,528,528,528,529,529,529,
+		529,529,530,530,530,530,530,531,531,531,531,532,532,532,532,533,533,533,534,534,534,535,535,535,535,536,536,536,536,537,537,537,537,538,538,538,538,539,539,539,539,539,540,540,540,541,541,541,541,542,542,542,542,543,543,543,543,543,544,544,544,545,545,545,546,546,547,547,547,547,548,548,548,549,549,549,549,550,550,550,551,551,551,551,552,552,552,553,553,553,553,554,554,554,555,555,555,555,556,556,556,556,557,557,557,558,558,558,559,559,559,559,560,560,560,561,561,561,561,562,562,562,563,563,563,564,564,565,565,565,565,566,566,567,567,567,568,568,568,569,569,570,570,570,571,571,572,572,572,572,573,573,573,574,574,575,575,575,576,576,577,577,578,578,578,578,579,579,580,580,581,581,581,582,582,582,583,583,584,584,584,585,585,586,586,587,587,588,588,589,589,589,590,590,591,591,591,592,592,593,593,594,594,595,595,596,596,597,597,597,598,598,599,599,599,600,600,601,601,602,603,603,603,604,604,605,605,605,606,606,606,607,607,608,608,609,609,610,610,611,611,612,612,612,613,613,614,614,615,615,616,616,616,617,618,
+		618,618,619,619,620,620,620,621,621,621,622,622,622,623,623,624,624,624,625,625,626,626,626,627,627,628,628,628,628,628,629,629,629,629,630,630,631,631,631,632,632,632,633,633,633,634,634,634,635,635,635,636,636,637,637,637,637,637,638,638,638,638,638,638,639,639,640,640,640,641,641,641,642,642,642,642,643,643,643,643,644,644,644,644,644,644,644,645,645,645,645,645,646,646,646,647,647,647,647,647,648,648,648,648,648,648,648,649,649,649,650,650,650,650,650,650,651,651,651,651,651,651,652,652,652,652,653,653,653,653,653,653,654,654,654,654,655,655,655,655,655,656,656,656,656,656,656,657,657,657,657,657,657,658,658,658,658,658,658,659,659,659,659,659,659,660,660,660,660,660,660,660,660,661,661,661,661,661,661,662,662,662,662,662,662,662,662,662,662,662,663,663,663,663,663,664,664,664,664,664,664,664,664,664,664,664,665,665,665,665,665,665,666,666,666,666,666,666,666,666,667,667,667,667,667,668,668,668,668,668,669,669,669,669,669,669,669,669,669,669,669,669,670,670,670,670,670,670,670,670,670,670,671,671,671,
+		671,671,672,672,672,672,672,672,672,673,673,673,673,673,673,673,673,673,674,674,674,674,674,674,674,674,674,674,675,675,675,675,675,675,676,676,676,676,676,676,676,676,676,676,676,676,676,677,677,677,677,677,677,677,677,677,677,677,677,677,677,678,678,678,678,678,678,678,678,678,678,679,679,679,679,680,680,680,680,680,680,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,682,682,682,682,683,683,683,683,683,683,683,683,684,684,684,684,684,684,684,684,684,684,684,684,684,685,685,685,685,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,687,687,687,687,687,687,687,687,687,687,687,687,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,688,689,689,689,689,689,689,689,689,689,689,689,689,689,689,689,690,690,690,690,690,690,690,690,690,690,690,690,690,690,691,691,691,691,691,691,691,691,691,691,691,691,691,691,692,692,692,692,692,692,692,692,692,692,692,692,692,692,693,693,693,693,693,693,693,693,694,694,694,694,
+		694,694,694,694,694,694,694,694,694,694,694,694,694,694,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695,696,696,696,696,696,696,697,697,697,697,697,697,697,697,698,698,698,698,698,698,698,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,700,700,700,700,700,700,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,701,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,703,703,703,703,
+		703,703,703,703,703,703,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,704,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,706,
+		706,706,706,706,706,706,706,706,706
+	},
+	{
+		0,0,5,7,9,9,11,12,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,26,27,28,28,29,29,30,30,31,31,31,32,32,32,33,33,33,34,35,35,36,37,39,40,42,43,45,47,49,51,53,56,58,60,62,64,66,68,70,71,73,75,76,78,80,81,83,84,86,87,88,90,91,93,94,95,97,98,99,101,102,104,105,106,108,109,110,111,113,114,115,117,118,119,121,122,123,124,126,127,128,129,130,132,133,134,135,137,138,139,140,141,142,143,145,146,147,148,149,150,151,152,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,169,170,171,172,173,174,175,176,177,178,179,180,180,181,182,183,184,185,186,187,187,188,189,190,191,192,193,193,194,195,196,197,198,199,199,200,201,202,203,203,204,205,206,207,208,208,209,210,211,212,212,213,214,215,216,216,217,218,219,220,220,221,222,223,223,224,225,226,226,227,228,229,229,230,231,232,232,233,234,235,235,236,237,238,238,239,240,240,241,
+		242,243,243,244,245,246,246,247,248,249,249,250,251,252,252,253,254,254,255,256,257,257,258,259,260,260,261,262,262,263,264,264,265,266,266,267,268,268,269,270,270,271,272,273,273,274,275,275,276,277,277,278,279,279,280,281,281,282,283,284,284,285,285,286,287,287,288,289,289,290,291,291,292,293,293,294,294,295,296,296,297,298,298,299,300,300,301,302,302,303,303,304,305,305,306,306,307,308,308,309,310,311,311,312,312,313,314,314,315,315,316,317,317,318,319,319,320,320,321,321,322,322,323,324,324,325,325,326,326,327,328,328,329,330,330,331,332,332,333,333,334,335,335,336,336,337,337,338,338,339,339,340,341,341,342,342,343,343,344,345,345,346,346,347,347,348,348,349,350,350,351,351,352,352,353,353,354,355,355,356,356,357,357,358,359,359,360,360,361,361,362,363,363,364,364,365,365,366,366,367,367,368,369,369,370,370,371,371,372,373,373,374,374,375,375,376,376,377,377,378,378,379,379,380,380,381,381,382,383,383,384,384,385,385,386,386,387,388,388,389,389,390,390,391,391,392,392,393,393,394,394,395,395,396,396,
+		397,397,398,398,399,399,400,400,401,401,402,402,403,403,404,404,405,405,406,407,407,408,408,409,410,410,411,411,412,412,413,413,414,414,415,415,416,416,417,417,418,419,419,419,420,421,421,422,422,423,423,424,424,425,425,426,426,427,427,427,428,429,429,430,430,431,431,432,432,433,433,434,434,435,435,436,436,437,437,438,439,439,440,440,441,441,442,442,443,443,443,444,444,445,445,446,446,447,447,447,448,448,449,450,450,451,451,452,452,452,453,453,454,454,455,455,456,456,456,457,457,458,458,459,459,460,460,460,461,461,462,462,463,463,463,464,464,464,465,465,466,466,466,467,467,468,468,468,469,469,470,470,470,471,471,472,472,472,473,473,473,474,474,474,475,475,475,476,476,477,477,477,477,478,478,478,479,479,479,480,480,480,481,481,481,482,482,482,483,483,483,483,484,484,484,485,485,485,485,486,486,486,487,487,487,487,488,488,488,488,489,489,489,489,490,490,490,491,491,491,491,492,492,492,492,493,493,493,493,494,494,494,494,495,495,495,495,496,496,496,497,497,497,497,498,498,498,498,499,499,499,499,499,499,499,
+		500,500,500,500,500,501,501,501,502,502,502,503,503,503,503,504,504,504,504,504,505,505,505,506,506,506,506,507,507,507,507,507,507,507,508,508,508,508,508,508,509,509,509,510,510,510,510,510,510,511,511,511,511,511,512,512,512,512,513,513,513,513,513,514,514,514,514,515,515,515,515,515,516,516,516,516,517,517,517,517,518,518,518,518,518,519,519,519,519,520,520,520,520,521,521,521,521,521,521,522,522,522,522,522,523,523,523,523,523,524,524,524,524,524,525,525,525,525,526,526,526,526,526,526,527,527,527,527,527,527,528,528,528,528,529,529,529,529,529,530,530,530,530,531,531,531,532,532,532,533,533,534,534,534,534,534,534,534,535,535,535,535,535,535,536,536,536,537,537,537,538,538,538,538,538,539,539,539,539,539,540,540,540,540,540,541,541,541,542,542,542,542,543,543,543,543,544,544,544,544,544,544,545,545,545,545,546,546,546,547,547,548,548,548,548,549,549,549,550,550,550,550,550,551,551,551,551,552,552,552,552,553,553,553,554,554,554,555,555,555,555,556,556,556,557,557,557,558,558,558,558,559,559,560,560,
+		560,560,561,561,561,561,562,562,563,563,563,564,564,565,565,566,566,566,566,566,567,567,567,568,568,568,569,569,569,570,570,571,571,571,571,571,571,572,572,573,573,574,574,574,575,575,576,576,577,577,578,578,578,579,579,579,580,580,580,581,581,581,582,582,582,583,583,584,584,585,585,586,586,587,587,588,588,588,589,589,590,590,590,590,591,591,591,592,592,593,593,593,594,594,595,595,596,596,596,597,597,598,598,598,599,599,599,600,600,601,601,602,602,603,603,603,604,604,605,605,606,606,606,607,607,607,607,608,608,608,609,609,609,610,610,610,611,611,612,612,613,613,614,614,614,615,615,615,616,616,616,616,617,617,617,617,618,618,619,619,619,619,620,620,620,621,621,621,621,622,622,622,623,623,623,624,624,624,625,625,625,625,625,626,626,626,627,627,627,627,628,628,628,628,629,629,629,629,629,629,630,630,630,631,631,631,632,632,632,632,633,633,633,633,633,633,634,634,634,634,634,634,635,635,636,636,636,636,636,637,637,637,638,638,638,638,638,638,639,639,639,639,639,639,640,640,640,640,640,641,641,641,641,641,642,
+		642,642,642,642,642,643,643,643,643,643,643,643,643,644,644,644,645,645,645,645,645,645,646,646,646,646,646,646,647,647,647,647,647,647,648,648,648,648,648,648,648,648,648,648,649,649,649,650,650,650,650,650,650,650,651,651,651,651,651,651,651,651,652,652,652,652,652,652,652,652,652,652,653,653,653,653,654,654,654,654,654,655,655,655,655,655,655,655,655,655,656,656,656,656,656,656,656,656,656,657,657,657,657,657,657,657,658,658,658,658,658,658,658,658,658,658,659,659,659,659,659,659,659,660,660,660,660,660,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,662,662,662,662,662,662,663,663,663,663,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,667,667,667,667,667,667,668,668,668,668,668,668,668,669,669,669,669,669,669,669,669,669,669,669,669,669,669,669,670,670,670,670,670,670,670,671,671,671,671,671,671,671,671,671,671,
+		671,671,671,671,671,671,672,672,672,672,672,672,672,672,672,672,672,672,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,674,674,674,674,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,677,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,680,681,681,681,681,682,682,682,682,682,682,682,682,682,
+		682,682,682,682,682,682,682,682,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,683,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,684,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,685,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,
+		686,686,686,686,686,686,686,686,686
+	},
+	{
+		0,4,7,9,10,10,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,15,15,16,16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,30,31,31,31,32,32,32,32,33,33,34,34,35,35,36,37,38,40,41,43,44,46,48,49,51,53,55,57,59,60,62,64,65,67,69,70,72,73,75,76,77,79,80,82,83,84,85,87,88,89,91,92,93,94,95,97,98,99,100,101,103,104,105,106,107,108,110,111,112,113,114,115,116,118,119,120,121,122,123,124,125,126,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,154,155,156,157,158,159,160,161,162,162,163,164,165,166,167,168,168,169,170,171,172,172,173,174,175,176,177,177,178,179,180,181,181,182,183,184,185,185,186,187,188,188,189,190,191,191,192,193,193,194,195,196,196,197,198,199,199,200,201,201,202,203,204,204,205,206,206,207,208,209,209,210,211,211,212,213,213,214,215,216,216,217,218,
+		218,219,220,220,221,222,223,223,224,225,225,226,227,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,238,238,239,240,240,241,242,242,243,244,244,245,245,246,247,247,248,249,249,250,251,251,252,253,253,254,254,255,256,256,257,257,258,258,259,260,260,261,261,262,263,263,264,265,265,266,266,267,268,268,269,269,270,270,271,272,272,273,273,274,275,275,276,276,277,277,278,279,279,280,280,281,282,282,283,283,284,284,285,286,286,287,287,288,288,289,290,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297,298,299,299,300,300,301,301,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,310,310,311,312,312,313,313,314,314,315,315,316,316,317,317,318,318,319,320,320,321,321,321,322,323,323,324,324,325,325,326,326,327,327,328,328,329,329,330,330,331,331,332,332,333,333,333,334,335,335,336,336,337,337,338,338,339,339,340,340,340,341,341,342,342,343,343,344,344,345,345,346,346,347,347,348,348,349,349,350,350,351,351,352,353,353,354,354,354,355,355,356,356,357,357,358,358,359,359,359,360,360,
+		361,361,362,362,363,363,364,364,365,365,366,366,367,367,368,368,369,369,369,370,370,371,371,372,372,373,373,374,374,375,375,376,376,377,377,377,378,378,379,379,380,380,381,381,382,382,383,383,384,384,384,385,385,386,386,387,387,388,388,389,389,390,390,390,391,391,392,392,393,393,394,394,395,395,396,396,397,397,398,398,399,399,399,400,400,401,401,402,402,403,403,404,404,404,405,405,406,406,407,407,408,408,409,409,410,410,410,411,411,412,412,413,413,414,414,415,415,415,416,416,417,417,418,418,419,419,420,420,421,421,422,422,422,423,423,424,424,425,425,426,426,427,427,428,428,429,429,430,430,431,431,432,432,432,433,433,434,434,435,435,436,436,437,437,438,438,438,439,439,440,440,441,441,441,442,442,443,443,443,444,444,445,445,445,446,446,447,447,448,448,448,449,449,450,450,450,451,451,452,452,452,453,453,453,454,454,454,455,455,456,456,456,457,457,458,458,458,459,459,459,460,460,460,461,461,461,461,462,462,462,463,463,463,464,464,464,465,465,465,466,466,466,467,467,467,468,468,468,468,469,469,469,470,470,470,
+		470,471,471,471,472,472,472,472,473,473,473,474,474,474,474,475,475,475,475,476,476,476,476,477,477,477,477,478,478,478,478,479,479,479,479,480,480,480,480,480,481,481,481,481,481,482,482,482,482,483,483,483,483,484,484,484,484,484,485,485,485,485,485,486,486,486,486,486,487,487,487,487,487,488,488,488,488,489,489,489,489,489,490,490,490,490,490,491,491,491,491,491,492,492,492,492,492,493,493,493,494,494,494,494,494,495,495,495,495,495,495,495,495,496,496,496,496,496,497,497,497,497,497,498,498,498,498,498,498,498,499,499,499,499,499,500,500,500,500,501,501,501,501,502,502,502,502,502,503,503,503,503,503,503,503,504,504,504,504,504,504,505,505,505,505,506,506,506,506,506,506,506,507,507,507,507,508,508,508,508,508,508,509,509,509,509,509,510,510,510,510,511,511,511,511,511,511,511,511,511,512,512,512,512,512,513,513,513,513,514,514,514,515,515,515,515,515,516,516,516,516,516,517,517,517,517,517,517,517,517,518,518,518,518,518,519,519,519,519,519,520,520,520,520,520,521,521,521,522,522,522,522,522,522,523,
+		523,523,523,524,524,524,524,525,525,525,525,525,526,526,526,526,526,527,527,527,527,527,527,528,528,528,528,528,528,529,529,529,530,530,530,530,530,531,531,531,531,532,532,532,532,533,533,533,533,534,534,534,534,534,534,534,535,535,535,535,535,536,536,536,536,536,536,537,537,537,538,538,538,539,539,539,540,540,540,540,541,541,541,541,541,541,541,541,542,542,542,542,542,543,543,543,544,544,544,544,544,544,545,545,545,545,546,546,546,546,547,547,548,548,548,548,548,548,549,549,549,550,550,550,550,550,551,551,551,551,552,552,552,552,553,553,553,553,554,554,555,555,556,556,556,556,556,557,558,558,558,558,558,558,559,559,559,559,559,560,560,560,561,561,562,562,562,563,563,563,564,564,565,565,565,565,565,566,566,566,567,567,568,568,568,569,569,570,570,570,571,571,571,571,572,572,573,573,573,573,574,574,574,575,575,576,576,576,577,577,578,578,579,579,580,580,580,581,581,582,582,582,583,583,584,584,584,585,585,585,585,586,586,587,587,587,588,588,589,589,590,590,590,591,591,591,592,592,592,593,593,593,594,594,595,
+		595,596,596,596,597,597,597,598,598,598,598,599,599,599,600,600,600,601,601,601,601,602,602,602,603,603,603,604,604,604,605,605,605,606,606,606,607,607,607,607,608,608,609,609,609,609,610,610,610,610,611,611,611,611,612,612,612,612,613,613,613,613,614,614,614,614,614,615,615,615,615,615,615,616,616,617,617,617,618,618,618,618,619,619,619,619,620,620,620,620,621,621,621,621,621,621,622,622,622,622,622,623,623,623,623,624,624,624,624,624,625,625,625,625,626,626,626,626,627,627,627,627,628,628,628,628,628,629,629,629,629,629,629,630,630,630,630,630,630,630,630,630,631,631,631,631,631,631,632,632,632,632,633,633,633,633,633,633,633,633,634,634,634,634,634,634,634,634,634,635,635,635,635,635,635,635,635,635,635,636,636,636,636,636,637,637,637,637,637,637,638,638,638,638,638,638,638,638,638,639,639,639,639,639,639,639,639,639,639,639,639,639,639,640,640,640,640,640,641,641,641,641,641,641,641,642,642,642,642,642,642,642,643,643,643,643,643,643,643,643,643,644,644,644,644,644,644,644,644,644,644,645,645,645,645,
+		645,645,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,647,647,647,647,647,647,647,648,648,648,648,648,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,650,650,650,650,650,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,652,652,652,652,652,652,652,652,652,652,652,652,652,652,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,653,654,654,654,654,654,654,655,655,655,655,655,655,655,655,655,655,655,655,655,655,655,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,659,660,660,660,660,660,660,660,660,660,
+		660,660,660,660,660,660,660,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,661,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,663,663,663,663,663,663,663,663,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,666,666,666,
+		667,667,667,667,667,667,667,667,667
+	},
+	{
+		0,0,4,7,8,9,11,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,15,15,15,16,16,17,17,17,18,18,19,19,20,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,34,34,35,36,37,38,40,41,43,44,46,47,49,51,52,54,56,57,59,60,62,64,65,66,68,69,70,72,73,74,76,77,78,79,80,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,124,125,126,127,128,129,130,131,132,133,134,135,136,137,137,138,139,140,141,142,143,144,145,146,146,147,148,149,150,151,152,152,153,154,155,156,156,157,158,159,160,160,161,162,163,164,164,165,166,167,167,168,169,170,170,171,172,172,173,174,175,175,176,177,177,178,179,180,180,181,182,182,183,184,184,185,186,187,187,188,189,189,190,191,191,192,193,193,194,195,195,196,197,198,198,199,200,200,201,
+		202,202,203,204,204,205,205,206,207,207,208,209,209,210,211,211,212,212,213,214,214,215,216,216,217,217,218,219,219,220,221,221,222,222,223,224,224,225,225,226,227,227,228,228,229,230,230,231,231,232,233,233,234,234,235,235,236,236,237,238,238,239,239,240,241,241,242,242,243,243,244,245,245,246,246,247,247,248,248,249,250,250,251,251,252,252,253,253,254,254,255,255,256,257,257,258,258,259,259,260,260,261,261,262,263,263,264,264,265,265,266,266,267,267,268,268,269,269,270,270,271,271,272,272,273,273,274,274,275,275,276,276,277,277,278,278,279,279,280,281,281,281,282,283,283,284,284,285,285,286,286,287,287,288,288,289,289,290,290,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297,297,298,298,299,299,300,300,301,302,302,302,303,303,304,304,305,305,306,306,307,307,308,308,309,309,309,310,310,311,311,312,312,313,313,313,314,314,315,315,316,316,317,317,318,318,319,319,319,320,320,321,321,322,322,323,323,323,324,324,325,325,326,326,327,327,328,328,329,329,329,330,330,331,331,331,332,332,333,333,334,334,
+		335,335,335,336,336,337,337,337,338,338,339,339,340,340,341,341,342,342,343,343,343,344,344,345,345,345,346,346,347,347,348,348,349,349,350,350,351,351,351,352,352,353,353,353,354,354,355,355,356,356,356,357,357,358,358,358,359,359,360,360,360,361,361,362,362,363,363,364,364,364,365,365,366,366,367,367,367,368,368,369,369,369,370,370,371,371,372,372,372,373,373,374,374,375,375,375,376,376,377,377,377,378,378,379,379,379,380,380,381,381,382,382,382,383,383,384,384,384,385,385,386,386,386,387,387,388,388,389,389,389,390,390,391,391,392,392,393,393,393,394,394,395,395,395,396,396,397,397,397,398,398,399,399,400,400,400,401,401,402,402,403,403,404,404,404,405,405,406,406,406,407,407,408,408,409,409,409,410,410,411,411,412,412,412,413,413,414,414,414,415,415,416,416,417,417,418,418,418,419,419,420,420,420,421,421,422,422,423,423,423,424,424,425,425,426,426,427,427,427,428,428,429,429,429,430,430,431,431,432,432,432,433,433,434,434,434,435,435,436,436,436,437,437,438,438,438,439,439,440,440,440,441,441,442,442,
+		443,443,443,444,444,444,445,445,446,446,446,447,447,447,448,448,449,449,449,450,450,450,451,451,451,452,452,453,453,453,454,454,454,455,455,455,455,456,456,456,456,457,457,457,458,458,458,459,459,459,460,460,460,461,461,461,461,462,462,462,463,463,463,463,464,464,464,464,464,465,465,465,466,466,466,466,466,467,467,467,467,468,468,468,468,469,469,469,469,470,470,470,471,471,471,471,471,472,472,472,473,473,473,473,474,474,474,474,474,474,475,475,475,475,475,475,476,476,476,476,476,477,477,477,477,478,478,478,478,478,479,479,479,479,479,480,480,480,480,480,480,481,481,481,481,482,482,482,482,482,483,483,483,483,483,484,484,484,484,484,484,485,485,485,485,485,486,486,486,486,486,486,487,487,487,487,487,488,488,488,488,488,489,489,489,489,489,490,490,490,490,490,490,490,491,491,491,491,491,491,491,492,492,492,492,492,493,493,493,493,493,493,494,494,494,494,494,495,495,495,495,495,495,495,496,496,496,496,496,496,496,497,497,497,497,498,498,498,498,498,498,499,499,499,499,499,499,499,500,500,500,500,501,501,501,
+		501,501,502,502,502,502,502,502,503,503,503,503,503,503,504,504,504,504,504,505,505,505,505,505,505,505,505,506,506,506,506,506,506,506,507,507,507,507,507,508,508,508,508,508,508,509,509,509,509,509,509,510,510,510,510,510,510,510,511,511,511,511,511,511,511,512,512,512,512,512,512,513,513,513,513,513,513,514,514,514,514,514,514,515,515,515,515,516,516,516,516,516,516,517,517,517,517,517,517,517,517,517,517,518,518,518,518,518,518,519,519,519,519,519,520,520,520,520,521,521,521,521,521,521,521,522,522,522,522,522,522,522,523,523,523,523,523,524,524,524,524,524,524,524,524,525,525,525,526,526,526,526,527,527,527,527,527,527,527,528,528,528,528,528,528,528,528,529,529,529,529,530,530,530,531,531,531,531,531,531,531,531,532,532,532,532,532,533,533,533,533,534,534,534,535,535,535,535,535,535,535,535,535,535,536,536,536,536,536,536,537,537,537,538,538,538,538,539,539,539,540,540,540,540,540,541,541,541,541,542,542,542,542,542,542,543,543,543,543,543,544,544,544,544,545,545,546,546,547,547,547,547,547,548,548,
+		548,548,548,548,549,549,549,550,550,550,550,551,551,551,552,552,552,552,552,553,553,554,554,554,555,555,555,555,556,556,556,557,557,557,558,558,558,558,558,559,559,559,560,560,560,560,560,561,561,562,562,562,562,563,563,564,564,564,564,564,565,565,565,565,566,566,566,567,567,568,568,569,569,569,570,570,570,570,570,571,571,571,572,572,572,573,573,574,574,574,575,575,576,576,576,577,577,578,578,578,578,579,579,579,580,580,580,580,581,581,582,582,582,582,582,583,583,584,584,585,585,586,586,587,587,587,587,588,588,588,589,589,589,590,590,590,591,591,591,591,592,592,592,593,593,593,594,594,594,595,595,595,596,596,596,597,597,597,597,598,598,598,598,599,599,599,599,599,600,600,600,601,601,601,601,602,602,602,603,603,603,603,604,604,604,605,605,605,606,606,606,606,606,606,607,607,607,607,607,607,608,608,608,608,608,609,609,609,609,609,610,610,610,611,611,611,612,612,612,613,613,613,613,613,614,614,614,615,615,615,615,615,615,616,616,616,616,616,616,616,617,617,617,618,618,618,618,618,619,619,619,619,619,619,619,
+		619,620,620,620,620,621,621,621,621,621,621,622,622,622,622,622,622,622,622,623,623,623,623,623,623,623,623,624,624,624,624,624,624,624,624,625,625,626,626,626,626,626,626,626,627,627,627,627,627,627,627,628,628,628,629,629,629,629,630,630,630,630,630,630,630,630,630,630,630,630,630,630,631,631,631,631,631,631,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,633,633,633,633,633,633,633,634,634,634,634,634,634,634,634,635,635,635,635,635,635,635,635,635,635,635,635,636,636,636,636,636,636,636,636,637,637,637,637,637,637,637,637,637,637,637,637,637,638,638,638,638,638,638,638,639,639,639,639,639,639,639,639,639,639,639,639,639,639,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,641,642,642,642,642,642,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,
+		644,645,645,645,645,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,650,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,651,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,
+		653,653,653,653,653,653,653,653,653
+	},
+	{
+		0,0,1,5,7,8,9,10,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,15,15,15,16,16,16,17,17,17,18,18,19,19,19,20,20,21,21,22,22,22,23,23,24,24,25,25,25,26,26,27,27,27,28,28,28,29,29,29,30,30,30,30,31,31,31,32,32,32,33,34,34,35,36,37,38,39,40,41,42,44,45,46,48,49,51,52,54,55,57,58,60,61,62,64,65,66,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,90,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,109,110,111,112,113,114,115,116,117,118,118,119,120,121,122,123,124,125,126,127,127,128,129,130,131,132,133,134,134,135,136,137,138,139,139,140,141,142,143,143,144,145,146,147,147,148,149,150,150,151,152,153,153,154,155,156,156,157,158,158,159,160,161,161,162,163,163,164,165,165,166,167,167,168,169,169,170,171,171,172,173,173,174,175,175,176,177,177,178,179,179,180,181,181,182,183,183,184,184,
+		185,186,186,187,188,188,189,189,190,191,191,192,193,193,194,194,195,196,196,197,197,198,199,199,200,200,201,202,202,203,203,204,205,205,206,206,207,207,208,208,209,210,210,211,211,212,212,213,214,214,215,215,216,216,217,217,218,219,219,220,220,221,221,222,222,223,223,224,224,225,225,226,226,227,228,228,229,229,230,230,231,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,256,256,256,257,257,258,258,259,259,260,260,261,261,262,262,263,263,264,264,265,265,266,266,266,267,267,268,268,269,269,270,270,270,271,271,272,272,273,273,273,274,274,275,275,276,276,277,277,278,278,279,279,279,280,280,281,281,282,282,282,283,283,284,284,284,285,285,286,286,287,287,288,288,289,289,289,290,290,291,291,292,292,292,293,293,294,294,295,295,295,296,296,297,297,298,298,299,299,299,300,300,301,301,302,302,302,303,303,304,304,304,305,305,305,306,306,307,307,307,308,308,309,309,310,310,
+		310,311,311,312,312,313,313,313,314,314,314,315,315,315,316,316,317,317,318,318,318,319,319,319,320,320,321,321,321,322,322,323,323,324,324,325,325,325,326,326,327,327,327,328,328,328,329,329,330,330,331,331,331,332,332,333,333,333,334,334,334,335,335,335,336,336,337,337,337,338,338,339,339,339,340,340,341,341,342,342,342,343,343,343,344,344,345,345,345,346,346,347,347,347,348,348,348,349,349,349,350,350,350,351,351,352,352,352,353,353,353,354,354,355,355,355,356,356,357,357,358,358,358,359,359,359,360,360,360,361,361,362,362,363,363,363,364,364,365,365,365,366,366,366,367,367,367,368,368,369,369,369,370,370,371,371,371,372,372,372,373,373,373,374,374,374,375,375,375,376,376,377,377,378,378,378,379,379,380,380,380,381,381,381,382,382,382,383,383,384,384,385,385,385,385,386,386,387,387,387,388,388,388,389,389,390,390,390,391,391,392,392,392,393,393,394,394,395,395,395,396,396,397,397,397,397,398,398,399,399,399,400,400,400,401,401,402,402,402,403,403,404,404,405,405,405,406,406,407,407,408,408,408,409,409,
+		409,410,410,410,411,411,412,412,412,413,413,414,414,415,415,416,416,416,417,417,418,418,418,419,419,419,420,420,421,421,421,422,422,422,423,423,424,424,424,425,425,426,426,426,427,427,427,428,428,429,429,429,430,430,431,431,431,432,432,433,433,433,434,434,434,435,435,435,436,436,436,437,437,437,438,438,438,439,439,440,440,441,441,441,442,442,442,443,443,443,444,444,444,444,445,445,445,446,446,446,447,447,447,447,448,448,448,449,449,449,450,450,450,451,451,451,451,452,452,452,452,453,453,453,453,454,454,454,455,455,455,455,455,456,456,456,457,457,457,457,458,458,458,458,459,459,459,459,460,460,460,460,461,461,461,461,462,462,462,462,462,463,463,463,463,463,464,464,464,464,465,465,465,465,465,466,466,466,466,466,467,467,467,467,468,468,468,468,468,469,469,469,469,469,469,469,470,470,470,470,470,471,471,471,471,471,472,472,472,472,472,472,473,473,473,473,474,474,474,474,474,474,475,475,475,475,475,475,476,476,476,476,476,477,477,477,477,477,478,478,478,478,478,478,479,479,479,479,479,480,480,480,480,480,481,
+		481,481,481,481,481,481,482,482,482,482,482,482,482,482,483,483,483,483,483,483,484,484,484,484,484,484,485,485,485,485,485,485,485,486,486,486,486,486,486,486,487,487,487,487,487,487,487,487,488,488,488,488,489,489,489,489,489,489,489,489,489,489,490,490,490,490,490,490,491,491,491,491,491,491,491,491,491,492,492,492,492,492,493,493,493,493,493,493,493,494,494,494,494,494,494,494,494,494,495,495,495,495,495,496,496,496,496,496,496,496,497,497,497,497,497,497,497,498,498,498,498,498,498,498,498,499,499,499,499,499,499,499,499,500,500,500,500,500,500,500,500,500,501,501,501,501,501,501,502,502,502,502,502,502,503,503,503,503,503,503,504,504,504,504,504,504,504,504,505,505,505,505,505,505,505,506,506,506,506,506,506,507,507,507,507,507,507,507,507,507,507,507,507,508,508,508,508,509,509,509,509,509,510,510,510,510,510,510,510,510,511,511,511,511,511,511,511,512,512,512,512,512,513,513,513,513,513,513,513,514,514,514,514,514,514,514,515,515,515,515,515,515,515,516,516,516,516,516,517,517,517,517,517,518,518,
+		518,518,519,519,519,519,519,519,520,520,520,520,520,520,521,521,521,521,521,521,521,521,522,522,522,522,522,522,522,522,523,523,524,524,524,524,524,525,525,525,525,526,526,526,526,526,526,526,526,527,527,527,527,527,527,527,528,528,528,528,528,528,528,528,529,529,529,529,529,530,530,530,530,530,531,531,532,532,532,532,532,533,533,533,533,533,534,534,534,534,534,535,535,535,535,535,536,536,536,536,536,537,537,537,537,537,538,538,538,538,538,538,538,539,539,539,539,540,540,541,541,541,542,542,542,542,543,543,543,543,543,544,544,544,544,544,544,544,545,545,545,545,545,545,546,546,546,547,547,547,547,548,548,548,548,548,549,549,549,549,549,550,550,550,550,550,551,551,551,551,552,552,552,553,553,553,553,554,554,554,555,555,555,556,556,556,557,557,557,558,558,558,558,559,559,559,559,559,560,560,560,560,561,561,561,561,561,562,562,563,563,563,563,564,564,565,565,566,566,566,566,567,567,567,567,567,568,568,568,568,569,569,570,570,570,571,571,572,572,572,573,573,573,574,574,574,574,575,575,575,576,576,576,577,577,
+		577,577,578,578,578,579,579,579,580,580,580,581,581,581,582,582,582,582,583,583,583,583,583,584,584,584,585,585,585,586,586,587,587,587,587,587,588,588,588,588,589,589,589,589,590,590,591,591,591,592,592,592,593,593,593,594,594,594,594,594,595,595,595,595,595,595,596,596,596,596,596,597,597,597,597,598,598,598,599,599,599,600,600,600,600,601,601,601,601,601,602,602,602,602,602,602,602,603,603,603,604,604,604,604,605,605,605,605,606,606,606,606,606,606,606,606,606,606,607,607,607,608,608,608,609,609,609,609,609,609,609,609,609,609,609,609,609,610,610,610,610,611,611,611,611,612,612,612,612,612,612,612,612,613,613,613,613,613,613,614,614,614,614,614,615,615,615,615,615,615,616,616,616,616,616,616,616,616,616,616,616,616,616,617,617,617,617,618,618,618,618,618,618,618,618,618,618,618,619,619,619,619,619,619,619,619,619,619,619,619,619,620,620,620,620,620,620,620,620,620,620,621,621,621,621,621,621,621,622,622,622,622,622,622,623,623,623,623,623,623,623,623,624,624,624,624,624,624,624,624,624,624,624,624,624,
+		624,624,624,624,624,624,624,625,625,626,626,626,626,626,626,626,626,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,627,628,628,628,628,628,628,628,628,628,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,631,631,631,631,631,631,631,631,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,634,634,634,634,634,634,634,634,634,634,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,636,636,636,636,636,636,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,638,638,638,638,
+		639,639,639,639,639,639,639,639,639
+	},
+	{
+		0,0,1,5,7,8,9,10,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15,16,16,16,17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,23,23,23,24,24,24,25,25,25,26,26,26,27,27,27,28,28,28,28,29,29,29,29,30,30,30,31,31,32,32,33,33,34,35,36,37,38,38,39,41,42,43,44,45,46,48,49,50,51,53,54,55,57,58,59,60,61,62,63,64,66,67,68,69,70,71,72,73,74,74,75,76,77,78,79,80,81,82,82,83,84,85,86,87,87,88,89,90,91,92,92,93,94,95,96,96,97,98,99,100,101,101,102,103,104,105,105,106,107,108,109,109,110,111,112,113,113,114,115,116,117,117,118,119,120,120,121,122,123,123,124,125,126,126,127,128,129,129,130,131,131,132,133,134,134,135,136,136,137,138,139,139,140,141,141,142,143,143,144,145,145,146,147,147,148,149,149,150,151,151,152,153,153,154,154,155,156,156,157,158,158,159,159,160,161,161,
+		162,163,163,164,164,165,166,166,167,167,168,168,169,170,170,171,171,172,173,173,174,174,175,175,176,177,177,178,178,179,179,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,190,190,191,191,192,192,193,193,194,194,195,195,196,196,197,197,198,198,199,199,200,200,201,201,202,202,203,203,204,204,205,205,206,206,207,207,208,208,208,209,209,210,210,211,211,212,212,213,213,213,214,214,215,215,216,216,217,217,218,218,219,219,219,220,220,221,221,221,222,222,223,223,224,224,225,225,226,226,226,227,227,228,228,228,229,229,230,230,231,231,231,232,232,233,233,234,234,234,235,235,236,236,237,237,237,238,238,238,239,239,240,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,247,247,247,248,248,249,249,250,250,250,251,251,252,252,252,253,253,253,254,254,255,255,255,256,256,256,257,257,258,258,258,259,259,260,260,260,261,261,261,262,262,262,263,263,263,264,264,265,265,265,266,266,267,267,267,268,268,268,269,269,269,270,270,271,271,271,272,272,272,273,273,274,274,274,275,275,275,276,276,
+		276,277,277,278,278,278,279,279,279,280,280,280,281,281,281,282,282,283,283,283,284,284,284,285,285,285,286,286,287,287,287,288,288,288,289,289,290,290,290,291,291,291,292,292,292,292,293,293,293,294,294,294,295,295,295,296,296,297,297,297,298,298,298,299,299,299,300,300,300,301,301,301,302,302,302,303,303,303,304,304,304,305,305,305,306,306,306,307,307,307,308,308,308,309,309,309,310,310,310,311,311,311,312,312,313,313,313,313,314,314,314,315,315,315,316,316,316,317,317,317,318,318,318,319,319,319,320,320,320,321,321,321,322,322,322,323,323,323,324,324,324,325,325,325,326,326,326,327,327,327,328,328,328,329,329,329,330,330,330,331,331,331,331,332,332,332,333,333,333,334,334,334,335,335,335,336,336,336,337,337,337,338,338,338,339,339,339,340,340,340,340,341,341,341,342,342,342,343,343,343,344,344,344,345,345,345,345,346,346,347,347,347,348,348,348,349,349,349,350,350,350,351,351,351,352,352,352,353,353,353,354,354,354,354,355,355,355,356,356,356,357,357,357,358,358,358,359,359,359,359,360,360,361,361,361,
+		361,362,362,362,363,363,363,363,364,364,364,365,365,365,366,366,366,367,367,367,368,368,369,369,369,370,370,370,371,371,371,371,372,372,372,373,373,373,374,374,374,375,375,375,376,376,376,377,377,377,378,378,378,378,379,379,379,380,380,380,381,381,381,382,382,382,383,383,383,384,384,384,385,385,385,386,386,386,387,387,387,388,388,388,389,389,389,390,390,390,391,391,391,392,392,392,392,393,393,394,394,394,395,395,395,396,396,396,397,397,397,398,398,398,399,399,399,399,400,400,400,401,401,401,402,402,402,403,403,404,404,404,405,405,405,406,406,406,407,407,408,408,408,408,409,409,410,410,410,411,411,411,411,412,412,413,413,413,414,414,415,415,415,416,416,416,417,417,417,418,418,418,419,419,419,420,420,420,421,421,422,422,422,423,423,423,424,424,424,425,425,425,426,426,426,426,427,427,427,428,428,428,429,429,429,430,430,430,431,431,432,432,432,432,433,433,433,434,434,434,435,435,435,436,436,436,437,437,437,438,438,438,439,439,439,439,440,440,440,441,441,441,442,442,442,442,443,443,443,443,444,444,444,444,445,
+		445,445,445,446,446,446,446,447,447,447,448,448,448,448,448,449,449,449,450,450,450,450,450,451,451,451,451,452,452,452,452,453,453,453,453,453,454,454,454,454,454,454,455,455,455,455,456,456,456,456,456,457,457,457,457,457,457,458,458,458,458,458,459,459,459,459,459,460,460,460,460,460,460,460,460,461,461,461,461,461,462,462,462,462,463,463,463,463,463,463,463,464,464,464,464,464,464,465,465,465,465,465,465,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467,468,468,468,468,468,468,468,468,469,469,469,469,469,469,470,470,470,470,470,471,471,471,471,471,471,471,472,472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473,474,474,474,474,474,474,475,475,475,475,475,475,475,475,475,475,476,476,476,476,476,476,476,477,477,477,477,477,477,477,478,478,478,478,478,478,478,478,478,478,478,479,479,479,479,479,479,479,479,480,480,480,480,480,480,481,481,481,481,481,481,481,481,481,481,482,482,482,482,482,482,483,483,483,483,483,483,483,483,483,483,483,484,484,484,484,484,484,485,485,485,485,485,485,
+		485,486,486,486,486,486,487,487,487,487,487,487,487,487,487,487,487,487,487,488,488,488,488,488,488,488,489,489,489,489,489,489,489,490,490,490,490,490,490,490,490,491,491,491,491,491,491,491,491,491,491,491,491,492,492,492,492,492,492,492,492,492,492,492,493,493,493,493,493,493,494,494,494,494,494,494,495,495,495,495,495,495,495,495,495,495,496,496,496,496,496,496,496,496,497,497,497,497,497,498,498,498,498,498,498,498,498,498,498,498,498,499,499,499,499,499,499,500,500,500,500,500,500,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,501,502,502,502,503,503,503,503,503,503,504,504,504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505,506,506,506,506,506,506,507,507,507,507,507,507,507,507,507,507,507,507,507,508,508,508,508,508,508,508,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510,510,510,511,511,511,511,511,512,512,512,512,512,512,512,512,513,513,513,513,513,514,514,514,514,514,514,515,515,515,515,515,515,515,515,516,516,516,516,516,516,516,516,516,
+		516,517,517,517,517,518,518,518,518,518,518,518,518,518,518,519,519,519,519,519,519,519,519,520,520,520,520,520,520,520,521,521,521,521,521,521,521,522,522,522,522,523,523,523,523,523,524,524,524,524,524,524,525,525,525,525,525,525,525,526,526,526,526,526,526,526,526,527,527,527,527,527,527,527,527,527,527,528,528,528,528,528,528,528,528,528,529,529,529,529,529,529,530,530,530,530,530,531,531,531,531,531,531,531,532,532,532,532,532,533,533,533,533,533,534,534,535,535,535,535,535,535,535,535,536,536,536,536,536,536,536,536,536,537,537,537,538,538,538,538,538,538,539,539,539,540,540,540,540,540,540,540,541,541,541,541,541,541,541,541,541,542,542,542,542,543,543,544,544,544,544,544,544,545,545,545,545,545,545,546,546,546,546,546,546,547,547,547,547,547,547,548,548,548,549,549,549,549,549,550,550,550,550,550,550,550,550,550,551,551,552,552,552,553,553,553,553,553,554,554,554,555,555,555,556,556,556,557,557,557,558,558,558,558,558,559,559,560,560,560,560,561,561,561,561,562,562,562,562,563,563,563,564,564,565,
+		565,565,566,566,566,567,567,568,568,569,569,569,569,570,570,570,571,571,571,571,571,571,572,572,572,573,573,573,573,574,574,574,575,575,575,576,576,576,576,577,577,577,577,577,577,578,578,579,579,579,579,580,580,580,580,581,581,581,581,581,582,582,582,582,583,583,583,584,584,584,584,584,584,585,585,585,585,586,586,586,586,587,587,587,587,587,587,588,588,588,588,589,589,589,590,590,590,590,590,590,591,591,591,591,591,591,591,591,592,592,592,592,592,593,593,593,593,594,594,594,594,594,594,594,595,595,595,595,596,596,596,596,596,597,597,597,597,597,597,597,598,598,598,598,598,599,599,599,599,599,599,599,600,600,600,600,600,600,601,601,601,601,601,601,601,601,602,602,602,603,603,603,603,603,603,603,603,604,604,604,604,604,604,604,605,605,605,605,605,605,605,605,605,605,605,606,606,606,606,606,607,607,607,607,608,608,608,608,609,609,609,609,609,609,609,609,609,609,609,609,609,609,609,610,610,610,610,610,610,610,610,611,611,611,611,611,611,611,611,611,611,612,612,612,612,612,612,612,613,613,613,613,613,613,613,
+		613,613,614,614,614,614,614,614,615
+	},
+	{
+		0,0,2,5,6,8,9,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,18,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24,24,24,24,25,25,25,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,31,31,31,32,32,33,33,34,34,35,36,36,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,56,57,58,60,61,62,63,64,64,65,66,67,68,69,70,71,72,72,73,74,75,76,77,77,78,79,80,81,81,82,83,84,84,85,86,87,87,88,89,90,90,91,92,93,94,94,95,96,97,97,98,99,99,100,101,102,102,103,104,105,105,106,107,108,108,109,110,110,111,112,113,113,114,115,115,116,117,117,118,119,120,120,121,122,122,123,124,124,125,126,126,127,128,128,129,130,130,131,132,132,133,134,134,135,136,136,137,137,138,139,139,140,141,141,142,142,143,144,144,145,146,
+		146,147,147,148,149,149,150,150,151,151,152,153,153,154,154,155,155,156,157,157,158,158,159,159,160,160,161,161,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169,170,170,171,171,172,172,173,173,174,175,175,176,176,177,177,178,178,179,179,180,180,180,181,181,182,182,183,183,184,184,185,185,186,186,187,187,188,188,189,189,189,190,190,191,191,192,192,193,193,194,194,194,195,195,196,196,197,197,198,198,199,199,199,200,200,201,201,201,202,202,203,203,204,204,205,205,205,206,206,207,207,207,208,208,209,209,209,210,210,211,211,212,212,212,213,213,214,214,214,215,215,215,216,216,217,217,217,218,218,219,219,219,220,220,221,221,221,222,222,223,223,223,224,224,224,225,225,226,226,226,227,227,227,228,228,229,229,229,230,230,231,231,231,232,232,233,233,233,234,234,234,235,235,235,236,236,236,237,237,238,238,238,239,239,239,240,240,241,241,241,242,242,242,243,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,253,253,253,254,254,255,255,255,256,256,
+		256,257,257,257,258,258,258,259,259,259,260,260,260,261,261,261,262,262,262,263,263,263,264,264,264,265,265,265,266,266,266,267,267,267,268,268,269,269,269,269,270,270,270,271,271,271,272,272,272,273,273,273,274,274,274,275,275,275,276,276,276,276,277,277,277,278,278,278,279,279,279,280,280,281,281,281,281,282,282,282,283,283,283,284,284,284,285,285,285,286,286,286,287,287,287,288,288,288,289,289,289,290,290,290,290,291,291,291,292,292,292,292,293,293,293,294,294,294,294,295,295,295,296,296,296,297,297,297,298,298,298,299,299,299,300,300,300,301,301,301,302,302,302,303,303,303,303,304,304,304,305,305,305,306,306,306,307,307,307,307,308,308,308,309,309,309,310,310,310,310,311,311,311,311,312,312,312,313,313,313,314,314,314,315,315,315,316,316,316,316,317,317,317,318,318,318,318,319,319,319,320,320,320,320,321,321,322,322,322,322,323,323,323,324,324,324,325,325,325,326,326,326,327,327,327,327,328,328,328,329,329,329,330,330,330,330,331,331,331,332,332,332,332,333,333,333,334,334,334,334,335,335,335,336,336,
+		336,336,337,337,337,338,338,338,338,339,339,339,340,340,340,340,341,341,341,342,342,342,343,343,343,344,344,344,345,345,345,346,346,346,346,347,347,347,348,348,348,348,349,349,349,350,350,350,351,351,351,351,352,352,353,353,353,353,354,354,354,355,355,355,355,355,356,356,356,357,357,357,358,358,358,359,359,360,360,360,360,361,361,361,361,362,362,362,362,363,363,363,364,364,364,365,365,365,366,366,366,367,367,367,368,368,368,368,369,369,369,370,370,370,370,371,371,371,371,372,372,372,373,373,373,373,374,374,374,375,375,375,376,376,376,376,377,377,377,378,378,378,379,379,379,380,380,380,381,381,381,382,382,382,383,383,383,384,384,384,385,385,385,385,386,386,386,387,387,387,388,388,388,389,389,390,390,390,390,391,391,391,392,392,392,393,393,393,393,394,394,394,395,395,395,396,396,396,397,397,397,398,398,398,399,399,399,400,400,400,401,401,401,401,402,402,403,403,403,404,404,404,405,405,405,406,406,406,407,407,407,407,408,408,408,409,409,409,410,410,410,411,411,412,412,412,413,413,413,414,414,414,415,415,415,
+		415,416,416,417,417,417,418,418,418,419,419,419,420,420,420,421,421,421,421,422,422,422,423,423,423,423,424,424,425,425,425,426,426,426,426,427,427,427,427,427,428,428,428,428,429,429,429,430,430,430,430,431,431,431,432,432,432,432,433,433,433,434,434,434,434,435,435,435,435,436,436,436,436,437,437,437,437,438,438,438,438,438,439,439,439,439,440,440,440,440,441,441,441,441,441,442,442,442,442,442,442,443,443,443,443,443,444,444,444,444,445,445,445,445,446,446,446,446,446,447,447,447,447,447,447,447,448,448,448,448,448,449,449,449,449,449,449,450,450,450,450,450,450,450,451,451,451,451,451,452,452,452,452,452,453,453,453,453,453,453,453,453,454,454,454,454,454,454,455,455,455,455,455,455,456,456,456,456,456,456,456,456,457,457,457,457,457,457,457,457,458,458,458,458,458,458,459,459,459,459,459,459,459,459,460,460,460,460,460,460,461,461,461,461,461,461,461,461,461,461,462,462,462,462,462,462,463,463,463,463,463,463,463,464,464,464,464,464,464,464,465,465,465,465,465,465,465,465,465,465,465,466,466,466,466,
+		466,466,466,466,466,467,467,467,467,467,467,467,468,468,468,468,468,468,468,468,468,469,469,469,469,469,469,469,469,469,470,470,470,470,470,471,471,471,471,471,471,471,471,471,472,472,472,472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473,473,473,473,474,474,474,474,474,474,474,474,474,475,475,475,475,475,475,475,475,476,476,476,476,476,476,476,477,477,477,477,477,477,477,477,478,478,478,478,478,478,478,478,478,478,478,478,478,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480,481,481,481,481,481,481,481,481,481,481,481,481,481,481,482,482,482,482,482,482,483,483,483,483,483,483,483,483,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,485,485,485,485,485,486,486,486,486,486,486,486,486,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,488,488,488,488,488,488,488,488,488,488,489,489,489,489,489,489,489,489,489,490,490,490,490,490,490,490,490,490,490,491,491,491,491,491,491,491,491,491,492,492,492,492,492,492,492,493,493,493,493,493,493,493,493,493,493,493,493,
+		494,494,494,494,494,494,495,495,495,495,495,495,495,495,495,495,495,495,495,496,496,496,496,496,496,497,497,497,497,497,497,497,498,498,498,498,498,498,498,498,498,499,499,499,499,499,499,499,499,499,500,500,500,500,500,500,500,500,500,500,501,501,501,501,501,501,501,501,501,501,502,502,502,502,502,502,502,502,503,503,503,503,503,503,503,503,503,503,503,504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505,505,505,505,505,505,505,506,506,506,506,506,506,507,507,507,507,507,507,507,507,507,508,508,508,508,508,508,508,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510,510,510,510,510,511,511,511,511,511,511,512,512,512,512,512,512,512,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,514,514,514,514,515,515,515,515,515,515,515,515,515,515,516,516,516,516,516,516,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,518,518,518,518,518,519,519,519,519,519,519,520,520,520,520,520,521,521,521,521,522,522,522,522,522,523,523,523,523,523,523,524,524,524,524,524,
+		524,524,524,525,525,525,525,525,526,526,526,527,527,527,527,527,528,528,528,528,528,528,528,529,529,529,529,529,529,529,530,530,530,530,531,531,531,531,532,532,532,532,532,532,532,532,532,532,532,533,533,534,534,534,535,535,535,535,536,536,536,536,536,536,536,537,537,537,537,538,538,539,539,539,539,539,540,540,540,540,540,541,541,541,541,541,541,542,542,543,543,543,543,544,544,544,545,545,545,546,546,546,546,546,547,547,547,548,548,548,548,549,549,549,550,550,550,550,550,550,551,551,551,551,551,552,552,552,553,553,553,554,554,554,554,555,555,555,555,556,556,556,556,557,557,558,558,558,558,558,559,559,559,559,559,560,560,560,561,561,561,562,562,563,563,563,564,564,564,565,565,565,565,565,566,566,566,566,566,567,567,567,567,568,568,568,568,569,569,569,570,570,570,570,571,571,571,571,572,572,572,572,572,573,573,573,573,574,574,574,575,575,575,575,576,576,576,577,577,577,577,577,577,578,578,578,578,579,579,579,579,580,580,580,580,580,581,581,581,581,581,581,581,582,582,582,583,583,583,584,584,584,584,585,585,
+		585,585,585,585,585,585,585,586,586
+	},
+	{
+		0,0,0,3,5,6,8,9,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,20,20,20,20,21,21,21,21,22,22,22,23,23,23,23,24,24,24,24,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,30,30,30,31,31,32,32,33,33,34,35,35,36,37,38,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,58,59,60,61,62,63,64,65,65,66,67,68,68,69,70,71,71,72,73,74,74,75,76,76,77,78,79,79,80,81,81,82,83,83,84,85,85,86,87,87,88,89,89,90,91,91,92,93,93,94,95,95,96,97,97,98,98,99,100,100,101,102,102,103,104,104,105,105,106,107,107,108,109,109,110,110,111,112,112,113,114,114,115,116,116,117,117,118,119,119,120,121,121,122,122,123,123,124,125,125,126,126,127,128,128,129,130,
+		130,131,131,132,132,133,134,134,135,135,136,136,137,138,138,139,139,140,140,141,142,142,143,143,144,144,145,145,146,147,147,148,148,149,149,150,150,151,151,152,152,153,153,154,154,155,155,156,156,157,157,158,158,159,159,160,160,161,161,162,162,163,163,164,164,165,165,166,166,167,167,167,168,168,169,169,170,170,171,171,172,172,173,173,173,174,174,175,175,176,176,176,177,177,178,178,179,179,179,180,180,181,181,181,182,182,183,183,184,184,185,185,185,186,186,187,187,187,188,188,189,189,189,190,190,191,191,191,192,192,192,193,193,194,194,194,195,195,195,196,196,197,197,197,198,198,199,199,199,200,200,200,201,201,202,202,202,203,203,203,204,204,205,205,205,206,206,206,207,207,207,208,208,208,209,209,209,210,210,210,211,211,211,212,212,212,213,213,214,214,214,215,215,215,216,216,216,217,217,217,218,218,218,219,219,219,220,220,220,221,221,221,222,222,222,223,223,223,224,224,224,225,225,225,226,226,226,227,227,227,228,228,228,229,229,229,229,230,230,230,231,231,231,232,232,232,233,233,233,234,234,234,235,235,235,
+		236,236,236,237,237,237,237,238,238,238,239,239,239,239,240,240,240,241,241,241,242,242,242,243,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,253,253,253,254,254,254,255,255,255,256,256,256,256,257,257,257,257,258,258,258,259,259,259,259,260,260,260,261,261,261,261,262,262,262,263,263,263,263,264,264,264,265,265,265,265,266,266,266,267,267,267,267,268,268,268,269,269,269,270,270,270,270,271,271,271,271,272,272,272,272,273,273,273,274,274,274,274,275,275,275,276,276,276,276,277,277,277,277,278,278,278,279,279,279,280,280,280,280,281,281,281,282,282,282,282,283,283,283,284,284,284,284,285,285,285,285,286,286,286,286,287,287,287,287,288,288,288,288,289,289,289,289,290,290,290,290,291,291,291,292,292,292,292,293,293,293,294,294,294,295,295,295,295,296,296,296,296,297,297,297,297,298,298,298,298,299,299,299,300,300,300,301,301,301,301,302,302,302,302,303,303,303,303,303,304,304,304,305,305,305,305,306,306,306,306,307,307,307,
+		307,308,308,308,308,309,309,309,310,310,310,310,311,311,311,312,312,312,312,313,313,313,313,314,314,314,315,315,315,315,316,316,316,316,317,317,317,317,318,318,318,319,319,319,320,320,320,320,321,321,321,321,321,322,322,322,322,323,323,323,323,324,324,324,324,325,325,325,325,325,326,326,326,327,327,327,328,328,328,329,329,329,329,329,330,330,330,330,331,331,331,332,332,332,332,333,333,333,333,334,334,334,335,335,335,335,336,336,336,336,337,337,337,337,337,338,338,338,338,339,339,339,339,340,340,340,340,341,341,341,341,342,342,342,343,343,343,343,344,344,344,344,345,345,345,346,346,346,347,347,347,347,348,348,348,348,349,349,349,349,350,350,350,350,351,351,351,352,352,352,352,353,353,353,354,354,354,354,355,355,355,355,356,356,356,356,357,357,357,357,358,358,358,358,359,359,359,359,360,360,360,360,361,361,361,361,362,362,362,363,363,363,364,364,364,364,365,365,365,365,366,366,366,366,367,367,367,367,368,368,368,369,369,369,369,370,370,370,370,371,371,371,371,372,372,372,373,373,373,373,374,374,374,374,375,
+		375,375,376,376,376,377,377,377,378,378,378,378,378,379,379,379,380,380,380,381,381,381,381,382,382,382,383,383,383,383,384,384,384,385,385,385,386,386,386,386,386,387,387,387,387,388,388,388,388,389,389,389,390,390,390,391,391,391,392,392,392,392,393,393,393,393,394,394,394,394,395,395,395,396,396,396,397,397,397,398,398,398,399,399,399,400,400,400,400,400,401,401,401,401,402,402,402,402,403,403,403,404,404,404,404,405,405,405,406,406,406,406,407,407,407,408,408,408,408,409,409,409,410,410,411,411,411,411,412,412,413,413,413,413,414,414,414,414,415,415,415,415,416,416,416,417,417,417,418,418,418,418,419,419,419,419,420,420,420,421,421,421,421,422,422,422,423,423,423,423,424,424,424,424,425,425,425,426,426,426,426,427,427,427,427,428,428,428,428,429,429,429,429,429,429,430,430,430,430,430,431,431,431,431,432,432,432,433,433,433,433,434,434,434,434,434,435,435,435,435,435,436,436,436,436,437,437,437,437,437,438,438,438,438,438,438,439,439,439,439,440,440,440,440,441,441,441,441,441,441,442,442,442,442,442,
+		442,442,443,443,443,443,443,444,444,444,444,444,445,445,445,445,445,445,446,446,446,446,446,446,447,447,447,447,447,447,447,447,448,448,448,448,448,448,448,449,449,449,449,449,449,450,450,450,450,450,450,451,451,451,451,451,451,451,451,451,451,452,452,452,452,452,452,453,453,453,453,453,453,453,454,454,454,454,454,454,454,454,455,455,455,455,455,455,456,456,456,456,456,456,456,456,456,457,457,457,457,457,457,457,457,457,458,458,458,458,458,458,458,459,459,459,459,459,459,459,459,459,459,460,460,460,460,460,460,460,460,460,461,461,461,461,461,461,461,461,462,462,462,462,462,462,462,462,462,463,463,463,463,463,463,463,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,465,465,465,465,465,465,465,465,465,465,466,466,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467,467,467,467,467,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,469,469,469,469,469,469,470,470,470,470,470,470,470,470,470,470,470,470,470,470,471,471,471,471,471,472,472,472,472,472,472,472,473,473,473,473,
+		473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,474,474,474,474,474,474,474,474,475,475,475,475,475,475,475,475,475,475,475,475,476,476,476,476,476,476,476,476,476,476,477,477,477,477,477,477,477,477,477,477,477,477,477,477,478,478,478,478,478,478,478,478,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480,480,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,482,482,482,482,482,482,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,483,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,485,485,485,485,485,485,485,485,485,485,485,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,487,487,487,487,487,487,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,490,490,490,490,490,490,490,490,490,490,490,490,490,490,490,490,490,491,491,491,491,491,491,491,491,491,491,491,491,491,491,492,492,492,
+		493,493,493,493,493,493,493,493,493,493,493,494,494,494,494,494,494,494,494,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,495,496,496,496,496,496,496,496,496,496,497,497,497,497,497,497,497,498,498,498,498,498,498,498,498,498,498,498,498,498,498,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,500,500,500,500,500,500,500,500,500,500,501,501,501,501,501,501,501,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,502,503,503,503,503,503,503,503,503,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,505,505,505,505,505,505,505,505,506,506,506,506,506,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,508,508,508,508,508,508,508,509,509,509,509,509,509,510,510,510,511,511,511,511,511,511,511,511,511,511,511,511,511,512,512,513,513,513,513,513,513,513,513,513,513,514,514,514,514,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,516,516,516,516,516,516,517,517,517,517,517,517,518,
+		518,518,518,518,518,518,518,518,519
+	},
+	{
+		0,0,0,3,5,6,8,9,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,17,17,17,17,18,18,18,18,18,19,19,19,19,20,20,20,20,20,21,21,21,22,22,22,22,23,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,30,30,30,31,31,32,32,33,33,34,34,35,35,36,37,37,38,39,39,40,41,42,43,43,44,45,46,47,48,49,49,50,51,52,53,54,55,55,56,57,58,59,59,60,61,62,62,63,64,64,65,66,67,67,68,69,69,70,71,71,72,72,73,74,74,75,76,76,77,77,78,79,79,80,80,81,82,82,83,83,84,85,85,86,86,87,87,88,89,89,90,90,91,91,92,92,93,94,94,95,95,96,97,97,98,98,99,99,100,100,101,102,102,103,103,104,105,105,106,106,107,107,108,108,109,110,110,111,111,112,
+		112,113,113,114,115,115,116,116,117,117,118,118,119,119,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,130,130,131,131,132,132,133,133,134,134,135,135,136,136,137,137,138,138,139,139,140,140,141,141,142,142,143,143,144,144,145,145,146,146,146,147,147,148,148,149,149,150,150,151,151,152,152,152,153,153,154,154,155,155,155,156,156,157,157,158,158,159,159,160,160,160,161,161,162,162,162,163,163,164,164,164,165,165,166,166,166,167,167,168,168,168,169,169,169,170,170,171,171,171,172,172,173,173,173,174,174,174,175,175,176,176,176,177,177,177,178,178,178,179,179,180,180,180,181,181,182,182,182,183,183,183,184,184,184,185,185,185,186,186,186,187,187,187,188,188,188,189,189,189,190,190,190,191,191,191,192,192,192,193,193,193,194,194,195,195,195,195,196,196,196,197,197,197,198,198,198,199,199,199,200,200,200,200,201,201,201,202,202,202,202,203,203,204,204,204,204,205,205,205,206,206,206,207,207,207,207,208,208,208,209,209,209,209,210,210,210,211,211,211,212,212,212,213,213,213,213,214,214,
+		214,215,215,215,215,216,216,216,216,217,217,217,218,218,218,218,219,219,219,220,220,220,221,221,221,221,222,222,222,223,223,223,223,224,224,224,224,225,225,225,225,226,226,226,227,227,227,227,228,228,228,229,229,229,229,230,230,230,230,231,231,231,232,232,232,233,233,233,233,234,234,234,234,235,235,235,235,236,236,236,236,237,237,237,238,238,238,238,239,239,239,240,240,240,240,240,241,241,241,241,242,242,242,242,243,243,243,243,244,244,244,244,245,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,254,254,254,255,255,255,255,255,256,256,256,256,256,256,257,257,257,257,258,258,258,259,259,259,259,260,260,260,260,260,261,261,261,261,262,262,262,262,262,263,263,263,263,264,264,264,265,265,265,265,266,266,266,266,267,267,267,267,268,268,268,268,268,269,269,269,270,270,270,270,271,271,271,272,272,272,272,272,273,273,273,273,274,274,274,274,275,275,275,275,276,276,276,276,277,277,277,277,277,278,278,278,278,279,279,279,279,280,280,280,
+		280,280,281,281,281,281,282,282,282,282,282,283,283,283,284,284,284,284,285,285,285,285,286,286,286,286,287,287,287,287,288,288,288,288,288,289,289,289,289,290,290,290,291,291,291,291,291,292,292,292,292,292,293,293,293,293,293,294,294,294,294,295,295,295,295,296,296,296,296,297,297,297,297,298,298,298,298,298,299,299,299,300,300,300,300,301,301,301,301,302,302,302,302,302,303,303,303,303,303,304,304,304,304,305,305,305,305,306,306,306,307,307,307,307,307,308,308,308,308,309,309,309,309,310,310,310,310,310,311,311,311,311,311,312,312,312,312,313,313,313,313,314,314,314,314,315,315,315,315,316,316,316,316,316,317,317,317,317,318,318,318,319,319,319,319,320,320,320,320,321,321,321,321,321,322,322,322,322,323,323,323,323,324,324,324,324,325,325,325,325,325,326,326,326,326,326,327,327,327,327,328,328,328,328,329,329,329,329,330,330,330,330,331,331,331,331,331,332,332,332,333,333,333,333,333,334,334,334,334,334,335,335,335,336,336,336,336,336,337,337,337,338,338,338,338,339,339,339,339,340,340,340,340,340,341,
+		341,341,341,342,342,342,342,342,343,343,343,343,344,344,344,344,345,345,345,346,346,346,346,347,347,347,347,348,348,348,348,349,349,349,349,349,349,349,350,350,350,351,351,351,351,352,352,352,352,353,353,353,353,354,354,354,354,355,355,355,355,355,356,356,356,356,356,357,357,357,357,358,358,358,359,359,359,359,359,360,360,360,360,360,361,361,361,362,362,362,362,362,363,363,363,363,364,364,364,364,365,365,365,365,366,366,366,366,366,367,367,367,367,367,368,368,368,368,369,369,369,369,370,370,370,370,371,371,371,372,372,372,372,372,373,373,373,373,374,374,374,374,375,375,375,375,375,376,376,376,376,377,377,377,377,378,378,378,378,379,379,379,380,380,380,380,381,381,381,381,382,382,382,382,383,383,383,383,383,384,384,384,384,384,385,385,385,385,386,386,386,387,387,387,387,388,388,388,388,389,389,389,389,390,390,390,390,391,391,391,391,391,392,392,392,392,393,393,393,393,394,394,395,395,395,396,396,396,396,397,397,397,398,398,398,398,399,399,399,399,400,400,400,400,401,401,401,401,402,402,402,402,403,403,403,
+		403,404,404,404,404,405,405,405,405,406,406,406,406,407,407,407,407,408,408,408,408,409,409,409,410,410,410,410,411,411,411,412,412,412,412,413,413,413,414,414,414,415,415,415,415,415,416,416,416,416,416,416,417,417,417,417,418,418,418,419,419,419,419,420,420,420,420,420,421,421,421,421,421,422,422,422,422,423,423,423,423,424,424,424,424,424,425,425,425,425,425,426,426,426,427,427,427,427,427,427,428,428,428,428,429,429,429,429,429,430,430,430,430,430,431,431,431,431,431,431,432,432,432,432,432,433,433,433,433,433,434,434,434,434,434,434,435,435,435,435,435,435,436,436,436,436,436,436,437,437,437,437,437,438,438,438,438,438,438,438,438,439,439,439,439,439,439,439,440,440,440,440,440,440,440,440,440,441,441,441,441,441,441,442,442,442,442,442,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444,444,444,444,444,445,445,445,445,445,445,445,445,446,446,446,446,446,446,446,446,447,447,447,447,447,447,447,447,448,448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,449,450,450,450,450,450,450,
+		450,451,451,451,451,451,451,451,451,451,451,451,451,452,452,452,452,452,452,452,453,453,453,453,453,453,453,453,453,453,453,454,454,454,454,454,454,455,455,455,455,455,455,455,455,455,455,455,455,455,455,455,455,456,456,456,456,456,456,456,456,457,457,457,457,457,457,457,457,457,457,457,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,459,459,459,459,459,459,460,460,460,460,460,460,460,460,460,460,460,460,460,460,461,461,461,461,461,461,461,461,462,462,462,462,462,462,462,462,462,462,462,462,462,462,462,462,463,463,463,463,463,463,463,463,463,463,463,463,464,464,464,464,464,464,464,464,464,464,464,464,464,464,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,466,466,466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,469,469,469,469,469,469,469,469,469,470,470,470,470,470,470,470,470,470,470,470,470,470,470,470,
+		471,471,471,471,471,471,471,471,471,471,471,471,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,475,475,475,475,475,475,475,475,475,475,475,475,475,475,476,476,476,476,476,476,476,476,476,476,476,476,476,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,479,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,481,481,481,481,481,481,481,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,483,483,483,483,483,483,483,483,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,484,485,485,485,485,485,485,485,485,485,485,485,485,486,486,486,486,486,486,486,486,486,
+		486,486,486,486,486,486,486,486,486
+	},
+	{
+		0,0,0,0,1,3,4,6,7,8,10,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,19,19,20,20,20,20,20,21,21,21,21,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,33,33,34,34,35,35,36,37,37,38,38,39,40,40,41,42,43,43,44,45,46,46,47,48,49,49,50,51,52,52,53,54,55,55,56,57,57,58,59,59,60,61,61,62,63,63,64,64,65,66,66,67,67,68,69,69,70,70,71,71,72,72,73,74,74,75,75,76,76,77,77,78,78,79,79,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,
+		97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,108,108,109,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129,130,130,130,131,131,132,132,133,133,134,134,135,135,135,136,136,137,137,138,138,139,139,139,140,140,141,141,142,142,142,143,143,144,144,145,145,145,146,146,147,147,147,148,148,149,149,149,150,150,151,151,151,152,152,153,153,153,154,154,155,155,155,156,156,156,157,157,158,158,158,159,159,159,160,160,160,161,161,161,162,162,163,163,163,164,164,164,165,165,165,166,166,166,167,167,167,168,168,168,169,169,169,170,170,170,171,171,171,172,172,172,173,173,173,174,174,174,175,175,175,176,176,176,177,177,177,177,178,178,178,179,179,179,180,180,180,181,181,181,182,182,182,183,183,183,183,184,184,184,185,185,185,186,186,186,186,187,187,187,187,188,188,188,189,189,189,190,190,190,190,191,191,191,192,192,192,192,193,193,193,194,194,194,194,195,195,195,195,196,
+		196,196,197,197,197,197,198,198,198,199,199,199,199,200,200,200,200,201,201,201,201,202,202,202,203,203,203,203,204,204,204,205,205,205,205,205,206,206,206,206,207,207,207,207,208,208,208,208,209,209,209,210,210,210,211,211,211,211,212,212,212,212,212,213,213,213,213,214,214,214,214,214,215,215,215,215,216,216,216,216,217,217,217,218,218,218,218,219,219,219,220,220,220,220,221,221,221,221,221,222,222,222,222,223,223,223,223,224,224,224,224,224,225,225,225,225,226,226,226,226,227,227,227,227,228,228,228,228,229,229,229,229,230,230,230,230,230,231,231,231,231,232,232,232,233,233,233,233,233,234,234,234,234,234,235,235,235,235,236,236,236,236,237,237,237,237,238,238,238,238,239,239,239,239,240,240,240,240,240,240,241,241,241,241,242,242,242,242,243,243,243,243,244,244,244,244,244,244,245,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,255,255,255,255,255,256,256,256,256,256,257,257,257,257,
+		258,258,258,258,259,259,259,259,259,260,260,260,260,260,260,261,261,261,261,261,262,262,262,263,263,263,263,264,264,264,264,264,265,265,265,265,265,266,266,266,266,267,267,267,267,268,268,268,268,269,269,269,269,269,270,270,270,270,270,271,271,271,271,271,272,272,272,272,273,273,273,273,273,274,274,274,274,274,275,275,275,275,275,276,276,276,276,276,277,277,277,277,278,278,278,278,279,279,279,279,279,280,280,280,280,280,281,281,281,281,281,282,282,282,282,282,283,283,283,283,284,284,284,284,284,285,285,285,285,285,286,286,286,286,287,287,287,287,287,288,288,288,288,288,289,289,289,289,290,290,290,290,290,290,291,291,291,291,292,292,292,293,293,293,293,294,294,294,294,294,294,295,295,295,295,295,296,296,296,297,297,297,297,297,298,298,298,298,298,299,299,299,299,299,300,300,300,300,301,301,301,301,301,301,301,302,302,302,302,303,303,303,303,303,304,304,304,304,305,305,305,305,305,306,306,306,306,307,307,307,307,308,308,308,308,309,309,309,309,309,310,310,310,310,310,311,311,311,312,312,312,312,312,312,312,
+		313,313,313,313,313,313,314,314,314,315,315,315,315,316,316,316,316,317,317,317,317,317,318,318,318,318,318,319,319,319,319,319,319,320,320,320,320,321,321,321,321,322,322,322,322,323,323,323,323,324,324,324,324,324,324,325,325,325,325,325,326,326,326,326,326,327,327,327,327,327,328,328,328,328,328,329,329,329,329,330,330,330,330,330,331,331,331,331,331,332,332,332,332,332,333,333,333,333,334,334,334,334,334,334,335,335,335,335,336,336,336,336,337,337,337,337,337,338,338,338,338,338,339,339,339,339,339,340,340,340,340,340,340,341,341,341,341,342,342,342,342,343,343,343,343,343,344,344,344,344,345,345,345,345,345,346,346,346,346,346,346,347,347,347,348,348,348,348,348,349,349,349,349,349,349,350,350,350,350,350,351,351,351,351,351,352,352,352,352,352,352,353,353,353,353,354,354,354,354,354,355,355,355,355,356,356,356,356,357,357,357,357,357,357,358,358,358,358,359,359,359,360,360,360,360,361,361,361,361,362,362,362,362,362,362,363,363,363,363,363,363,364,364,364,364,364,365,365,365,365,366,366,366,366,367,
+		367,367,367,368,368,368,368,368,369,369,369,369,369,370,370,370,370,370,371,371,371,371,372,372,372,373,373,373,373,374,374,374,374,374,375,375,375,375,375,376,376,376,376,376,377,377,377,377,377,378,378,378,378,379,379,379,379,380,380,380,380,381,381,381,381,382,382,382,382,382,383,383,383,383,384,384,384,384,384,385,385,385,385,385,386,386,386,386,387,387,387,387,388,388,388,388,389,389,389,389,389,390,390,390,391,391,391,391,392,392,392,392,392,393,393,393,393,394,394,394,394,395,395,395,395,396,396,396,396,397,397,397,397,397,398,398,398,398,399,399,399,400,400,400,400,400,401,401,401,401,401,402,402,402,402,403,403,403,403,403,404,404,404,404,405,405,405,405,406,406,406,406,406,407,407,407,407,408,408,408,408,409,409,409,410,410,410,410,410,411,411,411,411,411,412,412,412,412,412,412,413,413,413,413,413,414,414,414,414,415,415,415,415,415,416,416,416,416,417,417,417,417,418,418,418,418,418,418,419,419,419,419,419,420,420,420,420,420,421,421,421,421,421,422,422,422,422,423,423,423,423,423,423,423,423,
+		423,424,424,424,424,424,425,425,425,425,425,425,426,426,426,426,426,427,427,427,427,427,427,428,428,428,428,428,428,429,429,429,429,429,429,429,430,430,430,430,430,430,431,431,431,431,431,431,432,432,432,432,432,432,433,433,433,433,433,433,434,434,434,434,434,434,434,435,435,435,435,435,435,435,435,435,435,436,436,436,436,436,436,436,436,436,437,437,437,437,437,437,437,437,437,438,438,438,438,438,438,439,439,439,439,439,439,439,439,439,439,440,440,440,440,440,440,440,440,441,441,441,441,441,441,441,442,442,442,442,442,442,442,442,442,442,442,442,442,442,443,443,443,443,443,443,444,444,444,444,444,444,444,444,444,444,444,445,445,445,445,445,445,445,445,445,445,445,445,445,446,446,446,446,446,446,446,446,446,446,446,446,446,447,447,447,447,447,447,447,447,447,447,447,447,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,450,450,450,450,450,450,450,450,450,450,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,451,452,452,452,452,452,452,452,452,
+		452,452,452,452,452,453,453,453,453,453,453,453,453,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,454,455,455,455,455,455,455,455,455,455,455,455,455,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,457,457,457,457,457,457,457,457,457,457,457,457,457,457,457,457,457,457,457,457,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,458,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,460,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,461,462,462,462,462,462,462,462,462,462,462,462,462,462,462,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,463,464,464,464,464,464,464,464,464,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,466,466,466,466,466,466,466,466,
+		466,466,466,466,466,466,466,466,466
+	},
+	{
+		0,0,0,0,0,0,0,0,1,2,3,3,3,4,5,6,7,7,7,7,7,8,8,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,20,20,20,20,20,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,29,29,29,30,30,31,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,40,40,41,42,42,43,44,44,45,46,46,47,48,49,49,50,51,51,52,53,53,54,55,55,56,56,57,58,58,59,60,60,61,61,62,62,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,82,83,83,84,84,85,85,86,86,87,87,
+		88,88,89,89,89,90,90,91,91,92,92,93,93,94,94,94,95,95,96,96,97,97,98,98,99,99,100,100,101,101,101,102,102,103,103,104,104,105,105,106,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,113,114,114,115,115,116,116,117,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,124,125,125,126,126,126,127,127,128,128,129,129,129,130,130,131,131,131,132,132,133,133,133,134,134,135,135,135,136,136,137,137,138,138,138,139,139,140,140,140,141,141,142,142,142,143,143,143,144,144,145,145,145,146,146,147,147,147,148,148,148,149,149,149,150,150,150,151,151,151,152,152,153,153,153,154,154,154,155,155,155,156,156,156,157,157,157,158,158,158,159,159,159,160,160,160,161,161,161,162,162,162,163,163,163,163,164,164,164,165,165,165,166,166,166,167,167,167,168,168,168,169,169,169,169,170,170,170,171,171,171,171,172,172,172,173,173,173,174,174,174,174,175,175,175,176,176,176,176,177,177,177,177,178,178,178,179,179,179,179,180,180,180,180,181,181,181,182,182,182,182,183,183,183,184,
+		184,184,184,185,185,185,185,186,186,186,187,187,187,187,188,188,188,188,189,189,189,189,190,190,190,190,191,191,191,191,191,192,192,192,193,193,193,193,194,194,194,194,195,195,195,196,196,196,196,196,197,197,197,197,197,198,198,198,199,199,199,199,200,200,200,200,201,201,201,201,202,202,202,202,202,203,203,203,203,203,204,204,204,204,205,205,205,205,206,206,206,206,207,207,207,207,208,208,208,208,208,208,209,209,209,209,210,210,210,210,211,211,211,211,212,212,212,212,212,213,213,213,213,213,214,214,214,214,215,215,215,216,216,216,216,217,217,217,217,217,217,218,218,218,218,218,219,219,219,219,219,220,220,220,220,221,221,221,221,222,222,222,222,222,222,223,223,223,223,224,224,224,224,225,225,225,225,225,226,226,226,226,226,227,227,227,227,227,228,228,228,228,228,229,229,229,229,229,230,230,230,230,231,231,231,231,231,232,232,232,232,233,233,233,233,233,234,234,234,234,235,235,235,235,235,236,236,236,236,236,237,237,237,237,238,238,238,238,238,239,239,239,239,239,240,240,240,240,240,241,241,241,241,241,242,
+		242,242,242,242,243,243,243,243,243,244,244,244,244,244,245,245,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,255,255,255,255,255,256,256,256,256,256,257,257,257,257,257,258,258,258,258,259,259,259,259,260,260,260,260,260,260,261,261,261,261,261,261,262,262,262,262,262,263,263,263,263,263,264,264,264,264,264,265,265,265,265,265,266,266,266,266,266,267,267,267,267,267,268,268,268,268,268,269,269,269,269,269,270,270,270,270,271,271,271,271,271,272,272,272,272,272,272,272,273,273,273,273,274,274,274,274,274,274,275,275,275,275,275,276,276,276,276,277,277,277,277,277,278,278,278,278,279,279,279,279,279,279,280,280,280,280,280,280,281,281,281,281,281,282,282,282,282,283,283,283,283,283,283,284,284,284,284,284,284,285,285,285,285,285,286,286,286,286,287,287,287,287,287,288,288,288,288,288,289,289,289,289,289,290,290,290,290,290,291,291,291,291,292,292,292,292,293,293,
+		293,293,293,293,294,294,294,294,294,294,295,295,295,296,296,296,296,296,296,297,297,297,297,297,297,298,298,298,298,298,299,299,299,299,300,300,300,300,300,301,301,301,301,301,301,301,302,302,302,302,302,303,303,303,303,304,304,304,304,304,305,305,305,305,305,306,306,306,306,306,306,307,307,307,307,307,307,308,308,308,308,309,309,309,309,309,309,310,310,310,310,310,311,311,311,311,312,312,312,312,312,313,313,313,313,313,313,314,314,314,314,314,314,315,315,315,315,315,315,315,316,316,316,316,316,317,317,317,317,317,318,318,318,318,318,319,319,319,319,319,320,320,320,320,320,321,321,321,321,321,321,322,322,322,322,322,323,323,323,323,323,324,324,324,325,325,325,325,325,325,326,326,326,326,326,326,327,327,327,327,327,328,328,328,328,328,329,329,329,329,329,329,330,330,330,330,330,331,331,331,331,331,332,332,332,332,332,333,333,333,333,333,334,334,334,334,334,335,335,335,335,335,336,336,336,336,336,337,337,337,337,337,338,338,338,338,338,339,339,339,339,339,339,339,340,340,340,340,340,340,341,341,341,342,342,
+		342,342,342,343,343,343,343,343,343,344,344,344,344,344,345,345,345,345,345,346,346,346,346,346,347,347,347,347,348,348,348,348,348,348,349,349,349,349,349,350,350,350,350,350,351,351,351,351,351,351,352,352,352,352,352,352,353,353,353,353,354,354,354,354,354,354,355,355,355,355,355,356,356,356,356,357,357,357,357,357,357,358,358,358,358,358,359,359,359,359,359,359,360,360,360,360,360,360,361,361,361,361,362,362,362,362,363,363,363,363,363,363,364,364,364,364,364,364,365,365,365,365,366,366,366,366,367,367,367,367,368,368,368,368,368,368,369,369,369,369,369,370,370,370,370,370,371,371,371,371,371,372,372,372,372,372,373,373,373,373,373,374,374,374,374,374,374,375,375,375,375,375,376,376,376,376,377,377,377,377,377,378,378,378,378,378,378,379,379,379,379,380,380,380,380,380,380,381,381,381,381,381,381,382,382,382,382,383,383,383,383,384,384,384,384,384,384,385,385,385,385,385,386,386,386,386,386,387,387,387,387,388,388,388,388,389,389,389,389,390,390,390,390,391,391,391,391,392,392,392,392,392,393,393,393,
+		393,393,393,393,394,394,394,394,394,395,395,395,396,396,396,396,396,397,397,397,397,397,398,398,398,398,399,399,399,399,399,400,400,400,400,400,401,401,401,401,401,402,402,402,402,402,403,403,403,404,404,404,404,405,405,405,405,406,406,406,406,406,407,407,407,407,407,408,408,408,408,408,408,409,409,409,409,409,409,410,410,410,410,411,411,411,411,412,412,412,412,412,413,413,413,413,413,414,414,414,414,414,415,415,415,415,416,416,416,416,416,417,417,417,417,417,417,418,418,418,418,418,419,419,419,419,419,419,420,420,420,420,420,420,421,421,421,421,421,421,421,422,422,422,422,423,423,423,423,423,424,424,424,424,424,425,425,425,425,425,425,425,426,426,426,426,426,426,426,426,426,427,427,427,427,427,428,428,428,428,428,428,428,428,428,428,429,429,429,429,429,429,429,429,430,430,430,430,430,431,431,431,431,431,431,432,432,432,432,432,432,432,432,432,432,432,433,433,433,433,433,433,434,434,434,434,434,434,434,434,434,434,434,434,435,435,435,435,435,435,435,436,436,436,436,436,436,436,436,436,437,437,437,437,437,
+		437,437,437,437,438,438,438,438,438,438,438,438,438,438,438,438,438,439,439,439,439,439,439,439,439,439,439,439,439,439,439,440,440,440,440,440,440,440,440,440,440,440,440,441,441,441,441,441,441,441,441,441,441,441,441,441,442,442,442,442,442,442,442,442,442,443,443,443,443,443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444,444,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,446,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,447,448,448,448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,449,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,451,451,451,451,451,451,451,451,451,452,452,452,452,452,452,452,452,452,452,452,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,453,
+		454,454,454,454,454,454,454,454,454
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,4,5,5,6,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,33,33,34,34,34,35,35,36,36,37,37,38,38,39,39,40,41,41,42,42,43,44,44,45,45,46,47,47,48,48,49,49,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,65,66,66,67,67,68,68,68,69,69,70,70,71,71,
+		71,72,72,73,73,73,74,74,75,75,75,76,76,77,77,78,78,78,79,79,80,80,80,81,81,81,82,82,83,83,83,84,84,85,85,85,86,86,87,87,87,88,88,88,89,89,90,90,90,91,91,92,92,92,93,93,94,94,94,95,95,96,96,96,97,97,98,98,98,99,99,100,100,100,101,101,101,102,102,103,103,103,104,104,104,105,105,106,106,106,107,107,108,108,108,109,109,110,110,110,111,111,112,112,112,113,113,113,114,114,115,115,115,116,116,116,117,117,118,118,118,119,119,120,120,120,121,121,121,122,122,123,123,123,124,124,124,125,125,125,126,126,126,127,127,128,128,128,129,129,129,130,130,130,131,131,131,132,132,132,133,133,134,134,134,135,135,135,136,136,136,137,137,137,138,138,138,139,139,139,140,140,140,141,141,141,141,142,142,142,143,143,143,144,144,144,145,145,145,146,146,146,146,147,147,147,148,148,148,149,149,149,149,150,150,150,151,151,151,152,152,152,153,153,153,153,154,154,154,154,155,155,155,155,156,156,156,157,157,157,157,158,158,158,158,159,159,159,160,160,160,160,161,161,161,
+		162,162,162,162,163,163,163,163,164,164,164,164,164,165,165,165,166,166,166,166,167,167,167,167,168,168,168,168,169,169,169,169,169,170,170,170,170,171,171,171,171,172,172,172,172,173,173,173,173,174,174,174,174,174,175,175,175,175,175,176,176,176,176,177,177,177,178,178,178,178,178,179,179,179,179,179,180,180,180,180,181,181,181,181,181,182,182,182,182,183,183,183,183,183,184,184,184,184,184,185,185,185,185,185,186,186,186,186,187,187,187,187,187,188,188,188,188,189,189,189,189,190,190,190,190,190,191,191,191,191,191,191,192,192,192,192,193,193,193,193,194,194,194,194,194,194,195,195,195,195,195,195,196,196,196,196,197,197,197,197,197,198,198,198,198,198,199,199,199,199,199,200,200,200,200,200,201,201,201,201,201,201,202,202,202,202,202,202,203,203,203,203,203,203,204,204,204,204,204,205,205,205,205,205,206,206,206,206,206,207,207,207,207,207,207,208,208,208,208,208,209,209,209,209,209,209,210,210,210,210,210,211,211,211,211,211,212,212,212,212,212,212,213,213,213,213,213,214,214,214,214,214,214,215,215,
+		215,215,215,216,216,216,216,216,217,217,217,217,217,217,218,218,218,218,218,218,219,219,219,219,219,220,220,220,220,220,220,221,221,221,221,221,221,222,222,222,222,222,223,223,223,223,223,224,224,224,224,224,224,225,225,225,225,225,225,226,226,226,226,226,227,227,227,227,227,227,228,228,228,228,228,229,229,229,229,229,229,230,230,230,230,230,230,230,231,231,231,231,231,231,232,232,232,232,233,233,233,233,233,234,234,234,234,234,234,235,235,235,235,235,235,236,236,236,236,236,236,236,237,237,237,237,237,237,238,238,238,238,238,238,239,239,239,239,239,240,240,240,240,240,241,241,241,241,241,241,241,242,242,242,242,242,242,243,243,243,243,243,243,244,244,244,244,244,244,245,245,245,245,245,245,246,246,246,246,246,247,247,247,247,247,248,248,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,254,254,254,254,254,255,255,255,255,255,256,256,256,256,256,256,256,257,257,257,257,257,258,258,258,258,258,258,259,259,259,259,259,
+		260,260,260,260,260,261,261,261,261,261,261,261,261,262,262,262,262,262,263,263,263,263,263,264,264,264,264,264,264,264,265,265,265,265,265,265,266,266,266,266,266,266,267,267,267,267,267,267,268,268,268,268,268,269,269,269,269,269,269,269,270,270,270,270,270,270,271,271,271,271,271,272,272,272,272,272,272,272,272,273,273,273,273,273,274,274,274,274,274,274,275,275,275,275,275,275,275,276,276,276,276,276,277,277,277,277,277,277,278,278,278,278,278,278,278,278,279,279,279,279,279,280,280,280,280,280,280,280,281,281,281,281,281,281,282,282,282,282,282,283,283,283,283,283,283,284,284,284,284,284,284,285,285,285,285,285,285,285,285,286,286,286,286,286,287,287,287,287,287,288,288,288,288,288,288,289,289,289,289,289,289,289,289,290,290,290,290,290,290,291,291,291,291,291,291,291,292,292,292,292,292,293,293,293,293,293,294,294,294,294,294,294,295,295,295,295,295,296,296,296,296,296,296,297,297,297,297,297,297,297,297,298,298,298,298,298,299,299,299,299,299,300,300,300,300,300,300,301,301,301,301,301,301,301,302,
+		302,302,302,302,303,303,303,303,303,304,304,304,304,304,304,304,304,305,305,305,305,305,305,306,306,306,306,306,306,307,307,307,307,307,307,308,308,308,308,308,308,309,309,309,309,309,309,310,310,310,310,310,310,311,311,311,311,311,311,311,312,312,312,312,312,312,312,313,313,313,313,313,314,314,314,314,314,315,315,315,315,315,315,316,316,316,316,316,316,317,317,317,317,317,317,318,318,318,318,318,318,318,319,319,319,319,319,319,319,320,320,320,320,320,320,321,321,321,321,322,322,322,322,322,322,323,323,323,323,323,323,324,324,324,324,324,324,324,325,325,325,325,325,325,325,326,326,326,326,326,326,326,327,327,327,327,327,327,328,328,328,328,328,328,329,329,329,329,329,329,330,330,330,330,330,330,330,330,331,331,331,331,331,331,332,332,332,332,332,333,333,333,333,334,334,334,334,334,334,334,334,335,335,335,335,335,336,336,336,336,336,336,336,337,337,337,337,337,337,338,338,338,338,338,338,338,339,339,339,339,340,340,340,340,340,340,340,341,341,341,341,341,341,342,342,342,342,342,342,343,343,343,343,343,343,
+		344,344,344,344,344,344,344,344,345,345,345,345,345,345,346,346,346,346,346,346,346,347,347,347,347,347,347,348,348,348,348,348,348,348,349,349,349,349,349,350,350,350,350,350,351,351,351,351,351,351,351,352,352,352,352,353,353,353,353,353,354,354,354,354,354,354,354,354,354,355,355,355,355,355,355,355,356,356,356,356,356,356,356,356,356,356,357,357,357,357,357,358,358,358,358,359,359,359,359,359,359,359,360,360,360,360,360,361,361,361,361,361,361,362,362,362,362,362,362,362,363,363,363,363,363,364,364,364,364,364,364,365,365,365,365,365,365,365,365,366,366,366,366,366,366,367,367,367,367,367,368,368,368,368,368,368,368,369,369,369,369,369,370,370,370,370,370,370,370,371,371,371,371,371,371,372,372,372,372,372,372,373,373,373,373,373,373,373,373,373,373,374,374,374,374,375,375,375,375,375,376,376,376,376,376,376,377,377,377,377,378,378,378,378,378,378,378,378,379,379,379,379,379,380,380,380,380,380,380,380,381,381,381,381,381,381,382,382,382,383,383,383,383,383,384,384,384,384,384,385,385,385,385,385,385,
+		385,386,386,386,386,387,387,387,387,387,388,388,388,388,389,389,389,389,389,389,389,390,390,390,390,390,391,391,391,391,391,391,392,392,392,392,392,393,393,393,393,394,394,394,394,394,395,395,395,395,395,395,395,396,396,396,396,396,397,397,397,397,397,397,398,398,398,398,398,399,399,399,400,400,400,400,400,400,400,401,401,401,401,401,401,402,402,402,402,402,402,403,403,403,403,403,404,404,404,404,405,405,405,405,405,406,406,406,406,406,406,407,407,407,407,407,408,408,408,408,408,408,408,409,409,409,409,409,409,409,410,410,410,410,410,411,411,411,411,412,412,412,413,413,413,413,413,413,413,413,413,413,414,414,414,414,415,415,415,415,415,415,416,416,416,416,416,416,416,417,417,417,417,417,417,417,418,418,418,418,418,418,418,419,419,419,419,419,419,420,420,420,420,420,420,420,420,421,421,421,421,421,422,422,422,422,422,422,423,423,423,423,423,423,423,423,424,424,424,424,424,424,424,424,424,424,425,425,425,425,425,425,425,425,426,426,426,426,426,426,426,426,427,427,427,427,427,427,427,427,428,428,428,428,428,
+		428,428,429,429,429,429,429,429,429
+	},
+	{
+		0,0,0,0,0,0,1,2,4,5,6,8,9,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,34,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,56,57,57,58,58,59,59,60,60,60,61,61,62,62,63,63,63,
+		64,64,64,65,65,66,66,66,67,67,68,68,68,69,69,70,70,70,71,71,71,72,72,73,73,73,74,74,74,75,75,76,76,76,77,77,77,78,78,79,79,79,80,80,80,81,81,81,82,82,83,83,83,84,84,84,85,85,85,86,86,87,87,87,88,88,88,89,89,89,90,90,91,91,91,92,92,92,93,93,93,94,94,95,95,95,96,96,96,97,97,97,98,98,98,99,99,100,100,100,101,101,101,102,102,102,103,103,103,104,104,105,105,105,106,106,106,107,107,107,108,108,108,109,109,110,110,110,111,111,111,112,112,112,113,113,113,114,114,114,115,115,115,116,116,116,117,117,117,118,118,119,119,119,120,120,120,121,121,121,122,122,122,123,123,123,124,124,124,125,125,125,126,126,126,127,127,127,128,128,128,129,129,129,130,130,130,131,131,131,132,132,132,132,133,133,133,134,134,134,135,135,135,136,136,136,136,137,137,137,138,138,138,139,139,139,140,140,140,140,141,141,141,142,142,142,142,143,143,143,144,144,144,144,145,145,145,146,146,146,146,147,147,147,148,148,148,148,149,149,149,149,150,150,150,
+		150,151,151,151,151,152,152,152,153,153,153,153,154,154,154,154,155,155,155,155,156,156,156,156,157,157,157,157,158,158,158,158,159,159,159,159,160,160,160,160,161,161,161,161,161,162,162,162,162,163,163,163,163,164,164,164,164,164,165,165,165,165,166,166,166,166,166,167,167,167,167,168,168,168,168,168,169,169,169,169,169,170,170,170,170,171,171,171,171,171,172,172,172,172,173,173,173,173,173,174,174,174,174,175,175,175,175,176,176,176,176,176,176,177,177,177,177,177,177,178,178,178,178,179,179,179,179,179,180,180,180,180,180,180,181,181,181,181,182,182,182,182,182,183,183,183,183,183,184,184,184,184,185,185,185,185,185,185,186,186,186,186,186,187,187,187,187,188,188,188,188,188,188,189,189,189,189,189,189,190,190,190,190,190,191,191,191,191,191,191,192,192,192,192,192,192,193,193,193,193,193,194,194,194,194,194,195,195,195,195,195,196,196,196,196,196,197,197,197,197,197,197,197,198,198,198,198,198,198,199,199,199,199,199,200,200,200,200,200,200,201,201,201,201,201,201,202,202,202,202,202,202,202,203,203,
+		203,203,203,203,204,204,204,204,204,205,205,205,205,205,205,206,206,206,206,206,206,207,207,207,207,207,207,208,208,208,208,208,208,209,209,209,209,209,210,210,210,210,210,210,211,211,211,211,211,211,211,212,212,212,212,212,213,213,213,213,213,213,214,214,214,214,214,214,215,215,215,215,215,215,216,216,216,216,216,216,216,216,217,217,217,217,217,217,218,218,218,218,218,219,219,219,219,219,220,220,220,220,220,220,221,221,221,221,221,221,222,222,222,222,222,222,223,223,223,223,223,223,223,224,224,224,224,224,224,225,225,225,225,225,225,226,226,226,226,226,226,226,227,227,227,227,227,228,228,228,228,228,228,229,229,229,229,229,229,230,230,230,230,230,230,230,231,231,231,231,231,232,232,232,232,232,232,233,233,233,233,233,233,233,234,234,234,234,234,234,235,235,235,235,235,235,236,236,236,236,236,236,237,237,237,237,237,237,237,238,238,238,238,238,239,239,239,239,239,239,240,240,240,240,240,240,240,241,241,241,241,241,241,242,242,242,242,242,242,242,243,243,243,243,243,243,244,244,244,244,244,244,245,245,245,
+		245,245,245,245,246,246,246,246,246,246,247,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,253,253,253,253,253,254,254,254,254,254,255,255,255,255,255,255,255,256,256,256,256,256,256,256,257,257,257,257,257,257,257,257,257,258,258,258,258,258,259,259,259,259,259,260,260,260,260,260,260,261,261,261,261,261,261,262,262,262,262,262,262,262,262,263,263,263,263,263,263,264,264,264,264,264,264,264,265,265,265,265,265,265,265,265,266,266,266,266,266,266,267,267,267,267,267,268,268,268,268,268,268,269,269,269,269,269,269,269,270,270,270,270,270,270,270,271,271,271,271,271,271,272,272,272,272,272,272,272,273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,275,275,275,275,275,276,276,276,276,276,276,276,277,277,277,277,277,277,277,278,278,278,278,278,278,279,279,279,279,279,279,279,280,280,280,280,280,280,281,281,281,281,281,281,282,282,282,282,282,283,283,283,283,283,283,283,283,284,284,284,284,284,284,285,
+		285,285,285,285,285,286,286,286,286,286,286,287,287,287,287,287,287,288,288,288,288,288,288,288,289,289,289,289,289,290,290,290,290,290,290,291,291,291,291,291,291,291,291,291,291,292,292,292,292,292,292,292,293,293,293,293,293,293,294,294,294,294,294,295,295,295,295,295,295,296,296,296,296,296,296,297,297,297,297,297,297,297,297,298,298,298,298,298,298,298,299,299,299,299,299,300,300,300,300,300,300,300,301,301,301,301,301,301,301,302,302,302,302,302,302,303,303,303,303,303,303,303,303,303,304,304,304,304,304,304,305,305,305,305,305,305,306,306,306,306,306,307,307,307,307,307,307,308,308,308,308,308,308,309,309,309,309,309,309,309,310,310,310,310,310,310,310,310,311,311,311,311,311,311,311,312,312,312,312,312,312,312,313,313,313,313,314,314,314,314,314,314,315,315,315,315,315,315,315,315,315,315,316,316,316,316,316,316,316,316,317,317,317,317,317,317,317,317,318,318,318,318,318,318,318,319,319,319,319,320,320,320,320,320,321,321,321,321,322,322,322,322,322,322,322,322,323,323,323,323,323,323,323,323,323,
+		324,324,324,324,325,325,325,325,325,325,326,326,326,326,326,326,326,326,326,327,327,327,327,327,327,327,328,328,328,328,328,329,329,329,329,329,329,330,330,330,330,330,330,330,330,331,331,331,331,331,331,332,332,332,332,332,332,333,333,333,333,333,333,333,334,334,334,334,334,334,334,334,335,335,335,335,335,335,335,336,336,336,336,336,336,337,337,337,337,337,337,337,337,337,338,338,338,338,338,338,339,339,339,339,339,339,340,340,340,340,340,340,340,341,341,341,341,341,341,342,342,342,342,342,342,342,342,343,343,343,343,343,343,343,343,344,344,344,344,344,344,344,345,345,345,345,345,346,346,346,346,346,346,346,346,347,347,347,347,347,347,347,348,348,348,348,348,348,348,348,348,349,349,349,349,349,350,350,350,350,350,351,351,351,351,351,352,352,352,352,352,352,352,352,352,352,352,352,353,353,353,353,353,354,354,354,354,354,355,355,355,355,355,355,355,355,355,355,355,356,356,356,356,356,356,357,357,357,357,357,357,357,358,358,358,358,358,358,359,359,359,359,359,360,360,360,360,360,360,360,360,361,361,361,361,
+		361,361,362,362,362,362,363,363,363,363,363,364,364,364,364,364,364,364,365,365,365,365,365,365,365,366,366,366,366,366,366,366,366,367,367,367,367,367,367,367,368,368,368,368,368,368,368,368,369,369,369,369,370,370,370,370,370,370,370,371,371,371,371,371,371,371,372,372,372,372,372,372,373,373,373,373,373,373,374,374,374,374,374,374,375,375,375,375,375,375,375,375,375,376,376,376,376,376,377,377,377,377,378,378,378,378,378,378,378,379,379,379,379,379,380,380,380,380,380,380,380,380,381,381,381,381,381,382,382,382,382,382,383,383,383,383,383,383,383,383,384,384,384,384,384,385,385,385,385,386,386,386,386,386,386,387,387,387,387,388,388,388,388,388,388,389,389,389,389,390,390,390,390,390,390,391,391,391,391,391,392,392,392,392,392,392,392,393,393,393,393,393,393,394,394,394,394,395,395,395,395,396,396,396,396,396,397,397,397,397,398,398,398,398,398,398,399,399,399,399,399,400,400,400,400,400,401,401,401,401,401,401,401,402,402,402,402,402,402,403,403,403,403,404,404,404,404,404,405,405,405,405,405,406,406,
+		406,406,406,407,407,407,407,407,407
+	},
+	{
+		0,0,0,0,0,0,0,1,2,4,5,6,8,9,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,36,36,37,37,37,38,38,39,39,40,40,41,41,42,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,50,51,51,52,
+		52,53,53,53,54,54,55,55,55,56,56,57,57,57,58,58,58,59,59,60,60,60,61,61,61,62,62,62,63,63,64,64,64,65,65,65,66,66,66,67,67,67,68,68,68,69,69,69,70,70,70,71,71,71,72,72,72,73,73,73,73,74,74,74,75,75,75,76,76,76,77,77,77,78,78,78,79,79,79,80,80,80,81,81,81,81,82,82,82,83,83,83,84,84,84,85,85,85,86,86,86,86,87,87,87,88,88,88,89,89,89,90,90,90,91,91,91,91,92,92,92,93,93,93,94,94,94,95,95,95,95,96,96,96,97,97,97,98,98,98,99,99,99,100,100,100,100,101,101,101,102,102,102,103,103,103,103,104,104,104,105,105,105,106,106,106,106,107,107,107,108,108,108,109,109,109,110,110,110,110,111,111,111,112,112,112,113,113,113,114,114,114,114,115,115,115,116,116,116,117,117,117,117,118,118,118,119,119,119,119,120,120,120,121,121,121,122,122,122,122,123,123,123,124,124,124,124,125,125,125,126,126,126,126,127,127,127,128,128,128,129,129,129,129,130,130,130,130,131,131,131,131,132,132,132,
+		133,133,133,133,134,134,134,135,135,135,135,136,136,136,136,137,137,137,137,138,138,138,138,139,139,139,139,140,140,140,140,141,141,141,141,142,142,142,142,143,143,143,143,144,144,144,144,145,145,145,145,146,146,146,146,147,147,147,147,148,148,148,148,149,149,149,149,149,150,150,150,150,151,151,151,151,151,152,152,152,152,153,153,153,153,153,154,154,154,154,154,155,155,155,155,156,156,156,156,156,157,157,157,157,157,158,158,158,158,158,159,159,159,159,160,160,160,160,160,161,161,161,161,161,162,162,162,162,162,163,163,163,163,163,163,164,164,164,164,164,164,165,165,165,165,165,166,166,166,166,166,167,167,167,167,167,168,168,168,168,168,169,169,169,169,169,170,170,170,170,170,170,171,171,171,171,171,172,172,172,172,172,172,172,173,173,173,173,173,173,174,174,174,174,175,175,175,175,175,175,176,176,176,176,176,176,177,177,177,177,177,177,177,178,178,178,178,178,179,179,179,179,179,180,180,180,180,180,180,181,181,181,181,181,181,182,182,182,182,182,182,183,183,183,183,183,184,184,184,184,184,184,184,185,185,
+		185,185,185,185,186,186,186,186,186,186,187,187,187,187,187,187,188,188,188,188,188,188,189,189,189,189,189,189,189,190,190,190,190,190,190,190,191,191,191,191,191,191,192,192,192,192,192,192,193,193,193,193,193,193,194,194,194,194,194,194,195,195,195,195,195,195,195,196,196,196,196,196,196,196,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,199,199,199,199,199,199,200,200,200,200,200,200,200,201,201,201,201,201,201,201,202,202,202,202,202,202,202,203,203,203,203,203,203,204,204,204,204,204,204,204,204,205,205,205,205,205,205,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,208,208,208,208,208,208,208,209,209,209,209,209,209,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,212,212,212,212,212,212,213,213,213,213,213,214,214,214,214,214,214,214,214,215,215,215,215,215,215,216,216,216,216,216,216,217,217,217,217,217,217,217,218,218,218,218,218,218,218,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,221,221,221,221,221,221,222,222,222,222,222,222,223,223,223,223,
+		223,223,223,224,224,224,224,224,224,224,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,228,228,228,228,228,228,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,235,235,235,235,235,235,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,241,241,241,241,241,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,245,245,245,245,245,245,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,255,255,255,255,255,255,255,255,256,256,256,256,256,256,256,257,257,257,257,257,257,258,258,258,258,258,258,
+		258,259,259,259,259,259,259,259,259,260,260,260,260,260,260,260,260,261,261,261,261,261,262,262,262,262,262,262,262,263,263,263,263,263,263,263,263,263,264,264,264,264,264,264,264,264,265,265,265,265,265,265,265,265,266,266,266,266,266,266,267,267,267,267,267,267,267,267,268,268,268,268,268,268,268,269,269,269,269,269,269,270,270,270,270,270,270,271,271,271,271,271,271,271,271,271,271,271,271,272,272,272,272,272,272,273,273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,275,275,275,275,275,276,276,276,276,276,276,276,276,277,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,279,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,280,280,281,281,281,281,281,282,282,282,282,282,282,283,283,283,283,283,283,283,283,283,283,284,284,284,284,284,284,284,284,285,285,285,285,285,286,286,286,286,286,286,286,286,286,287,287,287,287,287,287,288,288,288,288,288,289,289,289,289,289,289,289,289,289,289,289,289,290,290,290,290,290,290,290,291,291,291,291,291,292,292,292,292,292,292,292,292,292,
+		293,293,293,293,293,293,293,293,294,294,294,294,294,294,295,295,295,295,295,295,296,296,296,296,296,296,296,296,297,297,297,297,297,297,297,297,297,298,298,298,298,298,298,298,299,299,299,299,299,299,299,300,300,300,300,300,300,300,300,300,301,301,301,301,301,301,302,302,302,302,302,302,302,303,303,303,303,303,303,303,303,303,303,304,304,304,304,304,304,304,304,305,305,305,305,305,305,305,305,305,305,305,306,306,306,306,306,306,306,307,307,307,307,307,307,307,308,308,308,308,308,308,309,309,309,309,309,309,309,309,309,309,310,310,310,310,310,310,310,310,310,311,311,311,311,311,311,312,312,312,312,312,312,313,313,313,313,313,313,313,313,313,313,314,314,314,314,314,314,314,314,314,314,315,315,315,315,315,315,315,315,316,316,316,316,316,316,316,316,317,317,317,317,317,317,317,318,318,318,318,318,318,318,319,319,319,319,319,319,319,319,320,320,320,320,320,320,320,320,320,320,320,321,321,321,321,321,321,321,322,322,322,322,322,322,322,322,323,323,323,323,323,324,324,324,324,324,324,324,324,325,325,325,325,325,
+		325,325,325,325,326,326,326,326,326,326,326,326,327,327,327,327,328,328,328,328,328,328,328,329,329,329,329,329,329,329,329,329,329,329,329,330,330,330,330,330,330,330,330,330,331,331,331,331,331,331,331,332,332,332,332,332,332,332,332,332,333,333,333,333,333,333,333,333,334,334,334,334,334,335,335,335,335,335,335,335,336,336,336,336,336,336,336,336,336,336,336,336,336,337,337,337,337,337,337,337,338,338,338,338,338,339,339,339,339,339,339,339,339,339,339,339,340,340,340,340,340,340,340,340,340,340,340,340,341,341,341,341,341,341,341,342,342,342,342,342,342,342,342,342,342,343,343,343,343,344,344,344,344,344,344,344,344,344,344,344,345,345,345,346,346,346,346,346,346,346,346,346,346,347,347,347,347,347,347,347,347,348,348,348,348,348,348,348,348,348,348,349,349,349,349,349,349,350,350,350,350,351,351,351,351,351,351,352,352,352,352,352,352,352,353,353,353,353,353,353,353,353,353,354,354,354,354,354,354,355,355,355,355,355,355,355,355,355,356,356,356,356,356,356,356,356,357,357,357,357,357,357,358,358,358,
+		358,358,358,359,359,359,359,359,359
+	},
+	{
+		0,0,0,0,0,0,0,0,0,1,3,3,4,5,6,8,9,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,36,36,36,37,37,38,38,38,39,39,40,40,40,41,41,42,42,
+		43,43,43,44,44,45,45,45,46,46,47,47,47,48,48,49,49,49,50,50,50,51,51,52,52,52,53,53,53,54,54,54,55,55,56,56,56,57,57,57,58,58,58,59,59,59,59,60,60,60,61,61,61,62,62,62,63,63,63,63,64,64,64,65,65,65,66,66,66,66,67,67,67,68,68,68,69,69,69,69,70,70,70,71,71,71,71,72,72,72,73,73,73,74,74,74,74,75,75,75,75,76,76,76,77,77,77,77,78,78,78,78,79,79,79,80,80,80,80,81,81,81,82,82,82,82,83,83,83,83,84,84,84,85,85,85,85,86,86,86,86,87,87,87,87,88,88,88,89,89,89,89,90,90,90,90,91,91,91,92,92,92,92,93,93,93,94,94,94,94,95,95,95,95,96,96,96,96,97,97,97,97,98,98,98,99,99,99,99,100,100,100,100,101,101,101,101,102,102,102,103,103,103,103,104,104,104,105,105,105,105,106,106,106,106,107,107,107,107,108,108,108,108,109,109,109,110,110,110,110,111,111,111,111,112,112,112,113,113,113,113,114,114,114,114,115,115,115,115,116,116,116,116,117,117,
+		117,118,118,118,118,119,119,119,119,120,120,120,120,121,121,121,121,122,122,122,122,123,123,123,123,124,124,124,124,125,125,125,125,126,126,126,126,127,127,127,127,128,128,128,129,129,129,129,130,130,130,130,131,131,131,131,131,132,132,132,132,133,133,133,133,134,134,134,134,135,135,135,135,136,136,136,136,137,137,137,137,137,138,138,138,138,139,139,139,139,139,140,140,140,140,141,141,141,141,142,142,142,142,142,143,143,143,143,144,144,144,144,144,144,145,145,145,145,146,146,146,146,147,147,147,147,147,147,148,148,148,148,148,149,149,149,149,150,150,150,150,150,151,151,151,151,151,151,152,152,152,152,152,153,153,153,153,153,153,154,154,154,154,154,155,155,155,155,155,156,156,156,156,156,156,157,157,157,157,157,158,158,158,158,158,159,159,159,159,159,159,159,160,160,160,160,160,160,161,161,161,161,161,161,162,162,162,162,162,163,163,163,163,163,163,164,164,164,164,164,164,164,165,165,165,165,165,165,165,166,166,166,166,166,166,167,167,167,167,167,167,168,168,168,168,168,169,169,169,169,169,169,170,170,170,
+		170,170,170,170,171,171,171,171,171,171,172,172,172,172,172,172,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,176,176,176,176,176,176,177,177,177,177,177,177,178,178,178,178,178,178,178,179,179,179,179,179,179,179,180,180,180,180,180,180,181,181,181,181,181,181,182,182,182,182,182,182,182,182,183,183,183,183,183,183,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,186,186,186,186,186,186,186,187,187,187,187,187,187,187,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,192,192,192,192,192,192,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,199,199,199,199,199,199,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,204,204,204,204,204,204,205,205,205,205,205,205,205,205,206,
+		206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,215,215,215,215,215,215,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,238,238,238,
+		238,238,238,238,238,238,238,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,256,256,256,256,256,256,257,257,257,257,257,257,257,258,258,258,258,258,258,258,258,258,259,259,259,259,259,259,259,259,259,259,260,260,260,260,260,260,260,261,261,261,261,261,261,261,262,262,262,262,262,262,262,262,262,262,263,263,263,263,263,263,263,264,264,264,264,264,264,264,264,264,264,265,265,265,265,265,265,265,265,266,266,266,266,266,266,267,267,267,267,267,267,267,267,268,268,268,268,268,268,268,268,268,268,268,268,268,
+		268,269,269,269,269,269,269,269,269,270,270,270,270,270,270,271,271,271,271,271,271,271,272,272,272,272,272,272,272,272,272,272,273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276,276,277,277,277,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,281,281,281,281,281,281,281,281,281,281,282,282,282,282,282,282,282,282,283,283,283,283,283,283,283,283,283,284,284,284,284,284,284,284,284,284,284,285,285,285,285,285,285,285,285,285,286,286,286,286,286,287,287,287,287,287,287,287,287,287,288,288,288,288,288,288,288,288,288,288,288,288,288,289,289,289,289,289,289,289,290,290,290,290,290,290,290,290,291,291,291,291,291,291,291,291,291,291,292,292,292,292,292,292,292,293,293,293,293,293,293,293,293,293,293,293,294,294,294,294,294,294,294,294,295,295,295,295,295,295,296,296,296,296,296,296,296,296,296,297,297,297,297,297,297,297,297,297,297,297,297,298,298,298,298,
+		298,298,298,298,298,299,299,299,299,299,299,299,299,300,300,300,300,300,300,300,301,301,301,301,301,301,301,301,301,301,302,302,302,302,302,302,302,302,302,302,303,303,303,303,303,303,303,303,304,304,304,304,304,304,304,304,304,304,304,304,304,305,305,305,305,305,305,306,306,306,306,306,306,306,306,306,306,306,307,307,307,307,307,307,307,307,308,308,308,308,308,308,308,308,308,308,308,308,309,309,309,309,309,309,309,309,310,310,310,310,310,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,311,312,312,312,312,312,312,312,312,312,313,313,313,313,313,313,313,314,314,314,314,314,314,314,314,314,314,314,314,315,315,315,315,315,315,315,315,316,316,316,316,316,316,316,317,317,317,317,317,317,317,318,318,318,318,318,318,318,319,319,319,319,319,319,319,319,319,319,319,319,319,320,320,320,320,320,320,320,320,320,321,321,321,321,321,322,322,322,322,322,322,322,322,322,322,323,323,323,323,323,323,324,324,324,324,324,325,325,325,325,325,325,325,325,325,325,325,325,325,325,326,326,326,326,326,327,327,327,327,
+		327,327,327,327,327,327,327,327,327
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,29,29,29,29,30,30,30,31,31,31,32,32,32,33,33,
+		33,34,34,34,35,35,35,36,36,36,37,37,37,38,38,39,39,39,40,40,40,41,41,42,42,42,43,43,43,44,44,45,45,45,46,46,46,47,47,47,48,48,48,49,49,49,50,50,50,51,51,51,52,52,52,53,53,53,53,54,54,54,55,55,55,56,56,56,56,57,57,57,58,58,58,59,59,59,59,60,60,60,60,61,61,61,62,62,62,62,63,63,63,64,64,64,64,65,65,65,65,66,66,66,66,67,67,67,67,68,68,68,69,69,69,69,70,70,70,70,70,71,71,71,71,72,72,72,72,73,73,73,73,74,74,74,74,75,75,75,75,76,76,76,76,77,77,77,77,78,78,78,78,79,79,79,79,80,80,80,80,81,81,81,81,81,82,82,82,82,83,83,83,83,84,84,84,84,85,85,85,85,86,86,86,86,87,87,87,87,87,88,88,88,88,89,89,89,89,90,90,90,90,91,91,91,91,92,92,92,92,92,93,93,93,93,94,94,94,94,95,95,95,95,96,96,96,96,97,97,97,97,97,98,98,98,98,99,99,99,99,99,100,100,100,100,101,101,101,101,102,102,102,102,103,
+		103,103,103,104,104,104,104,105,105,105,105,106,106,106,106,106,107,107,107,107,108,108,108,108,109,109,109,109,110,110,110,110,111,111,111,111,111,112,112,112,112,113,113,113,113,113,114,114,114,114,115,115,115,115,116,116,116,116,117,117,117,117,118,118,118,118,118,119,119,119,119,120,120,120,120,121,121,121,121,122,122,122,122,123,123,123,123,123,124,124,124,124,124,125,125,125,125,126,126,126,126,126,127,127,127,127,128,128,128,128,128,129,129,129,129,130,130,130,130,130,131,131,131,131,132,132,132,132,132,133,133,133,133,133,134,134,134,134,134,135,135,135,135,136,136,136,136,136,137,137,137,137,137,138,138,138,138,138,139,139,139,139,139,140,140,140,140,140,141,141,141,141,141,142,142,142,142,142,143,143,143,143,143,143,144,144,144,144,144,144,145,145,145,145,145,146,146,146,146,146,147,147,147,147,147,147,148,148,148,148,148,148,149,149,149,149,149,150,150,150,150,150,150,151,151,151,151,151,151,152,152,152,152,152,152,153,153,153,153,153,153,154,154,154,154,154,154,154,155,155,155,155,155,155,156,
+		156,156,156,156,156,157,157,157,157,157,157,157,158,158,158,158,158,158,159,159,159,159,159,159,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,163,163,163,163,163,163,163,164,164,164,164,164,164,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,169,169,169,169,169,169,170,170,170,170,170,170,170,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,176,176,176,176,176,176,176,177,177,177,177,177,177,177,178,178,178,178,178,178,179,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,190,190,190,190,190,
+		190,190,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,220,
+		220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,
+		247,247,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,256,256,256,256,256,256,256,256,256,256,256,256,257,257,257,257,257,257,257,257,257,257,257,257,258,258,258,258,258,258,259,259,259,259,259,259,259,259,259,260,260,260,260,260,260,260,260,260,260,261,261,261,261,261,261,261,261,261,262,262,262,262,262,262,262,262,262,262,262,262,263,263,263,263,263,263,263,263,263,264,264,264,264,264,264,264,264,264,265,265,265,265,265,265,265,265,265,265,265,265,265,265,266,266,266,266,266,266,266,266,266,266,267,267,267,267,267,267,267,268,268,268,268,268,268,268,268,268,268,269,269,269,269,269,269,269,269,269,269,269,269,269,269,270,270,270,270,270,270,270,271,271,271,271,271,271,271,271,271,271,271,271,272,272,272,272,272,272,272,272,273,273,273,273,273,273,273,273,273,273,274,274,274,274,
+		274,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,278,278,278,278,278,278,279,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,280,281,281,281,281,281,281,281,281,281,282,282,282,282,282,282,282,282,282,282,282,282,282,283,283,283,283,283,283,283,284,284,284,284,284,284,284,284,284,284,284,284,284,284,285,285,285,285,285,285,285,285,285,286,286,286,286,286,286,286,286,286,286,287,287,287,287,287,287,287,287,287,287,288,288,288,288,288,288,288,288,288,288,288,289,289,289,289,289,289,289,289,289,289,289,290,290,290,290,290,290,290,290,290,290,291,291,291,291,291,291,292,292,292,292,292,292,292,292,292,292,292,292,292,292,293,293,293,293,293,293,293,293,294,294,294,294,294,294,294,294,294,295,295,295,295,295,295,295,295,296,296,296,296,296,296,296,296,296,296,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,298,298,298,298,298,298,298,298,299,299,299,299,299,299,299,299,299,
+		299,299,300,300,300,300,300,300,300
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,26,26,26,27,27,27,27,28,28,
+		28,28,29,29,29,30,30,30,30,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,37,37,37,38,38,38,39,39,39,40,40,40,41,41,41,42,42,42,43,43,43,44,44,44,45,45,45,46,46,46,47,47,47,47,48,48,48,49,49,49,50,50,50,50,51,51,51,52,52,52,53,53,53,53,54,54,54,54,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,67,67,67,67,68,68,68,68,68,69,69,69,69,70,70,70,70,71,71,71,71,71,72,72,72,72,73,73,73,73,74,74,74,74,74,75,75,75,75,76,76,76,76,76,77,77,77,77,77,78,78,78,78,79,79,79,79,79,80,80,80,80,80,81,81,81,81,82,82,82,82,82,83,83,83,83,83,84,84,84,84,84,85,85,85,85,86,86,86,86,86,87,87,87,87,87,88,88,88,88,89,89,89,89,89,90,90,90,90,90,91,91,91,91,92,92,92,92,92,93,93,93,93,93,
+		94,94,94,94,94,95,95,95,95,95,96,96,96,96,96,97,97,97,97,97,98,98,98,98,99,99,99,99,100,100,100,100,100,101,101,101,101,101,102,102,102,102,102,103,103,103,103,103,104,104,104,104,105,105,105,105,105,106,106,106,106,107,107,107,107,107,108,108,108,108,108,109,109,109,109,109,110,110,110,110,110,111,111,111,111,112,112,112,112,113,113,113,113,113,114,114,114,114,114,115,115,115,115,116,116,116,116,116,117,117,117,117,117,118,118,118,118,119,119,119,119,119,120,120,120,120,120,121,121,121,121,122,122,122,122,122,123,123,123,123,123,124,124,124,124,124,125,125,125,125,125,126,126,126,126,126,127,127,127,127,127,128,128,128,128,128,129,129,129,129,130,130,130,130,130,130,131,131,131,131,131,132,132,132,132,133,133,133,133,133,133,134,134,134,134,134,134,135,135,135,135,135,136,136,136,136,136,137,137,137,137,137,138,138,138,138,138,138,139,139,139,139,139,140,140,140,140,140,140,141,141,141,141,141,141,142,142,142,142,142,143,143,143,143,143,144,144,144,144,144,144,145,145,145,145,
+		145,145,146,146,146,146,146,146,146,147,147,147,147,147,147,148,148,148,148,148,148,148,149,149,149,149,149,149,149,150,150,150,150,150,150,151,151,151,151,151,151,152,152,152,152,152,152,152,153,153,153,153,153,153,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,156,156,156,156,156,156,156,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,162,162,162,162,162,162,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,172,172,172,172,172,172,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,179,179,179,179,179,179,
+		179,179,179,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,
+		207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,232,232,
+		232,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,256,256,256,256,256,256,256,256,256,256,257,257,257,
+		257,257,257,257,257,257,257,257,257,257,257,258,258,258,258,258,258,258,258,258,259,259,259,259,259,259,259,259,259,259,260,260,260,260,260,260,260,260,260,260,260,260,260,260,260,261,261,261,261,261,261,261,261,261,262,262,262,262,262,262,262,262,262,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,265,265,265,265,265,265,265,265,266,266,266,266,266,266,266,266,266,266,267,267,267,267,267,267,267,267,267,267,267,267,267,268,268,268,268,268,268,268,268,268,269,269,269,269,269,269,269,269,269,269,269,269,269,270,270,270,270,270,270,270,270,270,270,270,270,270,271,271,271,271,271,271,271,271,271,271,271,272,272,272,272,272,272,272,273,273,273,273,273,273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276,276,276,276,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,278,278,278,278,278,279,279,279,279,279,279,279,279,280,280,280,
+		280,280,280,280,280,280,281,281,281
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,
+		21,21,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,26,27,27,27,28,28,28,28,29,29,29,29,30,30,30,31,31,31,31,32,32,32,33,33,33,34,34,34,35,35,35,36,36,36,36,37,37,37,38,38,38,39,39,39,40,40,40,40,41,41,41,42,42,42,43,43,43,43,44,44,44,44,45,45,45,46,46,46,46,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,61,62,62,62,62,62,63,63,63,63,63,64,64,64,64,64,65,65,65,65,66,66,66,66,66,67,67,67,67,67,68,68,68,68,68,69,69,69,69,69,69,70,70,70,70,70,71,71,71,71,71,72,72,72,72,72,73,73,73,73,73,73,74,74,74,74,74,75,75,75,75,75,75,76,76,76,76,76,76,77,77,77,77,77,78,78,78,78,78,78,79,79,79,79,79,80,80,80,80,80,
+		80,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,84,84,84,84,84,84,85,85,85,85,85,85,86,86,86,86,86,86,87,87,87,87,87,87,88,88,88,88,88,88,89,89,89,89,89,89,90,90,90,90,90,90,91,91,91,91,91,92,92,92,92,92,92,93,93,93,93,93,93,94,94,94,94,94,94,95,95,95,95,95,95,96,96,96,96,96,96,97,97,97,97,97,98,98,98,98,98,98,99,99,99,99,99,99,100,100,100,100,100,100,101,101,101,101,101,101,102,102,102,102,102,103,103,103,103,103,103,104,104,104,104,104,105,105,105,105,105,105,106,106,106,106,106,107,107,107,107,107,107,108,108,108,108,108,108,109,109,109,109,109,110,110,110,110,110,111,111,111,111,111,111,112,112,112,112,112,113,113,113,113,113,113,114,114,114,114,114,114,115,115,115,115,115,115,116,116,116,116,116,117,117,117,117,117,118,118,118,118,118,118,119,119,119,119,119,119,120,120,120,120,120,121,121,121,121,121,122,122,122,122,122,122,123,123,123,123,123,123,124,124,124,124,125,125,125,125,125,
+		125,126,126,126,126,126,126,126,127,127,127,127,127,127,128,128,128,128,128,128,129,129,129,129,129,130,130,130,130,130,130,131,131,131,131,131,131,132,132,132,132,132,133,133,133,133,133,133,134,134,134,134,134,134,135,135,135,135,135,135,136,136,136,136,136,136,136,137,137,137,137,137,137,138,138,138,138,138,138,138,139,139,139,139,139,139,139,140,140,140,140,140,140,141,141,141,141,141,141,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,144,144,144,144,144,144,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,161,161,161,161,161,161,
+		161,161,161,162,162,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,
+		187,187,187,188,188,188,188,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,
+		209,209,209,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,231,
+		231,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,249,250,250,250,250,
+		250,250,250,250,250,251,251,251,251
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,3,5,6,7,8,9,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,
+		18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,26,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,31,31,31,31,32,32,32,32,33,33,33,34,34,34,34,35,35,35,36,36,36,36,37,37,37,37,38,38,38,39,39,39,39,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,48,49,49,49,49,50,50,50,50,50,51,51,51,51,52,52,52,52,52,53,53,53,53,53,54,54,54,54,55,55,55,55,55,56,56,56,56,56,57,57,57,57,57,58,58,58,58,58,59,59,59,59,59,60,60,60,60,60,61,61,61,61,61,61,62,62,62,62,62,63,63,63,63,63,63,64,64,64,64,64,65,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,70,70,70,70,70,70,71,71,71,71,71,
+		71,72,72,72,72,72,72,73,73,73,73,73,73,74,74,74,74,74,74,75,75,75,75,75,75,76,76,76,76,76,76,76,77,77,77,77,77,77,78,78,78,78,78,78,79,79,79,79,79,79,79,80,80,80,80,80,80,81,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,83,83,84,84,84,84,84,84,84,85,85,85,85,85,85,86,86,86,86,86,86,87,87,87,87,87,87,87,88,88,88,88,88,88,89,89,89,89,89,89,89,90,90,90,90,90,90,91,91,91,91,91,91,92,92,92,92,92,92,92,93,93,93,93,93,93,94,94,94,94,94,94,94,95,95,95,95,95,95,96,96,96,96,96,96,96,97,97,97,97,97,97,98,98,98,98,98,98,99,99,99,99,99,99,100,100,100,100,100,100,101,101,101,101,101,101,102,102,102,102,102,102,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,106,106,106,106,106,107,107,107,107,107,107,108,108,108,108,108,108,109,109,109,109,109,109,110,110,110,110,110,110,111,111,111,111,111,111,112,112,112,112,
+		112,112,113,113,113,113,113,114,114,114,114,114,114,115,115,115,115,115,115,116,116,116,116,116,116,117,117,117,117,117,117,118,118,118,118,118,118,119,119,119,119,119,119,120,120,120,120,120,120,120,121,121,121,121,121,121,122,122,122,122,122,122,123,123,123,123,123,123,124,124,124,124,124,124,124,125,125,125,125,125,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,129,129,129,129,129,129,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,133,133,133,133,133,133,134,134,134,134,134,134,135,135,135,135,135,135,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,140,140,140,140,140,140,140,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,
+		150,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,174,174,175,
+		175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,
+		196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,
+		216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,
+		234,234,234,234,234,234,234,234,234
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,4,5,6,7,8,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+		16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,26,27,27,27,27,28,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,45,46,46,46,46,46,47,47,47,47,48,48,48,48,48,49,49,49,49,49,50,50,50,50,50,51,51,51,51,51,52,52,52,52,52,53,53,53,53,53,53,54,54,54,54,54,55,55,55,55,55,56,56,56,56,56,56,57,57,57,57,57,58,58,58,58,58,58,59,59,59,59,59,59,60,60,60,60,60,60,61,61,61,61,61,61,62,62,62,62,62,62,63,63,63,63,
+		63,63,64,64,64,64,64,64,65,65,65,65,65,65,66,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,68,69,69,69,69,69,69,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,73,73,73,73,73,73,73,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,85,85,85,85,85,85,85,86,86,86,86,86,86,86,86,87,87,87,87,87,87,87,87,88,88,88,88,88,88,88,89,89,89,89,89,89,89,89,89,90,90,90,90,90,90,90,90,91,91,91,91,91,91,91,92,92,92,92,92,92,92,93,93,93,93,93,93,93,94,94,94,94,94,94,94,95,95,95,95,95,95,95,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,98,98,98,98,
+		98,98,98,98,99,99,99,99,99,99,99,100,100,100,100,100,100,100,101,101,101,101,101,101,101,101,102,102,102,102,102,102,102,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,105,106,106,106,106,106,106,107,107,107,107,107,107,107,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,110,110,110,110,110,110,111,111,111,111,111,111,112,112,112,112,112,112,112,113,113,113,113,113,113,113,114,114,114,114,114,114,114,115,115,115,115,115,115,116,116,116,116,116,116,116,117,117,117,117,117,117,118,118,118,118,118,118,118,119,119,119,119,119,119,119,120,120,120,120,120,120,120,120,121,121,121,121,121,121,122,122,122,122,122,122,122,123,123,123,123,123,123,123,124,124,124,124,124,124,124,125,125,125,125,125,125,125,126,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,132,133,133,133,133,133,133,133,134,134,134,134,134,134,134,135,
+		135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,160,160,160,
+		160,161,161,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,181,182,
+		182,182,182,182,182,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,
+		199,199,199,199,199,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,
+		216,216,216,216,216,216,217,217,217
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,
+		15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,24,25,25,25,25,25,26,26,26,26,27,27,27,27,27,28,28,28,28,29,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,36,37,37,37,37,38,38,38,38,38,39,39,39,39,40,40,40,40,40,41,41,41,41,42,42,42,42,42,43,43,43,43,43,44,44,44,44,44,45,45,45,45,45,46,46,46,46,46,47,47,47,47,47,48,48,48,48,48,48,49,49,49,49,49,49,50,50,50,50,50,51,51,51,51,51,51,52,52,52,52,52,52,53,53,53,53,53,53,54,54,54,54,54,55,55,55,55,55,
+		55,56,56,56,56,56,56,56,57,57,57,57,57,57,58,58,58,58,58,58,59,59,59,59,59,59,59,60,60,60,60,60,60,61,61,61,61,61,61,61,62,62,62,62,62,62,62,63,63,63,63,63,63,63,64,64,64,64,64,64,64,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,84,85,85,85,85,85,85,85,85,86,86,86,86,86,86,86,86,86,86,87,87,87,87,87,87,
+		87,87,88,88,88,88,88,88,88,88,88,89,89,89,89,89,89,89,89,89,90,90,90,90,90,90,90,90,90,91,91,91,91,91,91,91,91,92,92,92,92,92,92,92,92,92,93,93,93,93,93,93,93,93,93,94,94,94,94,94,94,94,94,95,95,95,95,95,95,95,95,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,97,98,98,98,98,98,98,98,98,98,99,99,99,99,99,99,99,100,100,100,100,100,100,100,100,101,101,101,101,101,101,101,101,102,102,102,102,102,102,102,102,103,103,103,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,105,106,106,106,106,106,106,106,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,109,110,110,110,110,110,110,110,110,111,111,111,111,111,111,111,112,112,112,112,112,112,112,113,113,113,113,113,113,113,114,114,114,114,114,114,114,114,115,115,115,115,115,115,115,115,116,116,116,116,116,116,116,116,117,117,117,117,117,117,117,118,118,118,118,118,118,118,118,119,119,119,119,119,119,
+		120,120,120,120,120,120,120,120,121,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,123,123,124,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,129,129,129,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,
+		148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,
+		168,168,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,185,185,185,185,
+		185,185,185,185,185,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,199,199,199,200,200,200,200,200,
+		200,200,200,200,200,200,200,200,200
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,3,4,5,6,6,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,
+		14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,27,27,27,27,28,28,28,28,28,29,29,29,29,29,30,30,30,30,30,31,31,31,31,31,32,32,32,32,33,33,33,33,33,34,34,34,34,34,35,35,35,35,36,36,36,36,36,37,37,37,37,37,38,38,38,38,38,39,39,39,39,39,40,40,40,40,40,41,41,41,41,41,41,42,42,42,42,42,43,43,43,43,43,43,44,44,44,44,44,45,45,45,45,45,45,46,46,46,46,46,46,47,
+		47,47,47,47,47,48,48,48,48,48,48,49,49,49,49,49,49,50,50,50,50,50,50,51,51,51,51,51,51,52,52,52,52,52,52,52,53,53,53,53,53,53,53,54,54,54,54,54,54,54,55,55,55,55,55,55,56,56,56,56,56,56,56,57,57,57,57,57,57,57,57,58,58,58,58,58,58,58,59,59,59,59,59,59,59,59,60,60,60,60,60,60,60,60,61,61,61,61,61,61,61,62,62,62,62,62,62,62,62,63,63,63,63,63,63,63,63,63,64,64,64,64,64,64,64,64,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,66,67,67,67,67,67,67,67,67,67,68,68,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,
+		78,78,78,78,79,79,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,84,84,84,85,85,85,85,85,85,85,85,85,85,86,86,86,86,86,86,86,86,86,86,87,87,87,87,87,87,87,87,87,87,88,88,88,88,88,88,88,88,88,88,89,89,89,89,89,89,89,89,89,89,90,90,90,90,90,90,90,90,90,90,91,91,91,91,91,91,91,91,91,92,92,92,92,92,92,92,92,92,93,93,93,93,93,93,93,93,93,93,94,94,94,94,94,94,94,94,94,95,95,95,95,95,95,95,95,95,96,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,97,97,98,98,98,98,98,98,98,98,98,99,99,99,99,99,99,99,99,100,100,100,100,100,100,100,100,100,101,101,101,101,101,101,101,101,101,102,102,102,102,102,102,102,102,103,103,103,103,103,103,103,103,103,104,104,104,104,104,104,104,104,105,105,105,105,
+		105,105,105,105,106,106,106,106,106,106,106,106,106,107,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,109,110,110,110,110,110,110,110,110,111,111,111,111,111,111,111,111,112,112,112,112,112,112,112,112,112,113,113,113,113,113,113,113,113,114,114,114,114,114,114,114,114,115,115,115,115,115,115,115,115,115,116,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,118,119,119,119,119,119,119,119,119,120,120,120,120,120,120,120,120,121,121,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,123,123,124,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,126,127,127,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,129,129,130,130,130,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,
+		134,134,134,134,135,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,155,155,
+		155,155,155,155,156,156,156,156,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,172,172,172,172,172,
+		172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,186,186,186,186,187,
+		187,187,187,187,187,187,187,187,187
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,
+		13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,27,27,27,27,27,28,28,28,28,28,29,29,29,29,29,30,30,30,30,30,31,31,31,31,31,32,32,32,32,32,33,33,33,33,33,34,34,34,34,34,35,35,35,35,35,36,36,36,36,36,37,37,37,37,37,37,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,
+		41,41,41,41,41,41,42,42,42,42,42,42,43,43,43,43,43,43,44,44,44,44,44,44,45,45,45,45,45,45,46,46,46,46,46,46,47,47,47,47,47,47,48,48,48,48,48,48,48,49,49,49,49,49,49,49,50,50,50,50,50,50,51,51,51,51,51,51,51,52,52,52,52,52,52,52,53,53,53,53,53,53,53,53,54,54,54,54,54,54,54,55,55,55,55,55,55,55,56,56,56,56,56,56,56,56,56,57,57,57,57,57,57,57,57,58,58,58,58,58,58,58,58,59,59,59,59,59,59,59,59,60,60,60,60,60,60,60,60,60,61,61,61,61,61,61,61,61,62,62,62,62,62,62,62,62,62,63,63,63,63,63,63,63,63,64,64,64,64,64,64,64,64,64,64,65,65,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,66,67,67,67,67,67,67,67,67,67,67,68,68,68,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,72,72,
+		72,73,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,84,84,84,84,85,85,85,85,85,85,85,85,85,85,86,86,86,86,86,86,86,86,86,86,86,86,87,87,87,87,87,87,87,87,87,87,88,88,88,88,88,88,88,88,88,88,88,88,89,89,89,89,89,89,89,89,89,89,90,90,90,90,90,90,90,90,90,90,90,90,91,91,91,91,91,91,91,91,91,91,91,91,92,92,92,92,92,92,92,92,92,92,93,93,93,93,93,93,93,93,93,93,94,94,94,94,94,94,94,94,94,95,95,95,95,95,95,95,95,
+		95,95,95,95,96,96,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,97,97,98,98,98,98,98,98,98,98,98,99,99,99,99,99,99,99,99,99,99,99,100,100,100,100,100,100,100,100,100,101,101,101,101,101,101,101,101,101,102,102,102,102,102,102,102,102,102,102,103,103,103,103,103,103,103,103,103,103,104,104,104,104,104,104,104,104,104,105,105,105,105,105,105,105,105,105,105,106,106,106,106,106,106,106,106,106,107,107,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,109,109,110,110,110,110,110,110,110,110,111,111,111,111,111,111,111,111,111,111,111,112,112,112,112,112,112,112,112,113,113,113,113,113,113,113,113,113,114,114,114,114,114,114,114,114,114,115,115,115,115,115,115,115,116,116,116,116,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,118,118,119,119,119,119,119,119,119,119,119,120,120,120,120,120,120,120,120,120,121,121,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,122,123,123,
+		123,123,123,123,123,123,123,123,123,123,124,124,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,126,126,126,126,127,127,127,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,129,129,130,130,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,
+		146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,162,162,162,
+		162,162,162,162,162,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
+		177,177,177,177,177,177,177,177,177
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+		11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,23,23,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,28,28,28,28,28,29,29,29,
+		29,29,29,30,30,30,30,30,31,31,31,31,31,31,32,32,32,32,32,33,33,33,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,36,36,36,36,36,36,37,37,37,37,37,37,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,40,41,41,41,41,41,41,42,42,42,42,42,42,42,43,43,43,43,43,43,43,44,44,44,44,44,44,45,45,45,45,45,45,45,46,46,46,46,46,46,46,47,47,47,47,47,47,47,47,48,48,48,48,48,48,48,48,49,49,49,49,49,49,49,49,50,50,50,50,50,50,50,50,51,51,51,51,51,51,51,52,52,52,52,52,52,52,52,53,53,53,53,53,53,53,53,53,54,54,54,54,54,54,54,54,54,55,55,55,55,55,55,55,55,56,56,56,56,56,56,56,56,56,57,57,57,57,57,57,57,57,57,57,58,58,58,58,58,58,58,58,58,59,59,59,59,59,59,59,59,59,59,60,60,60,60,60,60,60,60,60,60,61,61,61,61,61,61,61,61,61,61,62,62,62,62,62,62,62,62,62,62,62,63,63,63,63,63,63,
+		63,63,63,63,63,64,64,64,64,64,64,64,64,64,64,64,65,65,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,66,66,67,67,67,67,67,67,67,67,67,67,67,67,67,68,68,68,68,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,82,82,82,82,82,83,83,83,83,
+		83,83,83,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,86,86,86,86,86,86,86,86,86,86,86,86,86,87,87,87,87,87,87,87,87,87,87,87,87,87,87,88,88,88,88,88,88,88,88,88,88,88,88,88,89,89,89,89,89,89,89,89,89,89,89,89,89,89,90,90,90,90,90,90,90,90,90,90,90,90,91,91,91,91,91,91,91,91,91,91,91,91,91,92,92,92,92,92,92,92,92,92,92,92,93,93,93,93,93,93,93,93,93,93,93,93,93,93,94,94,94,94,94,94,94,94,94,94,94,94,95,95,95,95,95,95,95,95,95,95,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,97,97,97,98,98,98,98,98,98,98,98,98,98,98,98,99,99,99,99,99,99,99,99,99,99,99,100,100,100,100,100,100,100,100,100,100,100,100,100,101,101,101,101,101,101,101,101,101,101,102,102,102,102,102,102,102,102,102,102,102,102,103,103,103,103,103,
+		103,103,103,103,103,103,103,104,104,104,104,104,104,104,104,105,105,105,105,105,105,105,105,105,106,106,106,106,106,106,106,106,106,106,106,106,106,106,107,107,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,109,109,109,109,110,110,110,110,110,110,110,110,110,110,110,111,111,111,111,111,111,111,111,111,111,111,111,112,112,112,112,112,112,112,112,112,113,113,113,113,113,113,113,113,113,113,113,114,114,114,114,114,114,114,114,114,114,115,115,115,115,115,115,115,115,115,115,115,116,116,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,118,118,119,119,119,119,119,119,119,119,119,119,119,119,120,120,120,120,120,120,120,120,120,120,121,121,121,121,121,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,123,123,123,123,124,124,124,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,126,126,126,126,126,126,127,127,127,
+		127,127,127,127,127,127,128,128,128,128,128,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,129,129,129,129,129,130,130,130,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,146,
+		146,146,146,146,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,
+		160,160,160,160,160,160,160,160,160
+	},
+	{
+		0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,3,4,5,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,
+		11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,
+		23,24,24,24,24,24,24,25,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,31,31,31,31,31,31,32,32,32,32,32,32,33,33,33,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,36,36,36,36,36,36,37,37,37,37,37,37,37,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,40,40,41,41,41,41,41,41,41,42,42,42,42,42,42,42,43,43,43,43,43,43,43,43,44,44,44,44,44,44,44,45,45,45,45,45,45,45,45,46,46,46,46,46,46,46,47,47,47,47,47,47,47,47,48,48,48,48,48,48,48,48,49,49,49,49,49,49,49,49,50,50,50,50,50,50,50,50,50,51,51,51,51,51,51,51,51,51,52,52,52,52,52,52,52,52,52,53,53,53,53,53,53,53,53,53,54,54,54,54,54,54,54,54,54,54,55,55,55,55,55,55,55,55,55,56,56,56,56,56,56,56,56,56,57,57,57,57,57,57,57,57,57,57,57,58,58,58,58,58,58,
+		58,58,58,58,59,59,59,59,59,59,59,59,59,59,60,60,60,60,60,60,60,60,60,60,60,60,61,61,61,61,61,61,61,61,61,61,62,62,62,62,62,62,62,62,62,62,62,62,63,63,63,63,63,63,63,63,63,63,63,64,64,64,64,64,64,64,64,64,64,64,64,65,65,65,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,66,66,66,66,67,67,67,67,67,67,67,67,67,67,67,67,67,67,68,68,68,68,68,68,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,69,69,69,69,69,69,70,70,70,70,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,75,75,75,75,75,75,75,75,75,75,75,75,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,78,78,78,78,
+		78,78,78,78,78,78,78,78,78,78,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,85,85,85,85,85,85,85,85,85,85,85,85,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,88,88,88,88,88,88,88,88,88,88,88,88,88,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,91,91,91,91,91,91,91,91,91,91,91,91,91,91,92,92,92,92,92,92,92,92,92,92,92,92,93,93,93,93,93,93,93,93,93,93,93,93,93,94,94,94,94,94,94,94,94,94,94,94,94,94,95,95,95,95,95,95,95,95,95,
+		95,95,95,95,96,96,96,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,97,97,97,97,97,97,97,98,98,98,98,98,98,98,98,98,98,98,98,99,99,99,99,99,99,99,99,99,99,99,99,99,100,100,100,100,100,100,100,100,100,100,100,101,101,101,101,101,101,101,101,101,101,101,101,101,102,102,102,102,102,102,102,102,102,102,103,103,103,103,103,103,103,103,103,103,103,103,104,104,104,104,104,104,104,104,104,104,104,104,105,105,105,105,105,105,105,105,105,105,105,106,106,106,106,106,106,106,106,106,106,106,106,106,107,107,107,107,107,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109,109,109,109,110,110,110,110,110,110,110,110,110,110,110,110,110,110,111,111,111,111,111,111,111,111,111,111,111,111,112,112,112,112,112,112,112,112,112,112,113,113,113,113,113,113,113,113,113,113,113,114,114,114,114,114,114,114,114,114,114,114,114,114,115,115,115,115,115,115,115,115,115,115,115,116,116,116,116,116,116,116,116,116,116,116,116,117,117,117,
+		117,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,118,118,119,119,119,119,119,119,119,119,119,119,119,119,119,120,120,120,120,120,120,120,120,120,120,121,121,121,121,121,121,121,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,123,123,123,123,123,123,124,124,124,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,126,126,126,126,126,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,129,129,129,129,129,130,130,130,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,137,137,137,137,137,
+		137,137,137,138,138,138,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,
+		152,152,152,152,152,152,152,152,152
+	}
+};
+
diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/dsputil_mmx.c
index 6a44e52..1696af5 100644
--- a/libavcodec/i386/dsputil_mmx.c
+++ b/libavcodec/i386/dsputil_mmx.c
@@ -2881,6 +2881,15 @@ void dsputil_init_mmx(DSPContext* c, AVC
         c->h264_idct8_dc_add=
         c->h264_idct8_add= ff_h264_idct8_add_mmx;
 
+        c->h264_dct = ff_h264_dct_mmx;
+        c->h264_idct_notranspose_add = ff_h264_idct_notranspose_add_mmx;
+        c->h264_hadamard_mult4x4 = ff_h264_hadamard_mult4x4_mmx;
+        c->h264_hadamard_quant_2x2 = ff_h264_hadamard_quant_2x2_mmx;
+        c->h264_hadamard_quant_4x4 = ff_h264_hadamard_quant_4x4_mmx;
+        c->h264_hadamard_invquant_4x4 = ff_h264_hadamard_invquant_4x4_mmx;
+        c->h264_transform_dct_quant = ff_h264_transform_dct_quant_mmx;
+        c->h264_transform_inverse_quant_dct_add = ff_h264_transform_inverse_quant_dct_add_mmx;
+
         if (mm_flags & MM_MMXEXT) {
             c->prefetch = prefetch_mmx2;
 
diff --git a/libavcodec/i386/h264dsp_mmx.c b/libavcodec/i386/h264dsp_mmx.c
index ac4ad64..00ac209 100644
--- a/libavcodec/i386/h264dsp_mmx.c
+++ b/libavcodec/i386/h264dsp_mmx.c
@@ -46,6 +46,11 @@
     SUMSUBD2_AB( s13, d13, t )\
     SUMSUB_BADC( d13, s02, s13, d02 )
 
+#define SBUTTERFLY(a,b,t,n)\
+    "movq " #a ", " #t "                \n\t" /* abcd */\
+    "punpckl" #n " " #b ", " #a "       \n\t" /* aebf */\
+    "punpckh" #n " " #b ", " #t "       \n\t" /* cgdh */\
+
 #define TRANSPOSE4(a,b,c,d,t)\
     SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
     SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
@@ -99,6 +104,131 @@ static void ff_h264_idct_add_mmx(uint8_t
     );
 }
 
+static void ff_h264_idct_notranspose_add_mmx(uint8_t *dst, int16_t *block, int stride)
+{
+    /* Load dct coeffs */
+    asm volatile(
+        "movq   (%0), %%mm0 \n\t"
+        "movq  8(%0), %%mm4 \n\t"
+        "movq 16(%0), %%mm3 \n\t"
+        "movq 24(%0), %%mm1 \n\t"
+	TRANSPOSE4(%%mm0, %%mm4, %%mm3, %%mm1, %%mm2)
+    :: "r"(block) );
+
+    asm volatile(
+        /* mm1=s02+s13  mm2=s02-s13  mm4=d02+d13  mm0=d02-d13 */
+        IDCT4_1D( %%mm2, %%mm1, %%mm0, %%mm3, %%mm4 )
+
+        "movq      %0,    %%mm6 \n\t"
+        /* in: 1,4,0,2  out: 1,2,3,0 */
+        TRANSPOSE4( %%mm3, %%mm1, %%mm0, %%mm2, %%mm4 )
+
+        "paddw     %%mm6, %%mm3 \n\t"
+
+        /* mm2=s02+s13  mm3=s02-s13  mm4=d02+d13  mm1=d02-d13 */
+        IDCT4_1D( %%mm4, %%mm2, %%mm3, %%mm0, %%mm1 )
+
+        "pxor %%mm7, %%mm7    \n\t"
+    :: "m"(ff_pw_32));
+
+    asm volatile(
+    STORE_DIFF_4P( %%mm0, %%mm1, %%mm7)
+        "add %1, %0             \n\t"
+    STORE_DIFF_4P( %%mm2, %%mm1, %%mm7)
+        "add %1, %0             \n\t"
+    STORE_DIFF_4P( %%mm3, %%mm1, %%mm7)
+        "add %1, %0             \n\t"
+    STORE_DIFF_4P( %%mm4, %%mm1, %%mm7)
+        : "+r"(dst)
+        : "r" ((long)stride)
+    );
+}
+
+#define FORWARD_DCT_PART(a,b,c,d,u,v,w,x) \
+        "movq  " #a ", " #u " \n\t" \
+    "paddw " #b ", " #u " \n\t" \
+    "paddw " #c ", " #u " \n\t" \
+    "paddw " #d ", " #u " \n\t" \
+    "movq  " #a ", " #w " \n\t" \
+    "psubw " #b ", " #w " \n\t" \
+    "psubw " #c ", " #w " \n\t" \
+    "paddw " #d ", " #w " \n\t" \
+    "movq  " #a ", " #x " \n\t" \
+    "psubw " #d ", " #x " \n\t" \
+    "movq  " #b ", " #v " \n\t" \
+    "psubw " #c ", " #v " \n\t" \
+    "movq  " #v ", " #a " \n\t" \
+    "movq  " #x ", " #b " \n\t" \
+    "psllw     $1, " #a " \n\t" \
+    "psllw     $1, " #b " \n\t" \
+    "paddw " #b ", " #v " \n\t" \
+    "psubw " #a ", " #x " \n\t"
+
+static void ff_h264_dct_mmx(int16_t inblock[4][4], int16_t outblock[4][4])
+{
+    /* Load dct coeffs */
+    asm volatile(
+        "movq   (%0), %%mm0 \n\t"
+        "movq  8(%0), %%mm1 \n\t"
+        "movq 16(%0), %%mm2 \n\t"
+        "movq 24(%0), %%mm3 \n\t"
+    :: "r"(inblock) );
+
+    asm volatile(
+        FORWARD_DCT_PART( %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm6, %%mm7)
+    TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
+    FORWARD_DCT_PART( %%mm4, %%mm7, %%mm0, %%mm6, %%mm1, %%mm2, %%mm3, %%mm5)
+    ::);
+    asm volatile(
+        "movq %%mm1,  (%0) \n\t"
+        "movq %%mm2, 8(%0) \n\t"
+        "movq %%mm3,16(%0) \n\t"
+        "movq %%mm5,24(%0) \n\t"       
+    : "+r"(outblock)
+        : );
+}
+
+#define HADAMARD_MULT_PART(a,b,c,d,u,v,w,x) \
+        "movq  " #a ", " #u " \n\t"\
+    "paddw " #b ", " #u " \n\t"\
+    "movq  " #u ", " #v " \n\t"\
+    "movq  " #c ", " #w " \n\t"\
+    "paddw " #d ", " #w " \n\t"\
+    "paddw " #w ", " #u " \n\t"\
+    "psubw " #w ", " #v " \n\t"\
+    "psubw " #b ", " #a " \n\t"\
+    "movq  " #a ", " #w " \n\t"\
+    "movq  " #a ", " #x " \n\t"\
+    "psubw " #d ", " #c " \n\t"\
+    "paddw " #c ", " #x " \n\t"\
+    "psubw " #c ", " #w " \n\t"
+
+static void ff_h264_hadamard_mult4x4_mmx(int16_t Y[4][4])
+{
+    /* Load dct coeffs */
+    asm volatile(
+        "movq   (%0), %%mm4 \n\t"
+        "movq  8(%0), %%mm5 \n\t"
+        "movq 16(%0), %%mm6 \n\t"
+        "movq 24(%0), %%mm7 \n\t"
+    :: "r"(Y) );
+
+    asm volatile(
+        TRANSPOSE4(%%mm4, %%mm5, %%mm6, %%mm7, %%mm0)
+    HADAMARD_MULT_PART( %%mm4, %%mm7, %%mm0, %%mm6, %%mm1, %%mm2, %%mm3, %%mm5)
+    TRANSPOSE4(%%mm1, %%mm2, %%mm3, %%mm5, %%mm0)
+    HADAMARD_MULT_PART( %%mm1, %%mm5, %%mm0, %%mm3, %%mm2, %%mm4, %%mm6, %%mm7)
+    :: );
+    asm volatile(
+        "movq %%mm2,  (%0) \n\t"
+        "movq %%mm4, 8(%0) \n\t"
+        "movq %%mm6,16(%0) \n\t"
+        "movq %%mm7,24(%0) \n\t"       
+    : "+r"(Y)
+        : );
+}
+
+
 static inline void h264_idct8_1d(int16_t *block)
 {
     asm volatile(
@@ -1254,6 +1384,7 @@ static void OPNAME ## h264_qpel ## SIZE 
 }\
 
 
+#define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b "    \n\t"
 #define AVG_3DNOW_OP(a,b,temp, size) \
 "mov" #size " " #b ", " #temp "   \n\t"\
 "pavgusb " #temp ", " #a "        \n\t"\
@@ -1408,6 +1539,343 @@ static inline void ff_h264_biweight_WxH_
     }
 }
 
+extern const int16_t ff_h264_MF00[6];
+extern const int16_t ff_h264_V00[6];
+
+// hadamard quantization
+void ff_h264_transform_quantize2_mmx(const int16_t *outblock, const int16_t *MF, int16_t *result, const int32_t *f, const int32_t qbits[1])
+{
+    const static int64_t oneconst = 0x0001000100010001LL;
+        
+    asm volatile(
+        "movq   (%0), %%mm0 \n\t"
+        "movq   (%1), %%mm4 \n\t"
+        :: "r"(outblock), "r"(MF));
+    asm volatile(
+        "movq   %%mm0, %%mm7 \n\t"
+        "psraw    $14, %%mm7 \n\t"
+        "movq      %0, %%mm1 \n\t"
+        "movq   %%mm1, %%mm2 \n\t"
+        "psllw     $1, %%mm2 \n\t"
+        "pand   %%mm2, %%mm7 \n\t"
+        "psubw  %%mm7, %%mm1 \n\t" // mm1 now contains the signs of outblock[0..3]
+        "movq   %%mm0, %%mm7 \n\t"
+        "pmullw %%mm1, %%mm7 \n\t" // mm7 now contains ABS(outblock)
+        "psraw     $1, %%mm7 \n\t" // mm7 now contains ABS(outblock) >> 1
+        "movq   %%mm7, %%mm6 \n\t"
+        "pmullw %%mm4, %%mm6 \n\t"
+        "pmulhw %%mm4, %%mm7 \n\t" // mm6 now contains low words of (ABS(outblock)>>1)*MF, mm7 contains the high words
+        "movq   %%mm6, %%mm5 \n\t" // now mm5 also contains low words
+        "punpcklwd %%mm7, %%mm5 \n\t" // mm5 should now contain the lowest 2 32-bit numbers from (ABS(outblock)>>1)*MF
+        "punpckhwd %%mm7, %%mm6 \n\t" // mm6 should now contain the highest 2 32-bit numbers from (ABS(outblock)>>1)*MF
+        "movq    (%1), %%mm3 \n\t"
+        "paddd  %%mm3, %%mm5 \n\t" // they now contain (ABS(outblock)>>1)*MF+f
+        "paddd  %%mm3, %%mm6 \n\t"
+        "movd    (%2), %%mm3 \n\t"
+        "psrld  %%mm3, %%mm5 \n\t" // mm5 and mm6 now contain ((ABS(outblock)>>1)*MF+f) >> qbits
+        "psrld  %%mm3, %%mm6 \n\t"
+        "psraw     $1, %%mm1 \n\t"
+        "movq   %%mm1, %%mm2 \n\t"
+        "punpcklwd %%mm1,%%mm1 \n\t"
+        "punpckhwd %%mm2,%%mm2 \n\t"
+        "movq   %%mm5, %%mm0 \n\t"
+        "movq   %%mm6, %%mm3 \n\t"
+        "paddd  %%mm0, %%mm0 \n\t"
+        "paddd  %%mm3, %%mm3 \n\t"
+        "pand   %%mm1, %%mm0 \n\t"
+        "pand   %%mm2, %%mm3 \n\t"
+        "psubd  %%mm0, %%mm5 \n\t"
+        "psubd  %%mm3, %%mm6 \n\t"
+        "packssdw %%mm6, %%mm5 \n\t"
+        :: "m"(oneconst),"r"(f),"r"(qbits));
+    asm volatile(
+        "movq  %%mm5, (%0) \n\t"
+        : "+r"(result)
+        :
+        : "memory");
+
+}
+
+void ff_h264_transform_quantize_mmx(const int16_t *outblock, const int16_t *MF, int16_t *result, const int32_t *f, const int32_t qbits[1])
+{
+    const static int64_t oneconst = 0x0001000100010001LL;
+        
+    asm volatile(
+        "movq   (%0), %%mm0 \n\t"
+        "movq   (%1), %%mm4 \n\t"
+        :: "r"(outblock), "r"(MF));
+    asm volatile(
+        "movq   %%mm0, %%mm7 \n\t"
+        "psraw    $14, %%mm7 \n\t"
+        "movq      %0, %%mm1 \n\t"
+        "movq   %%mm1, %%mm2 \n\t"
+        "psllw     $1, %%mm2 \n\t"
+        "pand   %%mm2, %%mm7 \n\t"
+        "psubw  %%mm7, %%mm1 \n\t" // mm1 now contains the signs of outblock[0..3]
+        "movq   %%mm0, %%mm7 \n\t"
+        "pmullw %%mm1, %%mm7 \n\t" // mm7 now contains ABS(outblock)
+        "movq   %%mm7, %%mm6 \n\t"
+        "pmullw %%mm4, %%mm6 \n\t"
+        "pmulhw %%mm4, %%mm7 \n\t" // mm6 now contains low words of ABS(outblock)*MF, mm7 contains the high words
+        "movq   %%mm6, %%mm5 \n\t" // now mm5 also contains low words
+        "punpcklwd %%mm7, %%mm5 \n\t" // mm5 should now contain the lowest 2 32-bit numbers from ABS(outblock)*MF
+        "punpckhwd %%mm7, %%mm6 \n\t" // mm6 should now contain the highest 2 32-bit numbers from ABS(outblock)*MF
+        "movq    (%1), %%mm3 \n\t"
+        "paddd  %%mm3, %%mm5 \n\t" // they now contain ABS(outblock)*MF+f
+        "paddd  %%mm3, %%mm6 \n\t"
+        "movd    (%2), %%mm3 \n\t"
+        "psrld  %%mm3, %%mm5 \n\t" // mm5 and mm6 now contain (ABS(outblock)*MF+f) >> qbits
+        "psrld  %%mm3, %%mm6 \n\t"
+        "psraw     $1, %%mm1 \n\t"
+        "movq   %%mm1, %%mm2 \n\t"
+        "punpcklwd %%mm1,%%mm1 \n\t"
+        "punpckhwd %%mm2,%%mm2 \n\t"
+        "movq   %%mm5, %%mm0 \n\t"
+        "movq   %%mm6, %%mm3 \n\t"
+        "paddd  %%mm0, %%mm0 \n\t"
+        "paddd  %%mm3, %%mm3 \n\t"
+        "pand   %%mm1, %%mm0 \n\t"
+        "pand   %%mm2, %%mm3 \n\t"
+        "psubd  %%mm0, %%mm5 \n\t"
+        "psubd  %%mm3, %%mm6 \n\t"
+        "packssdw %%mm6, %%mm5 \n\t"
+        :: "m"(oneconst),"r"(f),"r"(qbits));
+    asm volatile(
+        "movq  %%mm5, (%0) \n\t"
+        : "+r"(result)
+        :
+        : "memory");
+
+}
+
+extern const uint8_t div6[52];
+extern const uint8_t rem6[52];
+
+// we'll always work with transposed input blocks, to avoid having to make a distinction between
+// C and mmx implementations
+void ff_h264_transform_dct_quant_mmx(int16_t block[4][4], int QP, int dontscaleDC) // y,x indexing
+{
+    static const int16_t MF[6][4][4] = 
+    {
+        { { 13107, 8066, 13107, 8066}, {  8066, 5243,  8066, 5243}, { 13107, 8066, 13107, 8066}, {  8066, 5243,  8066, 5243} },
+        { { 11916, 7490, 11916, 7490}, {  7490, 4660,  7490, 4660}, { 11916, 7490, 11916, 7490}, {  7490, 4660,  7490, 4660} },
+        { { 10082, 6554, 10082, 6554}, {  6554, 4194,  6554, 4194}, { 10082, 6554, 10082, 6554}, {  6554, 4194,  6554, 4194} },
+        { {  9362, 5825,  9362, 5825}, {  5825, 3647,  5825, 3647}, {  9362, 5825,  9362, 5825}, {  5825, 3647,  5825, 3647} },
+        { {  8192, 5243,  8192, 5243}, {  5243, 3355,  5243, 3355}, {  8192, 5243,  8192, 5243}, {  5243, 3355,  5243, 3355} },
+        { {  7282, 4559,  7282, 4559}, {  4559, 2893,  4559, 2893}, {  7282, 4559,  7282, 4559}, {  4559, 2893,  4559, 2893} }
+    };
+    int32_t qbits = 15 + div6[QP];
+    int32_t f = (1<<qbits)/3;
+    int mod = rem6[QP];
+    DCTELEM outblock[4][4];
+    
+    ff_h264_dct_mmx(block, outblock);
+    
+    {
+        int32_t qbits2[1];
+        int32_t f2[2];
+
+        qbits2[0] = qbits;
+        f2[0] = f;
+        f2[1] = f;
+        ff_h264_transform_quantize_mmx(&(outblock[0][0]),&(MF[mod][0][0]),&(block[0][0]),f2,qbits2);
+        ff_h264_transform_quantize_mmx(&(outblock[1][0]),&(MF[mod][1][0]),&(block[1][0]),f2,qbits2);
+        ff_h264_transform_quantize_mmx(&(outblock[2][0]),&(MF[mod][2][0]),&(block[2][0]),f2,qbits2);
+        ff_h264_transform_quantize_mmx(&(outblock[3][0]),&(MF[mod][3][0]),&(block[3][0]),f2,qbits2);
+
+        if (dontscaleDC)
+            block[0][0] = outblock[0][0];
+    }
+}
+
+void ff_h264_transform_inverse_quantize_highQP_mmx(const int16_t inblock[4], const int16_t V[4], int16_t outblock[4], const int32_t shift[1])
+{
+    asm volatile(
+        "movq   (%0), %%mm7 \n\t"
+        "movq   (%1), %%mm4 \n\t"
+        :: "r"(inblock), "r"(V));
+    asm volatile(
+        "movq   %%mm7, %%mm6 \n\t"
+        "pmullw %%mm4, %%mm6 \n\t"
+        "pmulhw %%mm4, %%mm7 \n\t" // mm6 now contains low words of inblock*V, mm7 contains the high words
+        "movq   %%mm6, %%mm5 \n\t" // now mm5 also contains low words
+        "punpcklwd %%mm7, %%mm5 \n\t" // mm5 should now contain the lowest 2 32-bit numbers from inblock*V
+        "punpckhwd %%mm7, %%mm6 \n\t" // mm6 should now contain the highest 2 32-bit numbers from inblock*V
+        "movd    (%0), %%mm3 \n\t"
+        "pslld  %%mm3, %%mm5 \n\t" // mm5 and mm6 now contain (inblock*V) << shift
+        "pslld  %%mm3, %%mm6 \n\t"
+        "packssdw %%mm6, %%mm5 \n\t"
+        :: "r"(shift));
+    asm volatile(
+        "movq  %%mm5, (%0) \n\t"
+        : "+r"(outblock)
+        :
+        : "memory");
+
+}
+
+void ff_h264_transform_inverse_quantize_lowQP_mmx(const int16_t inblock[4], const int16_t V[4], int16_t outblock[4], const int32_t add[2], const int32_t shift[1])
+{
+    asm volatile(
+        "movq   (%0), %%mm7 \n\t"
+        "movq   (%1), %%mm4 \n\t"
+        :: "r"(inblock), "r"(V));
+    asm volatile(
+        "movq   %%mm7, %%mm6 \n\t"
+        "pmullw %%mm4, %%mm6 \n\t"
+        "pmulhw %%mm4, %%mm7 \n\t" // mm6 now contains low words of inblock*V, mm7 contains the high words
+        "movq   %%mm6, %%mm5 \n\t" // now mm5 also contains low words
+        "punpcklwd %%mm7, %%mm5 \n\t" // mm5 should now contain the lowest 2 32-bit numbers from inblock*V
+        "punpckhwd %%mm7, %%mm6 \n\t" // mm6 should now contain the highest 2 32-bit numbers from inblock*V
+        "movq    (%1), %%mm3 \n\t"
+        "paddd  %%mm3, %%mm5 \n\t"
+        "paddd  %%mm3, %%mm6 \n\t"
+        "movd    (%0), %%mm3 \n\t"
+        "psrad  %%mm3, %%mm5 \n\t" // mm5 and mm6 now contain (inblock*V+add) >> shift
+        "psrad  %%mm3, %%mm6 \n\t"
+        "packssdw %%mm6, %%mm5 \n\t"
+        :: "r"(shift),"r"(add));
+    asm volatile(
+        "movq  %%mm5, (%0) \n\t"
+        : "+r"(outblock)
+        :
+        : "memory");
+
+}
+
+void ff_h264_transform_inverse_quant_dct_add_mmx(int16_t block[4][4], int QP, int dontscaleDC, uint8_t *dst, int stride) // y,x indexing
+{
+    static const int16_t V[6][4][4] = 
+    {
+        { { 10*16, 13*16, 10*16, 13*16}, { 13*16, 16*16, 13*16, 16*16}, { 10*16, 13*16, 10*16, 13*16}, { 13*16, 16*16, 13*16, 16*16} },
+        { { 11*16, 14*16, 11*16, 14*16}, { 14*16, 18*16, 14*16, 18*16}, { 11*16, 14*16, 11*16, 14*16}, { 14*16, 18*16, 14*16, 18*16} },
+        { { 13*16, 16*16, 13*16, 16*16}, { 16*16, 20*16, 16*16, 20*16}, { 13*16, 16*16, 13*16, 16*16}, { 16*16, 20*16, 16*16, 20*16} },
+        { { 14*16, 18*16, 14*16, 18*16}, { 18*16, 23*16, 18*16, 23*16}, { 14*16, 18*16, 14*16, 18*16}, { 18*16, 23*16, 18*16, 23*16} },
+        { { 16*16, 20*16, 16*16, 20*16}, { 20*16, 25*16, 20*16, 25*16}, { 16*16, 20*16, 16*16, 20*16}, { 20*16, 25*16, 20*16, 25*16} },
+        { { 18*16, 23*16, 18*16, 23*16}, { 23*16, 29*16, 23*16, 29*16}, { 18*16, 23*16, 18*16, 23*16}, { 23*16, 29*16, 23*16, 29*16} }
+    };
+    DCTELEM elem[4][4];
+    int mod = rem6[QP];
+
+    if (QP >= 24)
+    {
+        int shift = div6[QP]-4;
+        
+        int32_t shift1[1];
+        shift1[0] = shift;
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(block[0][0]),&(V[mod][0][0]),&(elem[0][0]),shift1);
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(block[1][0]),&(V[mod][1][0]),&(elem[1][0]),shift1);
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(block[2][0]),&(V[mod][2][0]),&(elem[2][0]),shift1);
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(block[3][0]),&(V[mod][3][0]),&(elem[3][0]),shift1);
+        
+        if (dontscaleDC)
+            elem[0][0] = block[0][0];
+    }
+    else
+    {
+        int add = (1<<(3-div6[QP]));
+        int shift = (4-div6[QP]);
+        int32_t shift1[1];
+        int32_t add2[2];
+        shift1[0] = shift;
+        add2[0] = add;
+        add2[1] = add;
+        
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(block[0][0]),&(V[mod][0][0]),&(elem[0][0]),add2,shift1);
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(block[1][0]),&(V[mod][1][0]),&(elem[1][0]),add2,shift1);
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(block[2][0]),&(V[mod][2][0]),&(elem[2][0]),add2,shift1);
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(block[3][0]),&(V[mod][3][0]),&(elem[3][0]),add2,shift1);
+        if (dontscaleDC)
+            elem[0][0] = block[0][0];
+    }
+    
+    ff_h264_idct_add_c(dst, &(elem[0][0]), stride);
+}
+
+/**
+ * |ZD(i,j)| = (|YD(i,j)| MF(0,0) + 2 f) >> (qbits + 1)
+ *
+ */
+void ff_h264_hadamard_quant_4x4_mmx(DCTELEM Y[4][4], int QP)
+{
+    int qbits = 15 + div6[QP];
+    int f2 = ((1 << qbits) / 3)*2;
+    int shift = (qbits + 1);
+    int mod = rem6[QP];
+    int16_t mf = ff_h264_MF00[mod];
+    int16_t MF[4];
+    int32_t f[2];
+    int32_t qbits2[1];
+    MF[0] = mf;
+    MF[1] = mf;
+    MF[2] = mf;
+    MF[3] = mf;
+    f[0] = f2;
+    f[1] = f2;
+    qbits2[0] = shift;
+
+    ff_h264_transform_quantize2_mmx(&(Y[0][0]), MF, &(Y[0][0]), f, qbits2);
+    ff_h264_transform_quantize2_mmx(&(Y[1][0]), MF, &(Y[1][0]), f, qbits2);
+    ff_h264_transform_quantize2_mmx(&(Y[2][0]), MF, &(Y[2][0]), f, qbits2);
+    ff_h264_transform_quantize2_mmx(&(Y[3][0]), MF, &(Y[3][0]), f, qbits2);
+}
+
+/*
+ * Only if qpprime_y_zero_transform_bypass_flag == 0
+ */
+void ff_h264_hadamard_invquant_4x4_mmx(DCTELEM Y[4][4], int QP)
+{
+    int mod = rem6[QP];
+    
+    if (QP < 36)
+    {
+        int qbits = div6[QP];
+        int shift = 6-qbits;
+        int f = (1 << (5-qbits));
+        int32_t shift1[1];
+        int32_t f2[2] = {f, f};
+        int16_t V = ff_h264_V00[mod];
+        int16_t V2[4] = {V, V, V, V};
+        shift1[0] = shift;
+        
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(Y[0][0]),V2,&(Y[0][0]),f2,shift1);
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(Y[1][0]),V2,&(Y[1][0]),f2,shift1);
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(Y[2][0]),V2,&(Y[2][0]),f2,shift1);
+        ff_h264_transform_inverse_quantize_lowQP_mmx(&(Y[3][0]),V2,&(Y[3][0]),f2,shift1);
+    }
+    else
+    {
+        int shift = div6[QP] - 6;
+        int32_t shift1[1];
+        int16_t V = ff_h264_V00[mod];
+        int16_t V2[4] = {V, V, V, V};
+        shift1[0] = shift;
+        
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(Y[0][0]),V2,&(Y[0][0]),shift1);
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(Y[1][0]),V2,&(Y[1][0]),shift1);
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(Y[2][0]),V2,&(Y[2][0]),shift1);
+        ff_h264_transform_inverse_quantize_highQP_mmx(&(Y[3][0]),V2,&(Y[3][0]),shift1);
+    }
+}
+
+/**
+ * |ZD(i,j)| = (|YD(i,j)| MF(0,0) + 2 f) >> (qbits + 1)
+ *
+ */
+void ff_h264_hadamard_quant_2x2_mmx(int16_t Y[2][2], int QP)
+{
+    int qbits = 15 + div6[QP];
+    int f2 = ((1 << qbits) / 3)*2;
+    int shift = qbits+1;
+    int32_t shift1[1];
+    int32_t f22[2] = {f2, f2};
+    int16_t MF = ff_h264_MF00[rem6[QP]];
+    int16_t MF2[4] = {MF, MF, MF, MF};
+    shift1[0] = shift;
+    
+    ff_h264_transform_quantize_mmx(&(Y[0][0]),MF2,&(Y[0][0]),f22,shift1);
+}
+
 #define H264_WEIGHT(W,H) \
 static void ff_h264_biweight_ ## W ## x ## H ## _mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset){ \
     ff_h264_biweight_WxH_mmx2(dst, src, stride, log2_denom, weightd, weights, offset, W, H); \
diff --git a/tests/Makefile b/tests/Makefile
index 8654744..036a7ac 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -21,7 +21,7 @@ test-server: vsynth1/0.pgm asynth1.sw
 	@$(VPATH)/server-regression.sh $(SERVER_REFFILE) $(VPATH)/test.conf
 
 # fast regression tests for all codecs
-codectest mpeg4 mpeg ac3 snow snowll: vsynth1/0.pgm vsynth2/0.pgm asynth1.sw tiny_psnr
+codectest mpeg4 mpeg ac3 snow snowll ffh264: vsynth1/0.pgm vsynth2/0.pgm asynth1.sw tiny_psnr
 	@$(VPATH)/regression.sh $@ $(REFFILE1) vsynth1
 	@$(VPATH)/regression.sh $@ $(REFFILE2) vsynth2
 
diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref
index 58a141f..75447a0 100644
--- a/tests/ffmpeg.regression.ref
+++ b/tests/ffmpeg.regression.ref
@@ -59,6 +59,10 @@ fc01a5723a0d629bb73c74d64692120d *./data
 2414342 ./data/a-h263p.avi
 28fd12ac0b168252d81df6f6e60a5d17 *./data/out.yuv
 stddev:  2.07 PSNR:41.76 bytes:7602176
+9fbe481528de2f1b6dc3ed6ee1858419 *./data/a-ffh264.mp4
+3000506 ./data/a-ffh264.mp4
+900d635f44fd04fe94914c9d7782a4cb *./data/out.yuv
+stddev:  0.68 PSNR:51.39 bytes:7602176
 26bbeee40bd124d981e8fbfc5b8bee16 *./data/a-odivx.mp4
 554499 ./data/a-odivx.mp4
 57aed19df5cbada4b05991527ee72ebe *./data/out.yuv
diff --git a/tests/regression.sh b/tests/regression.sh
index 9aa1563..f64bd07 100755
--- a/tests/regression.sh
+++ b/tests/regression.sh
@@ -40,6 +40,8 @@ elif [ "$1" = "snow" ] ; then
     do_snow=y
 elif [ "$1" = "snowll" ] ; then
     do_snowll=y
+elif [ "$1" = "ffh264" ] ; then
+    do_ffh264=y
 elif [ "$1" = "libavtest" ] ; then
     do_libav=y
     logfile="$datadir/libav.regression"
@@ -82,6 +84,7 @@ else
     do_svq1=y
     do_snow=y
     do_snowll=y
+    do_ffh264=y
     do_adpcm_yam=y
     do_dv=y
     do_dv50=y
@@ -297,6 +300,16 @@ do_ffmpeg $raw_dst -y -i $file -f rawvid
 fi
 
 ###################################
+if [ -n "$do_ffh264" ] ; then
+# h264 encoding
+file=${outfile}ffh264.mp4
+do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec ffh264 -vtag avc1 $file
+
+# h264 decoding
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+fi
+
+###################################
 if [ -n "$do_mpeg4" ] ; then
 # mpeg4
 file=${outfile}odivx.mp4
diff --git a/tests/rotozoom.regression.ref b/tests/rotozoom.regression.ref
index 606b3ea..f95b9cc 100644
--- a/tests/rotozoom.regression.ref
+++ b/tests/rotozoom.regression.ref
@@ -59,6 +59,10 @@ stddev:  5.44 PSNR:33.41 bytes:7602176
 868164 ./data/a-h263p.avi
 80fb224bebbe2e04f228da7485b905c5 *./data/out.yuv
 stddev:  1.91 PSNR:42.49 bytes:7602176
+8d04a0eb38e9bc2448bdb8a1e5eac722 *./data/a-ffh264.mp4
+2219039 ./data/a-ffh264.mp4
+3003114c8857df5e7e652f1dff717470 *./data/out.yuv
+stddev:  0.71 PSNR:51.06 bytes:7602176
 f69bd330fd11c8f0943ab329d3099dc7 *./data/a-odivx.mp4
 120150 ./data/a-odivx.mp4
 e8c90899c32e11e7e4d1354dab0b8f28 *./data/out.yuv
