/******************************************************************************/
/*									      */
/* COMPUTE 3N+1 OR 3N-1 SEQUENCES (GENERALIZED DEAD LIMBS)		      */
/* 02/09/11 (dkc)							      */
/*									      */
/* This C program computes general 3n+1 or 3n-1 sequences. The fourth-to-last */
/* element of a sub-sequence must be odd and the third-to-last element of     */
/* a sub-sequence must be divisible by 8. The fourth-to-last element must     */
/* be larger than the order divided by 6. Certain lengths of such sequences   */
/* are not permissible.  General 3n+c sequences with the same properties are  */
/* also computed for c=5, 7, 11, 13, 17, 19, 23, 25, and 29 (where n>0).      */
/*									      */
/* The number of even and odd elements in the segment are computed (where the */
/* element after an odd element i is defined to be (3i+c)/2).		      */
/*									      */
/******************************************************************************/
#include <stdio.h> 
#include <math.h> 
#include <errno.h>
extern char *malloc();
int main () {
//
int c=5;
unsigned int flag23=1;  // alternate c=23 cycle (for "c=-23" if set)
unsigned int row=0;   // number of odd elements
unsigned int iters=1;  // attachment point count (cycles are found only if iters==iters1)
unsigned int iters1=1; // attachment point count (normally set to "iters" value)
unsigned int notwo=1;  // if set, don't count even number sandwiched between two odd numbers.
unsigned int flagp=0;  //  If set, output row data. Settings are;
// flagp=2, notwo=1, iters1=iters (excellent Weibull fit, best for finding cycles)
// flagp=2, notwo=1, iters1>iters (good Weibull fit except for first value)
// flagp=2, notwo=0, iters1>iters (good Weibull fit)
// flagp=1, notwo=0, iters1=iters (good Weibull fit, small samples, exceptions)
// flagp=1, notwo=0, iters1>iters (good Weibull fit, small samples, exceptions)
// flagp=1, notwo=1, iters1=iters (good Weibull fit except for first value, exceptions)
// flagp=1, notwo=1, iters1>iters (good Weibull fit, large samples, exceptions)
unsigned int nomax=0;  // if set, use first integer divisible by 8, normally not set
unsigned int teetoo=0;	//  if set, output t values instead
unsigned int norma=1;  // left shift amount (normally set to 1)
unsigned int outord=0;  // output order
unsigned int abselect=1;  // select default (1), ahist (2), or bhist (3)
unsigned int mask[30]={1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//unsigned int mask[30]={0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // c=7,25 for parity vector (8,4)
//unsigned int mask[30]={0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // c=35 for parity vector (8,4)
//unsigned int mask[30]={0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // c=175 for parity vector (8,4)
unsigned int outloop=40;  // number of primary attachment points (usually set to 40 for start=99999999)
    // multiple values for c=5, 1:2, first and second big cycles (result of clearing more than one mask in a cycle)
    // multiple values for c=25, 1:5 for first cycle (the five entry points are 76, 82, 148, 136 34)
    //	   1:6 for second cycle (the six entry points are 88, 22, 58, 112, 28, 352), 1:3 if only the first or third mask of that cycle is set
    // multiple values for c=29, 1:7 (result of clearing more than one mask in a cycle)
unsigned int overloop=1;  // if set, override iters and iters1 setting
unsigned int outtrace=0;  // output trace array
unsigned int locind=0;	// if set, output locations in trace
unsigned int notally=0;  // if set, don't tally when doing a trace (implemented for c=5, 25, and 29)
unsigned int outcols=1;  // if set, output values (for computing parameters of Weibull or normal distribution)
			 // operational (with masks) for c=-1, 5, 7, 11, 13, 17, -17, -19, 23, -23, 25, 35, 37, 41, 43, 47, 49, 175, 221, and 461
long long start=9999999;  // initial value divisible by 3 (maximum of 99999999)
long long stop=-819;  // final value divisible by 3
// set to 3  3,-3,-3,-21,-3,-9, 3, -3,	3,-33,	3,-111,  3,-33,  3,-27,  3,-99, -9,-87,-45,-81,-69,-201,   3,-291,-819
// for c= 1,-1, 5, 7, 11,13,17,-17,19,-19, 23,-23,  25,-25, 29,-29, 31,-31, 35, 37, 41, 43, 47, 49, 175,-119, 221, 461
//
// mask guide, [] denotes the same cycle, () denotes interrelated cycles
// c=-1: 272
// c=5: 8 152 ([6248 5984 1496] [5744 5336])
// c=7: 40
// c=11: [32 8] [248 104]
// c=13: 16 (1816 2008 2296 2728 3376) [4192 1048 1432]
// c=17: [32 8] [560 200 248]
// c=-17: 520
// c=19: [112 40]
// c=-19: [1496 920]
// c=23: (56 80) [4976 1568 392 440]
// c=-23: ([47512 29944] 29320 [94816 23704 50104] [77320 32536] [58744 49456] 37744 36208)
// c=25: 136 [352 88 112]
// c=-25: [6008 1808 968]
// c=29: [392 176] [32 8] ([3154208 788552 777464 316328 295736 166424 75176]
//			    [6831320 5764064 1441016 2308928 577232 147608 81224 30488])
// c=-29: 904
// c=31: [424 232 208 136]
// c=-31: 1520
// c=35: (272 [416 104])
// c=37: (184 232 304)
// c=41: [512 128 32 8] 152
// c=43: [112, 64, 16]
// c=47: (680 824 1040) [176 80 152 104] [1976 800 200 392]
// c=49: [3256 1600 400 712]
// c=175: (1648 [1432 712] 1168 1144 808) [2656 664 424] [4888 2008 928 232 568]
// c=-119: 2488
// c=221: [1280 320 80 1448] (Note: Maximum not listed first)
// c=461: [800 200 536 4424 2120 1256 1160 896 224 56 1184 296] (Note: Maximum not listed first)
//
long long i,k,oddk,savek,tempk;
unsigned long long temp,temp1,maxe,torder,order,lcount,acount,bcount,xcount;
unsigned long long reject;
unsigned int itero,itere,ecount,el,colcnt,bigo,over64,over32;
unsigned int a,b,f,g,h,j,n,np,count; // indices
unsigned int index,delta,dhist[1000],cnt[200];
unsigned int he[2048],ho2[2048*4],ahist[512],bhist[512]; // histogram
long long c1[50],c2[50],c3[50],c4[50],c5[50],c6[50],c7[50],c8[50],c9[50],c10[50];
unsigned int c1ind,c2ind,c3ind,c4ind,c5ind,c6ind,c7ind,c8ind,c9ind,c5cnt,c5tot,c11cnt,c11tot;
unsigned int c13cnt,c13tot,c17cnt,c17tot,c19cnt,c19tot,c23cnt,c23tot,c25cnt,c25tot,c29cnt,c29tot;
unsigned int c17cyc1,c17cyc2,c17cyc3,c5cyc1,c5cyc2,c5cyc3,c5cyc4,c5cyc5,c5cyc6,c25cyc4;
unsigned int c11cyc1,c11cyc2,c11cyc3,c13cyc1,c13cyc2,c13cyc3,c13cyc4,c13cyc5,c13cyc6,c13cyc7,c13cyc8,c1cyc1;
unsigned int c19cyc1,c19cyc2,c23cyc1,c23cyc2,c23cyc3,c23cyc4,c23cyc5,c23cyc6,c23cyc7,c25cyc1,c25cyc2,c25cyc3;
unsigned int c23cyc8,c23cyc9,c23cyc10,c23cyc11,c23cyc12,c1cnt,c1tot,c29cyc15,c10ind,c17cyc5,c29cyc19;
unsigned int c29cyc1,c29cyc2,c29cyc3,c29cyc4,c29cyc5,c29cyc6,c29cyc7,c29cyc8,c35cnt,c35tot;
unsigned int c29cyc9,c29cyc10,c29cyc11,c29cyc12,c29cyc13,c29cyc14,c7cyc1,c7cnt,c7tot,extra[1000];
unsigned int c23m1,c23m2,c23m3,c23m4,c23m5,c23m6,c23m7,c23m8,c31cnt,c31tot,c31cyc1,c31cyc2,c31cyc3,c31cyc4;
unsigned int c29cyc16,c29cyc17,c29cyc18,c5cyc7,c11cyc4,c13cyc9,c17cyc4,c35cyc1,c35cyc2,c35cyc3;
unsigned int c175cnt,c175tot,c175cyc1,c175cyc2,c175cyc3,c175cyc4,c175cyc5,c175cyc6,c175cyc7;
unsigned int c175cyc8,c175cyc9,c175cyc10,c175cyc11,c175cyc12,c175cyc13,c175cyc14;
unsigned int c119cnt,c119tot,c119cyc1,c221cnt,c221tot,c221cyc1,c221cyc2,c221cyc3,c221cyc4;
unsigned int c461cnt,c461tot,c461cyc1,c461cyc2,c461cyc3,c461cyc4,c461cyc5,c461cyc6,c461cyc7,c461cyc8;
unsigned int c461cyc9,c461cyc10,c461cyc11,c461cyc12,c37cnt,c37tot,c37cyc1,c37cyc2,c37cyc3;
unsigned int c41cnt,c41tot,c41cyc1,c41cyc2,c41cyc3,c41cyc4,c41cyc5,c43cnt,c43tot,c43cyc1,c43cyc2,c43cyc3;
unsigned int c47cnt,c47tot,c47cyc1,c47cyc2,c47cyc3,c47cyc4,c47cyc5,c47cyc6,c47cyc7,c47cyc8,c47cyc9,c47cyc10,c47cyc11;
unsigned int c49cnt,c49tot,c49cyc1,c49cyc2,c49cyc3,c49cyc4;
int tindex;
double sum,std;
unsigned int y[178]={
0,3,6,8,11,  // I (invalid lengths)
13,16,19,21,24, // I
26,29,32,34,37, // I
39,42,44,47,50, // J
52,55,57,60,63, // J
65,68,70,73,75, // K
78,81,83,86,88, // K
91,94,96,99,101, // K
104,106,109,112,114, // L
117,119,122,125,127, // L
130,132,135,138,140, // L
143,145,148,150,153, // M
156,158,161,163,166, // M
171,174,176,179, // M
184,187,189,192,194, // I'
197,200,202,205,207, // I'
210,212,215,218,220, // J'
223,225,228,231,233, // J'
236,238,241,243,246, // K'
249,251,254,256,259, // K'
262,264,267,269,272, // K'
275,277,280,282,285, // K'
287,290,293,295,298, // L'
300,303,306,308,311, // L'
313,316,318,321,324, // M'
326,329,331,334,337, // M'
339,342,344,347,349, // N
352,355,357,360,362, // N
365,368,370,373,375, // N
378,380,383,386,388, // O
391,393,396,399,401, // O
404,406,409,412,414, // O
417,419,422,424,427, // P
430,432,435,437,440, // P
443,445,448,450,453, // P
458,461,463,466}; //
unsigned int z[75]={
1,9, // I  (first elements of length pairs which
14,22, // I when decremented by 3 give invalid
27,35, // I lengths)
40,45, // J
53,58, // J
66,71,76, // K
84,89, // K
97,102, // K
107,115, // L
120,128, // L
133,141, // L
146,151, // M
159,164, // M
172,177, // M
182,190, // I'
195,203, // I' 
208,213, // J'
221,226, // J'
234,239,244, // K'
252,257, // K'
265,270, // K'
278,283, // K'
288,296, // L'
301,309, // L'
314,319, // M'
327,332, // M'
340,345,350, // N
358,363, // N
371,376, // N
384,389, // O
394,402, // O
407,415, // O
420,428, // P
433,438, // P
446,451, // P
459,464}; //
unsigned int table[121*2]={
 0, 0, // 0
 4, 3, // 1
 5, 4, // 2 (6, 2) => (3, 2)
5, 4, // 3 (7, 3) => (5, 3)
6, 5, // 4
6, 5, // 5 (10, 5) => (8, 5)
7, 6, // 6
8, 7, // 7 (14, 7) => (11, 7)
8, 7, // 8
9, 8, // 9
9, 8, // 10
10, 9, // 11
11, 10, // 12 (22, 12) => (19, 12)
11, 10, // 13
12, 11, // 14
12, 11, // 15
13, 12, // 16
13, 12, // 17 (29, 17) => (27, 17)
14, 13, // 18
15, 14, // 19
15, 14, // 20
16, 15, // 21
16, 15, // 22
17, 16, // 23
18, 17, // 24
18, 17, // 25
19, 18, // 26
19, 18, // 27
20, 19, // 28
20, 19, // 29 (48, 29) => (46, 29)
21, 20, // 30
22, 21, // 31
22, 21, // 32
23, 22, // 33
23, 22, // 34
24, 23, // 35
25, 24, // 36
25, 24, // 37
26, 25, // 38
26, 25, // 39
27, 26, // 40
27, 26, // 41 (67, 41) => (65, 41)
28, 27, // 42
29, 28, // 43
29, 28, // 44
30, 29, // 45
30, 29, // 46
31, 30, // 47
32, 31, // 48
32, 31, // 49
33, 32, // 50
33, 32, // 51
34, 33, // 52
35, 34, // 53 (87, 53) => (84, 53) Note: Even count was the same ((34, 34)) (for c=1 or -1)
35, 34, // 54
36, 35, // 55
36, 35, // 56
37, 36, // 57
37, 36, // 58 
38, 37, // 59
39, 38, // 60
39, 38, // 61
40, 39, // 62
40, 39, // 63
41, 40, // 64
42, 41, // 65
42, 41, // 66
43, 42, // 67
43, 42, // 68
44, 43, // 69
44, 43, // 70
45, 44, // 71
46, 45, // 72
46, 45, // 73
47, 46, // 74
47, 46, // 75
48, 47, // 76
49, 48, // 77
49, 48, // 78
50, 49, // 79
50, 49, // 80
51, 50, // 81
51, 50, // 82
52, 51, // 83
53, 52, // 84
53, 52, // 85
54, 53, // 86
54, 53, // 87
55, 54, // 88
56, 55, // 89
56, 55, // 90
57, 56, // 91
57, 56, // 92
58, 57, // 93
58, 57, // 94
59, 58, // 95
60, 59, // 96
60, 59, // 97
61, 60, // 98
61, 60, // 99
62, 61, // 100
63, 62, // 101
63, 62, // 102
64, 63, // 103
64, 63, // 104
65, 64, // 105
66, 65, // 106  // (0,65) for c=1 or -1
66, 65, // 107
67, 66, // 108
67, 66, // 109
68, 67, // 110
68, 67, // 111
69, 68, // 112
70, 69, // 113
70, 69, // 114
71, 70, // 115
71, 70, // 116
72, 71, // 117
72, 71, // 118  // second number interpolated
73, 72, // 119
74, 73}; // 120 
unsigned long long *table1;
long long *v;
unsigned char *trace;
unsigned int *ho;
errno_t err;
FILE *Outfp;
err = fopen_s(&Outfp,"out2a.dat","w");
ho=(unsigned int*) malloc(262144);
if (ho==NULL) {
	printf("error: not enough memory \n");
	goto zskip;
}
table1=(unsigned long long*) malloc(320000008);
if (table1==NULL) {
   printf("error: not enough memory \n");
   goto zskip;
   }
v=(long long*) malloc(1600008);
if (v==NULL) {
   printf("error: not enough memory \n");
   goto zskip;
   }
trace=(unsigned char*) malloc(1000000001);
if (trace==NULL) {
   printf("error: not enough memory \n");
   goto zskip;
   }
if (row>120) {
	printf("row greater than 120 \n");
	goto zskip;
}
if ((locind!=0)&&(notally!=0)) {
   printf("error: both locind and notally are set \n");
   goto zskip;
   }
if ((outcols!=0)&&(notally!=0)) {
   printf("error: both outcols and notally are set \n");
   goto zskip;
   }
if ((locind!=0)&&(outtrace==0)) {
   printf("error:  outtrace=0 \n");
   goto zskip;
   }
if (start>999999999) {
   printf("error: Start value is too large.  \n");
   goto zskip;
   }
if ((overloop!=0)&&(flagp!=0)) {
   printf("error:  overloop is not zero \n");
   goto zskip;
   }
if ((overloop==0)&&(outcols!=0)) {
   printf("error:  overloop is zero \n");
   goto zskip;
   }
if ((overloop==0)&&(c==461)&&(stop!=-819)) {
   printf("error: c=461 and stop is not -819 \n");
   goto zskip;
   }
if ((outcols!=0)&&(locind!=0)) {
   printf("error:  both outcols and locind set \n");
   goto zskip;
   }
if ((outcols!=0)&&((c!=11)&&(c!=13)&&(c!=17)&&(c!=49)&&(c!=47)&&(c!=35)&&(c!=37)&&(c!=41)&&(c!=43)&&(c!=175)&&(c!=461)&&(c!=-19)&&(c!=221)&&(c!=-1)&&(c!=-25)&&(c!=19)&&(c!=5)&&(c!=7)&&(c!=-17)&&(c!=-29)&&(c!=-31)&&(c!=-119)&&(c!=25)&&(c!=23))) {
   printf("error: outcols not implemented for this c value \n");
   goto zskip;
   }
if ((overloop!=0)&&(stop!=-819)) {
   printf("error: Stop value is not -819. \n");
   goto zskip;
   }
if (c==-23) {
   printf("error: Set c to 23 and flag23 to 1 for c=-23. \n");
   goto zskip;
   }
if (((c==1)||(c==-1)||(c==-119)||(c==-17)||(c==-31)||(c==-19)||((c==23)&&(flag23!=0))||(c==-25)||(c==-29))&&((stop!=3)&&(overloop==0))) {
   printf("error: Stop value is not 3. \n");
   goto zskip;
   }
if (((stop!=-3)&&(overloop==0))&&((c==5)||(c==7)||(c==13)||(c==19))) {
   printf("error: Stop value is not -3. \n");
   goto zskip;
   }
if ((stop!=-291)&&(overloop==0)&&(c==221)) {
   printf("error: Stop value is not -291. \n");
   goto zskip;
   }
if ((stop!=-9)&&(overloop==0)&&(c==37)) {
   printf("error: Stop value is not -9. \n");
   goto zskip;
   }
if ((stop!=-81)&&(overloop==0)&&(c==47)) {
   printf("error: Stop value is not -81. \n");
   goto zskip;
   }
if ((stop!=-69)&&(overloop==0)&&(c==49)) {
   printf("error: Stop value is not -69. \n");
   goto zskip;
   }
if ((stop!=-87)&&(overloop==0)&&(c==41)) {
   printf("error: Stop value is not -87. \n");
   goto zskip;
   }
if ((stop!=-45)&&(overloop==0)&&(c==43)) {
   printf("error: Stop value is not -45. \n");
   goto zskip;
   }
if ((stop!=-99)&&(overloop==0)&&(c==35)) {
   printf("error: Stop value is not -99. \n");
   goto zskip;
   }
if ((stop!=-111)&&(overloop==0)&&(c==25)) {
   printf("error: Stop value is not -111. \n");
   goto zskip;
   }
if ((stop!=-201)&&(overloop==0)&&(c==175)) {
   printf("error: Stop value is not -201. \n");
   goto zskip;
   }
if ((stop!=-33)&&(overloop==0)&&(c==29)) {
   printf("error: Stop value is not -33. \n");
   goto zskip;
   }
if ((stop!=-9)&&(overloop==0)&&(c==17)) {
   printf("error: Stop value is not -9. \n");
   goto zskip;
   }
if ((stop!=-21)&&(overloop==0)&&(c==11)) {
   printf("error: Stop value is not -21. \n");
   goto zskip;
   }
if ((stop!=-27)&&(overloop==0)&&(c==31)) {
   printf("error: Stop value is not -27. \n");
   goto zskip;
   }
if ((stop!=-33)&&(overloop==0)&&((c==23)&&(flag23==0))) {
   printf("error: Stop value is not -33. \n");
   goto zskip;
   }
if (start!=(start/3)*3) {
   printf("error:  Initial value is not divisible by 3. \n");
   goto zskip;
   }
if (stop!=(stop/3)*3) {
   printf("error:  Final value is not divisible by 3. \n");
   goto zskip;
   }
if (outloop>200) {
   printf("error:  Number of iterations greater than 200. \n");
   goto zskip;
   }
if (iters1>iters) {
   printf("error: Second number of iterations too large. \n");
   goto zskip;
   }
if ((row!=0)&&(flagp==0)) {
   printf("Row is set. \n");
   goto zskip;
   }
if (((c>49)&&((c!=221)&&(c!=175)&&(c!=461))||(c<-119))) {
   printf("Invalid c value. \n");
   goto zskip;
   }
if ((overloop==0)||(flagp!=0)||(iters!=iters1)||(notwo==0)) {
   outloop=1;
   printf("loop overridden \n");
   }
if (overloop!=0) {
   if ((outtrace!=0)&&(outcols!=0)) {
      printf("both trace output and Weibull output selected \n");
      goto zskip;
      }
   }
for (i=0; i<1000000001; i++)
   trace[i]=0;
colcnt=0;
for (i=0; i<200; i++)
   cnt[i]=0;
for (el=0; el<outloop; el++) {  // outer loop
	over64=0;
	over32=0;
   if (overloop!=0) {
      iters=el+1;
      iters1=el+1;
      }
for (i=0; i<1000; i++)
   dhist[i]=0;
for (i=0; i<512; i++) {
	ahist[i]=0;
	bhist[i]=0;
}
for (i=0; i<2048; i++) { // clear histogram of lengths
   he[i]=0;
   }
for (i=0; i<2048*4; i++) { // clear histogram of lengths
   ho2[i]=0;
   }
for (i=0; i<65536; i++)
	ho[i]=0;
for (i=0; i<50; i++) {
   c1[i]=0;
   c2[i]=0;
   c3[i]=0;
   c4[i]=0;
   c5[i]=0;
   c6[i]=0;
   c7[i]=0;
   c8[i]=0;
   c9[i]=0;
   c10[i]=0;
   }
for (i=0; i<1000; i++)
   extra[i]=0;
lcount=0;
acount=0;
bcount=0;
xcount=0;
ecount=0;
reject=0;
bigo=0;
c1ind=0;
c2ind=0;
c3ind=0;
c4ind=0;
c5ind=0;
c6ind=0;
c7ind=0;
c8ind=0;
c9ind=0;
c10ind=0;
c1cnt=0;
c1tot=0;
c5cnt=0;
c5tot=0;
c7cnt=0;
c7tot=0;
c11cnt=0;
c11tot=0;
c13cnt=0;
c13tot=0;
c17cnt=0;
c17tot=0;
c19cnt=0;
c19tot=0;
c23cnt=0;
c23tot=0;
c25cnt=0;
c25tot=0;
c29cnt=0;
c29tot=0;
c31cnt=0;
c31tot=0;
c35cnt=0;
c35tot=0;
c37cnt=0;
c37tot=0;
c37cyc1=0;
c37cyc2=0;
c37cyc3=0;
c41cnt=0;
c41tot=0;
c41cyc1=0;
c41cyc2=0;
c41cyc3=0;
c41cyc4=0;
c41cyc5=0;
c43cnt=0;
c43tot=0;
c43cyc1=0;
c43cyc2=0;
c43cyc3=0;
c47cnt=0;
c47tot=0;
c47cyc1=0;
c47cyc2=0;
c47cyc3=0;
c47cyc4=0;
c47cyc5=0;
c47cyc6=0;
c47cyc7=0;
c47cyc8=0;
c47cyc9=0;
c47cyc10=0;
c47cyc11=0;
c49cnt=0;
c49tot=0;
c49cyc1=0;
c49cyc2=0;
c49cyc3=0;
c49cyc4=0;
c119cnt=0;
c119tot=0;
c221cnt=0;
c221tot=0;
c221cyc1=0;
c221cyc2=0;
c221cyc3=0;
c221cyc4=0;
c461cnt=0;
c461tot=0;
c461cyc1=0;
c461cyc2=0;
c461cyc3=0;
c461cyc4=0;
c461cyc5=0;
c461cyc6=0;
c461cyc7=0;
c461cyc8=0;
c461cyc9=0;
c461cyc10=0;
c461cyc11=0;
c461cyc12=0;
c35cyc1=0;
c35cyc2=0;
c35cyc3=0;
c175cnt=0;
c175tot=0;
c1cyc1=0;
c5cyc1=0;
c5cyc2=0;
c5cyc3=0;
c5cyc4=0;
c5cyc5=0;
c5cyc6=0;
c5cyc7=0;
c7cyc1=0;
c11cyc1=0;
c11cyc2=0;
c11cyc3=0;
c11cyc4=0;
c13cyc1=0;
c13cyc2=0;
c13cyc3=0;
c13cyc4=0;
c13cyc4=0;
c13cyc5=0;
c13cyc6=0;
c13cyc7=0;
c13cyc8=0;
c13cyc9=0;
c17cyc1=0;
c17cyc2=0;
c17cyc3=0;
c17cyc4=0;
c17cyc5=0;
c19cyc1=0;
c19cyc2=0;
c23cyc1=0;
c23cyc2=0;
c23cyc3=0;
c23cyc4=0;
c23cyc5=0;
c23cyc6=0;
c23cyc7=0;
c23cyc8=0;
c23cyc9=0;
c23cyc10=0;
c23cyc11=0;
c23cyc12=0;
c25cyc1=0;
c25cyc2=0;
c25cyc3=0;
c25cyc4=0;
c29cyc1=0;
c29cyc2=0;
c29cyc3=0;
c29cyc4=0;
c29cyc5=0;
c29cyc6=0;
c29cyc7=0;
c29cyc8=0;
c29cyc9=0;
c29cyc10=0;
c29cyc11=0;
c29cyc12=0;
c29cyc13=0;
c29cyc14=0;
c29cyc15=0;
c29cyc16=0;
c29cyc17=0;
c29cyc18=0;
c29cyc19=0;
c31cyc1=0;
c31cyc2=0;
c31cyc3=0;
c31cyc4=0;
c119cyc1=0;
c175cyc1=0;
c175cyc2=0;
c175cyc3=0;
c175cyc4=0;
c175cyc5=0;
c175cyc6=0;
c175cyc7=0;
c175cyc8=0;
c175cyc9=0;
c175cyc10=0;
c175cyc11=0;
c175cyc12=0;
c175cyc13=0;
c175cyc14=0;
c23m1=0;
c23m2=0;
c23m3=0;
c23m4=0;
c23m5=0;
c23m6=0;
c23m7=0;
c23m8=0;
//
// DEAD LIMBS (ending in an even natural number)//
count=0;
index=0;
tindex=-1;
for (i=start; i>=stop; i-=6) {
   lcount=lcount+1;
   tindex=tindex+1;
   if ((c==5)&&((i/5)*5==i))
       continue;
   if ((c==7)&&((i/7)*7==i))
      continue;
   if ((c==11)&&((i/11)*11==i))
      continue;
   if ((c==13)&&((i/13)*13==i))
      continue;
   if ((c==17)&&((i/17)*17==i))
      continue;
   if ((c==-17)&&((i/17)*17==i))
      continue;
   if ((c==19)&&((i/19)*19==i))
      continue;
   if ((c==-19)&&((i/19)*19==i))
      continue;
   if ((c==23)&&((i/23)*23==i))
      continue;
   if ((c==-23)&&((i/23)*23==i))
      continue;
   if ((c==25)&&((i/5)*5==i))
      continue;
   if ((c==-25)&&((i/5)*5==i))
      continue;
   if ((c==29)&&((i/29)*29==i))
      continue;
   if ((c==-29)&&((i/29)*29==i))
      continue;
   if ((c==-31)&&((i/31)*31==i))
      continue;
   if ((c==31)&&((i/31)*31==i))
      continue;
   if ((c==35)&&((i/5)*5==i))
      continue;
   if ((c==35)&&((k/7)*7==i))
      continue;
   if ((c==37)&&((k/37)*37==i))
      continue;
   if ((c==41)&&((k/41)*41==i))
      continue;
   if ((c==43)&&((k/43)*43==i))
      continue;
   if ((c==47)&&((k/47)*47==i))
      continue;
   if ((c==49)&&((k/7)*7==i))
      continue;
   if ((c==175)&&((k/5)*5==i))
      continue;
   if ((c==175)&&((k/7)*7==i))
      continue;
   if ((c==-119)&&((k/7)*7==i))
      continue;
   if ((c==-119)&&((k/17)*17==i))
      continue;
   if ((c==221)&&((k/13)*13==i))
      continue;
   if ((c==221)&&((k/17)*17==i))
      continue;
   if ((c==461)&&((k/461)*461==i))
      continue;
   g=0;
   k=i; // set k
   v[0]=k;
   n=1;
   order=3; // set order
   if (k<0)
      temp=(unsigned long long)(-k);
   else
      temp=(unsigned long long)k;
   while (order<temp)
      order=order*2;
aloop:
   if (k<0)
      temp=(unsigned long long)(-k);
   else
      temp=(unsigned long long)k;
   if (temp>0x7f00000000000000) {
      printf("overflow error: k=%d \n",temp);
      ecount=ecount+1;
      goto cskip;
      }
   oddk=k;
   if ((flag23!=0)&&(c==23))
      k=3*k-c;
   else
      k=3*k+c; // next sequence value
   v[n]=k;
   n=n+1; // increment element count
   if (n>99999) {
      printf("error 1: v array too small %d %d %d %d %d \n",v[0],v[n-3],v[n-2],v[n-1],n);
      goto zskip;
      }
   if (k<0)
      temp=(unsigned long long)(-k);
   else
      temp=(unsigned long long)k;
   while (order<temp)
      order=order*2;
   if (k==(k/8)*8) { // check for connection point
      g=g+1;
      if (g==1) {
	 savek=k;
	 if (savek<0)
	    savek=-savek;
	 }
      else {
	 if (nomax==0) {
	    tempk=k;
	    if (tempk<0)
	       tempk=-tempk;
	    if (tempk>savek)
	       savek=tempk;
	    }
	 }
      if (g<iters)
	 goto dskip;
      if (g>iters)
	 goto cskip;
      np=n+1; // increment element count
      if (notwo!=0) {
	 maxe=0;
//	 printf("order=%lld, n=%d \n",order,n);
//	 printf("v=ll%d \n",v[0]);
	 for (h=1; h<(n-1); h++) {
//	    printf("v=%lld \n",v[h]);
	    if (v[h]<0)
	       temp=(unsigned long long)(-v[h]);
	    else
	       temp=(unsigned long long)v[h];
	    if (((v[h-1]&1)!=0)&&((v[h+2]&1)!=0)) {
	       if (temp>maxe)
		  maxe=temp;
	       }
	    }
	 maxe=maxe/2;
	 savek=savek/2;
//	 printf("maxe=%lld, savek=%lld \n",maxe,savek);
//	 printf("v=%lld \n",v[n-1]);
	 order=3;
	 if (maxe<=(unsigned long long)savek) {
	    while (order<(unsigned long long)savek)
	       order=order*2;
	    if (order!=(unsigned long long)savek)
	       order=order*2;
		if ((order&0xf000000000000000)!=0) {
			printf("order overflow: order=%lld, savek=%lld \n",order,savek);
			goto zskip;
		}
	    }
	 else {
	    torder=3;
	    while (torder<maxe)
	       torder=torder*2;
	    while (order<(unsigned long long)savek)
	       order=order*2;
	    if (torder!=order) {
	       reject=reject+1;
//	       printf("invalid order: i=%lld, savek=%lld, maxe=%lld \n",i,savek,maxe);
	       goto cskip;
	       }
	    if (order!=(unsigned long long)savek)
	       order=order*2;
		if ((order&0xf000000000000000)!=0) {
			printf("order overflow: order=%lld, torder=%lld, savek=%#020x %lld, i=%d \n",order,torder,savek,savek,i);
			goto zskip;
		}
	    }
	 if (i<0)
	    temp=(unsigned long long)(-i);
	 else
	    temp=(unsigned long long)i;
	 while (temp<(order/2)) {
	    temp=temp*2;
	    np=np+1;
	    }
//	 temp1=order*2;  // "true" condition for subsequent logic
	 goto oskip;
	 }
      else {
	 if (i<0)
	    temp=(unsigned long long)(-i);
	 else
	    temp=(unsigned long long)i;
	 while (temp<(order/2)) {
	    temp=temp*2;
	    np=np+1;
	    }
	 if (k<0)
	    temp1=(unsigned long long)(-k);
	 else
	    temp1=(unsigned long long)k;
	 temp1=temp1*2;
	 }
      if (order<temp1) {
oskip:
	 count=count+1;
	 itero=0;
	 itere=0;
	 f=0;
	 for (h=0; h<n; h++) {
	    if ((v[h]&1)==1)
	       itero=itero+1;
	    else {
	       if ((v[h-1]&1)==0)
		 itere=itere+1;
	       }
	    if (((v[h]&1)==1)&&(v[h+1]==(v[h+1]/8)*8))
	       f=f+1;
	    if (f==iters1) {
//	       printf(" order=%lld h=%d, %lld %lld %lld \n",order,h,v[0],v[h],np-n);
//	       printf(" order=%lld n=%d, %lld %lld %d \n",order,n,v[0],v[n-1],np-n);
  	       goto wskip;
	       }
	    }
	 printf("error: attachment point not found \n");
	 goto zskip;
wskip: itere=itere+(np-n)+1;
	 if ((itero>120)&&(outloop==0)) {
		 printf("error: itero=%d \n",itero);
		 bigo=bigo+1;
//		 goto zskip;
	 }
	 if (itero<121) {
	    a=table[2*itero];
	    b=table[2*itero+1];
		if (iters==iters1) {
		  if ((c==29)&&((v[n-1]==392)||(v[n-1]==176)||(v[n-1]==32)||(v[n-1]==8)||(v[n-1]==3154208)||(v[n-1]==788552)||(v[n-1]==777464)||(v[n-1]==316328)||
				(v[n-1]==295736)||(v[n-1]==166424)||(v[n-1]==75176)||(v[n-1]==6831320)||(v[n-1]==5764064)||(v[n-1]==1441016)||(v[n-1]==2308928)||
				(v[n-1]==577232)||(v[n-1]==147608)||(v[n-1]==81224)||(v[n-1]==30488))) {
		     if (v[n-1]==392)
			c29cyc1=c29cyc1+1;
		     if (v[n-1]==176)
			c29cyc2=c29cyc2+1;
		     if (v[n-1]==32)
			c29cyc3=c29cyc3+1;
		     if (v[n-1]==8)
			c29cyc4=c29cyc4+1;
		     if (v[n-1]==3154208)
			c29cyc5=c29cyc5+1;
		     if (v[n-1]==788552)
			c29cyc6=c29cyc6+1;
		     if (v[n-1]==777464)
			c29cyc7=c29cyc7+1;
		     if (v[n-1]==316328)
			c29cyc8=c29cyc8+1;
		     if (v[n-1]==295736)
			c29cyc9=c29cyc9+1;
		     if (v[n-1]==166424)
			c29cyc10=c29cyc10+1;
		     if (v[n-1]==75176)
			c29cyc11=c29cyc11+1;
		     if (v[n-1]==6831320)
			c29cyc12=c29cyc12+1;
		     if (v[n-1]==5764064)
			c29cyc13=c29cyc13+1;
		     if (v[n-1]==1441016)
			c29cyc14=c29cyc14+1;
		     if (v[n-1]==2308928)
			c29cyc15=c29cyc15+1;
		     if (v[n-1]==577232)
			c29cyc16=c29cyc16+1;
		     if (v[n-1]==147608)
			c29cyc17=c29cyc17+1;
		     if (v[n-1]==81224)
			c29cyc18=c29cyc18+1;
		     if (v[n-1]==30488)
			c29cyc19=c29cyc19+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=29, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-29)&&(v[n-1]==904)) {
		     c29cyc1=c29cyc1+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-29, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-31)&&(v[n-1]==1520)) {
		     c31cyc1=c31cyc1+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-31, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-119)&&(v[n-1]==2488)) {
		     c119cyc1=c119cyc1+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-119, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==221)&&((v[n-1]==1280)||(v[n-1]==320)||(v[n-1]==80)||(v[n-1]==1448))) {
		     if (v[n-1]==1280)
			c221cyc1=c221cyc1+1;
		     if (v[n-1]==320)
			c221cyc2=c221cyc2+1;
		     if (v[n-1]==80)
			c221cyc3=c221cyc3+1;
		     if (v[n-1]==1448)
			c221cyc4=c221cyc4+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=221, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==461)&&((v[n-1]==800)||(v[n-1]==200)||(v[n-1]==536)||(v[n-1]==4424)||(v[n-1]==2120)||(v[n-1]==1256)||(v[n-1]==1160)||(v[n-1]==896)||(v[n-1]==224)||(v[n-1]==56)||(v[n-1]==1184)||(v[n-1]==296))) {
		     if (v[n-1]==800)
			c461cyc1=c461cyc1+1;
		     if (v[n-1]==200)
			c461cyc2=c461cyc2+1;
		     if (v[n-1]==536)
			c461cyc3=c461cyc3+1;
		     if (v[n-1]==4424)
			c461cyc4=c461cyc4+1;
		     if (v[n-1]==2120)
			c461cyc5=c461cyc5+1;
		     if (v[n-1]==1256)
			c461cyc6=c461cyc6+1;
		     if (v[n-1]==1160)
			c461cyc7=c461cyc7+1;
		     if (v[n-1]==896)
			c461cyc8=c461cyc8+1;
		     if (v[n-1]==224)
			c461cyc9=c461cyc9+1;
		     if (v[n-1]==56)
			c461cyc10=c461cyc10+1;
		     if (v[n-1]==1184)
			c461cyc11=c461cyc11+1;
		     if (v[n-1]==296)
			c461cyc12=c461cyc12+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=461, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==31)&&((v[n-1]==424)||(v[n-1]==232)||(v[n-1]==208)||(v[n-1]==136))) {
		     if (v[n-1]==424)
			c31cyc1=c31cyc1+1;
		     if (v[n-1]==232)
			c31cyc2=c31cyc2+1;
		     if (v[n-1]==208)
			c31cyc3=c31cyc3+1;
		     if (v[n-1]==136)
			c31cyc4=c31cyc4+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=31, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==35)&&((v[n-1]==272)||(v[n-1]==416)||(v[n-1]==104))) {
		     if (v[n-1]==272)
			c35cyc1=c35cyc1+1;
		     if (v[n-1]==416)
			c35cyc2=c35cyc2+1;
		     if (v[n-1]==104)
			c35cyc3=c35cyc3+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=35, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==37)&&((v[n-1]==184)||(v[n-1]==232)||(v[n-1]==304))) {
		     if (v[n-1]==184)
			c37cyc1=c37cyc1+1;
		     if (v[n-1]==232)
			c37cyc2=c37cyc2+1;
		     if (v[n-1]==304)
			c37cyc3=c37cyc3+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=37, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==41)&&((v[n-1]==512)||(v[n-1]==128)||(v[n-1]==32)||(v[n-1]==8)||(v[n-1]==152))) {
		     if (v[n-1]==512)
			c41cyc1=c41cyc1+1;
		     if (v[n-1]==128)
			c41cyc2=c41cyc2+1;
		     if (v[n-1]==32)
			c41cyc3=c41cyc3+1;
		     if (v[n-1]==8)
			c41cyc4=c41cyc4+1;
		     if (v[n-1]==152)
			c41cyc5=c41cyc5+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=41, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==43)&&((v[n-1]==112)||(v[n-1]==64)||(v[n-1]==16))) {
		     if (v[n-1]==112)
			c43cyc1=c43cyc1+1;
		     if (v[n-1]==64)
			c43cyc2=c43cyc2+1;
		     if (v[n-1]==16)
			c43cyc3=c43cyc3+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=43, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==47)&&((v[n-1]==680)||(v[n-1]==824)||(v[n-1]==1040)||(v[n-1]==176)||(v[n-1]==80)||(v[n-1]==152)||(v[n-1]==104)||(v[n-1]==1976)||(v[n-1]==800)||(v[n-1]==200)||(v[n-1]==392))) {
		     if (v[n-1]==680)
			c47cyc1=c47cyc1+1;
		     if (v[n-1]==824)
			c47cyc2=c47cyc2+1;
		     if (v[n-1]==1040)
			c47cyc3=c47cyc3+1;
		     if (v[n-1]==176)
			c47cyc4=c47cyc4+1;
		     if (v[n-1]==80)
			c47cyc5=c47cyc5+1;
		     if (v[n-1]==152)
			c47cyc6=c47cyc6+1;
		     if (v[n-1]==104)
			c47cyc7=c47cyc7+1;
		     if (v[n-1]==1976)
			c47cyc8=c47cyc8+1;
		     if (v[n-1]==800)
			c47cyc9=c47cyc9+1;
		     if (v[n-1]==200)
			c47cyc10=c47cyc10+1;
		     if (v[n-1]==392)
			c47cyc11=c47cyc11+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=47, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==49)&&((v[n-1]==3256)||(v[n-1]==1600)||(v[n-1]==400)||(v[n-1]==712))) {
		     if (v[n-1]==3256)
			c49cyc1=c49cyc1+1;
		     if (v[n-1]==1600)
			c49cyc2=c49cyc2+1;
		     if (v[n-1]==400)
			c49cyc3=c49cyc3+1;
		     if (v[n-1]==712)
			c49cyc4=c49cyc4+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=49, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==175)&&((v[n-1]==1648)||(v[n-1]==1432)||(v[n-1]==1168)||(v[n-1]==1144)||(v[n-1]==808)||(v[n-1]==2656)||(v[n-1]==664)||(v[n-1]==424)||(v[n-1]==4888)||(v[n-1]==2008)||(v[n-1]==928)||(v[n-1]==232)||(v[n-1]==568)||(v[n-1]==712))) {
		     if (v[n-1]==1648)
			c175cyc1=c175cyc1+1;
		     if (v[n-1]==1432)
			c175cyc2=c175cyc2+1;
		     if (v[n-1]==712)
			c175cyc3=c175cyc3+1;
		     if (v[n-1]==1168)
			c175cyc4=c175cyc4+1;
		     if (v[n-1]==1144)
			c175cyc5=c175cyc5+1;
		     if (v[n-1]==808)
			c175cyc6=c175cyc6+1;
		     if (v[n-1]==2656)
			c175cyc7=c175cyc7+1;
		     if (v[n-1]==664)
			c175cyc8=c175cyc8+1;
		     if (v[n-1]==424)
			c175cyc9=c175cyc9+1;
		     if (v[n-1]==4888)
			c175cyc10=c175cyc10+1;
		     if (v[n-1]==2008)
			c175cyc11=c175cyc11+1;
		     if (v[n-1]==928)
			c175cyc12=c175cyc12+1;
		     if (v[n-1]==232)
			c175cyc13=c175cyc13+1;
		     if (v[n-1]==568)
			c175cyc14=c175cyc14+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=175, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-25)&&((v[n-1]==6008)||(v[n-1]==1808)||(v[n-1]==968))) {
		     if (v[n-1]==6008)
			c25cyc1=c25cyc1+1;
		     if (v[n-1]==1808)
			c25cyc2=c25cyc2+1;
		     if (v[n-1]==968)
			c25cyc3=c25cyc3+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-25, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==25)&&((v[n-1]==88)||(v[n-1]==136)||(v[n-1]==352)||(v[n-1]==112))) {
		     if (v[n-1]==136)
			c25cyc1=c25cyc1+1;
		     if (v[n-1]==352)
			c25cyc2=c25cyc2+1;
		     if (v[n-1]==88)
			c25cyc3=c25cyc3+1;
		     if (v[n-1]==112)
			c25cyc4=c25cyc4+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=25, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if (((c==23)&&(flag23==0))&&((v[n-1]==1568)||(v[n-1]==440)||(v[n-1]==4976)||(v[n-1]==80)||(v[n-1]==56)||(v[n-1]==392))) {
		     if (v[n-1]==56)
			c23cyc1=c23cyc1+1;
		     if (v[n-1]==80)
			c23cyc2=c23cyc2+1;
		     if (v[n-1]==4976)
			c23cyc3=c23cyc3+1;
		     if (v[n-1]==1568)
			c23cyc4=c23cyc4+1;
		     if (v[n-1]==392)
			c23cyc5=c23cyc5+1;
		     if (v[n-1]==440)
			 c23cyc6=c23cyc6+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=23, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if (((c==23)&&(flag23!=0))&&((v[n-1]==47512)||(v[n-1]==29944)||(v[n-1]==29320)||(v[n-1]==94816)||(v[n-1]==23704)||(v[n-1]==50104)||(v[n-1]==77320)||
				(v[n-1]==32536)||(v[n-1]==58744)||(v[n-1]==49456)||(v[n-1]==37744)||(v[n-1]==36208))) {
		     if (v[n-1]==47512)
			 c23cyc1=c23cyc1+1;
		     if (v[n-1]==29944)
			 c23cyc2=c23cyc2+1;
		     if (v[n-1]==29320)
			 c23cyc3=c23cyc3+1;
		     if (v[n-1]==94816)
			 c23cyc4=c23cyc4+1;
		     if (v[n-1]==23704)
			 c23cyc5=c23cyc5+1;
		     if (v[n-1]==50104)
			 c23cyc6=c23cyc6+1;
		     if (v[n-1]==77320)
			 c23cyc7=c23cyc7+1;
		     if (v[n-1]==32536)
			 c23cyc8=c23cyc8+1;
		     if (v[n-1]==58744)
			 c23cyc9=c23cyc9+1;
		     if (v[n-1]==49456)
			 c23cyc10=c23cyc10+1;
		     if (v[n-1]==37744)
			 c23cyc11=c23cyc11+1;
		     if (v[n-1]==36208)
			 c23cyc12=c23cyc12+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-23, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==19)&&((v[n-1]==112)||(v[n-1]==40))) {
		     if (v[n-1]==112)
			c19cyc1=c19cyc1+1;
		     if (v[n-1]==40)
			c19cyc2=c19cyc2+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=19, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-19)&&((v[n-1]==1496)||(v[n-1]==920))) {
		     if (v[n-1]==1496)
			c19cyc1=c19cyc1+1;
		     if (v[n-1]==920)
			c19cyc2=c19cyc2+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-19, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==17)&&((v[n-1]==248)||(v[n-1]==560)||(v[n-1]==200)||(v[n-1]==32)||(v[n-1]==8))) {
		     if (v[n-1]==32)
			c17cyc1=c17cyc1+1;
		     if (v[n-1]==8)
			c17cyc2=c17cyc2+1;
		     if (v[n-1]==560)
			c17cyc3=c17cyc3+1;
			 if (v[n-1]==200)
		     c17cyc4=c17cyc4+1;
		     if (v[n-1]==248)
			c17cyc5=c17cyc5+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=17, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-17)&&(v[n-1]==520)) {
		     c17cyc1=c17cyc1+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-17, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==13)&&((v[n-1]==1816)||(v[n-1]==2008)||(v[n-1]==2296)||(v[n-1]==2728)||(v[n-1]==3376)||(v[n-1]==4192)||(v[n-1]==1432)||(v[n-1]==16)||(v[n-1]==1048))) {
		     if (v[n-1]==16)
			c13cyc1=c13cyc1+1;
		     if (v[n-1]==1816)
			c13cyc2=c13cyc2+1;
		     if (v[n-1]==2008)
			c13cyc3=c13cyc3+1;
		     if (v[n-1]==2296)
			c13cyc4=c13cyc4+1;
		     if (v[n-1]==2728)
			c13cyc5=c13cyc5+1;
		     if (v[n-1]==3376)
			c13cyc6=c13cyc6+1;
		     if (v[n-1]==4192)
			c13cyc7=c13cyc7+1;
		     if (v[n-1]==1048)
			c13cyc8=c13cyc8+1;
		     if (v[n-1]==1432)
			c13cyc9=c13cyc9+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=13, order=%lld, odd=%d, even=%lld, v=%lld %d, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==11)&&((v[n-1]==248)||(v[n-1]==104)||(v[n-1]==32)||(v[n-1]==8))) {
		     if (v[n-1]==32)
			c11cyc1=c11cyc1+1;
		     if (v[n-1]==8)
			c11cyc2=c11cyc2+1;
		     if (v[n-1]==248)
			c11cyc3=c11cyc3+1;
		     if (v[n-1]==104)
			c11cyc4=c11cyc4+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=11, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==7)&&(v[n-1]==40)) {
		     c7cyc1=c7cyc1+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=7, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==5)&&((v[n-1]==8)||(v[n-1]==152)||(v[n-1]==6248)||(v[n-1]==5984)||(v[n-1]==1496)||(v[n-1]==5744)||(v[n-1]==5336))) {
		     if (v[n-1]==8)
			c5cyc1=c5cyc1+1;
		     if (v[n-1]==152)
			c5cyc2=c5cyc2+1;
		     if (v[n-1]==6248)
			c5cyc3=c5cyc3+1;
		     if (v[n-1]==5984)
			c5cyc4=c5cyc4+1;
		     if (v[n-1]==1496)
			c5cyc5=c5cyc5+1;
		     if (v[n-1]==5744)
			c5cyc6=c5cyc6+1;
		     if (v[n-1]==5336)
			c5cyc7=c5cyc7+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=5, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if ((c==-1)&&(v[n-1]==272)) {
		     c1cyc1=c1cyc1+1;
		     if ((overloop==0)&&((order==outord)||(outord==0)))
			printf("cycle for c=-1, order=%lld, odd=%d, even=%d, v=%lld %lld, n=%d %d \n",order,itero,itere,v[0],v[n-1],n,np);
		     }
		  if (c==29) {
		     if ((v[n-1]==392)&&(mask[0]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==176)&&(mask[1]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==32)&&(mask[2]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==8)&&(mask[3]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==3154208)&&(mask[4]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==788552)&&(mask[5]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==777464)&&(mask[6]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==316328)&&(mask[7]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==295736)&&(mask[8]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==166424)&&(mask[9]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==75176)&&(mask[10]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==6831320)&&(mask[11]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==5764064)&&(mask[12]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==1441016)&&(mask[13]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==2308928)&&(mask[14]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==577232)&&(mask[15]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==147608)&&(mask[16]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==81224)&&(mask[17]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     if ((v[n-1]==30488)&&(mask[18]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c29tot=c29tot+1;
			}
		     }
		  if ((c==-29)&&(v[n-1]==904)) {
		     trace[tindex]=trace[tindex]+1;
		     c29tot=c29tot+1;
			 if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
		     }
		  if (c==25) {
		     if ((v[n-1]==136)&&(mask[0]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==352)&&(mask[1]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==88)&&(mask[2]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==112)&&(mask[3]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==-25) {
		     if ((v[n-1]==6008)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1808)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==968)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c25tot=c25tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==31) {
		     if ((v[n-1]==424)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c31tot=c31tot+1;
			}
		     if ((v[n-1]==232)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c31tot=c31tot+1;
			}
		     if ((v[n-1]==208)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c31tot=c31tot+1;
			}
		     if ((v[n-1]==136)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c31tot=c31tot+1;
			}
		     }
		  if (c==35) {
		     if ((v[n-1]==272)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c35tot=c35tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==416)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c35tot=c35tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==104)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c35tot=c35tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==37) {
		     if ((v[n-1]==184)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c37tot=c37tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==232)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c37tot=c37tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==304)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c37tot=c37tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==41) {
		     if ((v[n-1]==512)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c41tot=c41tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==128)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c41tot=c41tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==32)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c41tot=c41tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==8)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c41tot=c41tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==152)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c41tot=c41tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==43) {
		     if ((v[n-1]==112)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c43tot=c43tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==64)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c43tot=c43tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==16)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c43tot=c43tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==47) {
		     if ((v[n-1]==680)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==824)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1040)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==176)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==80)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==152)&&(mask[5]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==104)&&(mask[6]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1976)&&(mask[7]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==800)&&(mask[8]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==200)&&(mask[9]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==392)&&(mask[10]==0)) {
			trace[tindex]=trace[tindex]+1;
			c47tot=c47tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==49) {
		     if ((v[n-1]==3256)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c49tot=c49tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1600)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c49tot=c49tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==400)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c49tot=c49tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==712)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c49tot=c49tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==175) {
		     if ((v[n-1]==1648)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1432)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==712)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1168)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1144)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==808)&&(mask[5]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==2656)&&(mask[6]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==664)&&(mask[7]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==424)&&(mask[8]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==4888)&&(mask[9]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==2008)&&(mask[10]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==928)&&(mask[11]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==232)&&(mask[12]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==568)&&(mask[13]==0)) {
			trace[tindex]=trace[tindex]+1;
			c175tot=c175tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if ((c==-119)&&(v[n-1]==2488)) {
		     trace[tindex]=trace[tindex]+1;
		     c119tot=c119tot+1;
			 if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
		     }
		  if (c==461) {
		     if ((v[n-1]==800)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==200)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==536)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==4424)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==2120)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1256)&&(mask[5]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1160)&&(mask[6]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==896)&&(mask[7]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==224)&&(mask[8]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==56)&&(mask[9]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1184)&&(mask[10]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==296)&&(mask[11]==0)) {
			trace[tindex]=trace[tindex]+1;
			c461tot=c461tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==221) {
		     if ((v[n-1]==1280)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c221tot=c221tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==320)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c221tot=c221tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==80)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c221tot=c221tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1448)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c221tot=c221tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if ((c==-31)&&(v[n-1]==1520)) {
		     trace[tindex]=trace[tindex]+1;
		     c31tot=c31tot+1;
			 if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
		     }
		  if ((c==23)&&(flag23==0)) {
		     if ((v[n-1]==56)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==80)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==4976)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1568)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==392)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==440)&&(mask[5]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if ((c==23)&&(flag23!=0)) {
		     if ((v[n-1]==47512)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==29944)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==29320)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==94816)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==23704)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==50104)&&(mask[5]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==77320)&&(mask[6]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==32536)&&(mask[7]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==58744)&&(mask[8]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==49456)&&(mask[9]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==37744)&&(mask[10]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==36208)&&(mask[11]==0)) {
			trace[tindex]=trace[tindex]+1;
			c23tot=c23tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==-19) {
		     if ((v[n-1]==1496)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c19tot=c19tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==920)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c19tot=c19tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==19) {
		     if ((v[n-1]==112)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c19tot=c19tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			   } 
			}
			}
		     if ((v[n-1]==40)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c19tot=c19tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			   }  
			}
			 }
		     }
		  if (c==17) {
		     if ((v[n-1]==32)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c17tot=c17tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==8)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c17tot=c17tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==560)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c17tot=c17tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==200)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c17tot=c17tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==248)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c17tot=c17tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if ((c==-17)&&(v[n-1]==520)) {
		     trace[tindex]=trace[tindex]+1;
		     c17tot=c17tot+1;
		     if (outcols!=0) {
			fprintf(Outfp," %d \n",el+1);
			colcnt=colcnt+1;
			if (colcnt>1500000) {
			   printf("output too large \n");
			   goto zskip;
			   }
			}
		     }
		  if (c==13) {
		     if ((v[n-1]==16)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1816)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==2008)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==2296)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==2728)&&(mask[4]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==3376)&&(mask[5]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==4192)&&(mask[6]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1048)&&(mask[7]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1432)&&(mask[8]==0)) {
			trace[tindex]=trace[tindex]+1;
			c13tot=c13tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==11) {
		     if ((v[n-1]==32)&&(mask[0]==0)) {
			trace[tindex]=trace[tindex]+1;
			c11tot=c11tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==8)&&(mask[1]==0)) {
			trace[tindex]=trace[tindex]+1;
			c11tot=c11tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==248)&&(mask[2]==0)) {
			trace[tindex]=trace[tindex]+1;
			c11tot=c11tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==104)&&(mask[3]==0)) {
			trace[tindex]=trace[tindex]+1;
			c11tot=c11tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==7) {
		     if ((v[n-1]==40)&&(mask[0]==0)) {
			c7tot=c7tot+1;
			trace[tindex]=trace[tindex]+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if (c==5) {
		     if ((v[n-1]==8)&&(mask[0]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==152)&&(mask[1]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==6248)&&(mask[2]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==5984)&&(mask[3]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==1496)&&(mask[4]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==5744)&&(mask[5]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     if ((v[n-1]==5336)&&(mask[6]==0)) {
			if (notally==0)
			   trace[tindex]=trace[tindex]+1;
			else
			   trace[tindex]=1;
			c5tot=c5tot+1;
			if (outcols!=0) {
			   fprintf(Outfp," %d \n",el+1);
			   colcnt=colcnt+1;
			   if (colcnt>1500000) {
			      printf("output too large \n");
			      goto zskip;
			      }
			   }
			}
		     }
		  if ((c==-1)&&(v[n-1]==272)) {
		     trace[tindex]=trace[tindex]+1;
		     c1tot=c1tot+1;
		     if (outcols!=0) {
			fprintf(Outfp," %d \n",el+1);
			colcnt=colcnt+1;
			if (colcnt>1500000) {
			   printf("output too large \n");
			   goto zskip;
			   }
			}
		     }
		  if (itere==a) {
			  acount=acount+1;
			  ahist[itero]=ahist[itero]+1;
		  }
		  if (itere==b) {
			  bcount=bcount+1;
			  bhist[itero]=bhist[itero]+1;
		  }
		  if ((itere!=a)&&(itere!=b)) {
		     if (itere>b) {
			 delta=itere-b;
			 if (delta<1000)
			    extra[delta]=extra[delta]+1;
//			 printf("extra: c=%d, order=%d, delta=%d, odd=%d, even=%d, v=%d %d, n=%d %d \n",c,order,delta,itero,itere,v[0],v[n-1],n,np);
	    	 if (delta>63)
				 over64=over64+1;
			 if (delta>31)
				 over32=over32+1;
			 if (delta>255) {
				 printf("error 1: delta=%d \n",delta);
				 goto zskip;
			 }
			 if ((delta<256)&&(itero<256)) {
			    ho[256*itero+delta]=ho[256*itero+delta]+1;
			    if ((flagp==2)&&(itero==row)) {
			       if (delta>norma) {
				  if (teetoo==0)
				     table1[index]=delta-norma;
				  else {
				     if (teetoo==1)
					table1[index]=i;
				     else
					table1[index]=order;
				     }
				  }
			       else {
				  printf("normalize amount too large \n");
				  goto zskip;
				  }
			       index=index+1;
			       if (index>=20000000) {
				  printf("error: not enough memory allocated \n");
				  goto zskip;
				  }
			       }
			    }
			 }
		     else {
			 xcount=xcount+1;
			delta=b-itere;
			if (delta<1000)
			   dhist[delta]=dhist[delta]+1;
//			printf("extra: c=%d, order=%d, delta=%d, odd=%d, even=%d, v=%d %d, n=%d %d \n",c,order,delta,itero,itere,v[0],v[n-1],n,np);
			if ((delta<32)&&(itero<511)) {
			   ho2[32*itero+delta]=ho2[32*itero+delta]+1;
			   if ((flagp==1)&&(itero==row)) {
			      table1[index]=delta;
			      index=index+1;
			      if (index>=10000000) {
				 printf("not enough memory allocated \n");
				 goto zskip;
				 }
			      }
			   }
			}
		     if (c==29) {
			if ((v[n-1]==32)||(v[n-1]==392)||(v[n-1]==176)||(v[n-1]==3154208)||(v[n-1]==295736)||(v[n-1]==166424)||(v[n-1]==316328)||(v[n-1]==75176)||(v[n-1]==777464)||
				(v[n-1]==6831320)||(v[n-1]==5764064)||(v[n-1]==2308928)||(v[n-1]==81224)||(v[n-1]==30488)||(v[n-1]==147608)||(v[n-1]==8)||(v[n-1]==1441016)||(v[n-1]==577232)||(v[n-1]==788552)) {
//			   printf("total count for c=29, order=%d, odd=%d, even=%d, delta=%d v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c29cnt=c29cnt+1;
			   }
			 }
		     if (c==-29) {
			if (v[n-1]==904) {
//			   printf("total count for c=-29, order=%d, odd=%d, even=%d,delta=%d v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c29cnt=c29cnt+1;
			   }
			 }
		     if (c==25) {
			if ((v[n-1]==88)||(v[n-1]==352)||(v[n-1]==112)||(v[n-1]==136)) {
//			   printf("total count for c=25, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c25cnt=c25cnt+1;
			   }
			 }
		     if (c==-25) {
			if ((v[n-1]==6008)||(v[n-1]==1808)||(v[n-1]==968)) {
//			   printf("total count for c=-25, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c25cnt=c25cnt+1;
			   }
			}
		     if (c==35) {
			if ((v[n-1]==272)||(v[n-1]==416)||(v[n-1]==104)) {
//			    printf("total count for c=35, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			    c35cnt=c35cnt+1;
			    }
			 }
		     if (c==37) {
			if ((v[n-1]==184)||(v[n-1]==232)||(v[n-1]==304)) {
//			    printf("total count for c=37, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			    c37cnt=c37cnt+1;
			    }
			 }
		     if (c==41) {
			if ((v[n-1]==512)||(v[n-1]==128)||(v[n-1]==32)||(v[n-1]==8)||(v[n-1]==152)) {
//			    printf("total count for c=41, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			    c41cnt=c41cnt+1;
			    }
			 }
		     if (c==43) {
			if ((v[n-1]==112)||(v[n-1]==64)||(v[n-1]==16)) {
//			    printf("total count for c=43, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			    c43cnt=c43cnt+1;
			    }
			 }
		     if (c==47) {
			if ((v[n-1]==680)||(v[n-1]==824)||(v[n-1]==1040)||(v[n-1]==176)||(v[n-1]==80)||(v[n-1]==152)||(v[n-1]==104)||(v[n-1]==1976)||(v[n-1]==800)||(v[n-1]==200)||(v[n-1]==392)) {
//			    printf("total count for c=43, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			    c47cnt=c47cnt+1;
			    }
			 }
		     if (c==49) {
			if ((v[n-1]==3256)||(v[n-1]==1600)||(v[n-1]==400)||(v[n-1]==712)) {
//			    printf("total count for c=43, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			    c49cnt=c49cnt+1;
			    }
			 }
		    if (c==-31) {
			if (v[n-1]==1520) {
//			   printf("total count for c=-31, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c31cnt=c31cnt+1;
			   }
			}
		    if (c==-119) {
			if (v[n-1]==2488) {
//			   printf("total count for c=-119, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c119cnt=c119cnt+1;
			   }
			}
		    if (c==221) {
			if ((v[n-1]==1280)||(v[n-1]==320)||(v[n-1]==80)||(v[n-1]==1448)) {
//			   printf("total count for c=221, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c221cnt=c221cnt+1;
			   }
			}
		    if (c==461) {
			if ((v[n-1]==800)||(v[n-1]==200)||(v[n-1]==536)||(v[n-1]==4424)||(v[n-1]==2120)||(v[n-1]==1256)||(v[n-1]==1160)||(v[n-1]==896)||(v[n-1]==224)||(v[n-1]==56)||(v[n-1]==1184)||(v[n-1]==296)) {
//			   printf("total count for c=461, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c461cnt=c461cnt+1;
			   }
			}
		     if (c==31) {
			if ((v[n-1]==424)||(v[n-1]==232)||(v[n-1]==208)||(v[n-1]==136)) {
//			   printf("total count for c=31, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c31cnt=c31cnt+1;
			   }
			}
		     if ((c==23)&&(flag23!=0)) {
			if ((v[n-1]==47512)||(v[n-1]==29944)||(v[n-1]==29320)||(v[n-1]==94816)||(v[n-1]==23704)||(v[n-1]==50104)||(v[n-1]==77320)||(v[n-1]==32536)||(v[n-1]==58744)||(v[n-1]==49456)||(v[n-1]==37744)||(v[n-1]==36208)) {
//			   printf("total count for c=-23, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c23cnt=c23cnt+1;
			   }
			}
		     if ((c==23)&&(flag23==0)) {
			if ((v[n-1]==80)||(v[n-1]==56)||(v[n-1]==4976)||(v[n-1]==1568)||(v[n-1]==440)||(v[n-1]==392)) {
//			   printf("total count for c=23, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c23cnt=c23cnt+1;
			   }
			}
		     if (c==-19) {
			if ((v[n-1]==1496)||(v[n-1]==920)) {
//			   printf("total count for c=19, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c19cnt=c19cnt+1;
			   }
			}
		     if (c==19) {
			if ((v[n-1]==112)||(v[n-1]==40)) {
//			   printf("total count for c=19, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c19cnt=c19cnt+1;
			   }
			}
		     if (c==-17) {
			if (v[n-1]==520) {
//			   printf("total count for c=-17, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c17cnt=c17cnt+1;
			   }
			}
		     if (c==17) {
			if ((v[n-1]==560)||(v[n-1]==248)||(v[n-1]==200)||(v[n-1]==32)||(v[n-1]==8)) {
//			   printf("total count for c=17, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c17cnt=c17cnt+1;
			   }
			}
		     if (c==13) {
			if ((v[n-1]==1816)||(v[n-1]==2008)||(v[n-1]==2296)||(v[n-1]==2728)||(v[n-1]==3376)||(v[n-1]==4192)||(v[n-1]==1048)||(v[n-1]==1432)||(v[n-1]==16)) {
//			   printf("total count for c=13, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c13cnt=c13cnt+1;
			   }
			}
		     if (c==11) {
			if ((v[n-1]==104)||(v[n-1]==248)||(v[n-1]==32)||(v[n-1]==8)) {
//			   printf("total count for c=11, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d \n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c11cnt=c11cnt+1;
			   }
			}
		     if (c==7) {
			if (v[n-1]==40) {
//			   printf("total count for c=7, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d\n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c7cnt=c7cnt+1;
			   }
			}
		     if (c==5) {
			if ((v[n-1]==8)||(v[n-1]==152)||(v[n-1]==6248)||(v[n-1]==5984)||(v[n-1]==1496)||(v[n-1]==5744)||(v[n-1]==5336)) {
//			   printf("total count for c=5, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d\n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c5cnt=c5cnt+1;
			   }
			}
		     if (c==-1) {
			if (v[n-1]==272) {
//			   printf("total count for c=-1, order=%d, odd=%d, even=%d, delta=%d, v=%d %d, n=%d %d\n",order,itero,itere,delta,v[0],v[n-1],n,np);
			   c1cnt=c1cnt+1;
			   }
			}
		     f=0;
		     }
		  }
	       else {
		  if ((itere!=a)&&(itere!=b)) {
		     if (itere>b) {
			 delta=itere-b;
			 if (delta<1000)
			    extra[delta]=extra[delta]+1;
//			 printf("extra: c=%d, order=%d, delta=%d, odd=%d, even=%d, v=%d %d, n=%d %d \n",c,order,delta,itero,itere,v[0],v[n-1],n,np);
			 if (delta>255) {
				 printf("error 2: delta=%d \n",delta);
				 goto zskip;
			 }
			 if ((delta<256)&&(itero<256)) {
			    ho[256*itero+delta]=ho[256*itero+delta]+1;
			    if ((flagp==2)&&(itero==row)) {
			       if (delta>norma) 
				  table1[index]=delta-norma;
			       else {
				  printf("normalize amount too large \n");
				  goto zskip;
				  }
			       index=index+1;
			       if (index>=10000000) {
				  printf("not enough memory allocated \n");
				  goto zskip;
				  }
			       }
			    }
			 }
		     else {
			delta=b-itere;
			if (delta<1000)
			   dhist[delta]=dhist[delta]+1;
//			printf("extra: c=%d, order=%d, delta=%d, odd=%d, even=%d, v=%d %d, n=%d %d \n",c,order,delta,itero,itere,v[0],v[n-1],n,np);
			if ((delta<32)&&(itero<511)) {
			   ho2[32*itero+delta]=ho2[32*itero+delta]+1;
			   if ((flagp==1)&&(itero==row)) {
			      table1[index]=delta;
			      index=index+1;
			      if (index>=10000000) {
				 printf("not enough memory allocated \n");
				 goto zskip;
				 }
			      }
			   }
			}
		    }
		 }
	       }
	 if ((count<20)&&(overloop==0)) {
	    printf("l=%d, n=%d \n",itere,itero);
	    if ((row==0)&&(flagp==0)) {
	       fprintf(Outfp,"l=%d, n=%d \n",itere,itero);
	       fprintf(Outfp," order=%d n=%d, %d %d %d \n",order,n,v[0],v[n-1],np-n);
	       }
	    }
	 for (j=0; j<75; j++) {
	    if (z[j]==np)
	       goto bskip;
	     }
	 np=np-3;
bskip:	 if (np<2048)
	    he[np]=he[np]+1;
	 }
      }
