/*****************************************************************************/
/*									     */
/*  FACTOR A, B, A-B, AND A+B						     */
/*  11/25/06 (dkc)							     */
/*									     */
/*  Input to this program is a triplet of (a,b) values.  These (a,b) values  */
/*  are different representations of T**p or p*T**p.  a, b, a-b, and a+b     */
/*  are factored for each (a,b) value.					     */
/*									     */
/*  Note: a-b and a+b are switched for [(a**p-b**p)/(a-b)] (the third (a,b)  */
/*  value).								     */
/*									     */
/*****************************************************************************/
#include <stdio.h>
#include <math.h>
#include "table10.h"
int main ()
{
int insize=408;
unsigned int input[408*4]={
   0x25c01a,   0x2400b5,  0x1e70025,  0x3030001, 
   0x25c01a,    0x1bf65,  0x1e70025,  0x3030001, 
   0x2400b5,    0x1bf65,  0x1e70025,  0x3030001, 
   0x25bbf3,   0x228c1e,  0x3a90013,  0x3030000, 
   0x25bbf3,    0x32fd5,  0x3a90013,  0x3030000, 
   0x228c1e,    0x32fd5,  0x3a90013,  0x3030000, 
   0x25b880,   0x1d54bd,   0xa30049,  0x3030000, 
   0x25b880,    0x863c3,   0xa30049,  0x3030000, 
   0x1d54bd,    0x863c3,   0xa30049,  0x3030000, 
   0x254fad,   0x1a18d0,  0x3730013,  0x3030001, 
   0x254fad,    0xb36dd,  0x3730013,  0x3030001, 
   0x1a18d0,    0xb36dd,  0x3730013,  0x3030001, 
   0x2504cc,   0x1b370f,  0x2650013,  0x3030000, 
   0x2504cc,    0x9cdbd,  0x2650013,  0x3030000, 
   0x1b370f,    0x9cdbd,  0x2650013,  0x3030000, 
   0x24d3a2,   0x20121b,  0x2770013,  0x3030000, 
   0x24d3a2,    0x4c187,  0x2770013,  0x3030000, 
   0x20121b,    0x4c187,  0x2770013,  0x3030001, 
   0x24a42f,   0x166ac3,  0x1330025,  0x3030000, 
   0x24a42f,    0xe396c,  0x1330025,  0x3030000, 
   0x166ac3,    0xe396c,  0x1330025,  0x3030000, 
   0x236a85,   0x15cbb9,  0x1b10025,  0x3030001, 
   0x236a85,    0xd9ecc,  0x1b10025,  0x3030001, 
   0x15cbb9,    0xd9ecc,  0x1b10025,  0x3030001, 
   0x230761,   0x11cba0,  0x2410013,  0x3030000, 
   0x230761,   0x113bc1,  0x2410013,  0x3030000, 
   0x11cba0,   0x113bc1,  0x2410013,  0x3030000, 
   0x21a861,   0x1e05ed,  0x1330025,  0x3030000, 
   0x21a861,    0x3a274,  0x1330025,  0x3030000, 
   0x1e05ed,    0x3a274,  0x1330025,  0x3030000, 
   0x215059,   0x151260,  0x32b0013,  0x3030000, 
   0x215059,    0xc3df9,  0x32b0013,  0x3030000, 
   0x151260,    0xc3df9,  0x32b0013,  0x3030000, 
   0x20fdf0,   0x167441,  0x32b0013,  0x3030001, 
   0x20fdf0,    0xa89af,  0x32b0013,  0x3030001, 
   0x167441,    0xa89af,  0x32b0013,  0x3030001, 
   0x20edb0,   0x1ad089,  0x2410013,  0x3030000, 
   0x20edb0,    0x61d27,  0x2410013,  0x3030000, 
   0x1ad089,    0x61d27,  0x2410013,  0x3030000, 
   0x209c33,   0x1cf2ef,  0x1b10025,  0x3030000, 
   0x209c33,    0x3a944,  0x1b10025,  0x3030000, 
   0x1cf2ef,    0x3a944,  0x1b10025,  0x3030000, 
   0x1ebbaf,   0x14cd2f,  0x18d0025,  0x3030000, 
   0x1ebbaf,    0x9ee80,  0x18d0025,  0x3030000, 
   0x14cd2f,    0x9ee80,  0x18d0025,  0x3030000, 
   0x1ea74b,   0x16aaac,  0x21d0013,  0x3030000, 
   0x1ea74b,    0x7fc9f,  0x21d0013,  0x3030000, 
   0x16aaac,    0x7fc9f,  0x21d0013,  0x3030000, 
   0x1e847f,   0x1dcbed,  0x33d0013,  0x3030001, 
   0x1e847f,     0xb892,  0x33d0013,  0x3030001, 
   0x1dcbed,     0xb892,  0x33d0013,  0x3030001, 
   0x1e808d,   0x134046,   0xc70049,  0x3030000, 
   0x1e808d,    0xb4047,   0xc70049,  0x3030000, 
   0x134046,    0xb4047,   0xc70049,  0x3030000, 
   0x1e4538,   0x134059,  0x10f0025,  0x3030000, 
   0x1e4538,    0xb04df,  0x10f0025,  0x3030000, 
   0x134059,    0xb04df,  0x10f0025,  0x3030000, 
   0x1dc4c1,   0x137072,  0x20b0013,  0x3030000, 
   0x1dc4c1,    0xa544f,  0x20b0013,  0x3030000, 
   0x137072,    0xa544f,  0x20b0013,  0x3030000, 
   0x1dba32,   0x139dc9,  0x20b0013,  0x3030000, 
   0x1dba32,    0xa1c69,  0x20b0013,  0x3030000, 
   0x139dc9,    0xa1c69,  0x20b0013,  0x3030000, 
   0x1d71b6,   0x153ebd,  0x2f50013,  0x3030000, 
   0x1d71b6,    0x832f9,  0x2f50013,  0x3030000, 
   0x153ebd,    0x832f9,  0x2f50013,  0x3030000, 
   0x1d71a5,   0x18168d,  0x18d0025,  0x3030001, 
   0x1d71a5,    0x55b18,  0x18d0025,  0x3030001, 
   0x18168d,    0x55b18,  0x18d0025,  0x3030001, 
   0x1d4db7,    0xf5a78,  0x2e30013,  0x3030000, 
   0x1d4db7,    0xdf33f,  0x2e30013,  0x3030000, 
    0xf5a78,    0xdf33f,  0x2e30013,  0x3030000, 
   0x1d0a13,   0x19c037,  0x21d0013,  0x3030001, 
   0x1d0a13,    0x349dc,  0x21d0013,  0x3030000, 
   0x19c037,    0x349dc,  0x21d0013,  0x3030000, 
   0x1cee6f,   0x123e5d,  0x17b0025,  0x3030001, 
   0x1cee6f,    0xab012,  0x17b0025,  0x3030001, 
   0x123e5d,    0xab012,  0x17b0025,  0x3030001, 
   0x1ce850,   0x1740dd,  0x10f0025,  0x3030000, 
   0x1ce850,    0x5a773,  0x10f0025,  0x3030000, 
   0x1740dd,    0x5a773,  0x10f0025,  0x3030000, 
   0x1c8bb9,   0x10d1df,   0x7f006d,  0x3030001, 
   0x1c8bb9,    0xbb9da,   0x7f006d,  0x3030001, 
   0x10d1df,    0xbb9da,   0x7f006d,  0x3030001, 
   0x1bbc28,   0x1616cf,  0x2e30013,  0x3030001, 
   0x1bbc28,    0x5a559,  0x2e30013,  0x3030001, 
   0x1616cf,    0x5a559,  0x2e30013,  0x3030001, 
   0x1ba865,   0x19a9ff,   0xc70049,  0x3030000, 
   0x1ba865,    0x1fe66,   0xc70049,  0x3030000, 
   0x19a9ff,    0x1fe66,   0xc70049,  0x3030000, 
   0x1b8b15,   0x1651ce,  0x17b0025,  0x3030000, 
   0x1b8b15,    0x53947,  0x17b0025,  0x3030000, 
   0x1651ce,    0x53947,  0x17b0025,  0x3030000, 
   0x1b8196,   0x18f2b1,  0x2f50013,  0x3030000, 
   0x1b8196,    0x28ee5,  0x2f50013,  0x3030000, 
   0x18f2b1,    0x28ee5,  0x2f50013,  0x3030000, 
   0x1b2449,    0xf97fd,   0x7f0049,  0x3030000, 
   0x1b2449,    0xb8c4c,   0x7f0049,  0x3030000, 
    0xf97fd,    0xb8c4c,   0x7f0049,  0x3030000, 
   0x1b1e61,    0xee62e,  0x1e70013,  0x3030000, 
   0x1b1e61,    0xc3833,  0x1e70013,  0x3030001, 
    0xee62e,    0xc3833,  0x1e70013,  0x3030000, 
   0x1b086f,   0x101d84,   0x250013,  0x3060001, 
   0x1b086f,    0xaeaeb,   0x250013,  0x3060001, 
   0x101d84,    0xaeaeb,   0x250013,  0x3060001, 
   0x1ac405,   0x16587b,   0x7f006d,  0x3030000, 
   0x1ac405,    0x46b8a,   0x7f006d,  0x3030000, 
   0x16587b,    0x46b8a,   0x7f006d,  0x3030000, 
   0x1abb19,    0xe73fd,   0xb50049,  0x3030000, 
   0x1abb19,    0xc471c,   0xb50049,  0x3030000, 
    0xe73fd,    0xc471c,   0xb50049,  0x3030000, 
   0x199205,   0x14ec21,   0x7f0049,  0x3030000, 
   0x199205,    0x4a5e4,   0x7f0049,  0x3030000, 
   0x14ec21,    0x4a5e4,   0x7f0049,  0x3030000, 
   0x18dd0b,   0x15e759,  0x1e70013,  0x3030000, 
   0x18dd0b,    0x2f5b2,  0x1e70013,  0x3030000, 
   0x15e759,    0x2f5b2,  0x1e70013,  0x3030000, 
   0x189324,   0x1661c5,   0x250013,  0x3060000, 
   0x189324,    0x2315f,   0x250013,  0x3060000, 
   0x1661c5,    0x2315f,   0x250013,  0x3060000, 
   0x17accc,   0x16a401,   0xb50049,  0x3030000, 
   0x17accc,    0x108cb,   0xb50049,  0x3030000, 
   0x16a401,    0x108cb,   0xb50049,  0x3030000, 
   0x16f73f,    0xddc63,  0x2770013,  0x3030001, 
   0x16f73f,    0x91adc,  0x2770013,  0x3030001, 
    0xddc63,    0x91adc,  0x2770013,  0x3030001, 
   0x16799b,    0xff7e7,  0x2770013,  0x3030000, 
   0x16799b,    0x681b4,  0x2770013,  0x3030000, 
    0xff7e7,    0x681b4,  0x2770013,  0x3030000, 
   0x1659bf,    0xf5ec1,   0xa30049,  0x3030000, 
   0x1659bf,    0x6fafe,   0xa30049,  0x3030000, 
    0xf5ec1,    0x6fafe,   0xa30049,  0x3030000, 
   0x1650d0,    0xf16af,  0x1b10013,  0x3030000, 
   0x1650d0,    0x73a21,  0x1b10013,  0x3030000, 
    0xf16af,    0x73a21,  0x1b10013,  0x3030000, 
   0x159c0b,    0xc1822,   0x6d0049,  0x3030000, 
   0x159c0b,    0x983e9,   0x6d0049,  0x3030000, 
    0xc1822,    0x983e9,   0x6d0049,  0x3030000, 
   0x156949,    0xf9b83,  0x2650013,  0x3030000, 
   0x156949,    0x5cdc6,  0x2650013,  0x3030000, 
    0xf9b83,    0x5cdc6,  0x2650013,  0x3030000, 
   0x153a1a,    0xc6e47,  0x1330025,  0x3030000, 
   0x153a1a,    0x8cbd3,  0x1330025,  0x3030000, 
    0xc6e47,    0x8cbd3,  0x1330025,  0x3030000, 
   0x1519f7,   0x122fbe,   0xa30049,  0x3030000, 
   0x1519f7,    0x2ea39,   0xa30049,  0x3030000, 
   0x122fbe,    0x2ea39,   0xa30049,  0x3030000, 
   0x141e51,   0x1213e6,  0x2650013,  0x3030000, 
   0x141e51,    0x20a6b,  0x2650013,  0x3030000, 
   0x1213e6,    0x20a6b,  0x2650013,  0x3030000, 
   0x141a40,   0x135139,  0x1b10013,  0x3030000, 
   0x141a40,     0xc907,  0x1b10013,  0x3030000, 
   0x135139,     0xc907,  0x1b10013,  0x3030001, 
   0x13ea13,    0xd039d,  0x2410013,  0x3030000, 
   0x13ea13,    0x6e676,  0x2410013,  0x3030000, 
    0xd039d,    0x6e676,  0x2410013,  0x3030000, 
   0x13afa6,   0x10f489,  0x1330025,  0x3030000, 
   0x13afa6,    0x2bb1d,  0x1330025,  0x3030000, 
   0x10f489,    0x2bb1d,  0x1330025,  0x3030000, 
   0x134534,    0xe3f1d,  0x18d0013,  0x3030000, 
   0x134534,    0x50617,  0x18d0013,  0x3030000, 
    0xe3f1d,    0x50617,  0x18d0013,  0x3030001, 
   0x1332d7,    0xb2480,   0xc70025,  0x3030000, 
   0x1332d7,    0x80e57,   0xc70025,  0x3030000, 
    0xb2480,    0x80e57,   0xc70025,  0x3030000, 
   0x12f031,   0x1292f3,   0x6d0049,  0x3030000, 
   0x12f031,     0x5d3e,   0x6d0049,  0x3030000, 
   0x1292f3,     0x5d3e,   0x6d0049,  0x3030000, 
   0x12961f,    0xa9b9e,  0x17b0013,  0x3030000, 
   0x12961f,    0x7fa81,  0x17b0013,  0x3030000, 
    0xa9b9e,    0x7fa81,  0x17b0013,  0x3030000, 
   0x12436e,    0xac6a5,  0x21d0013,  0x3030001, 
   0x12436e,    0x77cc9,  0x21d0013,  0x3030001, 
    0xac6a5,    0x77cc9,  0x21d0013,  0x3030001, 
   0x1240e4,   0x10307f,  0x18d0013,  0x3030000, 
   0x1240e4,    0x21065,  0x18d0013,  0x3030000, 
   0x10307f,    0x21065,  0x18d0013,  0x3030000, 
   0x11f15e,    0xd5f17,  0x17b0013,  0x3030000, 
   0x11f15e,    0x49247,  0x17b0013,  0x3030000, 
    0xd5f17,    0x49247,  0x17b0013,  0x3030001, 
   0x11c5fd,    0xce14e,  0x21d0013,  0x3030000, 
   0x11c5fd,    0x4e4af,  0x21d0013,  0x3030000, 
    0xce14e,    0x4e4af,  0x21d0013,  0x3030000, 
   0x11c005,    0xf655d,   0xc70025,  0x3030001, 
   0x11c005,    0x25aa8,   0xc70025,  0x3030000, 
    0xf655d,    0x25aa8,   0xc70025,  0x3030000, 
   0x119bab,   0x116bb6,  0x2410013,  0x3030000, 
   0x119bab,     0x2ff5,  0x2410013,  0x3030000, 
   0x116bb6,     0x2ff5,  0x2410013,  0x3030000, 
   0x11630f,    0xb8541,  0x10f0025,  0x3030000, 
   0x11630f,    0x5ddce,  0x10f0025,  0x3030000, 
    0xb8541,    0x5ddce,  0x10f0025,  0x3030000, 
   0x10b965,    0x884aa,   0xb50025,  0x3030000, 
   0x10b965,    0x834bb,   0xb50025,  0x3030000, 
    0x884aa,    0x834bb,   0xb50025,  0x3030000, 
   0x1081db,    0xdc35d,  0x10f0025,  0x3030000, 
   0x1081db,    0x2be7e,  0x10f0025,  0x3030000, 
    0xdc35d,    0x2be7e,  0x10f0025,  0x3030000, 
   0x1072a9,    0xd4789,  0x20b0013,  0x3030000, 
   0x1072a9,    0x32b20,  0x20b0013,  0x3030000, 
    0xd4789,    0x32b20,  0x20b0013,  0x3030000, 
   0x106711,    0xd5db0,  0x20b0013,  0x3030000, 
   0x106711,    0x30961,  0x20b0013,  0x3030000, 
    0xd5db0,    0x30961,  0x20b0013,  0x3030000, 
    0xf96cc,    0x9463f,  0x1e70013,  0x3030000, 
    0xf96cc,    0x6508d,  0x1e70013,  0x3030000, 
    0x9463f,    0x6508d,  0x1e70013,  0x3030000, 
    0xf7f62,    0xa12a3,   0x7f0049,  0x3030000, 
    0xf7f62,    0x56cbf,   0x7f0049,  0x3030000, 
    0xa12a3,	0x56cbf,   0x7f0049,  0x3030000,
    0xea427,    0xe5286,   0xb50025,  0x3030001, 
    0xea427,     0x51a1,   0xb50025,  0x3030001, 
    0xe5286,     0x51a1,   0xb50025,  0x3030001, 
    0xe3ec2,    0xce587,   0x7f0049,  0x3030000, 
    0xe3ec2,    0x1593b,   0x7f0049,  0x3030000, 
    0xce587,    0x1593b,   0x7f0049,  0x3030000, 
    0xe1ed7,    0x8facb,   0xa30025,  0x3030001, 
    0xe1ed7,    0x5240c,   0xa30025,  0x3030001, 
    0x8facb,    0x5240c,   0xa30025,  0x3030001, 
    0xe0185,    0xd1cdc,  0x1e70013,  0x3030000, 
    0xe0185,     0xe4a9,  0x1e70013,  0x3030000, 
    0xd1cdc,     0xe4a9,  0x1e70013,  0x3030000, 
    0xd96c9,    0x726ef,  0x1330013,  0x3030001, 
    0xd96c9,    0x66fda,  0x1330013,  0x3030001, 
    0x726ef,    0x66fda,  0x1330013,  0x3030001, 
    0xd7bfd,    0xad8fc,   0xa30025,  0x3030001, 
    0xd7bfd,    0x2a301,   0xa30025,  0x3030001, 
    0xad8fc,    0x2a301,   0xa30025,  0x3030001, 
    0xd23d3,    0x6f66d,  0x1b10013,  0x3030000, 
    0xd23d3,    0x62d66,  0x1b10013,  0x3030000, 
    0x6f66d,    0x62d66,  0x1b10013,  0x3030000, 
    0xc810c,    0x66f25,   0x6d0049,  0x3030000, 
    0xc810c,    0x611e7,   0x6d0049,  0x3030000, 
    0x66f25,    0x611e7,   0x6d0049,  0x3030000, 
    0xc77d5,    0x9d8fb,  0x1b10013,  0x3030000, 
    0xc77d5,    0x29eda,  0x1b10013,  0x3030000, 
    0x9d8fb,    0x29eda,  0x1b10013,  0x3030000, 
    0xb7b21,    0x6c5c3,  0x18d0013,  0x3030000, 
    0xb7b21,    0x4b55e,  0x18d0013,  0x3030000, 
    0x6c5c3,    0x4b55e,  0x18d0013,  0x3030000, 
    0xb3c0f,    0xa5ffc,   0x6d0049,  0x3030000, 
    0xb3c0f,     0xdc13,   0x6d0049,  0x3030000, 
    0xa5ffc,     0xdc13,   0x6d0049,  0x3030000, 
    0xb2c1b,    0x81919,  0x18d0013,  0x3030000, 
    0xb2c1b,    0x31302,  0x18d0013,  0x3030000, 
    0x81919,    0x31302,  0x18d0013,  0x3030000, 
    0xb0c76,    0x6b38f,   0xc70025,  0x3030000, 
    0xb0c76,    0x458e7,   0xc70025,  0x3030000, 
    0x6b38f,    0x458e7,   0xc70025,  0x3030000, 
    0xaea16,    0x7e895,  0x10f0013,  0x3030001, 
    0xaea16,    0x30181,  0x10f0013,  0x3030001, 
    0x7e895,    0x30181,  0x10f0013,  0x3030001, 
    0xa7027,    0x78137,  0x17b0013,  0x3030000, 
    0xa7027,    0x2eef0,  0x17b0013,  0x3030000, 
    0x78137,    0x2eef0,  0x17b0013,  0x3030000, 
    0xa3876,    0x93bf9,  0x10f0013,  0x3030001, 
    0xa3876,     0xfc7d,  0x10f0013,  0x3030001, 
    0x93bf9,     0xfc7d,  0x10f0013,  0x3030001, 
    0xa1d1d,    0x915ba,   0xc70025,  0x3030000, 
    0xa1d1d,    0x10763,   0xc70025,  0x3030000, 
    0x915ba,    0x10763,   0xc70025,  0x3030000, 
    0x9c440,    0x5d973,   0x7f0025,  0x3030001, 
    0x9c440,    0x3eacd,   0x7f0025,  0x3030001, 
    0x5d973,    0x3eacd,   0x7f0025,  0x3030001, 
    0x9bb3f,    0x8dae0,  0x17b0013,  0x3030000, 
    0x9bb3f,     0xe05f,  0x17b0013,  0x3030000, 
    0x8dae0,     0xe05f,  0x17b0013,  0x3030000, 
    0x9a78f,    0x4fc98,   0xb50025,  0x3030000, 
    0x9a78f,    0x4aaf7,   0xb50025,  0x3030000, 
    0x4fc98,    0x4aaf7,   0xb50025,  0x3030000, 
    0x920f8,    0x7b8e7,   0x7f0025,  0x3030001, 
    0x920f8,    0x16811,   0x7f0025,  0x3030001, 
    0x7b8e7,    0x16811,   0x7f0025,  0x3030001, 
    0x86a05,    0x84f60,   0xb50025,  0x3030000, 
    0x86a05,     0x1aa5,   0xb50025,  0x3030000, 
    0x84f60,     0x1aa5,   0xb50025,  0x3030000, 
    0x81c53,    0x55faa,   0xa30025,  0x3030000, 
    0x81c53,    0x2bca9,   0xa30025,  0x3030000, 
    0x55faa,    0x2bca9,   0xa30025,  0x3030000, 
    0x7cf42,    0x42e81,   0x6d0025,  0x3030001, 
    0x7cf42,    0x3a0c1,   0x6d0025,  0x3030001, 
    0x42e81,    0x3a0c1,   0x6d0025,  0x3030001, 
    0x7b336,    0x66ba1,   0xa30025,  0x3030000, 
    0x7b336,    0x14795,   0xa30025,  0x3030000, 
    0x66ba1,    0x14795,   0xa30025,  0x3030000, 
    0x7b2b8,    0x52d2f,  0x1330013,  0x3030000, 
    0x7b2b8,    0x28589,  0x1330013,  0x3030000, 
    0x52d2f,    0x28589,  0x1330013,  0x3030000, 
    0x6f779,    0x4a5ae,   0xc70013,  0x3030001, 
    0x6f779,    0x251cb,   0xc70013,  0x3030001, 
    0x4a5ae,    0x251cb,   0xc70013,  0x3030001, 
    0x6e9e8,    0x6ace1,  0x1330013,  0x3030000, 
    0x6e9e8,     0x3d07,  0x1330013,  0x3030000, 
    0x6ace1,     0x3d07,  0x1330013,  0x3030000, 
    0x6cfd3,    0x6b9ae,   0x6d0025,  0x3030001, 
    0x6cfd3,     0x1625,   0x6d0025,  0x3030001, 
    0x6b9ae,     0x1625,   0x6d0025,  0x3030001, 
    0x67c25,    0x3bc51,  0x10f0013,  0x3030000, 
    0x67c25,    0x2bfd4,  0x10f0013,  0x3030000, 
    0x3bc51,    0x2bfd4,  0x10f0013,  0x3030000, 
    0x64639,    0x4a3dd,  0x10f0013,  0x3030000, 
    0x64639,    0x1a25c,  0x10f0013,  0x3030000, 
    0x4a3dd,    0x1a25c,  0x10f0013,  0x3030000, 
    0x63ab1,    0x60e63,   0xc70013,  0x3030001, 
    0x63ab1,     0x2c4e,   0xc70013,  0x3030001, 
    0x60e63,     0x2c4e,   0xc70013,  0x3030001, 
    0x62195,    0x387a9,   0xb50013,  0x3030001, 
    0x62195,    0x299ec,   0xb50013,  0x3030001, 
    0x387a9,    0x299ec,   0xb50013,  0x3030001, 
    0x59df5,    0x38303,   0x7f0025,  0x3030000, 
    0x59df5,    0x21af2,   0x7f0025,  0x3030000, 
    0x38303,    0x21af2,   0x7f0025,  0x3030000, 
    0x58e5c,    0x5121d,   0xb50013,  0x3030001, 
    0x58e5c,     0x7c3f,   0xb50013,  0x3030001, 
    0x5121d,     0x7c3f,   0xb50013,  0x3030001, 
    0x53491,    0x48faf,   0x7f0025,  0x3030000, 
    0x53491,     0xa4e2,   0x7f0025,  0x3030000, 
    0x48faf,     0xa4e2,   0x7f0025,  0x3030000, 
    0x51763,    0x3b05d,   0xa30013,  0x3030001, 
    0x51763,    0x16706,   0xa30013,  0x3030001, 
    0x3b05d,    0x16706,   0xa30013,  0x3030001, 
    0x4c47b,    0x44ec6,   0xa30013,  0x3030001, 
    0x4c47b,     0x75b5,   0xa30013,  0x3030001, 
    0x44ec6,     0x75b5,   0xa30013,  0x3030001, 
    0x4832b,    0x24ca8,   0x6d0025,  0x3030000, 
    0x4832b,    0x23683,   0x6d0025,  0x3030000, 
    0x24ca8,    0x23683,   0x6d0025,  0x3030000, 
    0x4483f,    0x23e9a,   0x490025,  0x3030001, 
    0x4483f,    0x209a5,   0x490025,  0x3030001, 
    0x23e9a,    0x209a5,   0x490025,  0x3030001, 
    0x4185c,    0x22255,   0xc70013,  0x3030000, 
    0x4185c,    0x1f607,   0xc70013,  0x3030000, 
    0x22255,    0x1f607,   0xc70013,  0x3030000, 
    0x3ff41,    0x3d001,   0x6d0025,  0x3030000, 
    0x3ff41,     0x2f40,   0x6d0025,  0x3030000, 
    0x3d001,     0x2f40,   0x6d0025,  0x3030000, 
    0x3df0d,    0x3186c,   0xc70013,  0x3030000, 
    0x3df0d,     0xc6a1,   0xc70013,  0x3030000, 
    0x3186c,     0xc6a1,   0xc70013,  0x3030000, 
    0x3d3cd,    0x39487,   0x490025,  0x3030001, 
    0x3d3cd,     0x3f46,   0x490025,  0x3030001, 
    0x39487,     0x3f46,   0x490025,  0x3030001, 
    0x38ad3,    0x20389,   0xb50013,  0x3030000, 
    0x38ad3,    0x1874a,   0xb50013,  0x3030000, 
    0x20389,    0x1874a,   0xb50013,  0x3030000, 
    0x3895a,    0x26d37,   0x7f0013,  0x3030001, 
    0x3895a,    0x11c23,   0x7f0013,  0x3030001, 
    0x26d37,    0x11c23,   0x7f0013,  0x3030001, 
    0x3386a,    0x2e92b,   0xb50013,  0x3030000, 
    0x3386a,     0x4f3f,   0xb50013,  0x3030000, 
    0x2e92b,     0x4f3f,   0xb50013,  0x3030000, 
    0x3363a,    0x30c0b,   0x7f0013,  0x3030001, 
    0x3363a,     0x2a2f,   0x7f0013,  0x3030001, 
    0x30c0b,     0x2a2f,   0x7f0013,  0x3030001, 
    0x3066b,    0x1be10,   0xa30013,  0x3030000, 
    0x3066b,    0x1485b,   0xa30013,  0x3030000, 
    0x1be10,    0x1485b,   0xa30013,  0x3030000, 
    0x2ed40,    0x22a23,   0xa30013,  0x3030000, 
    0x2ed40,     0xc31d,   0xa30013,  0x3030000, 
    0x22a23,     0xc31d,   0xa30013,  0x3030000, 
    0x2df1c,    0x193f1,   0x6d0013,  0x3030001, 
    0x2df1c,    0x14b2b,   0x6d0013,  0x3030001, 
    0x193f1,    0x14b2b,   0x6d0013,  0x3030001, 
    0x2a1f3,    0x251cc,   0x6d0013,  0x3030001, 
    0x2a1f3,     0x5027,   0x6d0013,  0x3030001, 
    0x251cc,     0x5027,   0x6d0013,  0x3030001, 
    0x2781c,    0x15bb1,   0x490025,  0x3030000, 
    0x2781c,    0x11c6b,   0x490025,  0x3030000, 
    0x15bb1,    0x11c6b,   0x490025,  0x3030000, 
    0x22cf3,    0x21b4c,   0x490025,  0x3030000, 
    0x22cf3,     0x11a7,   0x490025,  0x3030000, 
    0x21b4c,     0x11a7,   0x490025,  0x3030000, 
    0x21617,    0x12023,   0x7f0013,  0x3030000, 
    0x21617,     0xf5f4,   0x7f0013,  0x3030000, 
    0x12023,     0xf5f4,   0x7f0013,  0x3030000, 
    0x1fcdb,    0x18c7f,   0x7f0013,  0x3030000, 
    0x1fcdb,     0x705c,   0x7f0013,  0x3030000, 
    0x18c7f,     0x705c,   0x7f0013,  0x3030000, 
    0x1a695,     0xfb5e,   0x6d0013,  0x3030000, 
    0x1a695,     0xab37,   0x6d0013,  0x3030000, 
     0xfb5e,     0xab37,   0x6d0013,  0x3030000, 
    0x1905d,     0xf410,   0x490013,  0x3030001, 
    0x1905d,     0x9c4d,   0x490013,  0x3030001, 
     0xf410,     0x9c4d,   0x490013,  0x3030001, 
    0x17baf,    0x1636d,   0x6d0013,  0x3030000, 
    0x17baf,     0x1842,   0x6d0013,  0x3030000, 
    0x1636d,     0x1842,   0x6d0013,  0x3030000, 
    0x16555,    0x15515,   0x490013,  0x3030001, 
    0x16555,     0x1040,   0x490013,  0x3030001, 
    0x15515,     0x1040,   0x490013,  0x3030001, 
     0xe8ce,     0x7c87,   0x490013,  0x3030000, 
     0xe8ce,     0x6c47,   0x490013,  0x3030000, 
     0x7c87,     0x6c47,   0x490013,  0x3030000, 
     0xd6cf,     0xb98e,   0x490013,  0x3030000, 
     0xd6cf,     0x1d41,   0x490013,  0x3030000, 
     0xb98e,     0x1d41,   0x490013,  0x3030000, 
     0x90ec,     0x54cd,   0x250013,  0x3030001, 
     0x90ec,     0x3c1f,   0x250013,  0x3030001, 
     0x54cd,     0x3c1f,   0x250013,  0x3030001, 
     0x82c7,     0x78dc,   0x250013,  0x3030001, 
     0x82c7,      0x9eb,   0x250013,  0x3030001, 
     0x78dc,      0x9eb,   0x250013,  0x3030001, 
     0x53e1,     0x2ee6,   0x250013,  0x3030000, 
     0x53e1,     0x24fb,   0x250013,  0x3030000, 
     0x2ee6,     0x24fb,   0x250013,  0x3030000, 
     0x4c93,     0x4459,   0x250013,  0x3030000, 
     0x4c93,      0x83a,   0x250013,  0x3030000, 
     0x4459,	  0x83a,   0x250013,  0x3030000};

int tsize=551; // prime look-up table size
int h,i,j,k,m;
int a,b,c,d;
int save[100];
FILE *Outfp;
Outfp = fopen("out18d.dat","w");
/*******************/
/*  factor input   */
/*******************/
for (h=0; h<insize; h+=3) {
/******************/
/*  first pair	  */
/******************/
   a=input[4*h];
   b=input[4*h+1];
   c=a+b;
   d=a-b;
   fprintf(Outfp," %#10x %d \n",input[4*h+2],
	  (unsigned char)(input[4*h+3]&0xff));
   fprintf(Outfp," %#8x %#8x ",a,b);
   m=0;
   for (i=0; i<tsize; i++) {
      j=table[i];
      if (j*j>a)
	 break;
      if ((a/j)*j!=a)
	 continue;
      for (k=0; k<100; k++) {
	 save[m]=j;
	 m=m+1;
	 a=a/j;
	 if ((a/j)*j!=a)
	    break;
	 }
      }
   if (a!=1) {
      save[m]=a;
      m=m+1;
      }
   if (m==1)
      fprintf(Outfp,"%d",save[0]);
   else {
      for (i=0; i<m-1; i++) {
	 fprintf(Outfp,"%d*",save[i]);
	 }
      fprintf(Outfp,"%d",save[m-1]);
      }
   fprintf(Outfp,"  ");
   if (b==1)
      fprintf(Outfp,"%d",b);
   else {
      m=0;
      for (i=0; i<tsize; i++) {
	 j=table[i];
	 if (j*j>b)
	    break;
	 if ((b/j)*j!=b)
	    continue;
	 for (k=0; k<100; k++) {
	    save[m]=j;
	    m=m+1;
	    b=b/j;
	    if ((b/j)*j!=b)
	       break;
	    }
	 }
      if (b!=1) {
	 save[m]=b;
	 m=m+1;
	 }
      if (m==1)
	 fprintf(Outfp,"%d",save[0]);
      else {
	 for (i=0; i<m-1; i++) {
	    fprintf(Outfp,"%d*",save[i]);
	    }
	 fprintf(Outfp,"%d",save[m-1]);
	 }
      }
   fprintf(Outfp,"  ");
   m=0;
   for (i=0; i<tsize; i++) {
      j=table[i];
      if (j*j>c)
	 break;
      if ((c/j)*j!=c)
	 continue;
      for (k=0; k<100; k++) {
	 save[m]=j;
	 m=m+1;
	 c=c/j;
	 if ((c/j)*j!=c)
	    break;
	 }
      }
   if (c!=1) {
      save[m]=c;
      m=m+1;
      }
   if (m==1)
      fprintf(Outfp,"%d",save[0]);
   else {
      for (i=0; i<m-1; i++) {
	 fprintf(Outfp,"%d*",save[i]);
	 }
      fprintf(Outfp,"%d",save[m-1]);
      }
   fprintf(Outfp,"  ");
   if (d==1)
      fprintf(Outfp,"%d",d);
   else {
      m=0;
      for (i=0; i<tsize; i++) {
	 j=table[i];
	 if (j*j>d)
	    break;
	 if ((d/j)*j!=d)
	    continue;
	 for (k=0; k<100; k++) {
	    save[m]=j;
	    m=m+1;
	    d=d/j;
	    if ((d/j)*j!=d)
	       break;
	    }
	 }
      if (d!=1) {
	 save[m]=d;
	 m=m+1;
	 }
      if (m==1)
	 fprintf(Outfp,"%d",save[0]);
      else {
	 for (i=0; i<m-1; i++) {
	    fprintf(Outfp,"%d*",save[i]);
	    }
	 fprintf(Outfp,"%d",save[m-1]);
	 }
      }
   fprintf(Outfp,"\n");
/******************/
/*  second pair   */
/******************/
   a=input[4*h];
   b=a-input[4*h+1];
   if (a<b) {
      c=a;
      a=b;
      b=c;
      }
   c=a+b;
   d=a-b;
   fprintf(Outfp," %#8x %#8x  ",a,b);
   m=0;
   for (i=0; i<tsize; i++) {
      j=table[i];
      if (j*j>a)
	 break;
      if ((a/j)*j!=a)
	 continue;
      for (k=0; k<100; k++) {
	 save[m]=j;
	 m=m+1;
	 a=a/j;
	 if ((a/j)*j!=a)
	    break;
	 }
      }
   if (a!=1) {
      save[m]=a;
      m=m+1;
      }
   if (m==1)
      fprintf(Outfp,"%d",save[0]);
   else {
      for (i=0; i<m-1; i++) {
	 fprintf(Outfp,"%d*",save[i]);
	 }
      fprintf(Outfp,"%d",save[m-1]);
      }
   fprintf(Outfp,"  ");
   if (b==1)
      fprintf(Outfp,"%d",b);
   else {
      m=0;
      for (i=0; i<tsize; i++) {
	 j=table[i];
	 if (j*j>b)
	    break;
	 if ((b/j)*j!=b)
	    continue;
	 for (k=0; k<100; k++) {
	    save[m]=j;
	    m=m+1;
	    b=b/j;
	    if ((b/j)*j!=b)
	       break;
	    }
	 }
      if (b!=1) {
	 save[m]=b;
	 m=m+1;
	 }
      if (m==1)
	 fprintf(Outfp,"%d",save[0]);
      else {
	 for (i=0; i<m-1; i++) {
	    fprintf(Outfp,"%d*",save[i]);
	    }
	 fprintf(Outfp,"%d",save[m-1]);
	 }
      }
   fprintf(Outfp,"  ");
   m=0;
   for (i=0; i<tsize; i++) {
      j=table[i];
      if (j*j>c)
	 break;
      if ((c/j)*j!=c)
	 continue;
      for (k=0; k<100; k++) {
	 save[m]=j;
	 m=m+1;
	 c=c/j;
	 if ((c/j)*j!=c)
	    break;
	 }
      }
   if (c!=1) {
      save[m]=c;
      m=m+1;
      }
   if (m==1)
      fprintf(Outfp,"%d",save[0]);
   else {
      for (i=0; i<m-1; i++) {
	 fprintf(Outfp,"%d*",save[i]);
	 }
      fprintf(Outfp,"%d",save[m-1]);
      }
   fprintf(Outfp,"  ");
   if (d==1)
      fprintf(Outfp,"%d",d);
   else {
      m=0;
      for (i=0; i<tsize; i++) {
	 j=table[i];
	 if (j*j>d)
	    break;
	 if ((d/j)*j!=d)
	    continue;
	 for (k=0; k<100; k++) {
	    save[m]=j;
	    m=m+1;
	    d=d/j;
	    if ((d/j)*j!=d)
	       break;
	    }
	 }
      if (d!=1) {
	 save[m]=d;
	 m=m+1;
	 }
      if (m==1)
	 fprintf(Outfp,"%d",save[0]);
      else {
	 for (i=0; i<m-1; i++) {
	    fprintf(Outfp,"%d*",save[i]);
	    }
	 fprintf(Outfp,"%d",save[m-1]);
	 }
      }
   fprintf(Outfp,"\n");
/******************/
/*  third pair	  */
/******************/
   b=input[4*h+1];
   a=input[4*h]-b;
   if (a<b) {
      c=a;
      a=b;
      b=c;
      }
   c=a-b;	       // switch a-b and a+b
   d=a+b;	       //
   fprintf(Outfp," %#8x %#8x  ",a,b);
   m=0;
   for (i=0; i<tsize; i++) {
      j=table[i];
      if (j*j>a)
	 break;
      if ((a/j)*j!=a)
	 continue;
      for (k=0; k<100; k++) {
	 save[m]=j;
	 m=m+1;
	 a=a/j;
	 if ((a/j)*j!=a)
	    break;
	 }
      }
   if (a!=1) {
      save[m]=a;
      m=m+1;
      }
   if (m==1)
      fprintf(Outfp,"%d",save[0]);
   else {
      for (i=0; i<m-1; i++) {
	 fprintf(Outfp,"%d*",save[i]);
	 }
      fprintf(Outfp,"%d",save[m-1]);
      }
   fprintf(Outfp,"  ");
   if (b==1)
      fprintf(Outfp,"%d",b);
   else {
      m=0;
      for (i=0; i<tsize; i++) {
	 j=table[i];
	 if (j*j>b)
	    break;
	 if ((b/j)*j!=b)
	    continue;
	 for (k=0; k<100; k++) {
	    save[m]=j;
	    m=m+1;
	    b=b/j;
	    if ((b/j)*j!=b)
	       break;
	    }
	 }
      if (b!=1) {
	 save[m]=b;
	 m=m+1;
	 }
      if (m==1)
	 fprintf(Outfp,"%d",save[0]);
      else {
	 for (i=0; i<m-1; i++) {
	    fprintf(Outfp,"%d*",save[i]);
	    }
	 fprintf(Outfp,"%d",save[m-1]);
	 }
      }
   fprintf(Outfp,"  ");
   m=0;
   for (i=0; i<tsize; i++) {
      j=table[i];
      if (j*j>c)
	 break;
      if ((c/j)*j!=c)
	 continue;
      for (k=0; k<100; k++) {
	 save[m]=j;
	 m=m+1;
	 c=c/j;
	 if ((c/j)*j!=c)
	    break;
	 }
      }
   if (c!=1) {
      save[m]=c;
      m=m+1;
      }
   if (m==1)
      fprintf(Outfp,"%d",save[0]);
   else {
      for (i=0; i<m-1; i++) {
	 fprintf(Outfp,"%d*",save[i]);
	 }
      fprintf(Outfp,"%d",save[m-1]);
      }
   fprintf(Outfp,"  ");
   if (d==1)
      fprintf(Outfp,"%d",d);
   else {
      m=0;
      for (i=0; i<tsize; i++) {
	 j=table[i];
	 if (j*j>d)
	    break;
	 if ((d/j)*j!=d)
	    continue;
	 for (k=0; k<100; k++) {
	    save[m]=j;
	    m=m+1;
	    d=d/j;
	    if ((d/j)*j!=d)
	       break;
	    }
	 }
      if (d!=1) {
	 save[m]=d;
	 m=m+1;
	 }
      if (m==1)
	 fprintf(Outfp,"%d",save[0]);
      else {
	 for (i=0; i<m-1; i++) {
	    fprintf(Outfp,"%d*",save[i]);
	    }
	 fprintf(Outfp,"%d",save[m-1]);
	 }
      }
   fprintf(Outfp,"\n");
   fprintf(Outfp,"\n");
   }
fprintf(Outfp,"\n");
fclose(Outfp);
return(0);
}