dskip:
   while (k==(k/2)*2) {
      k=k/2; // next sequence value
      v[n]=k;
      n=n+1; // increment element count
      if (n>100000) {
	 printf("error 2: v array too small %d %d %d %d \n",v[0],v[n-3],v[n-2],v[n-1]);
	 goto zskip;
	 }
      }
   if (c==1) {
      if (k<0)	// avoid spurious c=-1 cycle
	 goto cskip;
      if (k!=1)
	 goto aloop;
      }
   if (c==-1) {  
      if (k<0)	// avoid spurious c=1 cycle of -4,-2,-1
	 goto cskip;
      if ((k!=1)&&(k!=5)&&(k!=7)&&(k!=17)&&(k!=25)&&(k!=37)&&(k!=55)&&(k!=41)&&(k!=61)&&(k!=91))
	 goto aloop;
      if (c1ind==1) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if (k==1) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==2) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==5)||(k==7)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==7) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
      if ((k==17)||(k==25)||(k==37)||(k==55)||(k==41)||(k==61)||(k==91)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
       goto aloop;
      }
   if (c==5) {
      if (k==(k/5)*5)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k<0)&&((k==(k/5)*5)))  // avoid spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=1)&&(k!=19)&&(k!=31)&&(k!=49)&&(k!=781)&&(k!=587)&&(k!=883)&&(k!=1327)&&(k!=1993)&&(k!=187)&&(k!=283)&&
	 (k!=427)&&(k!=643)&&(k!=967)&&(k!=1453)&&(k!=1091)&&(k!=1639)&&(k!=2461)&&(k!=1847)&&(k!=2773)&&(k!=2081)&&(k!=359)&&
	 (k!=541)&&(k!=407)&&(k!=613)&&(k!=461)&&(k!=347)&&(k!=523)&&(k!=787)&&(k!=1183)&&(k!=1777)&&(k!=667)&&
	 (k!=1003)&&(k!=1507)&&(k!=2263)&&(k!=3397)&&(k!=2549)&&(k!=1913)&&(k!=23)&&(k!=37)&&(k!=29))
	 goto aloop;
      if (c1ind==1) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if (k==1) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==3) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==19)||(k==31)||(k==49)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==17) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
      if ((k==359)||(k==541)||(k==407)||(k==613)||(k==461)||(k==347)||(k==523)||(k==787)||(k==1183)||(k==1777)||
		 (k==667)||(k==1003)||(k==1507)||(k==2263)||(k==3397)||(k==2549)||(k==1913)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
      if (c7ind==7) {
	 for (h=0; h<c7ind; h++)
	    c7[h]=0;
	 c7ind=0;
	 goto cskip;
	 }
      if ((k==667)||(k==1003)||(k==1507)||(k==2263)||(k==3397)||(k==2549)||(k==1913)) {
	 c7[c7ind]=k;
	 c7ind=c7ind+1;
	 }
      if (c6ind==12) {
	 for (h=0; h<c6ind; h++)
	   c6[h]=0;
	 c6ind=0;
	 goto cskip;
	 }
      if ((k==187)||(k==283)||(k==427)||(k==643)||(k==967)||(k==1453)||(k==1091)||(k==1639)||(k==2461)||(k==1847)||(k==2773)||(k==2081)) {
	 c6[c6ind]=k;
	 c6ind=c6ind+1;
	 }
      if (c4ind==17) {
	 for (h=0; h<c4ind; h++)
	    c4[h]=0;
	 c4ind=0;
	 goto cskip;
	 }
      if ((k==781)||(k==587)||(k==883)||(k==1327)||(k==1993)||(k==187)||(k==283)||(k==427)||(k==643)||(k==967)||(k==1453)||(k==1091)||(k==1639)||(k==2461)||(k==1847)||(k==2773)||(k==2081)) {
	 c4[c4ind]=k;
	 c4ind=c4ind+1;
	 }
      if (c5ind==3) {
	 for (h=0; h<c5ind; h++)
	    c5[h]=0;
	 c5ind=0;
	 goto cskip;
	 }
      if ((k==23)||(k==37)||(k==29)) {
	 c5[c5ind]=k;
	 c5ind=c5ind+1;
	 }
      goto aloop;
      }
   if (c==7) {
      if (k==(k/7)*7)  // spurious non-primitive c=1 cycles
	 goto cskip;
      if ((k!=5)&&(k!=11))
	 goto aloop;
      if (c1ind==2) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==5)||(k==11)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==11) {
      if (k==(k/11)*11)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k<0)&&((k==(k/11)*11)))  // avoid spurious non-primitive c=-1 cycle
	 goto cskip;
      if ((k<0)&&((k==(k/19)*19)))  // avoid spurious non-primitive c=-1 cycle
	 goto cskip;
      if ((k!=1)&&(k!=7)&&(k!=31)&&(k!=13)&&(k!=25)&&(k!=43)&&(k!=35)&&(k!=29)&&
	 (k!=49)&&(k!=79))
	 goto aloop;
      if (c1ind==2) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==1)||(k==7)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==8) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==31)||(k==13)||(k==25)||(k==43)||(k==35)||(k==29)||(k==49)||(k==79)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      goto aloop;
      }
   if (c==13) {
      if (k==(k/13)*13)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=1)&&(k!=179)&&(k!=275)&&(k!=419)&&(k!=635)&&(k!=959)&&(k!=1445)&&(k!=1087)&&
	 (k!=1637)&&(k!=1231)&&(k!=1853)&&(k!=1393)&&(k!=131)&&(k!=203)&&(k!=311)&&(k!=473)&&
	 (k!=211)&&(k!=323)&&(k!=491)&&(k!=743)&&(k!=1121)&&(k!=341)&&(k!=259)&&(k!=395)&&
	 (k!=599)&&(k!=905)&&(k!=227)&&(k!=347)&&(k!=527)&&(k!=797)&&(k!=601)&&(k!=287)&&
	 (k!=437)&&(k!=331)&&(k!=503)&&(k!=761)&&(k!=251)&&(k!=383)&&(k!=581)&&(k!=439)&&
	 (k!=665)&&(k!=283)&&(k!=431)&&(k!=653)&&(k!=493)&&(k!=373)&&(k!=421)&&(k!=319)&&
	 (k!=485)&&(k!=367)&&(k!=557))
	 goto aloop;
      if (c1ind==1) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if (k==1) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
       if (c2ind==15) {
	  for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==179)||(k==275)||(k==419)||(k==635)||(k==959)||(k==1445)||(k==1087)||(k==1637)||
	 (k==1231)&&(k==1853)||(k==1393)||(k==131)&&(k==203)||(k==311)||(k==473)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
    if (c3ind==5) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
     if ((k==211)||(k==323)||(k==491)||(k==743)||(k==1121)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
      if (c4ind==5) {
	 for (h=0; h<c4ind; h++)
	    c4[h]=0;
	 c4ind=0;
	 goto cskip;
	 }
      if ((k==341)||(k==259)||(k==395)||(k==599)||(k==905)) {
	 c4[c4ind]=k;
	 c4ind=c4ind+1;
	 }
     if (c5ind==5) {
	for (h=0; h<c5ind; h++)
	   c5[h]=0;
	c5ind=0;
	goto cskip;
	}
     if ((k==227)||(k==347)||(k==527)||(k==797)||(k==601)) {
	c5[c5ind]=k;
	c5ind=c5ind+1;
	}
     if (c6ind==5) {
	for (h=0; h<c6ind; h++)
	   c6[h]=0;
	c6ind=0;
	goto cskip;
	}
     if ((k==287)||(k==437)||(k==331)||(k==503)||(k==761)) {
	c6[c6ind]=k;
	c6ind=c6ind+1;
	}
     if (c7ind==5) {
	for (h=0; h<c7ind; h++)
	   c7[h]=0;
	c7ind=0;
	goto cskip;
	}
     if ((k==251)||(k==383)||(k==581)||(k==439)||(k==665)) {
	c7[c7ind]=k;
	c7ind=c7ind+1;
	}
     if (c8ind==5) {
	for (h=0; h<c8ind; h++)
	   c8[h]=0;
	c8ind=0;
	goto cskip;
	}
     if ((k==283)||(k==431)||(k==653)||(k==493)||(k==373)) {
	c8[c8ind]=k;
	c8ind=c8ind+1;
	}
     if (c9ind==5) {
	for (h=0; h<c9ind; h++)
	   c9[h]=0;
	c9ind=0;
	goto cskip;
	}
     if ((k==421)||(k==319)||(k==485)||(k==367)||(k==557)) {
	c9[c9ind]=k;
	c9ind=c9ind+1;
	}
      goto aloop;
      }
     if (c==-17) {
	if (k==(k/17)*17)  // spurious non-primitive c=1 cycle
	   goto cskip;
	if ((k!=65)&&(k!=89)&&(k!=125)&&(k!=179)&&(k!=103)&&(k!=73)&&(k!=101)&&(k!=143))
	   goto aloop;
	if (c2ind==4) {
	   for (h=0; h<c2ind; h++)
	      c2[h]=0;
	   c2ind=0;
	   goto cskip;
	   }
	if ((k==103)||(k==73)||(k==101)||(k==143)) {
	   c2[c2ind]=k;
	   c2ind=c2ind+1;
	   }
	if (c1ind==4) {
	   for (h=0; h<c1ind; h++)
	      c1[h]=0;
	   c1ind=0;
	   goto cskip;
	   }
	if ((k==65)||(k==89)||(k==125)||(k==179)) {
	   c1[c1ind]=k;
	   c1ind=c1ind+1;
	   }
	goto aloop;
	}
     if (c==17) {
	if (k==-143)  // spurious value
	   goto cskip;
	if (k==(k/17)*17)  // spurious non-primitive c=1 cycle
	   goto cskip;
	if ((k!=1)&&(k!=5)&&(k!=35)&&(k!=61)&&(k!=25)&&(k!=23)&&(k!=43)&&(k!=73)&&
	    (k!=59)&&(k!=97)&&(k!=77)&&(k!=31)&&(k!=55)&&(k!=91)&&(k!=145)&&(k!=113)&&
	    (k!=89)&&(k!=71)&&(k!=115)&&(k!=181))
	    goto aloop;
	 if (c1ind==2) {
	    for (h=0; h<c1ind; h++)
	       c1[h]=0;
	    c1ind=0;
	    goto cskip;
	    }
	 if ((k==1)||(k==5)) {
	    c1[c1ind]=k;
	    c1ind=c1ind+1;
	    }
	 if (c2ind==18) {
	    for (h=0; h<c2ind; h++)
	       c2[h]=0;
	    c2ind=0;
	    goto cskip;
	    }
	 if ((k==35)||(k==61)||(k==25)||(k==23)||(k==43)||(k==73)||(k==59)||(k==97)||
	    (k==77)||(k==31)||(k==55)||(k==91)||(k==145)||(k==113)||(k==89)||(k==71)||
	    (k==115)||(k==181)) {
	    c2[c2ind]=k;
	    c2ind=c2ind+1;
	    }
	 goto aloop;
	 }
   if (c==19) {
      if (k==(k/19)*19)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=7)&&(k!=5)&&(k!=17)&&(k!=35)&&(k!=31))
	 goto aloop;
	     if (c1ind==5) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==7)||(k==5)||(k==17)||(k==35)||(k==31)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==-19) {
       if (k==(k/19)*19)  // spurious non-primitive c=1 cycle
	  goto cskip;
       if ((k!=187)&&(k!=271)&&(k!=397)&&(k!=293)&&(k!=215)&&(k!=313)&&(k!=115)&&(k!=163)&&(k!=235)&&(k!=343)&&(k!=505))
	  goto aloop;
       if (c1ind==11) {
	  for (h=0; h<c1ind; h++)
	     c1[h]=0;
	  c1ind=0;
	  goto cskip;
	  }
       if ((k==187)||(k==217)||(k==397)||(k==293)||(k==215)||(k==313)||(k==115)||(k==163)||(k==235)||(k==343)||(k==505)) {
	  c1[c1ind]=k;
	  c1ind=c1ind+1;
	  }
       goto aloop;
       }
   if ((c==23)&&(flag23==0)) {
      if ((k==-6817)||(k==-9097)||(k==-12137)||(k==-8099)||(k==-5407)||(k==-7217)||(k==-4819)||(k==-6433)||(k==-8583)||(k==-5731)||(k==-7649)||(k==-5107))
	 goto cskip;
      if ((k==6817)||(k==9097)||(k==12137)||(k==8099)||(k==5407)||(k==7217)||(k==4819)||(k==6433)||(k==8583)||(k==5731)||(k==7649)||(k==5107))
	 goto cskip;
      if (k==(k/23)*23) // spurious non-primitive cycles
	 goto cskip;
      if ((k!=311)&&(k!=239)&&(k!=185)&&(k!=289)&&(k!=445)&&(k!=679)&&(k!=515)&&(k!=49)&&
	 (k!=85)&&(k!=139)&&(k!=55)&&(k!=47)&&(k!=41)&&(k!=73)&&(k!=121)&&(k!=193)&&
	 (k!=301)&&(k!=463)&&(k!=353)&&(k!=541)&&(k!=823)&&(k!=623)&&(k!=473)&&(k!=721)&&
	 (k!=1093)&&(k!=1651)&&(k!=7)&&(k!=11)&&(k!=5)&&(k!=19))
	 goto aloop;
      if (c1ind==26) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==311)||(k==239)||(k==185)||(k==289)||(k==445)||(k==679)||(k==515)||(k==49)||
	 (k==85)||(k==139)||(k==55)||(k==47)||(k==41)||(k==73)||(k==121)||(k==193)||(k==301)||
	 (k==463)||(k==353)||(k==541)||(k==823)||(k==623)||(k==473)||(k==721)||(k==1093)||(k==1651)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==2) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==7)||(k==11)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==2) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
      if ((k==5)||(k==19)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
      goto aloop;
      }
      if ((c==23)&&(flag23!=0)) {
	 if (k==(k/23)*23) // spurious non-primitive c=1 cycle
	    goto cskip;
	 if ((k==-5)||(k==-19))
	     goto cskip;
	 if ((k==-311)||(k==-239)||(k==-185)||(k==-289)||(k==-445)||(k==-679)||(k==-515)||(k==-49)||
	    (k==-85)||(k==-139)||(k==-55)||(k==-47)||(k==-41)||(k==-73)||(k==-121)||(k==-193)||
	    (k==-301)||(k==-463)||(k==-353)||(k==-541)||(k==-823)||(k==-623)||(k==-473)||(k==-721)||
	    (k==-1093)||(k==-1651)||(k==-7)||(k==-11)||(k==-5)||(k==-19))
	    goto cskip;
	 if ((k==6817)||(k==9097)||(k==12137)||(k==8099)||(k==5407)||(k==7217)||(k==4819)||(k==6433)||(k==8583)||(k==5731)||(k==7649)||(k==5107))
	    goto cskip;
	 if ((k!=5939)&&(k!=8897)&&(k!=6667)&&(k!=9989)&&(k!=3743)&&(k!=5603)&&(k!=8393)&&(k!=6289)&&(k!=4711)&&(k!=7055)&&(k!=10571)&&(k!=15845)&&
	     (k!=3665)&&(k!=2743)&&(k!=4103)&&(k!=6143)&&(k!=9203)&&(k!=13793)&&(k!=10339)&&(k!=15497)&&(k!=11617)&&(k!=8707)&&(k!=13049)&&(k!=9781)&&
	     (k!=2963)&&(k!=4433)&&(k!=3319)&&(k!=4967)&&(k!=7439)&&(k!=11147)&&(k!=16709)&&(k!=6263)&&(k!=9383)&&(k!=14063)&&(k!=21083)&&(k!=31613)&&
	     (k!=9665)&&(k!=7243)&&(k!=10853)&&(k!=4067)&&(k!=6089)&&(k!=4561)&&(k!=3415)&&(k!=5111)&&(k!=7655)&&(k!=11471)&&(k!=17195)&&(k!=25781)&&
	     (k!=7343)&&(k!=11003)&&(k!=16493)&&(k!=3091)&&(k!=4625)&&(k!=3463)&&(k!=5183)&&(k!=7763)&&(k!=11633)&&(k!=8719)&&(k!=13067)&&(k!=19589)&&
	     (k!=2359)&&(k!=3527)&&(k!=5279)&&(k!=7907)&&(k!=11849)&&(k!=8881)&&(k!=6655)&&(k!=9971)&&(k!=14945)&&(k!=11203)&&(k!=16793)&&(k!=12589)&&
	     (k!=2263)&&(k!=3383)&&(k!=5063)&&(k!=7583)&&(k!=11363)&&(k!=17033)&&(k!=12769)&&(k!=9571)&&(k!=14345)&&(k!=10753)&&(k!=8059)&&(k!=12077))
	     goto aloop;
	 if (c7ind==12) {
	     for (h=0; h<c7ind; h++)
		c7[h]=0;
	     c7ind=0;
	     goto cskip;
	     }
	  if ((k==2263)||(k==3383)||(k==5063)||(k==7583)||(k==11363)||(k==17033)||(k==12769)||(k==9571)||(k==14345)||(k==10753)||(k==8059)||(k==12077)) {
	     c7[c7ind]=k;
	     c7ind=c7ind+1;
	     if ((c23m7<3)&&(overloop==0))
		printf("c7: k=%lld, i=%lld \n",k,i);
	     c23m7=c23m7+1;
	     }
	  if (c6ind==12) {
	     for (h=0; h<c6ind; h++)
		c6[h]=0;
	     c6ind=0;
	     goto cskip;
	     }
	  if ((k==2359)||(k==3527)||(k==5279)||(k==7907)||(k==11849)||(k==8881)||(k==6655)||(k==9971)||(k==14945)||(k==11203)||(k==16793)||(k==12589)) {
	     c6[c6ind]=k;
	     c6ind=c6ind+1;
	     if ((c23m6<3)&&(overloop==0))
		printf("c6: k=%lld, i=%lld \n",k,i);
	     c23m6=c23m6+1;
	     }
	  if (c5ind==12) {
	     for (h=0; h<c5ind; h++)
		c5[h]=0;
	     c5ind=0;
	     goto cskip;
	     }
	  if ((k==7343)||(k==11003)||(k==16493)||(k==3091)||(k==4625)||(k==3463)||(k==5183)||(k==7763)||(k==11633)||(k==8719)||(k==13067)||(k==19589)) {
	     c5[c5ind]=k;
	     c5ind=c5ind+1;
	     if ((c23m5<3)&&(overloop==0))
		printf("c5: k=%lld, index=%d, i=%lld, order=%lld \n",k,index,i,order);
	     c23m5=c23m5+1;
	     }
	  if (c4ind==12) {
	     for (h=0; h<c4ind; h++)
		c4[h]=0;
	     c4ind=0;
	     goto cskip;
	     }
	  if ((k==9665)||(k==7243)||(k==10853)||(k==4067)||(k==6089)||(k==4561)||(k==3415)||(k==5111)||(k==7655)||(k==11471)||(k==17195)||(k==25781)) {
	     c4[c4ind]=k;
	     c4ind=c4ind+1;
	     if ((c23m4<3)&&(overloop==0))
		printf("c4: k=%lld, i=%lld \n",k,i);
	     c23m4=c23m4+1;
	     }
	  if (c3ind==12) {
	     for (h=0; h<c3ind; h++)
		c3[h]=0;
	     c3ind=0;
	     goto cskip;
	     }
	  if ((k==2963)||(k==4433)||(k==3319)||(k==4967)||(k==7439)||(k==11147)||(k==16709)||(k==6263)||(k==9383)||(k==14063)||(k==21083)||(k==31613)) {
	     c3[c3ind]=k;
	     c3ind=c3ind+1;
	     if ((c23m3<3)&&(overloop==0))
		printf("c3: k=%lld, i=%lld  \n",k,i);
	     c23m3=c23m3+1;
	     }
	  if (c1ind==12) {
	     for (h=0; h<c1ind; h++)
		c1[h]=0;
	     c1ind=0;
	     goto cskip;
	     }
	  if ((k==10339)||(k==15497)||(k==11617)||(k==8707)||(k==13049)||(k==9781)||(k==3665)||(k==2743)||(k==4103)||(k==6143)||(k==9203)||(k==13793)) {
	     c1[c1ind]=k;
	     c1ind=c1ind+1;
	     if ((c23m1<3)&&(overloop==0))
		printf("c1: k=%lld, i=%lld \n",k,i);
	     c23m1=c23m1+1;
	     }
	  if (c2ind==12) {
	     for (h=0; h<c2ind; h++)
		c2[h]=0;
	     c2ind=0;
	     goto cskip;
	     }
	  if ((k==5939)||(k==8897)||(k==6667)||(k==9989)||(k==3743)||(k==5603)||(k==8393)||(k==6289)||(k==4711)||(k==7055)||(k==10571)||(k==15845)) {
	     c2[c2ind]=k;
	     c2ind=c2ind+1;
	     if ((c23m2<3)&&(overloop==0))
		printf("c2: k=%lld, index=%d, i=%lld, order=%lld \n",k,c2ind,i,order);
	     c23m2=c23m2+1;
	     }
	  goto aloop;
	  }
      if (c==-25) {
	 if (k==(k/5)*5)  // spurious non-primitive c=1 cycle
	    goto cskip;
	 if ((k!=751)&&(k!=557)&&(k!=823)&&(k!=611)&&(k!=113)&&(k!=157)&&(k!=223)&&(k!=161)&&(k!=229)&&(k!=331)&&
	    (k!=121)&&(k!=169)&&(k!=241)&&(k!=349)&&(k!=511)&&(k!=377)&&(k!=553)&&(k!=817)&&(k!=1213)&&(k!=1807)&&
	    (k!=1349)&&(k!=2011))
	    goto aloop;
	 if (c1ind==22) {
	    for (h=0; h<c1ind; h++)
	       c1[h]=0;
	    c1ind=0;
	    goto cskip;
	    }
	 if ((k==751)||(k==557)||(k==823)||(k==611)||(k==113)||(k==157)||(k==223)||(k==161)||(k==229)||(k==331)||
	    (k==121)||(k==169)||(k==241)||(k==349)||(k==511)||(k==377)||(k==553)||(k==817)||(k==1213)||(k==1807)||
	    (k==1349)||(k==2011)) {
	    c1[c1ind]=k;
	    c1ind=c1ind+1;
	    }
	 goto aloop;
	 }
      if (c==25) {
	 if (k==(k/5)*5)  // spurious non-primitive c=1 cycle
	    goto cskip;
	 if ((k!=17)&&(c!=19)&&(c!=41)&&(c!=37)&&(c!=11)&&(c!=29)&&(c!=7)&&(c!=23)&&(c!=47)&&
	    (k!=83)&&(k!=137)&&(k!=109))
	    goto aloop;
	 if (c1ind==4) {
	    for (h=0; h<c1ind; h++)
	       c1[h]=0;
	    c1ind=0;
	    goto cskip;
	    }
	 if ((k==17)||(k==19)||(k==41)||(k==37)) {
	    c1[c1ind]=k;
	    c1ind=c1ind+1;
	    }
	 if (c2ind==8) {
	    for (h=0; h<c2ind; h++)
	       c2[h]=0;
	    c2ind=0;
	    goto cskip;
	    }
	 if ((k==11)||(k==29)||(k==7)||(k==23)||(k==47)||(k==83)||(k==137)||(k==109)) {
	    c2[c2ind]=k;
	    c2ind=c2ind+1;
	    }
	 goto aloop;
	 }
   if (c==29) {
      if (k==(k/29)*29)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=49)&&(k!=11)&&(k!=31)&&(k!=61)&&(k!=53)&&(k!=47)&&(k!=85)&&(k!=71)&&(k!=121)&&
	 (k!=98569)&&(k!=36967)&&(k!=55465)&&(k!=20803)&&(k!=31219)&&(k!=46843)&&(k!=70279)&&
	 (k!=105433)&&(k!=39541)&&(k!=29663)&&(k!=44509)&&(k!=33389)&&(k!=25049)&&(k!=9397)&&
	 (k!=7055)&&(k!=10597)&&(k!=7955)&&(k!=11947)&&(k!=17935)&&(k!=26917)&&(k!=20195)&&
	 (k!=30307)&&(k!=45475)&&(k!=68227)&&(k!=102355)&&(k!=153547)&&(k!=230335)&&
	 (k!=345517)&&(k!=259145)&&(k!=97183)&&(k!=109349)&&(k!=82019)&&(k!=123043)&&
	 (k!=184579)&&(k!=276883)&&(k!=415339)&&(k!=623023)&&(k!=934549)&&(k!=700919)&&(k!=1051393)&&
	 (k!=853915)&&(k!=1280887)&&(k!=1921345)&&(k!=180127)&&(k!=270205)&&(k!=202661)&&
	 (k!=152003)&&(k!=228019)&&(k!=342043)&&(k!=513079)&&(k!=769633)&&(k!=36077)&&
	 (k!=27065)&&(k!=10153)&&(k!=3811)&&(k!=5731)&&(k!=8611)&&(k!=12931)&&(k!=19411)&&
	 (k!=29131)&&(k!=43711)&&(k!=65581)&&(k!=49193)&&(k!=18451)&&(k!=27691)&&(k!=41551)&&
	 (k!=62341)&&(k!=46763)&&(k!=70159)&&(k!=105253)&&(k!=78947)&&(k!=118435)&&(k!=177667)&&
	 (k!=266515)&&(k!=399787)&&(k!=599695)&&(k!=899557)&&(k!=674675)&&(k!=1012027)&&
	 (k!=1518055)&&(k!=2277097)&&(k!=1))
	     goto aloop;
     if (c1ind==9) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==49)||(k==11)||(k==31)||(k==61)||(k==53)||(k==47)||(k==85)||(k==71)||(k==121)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
     if (c2ind==40) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==98569)||(k==36967)||(k==55465)||(k==20803)||(k==31219)||(k==46843)||(k==70279)||
	 (k==105433)||(k==39541)||(k==29663)||(k==44509)||(k==33389)||(k==25049)||(k==9397)||
	 (k==7055)||(k==10597)||(k==7955)||(k==11947)||(k==17935)||(k==26917)||(k==20195)||
	 (k==30307)||(k==45475)||(k==68227)||(k==102355)||(k==153547)||(k==230335)||
	 (k==345517)||(k==259145)||(k==97183)||(k==109349)||(k==82019)||(k==123043)||
	 (k==184579)||(k==276883)||(k==415339)||(k==623023)||(k==934549)||(k==700919)||(k==1051393)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==41) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
      if ((k==853915)||(k==1280887)||(k==1921345)||(k==180127)||(k==270205)||(k==202661)||
	 (k==152003)||(k==228019)||(k==342043)||(k==513079)||(k==769633)||(k==36077)||
	 (k==27065)||(k==10153)||(k==3811)||(k==5731)||(k==8611)||(k==12931)||(k==19411)||
	 (k==29131)||(k==43711)||(k==65581)||(k==49193)||(k==18451)||(k==27691)||(k==41551)||
	 (k==62341)||(k==46763)||(k==70159)||(k==105253)||(k==78947)||(k==118435)||(k==177667)||
	 (k==266515)||(k==399787)||(k==599695)||(k==899557)||(k==674675)||(k==1012027)||
	 (k==1518055)||(k==2277097)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
      if (c4ind==1) {
	 for (h=0; h<c4ind; h++)
	    c4[h]=0;
	 c4ind=0;
	 goto cskip;
	 }
      if (k==1) {
	 c4[c4ind]=k;
	 c4ind=c4ind+1;
	 }
      goto aloop;
      }
   if (c==-29) {
      if ((k==(k/29)*29))  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=113)&&(k!=155)&&(k!=109)&&(k!=149)&&(k!=209)&&(k!=299)&&(k!=217)&&(k!=311))
	 goto aloop;
      if (c1ind==8) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==113)||(k==155)||(k==109)||(k==149)||(k==209)||(k==299)||(k==217)||(k==311)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==-31) {
      if ((k==(k/31)*31))  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=95)&&(k!=127)&&(k!=175)&&(k!=247)&&(k!=355)&&(k!=517))
	 goto aloop;
      if (c1ind==6) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==95)||(k==127)||(k==175)||(k==247)||(k==355)||(k==517)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==31) {
      if ((k==(k/31)*31))  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=53)&&(k!=95)&&(k!=79)&&(k!=67)&&(k!=29)&&(k!=59)&&(k!=13)&&(k!=35)&&(k!=17)&&(k!=41)&&(k!=77)&&(k!=131))
	 goto aloop;
      if (c1ind==12) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==53)||(k==95)||(k==79)||(k==67)||(k==29)||(k==59)||(k==13)||(k==35)||(k==17)||(k==41)||(k==77)||(k==131)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==35) {
      if ((k==(k/5)*5))  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k==(k/7)*7))
	 goto cskip;
      if ((k!=17)&&(k!=43)&&(k!=41)&&(k!=79)&&(k!=13)&&(k!=37)&&(k!=73)&&(k!=127))
	 goto aloop;
      if (c1ind==4) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==17)||(k==43)||(k==41)||(k==79)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==4) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==13)||(k==37)||(k==73)||(k==127)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      goto aloop;
      }
   if (c==37) {
      if ((k==(k/37)*37))
	 goto cskip;
      if ((k!=23)&&(k!=53)&&(k!=49)&&(k!=29)&&(k!=31)&&(k!=65)&&(k!=19)&&(k!=47)&&(k!=89))
	 goto aloop;
      if (c1ind==3) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==23)||(k==53)||(k==49)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==3) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==29)||(k==31)||(k==65)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==3) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
      if ((k==19)||(k==47)||(k==89)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
      goto aloop;
      }
   if (c==41) {
      if (k==(k/41)*41) // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=1)&&(k!=11)&&(k!=37)&&(k!=19)&&(k!=49)&&(k!=47)&&(k!=91)&&(k!=157))
	 goto aloop;
      if (c1ind==8) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==1)||(k==11)||(k==37)||(k==19)||(k==49)||(k==47)||(k==91)||(k==157)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==43) {
      if (k==(k/43)*43) // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=7)&&(k!=1)&&(k!=23))
	 goto aloop;
      if (c1ind==3) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==7)||(k==1)||(k==23)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==47) {
      if (k==(k/47)*47) // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k==119)||(k==101)||(k==175)||(k==143))
	 goto cskip;   // interrelated cycle with no attachment points
      if ((k!=85)&&(k!=151)&&(k!=125)&&(k!=211)&&(k!=103)&&(k!=89)&&(k!=157)&&(k!=259)&&(k!=65)&&(k!=121)&&(k!=205)&&(k!=331)&&
	 (k!=11)&&(k!=5)&&(k!=31)&&(k!=35)&&(k!=19)&&(k!=13)&&(k!=43)&&(k!=247)&&(k!=197)&&(k!=319)&&(k!=251)&&(k!=25)&&(k!=61)&&
	 (k!=115)&&(k!=49)&&(k!=97)&&(k!=169)&&(k!=277)&&(k!=439)&&(k!=341)&&(k!=535)&&(k!=413)&&(k!=643))
	 goto aloop;
      if (c1ind==4) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==85)||(k==151)||(k==125)||(k==211)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==4) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==103)||(k==89)||(k==157)||(k==259)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==4) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c3ind=0;
	 goto cskip;
	 }
      if ((k==65)||(k==121)||(k==205)||(k==331)) {
	 c3[c3ind]=k;
	 c3ind=c3ind+1;
	 }
      if (c4ind==7) {
	 for (h=0; h<c4ind; h++)
	    c4[h]=0;
	 c4ind=0;
	 goto cskip;
	 }
      if ((k==11)||(k==5)||(k==31)||(k==35)||(k==19)||(k==13)||(k==43)) {
	 c4[c4ind]=k;
	 c4ind=c4ind+1;
	 }
      if (c5ind==16) {
	 for (h=0; h<c5ind; h++)
	    c5[h]=0;
	 c5ind=0;
	 goto cskip;
	 }
      if ((k==247)||(k==197)||(k==319)||(k==251)||(k==25)||(k==61)||(k==115)||(k==49)||(k==97)||(k==169)||(k==277)||(k==439)||(k==341)||(k==535)||(k==413)||(k==643)) {
	 c5[c5ind]=k;
	 c5ind=c5ind+1;
	 }
      goto aloop;
      }
   if (c==49) {
      if (k==(k/7)*7) // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k==-65)||(k==-73)||(k==-85)||(k==-103))
	 goto cskip;  // cycle without attachment points
      if ((k!=407)&&(k!=635)&&(k!=977)&&(k!=745)&&(k!=571)&&(k!=881)&&(k!=673)&&(k!=517)&&(k!=25)&&(k!=31)&&(k!=71)&&(k!=131)&&
	 (k!=221)&&(k!=89)&&(k!=79)&&(k!=143)&&(k!=239)&&(k!=383)&&(k!=599)&&(k!=923)&&(k!=1409)&&(k!=1069))
	 goto aloop;
      if (c1ind==22) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==407)||(k==635)||(k==977)||(k==745)||(k==571)||(k==881)||(k==673)||(k==517)||(k==25)||(k==31)||(k==71)||(k==131)||
	 (k==221)||(k==89)||(k==79)||(k==143)||(k==239)||(k==383)||(k==599)||(k==923)||(k==1409)||(k==1069)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==175) {
      if ((k==(k/5)*5))  // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k==(k/7)*7))
	 goto cskip;
      if ((k!=103)&&(k!=121)&&(k!=269)&&(k!=491)&&(k!=179)&&(k!=89)&&(k!=221)&&(k!=419)&&(k!=73)&&(k!=197)&&(k!=383)&&(k!=331)&&(k!=143)&&
		  (k!=151)&&(k!=157)&&(k!=323)&&(k!=101)&&(k!=239)&&(k!=223)&&(k!=211)&&(k!=83)&&(k!=53)&&(k!=167)&&(k!=169)&&(k!=341)&&(k!=599)&&
		  (k!=493)&&(k!=827)&&(k!=611)&&(k!=251)&&(k!=29)&&(k!=131)&&(k!=71)&&(k!=97)&&(k!=233)&&(k!=437)&&(k!=743)&&(k!=601)&&(k!=989)&&(k!=1571))
	 goto aloop;
      if (c1ind==4) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==103)||(k==121)||(k==269)||(k==491)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      if (c2ind==4) {
	 for (h=0; h<c2ind; h++)
	    c2[h]=0;
	 c2ind=0;
	 goto cskip;
	 }
      if ((k==179)||(k==89)||(k==221)||(k==419)) {
	 c2[c2ind]=k;
	 c2ind=c2ind+1;
	 }
      if (c3ind==4) {
	 for (h=0; h<c3ind; h++)
	    c3[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==73)||(k==197)||(k==383)||(k==331)) {
	 c3[c1ind]=k;
	 c3ind=c3ind+1;
	 }
      if (c4ind==4) {
	 for (h=0; h<c4ind; h++)
	    c4[h]=0;
	 c4ind=0;
	 goto cskip;
	 }
      if ((k==143)||(k==151)||(k==157)||(k==323)) {
	 c4[c4ind]=k;
	 c4ind=c4ind+1;
	 }
      if (c5ind==4) {
	 for (h=0; h<c5ind; h++)
	    c5[h]=0;
	 c5ind=0;
	 goto cskip;
	 }
      if ((k==101)||(k==239)||(k==223)||(k==211)) {
	 c5[c5ind]=k;
	 c5ind=c5ind+1;
	 }
      if (c6ind==8) {
	 for (h=0; h<c6ind; h++)
	    c6[h]=0;
	 c6ind=0;
	 goto cskip;
	 }
      if ((k==83)||(k==53)||(k==167)||(k==169)||(k==341)||(k==599)||(k==493)||(k==827)) {
	 c6[c6ind]=k;
	 c6ind=c6ind+1;
	 }
      if (c7ind==12) {
	 for (h=0; h<c7ind; h++)
	    c7[h]=0;
	 c6ind=0;
	 goto cskip;
	 }
      if ((k==611)||(k==251)||(k==29)||(k==131)||(k==71)||(k==97)||(k==233)||(k==437)||(k==743)||(k==601)||(k==989)||(k==1571)) {
	 c7[c7ind]=k;
	 c7ind=c7ind+1;
	 }
      goto aloop;
      }
   if (c==-119) {
      if (k==(k/7)*7)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if (k==(k/17)*17)
	 goto cskip;
      if ((k!=311)&&(k!=407)&&(k!=551)&&(k!=767)&&(k!=1091)&&(k!=1577)&&(k!=1153)&&(k!=835)&&(k!=1193)&&(k!=865)&&(k!=619)&&(k!=869))
	 goto aloop;
      if (c1ind==12) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==311)||(k==407)||(k==551)||(k==767)||(k==1091)||(k==1577)||(k==1153)||(k==835)||(k==1193)||(k==865)||(k==619)||(k==869)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==221) {
      if (k==(k/13)*13)  // spurious non-primitive c=1 cycle
	 goto cskip;
      if (k==(k/17)*17)
	 goto cskip;
      if ((k!=5)&&(k!=59)&&(k!=199)&&(k!=409)&&(k!=181)&&(k!=191)&&(k!=397)&&(k!=353))
	 goto aloop;
      if (c1ind==8) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==5)||(k==59)||(k==199)||(k==409)||(k==181)||(k==191)||(k==397)||(k==353)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
   if (c==461) {
      if (k==(k/461)*461) // spurious non-primitive c=1 cycle
	 goto cskip;
      if ((k!=113)&&(k!=25)&&(k!=67)&&(k!=331)&&(k!=727)&&(k!=1321)&&(k!=553)&&(k!=265)&&(k!=157)&&(k!=233)&&(k!=145)&&(k!=7)&&(k!=241)&&(k!=37)&&(k!=143)&&(k!=445)&&(k!=449))
	 goto aloop;
      if (c1ind==17) {
	 for (h=0; h<c1ind; h++)
	    c1[h]=0;
	 c1ind=0;
	 goto cskip;
	 }
      if ((k==113)||(k==25)||(k==67)||(k==331)||(k==727)||(k==1321)||(k==553)||(k==265)||(k==157)||(k==233)||(k==145)||(k==7)||(k==241)||(k==37)||(k==143)||(k==445)||(k==449)) {
	 c1[c1ind]=k;
	 c1ind=c1ind+1;
	 }
      goto aloop;
      }
cskip:
   k=0;
   c1ind=0;
   c2ind=0;
   c3ind=0;
   c4ind=0;
   c5ind=0;
   c6ind=0;
   c7ind=0;
   c8ind=0;
   c9ind=0;
   }
if (c==-1)
   cnt[el]=c1tot;
if (c==5)
   cnt[el]=c5tot;
if (c==7)
   cnt[el]=c7tot;
if (c==11)
   cnt[el]=c11tot;
if (c==13)
   cnt[el]=c13tot;
if ((c==17)||(c==-17))
   cnt[el]=c17tot;
if ((c==19)||(c==-19))
   cnt[el]=c19tot;
if (c==23)
   cnt[el]=c23tot;
if ((c==25)||(c==-25))
   cnt[el]=c25tot;
if ((c==29)||(c==-29))
   cnt[el]=c29tot;
if ((c==31)||(c==-31))
   cnt[el]=c31tot;
if (c==35)
   cnt[el]=c35tot;
if (c==37)
   cnt[el]=c37tot;
if (c==41)
   cnt[el]=c41tot;
if (c==43)
   cnt[el]=c43tot;
if (c==47)
   cnt[el]=c47tot;
if (c==49)
   cnt[el]=c49tot;
if (c==175)
   cnt[el]=c175tot;
if (c==-119)
   cnt[el]=c119tot;
if (c==221)
   cnt[el]=c221tot;
if (c==461)
   cnt[el]=c461tot;
printf("l=%d, count=%d, exceptions=%d %d \n",el+1,cnt[el],over32,over64);
}
if (overloop==0) {
//
// check for valid lengths//
//
for (h=0; h<178; h++) {
   if (he[y[h]]!=0) {
      printf("exception for length, c=%d, l=%d, count=%d \n",c,y[h]+3,he[y[h]]);
      }
   }
//
// HISTOGRAM OF LENGTHS
//
printf("\n");
if (flagp==0) {
   fprintf(Outfp,"\n");
   fprintf(Outfp,"HISTOGRAM \n");
   printf("HISTOGRAM OF LENGTHS \n");
   for (h=0; h<64; h++) {
      fprintf(Outfp," %d %d %d %d %d %d %d %d \n",he[8*h],he[8*h+1],he[8*h+2],
      he[8*h+3],he[8*h+4],he[8*h+5],he[8*h+6],he[8*h+7]);
      printf(" %d %d %d %d %d %d %d %d \n",he[8*h],he[8*h+1],he[8*h+2],
      he[8*h+3],he[8*h+4],he[8*h+5],he[8*h+6],he[8*h+7]);
      }
   }
//
// HISTOGRAM OF LENGTHS
//
fprintf(Outfp,"\n");
printf("\n");
if (flagp==0) {
   fprintf(Outfp,"HISTOGRAM \n");
   printf("HISTOGRAM OF NUMBER OF EVEN ELEMENTS (PER NUMBER OF ODD ELEMENTS)\n");
   for (h=0; h<64; h++) {
      fprintf(Outfp," %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",ho[256*h],
      ho[256*h+1],ho[256*h+2],ho[256*h+3],ho[256*h+4],ho[256*h+5],ho[256*h+6],
      ho[256*h+7],ho[256*h+8],ho[256*h+9],ho[256*h+10],ho[256*h+11],ho[256*h+12],
      ho[256*h+13],ho[256*h+14],ho[256*h+15]);
      printf(" %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d i=%d \n",ho[256*h],
      ho[256*h+1],ho[256*h+2],ho[256*h+3],ho[256*h+4],ho[256*h+5],ho[256*h+6],
      ho[256*h+7],ho[256*h+8],ho[256*h+9],ho[256*h+10],ho[256*h+11],ho[256*h+12],
      ho[256*h+13],ho[256*h+14],ho[256*h+15],h);
      }
   if (c==-1) {
      printf("c=-1 total cycle count (including fragments)=%d \n",c1tot);
      printf("cycle count=%d \n",c1cyc1);
      }
   if (c==5) {
      printf("c=5 total cycle count (including fragments)=%d \n",c5tot);
      printf("cycle count=%d %d %d %d %d %d %d \n",c5cyc1,c5cyc2,c5cyc3,c5cyc4,c5cyc5,c5cyc6,c5cyc7);
      }
   if (c==7) {
      printf("c=7 total cycle count (including fragments)=%d \n",c7tot);
      printf("cycle count=%d \n",c7cyc1);
      }
   if (c==11) {
      printf("c=11 total cycle count (including fragments)=%d \n",c11tot);
      printf("cycle count=%d %d %d %d \n",c11cyc1,c11cyc2,c11cyc3,c11cyc4);
      }
   if (c==13) {
      printf("c=13 total cycle count (including fragments)=%d \n",c13tot);
      printf("cycle counts=%d %d %d %d %d %d %d %d %d  \n",c13cyc1,c13cyc2,c13cyc3,c13cyc4,c13cyc5,c13cyc6,c13cyc7,c13cyc8,c13cyc9);
      }
   if (c==17) {
      printf("c=17 total cycle count (including fragments)=%d \n",c17tot);
      printf("cycle counts=%d %d %d %d %d \n",c17cyc1,c17cyc2,c17cyc3,c17cyc4,c17cyc5);
      }
   if (c==-17) {
      printf("c=-17 total cycle count (including fragments)=%d \n",c17tot);
      printf("cycle count=%d  \n",c17cyc1);
      }
   if (c==19) {
      printf("c=19 total cycle count (including fragments)=%d \n",c19tot);
      printf("cycle count=%d %d \n",c19cyc1,c19cyc2);
      }
   if (c==-19) {
      printf("c=-19 total cycle count (including fragments)=%d \n",c19tot);
      printf("cycle counts=%d %d \n",c19cyc1,c19cyc2);
      }
   if ((c==23)&&(flag23!=0)) {
      printf("c=-23 total cycle count (including fragments)=%d \n",c23tot);
      printf("cycle counts=%d %d %d %d %d %d %d %d %d %d %d %d \n",c23cyc1,c23cyc2,c23cyc3,c23cyc4,c23cyc5,c23cyc6,
				   c23cyc7,c23cyc8,c23cyc9,c23cyc10,c23cyc11,c23cyc12);
      }
   if ((c==23)&&(flag23==0)) {
      printf("c=23 total cycle count (including fragments)=%d \n",c23tot);
      printf("cycle counts=%d %d %d %d %d %d \n",c23cyc1,c23cyc2,c23cyc3,c23cyc4,c23cyc5,c23cyc6);
      }
   if (c==25) {
      printf("c=25 total cycle count (including fragments)=%d \n",c25tot);
      printf("cycle counts=%d %d %d %d \n",c25cyc1,c25cyc2,c25cyc3,c25cyc4);
      }
   if (c==-25) {
      printf("c=-25 total cycle count (including fragments)=%d \n",c25tot);
      printf("cycle count=%d %d %d\n",c25cyc1,c25cyc2,c25cyc3);
      }
   if (c==29) {
      printf("c=29 total cycle count (including fragments)=%d \n",c29tot);
      printf("cycle counts=%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",c29cyc1,c29cyc2,c29cyc3,c29cyc4,c29cyc5,c29cyc6,c29cyc7,c29cyc8,c29cyc9,c29cyc10,c29cyc11,c29cyc12,c29cyc13,c29cyc14,c29cyc15,c29cyc16,c29cyc17,c29cyc18,c29cyc19);
      }
   if (c==-29) {
      printf("c=-29 total cycle count (including fragments)=%d \n",c29tot);
      printf("cycle counts=%d \n",c29cyc1);
      }
   if (c==-31) {
      printf("c=-31 total cycle count (including fragments)=%d \n",c31tot);
      printf("cycle counts=%d \n",c31cyc1);
      }
   if (c==-119) {
      printf("c=-119 total cycle count (including fragments)=%d \n",c119tot);
      printf("cycle counts=%d \n",c119cyc1);
      }
   if (c==31) {
      printf("c=31 total cycle count (including fragments)=%d \n",c31tot);
      printf("cycle counts=%d %d %d %d \n",c31cyc1,c31cyc2,c31cyc3,c31cyc4);
      }
   if (c==35) {
      printf("c=35 total cycle count (including fragments)=%d \n",c35tot);
      printf("cycle counts=%d %d %d \n",c35cyc1,c35cyc2,c35cyc3);
      }
   if (c==37) {
      printf("c=37 total cycle count (including fragments)=%d \n",c37tot);
      printf("cycle counts=%d %d %d \n",c37cyc1,c37cyc2,c37cyc3);
      }
   if (c==41) {
      printf("c=41 total cycle count (including fragments)=%d \n",c41tot);
      printf("cycle counts=%d %d %d %d %d \n",c41cyc1,c41cyc2,c41cyc3,c41cyc4,c41cyc5);
      }
   if (c==43) {
      printf("c=43 total cycle count (including fragments)=%d \n",c43tot);
      printf("cycle counts=%d %d %d  \n",c43cyc1,c43cyc2,c43cyc3);
      }
   if (c==47) {
      printf("c=47 total cycle count (including fragments)=%d \n",c47tot);
      printf("cycle counts=%d %d %d %d %d %d %d %d %d %d %d \n",c47cyc1,c47cyc2,c47cyc3,c47cyc4,c47cyc5,c47cyc6,c47cyc7,c47cyc8,c47cyc9,c47cyc10,c47cyc11);
      }
   if (c==49) {
      printf("c=49 total cycle count (including fragments)=%d \n",c49tot);
      printf("cycle counts=%d %d %d %d \n",c49cyc1,c49cyc2,c49cyc3,c49cyc4);
      }
   if (c==175) {
      printf("c=175 total cycle count (including fragments)=%d \n",c175tot);
      printf("cycle counts=%d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",c175cyc1,c175cyc2,c175cyc3,c175cyc4,c175cyc5,c175cyc6,c175cyc7,c175cyc8,c175cyc9,c175cyc10,c175cyc11,c175cyc12,c175cyc13,c175cyc14);
      }
   if (c==221) {
      printf("c=221 total cycle count (including fragments)=%d \n",c221tot);
      printf("cycle counts=%d %d %d %d  \n",c221cyc1,c221cyc2,c221cyc3,c221cyc4);
      }
   if (c==461) {
      printf("c=461 total cycle count (including fragments)=%d \n",c461tot);
      printf("cycle counts=%d %d %d %d %d %d %d %d %d %d %d %d \n",c461cyc1,c461cyc2,c461cyc3,c461cyc4,c461cyc5,c461cyc6,c461cyc7,c461cyc8,c461cyc9,c461cyc10,c461cyc11,c461cyc12);
      }
   }
if (flagp!=0) {
   if (flagp==2) {
      printf("HISTOGRAM OF NUMBER OF EVEN ELEMENTS PER NUMBER OF ODD ELEMENTS, (+ relative to c=1 or -1)\n");
      for (h=1; h<64; h++) {
	 printf(" %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d, i=%d\n",
	 ho[256*h+1],ho[256*h+2],ho[256*h+3],ho[256*h+4],ho[256*h+5],ho[256*h+6],ho[256*h+7],ho[256*h+8],ho[256*h+9],ho[256*h+10],ho[256*h+11],
	 ho[256*h+12],ho[256*h+13],ho[256*h+14],ho[256*h+15],ho[256*h+16],ho[256*h+17],ho[256*h+18],ho[256*h+19],ho[256*h+20],ho[256*h+21],
	 ho[256*h+22],ho[256*h+23],ho[256*h+24],ho[256*h+25],ho[256*h+26],ho[256*h+27],ho[256*h+28],ho[256*h+29],ho[256*h+30],ho[256*h+31],h);
	 }
      }
   else {
      printf("HISTOGRAM OF NUMBER OF EVEN ELEMENTS PER NUMBER OF ODD ELEMENTS, (- relative to c=1 or -1)\n");
      for (h=1; h<64; h++) {
	 printf(" %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d, i=%d \n",
	 ho2[32*h+1],ho2[32*h+2],ho2[32*h+3],ho2[32*h+4],ho2[32*h+5],ho2[32*h+6],ho2[32*h+7],ho2[32*h+8],ho2[32*h+9],ho2[32*h+10],ho2[32*h+11],
	 ho2[32*h+12],ho2[32*h+13],ho2[32*h+14],ho2[32*h+15],ho2[32*h+16],ho2[32*h+17],ho2[32*h+18],ho2[32*h+19],ho2[32*h+20],ho2[32*h+21],
	 ho2[32*h+22],ho2[32*h+23],ho2[32*h+24],ho2[32*h+25],ho2[32*h+26],ho2[32*h+27],ho2[32*h+28],ho2[32*h+29],ho2[32*h+30],ho2[32*h+31],h);
	 }
      }
   }
printf("\n");
printf("exceptions (+)=%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",extra[1],extra[2],extra[3],extra[4],extra[5],extra[6],extra[7],
	   extra[8],extra[9],extra[10],extra[11],extra[12],extra[13],extra[14],extra[15],extra[16],extra[17],extra[18],extra[19]);
printf("exceptions (-)=%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \n",dhist[1],dhist[2],dhist[3],dhist[4],dhist[5],dhist[6],dhist[7],
	   dhist[8],dhist[9],dhist[10],dhist[11],dhist[12],dhist[13],dhist[14],dhist[15],dhist[16],dhist[17],dhist[18],dhist[19]);
printf("overflow count=%d \n",ecount);
printf("rejection count=%lld \n",reject);
printf("loop count=%lld, ratio=%f \n",lcount,1.0-(double)reject/(double)lcount);
printf("size exception=%d \n",over64);
if (flagp==0) {
   printf("\n");
   printf("acount=%lld, bcount=%lld, xcount=%lld, bigo=%d \n",acount,bcount,xcount,bigo);
   temp1=0;
for (i=0; i<128; i++) {  // Note: Allocated up to 256 (rows)
	temp=0;
	for (j=0; j<256; j++)
		temp=temp+(unsigned long long)ho[256*i+j];  // columns
	temp1=temp1+temp;
	printf("i=%d, count=%lld, ahist=%d, bhist=%d \n",i,temp,ahist[i],bhist[i]);
	if (abselect==1)
	   fprintf(Outfp," %lld, \n",temp);
	if (abselect==2)
		fprintf(Outfp," %d, \n",ahist[i]);
	if (abselect==3)
		fprintf(Outfp," %d, \n",bhist[i]);
}
temp=temp1+acount+bcount+reject;
printf("sum=%lld, total=%d, ratio=%f \n",temp1,temp,(double)temp/(double)lcount);
}
if (flagp!=0) {
   sum=0.0;
   for (h=0; h<index; h++) {
      fprintf(Outfp," %lld,\n",table1[h]);
      sum=sum+(double)table1[h];
      }
   sum=sum/(double)index;
   std=0.0;
   for (h=0; h<index; h++)
      std=std+((double)table1[h]-sum)*((double)table1[h]-sum);
   std=sqrt(std/(double)(index-1));
   printf("index=%d, mean=%f, std=%f, overflow count=%d \n",index,sum,std, ecount);
   }
   }
else {
  if (outtrace==0) {
     for (h=0; h<outloop; h++) {
	printf("h=%d, count=%d \n",h+1,cnt[h]);
	if (outcols==0)
	   fprintf(Outfp," %d \n",cnt[h]);
	}
     }
  else {
     for (h=0; h<=(unsigned int)tindex; h++) {
	if (locind==0)
	   fprintf(Outfp," %d \n",trace[h]);
	else {
	   if (trace[h]==locind)
	      fprintf(Outfp," %d \n",h);
	   }
	}
     }
  }
zskip:
fclose(Outfp);
return(0);
}