/* <qd.c> 9jun05
**
** Program to dump data from Folding@home <queue.dat> file.
** It will poke around at other files too, if it can find them.
**
** Copyright (C) 2002-2005 Richard P. Howell IV. 
** Copyright (C) 2005-2008 Sebastiaan Couwenberg
** This is free software; you can distribute it and/or modify it under 
** the terms of the GNU General Public License.  There is no warranty 
** whatsoever.
**
** To compile (for example):
**
**  cc -o qd -DNO_CTIME=1 -DTZONE=0 qd.c
**
** Define SYSTYPE as needed for system being compiled for...
**  0 - Linux                  (x86 CPU)
**  1 - Windows NT, 2K, ME, XP (x86 CPU)
**  2 - Mac OS X               (PPC CPU)
**  3 - Mac OS X               (x86 CPU)
**
** DATE and FREV are normally defined automatically along with the point
** table inserted during compilation.
**
** The program accepts the following flag arguments...
**
**  -u      Print this usage message (and exit)
**  -h      Print an explanation of the status codes (and exit)
**  -i      Format with deeper indentation
**  -c      Compact format (omit several lines)
**  -C      Only display current index
**  -p      Don't look at FAH files other than <queue.dat>
**  -P      Print extra Project, Run, Clone, Generation line like in FAHlog.txt
**  -a      Show all, also displays the passkey if it's set (not displayed by default since fr 069)
**  -f dir  Explicitly specify folding directory
**  -q file Explicitly specify queue data file (implies -p)
**  -n file Explicitly specify qd info file (default <qdinfo.dat>)
**  -m file Explicitly specify EM III info file (default <emprotz.dat>)
**  -s {linux, windows, mac-ppc, mac-x86}  Specify type of queue data file
**  -t zone Override time zone (+HHMM or -HHMM)
**  -z      Force UTC (same as -t +0000)
**  -v      Just print version information and stop
**  -d      Print debug dump
**  -e      Print all entries even if they're garbage
**  -l      Format for log entry data
**  -L      Format for log entry data with specified ID string
**  -x      Print output in Well Formed XML
**  -X      Print output in Valid XML with Inline DTD
**  -b      Just print out benchmark number (like "qbm") UNIMPLEMENTED
**  -r      Detect and fix errors (like "qfix") UNIMPLEMENTED
*/

#ifndef SYSTYPE			/* Really it should always be compiler arg */
# if defined (__i386__) && ((defined(__linux__) || defined(__unix__)) && !defined(__APPLE__))
#  define SYSTYPE	0
# elif defined (__i386__) && (defined(__WIN32__) || defined(WIN32))
#  define SYSTYPE	1
# elif defined(__ppc__) && defined(__APPLE__)
#  define SYSTYPE	2
# elif defined(__i386__) && defined(__APPLE__)
#  define SYSTYPE	3
# else
#  define SYSTYPE	-1
# endif
#endif
#ifndef NO_CTIME
# define NO_CTIME	0	/* It's OK to use library "ctime" function */
#endif
#ifndef DEFQVER
# define DEFQVER	400	/* Default client version number if file looks bad */
#endif
#ifndef MAXQVER
# define MAXQVER	600	/* Maximum queue version number allowed */
#endif

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#if !NO_CTIME
# include <time.h>		/* Provides ctime() */
#endif
#include <ctype.h> 		/* Provides tolower() */
#include <math.h> 		/* Provides sqrt() */

typedef int bool;
#ifndef FALSE
# define FALSE		0
# define TRUE		1
#endif

#define TIME_OFS 946684800U	/* Linux epoch is 1970, FAH (Cosm) is 2000 */

#ifndef TZONE
# define TZONE (0 * 3600)	/* Our own time printer needs the time zone */
#endif
char mtab[] = "Jan\037Feb\035Mar\037Apr\036May\037Jun\036\
Jul\037Aug\037Sep\036Oct\037Nov\036Dec\037";

#define be4(x)	(((x)[0]<<24)|(((x)[1]&0xFF)<<16)|(((x)[2]&0xFF)<<8)|((x)[3]&0xFF))
#define le4(x)	(((x)[3]<<24)|(((x)[2]&0xFF)<<16)|(((x)[1]&0xFF)<<8)|((x)[0]&0xFF))
#define le2(x)	((((x)[1]&0xFF)<<8)|((x)[0]&0xFF))
#define exch(x, y, t)	{t=x;x=y;y=t;}

bool f_indt = FALSE; 	/* Format with deeper indentation */
bool f_prst = FALSE; 	/* Print an explanation of the status codes */
bool f_only = FALSE; 	/* Don't look at files other than <queue.dat> */
bool f_dbgd = FALSE; 	/* Print debug dump */
bool f_pall = FALSE; 	/* Print all entries even if they're garbage */
bool f_logd = FALSE; 	/* Format for log entry data */
bool f_zone = FALSE;	/* Time zone specified (don't use "ctime") */
bool f_styp = FALSE;	/* System type specified (don't autodetect) */
bool f_pver = FALSE;	/* Just print version information and stop */
bool f_cpct = FALSE;	/* Print compact format (omit several lines) */
bool f_pqbm = FALSE;	/* Just print out benchmark number (like "qbm") */
bool f_qfix = FALSE;	/* Detect and fix errors (like "qfix") */
bool f_xmld = FALSE;   	/* Print output in Well Formed XML */
bool f_xdtd = FALSE;	/* Print output in Valid XML with Inline DTD in the DOCTYPE */
bool f_prcg = FALSE;	/* Print extra Project, Run, Clone, Generation line like in FAHlog.txt */
bool f_show = FALSE;	/* Show all, also displays the passkey if it's set which is not shown by default */
bool f_curr = FALSE;	/* Only show current index */
bool f_oldi = FALSE;	/* Info file is older than builtin tables */

char *qfil;		/* Name of queue data file (default "queue.dat") */
char *nfil;		/* Name of qd info file (default "qdinfo.dat") */
char *mfil;		/* Name of EM III info file (default "emprotz.dat") */
char *fdir;		/* Folding directory (default "./") */
char *lid;		/* Specified log ID string */
int systype;		/* System type (from SYSTYPE) */
unsigned int qver;	/* Queue version number, from queue or best guess */
bool eswap;		/* Queue file with opposite endianness (default FALSE) */
int tzone;		/* Time zone (default TZONE) */
char *idnt;		/* Indentation string */

FILE *fp;
FILE *fpm;

/* Structure of <queue.dat> file */

typedef unsigned int u32;
typedef unsigned short u16;

struct qf
{	u32		version;	 /* 0000 Queue (client) version (v2.17 and above) */
	u32		current;	 /* 0004 Current index number */
	struct qs
	{	u32	stat;		 /* 000 Status */
		char	use_cores[4];	 /* 004 Pad for Windows, others as of v4.01, as of v6.01 number of SMP Cores to use (LE) */
		u32	tdata[8];	 /* 008 Time data (epoch 0000 1jan00 UTC) */
		u32	svr1;		 /* 040 Server IP address (until v3.0) */
		u32	ustat;		 /* 044 Upload status */
		char	url[128];	 /* 048 Web address for core downloads */
		u32	m176;		 /* 176 Misc1a */
		u32	core;		 /* 180 Core_xx number (hex) */
		u32	m184;		 /* 184 Misc1b */
		u32	dsiz;		 /* 188 wudata_xx.dat file size */
		char	z192[16];
		union
		{	struct
			{	char	proj[2];	/* 208 Project number (LE) */
				char	run[2];		/* 210 Run (LE) */
				char	clone[2];	/* 212 Clone (LE) */
				char	gen[2];		/* 214 Generation (LE) */
				char	issue[2][4];	/* 216 WU issue time (LE) */
			}	f;			/* Folding@home data */
			struct
			{	char	proj[2];	/* 208 Project number (LE) */
				u16	miscg1;		/* 210 Miscg1 */
				char	issue[2][4];	/* 212 WU issue time (LE) */
				u16	miscg2;		/* 220 Miscg2 */
				u16	miscg3;		/* 222 Miscg3 */
			}	g;			/* Genome@home data */
		}	wuid;		 /* 208 Work unit ID information */
		char	z224[36];
		char	mid[4];		 /* 260 Machine ID (LE or BE, was only LE before v5 work servers) */
		u32	svr2;		 /* 264 Server IP address */
		u32	port;		 /* 268 Server port number */
		char	type[64];	 /* 272 Work unit type */
		char	uname[64];	 /* 336 User Name */
		char	teamn[64];	 /* 400 Team Number */
		char	uid[8];		 /* 464 Stored ID for unit (UserID + MachineID) (LE or BE, usually BE, always BE for v5 work servers) */
		char	bench[4];	 /* 472 Benchmark (as of v3.24) (LE) */
		char	m476[4];	 /* 476 Misc3b (unused as of v3.24) (LE); Benchmark (as of v5.00) (BE) */
		u32	cpu_type;	 /* 480 CPU type (LE or BE, sometimes 0) */
		u32	os_type;	 /* 484 OS type (LE or BE, sometimes 0) */
		u32	cpu_spec;	 /* 488 CPU species (LE or BE, sometimes 0) */
		u32	os_spec;	 /* 492 OS species (LE or BE, sometimes 0) */
		u32	expire;		 /* 496 Allowed time to return (seconds) */
		char	z500[4];
		char    cltype[4];	 /* 504 Client type required (usually 0) (LE or BE) */
		char	aiflag[4];	 /* 508 Assignment info present flag (LE or BE) */
		char	aitime[4];	 /* 512 Assignment timestamp (LE or BE) */
		char	aidata[4];	 /* 516 Assignment info (LE or BE) */
		char	csip[4];	 /* 520 Collection server IP address (as of v5.00) (LE) */
		char	dstart[4];	 /* 524 Download started time (as of v5.00) (BE) */
		char	z528[4];
		char	m532[4];	 /* 532 Misc4a (LE or BE) */
		char	z536[8];
		char    cores[4];	 /* 544 Number of SMP cores (as of v5.91) (BE) */
		char    tag[16];         /* 548 Tag of Work Unit (as of v5.00) */
		char    z564[16];
		char    passkey[32];     /* 580 Passkey (as of v6.00) */
		char    flops[4];        /* 612 Flops per CPU (core) (as of v6.00) (BE) */
		char    memory[4];       /* 616 Available memory (as of v6.00) (BE) */
		char    gpu_memory[4];	 /* 620 Available GPU memory (as of v6.20) (LE) */
		char    z624[64];
		u32	due[4];		 /* 688 WU expiration time */
		u32	plimit;		 /* 704 Packet size limit (as of v5.00) */
		u32	uploads;	 /* 708 Number of upload failures (as of v5.00) */
	}		entry[10];	 /* 0008 Array of ten queue entries */
	u32		pfract;		 /* 7128 Performance fraction (as of v3.24) */
	u32		punits;		 /* 7132 Performance fraction unit weight (as of v3.24) */
	u32		drate;		 /* 7136 Download rate sliding average (as of v4.00) */
	u32		dunits;		 /* 7140 Download rate unit weight (as of v4.00) */
	u32		urate;		 /* 7144 Upload rate sliding average (as of v4.00) */
	u32		uunits;		 /* 7148 Upload rate unit weight (as of v4.00) */
	char		results_sent[4]; /* 7152 Results successfully sent (after upload failures) (as of v5.00) (LE) */
	char		z7156[12];       /* 7156 (as of v5.00) ...all zeros after queue conversion... */
} qbuf;

/* There is still sometimes unknown stuff in bytes 500-503 and 528-535.
 *
 * Bytes 500-507 likely contain the configuration requirements of the WU,
 * e.g if the WU requires the use of -advmethods flag.
 *
 * Known values in byte 500-503:
 *  01 00 00 00
 *  00 00 00 01
 *
 * Known values in byte 192-208:
 *  25 0B 00 00 65 DF 68 4B  A5 ED 52 66 00 00 00 00
 *  27 00 00 00 38 DF 68 4B  A5 ED 52 66 01 00 00 00
 *  AC 56 00 00 77 85 52 4A  A5 ED 52 66 03 00 00 00
 *  D9 14 00 00 6A 1C 39 4B  A5 ED 52 66 34 00 00 00
 *  7B 51 00 00 9D 10 35 4C  AF ED 52 66 07 00 00 00
 *  32 01 00 00 5B 04 35 4C  AF ED 52 66 0D 00 00 00
 *  1D 3E 00 00 E7 05 35 4C  AF ED 52 66 31 00 00 00
 *
 * Known values in byte 564-580:
 *  31 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 *  32 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 *  35 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 *  38 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 * 
 * Known values in byte 672-688:
 *  00 00 00 00 00 00 00 00  00 00 00 00 00 00 02 BC
 */


struct ptent
{	u16	proj;		/* Project number */
	u32	points;		/* Points */
	u32	until;		/* Time points may have changed */
} pbuf[5000];			/* Working point table */

struct pdent
{	u16	proj;		/* Project number */
	u32	preferred;	/* Preferred deadline (in seconds) */
	u32	until;		/* Time preferred deadline may have changed */
} pdbuf[5000];			/* Working preferred deadline table */

struct pkent
{	u16	proj;		/* Project number */
	u32	kfactor;	/* Kfactor */
	u32	until;		/* Time kfactor may have changed */
} pkbuf[5000];			/* Working kfactor table */

struct strtab
{	u32	type;		/* CPU or OS type */
	char *	name;		/* Name string */
};

struct strtab cputab[] =
 {	{  100000, "x86" },
	{  100085, "x86" },
	{  100086, "i86" },
	{  100087, "Pentium IV" },
	{  100186, "i186" },
	{  100286, "i286" },
	{  100386, "i386" },
	{  100486, "i486" },
	{  100586, "Pentium" },
	{  100587, "Pentium MMX" },
	{  100686, "Pentium Pro" },
	{  100687, "Pentium II/III" },
	{  101000, "Cyrix x86" },
	{  102000, "AMD x86" },
	{  200000, "PowerPC" },
	{ 1100000, "IA64" },
	{ 1600000, "AMD64" },
	{ 0 }
 };

struct strtab ostab[] =
 {	{  100000, "Windows" },
	{  100001, "Win95" },
	{  100002, "Win95_OSR2" },
	{  100003, "Win98" },
	{  100004, "Win98SE" },
	{  100005, "WinME" },
	{  100006, "WinNT" },
	{  100007, "Win2K" },
	{  100008, "WinXP" },
	{  100009, "Win2K3" },
	{  200000, "MacOS" },
	{  300000, "OSX" },
	{  400000, "Linux" },
	{  700000, "FreeBSD" },
	{  800000, "OpenBSD" },
	{ 1800000, "Win64" },
	{ 1900000, "OS2" },
	{ 0 }
 };

/* Folding@Home client types
 *
 * In older versions of the F@H client, type 1 were Folding@Home WUs and
 * type 2 were Genome@Home WUs.
 * This probably applied to versions before v4.00, like v3.24.
 * The value found in the queue.dat is only displayed for Folding@Home WUs.
 */
struct strtab cltab[] =
 {      { 1, "Regular" },
        { 2, "No Deadline" },
        { 3, "Advmethods" },
        { 4, "Beta" },
        { 5, "Internal" },
        { 6, "Big Beta" },
        { 7, "BigAdv" },
        { 8, "Alpha" },
        { 9, "Big Alpha" },
        { 0 }
 };

struct strtab coretab[] =
 {	{ 0x10, "GROGPU" },		/* GPU */
 	{ 0x11, "GROGPU2" },		/* GPU2 (ATI CAL / NVIDIA CUDA) */
 	{ 0x12, "ATI-DEV" },		/* GPU2 (ATI Development) */
 	{ 0x13, "NVIDIA-DEV" },		/* GPU2 (NVIDIA Development) */
 	{ 0x14, "GROGPU2-MT" },		/* GPU2 (NVIDIA Development) */
 	{ 0x15, "OPENMMGPU" },		/* GPU3 (OpenMM) */
	{ 0x20, "SHARPEN" },		/* SHARPEN */
 	{ 0x65, "TINKER" },		/* Tinker */
 	{ 0x78, "GROMACS" },		/* Gromacs */
 	{ 0x79, "DGROMACS" },		/* Double-precision Gromacs */
 	{ 0x7a, "GBGROMACS" },		/* GB Gromacs (Generalized Born implicit solvent) */
 	{ 0x7b, "DGROMACSB" },		/* Double-precision Gromacs B */
 	{ 0x7c, "DGROMACSC" },		/* Double-precision Gromacs C */
 	{ 0x80, "GROST" },		/* Gromacs SREM */
 	{ 0x81, "GROSIMT" },		/* Gromacs Simulated Tempering */
 	{ 0x82, "AMBER" },		/* Amber */
 	{ 0x96, "QMD" },		/* QMD */
 	{ 0xa0, "GROMACS33" },		/* Gromacs 3.3 */
 	{ 0xa1, "GRO-SMP" },		/* Gromacs SMP (V1.71) */
 	{ 0xa2, "GROCVS" },		/* Gromacs CVS / Gromacs SMP (V1.90) */
 	{ 0xa3, "GRO-A3" },		/* Gromacs SMP2 / Gromacs SMP (V2.13) */
 	{ 0xa4, "GRO-A4" },		/* Gromacs GB (V2.06) */
 	{ 0xb4, "ProtoMol" },		/* ProtoMol */
 	{ 0 }
 };

char wbuf[300];						/* Word buffer, stores strings */
char nbuf[300];
char vbuf[20];
char vbufa[20];
void cfn(char *, int);					/* Construct file name (in wbuf) */
int lform(int *);					/* Construct line with variable fields */
void prstr(char *, u32, u32, struct strtab *);		/* Print string */
void prcore(char *, u32, struct strtab *);		/* Print FAH core */
void printip(char *, unsigned int, unsigned int);	/* Print IP address */
void prtime(char *, unsigned int);			/* Print a date and time */
void printb(void *, void *, int);			/* Print hex bytes */
u32 es32(u32);
void eswp(struct qf *);
void lower(char *);					/* Print a string in lowercase */

/* The following text is automatically generated from <qdinfo.dat> */

#define DATE "7 September 2010"
#define FREV "083"
#define PGEN 0x14191E01
struct ptent ptbl[] =		/* Built-in table, from "pt" and "ph" entries */
 {	{   101,   7400 },{   111,    500 },{   112,    500 },{   113,    500 },{   114,    500 },
	{   127,    200 },{   128,    200 },{   129,    200 },{   131,    140 },{   132,    280 },
	{   133,    350 },{   134,    190 },{   135,     70 },{   136,    130 },{   137,     60 },
	{   138,     60 },{   139,     60 },{   140,     60 },{   141,     60 },{   142,     60 },
	{   143,     60 },{   144,     60 },{   145,     60 },{   146,    600 },{   147,     60 },
	{   160,    200 },{   161,    200 },{   162,    200 },{   163,    200 },{   164,    200 },
	{   165,    200 },{   166,    200 },{   167,    200 },{   168,    200 },{   169,    200 },
	{   170,    200 },{   171,  10000 },{   172,    200 },{   180,   9300 },{   181,    800 },
	{   182,   9300 },{   183,     70 },{   184,   9300 },{   185,   9300 },{   186,    640 },
	{   187,    640 },{   188,    640 },{   189,    640 },{   190,    640 },{   191,   1800 },
	{   192,   1000 },{   200,    200 },{   201,    760 },{   202,    760 },{   203,    760 },
	{   204,    760 },{   205,    760 },{   206,    760 },{   207,    760 },{   208,    760 },
	{   209,    760 },{   210,    760 },{   211,    640 },{   212,  13500 },{   213,    640 },
	{   214,   6400 },{   215,   5400 },{   216,   5400 },{   217,  23600 },{   218,  18600 },
	{   219,  16000 },{   220,  14800 },{   221,   4200 },{   223,   3800 },{   224,   3400 },
	{   227,   3200 },{   230,   7800 },{   231,   6400 },{   233,   5300 },{   234,   5200 },
	{   235,  23900 },{   236,  18500 },{   237,  16000 },{   238,  14800 },{   239,   4200 },
	{   240,   3800 },{   241,   3300 },{   242,   3200 },{   243,   7800 },{   244,   6300 },
	{   245,   5400 },{   246,   5300 },{   247,  23500 },{   248,  18300 },{   249,  15800 },
	{   250,   5330 },{   251,   1800 },{   252,   3500 },{   253,   3500 },{   254,   7400 },
	{   255,   7700 },{   256,   7600 },{   257,   1500 },{   258,   9200 },{   259,   9800 },
	{   260,   2200 },{   261,  36600 },{   262,  15200 },{   263,  22100 },{   264,  20600 },
	{   265,  14600 },{   266,  15200 },{   267,  22100 },{   268,  20600 },{   269,  14600 },
	{   272,   4550 },{   273,   4000 },{   274,   4100 },{   275,   4100 },{   276,   4100 },
	{   277,   4100 },{   278,   4100 },{   279,   4100 },{   280,   4100 },{   281,   4100 },
	{   282,   4200 },{   283,   4100 },{   284,   4100 },{   285,   4100 },{   286,   4100 },
	{   287,   4100 },{   288,   4200 },{   289,   4100 },{   290,   4100 },{   291,   4100 },
	{   292,   4100 },{   293,   4100 },{   294,  46900 },{   295,  23400 },{   296,  23400 },
	{   297,  26600 },{   298,  23500 },{   299,  26100 },{   301,    200 },{   304,    200 },
	{   310,    200 },{   312,     50 },{   313,     50 },{   314,     50 },{   315,    200 },
	{   316,    200 },{   317,    200 },{   318,    420 },{   319,     50 },{   320,   5140 },
	{   321,   5140 },{   322,   5140 },{   323,   5140 },{   324,   5140 },{   325,   5140 },
	{   326,   5140 },{   327,   5140 },{   328,   5140 },{   329,   5140 },{   330,   5140 },
	{   332,   5140 },{   333,   5140 },{   334,   5140 },{   335,   5140 },{   336,   5140 },
	{   337,   5140 },{   338,   5140 },{   340,   5330 },{   341,   5330 },{   342,   5330 },
	{   343,   5330 },{   344,   5330 },{   345,   5330 },{   346,   5330 },{   347,   5330 },
	{   348,   5460 },{   349,   5460 },{   350,   5140 },{   351,   5140 },{   352,   5140 },
	{   353,   5140 },{   354,   5140 },{   355,   5140 },{   356,   5140 },{   357,   5140 },
	{   358,   5140 },{   359,   5140 },{   360,   5330 },{   361,   5330 },{   362,   5460 },
	{   363,   5460 },{   364,   2940 },{   365,   2940 },{   367,   5330 },{   368,   2940 },
	{   369,   2940 },{   372,   5330 },{   373,   5330 },{   374,   1530 },{   375,   1530 },
	{   376,   5330 },{   377,   5330 },{   378,   5330 },{   379,   5330 },{   380,   5330 },
	{   381,   5330 },{   382,   5330 },{   383,   5330 },{   384,   5330 },{   385,   5330 },
	{   386,   1530 },{   387,   1530 },{   388,    956 },{   389,    956 },{   391,    956 },
	{   392,    956 },{   393,    956 },{   394,    956 },{   395,    956 },{   396,    956 },
	{   397,    478 },{   411,     60 },{   412,     60 },{   434,     30 },{   435,     30 },
	{   437,     30 },{   439,     30 },{   441,     60 },{   442,     30 },{   443,     30 },
	{   447,     30 },{   448,     30 },{   451,     30 },{   452,     30 },{   457,     60 },
	{   458,     60 },{   459,     60 },{   464,     60 },{   465,     60 },{   466,     60 },
	{   468,     60 },{   469,     60 },{   472,     60 },{   477,     60 },{   482,     60 },
	{   487,     60 },{   488,     60 },{   489,     60 },{   494,     60 },{   499,     60 },
	{   501,    160 },{   502,    160 },{   504,    190 },{   505,    160 },{   506,    160 },
	{   507,    160 },{   508,    160 },{   509,    600 },{   511,    600 },{   513,    600 },
	{   514,    600 },{   515,    600 },{   516,    600 },{   520,   4400 },{   521,   4400 },
	{   522,   4400 },{   523,   4400 },{   524,   4400 },{   525,   4400 },{   526,   4400 },
	{   529,   4600 },{   530,   4400 },{   531,    700 },{   532,   2400 },{   533,    700 },
	{   534,    700 },{   535,    700 },{   536,   1000 },{   537,   1800 },{   538,   4800 },
	{   539,   4600 },{   540,   3300 },{   541,   3300 },{   542,   4600 },{   543,   4400 },
	{   544,   4700 },{   545,   4700 },{   546,   4700 },{   547,   1800 },{   548,   2300 },
	{   549,   4700 },{   553,    900 },{   554,     60 },{   555,    900 },{   556,   3300 },
	{   557,    900 },{   558,   4700 },{   559,   4600 },{   560,     60 },{   561,     60 },
	{   562,     60 },{   563,   2300 },{   564,     60 },{   565,     60 },{   566,   3300 },
	{   567,   3300 },{   568,   2300 },{   569,   4600 },{   570,   3600 },{   571,   6600 },
	{   572,   6100 },{   573,   4700 },{   574,   4700 },{   575,   4700 },{   576,   4700 },
	{   577,   4700 },{   578,   4700 },{   579,  18600 },{   580,    650 },{   581,  22000 },
	{   582,  27700 },{   583,   4200 },{   584,   8800 },{   585,   1000 },{   586,  21500 },
	{   587,  18600 },{   588,  23000 },{   589,  23000 },{   590,   9300 },{   591,   2000 },
	{   599,    900 },{   601,     75 },{   602,     75 },{   603,    150 },{   604,    150 },
	{   605,    150 },{   606,    150 },{   607,    100 },{   608,    140 },{   609,    280 },
	{   610,    700 },{   611,    570 },{   612,    810 },{   613,    570 },{   614,    570 },
	{   615,    570 },{   616,    570 },{   617,   5100 },{   618,   6300 },{   619,   5200 },
	{   620,   1040 },{   621,    730 },{   622,  12800 },{   623,  12800 },{   624,  12800 },
	{   625,  12800 },{   626,   6600 },{   627,   3800 },{   628,   5100 },{   629,   2900 },
	{   630,   4300 },{   631,   2400 },{   632,   2360 },{   633,   2360 },{   634,  20400 },
	{   635,  24800 },{   636,  11500 },{   637,  13800 },{   638,  23900 },{   639,  23900 },
	{   640,   1970 },{   641,   1970 },{   642,   1970 },{   643,   1970 },{   644,   2360 },
	{   645,   2360 },{   646,   1970 },{   647,   1970 },{   648,   1970 },{   649,   1970 },
	{   650,   4060 },{   651,   4060 },{   652,   3060 },{   653,   3060 },{   654,   1720 },
	{   655,   1720 },{   656,  14600 },{   657,  14600 },{   658,   6700 },{   659,  12200 },
	{   660,  12800 },{   661,  12800 },{   662,   1970 },{   663,   1970 },{   664,   1970 },
	{   665,   1970 },{   666,   1970 },{   667,   1970 },{   668,   3060 },{   669,   3060 },
	{   670,   7300 },{   671,   7300 },{   672,  12800 },{   673,   1970 },{   674,   2360 },
	{   675,  18200 },{   676,  12800 },{   677,  12800 },{   678,  24200 },{   679,   2360 },
	{   680,  23700 },{   681,   3010 },{   682,   3010 },{   683,   6000 },{   684,   6000 },
	{   685,  12900 },{   686,  12500 },{   687,  23500 },{   688,  23600 },{   689,  23100 },
	{   690,  23100 },{   691,   7090 },{   692,  24100 },{   693,  24400 },{   694,  23600 },
	{   695,  23500 },{   696,  23500 },{   697,  23800 },{   698,  21400 },{   699,  21300 },
	{   700,    250 },{   701,    250 },{   702,    250 },{   703,    250 },{   704,    250 },
	{   705,    250 },{   706,    250 },{   707,    250 },{   720,   1540 },{   721,   3900 },
	{   722,   5460 },{   723,   4900 },{   724,   6300 },{   725,   1170 },{   726,   1170 },
	{   727,   1310 },{   728,   1390 },{   729,   2000 },{   730,   2400 },{   731,   2500 },
	{   732,   2700 },{   733,   1800 },{   734,   2100 },{   735,  25600 },{   736,  12800 },
	{   737,  12800 },{   738,   2300 },{   739,   2000 },{   740,   2400 },{   741,  14900 },
	{   742,  17800 },{   743,  21000 },{   744,   4400 },{   745,  17800 },{   746,  21000 },
	{   747,   4400 },{   748,   5100 },{   749,   6000 },{   752,  14900 },{   753,   4400 },
	{   754,   5100 },{   755,   4100 },{   761,  13500 },{   762,   4100 },{   763,   4800 },
	{   764,   3900 },{   768,  12000 },{   769,   3600 },{   770,   4100 },{   771,   3300 },
	{   772,  14900 },{   773,   4400 },{   774,   4100 },{   775,  12000 },{   776,   3600 },
	{   780,  56500 },{   781,  56500 },{   782,  56500 },{   783,  56500 },{   784,  56500 },
	{   785,  56500 },{   786,  56500 },{   800,  15500 },{   801,  15500 },{   802,   3200 },
	{   803,   3200 },{   804,   3200 },{   805,   5450 },{   806,   5450 },{   807,   5450 },
	{   808,   3200 },{   809,   5450 },{   810,   3200 },{   811,   3200 },{   812,   3200 },
	{   813,   3200 },{   814,   3200 },{   815,   3200 },{   816,   3200 },{   817,   3200 },
	{   818,   3200 },{   819,   3200 },{   820,   3250 },{   821,   3200 },{   822,   3200 },
	{   823,   3200 },{   824,   3200 },{   825,   3200 },{   826,   3200 },{   827,   3200 },
	{   828,   3200 },{   829,   3200 },{   830,   3200 },{   831,   3200 },{   832,   3200 },
	{   833,   3200 },{   834,   3200 },{   835,   3200 },{   836,   3200 },{   837,   3200 },
	{   838,   3200 },{   839,   4000 },{   840,   1150 },{   841,   3250 },{   842,   3200 },
	{   843,   3200 },{   844,   1150 },{   845,   3200 },{   846,   3200 },{   847,   3200 },
	{   848,   3200 },{   849,   3200 },{   850,   3200 },{   851,   3500 },{   852,   3200 },
	{   853,   3200 },{   854,  15500 },{   855,  14100 },{   856,  14100 },{   857,  14100 },
	{   858,  16000 },{   859,  16000 },{   860,   3100 },{   861,   3100 },{   862,   3100 },
	{   863,   3100 },{   864,  15500 },{   865,  15500 },{   866,  15500 },{   867,  15500 },
	{   868,  15000 },{   869,  15000 },{   870,  15000 },{   871,  16400 },{   872,   3100 },
	{   873,   3100 },{   874,  15500 },{   875,  15500 },{   876,  13600 },{   877,  15500 },
	{   878,  13600 },{   879,  13600 },{   880,  13600 },{   881,  13600 },{   882,  13600 },
	{   883,  15500 },{   884,  13600 },{   885,  13600 },{   886,  14200 },{   887,  14200 },
	{   888,  13800 },{   889,  27200 },{   890,  27200 },{   891,  17400 },{   892,  16500 },
	{   893,  64700 },{   894,  74300 },{   895,  16500 },{   896,  17100 },{   897,  32600 },
	{   901,    320 },{   902,    500 },{   903,    620 },{   905,   1300 },{   906,   1300 },
	{   907,   1400 },{   908,   1300 },{   909,   4100 },{   910,   3500 },{   911,   6000 },
	{   912,   6000 },{   913,   6500 },{   914,   4100 },{   915,   3700 },{   916,   4100 },
	{   917,   4100 },{   918,   3100 },{   919,   3400 },{   920,   3400 },{   921,   4000 },
	{   922,   3400 },{   923,   4800 },{   924,   4800 },{   925,   3400 },{   926,   4100 },
	{   927,   9100 },{   928,   9100 },{   929,  11400 },{   930,   9900 },{   931,  10400 },
	{   932,  11000 },{   933,  11200 },{   934,  10700 },{   935,   6800 },{   936,  10700 },
	{   937,   7800 },{   938,   7500 },{   939,   9900 },{   940,   1200 },{   941,   4400 },
	{   942,   2100 },{   943,   3300 },{   944,   5200 },{   945,   7800 },{   946,  11900 },
	{   947,  17700 },{   948,   1700 },{   949,   3800 },{   950,   2700 },{   951,   3600 },
	{   952,   4900 },{   953,   6100 },{   954,   7600 },{   955,  10600 },{   956,   4800 },
	{   957,   4800 },{   958,   4800 },{   959,   4800 },{   960,   4800 },{   961,   4800 },
	{   962,   2800 },{   963,   2300 },{   964,   8400 },{   970,  12200 },{   971,   8400 },
	{   972,  12200 },{   973,   8400 },{   974,   8400 },{   975,   8400 },{   976,   8400 },
	{   977,   8400 },{   978,   8400 },{   979,  16800 },{   984,   8400 },{   985,   2300 },
	{   986,   2800 },{   987,   2300 },{   988,   2300 },{   989,   2800 },{   990,   2300 },
	{   991,   9900 },{   992,  13000 },{   993,  12200 },{   994,  13000 },{   995,   9900 },
	{   996,  13000 },{   997,  13000 },{   998,   1000 },{  1001,   4110 },{  1002,   4110 },
	{  1003,   4110 },{  1004,   4110 },{  1005,   4110 },{  1006,   5700 },{  1010,   3620 },
	{  1011,   3620 },{  1012,   5700 },{  1013,   5800 },{  1014,   3900 },{  1015,   3900 },
	{  1016,   3200 },{  1017,   3200 },{  1018,   3900 },{  1019,   3900 },{  1020,   5140 },
	{  1021,   5140 },{  1022,   5140 },{  1023,   5140 },{  1024,   5140 },{  1025,   5140 },
	{  1026,   5140 },{  1027,   5140 },{  1028,   5140 },{  1029,   5140 },{  1030,   5140 },
	{  1031,   5140 },{  1032,   5140 },{  1033,   5140 },{  1034,   5140 },{  1035,   5140 },
	{  1036,   5140 },{  1037,   5140 },{  1038,   5140 },{  1039,   5140 },{  1040,   5140 },
	{  1041,   5140 },{  1042,   5900 },{  1043,   5900 },{  1044,   5900 },{  1045,   5900 },
	{  1046,   5900 },{  1047,   5900 },{  1048,   5900 },{  1049,   5900 },{  1050,   5900 },
	{  1051,   5900 },{  1052,   5900 },{  1053,   5900 },{  1054,   5900 },{  1055,   5900 },
	{  1056,   5900 },{  1057,   5900 },{  1058,   5900 },{  1059,   5900 },{  1060,   5900 },
	{  1061,   5900 },{  1062,   5900 },{  1063,   5900 },{  1064,   5900 },{  1065,   5900 },
	{  1066,   5900 },{  1067,   5900 },{  1068,   5900 },{  1069,   5900 },{  1070,   3900 },
	{  1071,   3900 },{  1072,   3900 },{  1073,   3900 },{  1074,   3900 },{  1075,   3900 },
	{  1076,   3200 },{  1077,   3200 },{  1078,   3200 },{  1079,   3200 },{  1080,   3200 },
	{  1081,   3200 },{  1082,   3900 },{  1083,   3900 },{  1084,   3900 },{  1085,   3900 },
	{  1086,   3900 },{  1087,   3900 },{  1088,   5700 },{  1089,   5700 },{  1090,   9100 },
	{  1091,   9100 },{  1092,   9100 },{  1093,   9100 },{  1094,   9100 },{  1100,   2400 },
	{  1101,   3200 },{  1102,   4200 },{  1103,   4500 },{  1104,   4900 },{  1105,   3600 },
	{  1106,   4700 },{  1107,   3000 },{  1108,   3700 },{  1109,   2800 },{  1110,  24900 },
	{  1111,  24900 },{  1112,  24900 },{  1113,   4000 },{  1114,  23100 },{  1115,  23100 },
	{  1116,  23100 },{  1117,  23100 },{  1118,  23100 },{  1119,  23100 },{  1120,  23100 },
	{  1121,  23100 },{  1122,   4000 },{  1123,  23700 },{  1124,  24100 },{  1125,  24100 },
	{  1126,  23100 },{  1127,  23100 },{  1128,  23100 },{  1129,  23100 },{  1130,  24100 },
	{  1131,  24100 },{  1132,  24100 },{  1133,  24100 },{  1134,  60000 },{  1135,  60000 },
	{  1136,  24100 },{  1137,  24100 },{  1138,  24100 },{  1139,  24100 },{  1140,  60000 },
	{  1141,  60000 },{  1142,   2500 },{  1144,  60000 },{  1145,  24100 },{  1146,  24100 },
	{  1147,  24100 },{  1148,  24100 },{  1149,  60000 },{  1150,  60000 },{  1151,  24100 },
	{  1152,  23900 },{  1153,   1000 },{  1154,  24100 },{  1155,  24100 },{  1156,  24100 },
	{  1157,  24100 },{  1158,  24100 },{  1159,  24100 },{  1160,  24100 },{  1161,  24100 },
	{  1162,  24100 },{  1163,  24100 },{  1164,  57400 },{  1165,  62200 },{  1166,  57400 },
	{  1167,  49400 },{  1168,  57400 },{  1169,  57400 },{  1170,  57400 },{  1171,  57400 },
	{  1200,   6300 },{  1201,   6300 },{  1202,   8800 },{  1203,   8800 },{  1204,   6300 },
	{  1205,   6300 },{  1206,   8800 },{  1207,   8800 },{  1208,   6300 },{  1209,   6300 },
	{  1210,   8800 },{  1211,   8800 },{  1212,   6300 },{  1213,   6300 },{  1214,   8800 },
	{  1215,   8800 },{  1216,   6300 },{  1217,   6300 },{  1218,   8800 },{  1219,   8800 },
	{  1220,   6300 },{  1221,   6300 },{  1222,   8800 },{  1223,   8800 },{  1224,   6300 },
	{  1225,   6300 },{  1226,   8800 },{  1227,   8800 },{  1228,   5700 },{  1229,   5700 },
	{  1230,   5700 },{  1231,   5700 },{  1232,   5700 },{  1233,   5700 },{  1234,   5700 },
	{  1235,   5700 },{  1236,   5700 },{  1237,   5700 },{  1238,   5700 },{  1239,   5700 },
	{  1240,   5700 },{  1241,   5700 },{  1242,   5700 },{  1243,   5700 },{  1244,   5700 },
	{  1245,   5700 },{  1246,   5700 },{  1247,   5700 },{  1248,  15900 },{  1249,  15900 },
	{  1250,   7600 },{  1251,   7600 },{  1252,   7600 },{  1253,   7600 },{  1254,   7600 },
	{  1255,   7600 },{  1256,   7600 },{  1257,   7600 },{  1258,   7600 },{  1259,   7600 },
	{  1260,   7600 },{  1261,   7600 },{  1262,   7600 },{  1263,   7600 },{  1264,   7600 },
	{  1265,   7600 },{  1266,   7600 },{  1267,   7600 },{  1268,   7600 },{  1269,   7600 },
	{  1270,   7600 },{  1271,   5700 },{  1272,   5700 },{  1273,   8300 },{  1274,   8300 },
	{  1275,   4600 },{  1276,   4600 },{  1277,   5900 },{  1278,   5900 },{  1279,   7600 },
	{  1280,   7600 },{  1281,   7200 },{  1282,   7200 },{  1283,   7300 },{  1284,   7300 },
	{  1285,   7300 },{  1286,   7300 },{  1288,   5900 },{  1289,   5900 },{  1290,   5900 },
	{  1291,   5900 },{  1292,   5900 },{  1293,   5900 },{  1294,   5900 },{  1295,   5900 },
	{  1296,   5900 },{  1297,   5900 },{  1298,   5900 },{  1299,   5900 },{  1300,  13900 },
	{  1301,  24200 },{  1302,  24200 },{  1303,  51700 },{  1304,  16200 },{  1305,  63400 },
	{  1306,  32000 },{  1307,   8000 },{  1308,  32000 },{  1309,  31600 },{  1310,  31600 },
	{  1311,  25400 },{  1312,  25400 },{  1313,  30200 },{  1314,  30200 },{  1315,  30200 },
	{  1316,  34300 },{  1317,  34300 },{  1318,  34300 },{  1319,  34300 },{  1320,  34300 },
	{  1321,  34600 },{  1322,  30200 },{  1323,  30800 },{  1324,  30500 },{  1325,  31000 },
	{  1400,  22800 },{  1401,  24000 },{  1402,  26400 },{  1403,  23000 },{  1404,  25100 },
	{  1405,  23400 },{  1406,  26600 },{  1407,  23500 },{  1408,  26100 },{  1409,  22800 },
	{  1410,  24000 },{  1411,  26400 },{  1412,  23000 },{  1413,  25100 },{  1415,  26600 },
	{  1416,  23400 },{  1417,   7200 },{  1418,   7200 },{  1420,  74500 },{  1421,  73400 },
	{  1422,  71700 },{  1423,  74200 },{  1424,  39300 },{  1425,  39300 },{  1426,  88100 },
	{  1427,  88100 },{  1428,  51600 },{  1429,  51600 },{  1430,  19500 },{  1431,  19500 },
	{  1432,  11200 },{  1433,  11200 },{  1475,  36400 },{  1476,  36400 },{  1477,  36400 },
	{  1478,  36400 },{  1479,  36400 },{  1480,  37600 },{  1481,  36400 },{  1485,  16600 },
	{  1486,  30000 },{  1487, 174100 },{  1488,  45900 },{  1489,  16500 },{  1491,   1200 },
	{  1492,  17000 },{  1493,  21000 },{  1495,  29200 },{  1496,  45900 },{  1497,  29200 },
	{  1498,  75500 },{  1499,  36400 },{  1500,   3900 },{  1501,   3900 },{  1502,   3900 },
	{  1503,   3900 },{  1504,   3900 },{  1505,   3900 },{  1506,   3900 },{  1507,   3900 },
	{  1508,   3900 },{  1509,   3900 },{  1510,   3900 },{  1511,   3900 },{  1512,   3200 },
	{  1513,   3200 },{  1514,   3200 },{  1515,   3200 },{  1516,   3200 },{  1517,   3200 },
	{  1518,   3200 },{  1519,   3200 },{  1520,   3200 },{  1521,   3200 },{  1522,   3200 },
	{  1523,   3200 },{  1534,   5700 },{  1535,   5700 },{  1536,   5700 },{  1537,   5700 },
	{  1538,   5700 },{  1539,   5700 },{  1540,   5700 },{  1541,   5700 },{  1542,   5700 },
	{  1543,   5700 },{  1544,   5700 },{  1545,   5700 },{  1546,   9500 },{  1547,   9500 },
	{  1548,  10000 },{  1549,  10000 },{  1550,  10800 },{  1551,  10800 },{  1552,  12300 },
	{  1553,  12300 },{  1554,  13400 },{  1555,  13400 },{  1556,  14900 },{  1557,  14900 },
	{  1582,   7600 },{  1583,   7600 },{  1584,   7600 },{  1585,   5700 },{  1586,   5700 },
	{  1587,   5700 },{  1588,   5700 },{  1589,   5600 },{  1590,   5600 },{  1591,   5700 },
	{  1592,   5700 },{  1593,   5700 },{  1594,   5700 },{  1595,   5700 },{  1596,   5700 },
	{  1597,   5700 },{  1598,   5700 },{  1599,   5700 },{  1600,  14600 },{  1601,   4100 },
	{  1602,   3800 },{  1603,   3300 },{  1604,   3200 },{  1605,   7800 },{  1606,   5300 },
	{  1607,   5300 },{  1608,   5300 },{  1700,   5600 },{  1701,   5600 },{  1702,   5600 },
	{  1703,   5600 },{  1704,   5600 },{  1705,   5600 },{  1706,   5600 },{  1707,   5600 },
	{  1708,   5600 },{  1709,   5600 },{  1710,  11600 },{  1711,  11600 },{  1712,  11600 },
	{  1713,  11600 },{  1714,  11600 },{  1715,  11600 },{  1716,  11600 },{  1717,  11600 },
	{  1718,  11600 },{  1719,  11600 },{  1732,   5700 },{  1733,   5700 },{  1734,   5700 },
	{  1735,   5700 },{  1736,   5700 },{  1737,   5700 },{  1738,   5700 },{  1739,   5700 },
	{  1741, 213760 },{  1750, 213760 },{  1751, 213760 },{  1761, 213760 },{  1763, 213760 },
	{  1765, 213760 },{  1771, 213760 },{  1773, 213760 },{  1775, 213760 },{  1796,  43500 },
	{  1797,  41200 },{  1798,  43500 },{  1799,  41200 },{  1800,   7700 },{  1801,   6600 },
	{  1802,   7700 },{  1803,   6900 },{  1804,  12300 },{  1805,  13000 },{  1806,   1900 },
	{  1808,  15300 },{  1809,  15300 },{  1811,  51200 },{  1812,   1900 },{  1813,   1900 },
	{  1814,  15300 },{  1815,  15300 },{  1816,  33000 },{  1850,  18200 },{  1851,   9300 },
	{  1852,  17600 },{  1860,  19800 },{  1861,  26700 },{  1862,  53500 },{  1900,  12500 },
	{  1901,  12500 },{  1902,  12500 },{  1910,  45000 },{  1911,  45000 },{  1912,  45000 },
	{  2000,  15400 },{  2002,  18000 },{  2003,  16200 },{  2004,  15400 },{  2005,   8300 },
	{  2006,   8500 },{  2007,   7900 },{  2008,  21800 },{  2009,  15700 },{  2010,  13600 },
	{  2011,  13600 },{  2012,  13600 },{  2013,  20100 },{  2014,  11600 },{  2015,  23100 },
	{  2016,  18800 },{  2017,  18100 },{  2018,  10100 },{  2019,   9500 },{  2020,   8000 },
	{  2021,  17500 },{  2022,  15900 },{  2023,  13300 },{  2024,  17100 },{  2025,  27000 },
	{  2026,  16800 },{  2027,  12700 },{  2028,  14000 },{  2029,  19400 },{  2030,  15900 },
	{  2031,  28900 },{  2032,  16000 },{  2033,  14400 },{  2034,  12100 },{  2035,   8300 },
	{  2036,   8300 },{  2037,  15200 },{  2038,  11700 },{  2039,   8300 },{  2040,   8300 },
	{  2041,   8300 },{  2042,   8300 },{  2051,  26700 },{  2052,  26600 },{  2053,  21900 },
	{  2054,   6900 },{  2055,  19300 },{  2056,  19200 },{  2057,  15900 },{  2059,   3800 },
	{  2060,   8800 },{  2061,   9400 },{  2062,  18700 },{  2063,  13600 },{  2064,  11800 },
	{  2065,  12000 },{  2066,  11700 },{  2067,  22500 },{  2068,  21300 },{  2069,  13400 },
	{  2070,  19900 },{  2071,  16600 },{  2072,  20600 },{  2073,  19000 },{  2074,  22500 },
	{  2075,   4800 },{  2076,  13300 },{  2077,  19000 },{  2078,  24400 },{  2079,  22900 },
	{  2080,  22600 },{  2081,  25500 },{  2082,  25500 },{  2083,  27400 },{  2084,  29500 },
	{  2085,  22800 },{  2086,  13900 },{  2087,  17200 },{  2088,  17800 },{  2089,  16900 },
	{  2090,  27400 },{  2091,  29500 },{  2092,  22800 },{  2093,  23500 },{  2094,  13900 },
	{  2095,  17200 },{  2096,  17800 },{  2097,  16900 },{  2098,  22600 },{  2099,  22600 },
	{  2100,  20900 },{  2101,  20900 },{  2102,  41400 },{  2104,  25000 },{  2106,  20200 },
	{  2107,  40400 },{  2108,  44900 },{  2109,  37600 },{  2110,  37600 },{  2111,  37600 },
	{  2112,  37600 },{  2113,  37600 },{  2114,  41200 },{  2115,  41200 },{  2116,  41200 },
	{  2117,  41200 },{  2118,  41200 },{  2119,  40800 },{  2120,  40800 },{  2121,  40800 },
	{  2122,  40800 },{  2123,  40800 },{  2124,  39600 },{  2125,  39200 },{  2126,  37300 },
	{  2127,  35900 },{  2128,  35900 },{  2129,  35900 },{  2130,  35900 },{  2131,  35900 },
	{  2132,  38100 },{  2133,  38100 },{  2134,  38100 },{  2135,  38100 },{  2136,  38100 },
	{  2137,  38500 },{  2138,  38500 },{  2139,  38500 },{  2140,  38500 },{  2141,  38500 },
	{  2142,  47600 },{  2143,  47800 },{  2144,  46400 },{  2145,  47200 },{  2146,  23000 },
	{  2147,  21800 },{  2148,  22500 },{  2149,  22000 },{  2150,  23000 },{  2151,  21800 },
	{  2152,  22500 },{  2153,  22000 },{  2162,  48400 },{  2163,  49800 },{  2164,  49400 },
	{  2165,  49200 },{  2166,  48400 },{  2167,  49800 },{  2168,  49400 },{  2169,  49200 },
	{  2170,  23400 },{  2171,  42900 },{  2172,  32900 },{  2173,  43700 },{  2174,  43500 },
	{  2175,  32900 },{  2176,  43700 },{  2200,  12100 },{  2300,   5500 },{  2301,   8600 },
	{  2302,  12700 },{  2303,  18100 },{  2304,   4800 },{  2305,   4600 },{  2306,  18800 },
	{  2307,  21800 },{  2308,   8000 },{  2351,  78800 },{  2352,  68600 },{  2353,  54100 },
	{  2354,  76000 },{  2355,  68300 },{  2356,  86800 },{  2357,  85200 },{  2358,  57200 },
	{  2359,  60400 },{  2360, 129400 },{  2361,  68900 },{  2362,  72300 },{  2363,  72200 },
	{  2364,  58600 },{  2365,  58900 },{  2366,  16900 },{  2367,  14100 },{  2368,  11500 },
	{  2369,  15300 },{  2370,  14600 },{  2371,  18600 },{  2372,  14100 },{  2373,  11600 },
	{  2374,  13000 },{  2375,  26800 },{  2376,  14200 },{  2377,  14600 },{  2378,  14600 },
	{  2379,  12300 },{  2380,  12300 },{  2381,  67700 },{  2382,  59000 },{  2383,  46800 },
	{  2384,  64800 },{  2385,  58700 },{  2386,  74200 },{  2387,  73100 },{  2388,  49500 },
	{  2389,  52900 },{  2390, 111200 },{  2391,  59200 },{  2392,  66700 },{  2393,  62700 },
	{  2394,  50800 },{  2395,  51000 },{  2401,  60000 },{  2402,  60000 },{  2408,  50000 },
	{  2409,  50000 },{  2411,  50000 },{  2412,  50000 },{  2413,  50000 },{  2414,  50000 },
	{  2415,  50000 },{  2416,  50000 },{  2417,  50000 },{  2418,  50000 },{  2419,  50000 },
	{  2420,  50000 },{  2421,  50000 },{  2422,  50000 },{  2423,  50000 },{  2424,  50000 },
	{  2425,  50000 },{  2426,  50000 },{  2427,  50000 },{  2442,  90500 },{  2443, 243500 },
	{  2444, 243500 },{  2445, 243500 },{  2446, 243500 },{  2447, 243500 },{  2450,  50000 },
	{  2451,  24300 },{  2452,  24300 },{  2453,  24300 },{  2463,  90500 },{  2464,  90500 },
	{  2465,  90500 },{  2466,  90500 },{  2471,  90500 },{  2481,  90500 },{  2482,  90500 },
	{  2483,  90500 },{  2484,  90500 },{  2485,  90500 },{  2486,  50000 },{  2490,  50000 },
	{  2491,  50000 },{  2492,  90500 },{  2493,  90500 },{  2494,  90500 },{  2495,  90500 },
	{  2496,  90500 },{  2497,  90500 },{  2498,  90500 },{  2499,  90500 },{  2500,  20800 },
	{  2504,  19500 },{  2505,  20000 },{  2506,  24100 },{  2507,  21500 },{  2509,  21500 },
	{  2510,  24100 },{  2511,  13600 },{  2512,  13600 },{  2526,  18600 },{  2527,  18600 },
	{  2534,  22100 },{  2542,  20600 },{  2543,  22300 },{  2549,  30200 },{  2550,  35000 },
	{  2552,  30200 },{  2553,  35000 },{  2554,  33000 },{  2555,  35000 },{  2556,  33000 },
	{  2557,  33000 },{  2558,  41200 },{  2559,  27500 },{  2560,  30800 },{  2561,  27000 },
	{  2562,  40100 },{  2563,  25000 },{  2564,  29000 },{  2565,  21000 },{  2566,  29300 },
	{  2567,   6000 },{  2568,   6000 },{  2569,  30000 },{  2570,  34000 },{  2571,  31000 },
	{  2572,  32000 },{  2573,  31000 },{  2574,  24000 },{  2575,  24000 },{  2576,  24000 },
	{  2577,  21000 },{  2578,  30000 },{  2579,  26000 },{  2580,  28000 },{  2581,  26000 },
	{  2582,  20000 },{  2583,  29300 },{  2584,  21000 },{  2585,  21700 },{  2586,  13300 },
	{  2587,  13500 },{  2588,  13500 },{  2589,  13400 },{  2590,  29300 },{  2591,  30800 },
	{  2592,  17600 },{  2593,  19800 },{  2602,    500 },{  2603,    500 },{  2604, 176000 },
	{  2605, 176000 },{  2606,  29200 },{  2607,  33800 },{  2608, 138500 },{  2609, 152300 },
	{  2610, 152300 },{  2611,  68200 },{  2612,  29200 },{  2613,  75500 },{  2614,  28700 },
	{  2615,  66400 },{  2616, 152300 },{  2618, 135000 },{  2619, 162000 },{  2620,  29200 },
	{  2621,  29200 },{  2630,  46200 },{  2631,  46200 },{  2632, 162600 },{  2633,  23500 },
	{  2651, 176000 },{  2652, 114800 },{  2653, 176000 },{  2660,    100 },{  2661,    100 },
	{  2662, 192000 },{  2663,    100 },{  2665, 192000 },{  2666, 192000 },{  2668, 192000 },
	{  2669, 192000 },{  2670, 192000 },{  2671, 192000 },{  2672, 192000 },{  2673, 384000 },
	{  2674, 192000 },{  2675, 192000 },{  2676, 192000 },{  2677, 192000 },{  2680,   1900 },
	{  2681,2540300 },{  2682, 895500 },{  2683,2540300 },{  2684, 895500 },{  2685, 895500 },
	{  2686, 895500 },{  2689,1193600 },{  2690,1125100 },{  2692, 895500 },{  2711,  33000 },
	{  2715,    100 },{  2717,    100 },{  2718,    100 },{  2721,  33000 },{  2722,  22000 },
	{  2723,  33000 },{  2725,  33000 },{  2728,  22000 },{  2730,  33000 },{  2731,  33000 },
	{  2732,  33000 },{  2733,  33000 },{  2734,  33000 },{  2735,  33000 },{  2736,  33000 },
	{  2737,  33000 },{  2738,  33000 },{  2739,  33000 },{  2740,  33000 },{  2741,  33000 },
	{  2742,  33000 },{  2743,  33000 },{  2744,  33000 },{  2745,  33000 },{  2746,  33000 },
	{  2747,  33000 },{  2748,  33000 },{  2755,      0 },{  2756,      0 },{  2757,      0 },
	{  2758,      0 },{  2759,      0 },{  2760,      0 },{  2761,      0 },{  2762,      0 },
	{  2763,      0 },{  2764,      0 },{  2765,      0 },{  2766,      0 },{  2767,      0 },
	{  2768,      0 },{  2769,      0 },{  2770,      0 },{  2771,      0 },{  2772,      0 },
	{  2774,      0 },{  2775,      0 },{  2776,      0 },{  2777,      0 },{  2778,      0 },
	{  2779,      0 },{  2780,      0 },{  2781,      0 },{  2782,      0 },{  2783,      0 },
	{  2784,      0 },{  2785,      0 },{  2786,      0 },{  2787,      0 },{  2788,      0 },
	{  2791,  10000 },{  2792,  10000 },{  2793,  10000 },{  2794,   3000 },{  2795,   3000 },
	{  2796,   3000 },{  2798,   9700 },{  2799,   9700 },{  2800,  21400 },{  2801,  21400 },
	{  2903,  13200 },{  2904,  13200 },{  2905,  33300 },{  2906,  13200 },{  2907,  13200 },
	{  2908,   3300 },{  2910,  55800 },{  2911,  54600 },{  2912,  55600 },{  2913,  55800 },
	{  2914,  54600 },{  2915,  55600 },{  2920,   4400 },{  2921,   4400 },{  2928,  33000 },
	{  2929,  33000 },{  2930,  12200 },{  2932,  12200 },{  2933,  12200 },{  2934,  12200 },
	{  2935,  12200 },{  2951,   4400 },{  2952,   4400 },{  2960,  13200 },{  2961,  13200 },
	{  2962,  13200 },{  2963,  13200 },{  2964,  13200 },{  2965,  13200 },{  2966,  13200 },
	{  2967,  13200 },{  2968,   8070 },{  2969,   8070 },{  2970,  29250 },{  2971,  29250 },
	{  2972,   8070 },{  2973,   8070 },{  3000,   8000 },{  3001,    100 },{  3002,  11700 },
	{  3003,    100 },{  3006,  58700 },{  3007,  58700 },{  3008,  58700 },{  3009,  58700 },
	{  3015,    100 },{  3016,  58700 },{  3017,   5900 },{  3020,  58700 },{  3022,  65800 },
	{  3023,  58700 },{  3024,  65200 },{  3025,  58700 },{  3026,  69100 },{  3027,  71600 },
	{  3028, 144000 },{  3029, 144000 },{  3030,  18600 },{  3032, 144000 },{  3033, 144000 },
	{  3034, 144000 },{  3035, 144000 },{  3036, 144000 },{  3037, 144000 },{  3038,  18600 },
	{  3039,  18600 },{  3040,  18600 },{  3041,  18600 },{  3042,  18600 },{  3043, 146100 },
	{  3044,  21800 },{  3045,  31400 },{  3046,  23600 },{  3047,  21800 },{  3048,  31400 },
	{  3049,  23600 },{  3050, 144000 },{  3051, 144000 },{  3052, 144000 },{  3059, 116700 },
	{  3060, 253900 },{  3061, 132900 },{  3062, 173200 },{  3063, 183700 },{  3064, 175300 },
	{  3065, 214400 },{  3123,  28700 },{  3124,  28700 },{  3125,  28700 },{  3126,  28700 },
	{  3127,  28700 },{  3128,  28700 },{  3129,  28700 },{  3130,  28700 },{  3147,  28700 },
	{  3148,  28700 },{  3149,  28700 },{  3150,  28700 },{  3151,  28700 },{  3152,  28700 },
	{  3153,  28700 },{  3154,  28700 },{  3155,  28700 },{  3156,  28700 },{  3157,  28700 },
	{  3158,  28700 },{  3159,  28700 },{  3160,  28700 },{  3161,  28700 },{  3171,  28700 },
	{  3172,  28700 },{  3173,  28700 },{  3174,  28700 },{  3175,  28700 },{  3176,  28700 },
	{  3177,  28700 },{  3178,  28700 },{  3179,  28700 },{  3180,  28700 },{  3181,  28700 },
	{  3182,  28700 },{  3189,  28700 },{  3190,  28700 },{  3191,  21100 },{  3192,  28900 },
	{  3193,  27000 },{  3194,  27500 },{  3195,  25000 },{  3196,  28900 },{  3197,  27000 },
	{  3198,  27500 },{  3199,  28700 },{  3300,   4800 },{  3301,   4700 },{  3302,   9400 },
	{  3303,   5700 },{  3304,   3400 },{  3305,   9100 },{  3306,  13700 },{  3402,  20600 },
	{  3403,  20600 },{  3404,  20600 },{  3405,  20600 },{  3406,  20600 },{  3407,  20600 },
	{  3408,  38800 },{  3409,  35000 },{  3410,  38300 },{  3411,  28700 },{  3412,  34000 },
	{  3413,  28700 },{  3422,  38300 },{  3423,  38500 },{  3424,  38500 },{  3425,  38500 },
	{  3426,  38500 },{  3430,   4100 },{  3431,   4400 },{  3432,   4700 },{  3433,   5000 },
	{  3434,   5200 },{  3435,   5300 },{  3436,   4300 },{  3437,   4300 },{  3438,   4600 },
	{  3439,   5000 },{  3440,   5200 },{  3441,   5500 },{  3445,  25100 },{  3446,  25500 },
	{  3447,  24400 },{  3448,  24700 },{  3449,  25500 },{  3450,  25700 },{  3451,  25100 },
	{  3452,  25100 },{  3453,  25100 },{  3454,  25100 },{  3455,  24400 },{  3456,  24700 },
	{  3457,  25500 },{  3458,  25700 },{  3459,  25100 },{  3460,  25100 },{  3461,  25100 },
	{  3462,  25100 },{  3463,  25100 },{  3464,  25100 },{  3465,  25100 },{  3466,  25100 },
	{  3467,  25100 },{  3468,  25100 },{  3469,  45000 },{  3470,  44500 },{  3500,  18800 },
	{  3501,  18800 },{  3502,  18300 },{  3503,  18300 },{  3600,  13200 },{  3603,  34300 },
	{  3604,  34300 },{  3607,  34300 },{  3608,  34300 },{  3611,  34300 },{  3612,  34300 },
	{  3615,  34300 },{  3616,  34300 },{  3619,  34300 },{  3620,  34300 },{  3623,  34300 },
	{  3624,  34300 },{  3627,  34300 },{  3628,  34300 },{  3631,  34300 },{  3632,  34300 },
	{  3635,  34300 },{  3636,  34300 },{  3639,  34300 },{  3640,  34300 },{  3641,  34300 },
	{  3643,  34300 },{  3644,  34300 },{  3645,  34300 },{  3646,  34300 },{  3647,  34300 },
	{  3648,  34300 },{  3649,  34300 },{  3650,  34300 },{  3651,  34300 },{  3652,  34300 },
	{  3653,  34300 },{  3654,  34300 },{  3655,  34300 },{  3656,  34300 },{  3657,  34300 },
	{  3658,  34300 },{  3659,  34300 },{  3660,  34300 },{  3661,  34300 },{  3662,  34300 },
	{  3663,  34300 },{  3664,  34300 },{  3665,  34300 },{  3666,  34300 },{  3667,  34300 },
	{  3668,  34300 },{  3669,  34300 },{  3670,  34300 },{  3671,  34300 },{  3672,  34300 },
	{  3673,  34300 },{  3674,  34300 },{  3675,  34300 },{  3676,  34300 },{  3677,  34300 },
	{  3678,  34300 },{  3679,  34300 },{  3680,  34300 },{  3681,  34300 },{  3682,  34300 },
	{  3683,  34300 },{  3684,  34300 },{  3685,  34300 },{  3686,  34300 },{  3687,  34300 },
	{  3688,  34300 },{  3689,  34300 },{  3690,  34300 },{  3691,  34300 },{  3692,  34300 },
	{  3693,  34300 },{  3694,  34300 },{  3695,  34300 },{  3696,  34300 },{  3697,  34300 },
	{  3698,  34300 },{  3699,  34300 },{  3700,  34300 },{  3701,  34300 },{  3702,  34300 },
	{  3703,  34300 },{  3704,  34300 },{  3705,  34300 },{  3706,  34300 },{  3707,  34300 },
	{  3708,  34300 },{  3709,  34300 },{  3710,  34300 },{  3711,  34300 },{  3712,  34300 },
	{  3713,  47400 },{  3717,  49300 },{  3721,  49100 },{  3725,  48700 },{  3729,  34300 },
	{  3730,  34300 },{  3731,  34300 },{  3732,  34300 },{  3733,  34300 },{  3734,  34300 },
	{  3735,  34300 },{  3736,  34300 },{  3737,  34300 },{  3738,  34300 },{  3739,  34300 },
	{  3740,  34300 },{  3741,  20500 },{  3742,  20500 },{  3745,  20400 },{  3746,  20400 },
	{  3749,  16500 },{  3750,  16500 },{  3753,  47300 },{  3754,  47300 },{  3757,  33400 },
	{  3758,  33400 },{  3761,  44800 },{  3762,  44800 },{  3765,  44600 },{  3766,  44600 },
	{  3770,  18600 },{  3771,  17300 },{  3798,  25000 },{  3850,  34300 },{  3851,  44300 },
	{  3852,  34300 },{  3853,  44300 },{  3855,  45000 },{  3856,  40100 },{  3858,  45000 },
	{  3859,  40100 },{  3860,  74200 },{  3861,  63800 },{  3863,  60400 },{  3864,  62300 },
	{  3900,    500 },{  3903,  33800 },{  3905,  33800 },{  3906,  31000 },{  3907,  31000 },
	{  3908,  33800 },{  3951, 192000 },{  3952, 192000 },{  4000,  25000 },{  4001,  28900 },
	{  4002,  27000 },{  4003,  27500 },{  4004,  25000 },{  4005,  28900 },{  4006,  27000 },
	{  4007,  27500 },{  4008,  25000 },{  4009,  27500 },{  4010,  29500 },{  4011,  29500 },
	{  4012,  21100 },{  4013,  25000 },{  4014,  25000 },{  4015,  25000 },{  4016,  25000 },
	{  4017,  25000 },{  4018,  25000 },{  4019,  25000 },{  4020,  25000 },{  4021,  25000 },
	{  4022,  28700 },{  4023,  25000 },{  4024, 150000 },{  4025, 150000 },{  4026,  25000 },
	{  4027,  25000 },{  4028,  25000 },{  4029,  25000 },{  4030,  25000 },{  4031,  25000 },
	{  4032,  21100 },{  4033,  21100 },{  4034,  21100 },{  4035,  21100 },{  4036,  21100 },
	{  4037,  21100 },{  4038,      0 },{  4039,      0 },{  4040,      0 },{  4041,      0 },
	{  4042,      0 },{  4043,  12500 },{  4044, 125000 },{  4045, 125000 },{  4046,  25000 },
	{  4047,  25000 },{  4100,  17600 },{  4101,  21700 },{  4102,  21500 },{  4103,  16400 },
	{  4104,  21300 },{  4105,  17600 },{  4107,  21500 },{  4108,  16400 },{  4109,  21300 },
	{  4110,  16800 },{  4111,  16800 },{  4112,  30300 },{  4113,  18800 },{  4114,  10700 },
	{  4115,  17600 },{  4116,  21700 },{  4117,  21500 },{  4118,  16400 },{  4119,  21300 },
	{  4120,  16800 },{  4121,   1000 },{  4122,   1000 },{  4400,   1500 },{  4401,   1500 },
	{  4402,   1500 },{  4403,   1500 },{  4404,   1500 },{  4405,   1500 },{  4406,   1500 },
	{  4407,   1500 },{  4408,   1500 },{  4409,   1500 },{  4410,   1500 },{  4411,   1500 },
	{  4412,   1500 },{  4413,   1500 },{  4414,   1500 },{  4415,   1500 },{  4416,   1500 },
	{  4417,   1500 },{  4418,   1500 },{  4419,   1500 },{  4420,   1500 },{  4421,   1500 },
	{  4422,   1500 },{  4423,   1500 },{  4424,   1500 },{  4425,   1500 },{  4426,   1500 },
	{  4427,   1500 },{  4432,  22500 },{  4433,  89300 },{  4434,  22500 },{  4435,  22500 },
	{  4436,  22500 },{  4437,  22500 },{  4438,  22500 },{  4439,  22500 },{  4440,  22500 },
	{  4441,  22500 },{  4442,  22500 },{  4443,  22500 },{  4444,  22500 },{  4445,  22500 },
	{  4446,  22500 },{  4447,  22500 },{  4448,  22500 },{  4449,  22500 },{  4450,  22500 },
	{  4451,  22500 },{  4452,  22500 },{  4453,  22500 },{  4454,  22500 },{  4455,  22500 },
	{  4456,  22500 },{  4457,  22500 },{  4458,  22500 },{  4459,  22500 },{  4460,  22500 },
	{  4461,  22500 },{  4462,  22500 },{  4463,  22500 },{  4510,   1000 },{  4511,    450 },
	{  4513,    450 },{  4514,   1000 },{  4515,    720 },{  4519,   7050 },{  4520,  17895 },
	{  4521,  12705 },{  4522,   7050 },{  4523,  12705 },{  4524,  17895 },{  4525,   7050 },
	{  4526,  12705 },{  4527,  17895 },{  4528,  12705 },{  4529,   7050 },{  4530,  17895 },
	{  4531,  12705 },{  4532,   7050 },{  4533,  17895 },{  4534,   8470 },{  4535,  11930 },
	{  4536,   4700 },{  4537,  11930 },{  4538,   4700 },{  4539,   8470 },{  4540,   8470 },
	{  4541,   4700 },{  4542,  11930 },{  4543,   8470 },{  4544,   4700 },{  4545,  11930 },
	{  4546,   8470 },{  4547,   4700 },{  4548,  11930 },{  4549,  11930 },{  4550,   4700 },
	{  4551,   8470 },{  4552,  11930 },{  4553,   4700 },{  4554,   8470 },{  4555,   4700 },
	{  4556,  11930 },{  4557,   8470 },{  4558,   8470 },{  4559,   4700 },{  4560,  11930 },
	{  4561,  11930 },{  4562,   4700 },{  4563,   8470 },{  4564,  11930 },{  4565,   4700 },
	{  4566,   8470 },{  4567,   8470 },{  4568,  11930 },{  4569,   4700 },{  4570,   4700 },
	{  4571,   4700 },{  4572,  11930 },{  4573,  11930 },{  4574,   8470 },{  4575,   8470 },
	{  4576,  11930 },{  4577,   4700 },{  4578,   8470 },{  4579,   8470 },{  4580,  11930 },
	{  4581,   4700 },{  4582,   4700 },{  4583,  11930 },{  4584,   8470 },{  4585,   4700 },
	{  4586,  11930 },{  4587,   8470 },{  4588,   4700 },{  4589,   8470 },{  4590,  11930 },
	{  4591,  11930 },{  4592,   8470 },{  4593,   4700 },{  4594,  11930 },{  4595,   4700 },
	{  4596,   8470 },{  4597,   4700 },{  4598,   8470 },{  4599,  11930 },{  4600,  11930 },
	{  4601,   8470 },{  4602,   4700 },{  4603,  11930 },{  4604,   8470 },{  4605,   4700 },
	{  4606,   4700 },{  4607,   8470 },{  4608,  11930 },{  4609,   4700 },{  4610,   4700 },
	{  4611,   4700 },{  4612,  11930 },{  4613,   4700 },{  4614,   8470 },{  4615,  11930 },
	{  4616,   8470 },{  4617,  11930 },{  4618,   8470 },{  4619,  11930 },{  4620,   8470 },
	{  4621,   4700 },{  4622,  11930 },{  4623,   8470 },{  4624,   8470 },{  4625,   4700 },
	{  4626,  11930 },{  4700,   9700 },{  4701,   9700 },{  4707,   9800 },{  4708,  18200 },
	{  4709,  18200 },{  4710,  18200 },{  4711,  50400 },{  4712,  59200 },{  4713,  59300 },
	{  4715,  12200 },{  4716, 182000 },{  4717, 182000 },{  4719, 182000 },{  4720,  30000 },
	{  4721,  30000 },{  4722,  30000 },{  4724,  17700 },{  4725,  18200 },{  4726,  19200 },
	{  4727,  19200 },{  4728,  19200 },{  4729,  22400 },{  4730,  11100 },{  4731,  19300 },
	{  4732,  19300 },{  4733,  23400 },{  4734,  46800 },{  4735,  23400 },{  4736,  23400 },
	{  4737,  23400 },{  4738,  23400 },{  4739,  23400 },{  4740,  23400 },{  4741,  23400 },
	{  4742,  54800 },{  4743,  54800 },{  4744,  54800 },{  4745,  54800 },{  4746,  54800 },
	{  4747,  54800 },{  4748,  19300 },{  4749,  54800 },{  4750,  54800 },{  4751,  47700 },
	{  4752,  47700 },{  4753,  47700 },{  4754,  47700 },{  4755,  47700 },{  4756,  47700 },
	{  4800,     10 },{  4900,  31000 },{  5000,   9800 },{  5001,   9800 },{  5002,   9800 },
	{  5003,  47900 },{  5004,  47900 },{  5005,  48000 },{  5006,  48000 },{  5007,  48000 },
	{  5008,  48000 },{  5009,  48000 },{  5010,  48000 },{  5011,  48000 },{  5012,  48000 },
	{  5013,  48000 },{  5014,  48000 },{  5015,  48000 },{  5016,  48000 },{  5017,  43000 },
	{  5018,  43000 },{  5019,  43000 },{  5020,  43000 },{  5021,  43000 },{  5022,  43000 },
	{  5101, 216500 },{  5102, 334000 },{  5104, 268000 },{  5107,    100 },{  5113,  74900 },
	{  5114,  74900 },{  5200,   9800 },{  5201,  12200 },{  5202,  11100 },{  5203,   9800 },
	{  5205,  47900 },{  5206,  22500 },{  5207,  22500 },{  5208,  22500 },{  5209,  22500 },
	{  5210,  22500 },{  5211,  22500 },{  5212,  22500 },{  5213,  22500 },{  5214,  47900 },
	{  5215,  48000 },{  5216,  48000 },{  5217,  48000 },{  5218,  48000 },{  5219,  48000 },
	{  5220,  48000 },{  5221,  48000 },{  5222,  48000 },{  5223,  77900 },{  5224,  77900 },
	{  5225,  77900 },{  5226,  77900 },{  5227,  48000 },{  5228,  48000 },{  5229,  48000 },
	{  5230,  48000 },{  5231,  48000 },{  5232,  48000 },{  5233,  43000 },{  5300,  24000 },
	{  5301,  24000 },{  5302,  24000 },{  5303,  24000 },{  5304,  45000 },{  5305,  33000 },
	{  5306,  24000 },{  5307,  24000 },{  5308,  33000 },{  5309,  33000 },{  5310,  11000 },
	{  5311,  33000 },{  5312,  45000 },{  5400,   2000 },{  5500,  48000 },{  5501,  48000 },
	{  5502,  48000 },{  5503,  48000 },{  5504,  48000 },{  5505,  48000 },{  5506,  48000 },
	{  5507,  48000 },{  5508,  43000 },{  5509,  43000 },{  5510,  43000 },{  5511,  43000 },
	{  5512,  43000 },{  5513,  43000 },{  5514,  43000 },{  5515,  43000 },{  5516,  43000 },
	{  5517,  43000 },{  5518,  43000 },{  5519,  43000 },{  5600,  38800 },{  5601,  38800 },
	{  5602,  38800 },{  5603,  38800 },{  5650,  38800 },{  5651,  38800 },{  5700,  51100 },
	{  5701,  51100 },{  5702,  51100 },{  5703,  51100 },{  5704,  51100 },{  5705,  51100 },
	{  5706,  51100 },{  5707,  51100 },{  5708,  38400 },{  5709,  38400 },{  5710,  38400 },
	{  5711,  38400 },{  5712,  38400 },{  5713,  38400 },{  5714,  38400 },{  5715,  38400 },
	{  5716,  51100 },{  5717,  51100 },{  5718,  51100 },{  5719,  51100 },{  5720,  51100 },
	{  5721,  51100 },{  5722,  51100 },{  5723,  51100 },{  5724,  38400 },{  5725,  38400 },
	{  5726,  38400 },{  5727,  38400 },{  5728,  38400 },{  5729,  38400 },{  5730,  38400 },
	{  5731,  38400 },{  5732,  51100 },{  5733,  51100 },{  5734,  51100 },{  5735,  51100 },
	{  5736,  51100 },{  5737,  51100 },{  5738,  51100 },{  5739,  51100 },{  5740,  38400 },
	{  5741,  38400 },{  5742,  38400 },{  5743,  38400 },{  5744,  38400 },{  5745,  38400 },
	{  5746,  38400 },{  5747,  38400 },{  5748,  51100 },{  5749,  51100 },{  5750,  51100 },
	{  5751,  51100 },{  5752,  51100 },{  5753,  51100 },{  5754,  51100 },{  5755,  51100 },
	{  5756,  51100 },{  5757,  38400 },{  5758,  38400 },{  5759,  38400 },{  5760,  38400 },
	{  5761,  38400 },{  5762,  38400 },{  5763,  38400 },{  5764,  38400 },{  5765,  35300 },
	{  5766,  35300 },{  5767,  35300 },{  5768,  35300 },{  5769,  35300 },{  5770,  35300 },
	{  5771,  35300 },{  5772,  35300 },{  5773,  76800 },{  5774,  76800 },{  5775,  76800 },
	{  5776,  76800 },{  5777,  76800 },{  5778,  76800 },{  5779,  76800 },{  5780,  76800 },
	{  5781,  78300 },{  5782,  78300 },{  5783,  78300 },{  5784,  78300 },{  5785,  78300 },
	{  5786,  78300 },{  5787,  78700 },{  5788,  78700 },{  5789,  78700 },{  5790,  78700 },
	{  5791,  78700 },{  5792,  78700 },{  5793,  78700 },{  5794,  78700 },{  5795,  78700 },
	{  5796,  78700 },{  5797,  78700 },{  5798,  78700 },{  5799,  37500 },{  5800,  48000 },
	{  5801,  48000 },{  5900,  47200 },{  5901, 188800 },{  5902, 188800 },{  5903, 188800 },
	{  5904, 188800 },{  5905, 188800 },{  5906,  47200 },{  5907, 188800 },{  5908, 188800 },
	{  5909, 188800 },{  5910,  47200 },{  5911, 188800 },{  5912, 188800 },{  5913, 188800 },
	{  5914, 188800 },{  5915, 188800 },{  6001,   1000 },{  6002,   1000 },{  6004,  10000 },
	{  6005, 192000 },{  6006,  10000 },{  6007,  10000 },{  6008,  10000 },{  6010,  10000 },
	{  6011,   4000 },{  6012,  47000 },{  6013,  38000 },{  6014,  48400 },{  6015,  48400 },
	{  6020,  46700 },{  6021,  47600 },{  6023,  47500 },{  6024,  47400 },{  6025,  48300 },
	{  6040, 139500 },{  6041, 139500 },{  6050,  48100 },{  6051,  48100 },{  6052,  48100 },
	{  6053,  48100 },{  6054,  48100 },{  6055,  48100 },{  6056,  48100 },{  6057,  48100 },
	{  6058,  48100 },{  6059,  48100 },{  6060,  48100 },{  6061,  48100 },{  6062,  48100 },
	{  6063,  48100 },{  6064,  48100 },{  6065,  48100 },{  6066,  48100 },{  6067,  48100 },
	{  6068,  48100 },{  6069,  48100 },{  6070,  48100 },{  6071,  48100 },{  6072,  48100 },
	{  6073,  48100 },{  6074,  48100 },{  6075,  48100 },{  6076,  48100 },{  6077,  48100 },
	{  6300,   4900 },{  6301,  33600 },{  6302,  33600 },{  6303,  33600 },{  6304,  33600 },
	{  6305,   4900 },{  6306,   5700 },{  6307,  33600 },{  6313,  33600 },{  6314,  33600 },
	{  6315,  33600 },{  6316,  33600 },{  6317,  33600 },{  6318,  33600 },{  6319,  10600 },
	{  6320,  10400 },{  6321,  10600 },{  6322,  10400 },{  6323,  10400 },{  6324,  10400 },
	{  6325,  10400 },{  6326,  10400 },{  6327,  33600 },{  6328,  10600 },{  6329,  10400 },
	{  6330,  10400 },{  6331,  10400 },{  6500,  23700 },{  6501,  12300 },{  6502,   5900 },
	{  6503,   7500 },{  6504,  11200 },{  6505,   7400 },{  6507,   9900 },{  6508,   7200 },
	{  6509,  19200 },{  6511,  12300 },{  6512,   5900 },{  6513,   7500 },{  6515,   7400 },
	{  6516,  11200 },{  6517,   9900 },{  6518,   7200 },{  6600,  45000 },{  6601,  45000 },
	{  6602,  45000 },{  6603,  45000 },{  6604,  45000 },{  6605,  45000 },{  6606,  45000 },
	{  6700,  51100 },{  6701,  92100 },{  6702,  92100 },{  9900,   5000 },{  9908,   2000 },
	{  9914,   2000 },{  9915,   1000 },{  9916,  24000 },{  9917,  24000 },{  9918,  24000 },
	{  9919,  24000 },{  9920,  24000 },{  9921,  24000 },{  9922,   2000 },{  9923,   2000 },
	{  9924,   2000 },{  9925,   2000 },{  9926,   2000 },{  9994,  10000 },{  9996,  10000 },
	{  9997,  10000 },{  9999,  58700 },{ 10000,   8448 },{ 10001,   5056 },{ 10002,   8448 },
	{ 10003,   5056 },{ 10004,  12641 },{ 10005,  12641 },{ 10006,  12641 },{ 10007,  12641 },
	{ 10008,  12485 },{ 10009,  12625 },{ 10010,  12641 },{ 10012,  12625 },{ 10013,  12625 },
	{ 10014,  12625 },{ 10015,  12625 },{ 10016,  12625 },{ 10017,  12625 },{ 10019,  12625 },
	{ 10020,  12625 },{ 10021,  12625 },{ 10022,  12625 },{ 10023,  12625 },{ 10024,  12625 },
	{ 10027,  12625 },{ 10030,  12625 },{ 10031,  12625 },{ 10032,  12625 },{ 10033,  12625 },
	{ 10034,  12625 },{ 10038,  12625 },{ 10039,  12625 },{ 10040,  16896 },{ 10041,  16896 },
	{ 10042,  12625 },{ 10043,  12625 },{ 10044,  12625 },{ 10045,  12625 },{ 10046,  12625 },
	{ 10047,  12625 },{ 10048,  12625 },{ 10049,  12625 },{ 10050,  12625 },{ 10051,  12625 },
	{ 10052,  12625 },{ 10053,  12625 },{ 10054,  12625 },{ 10055,  12625 },{ 10056,  12625 },
	{ 10057,  12625 },{ 10058,  12625 },{ 10059,  12625 },{ 10060,  12641 },{ 10061,  12641 },
	{ 10099,    253 },{ 10101,  54800 },{ 10102,  54800 },{ 10103,  54800 },{ 10104,  54800 },
	{ 10105,  54800 },{ 10106,  54800 },{ 10107,  54800 },{ 10108,  54800 },{ 10200,  49300 },
	{ 10203,  49300 },{ 10300,  52000 },{ 10301,  36000 },{ 10400,   9300 },{ 10401,   5800 },
	{ 10402,   9300 },{ 10501,  58700 },{ 10502,  58700 },{ 10503,  58700 },{ 10504,  58700 },
	{ 10505,  45100 },{ 10506,  58700 },{ 10510,  58700 },{ 10511,  58700 },{ 10512,  58700 },
	{ 10513,  58700 },{ 10514,  58700 },{ 10515,  58700 },{ 10516,  58700 },{ 10601, 492000 },
	{ 10626,  61000 },{ 10627,  61100 },{ 10628,  61100 },{ 10629,  61100 },{ 10630,  61100 },
	{ 10631,  61100 },{ 10632,  61100 },{ 10633,  61100 },{ 10641,  41600 },{ 10642,  41600 },
	{ 10643,  41600 },{ 10644,  41600 },{ 10645,  41600 },{ 10646,  41600 },{ 10647,  41600 },
	{ 10648,  41600 },{ 10649,  41600 },{ 10650,  41600 },{ 10651,  41600 },{ 10652,  41600 },
	{ 10653,  41600 },{ 10654,  41600 },{ 10655,  41600 },{ 10656,  41600 },{ 10657,  41600 },
	{ 10658,  41600 },{ 10659,  41600 },{ 10660,  41600 },{ 10661,  41600 },{ 10662,  41600 },
	{ 10663,  41600 },{ 10664,  41600 },{ 10665,  41600 },{ 10666,  41600 },{ 10667,  41600 },
	{ 10668,  41600 },{ 10669,  41600 },{ 10670,  41600 },{ 10671,  41600 },{ 10672,  41600 },
	{ 10673,  41600 },{ 10674,  41600 },{ 10675,  41600 },{ 10676,  41600 },{ 10677,  41600 },
	{ 10678,  41600 },{ 10679,  41600 },{ 10680,  41600 },{ 10681,  41600 },{ 10682,  41600 },
	{ 10683,  41600 },{ 10684,  41600 },{ 10685,  41600 },{ 10686,  41600 },{ 10687,  41600 },
	{ 10688,  41600 },{ 10689,  41600 },{ 10690,  41600 },{ 10691,  41600 },{ 10692,  41600 },
	{ 10820,  21000 },{ 10821,  20500 },{ 10822,  20700 },{ 10823,  20600 },{ 10824,  20700 },
	{ 10825,  20700 },{ 10826,  20900 },{ 10827,  20700 },{ 10828,  20900 },{ 10829,  21100 },
	{ 10830,  20900 },{ 10831,  20700 },{ 10832,  20700 },{ 10833,  20900 },{ 10834,  20800 },
	{ 10840,   6900 },{ 10841,   6800 },{ 10842,   6900 },{ 10843,   6900 },{ 10844,   6900 },
	{ 10845,   6800 },{ 10846,   6900 },{ 10847,   6900 },{ 10848,   6900 },{ 10849,   6900 },
	{ 10850,   6800 },{ 10851,   6800 },{ 10852,   6900 },{ 10853,   6800 },{ 10854,   6900 },
	{ 10861,  20700 },{ 10862,  20700 },{ 10863,  20700 },{ 10864,  20700 },{ 10865,  20700 },
	{ 10866,  20700 },{ 10867,  20700 },{ 10868,  20700 },{ 10869,  20700 },{ 10870,  20700 },
	{ 10871,  20700 },{ 10872,  20700 },{ 10873,  20700 },{ 10874,  20700 },{ 10875,  20700 },
	{ 10876,   6800 },{ 10877,   6800 },{ 10878,   6800 },{ 10879,   6800 },{ 10880,   6800 },
	{ 10881,   6800 },{ 10882,   6800 },{ 10883,   6800 },{ 10884,   6800 },{ 10885,   6800 },
	{ 10886,   6800 },{ 10887,   6800 },{ 10888,   6800 },{ 10889,   6800 },{ 10890,   6800 },
	{ 10891,  20900 },{ 10892,  20900 },{ 10893,  20900 },{ 10894,  20900 },{ 10895,  31400 },
	{ 10896,   6900 },{ 10897,   6900 },{ 10898,   6900 },{ 10899,   6900 },{ 10900,   6900 },
	{ 10901,  20900 },{ 10910,  14500 },{ 10911,  14500 },{ 10912,  14500 },{ 10913,  14500 },
	{ 10914,  14500 },{ 10915,  14500 },{ 10927,  92500 },{ 10928,  92500 },{ 10929,  92500 },
	{ 10930,  92500 },{ 10931,  92500 },{ 10932,  92500 },{ 10933,  92500 },{ 10934,  92500 },
	{ 10935,  92500 },{ 10936,  92500 },{ 10937,  92500 },{ 10938,  92500 },{ 10939,  92500 },
	{ 10940,  92500 },{ 10941,  92500 },{ 10942,  92500 },{ 10943,  92500 },{ 10944,  92500 },
	{ 10945,  92500 },{ 10946,  92500 },{ 10947,  92500 },{ 10948,  92500 },{ 10949,  92500 },
	{ 10950,  92500 },{ 10951,  92500 },{ 10952,  92500 },{ 10953,  92500 },{ 10954,  92500 },
	{ 10955,  92500 },{ 10956,  92500 },{ 10957,  92500 },{ 10958,  92500 },{ 10959,  92500 },
	{ 10960,  92500 },{ 10961,  92500 },{ 10962,  92500 },{ 10963,  92500 },{ 10964,  92500 },
	{ 10965,  92500 },{ 10966,  92500 },{ 10967,  92500 },{ 10968,  92500 },{ 10969,  92500 },
	{ 10970,  92500 },{ 10971,  92500 },{ 10972,  92500 },{ 10973,  92500 },{ 10974,  92500 },
	{ 10975,  92500 },{ 10976,  92500 },{ 10977,  92500 },{ 10978,  92500 },{ 11101,  91200 },
	{ 11102,  91200 },{ 11103,  91200 },{ 11104,  91200 },{ 11105,  91200 },{ 11106,  91200 },
	{ 11107,  91200 },{ 11108,  91200 },{ 11109,  91200 },{ 11110,  91200 },{ 11111,  91200 },
	{ 11112,  91200 },{ 11113,  91200 },{ 11114,  91200 },{ 11115,  91200 },{ 11116,  91200 },
	{ 11117,  91200 },{ 11118,  91200 },{ 11119,  91200 },{ 11120,  91200 },{ 11121,  91200 },
	{ 11122,  91200 },{ 11123,  91200 },{ 11124,  91200 },{ 11125,  91200 },{ 11126,  91200 },
	{ 11127,  91200 },{ 11128,  91200 },{ 11129,  91200 },{ 11130,  91200 },{ 11131,  91200 },
	{ 11132,  91200 },{ 11133,  91200 },{ 11134,  91200 },{ 11135,  91200 },{ 11136,  91200 },
	{ 11137,  91200 },{ 11138,  91200 },{ 11139,  91200 },{ 11140,  91200 },{ 11141,  91200 },
	{ 11142,  91200 },{ 11143,  91200 },{ 11144,  91200 },{ 11145,  91200 },{ 11146,  91200 },
	{ 11147,  91200 },{ 11148,  91200 },{ 11149,  91200 },{ 11150,  91200 },{ 11151,  91200 },
	{ 11152,  91200 },{ 11153, 135200 },{ 11154, 135800 },{ 11155, 134900 },{ 11156, 135200 },
	{ 11157, 135200 },{ 11158, 124100 },{ 11160, 135200 },{ 11161, 135200 },{ 11162, 135800 },
	{ 11163, 134900 },{ 11164, 135200 },{ 11165, 135200 },{ 11166, 124100 },{ 11167, 135800 },
	{ 11201,  91200 },{ 11202,  91200 },{ 11203,  91200 },{ 11204,  91200 },{ 11205,  91200 },
	{ 11206,  91200 },{ 11207,  91200 },{ 11208,  91200 },{ 11209,  91200 },{ 11210,  91200 },
	{ 11211,  91200 },{ 11212,  91200 },{ 11213,  91200 },{ 11214,  91200 },{ 11215,  91200 },
	{ 11216,  91200 },{ 11217,  91200 },{ 11218,  91200 },{ 11219,  91200 },{ 11220,  91200 },
	{ 11221,  91200 },{ 11222,  91200 },{ 11223,  91200 },{ 11224,  91200 },{ 11225,  91200 },
	{ 11226,  91200 },{ 11227,  91200 },{ 11228,  91200 },{ 11229,  91200 },{ 11230,  91200 },
	{ 11231,  91200 },{ 11232,  91200 },{ 11233,  91200 },{ 11234,  91200 },{ 11235,  91200 },
	{ 11236,  91200 },{ 11237,  91200 },{ 11238,  91200 },{ 11239,  91200 },{ 11240,  91200 },
	{ 11241,  91200 },{ 11242,  91200 },{ 11243,  91200 },{ 11244,  91200 },{ 11245,  91200 },
	{ 11246,  91200 },{ 11247,  91200 },{ 11248,  91200 },{ 11249,  91200 },{ 11250,  91200 },
	{ 11251,  91200 },{ 11252,  91200 },{ 11253,  91200 },{ 11254,  91200 },{ 11255,  91200 },
	{ 11256,  91200 },{ 11257,  91200 },{ 11258,  91200 },{ 11259,  91200 },{ 11260,  91200 },
	{ 11261,  91200 },{ 11262,  91200 },{ 11263,  91200 },{ 11264,  91200 },{ 11265,  91200 },
	{ 11266,   6900 },{ 11267,   6900 },{ 11268,   6900 },{ 11269,   6900 },{ 11270,   6900 },
	{ 11271,   6900 },{ 11272,   6900 },{ 11273,  20900 },{ 11274,  20900 },{ 11275,  20900 },
	{ 11276,  20900 },{ 11277,  20900 },{ 11278,  20900 },{ 11279,  20900 },{ 11280,  14500 },
	{ 11281,  14500 },{ 11282,  14500 },{ 11283,  14500 },{ 11284,  14500 },{ 11285,  14500 },
	{ 11286,  14500 },
	{   171,    200, 0x0A7A948C },{   180,    560, 0x0818538C },{   182,    560, 0x0818538C },
	{   184,    900, 0x0818538C },{   185,    900, 0x0818538C },{   212,  16000, 0x0817020C },
	{   212,   7500, 0x080CA03C },{   212,   3200, 0x08074C2C },{   212,    640, 0x07F76C1C },
	{   214,  13500, 0x08B43E14 },{   215,  13500, 0x08B43E14 },{   216,  13500, 0x08B43E14 },
	{   217,  13500, 0x08B43E14 },{   218,  13500, 0x08B43E14 },{   219,  13500, 0x08B43E14 },
	{   220,  13500, 0x08B43E14 },{   221,  13500, 0x08B43E14 },{   223,  13500, 0x08B43E14 },
	{   224,  13500, 0x08B43E14 },{   227,  13500, 0x08B43E14 },{   230,  13500, 0x08B43E14 },
	{   251,   2281, 0x083D2694 },{   252,   2281, 0x0817020C },{   253,   2281, 0x0817020C },
	{   254,   5377, 0x0817020C },{   255,   5377, 0x0817020C },{   256,   5377, 0x0817020C },
	{   257,   9200, 0x08398674 },{   257,  10483, 0x0817020C },{   258,   5761, 0x0817020C },
	{   259,   7077, 0x0817020C },{   261,   5049, 0x088473B4 },{   261,     49, 0x08831424 },
	{   261,     30, 0x0881DEC4 },{   261,   2200, 0x087817A4 },{   262,  15100, 0x08874EF4 },
	{   263,  15100, 0x0883BCE4 },{   264,  15100, 0x088481C4 },{   265,  15100, 0x08842D64 },
	{   266,  15100, 0x08874EF4 },{   273,   3116, 0x0821AA2C },{   297,  23400, 0x08DD383C },
	{   298,  23400, 0x08DFA2FC },{   299,  23500, 0x08EDDD2C },{   520,   4500, 0x082D5494 },
	{   520,   3300, 0x0817020C },{   521,   3300, 0x082D5494 },{   522,   3300, 0x082D5494 },
	{   523,   3300, 0x082FBF54 },{   524,   3300, 0x082FBF54 },{   525,   4500, 0x082FBF54 },
	{   525,   3300, 0x0817020C },{   526,   3300, 0x082FBF54 },{   530,   1000, 0x085FEC24 },
	{   538,   3600, 0x081B3CDC },{   539,   3300, 0x0817020C },{   542,   3300, 0x081B3CDC },
	{   543,   3300, 0x0817020C },{   544,   4600, 0x08538204 },{   544,   3300, 0x0817020C },
	{   545,   3300, 0x08538204 },{   546,   3300, 0x08538204 },{   548,   1800, 0x083E9434 },
	{   549,   3300, 0x0817020C },{   563,   1800, 0x0817020C },{   568,   1800, 0x0817AACC },
	{   571,   4700, 0x08402C04 },{   572,   4700, 0x08186FAC },{   580,     55, 0x08E664AC },
	{   582,  22000, 0x08E9B06C },{   617,   1360, 0x0818538C },{   618,   1040, 0x0818538C },
	{   619,   1360, 0x0818538C },{   622,   1970, 0x0818538C },{   623,   1970, 0x0818538C },
	{   624,   1970, 0x0818538C },{   625,   1970, 0x0818538C },{   626,   7300, 0x0818538C },
	{   627,   7300, 0x0818538C },{   628,   5550, 0x0818538C },{   629,   5550, 0x0818538C },
	{   630,   4700, 0x0818538C },{   631,   4700, 0x0818538C },{   634,   4830, 0x0818538C },
	{   635,   5990, 0x0818538C },{   636,   4830, 0x0818538C },{   637,   5990, 0x0818538C },
	{   638,  12800, 0x0864C1A4 },{   638,   7090, 0x0817020C },{   639,   7090, 0x0817020C },
	{   658,   3730, 0x0817020C },{   659,   3730, 0x0817020C },{   660,   1970, 0x0818538C },
	{   661,   1970, 0x0818538C },{   672,   1970, 0x0818538C },{   675,   4060, 0x0817020C },
	{   676,   1970, 0x0818538C },{   677,   1970, 0x0818538C },{   678,   7090, 0x0817020C },
	{   680,   7090, 0x0817020C },{   685,   7090, 0x0817020C },{   686,   7090, 0x0817020C },
	{   687,   7090, 0x0817020C },{   688,   7090, 0x0817020C },{   689,   7090, 0x0817020C },
	{   690,   7090, 0x0817020C },{   692,   7090, 0x0817020C },{   693,   7090, 0x0818538C },
	{   694,  12900, 0x0819267C },{   694,   7090, 0x0818538C },{   695,   7090, 0x0818538C },
	{   696,   7090, 0x0818538C },{   697,   7090, 0x0818538C },{   698,   7090, 0x0817020C },
	{   699,   7090, 0x0817020C },{   724,   4900, 0x0817020C },{   729,   1170, 0x0817020C },
	{   730,   1170, 0x0817020C },{   731,   1310, 0x0817020C },{   732,   1390, 0x0817020C },
	{   733,   1190, 0x0817020C },{   734,   1110, 0x0817020C },{   735,  10000, 0x0823EFE4 },
	{   738,  12800, 0x08AF0624 },{   800,   3200, 0x0A0D442C },{   801,   3200, 0x0A0D442C },
	{   854,   3200, 0x08D8FD6C },{   855,  15500, 0x08FEF29C },{   855,   3200, 0x08FDCB4C },
	{   856,  15500, 0x08FEF29C },{   856,  16000, 0x08FDCB4C },{   857,  15500, 0x08FEF29C },
	{   857,  16000, 0x08FDCB4C },{   868,  14100, 0x0908493C },{   869,  14100, 0x0908493C },
	{   893,  16500, 0x0F7FB669 },{   897,  17100, 0x10629489 },{   909,   3800, 0x0822993C },
	{   910,   5700, 0x0822993C },{   914,   2970, 0x0818619C },{   915,   3660, 0x0818619C },
	{   916,   2970, 0x0818619C },{   917,   2970, 0x0818619C },{   918,   2300, 0x0818619C },
	{   919,   3100, 0x0818619C },{   920,   3660, 0x0818619C },{   921,   2300, 0x0818619C },
	{   922,   3100, 0x0818619C },{   929,  19900, 0x09A563FC },{   930,   4730, 0x0818619C },
	{   931,   4600, 0x0818619C },{   933,   4960, 0x0818619C },{   934,   3800, 0x0818619C },
	{   935,   2300, 0x0818619C },{   939,  16000, 0x09A563FC },{   970,  13000, 0x09A563FC },
	{   991,   8400, 0x0BD6BE51 },{   992,   8400, 0x0BD6BE51 },{   997,   1000, 0x0C3458D2 },
	{  1006,   4110, 0x0817020C },{  1012,   4015, 0x0817020C },{  1013,   4015, 0x0817020C },
	{  1016,   3900, 0x08F1DFBC },{  1017,   3900, 0x08F1DFBC },{  1100,   1000, 0x0817020C },
	{  1101,   1400, 0x0817020C },{  1102,   1640, 0x0817020C },{  1103,   1780, 0x0817020C },
	{  1104,   1920, 0x0817020C },{  1105,   1420, 0x0817020C },{  1106,   1740, 0x0817020C },
	{  1107,   1250, 0x0817020C },{  1108,   1460, 0x0817020C },{  1109,   1100, 0x0817020C },
	{  1110,  12800, 0x0818619C },{  1110,   7090, 0x0818538C },{  1111,  12900, 0x0819EB5C },
	{  1113,   2400, 0x0881DEC4 },{  1113,  24000, 0x087D79C4 },{  1113,  20000, 0x08784FE4 },
	{  1122,  11160, 0x09285DBC },{  1122,  24000, 0x08ABF2A4 },{  1122,   4000, 0x08A5E7C4 },
	{  1164,  60000, 0x0C2AD802 },{  1165,  60000, 0x0C2B80C2 },{  1300,  24200, 0x08AABD44 },
	{  1300,  36600, 0x089BF674 },{  1301,  18200, 0x08CB7A0D },{  1301,  13900, 0x08B68CB4 },
	{  1301,  24200, 0x08AABD44 },{  1302,  18200, 0x08CB7A0D },{  1302,  13900, 0x08B68CB4 },
	{  1303,  24200, 0x08C00D0C },{  1303,  18200, 0x08BEC99C },{  1304,  24200, 0x08DA24BC },
	{  1305,  10000, 0x08DF246C },{  1306,   6300, 0x08E36D4C },{  1307,   1000, 0x08E7A81C },
	{  1308,   8000, 0x08F60C7C },{  1310,   1000, 0x09073E0C },{  1313,  22400, 0x095B1F7C },
	{  1314,  22400, 0x095B1F7C },{  1315,  22400, 0x095B1F7C },{  1316,  25400, 0x095B1F7C },
	{  1317,  25400, 0x095B1F7C },{  1318,  25400, 0x095B1F7C },{  1319,  25400, 0x095B1F7C },
	{  1320,  25400, 0x095B1F7C },{  1321,  25600, 0x095B1F7C },{  1322,  22400, 0x095B1F7C },
	{  1323,  22800, 0x095B1F7C },{  1324,  22600, 0x095B1F7C },{  1325,  22800, 0x095D600C },
	{  1400,  23500, 0x08EDDD2C },{  1401,  23500, 0x08EDDD2C },{  1402,  23500, 0x08EDDD2C },
	{  1403,  23500, 0x08EDDD2C },{  1404,  23500, 0x08EDDD2C },{  1417,   7500, 0x0A6214AC },
	{  1475,  18200, 0x0974C6AC },{  1485,  33100, 0x0BA8EE32 },{  1486,  60000, 0x0BA8EE32 },
	{  1487, 116100, 0x0EBFD618 },{  1487,  46100, 0x0BDFA472 },{  1489,  46100, 0x0BCB2721 },
	{  1492,  16500, 0x0BDEEDA2 },{  1495,  36400, 0x0D4BACA2 },{  1497,  36400, 0x0D4BACA2 },
	{  1498,  80500, 0x0D4BACA2 },{  1498,  54200, 0x0D2538E3 },{  1498,  36400, 0x0CC3B7F2 },
	{  1798,  33770, 0x13430C72 },{  1799,  31970, 0x13430C72 },{  1811, 102400, 0x0BF39522 },
	{  1811,  79000, 0x0BE700D2 },{  1811,  19800, 0x0BDEC373 },{  1816,  51200, 0x0CEA7202 },
	{  1861,  53400, 0x0BF39522 },{  1861, 102400, 0x0BEA5AA2 },{  1862,  26700, 0x0C624512 },
	{  1900,  18500, 0x09A7B29C },{  1910,  37500, 0x09BBDB8C },{  1910,  55000, 0x09BB32CC },
	{  1910,  12500, 0x09B98CEC },{  2005,  10000, 0x0A4CE08C },{  2006,   8400, 0x0A71E6AC },
	{  2006,  10100, 0x0A4CE08C },{  2007,   8000, 0x0A71E6AC },{  2007,   9500, 0x0A4CE08C },
	{  2007,  15400, 0x0A49B0EC },{  2008,   7800, 0x0A71E6AC },{  2008,   8100, 0x0A5E121C },
	{  2008,  15400, 0x0A55AA8C },{  2008,   8100, 0x0A54752C },{  2008,  15400, 0x0A4C9A3C },
	{  2009,  21500, 0x0A77D56C },{  2009,  21800, 0x0A72734C },{  2009,   7900, 0x0A71E6AC },
	{  2009,   8100, 0x0A4CE08C },{  2010,   9600, 0x0A77D56C },{  2010,  15400, 0x0A584D8C },
	{  2011,  13600, 0x0A83B2EC },{  2011,  15400, 0x0A83A4DC },{  2011,  13600, 0x0A83426D },
	{  2011,  15400, 0x0A830A2C },{  2011,  13600, 0x0A82EE0C },{  2011,  15400, 0x0A82A7BC },
	{  2011,  13600, 0x0A8299AC },{  2011,  15400, 0x0A82616C },{  2011,  13600, 0x0A82535C },
	{  2011,  15400, 0x0A82454C },{  2011,  13600, 0x0A81B8AC },{  2011,  15400, 0x0A81725C },
	{  2011,  13600, 0x0A810FEC },{  2011,  15400, 0x0A80C99C },{  2012,  11600, 0x0A71E6AC },
	{  2012,  15400, 0x0A55AA8C },{  2013,  12200, 0x0A71E6AC },{  2013,  15400, 0x0A55AA8C },
	{  2014,  15400, 0x0A55AA8C },{  2015,   6800, 0x0A71E6AC },{  2015,  15400, 0x0A55AA8C },
	{  2018,  15400, 0x0A584D8C },{  2019,  20800, 0x0A77D56C },{  2019,  20100, 0x0A72734C },
	{  2019,  11600, 0x0A71E6AC },{  2020,   1400, 0x0A77D56C },{  2020,  13600, 0x0A72734C },
	{  2020,  24600, 0x0A71E6AC },{  2020,  12200, 0x0A58CC1C },{  2021,   8300, 0x0A8AF32C },
	{  2022,   8300, 0x0A8AF32C },{  2023,   8300, 0x0A8AF32C },{  2024,   8300, 0x0A8AF32C },
	{  2025,   8300, 0x0A8AF32C },{  2026,   8300, 0x0A8AF32C },{  2027,   8300, 0x0A8AF32C },
	{  2028,   8300, 0x0A8AF32C },{  2029,   8300, 0x0A8AF32C },{  2030,   8300, 0x0A8AF32C },
	{  2032,   8300, 0x0A8CEDE4 },{  2033,   8300, 0x0A8D96A4 },{  2034,   8300, 0x0A8CEDE4 },
	{  2037,   8300, 0x0A8D96A4 },{  2038,   8300, 0x0A8D96A4 },{  2051,  16700, 0x0B7EB022 },
	{  2052,  16600, 0x0B7EB022 },{  2053,  13700, 0x0B7EB022 },{  2054,  11400, 0x0A86FEAC },
	{  2054,  16700, 0x0A83A4DC },{  2055,  12900, 0x0B7EB022 },{  2055,  16700, 0x0A6FEC6C },
	{  2056,  12800, 0x0B7EB022 },{  2056,  16700, 0x0A70952C },{  2057,  10600, 0x0B7EB022 },
	{  2057,  15400, 0x0A70952C },{  2059,  15400, 0x0A82EE0C },{  2060,   6800, 0x0B7EB022 },
	{  2060,   5700, 0x0B1A1BF8 },{  2060,  16700, 0x0A83A4DC },{  2080,  27400, 0x0BAA2392 },
	{  2090,  16900, 0x0B892002 },{  2091,  33500, 0x0B892002 },{  2091,  16900, 0x0B876C12 },
	{  2092,  16900, 0x0B892002 },{  2093,  18700, 0x0B9F3521 },{  2098,  29500, 0x0BAA2392 },
	{  2099,  22800, 0x0BAA2392 },{  2104,  20900, 0x0B796A21 },{  2106,  41400, 0x0B8393B2 },
	{  2108,  38100, 0x0BA8AB24 },{  2109,  44900, 0x0BD31023 },{  2110,  44900, 0x0BD31023 },
	{  2111,  44900, 0x0BD31023 },{  2112,  44900, 0x0BD31023 },{  2113,  44900, 0x0BD31023 },
	{  2114,  44900, 0x0BBDB1D4 },{  2115,  44900, 0x0BD31023 },{  2116,  44900, 0x0BD31023 },
	{  2117,  44900, 0x0BD31023 },{  2118,  44900, 0x0BD31023 },{  2119,  44900, 0x0BBDB1D4 },
	{  2120,  44900, 0x0BD31023 },{  2121,  44900, 0x0BD31023 },{  2122,  44900, 0x0BD31023 },
	{  2123,  44900, 0x0BD31023 },{  2144,  47600, 0x0D400761 },{  2145,  47800, 0x0D400761 },
	{  2170,    100, 0x0FABD299 },{  2307,   9500, 0x0EF25181 },{  2359,  14000, 0x0B20DD63 },
	{  2360,  28900, 0x0B20DD63 },{  2361,  15900, 0x0B20DD63 },{  2362,  18100, 0x0B20DD63 },
	{  2363,  16700, 0x0B20DD63 },{  2364,  13600, 0x0B218625 },{  2371,  86800, 0x0B24EE03 },
	{  2372,  86700, 0x0B24EE03 },{  2373,  72200, 0x0B24EE03 },{  2374,  76900, 0x0B24EE03 },
	{  2375,  14200, 0x0B3E4EE3 },{  2376,  68900, 0x0B24EE03 },{  2377,  72300, 0x0B24EE03 },
	{  2378,  72200, 0x0B24EE03 },{  2379,  13600, 0x0B24EE03 },{  2380,  73900, 0x0B24EE03 },
	{  2401,  33100, 0x0BB72862 },{  2401,  13500, 0x0BAF77A1 },{  2408,  60000, 0x0D4C4752 },
	{  2409,  60000, 0x0D4C4752 },{  2411,  60000, 0x0D4C4752 },{  2412,  60000, 0x0D4C4752 },
	{  2413,  60000, 0x0D4C4752 },{  2414,  60000, 0x0D4C4752 },{  2483,  50000, 0x107E8A59 },
	{  2492,  21300, 0x10797C9E },{  2492,  50000, 0x10754FD1 },{  2493,  21300, 0x10798AAA },
	{  2493,  50000, 0x10754FD1 },{  2494,  21300, 0x1086D5C7 },{  2494,  90500, 0x1079C2EE },
	{  2494,  21300, 0x10797C9E },{  2494,  50000, 0x10754FD1 },{  2495,  21300, 0x1079B4DD },
	{  2505,  19500, 0x0BDA3443 },{  2506,  19500, 0x0BE1C8E2 },{  2507,  19500, 0x0BE1C8E2 },
	{  2509,  13600, 0x0C002973 },{  2510,  13600, 0x0C002973 },{  2526,  20000, 0x0D40BE32 },
	{  2566,  22300, 0x0E1D5937 },{  2571,  33000, 0x0E7842A9 },{  2572,  34000, 0x0E7842A9 },
	{  2575,  31000, 0x0E81C372 },{  2602,    100, 0x0CD41692 },{  2604, 121000, 0x0D66DD92 },
	{  2604, 361000, 0x0CE13782 },{  2605,  71000, 0x0CE80741 },{  2606,  36400, 0x0D4BACA2 },
	{  2608, 176000, 0x0D7F6B82 },{  2611,  36900, 0x0DB27398 },{  2611,  29600, 0x0DB08761 },
	{  2615, 677200, 0x0E2BD9B7 },{  2615,  66400, 0x0E2BCBA6 },{  2662,    100, 0x0FED8B8D },
	{  2665, 127500, 0x0FC0C063 },{  2682,2540300, 0x13EE0D01 },{  2684, 746300, 0x1386FFC1 },
	{  2690, 937600, 0x1386FFC1 },{  2711,  22000, 0x0CBE9C22 },{  2721,  22000, 0x0CBE9C22 },
	{  2723,  22000, 0x0CBE9C22 },{  2725,  22000, 0x0CBE9C22 },{  2791,      0, 0x0F916689 },
	{  2792,      0, 0x0F916689 },{  2793,      0, 0x0F916689 },{  2794,  10000, 0x0FA63839 },
	{  2794,      0, 0x0F916689 },{  2795,  10000, 0x0FA63839 },{  2795,      0, 0x0F916689 },
	{  2796,  10000, 0x0FA63839 },{  2796,      0, 0x0F916689 },{  2798,   7500, 0x0F83E32A },
	{  2798,   6400, 0x0F83D516 },{  2920,  33000, 0x0DF120E2 },{  2921,  33000, 0x0DF120E2 },
	{  3000,    100, 0x0CE2C142 },{  3002,    100, 0x0CE7B2E2 },{  3016,    100, 0x0CFFB432 },
	{  3017,    100, 0x0D00BF62 },{  3022,  58700, 0x0D134272 },{  3028,  69100, 0x0D36CCE2 },
	{  3030,  69100, 0x0D39A822 },{  3043, 144000, 0x0F5F3161 },{  3062, 132400, 0x0F5F3161 },
	{  3064, 132900, 0x0F5F3161 },{  3065, 183700, 0x0F5F3161 },{  3195,  21100, 0x0E8314F2 },
	{  3306,      0, 0x0F5A4DD9 },{  3408,  20600, 0x0DFA7782 },{  3410,  28700, 0x0E789708 },
	{  3412,  28700, 0x0E789708 },{  3430,  34300, 0x0F4B4EC9 },{  3641,  13200, 0x0E12F762 },
	{  3733,  33000, 0x0E40E3A7 },{  4000,  21100, 0x0E8314F2 },{  4004,  21100, 0x0E8314F2 },
	{  4008,  21100, 0x0E8314F2 },{  4022,  25000, 0x12BDACB1 },{  4026,      0, 0x0F59C131 },
	{  4027,      0, 0x0F59C131 },{  4028,      0, 0x0F59C131 },{  4029,      0, 0x0F59C131 },
	{  4030,      0, 0x0F59C131 },{  4031,      0, 0x0F59C131 },{  4032,      0, 0x0F59C131 },
	{  4033,      0, 0x0F59C131 },{  4034,      0, 0x0F59C131 },{  4035,      0, 0x0F59C131 },
	{  4036,      0, 0x0F59C131 },{  4037,      0, 0x0F59C131 },{  4400,  34300, 0x0F4BA321 },
	{  4433,  25000, 0x11543977 },{  4433,  89300, 0x1153F328 },{  4726,  12800, 0x0FE466F1 },
	{  4727,  12800, 0x0FE466F1 },{  4728,  12800, 0x0FE466F1 },{  4748,  23400, 0x105AC7A4 },
	{  4749,  46800, 0x105AC7A4 },{  5013,  19600, 0x102F8C72 },{  5102, 216500, 0x0FFBCD94 },
	{  5304,  29000, 0x1064B8F9 },{  5305,  21000, 0x1064B8F9 },{  5308,  28500, 0x1064D519 },
	{  5309,  28500, 0x1064D519 },{  5311,  11000, 0x12BDACB1 },{  5311,  33000, 0x11E2FDED },
	{  5311,  11000, 0x11E2EFDD },{  5311,  33000, 0x11E2D3BB },{  5311,  11000, 0x11E2C5AD },
	{  5311,  33000, 0x11E0F59A },{  5311,  11000, 0x11E0E78D },{  5311,  33000, 0x1178508C },
	{  5311,  11000, 0x1177EE1B },{  5311,  33000, 0x109A0192 },{  5500,  19200, 0x1024C838 },
	{  5501,  19200, 0x1024C838 },{  5600,  22700, 0x10654598 },{  5708,  51100, 0x1074FB79 },
	{  5709,  51100, 0x1074FB79 },{  5710,  51100, 0x1074FB79 },{  5711,  51100, 0x1074FB79 },
	{  5712,  51100, 0x1074FB79 },{  5713,  51100, 0x1074FB79 },{  5714,  51100, 0x1074FB79 },
	{  5715,  51100, 0x1074FB79 },{  5900,  42000, 0x115EB76B },{  5900,  38400, 0x113EE93D },
	{  5901, 168000, 0x12BDBAC2 },{  5902, 168000, 0x115EB76B },{  5903, 168000, 0x115EB76B },
	{  5904, 168000, 0x115EB76B },{  6006,   1000, 0x1122207F },{  6007,   1000, 0x1122207F },
	{  6011,  10000, 0x12610142 },{  6012,  42600, 0x1295CB51 },{  6012, 142000, 0x128C3C71 },
	{  6012,   4000, 0x12677CA1 },{  6013,  34500, 0x1295CB51 },{  6013, 192000, 0x128C3C71 },
	{  6024,  46700, 0x12F7CAD1 },{  6301,  16800, 0x11BAC82C },{  6302,  16800, 0x11BAC82C },
	{  6319,   5100, 0x12F49B31 },{  6320,   5100, 0x12F49B31 },{  6321,   5100, 0x12F49B31 },
	{  6322,   5100, 0x12F49B31 },{  6323,  10600, 0x12F49B31 },{  6324,  10600, 0x12F49B31 },
	{  6325,  10600, 0x12F49B31 },{  6326,  10600, 0x12F49B31 },{  6606,  55000, 0x132AB6C1 },
	{ 10000,   4224, 0x12BEFE31 },{ 10001,   2528, 0x12BC7752 },{ 10004,   2528, 0x131325F2 },
	{ 10006,   1264, 0x131325F2 },{ 10007,    632, 0x131325F2 },{ 10008,    843, 0x131325F2 },
	{ 10300,  26000, 0x13456921 },{ 10301,  18000, 0x13456921 },{ 10501,  35300, 0x13010551 },
	{ 0 }
 };

struct pdent pdtbl[] =		/* Built-in table, from "pd" and "dh" entries */
 {	{   772,25920000 },{   773,25920000 },{   780, 1728000 },{   781, 1728000 },
	{   782, 1728000 },{   783, 1728000 },{   784, 1728000 },{   785, 1728000 },
	{   786, 1728000 },{   891, 2764800 },{   892, 2592000 },{   893,10195200 },
	{   894,11664000 },{   895,  864000 },{   896,  950400 },{   897, 5184000 },
	{   962,   86400 },{   963,   86400 },{   964,  259200 },{  1136,  950400 },
	{  1151,  432000 },{  1155,  432000 },{  1156, 3974400 },{  1157, 3974400 },
	{  1158, 3974400 },{  1162,  172800 },{  1163,  172800 },{  1164,  604800 },
	{  1165,  604800 },{  1166,  864000 },{  1167,  864000 },{  1168,  604800 },
	{  1169,  604800 },{  1170,  604800 },{  1171,  604800 },{  1420,11836800 },
	{  1421,11664000 },{  1422,11404800 },{  1423,11836800 },{  1424, 6307200 },
	{  1425, 6307200 },{  1426,13996800 },{  1427,13996800 },{  1428, 8294400 },
	{  1429, 8294400 },{  1430, 3196800 },{  1431, 3196800 },{  1432, 1900800 },
	{  1433, 1900800 },{  1487, 4060800 },{  1491,  259200 },{  1492, 2851200 },
	{  1495, 3024000 },{  1496, 4147200 },{  1497, 3024000 },{  1498, 3283200 },
	{  1582, 1555200 },{  1583, 1555200 },{  1584, 1555200 },{  1585, 1555200 },
	{  1586, 1555200 },{  1587, 1555200 },{  1588, 1555200 },{  1589, 1036800 },
	{  1590, 1036800 },{  1732, 1555200 },{  1733, 1555200 },{  1734, 1555200 },
	{  1735, 1555200 },{  1736, 1555200 },{  1737, 1555200 },{  1738, 1555200 },
	{  1739, 1555200 },{  1741, 1209600 },{  1750, 1209600 },{  1751, 1209600 },
	{  1761, 1209600 },{  1763, 1209600 },{  1765, 1209600 },{  1771, 1209600 },
	{  1773, 1209600 },{  1775, 1209600 },{  1796,  604800 },{  1797,  604800 },
	{  1798,  604800 },{  1799,  604800 },{  1808, 2592000 },{  1809, 2592000 },
	{  1814, 2592000 },{  1815, 2592000 },{  1816, 5356800 },{  1862, 8553600 },
	{  2004, 2592000 },{  2008, 3628800 },{  2009, 2592000 },{  2012, 2332800 },
	{  2013, 3369600 },{  2016, 3110400 },{  2017, 3024000 },{  2019, 1641600 },
	{  2051, 2851200 },{  2052, 2764800 },{  2053, 2332800 },{  2055, 2246400 },
	{  2056, 2160000 },{  2057, 1814400 },{  2060, 1036800 },{  2061, 1641600 },
	{  2062, 3110400 },{  2063, 2332800 },{  2064, 1987200 },{  2065, 2073600 },
	{  2066, 1987200 },{  2067, 3715200 },{  2068, 3542400 },{  2069, 2246400 },
	{  2071, 2764800 },{  2072, 3369600 },{  2073, 3110400 },{  2074, 3715200 },
	{  2075,  950400 },{  2076, 2246400 },{  2077, 3196800 },{  2078, 3974400 },
	{  2079, 3801600 },{  2080, 2937600 },{  2083, 4492800 },{  2084, 4752000 },
	{  2085, 3801600 },{  2094, 2332800 },{  2095, 2851200 },{  2096, 2937600 },
	{  2097, 2851200 },{  2098, 2937600 },{  2099, 2937600 },{  2107, 6739200 },
	{  2108, 7257600 },{  2109, 6134400 },{  2110, 6134400 },{  2111, 6134400 },
	{  2112, 6134400 },{  2113, 6134400 },{  2114, 6652800 },{  2115, 6652800 },
	{  2116, 6652800 },{  2117, 6652800 },{  2118, 6652800 },{  2119, 6652800 },
	{  2120, 6652800 },{  2121, 6652800 },{  2122, 6652800 },{  2123, 6652800 },
	{  2124, 6393600 },{  2125, 6307200 },{  2126, 6048000 },{  2127, 5788800 },
	{  2128, 6134400 },{  2129, 5788800 },{  2130, 5788800 },{  2131, 5788800 },
	{  2132, 6134400 },{  2133, 6134400 },{  2134, 6134400 },{  2135, 6134400 },
	{  2136, 6134400 },{  2137, 6220800 },{  2138, 6220800 },{  2139, 6220800 },
	{  2140, 6220800 },{  2141, 6220800 },{  2142, 3888000 },{  2143, 3888000 },
	{  2144, 3801600 },{  2145, 3888000 },{  2146, 3801600 },{  2147, 3628800 },
	{  2148, 3715200 },{  2149, 3628800 },{  2150, 3801600 },{  2151, 3628800 },
	{  2152, 3715200 },{  2153, 3628800 },{  2162, 3974400 },{  2163, 4060800 },
	{  2164, 4060800 },{  2165, 4060800 },{  2166, 3974400 },{  2167, 4060800 },
	{  2168, 4060800 },{  2169, 4060800 },{  2170, 3888000 },{  2171, 3870720 },
	{  2172, 3015360 },{  2173, 3948480 },{  2174, 3931200 },{  2175, 3015360 },
	{  2176, 3948480 },{  2300, 1036800 },{  2301, 1555200 },{  2302, 2160000 },
	{  2303,  950400 },{  2304,  950400 },{  2305,  518400 },{  2307, 2592000 },
	{  2308, 1468800 },{  2408, 2592000 },{  2409, 2592000 },{  2411, 2592000 },
	{  2412, 2592000 },{  2413, 2592000 },{  2414, 2592000 },{  2415, 2592000 },
	{  2416, 2592000 },{  2417, 2592000 },{  2418, 2592000 },{  2419, 2592000 },
	{  2420, 2592000 },{  2421, 2592000 },{  2422, 2592000 },{  2423, 2592000 },
	{  2424, 2592000 },{  2425, 2592000 },{  2426, 2592000 },{  2427, 2592000 },
	{  2442, 3628800 },{  2443, 3628800 },{  2444, 3628800 },{  2445, 3628800 },
	{  2446, 3628800 },{  2447, 3628800 },{  2450, 2592000 },{  2451, 3974400 },
	{  2452, 3974400 },{  2453, 3974400 },{  2463, 3888000 },{  2464, 3888000 },
	{  2465, 3888000 },{  2466, 3888000 },{  2471,17452800 },{  2481,17452800 },
	{  2482,17452800 },{  2483, 3628800 },{  2484, 3628800 },{  2485, 3628800 },
	{  2486, 2592000 },{  2490, 2592000 },{  2491, 2592000 },{  2492, 3628800 },
	{  2493, 3628800 },{  2494, 3628800 },{  2495, 3628800 },{  2496, 3628800 },
	{  2497, 3628800 },{  2498, 3628800 },{  2499, 3628800 },{  2500, 3456000 },
	{  2504, 3283200 },{  2505, 3283200 },{  2506, 3974400 },{  2507, 3628800 },
	{  2509, 3542400 },{  2510, 3974400 },{  2511, 2332800 },{  2512, 2332800 },
	{  2526, 3110400 },{  2527, 3110400 },{  2534, 3628800 },{  2542, 3369600 },
	{  2543, 3715200 },{  2549,  105408 },{  2550,  121824 },{  2552,  105408 },
	{  2553,  121824 },{  2554,  114912 },{  2555,  121824 },{  2556,  114912 },
	{  2557,  114912 },{  2558,  146880 },{  2559,   95040 },{  2560,  103680 },
	{  2561,   86400 },{  2562,  138240 },{  2563,   95040 },{  2564,  103680 },
	{  2565,   77760 },{  2566, 4752000 },{  2567,   86400 },{  2568,   86400 },
	{  2569,  103680 },{  2570,  120960 },{  2571,  112320 },{  2572,  120960 },
	{  2573,  112320 },{  2574,   86400 },{  2575,   86400 },{  2576,   86400 },
	{  2577,   77760 },{  2578,  112320 },{  2579,   95040 },{  2580,  103680 },
	{  2581,   95040 },{  2582, 3110400 },{  2583, 4752000 },{  2584, 3456000 },
	{  2585, 3542400 },{  2586, 2246400 },{  2587, 2332800 },{  2588, 2332800 },
	{  2589, 2246400 },{  2590, 4752000 },{  2591,  103680 },{  2592, 2937600 },
	{  2593, 3283200 },{  2603,  345600 },{  2604,  259200 },{  2605,  259200 },
	{  2606, 1728000 },{  2607, 1728000 },{  2608,  345600 },{  2609,  345600 },
	{  2610,  345600 },{  2611, 1728000 },{  2612, 1728000 },{  2613, 1728000 },
	{  2614, 1728000 },{  2615, 2592000 },{  2616,  345600 },{  2618,  345600 },
	{  2619,  345600 },{  2620, 1728000 },{  2621, 1728000 },{  2630,  259200 },
	{  2631,  259200 },{  2632,  501120 },{  2633,  103680 },{  2651,  259200 },
	{  2652,  259200 },{  2653,  259200 },{  2660,    3456 },{  2661,  604800 },
	{  2662,  259200 },{  2663,    3456 },{  2665,  518400 },{  2666,  518400 },
	{  2668,  259200 },{  2669,  259200 },{  2670,  259200 },{  2671,  259200 },
	{  2672,  259200 },{  2673,  518400 },{  2674,  259200 },{  2675,  259200 },
	{  2676,  259200 },{  2677,  259200 },{  2680,  345600 },{  2681,  345600 },
	{  2682,  345600 },{  2683,  345600 },{  2684,  345600 },{  2685,  345600 },
	{  2686,  345600 },{  2689,  345600 },{  2690,  518400 },{  2692,  345600 },
	{  2711,  259200 },{  2721,  259200 },{  2723,  259200 },{  2725,  259200 },
	{  2732,  259200 },{  2733,  259200 },{  2734,  259200 },{  2735,  259200 },
	{  2736,  259200 },{  2737,  259200 },{  2738,  259200 },{  2739,  259200 },
	{  2740,  259200 },{  2741,  259200 },{  2742,  259200 },{  2743,  259200 },
	{  2744,  259200 },{  2745,  259200 },{  2746,  259200 },{  2747,  259200 },
	{  2748,  259200 },{  2755,  172800 },{  2756,  172800 },{  2757, 1728000 },
	{  2758,  172800 },{  2759, 1728000 },{  2760,  172800 },{  2761, 1728000 },
	{  2762,  172800 },{  2763,  172800 },{  2764,  172800 },{  2765,  172800 },
	{  2766,  172800 },{  2767,  172800 },{  2768,  172800 },{  2769,  172800 },
	{  2770,  172800 },{  2771,  172800 },{  2772,  172800 },{  2774,  172800 },
	{  2775,  172800 },{  2776,  172800 },{  2777, 1728000 },{  2778, 1728000 },
	{  2779, 1728000 },{  2780, 1728000 },{  2781, 1728000 },{  2782, 1728000 },
	{  2783, 1728000 },{  2784, 1728000 },{  2785, 1728000 },{  2786, 1728000 },
	{  2787, 1728000 },{  2788, 1728000 },{  2791, 1728000 },{  2792, 1728000 },
	{  2793, 1728000 },{  2794,  172800 },{  2795,  172800 },{  2796,  172800 },
	{  2798,  172800 },{  2799,   86400 },{  2800, 3369600 },{  2801, 3369600 },
	{  2904, 2246400 },{  2905, 5443200 },{  2907, 2246400 },{  2908,  691200 },
	{  2913, 4579200 },{  2914, 4492800 },{  2915, 4492800 },{  2920,  864000 },
	{  2921,  864000 },{  2928, 5356800 },{  2929, 5356800 },{  2930,  172800 },
	{  2932,  172800 },{  2933,  172800 },{  2934,  172800 },{  2935,  172800 },
	{  2951,  864000 },{  2952,  864000 },{  2960, 2246400 },{  2961, 2246400 },
	{  2962, 2246400 },{  2963, 2246400 },{  2964, 2246400 },{  2965, 2246400 },
	{  2966, 2246400 },{  2967, 2246400 },{  2968, 1442880 },{  2969, 1442880 },
	{  2970, 4752000 },{  2971, 4752000 },{  2972, 1442880 },{  2973, 1442880 },
	{  3023,  129600 },{  3024,   64800 },{  3025,  129600 },{  3027,  129600 },
	{  3032,  172800 },{  3033,  172800 },{  3034,  172800 },{  3035,  172800 },
	{  3036,  129600 },{  3037,  129600 },{  3038, 3110400 },{  3039, 3110400 },
	{  3040, 3110400 },{  3041, 3110400 },{  3042, 3110400 },{  3043,  129600 },
	{  3044, 3628800 },{  3045, 5097600 },{  3046, 3888000 },{  3047, 3628800 },
	{  3048, 5097600 },{  3049, 3888000 },{  3050,  120960 },{  3051,  129600 },
	{  3052,  129600 },{  3059,  108000 },{  3060,  222912 },{  3061,  117504 },
	{  3062,  155520 },{  3063,  162432 },{  3064,  155520 },{  3065,  190080 },
	{  3123,  112320 },{  3124,  112320 },{  3125,  112320 },{  3126,  112320 },
	{  3127,  112320 },{  3128,  112320 },{  3129,  112320 },{  3130,  112320 },
	{  3147,  112320 },{  3148,  112320 },{  3149,  112320 },{  3150,  112320 },
	{  3151,  112320 },{  3152,  112320 },{  3153,  112320 },{  3154,  112320 },
	{  3155,  112320 },{  3156,  112320 },{  3157,  112320 },{  3158,  112320 },
	{  3159,  112320 },{  3160,  112320 },{  3161,  112320 },{  3171,  112320 },
	{  3172,  112320 },{  3173,  112320 },{  3174,  112320 },{  3175,  112320 },
	{  3176,  112320 },{  3177,  112320 },{  3178,  112320 },{  3179,  112320 },
	{  3180,  112320 },{  3181,  112320 },{  3182,  112320 },{  3189,  112320 },
	{  3190,  112320 },{  3191,  172800 },{  3192,  112320 },{  3193,  103680 },
	{  3194,  103680 },{  3195,  172800 },{  3196,  112320 },{  3197,  103680 },
	{  3198,  103680 },{  3199,  112320 },{  3300,  172800 },{  3302,  604800 },
	{  3303,  172800 },{  3304,  259200 },{  3305,  432000 },{  3306,  432000 },
	{  3402, 3369600 },{  3403, 3369600 },{  3404, 3369600 },{  3405, 3369600 },
	{  3406, 3369600 },{  3407, 3369600 },{  3408, 6220800 },{  3409, 4320000 },
	{  3410,  146880 },{  3411,  112320 },{  3412,  146880 },{  3413,  112320 },
	{  3422,  146880 },{  3423,  146880 },{  3424,  146880 },{  3425,  146880 },
	{  3426,  146880 },{  3430,  691200 },{  3431,  691200 },{  3432,  734400 },
	{  3433,  777600 },{  3434,  812160 },{  3435,  864000 },{  3436,  691200 },
	{  3437,  691200 },{  3438,  691200 },{  3439,  777600 },{  3440,  820800 },
	{  3441,  864000 },{  3445,  259200 },{  3446,  259200 },{  3447,  259200 },
	{  3448,  259200 },{  3449,  259200 },{  3450,  259200 },{  3451,  259200 },
	{  3452,  259200 },{  3453,  259200 },{  3454,  259200 },{  3455,  259200 },
	{  3456,  259200 },{  3457,  259200 },{  3458,  259200 },{  3459,  259200 },
	{  3460,  259200 },{  3461,  259200 },{  3462,  259200 },{  3463,  259200 },
	{  3464,  259200 },{  3465,  259200 },{  3466,  259200 },{  3467,  259200 },
	{  3468,  259200 },{  3469,  518400 },{  3470,  518400 },{  3500, 3110400 },
	{  3501, 3110400 },{  3502, 3024000 },{  3503, 3024000 },{  3600, 2246400 },
	{  3603, 5529600 },{  3604, 5529600 },{  3607, 5529600 },{  3608, 5529600 },
	{  3611, 5529600 },{  3612, 5529600 },{  3615, 5529600 },{  3616, 5529600 },
	{  3619, 5529600 },{  3620, 5529600 },{  3623, 5529600 },{  3624, 5529600 },
	{  3627, 5529600 },{  3628, 5529600 },{  3631, 5529600 },{  3632, 5529600 },
	{  3635, 5529600 },{  3636, 5529600 },{  3639, 5529600 },{  3640, 5529600 },
	{  3641, 5529600 },{  3643, 5529600 },{  3644, 5529600 },{  3645, 5529600 },
	{  3646, 5529600 },{  3647, 5529600 },{  3648, 5529600 },{  3649, 5529600 },
	{  3650, 5529600 },{  3651, 5529600 },{  3652, 5529600 },{  3653, 5529600 },
	{  3654, 5529600 },{  3655, 5529600 },{  3656, 5529600 },{  3657, 5529600 },
	{  3658, 5529600 },{  3659, 5529600 },{  3660, 5529600 },{  3661, 5529600 },
	{  3662, 5529600 },{  3663, 5529600 },{  3664, 5529600 },{  3665, 5529600 },
	{  3666, 5529600 },{  3667, 5529600 },{  3668, 5529600 },{  3669, 5529600 },
	{  3670, 5529600 },{  3671, 5529600 },{  3672, 5529600 },{  3673, 5529600 },
	{  3674, 5529600 },{  3675, 5529600 },{  3676, 5529600 },{  3677, 5529600 },
	{  3678, 5529600 },{  3679, 5529600 },{  3680, 5529600 },{  3681, 5529600 },
	{  3682, 5529600 },{  3683, 5529600 },{  3684, 5529600 },{  3685, 5529600 },
	{  3686, 5529600 },{  3687, 5529600 },{  3688, 5529600 },{  3689, 5529600 },
	{  3690, 5529600 },{  3691, 5529600 },{  3692, 5529600 },{  3693, 5529600 },
	{  3694, 5529600 },{  3695, 5529600 },{  3696, 5529600 },{  3697, 5529600 },
	{  3698, 5529600 },{  3699, 5529600 },{  3700, 5529600 },{  3701, 5529600 },
	{  3702, 5529600 },{  3703, 5529600 },{  3704, 5529600 },{  3705, 5529600 },
	{  3706, 5529600 },{  3707, 5529600 },{  3708, 5529600 },{  3709, 5529600 },
	{  3710, 5529600 },{  3711, 5529600 },{  3712, 5529600 },{  3713, 7603200 },
	{  3717, 7948800 },{  3721, 7862400 },{  3725, 7862400 },{  3729, 5529600 },
	{  3730, 5529600 },{  3731, 5529600 },{  3732, 5529600 },{  3733, 5529600 },
	{  3734, 5529600 },{  3735, 5529600 },{  3736, 5529600 },{  3737, 5529600 },
	{  3738, 5529600 },{  3739, 5529600 },{  3740, 5529600 },{  3741, 3369600 },
	{  3742, 3369600 },{  3745, 3369600 },{  3746, 3369600 },{  3749, 2764800 },
	{  3750, 2764800 },{  3753, 7603200 },{  3754, 7603200 },{  3757, 5443200 },
	{  3758, 5443200 },{  3761, 7171200 },{  3762, 7171200 },{  3765, 7171200 },
	{  3766, 7171200 },{  3770, 3110400 },{  3771, 3196800 },{  3798,     864 },
	{  3850, 1814400 },{  3851, 2073600 },{  3852, 1814400 },{  3853, 2073600 },
	{  3855, 3456000 },{  3856, 3456000 },{  3858, 3456000 },{  3859, 3456000 },
	{  3860,  691200 },{  3861,  691200 },{  3863,  518400 },{  3864,  518400 },
	{  3900,  345600 },{  3903, 5529600 },{  3905, 5529600 },{  3906, 5097600 },
	{  3907, 5097600 },{  3908, 5529600 },{  3951,  518400 },{  3952,  518400 },
	{  4000,  172800 },{  4001,  112320 },{  4002,  103680 },{  4003,  103680 },
	{  4004,  172800 },{  4005,  112320 },{  4006,  103680 },{  4007,  103680 },
	{  4008,  172800 },{  4009,  103680 },{  4010,  172800 },{  4011,  172800 },
	{  4012,  172800 },{  4013,  172800 },{  4014,  172800 },{  4015,  172800 },
	{  4016,  172800 },{  4017,  172800 },{  4018,  172800 },{  4019,  172800 },
	{  4020,  172800 },{  4021,  172800 },{  4022,  112320 },{  4023,  172800 },
	{  4024, 1382400 },{  4025, 1382400 },{  4026,  172800 },{  4027,  172800 },
	{  4028,  172800 },{  4029,  172800 },{  4030,  172800 },{  4031,  172800 },
	{  4032,  172800 },{  4033,  172800 },{  4034,  172800 },{  4035,  172800 },
	{  4036,  172800 },{  4037,  172800 },{  4038, 1728000 },{  4039, 1728000 },
	{  4040, 1728000 },{  4041, 1728000 },{  4042, 1728000 },{  4043,  172800 },
	{  4044, 1728000 },{  4045, 1728000 },{  4046, 1728000 },{  4047, 1728000 },
	{  4100, 2764800 },{  4101, 3456000 },{  4102, 3369600 },{  4103, 2592000 },
	{  4104, 3369600 },{  4105, 2764800 },{  4107, 3369600 },{  4108, 2592000 },
	{  4109, 3369600 },{  4110, 2678400 },{  4111, 2678400 },{  4112, 4752000 },
	{  4113, 3024000 },{  4114, 1728000 },{  4115, 2764800 },{  4116, 3456000 },
	{  4117, 3369600 },{  4118, 2592000 },{  4119, 3369600 },{  4120, 2678400 },
	{  4121, 2764800 },{  4122, 2678400 },{  4400,  432000 },{  4401,  432000 },
	{  4402,  432000 },{  4403,  432000 },{  4404,  432000 },{  4405,  432000 },
	{  4406,  432000 },{  4407,  432000 },{  4408,  432000 },{  4409,  432000 },
	{  4410,  432000 },{  4411,  432000 },{  4412,  432000 },{  4413,  432000 },
	{  4414,  432000 },{  4415,  432000 },{  4416,  432000 },{  4417,  432000 },
	{  4418,  432000 },{  4419,  432000 },{  4420,  432000 },{  4421,  432000 },
	{  4422,  432000 },{  4423,  432000 },{  4424,  432000 },{  4425,  432000 },
	{  4426,  432000 },{  4427,  432000 },{  4432, 3715200 },{  4433,  172800 },
	{  4434, 3715200 },{  4435, 3715200 },{  4436, 3715200 },{  4437, 3715200 },
	{  4438, 3715200 },{  4439, 3715200 },{  4440, 3715200 },{  4441, 3715200 },
	{  4442, 3715200 },{  4443, 3715200 },{  4444, 3715200 },{  4445, 3715200 },
	{  4446, 3715200 },{  4447, 3715200 },{  4448, 3715200 },{  4449, 3715200 },
	{  4450, 3715200 },{  4451, 3715200 },{  4452, 3715200 },{  4453, 3715200 },
	{  4454, 3715200 },{  4455, 3715200 },{  4456, 3715200 },{  4457, 3715200 },
	{  4458, 3715200 },{  4459, 3715200 },{  4460, 3715200 },{  4461, 3715200 },
	{  4462, 3715200 },{  4463, 3715200 },{  4510,  172800 },{  4511,   86400 },
	{  4513,   86400 },{  4514,  172800 },{  4515,  129600 },{  4519, 1062720 },
	{  4520, 2808000 },{  4521, 1995840 },{  4522, 1105920 },{  4523, 1995840 },
	{  4524, 2808000 },{  4525, 1105920 },{  4526, 1995840 },{  4527, 2808000 },
	{  4528, 1995840 },{  4529, 1105920 },{  4530, 2808000 },{  4531, 1995840 },
	{  4532, 1105920 },{  4533, 2808000 },{  4534, 1330560 },{  4535, 1874880 },
	{  4536,  734400 },{  4537, 1874880 },{  4538,  734400 },{  4539, 1330560 },
	{  4540, 1330560 },{  4541,  734400 },{  4542, 1874880 },{  4543, 1330560 },
	{  4544,  734400 },{  4545, 1874880 },{  4546, 1330560 },{  4547,  734400 },
	{  4548, 1874880 },{  4549, 1874880 },{  4550,  734400 },{  4551, 1330560 },
	{  4552, 1874880 },{  4553,  734400 },{  4554, 1330560 },{  4555,  734400 },
	{  4556, 1874880 },{  4557, 1330560 },{  4558, 1330560 },{  4559,  734400 },
	{  4560, 1874880 },{  4561, 1874880 },{  4562,  734400 },{  4563, 1330560 },
	{  4564, 1874880 },{  4565,  734400 },{  4566, 1330560 },{  4567, 1330560 },
	{  4568, 1874880 },{  4569,  734400 },{  4570,  734400 },{  4571,  734400 },
	{  4572, 1874880 },{  4573, 1874880 },{  4574, 1330560 },{  4575, 1330560 },
	{  4576, 1874880 },{  4577,  734400 },{  4578, 1330560 },{  4579, 1330560 },
	{  4580, 1874880 },{  4581,  734400 },{  4582,  734400 },{  4583, 1874880 },
	{  4584, 1330560 },{  4585,  734400 },{  4586, 1874880 },{  4587, 1330560 },
	{  4588,  734400 },{  4589, 1330560 },{  4590, 1874880 },{  4591, 1874880 },
	{  4592, 1330560 },{  4593,  734400 },{  4594, 1874880 },{  4595,  734400 },
	{  4596, 1330560 },{  4597,  734400 },{  4598, 1330560 },{  4599, 1874880 },
	{  4600, 1874880 },{  4601, 1330560 },{  4602,  734400 },{  4603, 1874880 },
	{  4604, 1330560 },{  4605,  734400 },{  4606,  734400 },{  4607, 1330560 },
	{  4608, 1874880 },{  4609,  734400 },{  4610,  734400 },{  4611,  734400 },
	{  4612, 1874880 },{  4613,  734400 },{  4614, 1330560 },{  4615, 1874880 },
	{  4616, 1330560 },{  4617, 1874880 },{  4618, 1330560 },{  4619, 1874880 },
	{  4620, 1330560 },{  4621,  734400 },{  4622, 1874880 },{  4623, 1330560 },
	{  4624, 1330560 },{  4625,  734400 },{  4626, 1874880 },{  4700,   86400 },
	{  4701,   86400 },{  4707,  172800 },{  4708,  172800 },{  4709,  172800 },
	{  4710,  172800 },{  4711,  172800 },{  4712,  172800 },{  4713,  172800 },
	{  4715,  172800 },{  4716,  311040 },{  4717,  311040 },{  4719,  311040 },
	{  4720,  172800 },{  4721,  172800 },{  4722,  172800 },{  4724,  172800 },
	{  4725,  172800 },{  4726,  172800 },{  4727,  172800 },{  4728,  172800 },
	{  4729,  172800 },{  4730,  172800 },{  4731,  172800 },{  4732,  172800 },
	{  4733,  172800 },{  4734,  172800 },{  4735,  172800 },{  4736,  172800 },
	{  4737,  172800 },{  4738,  172800 },{  4739,  172800 },{  4740,  172800 },
	{  4741,  172800 },{  4742,  172800 },{  4743,  172800 },{  4744,  172800 },
	{  4745,  172800 },{  4746,  172800 },{  4747,  172800 },{  4748,  172800 },
	{  4749,  172800 },{  4750,  172800 },{  4751,  172800 },{  4752,  172800 },
	{  4753,  172800 },{  4754,  172800 },{  4755,  172800 },{  4756,  172800 },
	{  4800, 3974400 },{  4900,  112320 },{  5000,  172800 },{  5001,  172800 },
	{  5002,  172800 },{  5003,  172800 },{  5004,  172800 },{  5005,  172800 },
	{  5006,  172800 },{  5007,  172800 },{  5008,  172800 },{  5009,  172800 },
	{  5010,  172800 },{  5011,  172800 },{  5012,  172800 },{  5013,  172800 },
	{  5014,  172800 },{  5015,  172800 },{  5016,  172800 },{  5017,  172800 },
	{  5018,  172800 },{  5019,  172800 },{  5020,  172800 },{  5021,  172800 },
	{  5022,  172800 },{  5101,  432000 },{  5102,  691200 },{  5104,  518400 },
	{  5107,  518400 },{  5113, 2160000 },{  5114, 2160000 },{  5200,  172800 },
	{  5201,  172800 },{  5202,  172800 },{  5203,  172800 },{  5205,  172800 },
	{  5206,  172800 },{  5207,  172800 },{  5208,  172800 },{  5209,  172800 },
	{  5210,  172800 },{  5211,  172800 },{  5212,  172800 },{  5213,  172800 },
	{  5214,  172800 },{  5215,  172800 },{  5216,  172800 },{  5217,  172800 },
	{  5218,  172800 },{  5219,  172800 },{  5220,  172800 },{  5221,  172800 },
	{  5222,  172800 },{  5223,  172800 },{  5224,  172800 },{  5225,  172800 },
	{  5226,  172800 },{  5227,  172800 },{  5228,  172800 },{  5229,  172800 },
	{  5230,  172800 },{  5231,  172800 },{  5232,  172800 },{  5233,  172800 },
	{  5300,   86400 },{  5301,   86400 },{  5302,   86400 },{  5303,   86400 },
	{  5304,  345600 },{  5305,  345600 },{  5306,   86400 },{  5307,   86400 },
	{  5308,  259200 },{  5309,  259200 },{  5310,  259200 },{  5311,  259200 },
	{  5312,  345600 },{  5400,  172800 },{  5500,  172800 },{  5501,  172800 },
	{  5502,  172800 },{  5503,  172800 },{  5504,  172800 },{  5505,  172800 },
	{  5506,  172800 },{  5507,  172800 },{  5508,  172800 },{  5509,  172800 },
	{  5510,  172800 },{  5511,  172800 },{  5512,  172800 },{  5513,  172800 },
	{  5514,  172800 },{  5515,  172800 },{  5516,  172800 },{  5517,  172800 },
	{  5518,  172800 },{  5519,  172800 },{  5600,  172800 },{  5601,  172800 },
	{  5602,  172800 },{  5603,  172800 },{  5650,  172800 },{  5651,  172800 },
	{  5700,  172800 },{  5701,  172800 },{  5702,  172800 },{  5703,  172800 },
	{  5704,  172800 },{  5705,  172800 },{  5706,  172800 },{  5707,  172800 },
	{  5708,  172800 },{  5709,  172800 },{  5710,  172800 },{  5711,  172800 },
	{  5712,  172800 },{  5713,  172800 },{  5714,  172800 },{  5715,  172800 },
	{  5716,  172800 },{  5717,  172800 },{  5718,  172800 },{  5719,  172800 },
	{  5720,  172800 },{  5721,  172800 },{  5722,  172800 },{  5723,  172800 },
	{  5724,  172800 },{  5725,  172800 },{  5726,  172800 },{  5727,  172800 },
	{  5728,  172800 },{  5729,  172800 },{  5730,  172800 },{  5731,  172800 },
	{  5732,  172800 },{  5733,  172800 },{  5734,  172800 },{  5735,  172800 },
	{  5736,  172800 },{  5737,  172800 },{  5738,  172800 },{  5739,  172800 },
	{  5740,  172800 },{  5741,  172800 },{  5742,  172800 },{  5743,  172800 },
	{  5744,  172800 },{  5745,  172800 },{  5746,  172800 },{  5747,  172800 },
	{  5748,  172800 },{  5749,  172800 },{  5750,  172800 },{  5751,  172800 },
	{  5752,  172800 },{  5753,  172800 },{  5754,  172800 },{  5755,  172800 },
	{  5756,  172800 },{  5757,  172800 },{  5758,  172800 },{  5759,  172800 },
	{  5760,  172800 },{  5761,  172800 },{  5762,  172800 },{  5763,  172800 },
	{  5764,  172800 },{  5765,  172800 },{  5766,  172800 },{  5767,  172800 },
	{  5768,  172800 },{  5769,  172800 },{  5770,  172800 },{  5771,  172800 },
	{  5772,  172800 },{  5773,  345600 },{  5774,  345600 },{  5775,  345600 },
	{  5776,  345600 },{  5777,  345600 },{  5778,  345600 },{  5779,  345600 },
	{  5780,  345600 },{  5781, 1296000 },{  5782, 1296000 },{  5783, 1296000 },
	{  5784, 1296000 },{  5785, 1296000 },{  5786, 1296000 },{  5787,  864000 },
	{  5788,  864000 },{  5789,  864000 },{  5790,  864000 },{  5791,  864000 },
	{  5792,  864000 },{  5793,  864000 },{  5794,  864000 },{  5795,  864000 },
	{  5796,  864000 },{  5797,  864000 },{  5798,  864000 },{  5799, 1296000 },
	{  5800,  172800 },{  5801,  172800 },{  5900,  172800 },{  5901,  259200 },
	{  5902,  259200 },{  5903,  259200 },{  5904,  259200 },{  5905,  259200 },
	{  5906,  172800 },{  5907,  259200 },{  5908,  259200 },{  5909,  259200 },
	{  5910,  172800 },{  5911,  259200 },{  5912,  259200 },{  5913,  259200 },
	{  5914,  259200 },{  5915,  259200 },{  6001,  259200 },{  6002,  259200 },
	{  6004,  259200 },{  6005, 1036800 },{  6006,  259200 },{  6007,  259200 },
	{  6008,  259200 },{  6010,  172800 },{  6011,   86400 },{  6012,  259200 },
	{  6013,  259200 },{  6014,  259200 },{  6015,  259200 },{  6020,  259200 },
	{  6021,  259200 },{  6023,  259200 },{  6024,  259200 },{  6025,  259200 },
	{  6040,  518400 },{  6041,  518400 },{  6050,  259200 },{  6051,  259200 },
	{  6052,  259200 },{  6053,  259200 },{  6054,  259200 },{  6055,  259200 },
	{  6056,  259200 },{  6057,  259200 },{  6058,  259200 },{  6059,  259200 },
	{  6060,  259200 },{  6061,  259200 },{  6062,  259200 },{  6063,  259200 },
	{  6064,  259200 },{  6065,  259200 },{  6066,  259200 },{  6067,  259200 },
	{  6068,  259200 },{  6069,  259200 },{  6070,  259200 },{  6071,  259200 },
	{  6072,  259200 },{  6073,  259200 },{  6074,  259200 },{  6075,  259200 },
	{  6076,  259200 },{  6077,  259200 },{  6300,  864000 },{  6301, 3110400 },
	{  6302, 3110400 },{  6303, 3110400 },{  6304, 3110400 },{  6305,  864000 },
	{  6306,  864000 },{  6307, 3110400 },{  6313, 3110400 },{  6314, 3110400 },
	{  6315, 3110400 },{  6316, 3110400 },{  6317, 3110400 },{  6318, 3110400 },
	{  6319,  864000 },{  6320,  864000 },{  6321,  864000 },{  6322,  864000 },
	{  6323,  864000 },{  6324,  864000 },{  6325,  864000 },{  6326,  864000 },
	{  6327, 3110400 },{  6328,  864000 },{  6329,  864000 },{  6330,  864000 },
	{  6331,  864000 },{  6500, 3715200 },{  6501, 1987200 },{  6502,  950400 },
	{  6503, 1209600 },{  6504, 1814400 },{  6505, 1209600 },{  6507, 1555200 },
	{  6508, 1123200 },{  6509, 3024000 },{  6511, 1987200 },{  6512,  950400 },
	{  6513, 1209600 },{  6515, 1209600 },{  6516, 1814400 },{  6517, 1555200 },
	{  6518, 1123200 },{  6600,  518400 },{  6601,  518400 },{  6602,  518400 },
	{  6603,  518400 },{  6604,  518400 },{  6605,  518400 },{  6606,  518400 },
	{  6700,  259200 },{  6701,  423360 },{  6702,  423360 },{  9900,  172800 },
	{  9908,  172800 },{  9914,  172800 },{  9915,  103680 },{  9916,   86400 },
	{  9917,   86400 },{  9918,   86400 },{  9919,   86400 },{  9920,   86400 },
	{  9921,   86400 },{  9922,  172800 },{  9923,  172800 },{  9924,  172800 },
	{  9925,  172800 },{  9926,  172800 },{  9994,  103680 },{  9996,  112320 },
	{  9997,  103680 },{ 10000,  265248 },{ 10001,  158976 },{ 10002,  265248 },
	{ 10003,  158976 },{ 10004,  397440 },{ 10005,  397440 },{ 10006,  397440 },
	{ 10007,  397440 },{ 10008,  392256 },{ 10009,  396576 },{ 10010,  397440 },
	{ 10012,  396576 },{ 10013,  396576 },{ 10014,  396576 },{ 10015,  396576 },
	{ 10016,  396576 },{ 10017,  396576 },{ 10019,  396576 },{ 10020,  396576 },
	{ 10021,  396576 },{ 10022,  396576 },{ 10023,  396576 },{ 10024,  396576 },
	{ 10027,  396576 },{ 10030,  396576 },{ 10031,  396576 },{ 10032,  396576 },
	{ 10033,  396576 },{ 10034,  396576 },{ 10038,  396576 },{ 10039,  396576 },
	{ 10040,  530496 },{ 10041,  530496 },{ 10042,  396576 },{ 10043,  396576 },
	{ 10044,  396576 },{ 10045,  396576 },{ 10046,  396576 },{ 10047,  396576 },
	{ 10048,  396576 },{ 10049,  396576 },{ 10050,  396576 },{ 10051,  396576 },
	{ 10052,  396576 },{ 10053,  396576 },{ 10054,  396576 },{ 10055,  396576 },
	{ 10056,  396576 },{ 10057,  396576 },{ 10058,  396576 },{ 10059,  396576 },
	{ 10060,  397440 },{ 10061,  397440 },{ 10099,    7776 },{ 10101,  172800 },
	{ 10102,  172800 },{ 10103,  172800 },{ 10104,  172800 },{ 10105,  172800 },
	{ 10106,  172800 },{ 10107,  172800 },{ 10108,  172800 },{ 10200, 7948800 },
	{ 10203, 7948800 },{ 10300, 8640000 },{ 10301, 6048000 },{ 10400, 3110400 },
	{ 10401, 1987200 },{ 10402, 3110400 },{ 10501,  691200 },{ 10502,  691200 },
	{ 10503,  691200 },{ 10504,  691200 },{ 10505,  518400 },{ 10506,  691200 },
	{ 10510,  691200 },{ 10511,  691200 },{ 10512,  691200 },{ 10513,  691200 },
	{ 10514,  691200 },{ 10515,  691200 },{ 10516,  691200 },{ 10601,  432000 },
	{ 10626,  172800 },{ 10627,  172800 },{ 10628,  172800 },{ 10629,  172800 },
	{ 10630,  172800 },{ 10631,  172800 },{ 10632,  172800 },{ 10633,  172800 },
	{ 10641,  691200 },{ 10642,  691200 },{ 10643,  691200 },{ 10644,  691200 },
	{ 10645,  691200 },{ 10646,  691200 },{ 10647,  691200 },{ 10648,  691200 },
	{ 10649,  691200 },{ 10650,  691200 },{ 10651,  691200 },{ 10652,  691200 },
	{ 10653,  691200 },{ 10654,  691200 },{ 10655,  691200 },{ 10656,  691200 },
	{ 10657,  691200 },{ 10658,  691200 },{ 10659,  691200 },{ 10660,  691200 },
	{ 10661,  691200 },{ 10662,  691200 },{ 10663,  691200 },{ 10664,  691200 },
	{ 10665,  691200 },{ 10666,  691200 },{ 10667,  691200 },{ 10668,  691200 },
	{ 10669,  691200 },{ 10670,  691200 },{ 10671,  691200 },{ 10672,  691200 },
	{ 10673,  691200 },{ 10674,  691200 },{ 10675,  691200 },{ 10676,  691200 },
	{ 10677,  691200 },{ 10678,  691200 },{ 10679,  691200 },{ 10680,  691200 },
	{ 10681,  691200 },{ 10682,  691200 },{ 10683,  691200 },{ 10684,  691200 },
	{ 10685,  691200 },{ 10686,  691200 },{ 10687,  691200 },{ 10688,  691200 },
	{ 10689,  691200 },{ 10690,  691200 },{ 10691,  691200 },{ 10692,  691200 },
	{ 10820,  864000 },{ 10821,  864000 },{ 10822,  864000 },{ 10823,  864000 },
	{ 10824,  864000 },{ 10825,  864000 },{ 10826,  864000 },{ 10827,  864000 },
	{ 10828,  864000 },{ 10829,  864000 },{ 10830,  864000 },{ 10831,  864000 },
	{ 10832,  864000 },{ 10833,  864000 },{ 10834,  864000 },{ 10840,  432000 },
	{ 10841,  432000 },{ 10842,  432000 },{ 10843,  432000 },{ 10844,  432000 },
	{ 10845,  432000 },{ 10846,  432000 },{ 10847,  432000 },{ 10848,  432000 },
	{ 10849,  432000 },{ 10850,  432000 },{ 10851,  432000 },{ 10852,  432000 },
	{ 10853,  432000 },{ 10854,  432000 },{ 10861, 3456000 },{ 10862, 3456000 },
	{ 10863, 3456000 },{ 10864, 3456000 },{ 10865, 3456000 },{ 10866, 3456000 },
	{ 10867, 3456000 },{ 10868, 3456000 },{ 10869, 3456000 },{ 10870, 3456000 },
	{ 10871, 3456000 },{ 10872, 3456000 },{ 10873, 3456000 },{ 10874, 3456000 },
	{ 10875, 3456000 },{ 10876,  432000 },{ 10877,  432000 },{ 10878,  432000 },
	{ 10879,  432000 },{ 10880,  432000 },{ 10881,  432000 },{ 10882,  432000 },
	{ 10883,  432000 },{ 10884,  432000 },{ 10885,  432000 },{ 10886,  432000 },
	{ 10887,  432000 },{ 10888,  432000 },{ 10889,  432000 },{ 10890,  432000 },
	{ 10891, 3456000 },{ 10892, 3456000 },{ 10893, 3456000 },{ 10894, 3456000 },
	{ 10895, 2332800 },{ 10896, 1209600 },{ 10897, 1209600 },{ 10898, 1209600 },
	{ 10899, 1209600 },{ 10900, 1209600 },{ 10901, 3456000 },{ 10910, 2419200 },
	{ 10911, 2419200 },{ 10912, 2419200 },{ 10913, 2419200 },{ 10914, 2419200 },
	{ 10915, 2419200 },{ 10927, 1209600 },{ 10928, 1209600 },{ 10929, 1209600 },
	{ 10930, 1209600 },{ 10931, 1209600 },{ 10932, 1209600 },{ 10933, 1209600 },
	{ 10934, 1209600 },{ 10935, 1209600 },{ 10936, 1209600 },{ 10937, 1209600 },
	{ 10938, 1209600 },{ 10939, 1209600 },{ 10940, 1209600 },{ 10941, 1209600 },
	{ 10942, 1209600 },{ 10943, 1209600 },{ 10944, 1209600 },{ 10945, 1209600 },
	{ 10946, 1209600 },{ 10947, 1209600 },{ 10948, 1209600 },{ 10949, 1209600 },
	{ 10950, 1209600 },{ 10951, 1209600 },{ 10952, 1209600 },{ 10953, 1209600 },
	{ 10954, 1209600 },{ 10955, 1209600 },{ 10956, 1209600 },{ 10957, 1209600 },
	{ 10958, 1209600 },{ 10959, 1209600 },{ 10960, 1209600 },{ 10961, 1209600 },
	{ 10962, 1209600 },{ 10963, 1209600 },{ 10964, 1209600 },{ 10965, 1209600 },
	{ 10966, 1209600 },{ 10967, 1209600 },{ 10968, 1209600 },{ 10969, 1209600 },
	{ 10970, 1209600 },{ 10971, 1209600 },{ 10972, 1209600 },{ 10973, 1209600 },
	{ 10974, 1209600 },{ 10975, 1209600 },{ 10976, 1209600 },{ 10977, 1209600 },
	{ 10978, 1209600 },{ 11101, 1209600 },{ 11102, 1209600 },{ 11103, 1209600 },
	{ 11104, 1209600 },{ 11105, 1209600 },{ 11106, 1209600 },{ 11107, 1209600 },
	{ 11108, 1209600 },{ 11109, 1209600 },{ 11110, 1209600 },{ 11111, 1209600 },
	{ 11112, 1209600 },{ 11113, 1209600 },{ 11114, 1209600 },{ 11115, 1209600 },
	{ 11116, 1209600 },{ 11117, 1209600 },{ 11118, 1209600 },{ 11119, 1209600 },
	{ 11120, 1209600 },{ 11121, 1209600 },{ 11122, 1209600 },{ 11123, 1209600 },
	{ 11124, 1209600 },{ 11125, 1209600 },{ 11126, 1209600 },{ 11127, 1209600 },
	{ 11128, 1209600 },{ 11129, 1209600 },{ 11130, 1209600 },{ 11131, 1209600 },
	{ 11132, 1209600 },{ 11133, 1209600 },{ 11134, 1209600 },{ 11135, 1209600 },
	{ 11136, 1209600 },{ 11137, 1209600 },{ 11138, 1209600 },{ 11139, 1209600 },
	{ 11140, 1209600 },{ 11141, 1209600 },{ 11142, 1209600 },{ 11143, 1209600 },
	{ 11144, 1209600 },{ 11145, 1209600 },{ 11146, 1209600 },{ 11147, 1209600 },
	{ 11148, 1209600 },{ 11149, 1209600 },{ 11150, 1209600 },{ 11151, 1209600 },
	{ 11152, 1209600 },{ 11153, 1728000 },{ 11154, 1728000 },{ 11155, 1728000 },
	{ 11156, 1728000 },{ 11157, 1728000 },{ 11158, 1641600 },{ 11160, 1728000 },
	{ 11161, 1728000 },{ 11162, 1728000 },{ 11163, 1728000 },{ 11164, 1728000 },
	{ 11165, 1728000 },{ 11166, 1641600 },{ 11167, 1728000 },{ 11201, 1209600 },
	{ 11202, 1209600 },{ 11203, 1209600 },{ 11204, 1209600 },{ 11205, 1209600 },
	{ 11206, 1209600 },{ 11207, 1209600 },{ 11208, 1209600 },{ 11209, 1209600 },
	{ 11210, 1209600 },{ 11211, 1209600 },{ 11212, 1209600 },{ 11213, 1209600 },
	{ 11214, 1209600 },{ 11215, 1209600 },{ 11216, 1209600 },{ 11217, 1209600 },
	{ 11218, 1209600 },{ 11219, 1209600 },{ 11220, 1209600 },{ 11221, 1209600 },
	{ 11222, 1209600 },{ 11223, 1209600 },{ 11224, 1209600 },{ 11225, 1209600 },
	{ 11226, 1209600 },{ 11227, 1209600 },{ 11228, 1209600 },{ 11229, 1209600 },
	{ 11230, 1209600 },{ 11231, 1209600 },{ 11232, 1209600 },{ 11233, 1209600 },
	{ 11234, 1209600 },{ 11235, 1209600 },{ 11236, 1209600 },{ 11237, 1209600 },
	{ 11238, 1209600 },{ 11239, 1209600 },{ 11240, 1209600 },{ 11241, 1209600 },
	{ 11242, 1209600 },{ 11243, 1209600 },{ 11244, 1209600 },{ 11245, 1209600 },
	{ 11246, 1209600 },{ 11247, 1209600 },{ 11248, 1209600 },{ 11249, 1209600 },
	{ 11250, 1209600 },{ 11251, 1209600 },{ 11252, 1209600 },{ 11253, 1209600 },
	{ 11254, 1209600 },{ 11255, 1209600 },{ 11256, 1209600 },{ 11257, 1209600 },
	{ 11258, 1209600 },{ 11259, 1209600 },{ 11260, 1209600 },{ 11261, 1209600 },
	{ 11262, 1209600 },{ 11263, 1209600 },{ 11264, 1209600 },{ 11265, 1209600 },
	{ 11266, 1209600 },{ 11267, 1209600 },{ 11268, 1209600 },{ 11269, 1209600 },
	{ 11270, 1209600 },{ 11271, 1209600 },{ 11272, 1209600 },{ 11273, 3456000 },
	{ 11274, 3456000 },{ 11275, 3456000 },{ 11276, 3456000 },{ 11277, 3456000 },
	{ 11278, 3456000 },{ 11279, 3456000 },{ 11280, 2419200 },{ 11281, 2419200 },
	{ 11282, 2419200 },{ 11283, 2419200 },{ 11284, 2419200 },{ 11285, 2419200 },
	{ 11286, 2419200 },
	{  6040,  345600, 0x13491751 },{  6041,  345600, 0x13491751 },{  6701,  276480, 0x13CE30C1 },
	{  6702,  345600, 0x13CE30C1 },{ 10004,   79488, 0x131325F2 },{ 10006,   39744, 0x131325F2 },
	{ 10007,   19872, 0x131325F2 },{ 10008,   26784, 0x131325F2 },{ 10300, 4320000, 0x13458541 },
	{ 10301, 3024000, 0x13458541 },{ 10626,  259200, 0x138FF3F1 },{ 10627,  259200, 0x138FF3F1 },
	{ 0 }
 };

struct pkent pktbl[] =		/* Built-in table, from "pk" and "kh" entries */
 {	{  2630,310 },{  2631,310 },{  2632,288 },{  2633,310 },{  2681,200 },
	{  2682,2640 },{  2683,200 },{  2684,2640 },{  2685,2640 },{  2686,2640 },
	{  2689,3520 },{  2690,2500 },{  2692,2640 },{  6012,200 },{  6013,336 },
	{  6014,210 },{  6015,210 },{  6020,200 },{  6021,210 },{  6023,210 },
	{  6024,210 },{  6025,210 },{  6040,463 },{  6041,463 },{  6050,210 },
	{  6051,210 },{  6052,210 },{  6053,210 },{  6054,210 },{  6055,210 },
	{  6056,210 },{  6057,210 },{  6058,210 },{  6059,210 },{  6060,210 },
	{  6061,210 },{  6062,210 },{  6063,210 },{  6064,210 },{  6065,210 },
	{  6066,210 },{  6067,210 },{  6068,210 },{  6069,210 },{  6070,210 },
	{  6071,210 },{  6072,210 },{  6073,210 },{  6074,210 },{  6075,210 },
	{  6076,210 },{  6077,210 },{  6700,230 },{  6701,410 },{  6702,410 },
	{  2682,200, 0x13EE0D01 },{  6040,620, 0x13491751 },{  6041,620, 0x13491751 },
	{ 0 }
 };

#ifndef DATE
# define DATE "FOR TEST ONLY"
#endif
#ifndef FREV
# define FREV "EXPERIMENTAL"
#endif
#ifndef PGEN
# define PGEN 0
#endif

/* Finally, the program! */

int main(int argc, char *argv[])		/* qd */
{
char *argv0;
char *s1;
int f, i, j, k;
unsigned int m, n;
int estat;
bool gf;
float bst, bsp, bbst, bbsp, abst, absp, abbst, abbsp;
unsigned int cl, aibe;
unsigned int et, xt, pd, bet;
float fc, fcl, d, g, kf, ppd;
int tcl, tcc;
struct ptent *pb;
struct pdent *pdb;
struct pkent *pkb;
struct qs *p;
struct qf *bp;
u32 *tp, *dp;
char *q;
int na, nb, nc;
u32 ut, mt, it, pg, ct;
int za;
char zc;
char *pn;
char uf[2];
char emn[100];
int emd;
float emp;
int proj;
struct stat st, st2, st3;
float pfract;

	argv0 = argv[0];
	qfil = "queue.dat";
	nfil = "qdinfo.dat";
	mfil = NULL;			/* Default will try <emprotz.dat> first, then <emprotx.dat> */
	fpm = NULL;
	fdir = "";
	lid = NULL;
	systype = SYSTYPE;		/* Default is native queue type */
	eswap = FALSE;
	qver = DEFQVER;
	tzone = TZONE;
	idnt = "  ";
	aibe = FALSE;			/* Assume Assignment Info is Little Endian by default */

	/* Parse arguments */

	while (--argc > 0)
	{	++argv;
		if (*argv[0] == '-')
		{	s1 = *argv;
			while (*++s1 != '\0')
				switch (*s1)
				{
				default:
us:					fprintf(stderr, "\n\
Usage: %.200s [<flags> <arguments required by flags>]*\n", argv0);
					fprintf(stderr,"\
 -u      Print this usage message (and exit)\n\
 -h      Print an explanation of the status codes (and exit)\n\
 -i      Format with deeper indentation\n\
 -c      Compact format (omit several lines)\n\
 -C      Only show current index\n\
 -p      Don't look at FAH files other than <queue.dat>\n\
 -P      Print extra Project, Run, Clone, Generation line like in FAHlog.txt\n\
 -a      Show all, also displays the passkey if it's set\n\
 -f dir  Explicitly specify folding directory\n\
 -q file Explicitly specify queue data file (implies -p)\n\
 -n file Explicitly specify qd info file\n\
 -m file Explicitly specify EM III info file\n");
					fprintf(stderr,"\
 -s {linux, windows, mac-ppc, mac-x86}  Specify type of queue data file\n\
 -t zone Override time zone (+HHMM or -HHMM)\n\
 -z      Force UTC (same as -t +0000)\n\
 -v      Just print version information and stop\n\
 -d      Print debug dump\n\
 -e      Print all entries even if they're garbage\n\
 -l      Format for log entry data\n\
 -L      Format for log entry data with specified ID string\n\
 -x      Print output in Well Formed XML\n\
 -X      Print output in Valid XML with Inline DTD\n");
#ifdef NOTYET
					fprintf(stderr,"\
 -b      Just print out benchmark number (like \"qbm\")\n\
 -r      Detect and fix errors (like \"qfix\")\n");
#endif
					exit(1);

				case 'h':		/* Print an explanation of the status codes */
					fprintf(stderr, "\n\
The status code for each queue entry may be interpreted as follows:\n\n\
(0) empty\n\
  The queue entry has never been used, or has been completely cleared.\n\
(0) deleted\n\
  The unit was explicitly deleted.\n\
(0) finished\n\
  The unit has been uploaded.  The queue entry is just history.\n\
(0) garbage\n\
  The queue entry is available, but its history is unintelligible.\n");
					fprintf(stderr, "\
(1) folding now\n\
  The unit is in progress.  Presumably the core is running.\n\
(1) queued for processing\n\
  The unit has been downloaded but processing hasn't begun yet.\n\
(2) ready for upload\n\
  The core has finished the unit, but it is still in the queue.\n\
(3) DANGER will be lost if client is restarted!\n\
  Bug before V3b5, neglected to post status (1).\n\
(3) abandoned\n\
  Bug before V3b5, neglected to post status (1), and client was restarted.\n");
					fprintf(stderr, "\
(4) fetching from server\n\
  Client presently contacting the server, or something failed in download.\n\
  If this state persists past the current unit, the queue entry will be\n\
  unusable, but otherwise things will go on as usual.\n\
(?) UNKNOWN STATUS = ??\n\
  Something other than 0 to 4.\n");
					exit(0);

				case 'i':		/* Format with deeper indentation */
					f_indt = TRUE;
					idnt = "   ";
					break;
				case 'c':		/* Print compact format (omit several lines) */
					f_cpct = TRUE;
					break;
				case 'C':		/* Only show current index */
					f_curr = TRUE;
					break;
				case 'q':		/* Explicitly specify queue data file (implies -p) */
					if (--argc <= 0)
					{	q = "Missing queue file name argument";
						goto pe;
					}
					qfil = *++argv;
				case 'p':		/* Don't look at FAH files other than <queue.dat> */
					f_only = TRUE;
					break;
				case 'P':		/* Print extra Project, Run, Clone, Generation line like in FAHlog.txt */
					f_prcg = TRUE;
					break;
				case 'a':		/* Show all, also displays the passkey if it's set */
					f_show = TRUE;
					break;
				case 'n':		/* Explicitly specify qd info file */
					if (--argc <= 0)
					{	q = "Missing qd info file name argument";
						goto pe;
					}
					nfil = *++argv;
					break;
				case 'm':		/* Explicitly specify EM III info file */
					if (--argc <= 0)
					{	q = "Missing EM III info file name argument";
						goto pe;
					}
					mfil = *++argv;
					break;
				case 's':		/* Specify queue file type */
					if (--argc <= 0)
					{	q = "Missing queue file type argument";
						goto pe;
					}
					if (strcasecmp(*++argv, "linux") == 0)
					{
						systype = 0;
					}
					else if (strcasecmp(*argv, "windows") == 0)
					{
						systype = 1;
					}
                                        else if (  (strcasecmp(*argv, "mac") == 0) 
					        || (strcasecmp(*argv, "mac-ppc") == 0)
						)
                                        {
                                        	systype = 2;
                                        }
					else if (strcasecmp(*argv, "mac-x86") == 0)
					{
						systype = 3;
					}
					else
					{	q = "Invalid queue file type argument";
						goto pe;
					}
					f_styp = TRUE;
					break;
				case 'f':		/* Explicitly specify folding directory */
					if (--argc <= 0)
					{	q = "Missing folding directory name argument";
						goto pe;
					}
					fdir = *++argv;
					break;
				case 't':		/* Override time zone (needs argument) */
					if (--argc <= 0)
					{	q = "Missing time zone argument";
						goto pe;
					}
					q = *++argv;
					if	(	(strlen(q) != 5)
						||	((q[0] != '+') && (q[0] != '-'))
						||	(sscanf(&q[1], "%4d%c", &za, &zc) != 1)
						||	(za < 0)
						||	((za % 100) >= 60)
						||	(za >= 2400)
						)
					{	q = "Bad time zone argument";
pe:						fprintf(stderr,"\n%.200s: %.200s\n", argv0, q);
						goto us;
					}
					tzone = za * 36 + (za % 100) * 24;
					if (q[0] == '-')
						tzone = -tzone;
					goto tz;
				case 'z':		/* Force UTC */
					tzone = 0;
tz:					f_zone = TRUE;	/* Suppress use of "ctime" */
					break;
				case 'v':		/* Just print version information and stop */
					f_pver = TRUE;
					break;
				case 'd':		/* Print debug dump */
					f_dbgd = TRUE;
					break;
				case 'e':		/* Print all entries even if they're garbage */
					f_pall = TRUE;
					break;
				case 'l':		/* Format for log entry data */
					f_logd = TRUE;
					break;
				case 'L':		/* Format for log entry data, with ID string */
					if (--argc <= 0)
					{	q = "Missing log entry ID string argument";
						goto pe;
					}
					f_logd = TRUE;
					lid = *++argv;
					break;
				case 'x':		/* Print output in Well Formed XML */
					f_xmld = TRUE;
					break;
				case 'X':		/* Print output in Valid XML with Inline DTD in the DOCTYPE */
					f_xdtd = TRUE;
					
					/* -X also implies -x */
					f_xmld = TRUE;
#ifdef NOTYET
					break;
				case 'b':		/* Just print out benchmark number (like "qbm") */
					f_pqbm = TRUE;
					break;
				case 'r':		/* Detect and fix errors (like "qfix") */
					f_qfix = TRUE;
#endif
				}
			continue;
		}
		else goto us;
	}

	/* Set up points table in "pbuf", merge info from info file (qdinfo.dat) */

	memset(pbuf, 0, sizeof(pbuf));
	memcpy(pbuf, ptbl, sizeof(ptbl));
	for (pb = pbuf; pb->proj != 0; ++pb)
	{
		if (pb->until == 0)
		{
			pb->until = 0xFFFFFFFF;
		}
	}

	/* Set up preferred deadline table in "pdbuf", merge info from info file (qdinfo.dat) */
	memset(pdbuf, 0, sizeof(pdbuf));
	memcpy(pdbuf, pdtbl, sizeof(pdtbl));
	for (pdb = pdbuf; pdb->proj != 0; ++pdb)
	{
		if (pdb->until == 0)
		{
			pdb->until = 0xFFFFFFFF;
		}
	}

	/* Set up kfactor table in "pkbuf", merge info from info file (qdinfo.dat) */
	memset(pkbuf, 0, sizeof(pkbuf));
	memcpy(pkbuf, pktbl, sizeof(pktbl));
	for (pkb = pkbuf; pkb->proj != 0; ++pkb)
	{
		if (pkb->until == 0)
		{
			pkb->until = 0xFFFFFFFF;
		}
	}

	if(f_xmld == TRUE) 
	{
		printf("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");
		if(f_xdtd == TRUE)
		{
			printf("<!DOCTYPE queue_dump [\n");
			printf("  <!ELEMENT queue_dump                (\n");
			printf("                                       qd,\n");
			printf("                                       qdinfo?,\n");
			printf("                                       notice*,\n");
			printf("                                       executed?,\n");
			printf("                                       executed_utc?,\n");
			printf("                                       error?,\n");
			printf("                                       queue?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT qd                        (\n");
			printf("                                       date,\n");
			printf("                                       functional_revision\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT date                      (#PCDATA)>\n");
			printf("  <!ELEMENT functional_revision       (#PCDATA)>\n");
			printf("  <!ELEMENT qdinfo                    (#PCDATA)>\n");
			printf("  <!ELEMENT notice                    (#PCDATA)>\n");
			printf("  <!ELEMENT executed                  (#PCDATA)>\n");
			printf("  <!ELEMENT executed_utc              (#PCDATA)>\n");
			printf("  <!ELEMENT error                     (#PCDATA)>\n");
			printf("  <!ELEMENT queue                     (\n");
			printf("                                       version,\n");
			printf("                                       system_type?,\n");
			printf("                                       warning?,\n");
			printf("                                       current_index,\n");
			printf("                                       index+,\n");
			printf("                                       results_successfully_sent?,\n");
			printf("                                       download_rate?,\n");
			printf("                                       upload_rate?,\n");
			printf("                                       performance_fraction?,\n");
			printf("                                       pph?,\n");
			printf("                                       ppd?,\n");
			printf("                                       ppw?,\n");
			printf("                                       ppy?,\n");
			printf("                                       bonus_pph?,\n");
			printf("                                       bonus_ppd?,\n");
			printf("                                       bonus_ppw?,\n");
			printf("                                       bonus_ppy?,\n");
			printf("                                       alternate_pph?,\n");
			printf("                                       alternate_ppd?,\n");
			printf("                                       alternate_ppw?,\n");
			printf("                                       alternate_ppy?,\n");
			printf("                                       alternate_bonus_pph?,\n");
			printf("                                       alternate_bonus_ppd?,\n");
			printf("                                       alternate_bonus_ppw?,\n");
			printf("                                       alternate_bonus_ppy?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT version                   (#PCDATA)>\n");
			printf("  <!ELEMENT system_type               (#PCDATA)>\n");
			printf("  <!ELEMENT warning                   (#PCDATA)>\n");
			printf("  <!ELEMENT current_index             (#PCDATA)>\n");
			printf("  <!ELEMENT index                     (\n");
			printf("                                       number,\n");
			printf("                                       status,\n");
			printf("                                       points?,\n");
			printf("                                       points_per_hour?,\n");
			printf("                                       points_per_day?,\n");
			printf("                                       progress_rate?,\n");
			printf("                                       progress?,\n");
			printf("                                       bonus_points?,\n");
			printf("                                       bonus_points_per_hour?,\n");
			printf("                                       bonus_points_per_day?,\n");
			printf("                                       bonus_factor?,\n");
			printf("                                       kfactor?,\n");
			printf("                                       server*,\n");
			printf("                                       project_number?,\n");
			printf("                                       project_name?,\n");
			printf("                                       genome*,\n");
			printf("                                       folding*,\n");
			printf("                                       issue_timestamp?,\n");
			printf("                                       begin_timestamp?,\n");
			printf("                                       end_timestamp?,\n");
			printf("                                       expect_timestamp?,\n");
			printf("                                       due_timestamp?,\n");
			printf("                                       expire_timestamp?,\n");
			printf("                                       deadline?,\n");
			printf("                                       preferred_timestamp?,\n");
			printf("                                       preferred_deadline?,\n");
			printf("                                       core?,\n");
			printf("                                       cpu?,\n");
			printf("                                       os?,\n");
			printf("                                       smp_cores?,\n");
			printf("                                       use_cores?,\n");
			printf("                                       tag?,\n");
			printf("                                       passkey?,\n");
			printf("                                       flops?,\n");
			printf("                                       megaflops?,\n");
			printf("                                       memory?,\n");
			printf("                                       gpu_memory?,\n");
			printf("                                       client_type?,\n");
			printf("                                       assignment_info?,\n");
			printf("                                       collection_server?,\n");
			printf("                                       download_timestamp?,\n");
			printf("                                       upload_failures?,\n");
			printf("                                       packet_size_limit?,\n");
			printf("                                       qgen?,\n");
			printf("                                       username?,\n");
			printf("                                       team?,\n");
			printf("                                       id?,\n");
			printf("                                       machine_id?,\n");
			printf("                                       work_unit?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT number                    (#PCDATA)>\n");
			printf("  <!ELEMENT status                    (#PCDATA)>\n");
			printf("  <!ELEMENT points                    (#PCDATA)>\n");
			printf("  <!ELEMENT points_per_hour           (#PCDATA)>\n");
			printf("  <!ELEMENT points_per_day            (#PCDATA)>\n");
			printf("  <!ELEMENT progress_rate             (#PCDATA)>\n");
			printf("  <!ELEMENT progress                  (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_points              (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_points_per_hour     (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_points_per_day      (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_factor              (#PCDATA)>\n");
			printf("  <!ELEMENT kfactor                   (#PCDATA)>\n");
			printf("  <!ELEMENT server                    (\n");
			printf("                                       number,\n");
			printf("                                       address\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT address                   (#PCDATA)>\n");
			printf("  <!ELEMENT project_number            (#PCDATA)>\n");
			printf("  <!ELEMENT project_name              (#PCDATA)>\n");
			printf("  <!ELEMENT genome                    (\n");
			printf("                                       unit?,\n");
			printf("                                       benchmark?,\n");
			printf("                                       misc?,\n");
			printf("                                       other?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT unit                      (#PCDATA)>\n");
			printf("  <!ELEMENT benchmark                 (#PCDATA)>\n");
			printf("  <!ELEMENT misc                      (#PCDATA)>\n");
			printf("  <!ELEMENT other                     (#PCDATA)>\n");
			printf("  <!ELEMENT folding                   (\n");
			printf("                                       run?,\n");
			printf("                                       clone?,\n");
			printf("                                       generation?,\n");
			printf("                                       benchmark?,\n");
			printf("                                       misc?,\n");
			printf("                                       other?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT run                       (#PCDATA)>\n");
			printf("  <!ELEMENT clone                     (#PCDATA)>\n");
			printf("  <!ELEMENT generation                (#PCDATA)>\n");
			printf("  <!ELEMENT issue_timestamp           (#PCDATA)>\n");
			printf("  <!ELEMENT begin_timestamp           (#PCDATA)>\n");
			printf("  <!ELEMENT end_timestamp             (#PCDATA)>\n");
			printf("  <!ELEMENT expect_timestamp          (#PCDATA)>\n");
			printf("  <!ELEMENT due_timestamp             (#PCDATA)>\n");
			printf("  <!ELEMENT expire_timestamp          (#PCDATA)>\n");
			printf("  <!ELEMENT deadline                  (#PCDATA)>\n");
			printf("  <!ELEMENT preferred_timestamp       (#PCDATA)>\n");
			printf("  <!ELEMENT preferred_deadline        (#PCDATA)>\n");
			printf("  <!ELEMENT core                      (\n");
			printf("                                       url?,\n");
			printf("                                       version?,\n");
			printf("                                       number,\n");
			printf("                                       name?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT url                       (#PCDATA)>\n");
			printf("  <!ELEMENT name                      (#PCDATA)>\n");
			printf("  <!ELEMENT cpu                       (\n");
			printf("                                       cosm_type?,\n");
			printf("                                       cosm_subtype?,\n");
			printf("                                       name?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT cosm_type                 (#PCDATA)>\n");
			printf("  <!ELEMENT cosm_subtype              (#PCDATA)>\n");
			printf("  <!ELEMENT os                        (\n");
			printf("                                       cosm_type?,\n");
			printf("                                       cosm_subtype?,\n");
			printf("                                       name?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT smp_cores                 (#PCDATA)>\n");
			printf("  <!ELEMENT use_cores                 (#PCDATA)>\n");
			printf("  <!ELEMENT tag                       (#PCDATA)>\n");
			printf("  <!ELEMENT passkey                   (#PCDATA)>\n");
			printf("  <!ELEMENT flops                     (#PCDATA)>\n");
			printf("  <!ELEMENT megaflops                 (#PCDATA)>\n");
			printf("  <!ELEMENT memory                    (#PCDATA)>\n");
			printf("  <!ELEMENT gpu_memory                (#PCDATA)>\n");
			printf("  <!ELEMENT client_type               (\n");
			printf("                                       type?,\n");
			printf("                                       name?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT type                      (#PCDATA)>\n");
			printf("  <!ELEMENT assignment_info           (\n");
			printf("                                       byte_order?,\n");
			printf("                                       timestamp?,\n");
			printf("                                       checksum?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT byte_order                (#PCDATA)>\n");
			printf("  <!ELEMENT timestamp                 (#PCDATA)>\n");
			printf("  <!ELEMENT checksum                  (#PCDATA)>\n");
			printf("  <!ELEMENT collection_server         (#PCDATA)>\n");
			printf("  <!ELEMENT download_timestamp        (#PCDATA)>\n");
			printf("  <!ELEMENT upload_failures           (#PCDATA)>\n");
			printf("  <!ELEMENT packet_size_limit         (#PCDATA)>\n");
			printf("  <!ELEMENT qgen                      (#PCDATA)>\n");
			printf("  <!ELEMENT username                  (#PCDATA)>\n");
			printf("  <!ELEMENT team                      (#PCDATA)>\n");
			printf("  <!ELEMENT id                        (#PCDATA)>\n");
			printf("  <!ELEMENT machine_id                (#PCDATA)>\n");
			printf("  <!ELEMENT work_unit                 (\n");
			printf("                                       file,\n");
			printf("                                       size,\n");
			printf("                                       type?\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT file                      (#PCDATA)>\n");
			printf("  <!ELEMENT size                      (#PCDATA)>\n");
			printf("  <!ELEMENT results_successfully_sent (#PCDATA)>\n");
			printf("  <!ELEMENT download_rate             (\n");
			printf("                                       speed,\n");
			printf("                                       units\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT speed                     (#PCDATA)>\n");
			printf("  <!ELEMENT units                     (#PCDATA)>\n");
			printf("  <!ELEMENT upload_rate               (\n");
			printf("                                       speed,\n");
			printf("                                       units\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT performance_fraction      (\n");
			printf("                                       fraction,\n");
			printf("                                       units\n");
			printf("                                      )>\n");
			printf("  <!ELEMENT fraction                  (#PCDATA)>\n");
			printf("  <!ELEMENT pph                       (#PCDATA)>\n");
			printf("  <!ELEMENT ppd                       (#PCDATA)>\n");
			printf("  <!ELEMENT ppw                       (#PCDATA)>\n");
			printf("  <!ELEMENT ppy                       (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_pph                 (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_ppd                 (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_ppw                 (#PCDATA)>\n");
			printf("  <!ELEMENT bonus_ppy                 (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_pph             (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_ppd             (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_ppw             (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_ppy             (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_bonus_pph       (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_bonus_ppd       (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_bonus_ppw       (#PCDATA)>\n");
			printf("  <!ELEMENT alternate_bonus_ppy       (#PCDATA)>\n");
			printf("]>\n");
		}
		printf("<queue_dump>\n");
		printf("  <qd>\n");
		printf("    <date>%s</date>\n", DATE);
		printf("    <functional_revision>%s</functional_revision>\n", FREV);
		printf("  </qd>\n");
	}
	else 
	{
		printf("qd released %s (fr %s)", DATE, FREV);
	}
	cfn(nfil, 0);		/* Try to get data from qd info file */
	if ((fp = fopen(wbuf, "rb")) != NULL)
	{	while (fgets(wbuf, sizeof(wbuf), fp) != NULL)
		{	nbuf[0] = '\0';
			sscanf(wbuf, "%20s%n", nbuf, &za);
			q = wbuf + za;
			if	(	(strcmp(nbuf, "da") == 0)
				||	(strcmp(nbuf, "fr") == 0)
				)
			{	while ((*q == ' ') || (*q == '\t')) ++q;
				for	(	s1 = q + strlen(q) - 1
					;	(	(*s1 == 0x0A)
						||	(*s1 == 0x0D)
						||	(*s1 == ' ')
						||	(*s1 == '\t')
						)
					;	--s1
					) ;
				if (s1 > q)
				{	*++s1 = '\0';
					if (strcmp(nbuf, "da") == 0)
					{
						if(f_xmld == TRUE)
						{
							printf("  <qdinfo>%.50s</qdinfo>\n", q);
						}
						else
						{
							printf("; qd info %.50s", q);
						}
					}
					else if ((i = strcmp(q, FREV)) > 0)
					{
						if(f_xmld == TRUE)
						{
							printf("  <notice>This version of &quot;qd&quot; is out of date (info file is fr %.10s).</notice>\n", q);
						}
						else {
							printf("\n\
** NOTICE: This version of \"qd\" is out of date (info file is fr %.10s). **", q);
						}
					}
					else if (i < 0)
					{
						f_oldi = TRUE;
					}
				}
			}
			if (strcmp(nbuf, "pg") == 0)
			{	pg = 0;
				sscanf(q, "%x", &pg);
				if (pg < PGEN)
				{
					f_oldi = TRUE;
				}
				else
				{
					f_oldi = FALSE;
				}
			}
			else if (strcmp(nbuf, "pt") == 0)
			{
				while (sscanf(q, "%d%u%n", &nb, &cl, &za) >= 2)
				{	q += za;
					for (pb = pbuf; pb->proj != 0; ++pb)
						if ((pb->proj == nb) && (pb->until == 0xFFFFFFFF)) break;
					if ((pb->proj == 0) || (f_oldi == FALSE))
					{	pb->proj = nb;
						pb->points = cl;
						pb->until = 0xFFFFFFFF;
					}
				}
			}
			else if (strcmp(nbuf, "ph") == 0)
			{
				while (sscanf(q, "%d%u%x%n", &nb, &cl, &ut, &za) >= 3)
				{	q += za;
					for (pb = pbuf; pb->proj != 0; ++pb)
						if ((pb->proj == nb) && (pb->until == ut)) break;
					pb->proj = nb;
					pb->points = cl;
					pb->until = ut;
				}
			}
			else if (strcmp(nbuf, "pd") == 0)
			{
				while (sscanf(q, "%d%u%n", &nb, &cl, &za) >= 2)
				{	q += za;
					for (pdb = pdbuf; pdb->proj != 0; ++pdb)
						if ((pdb->proj == nb) && (pdb->preferred == cl)) break;
					if ((pdb->proj == 0) || (f_oldi == FALSE))
					{	pdb->proj      = nb;
						pdb->preferred = cl;
						pdb->until = 0xFFFFFFFF;
					}
				}
			}
			else if (strcmp(nbuf, "dh") == 0)
			{
				while (sscanf(q, "%d%u%x%n", &nb, &cl, &ut, &za) >= 3)
				{	q += za;
					for (pdb = pdbuf; pdb->proj != 0; ++pdb)
						if ((pdb->proj == nb) && (pdb->until == ut)) break;
					pdb->proj = nb;
					pdb->preferred = cl;
					pdb->until = ut;
				}
			}
			else if (strcmp(nbuf, "pk") == 0)
			{
				while (sscanf(q, "%d%u%n", &nb, &cl, &za) >= 2)
				{	q += za;
					for (pkb = pkbuf; pkb->proj != 0; ++pkb)
						if ((pkb->proj == nb) && (pkb->until == 0xFFFFFFFF)) break;
					if ((pkb->proj == 0) || (f_oldi == FALSE))
					{	pkb->proj = nb;
						pkb->kfactor = cl;
						pkb->until = 0xFFFFFFFF;
					}
				}
			}
			else if (strcmp(nbuf, "kh") == 0)
			{
				while (sscanf(q, "%d%u%x%n", &nb, &cl, &ut, &za) >= 3)
				{	q += za;
					for (pkb = pkbuf; pkb->proj != 0; ++pkb)
						if ((pkb->proj == nb) && (pkb->until == ut)) break;
					pkb->proj = nb;
					pkb->kfactor = cl;
					pkb->until = ut;
				}
			}
		}
		fclose(fp);
	}
	if (f_oldi == TRUE)
	{
		if(f_xmld == TRUE)
		{
			printf("  <notice>The info file is older than this version of &quot;qd&quot;</notice>\n");
		}
		else 
		{
			printf("\n\
** NOTICE: The info file is older than this version of \"qd\" **");
		}
	}
	if(f_xmld == FALSE)
	{
		printf("\n");
	}
	if (f_pver == TRUE)
	{
		if(f_xmld == TRUE)
		{
			printf("</queue_dump>\n");
		}
		exit(0);
	}
#if !NO_CTIME
	else
	{
		/* Display the current date & time including timezone.
		 * All dates displayed through prtime() are shown in the local
		 * timezone, but prtime() doesn't show which timezone that is.
		 *
		 * To ease debugging problems using qd output, the date & time
		 * qd was executed will be displayed so the local timezone is
		 * explicitly shown as is the current date & time in UTC.
		 */

		int  time_size = 80;
		char local_time[time_size];
		char utc_time[time_size];
		size_t size;
		struct tm tim;
		time_t now;
		now = time(NULL);
	
		// Sat Mar 22 16:05:45 CET 2008
		tim = *(localtime(&now));
		size = strftime(local_time, time_size, "%a %b %d %H:%M:%S %Z %Y", &tim);
	
		// Sat Mar 22 16:05:45 UTC 2008
		tim = *(gmtime(&now));
		size = strftime(utc_time, time_size, "%a %b %d %H:%M:%S UTC %Y", &tim);
	
		if(f_xmld == TRUE)
		{
			printf("  <executed>%s</executed>\n", local_time);
			printf("  <executed_utc>%s</executed_utc>\n", utc_time);
		}
		else
		{
			printf("qd executed %s (%s)\n", local_time, utc_time);
		}
	}
#endif

	/* Read in the queue data and figure out what version and system it is */

	cfn(qfil, 0);
	if ((fp = fopen(wbuf, "rb")) == NULL)
	{	
		if(f_xmld == TRUE)
		{
			printf("  <error>Can&apos;t open &lt;%s&gt; file</error>\n", wbuf);
			printf("</queue_dump>\n");
		}
		else
		{
			printf("Can't open <%s> file\n", wbuf);
		}
		exit(1);
	}
	i = fread(&qbuf, 1, sizeof(struct qf), fp);
	fclose(fp);
	if (i < 6844)
	{	
		if(f_xmld == TRUE)
		{
			printf("  <error>Can&apos;t read &lt;%s&gt; file</error>\n", wbuf);
			printf("</queue_dump>\n");
		}
		else
		{
			printf("Can't read <%s> file\n", wbuf);
		}
		exit(1);
	}
	q = NULL;
	if (f_styp == FALSE)
	{	gf = (qbuf.version > 0xFFFF)
				&& ((qbuf.current > 0xFFFF) || (qbuf.current == 0));
		qver = 0;
		switch (i)		/* Determine system type, mainly from file length */
		{
		case 6884:		/* 2.15W - 2.17W */
			qver = 217;
			goto tw;
		case 6888:		/* 3.00W - 3.14W */
			qver = 314;
			goto tw;
		case 7048:		/* 3.24W earlier */
		case 7056:		/* 3.24W later */
			qver = 324;
tw:			q = "1Windows";
			break;
		case 6848:		/* 2.19L (3.12M) - 3.14LM */
			qver = 314;
			goto tl;
		case 7008:		/* 3.24LM earlier */
		case 7016:		/* 3.24LM later */
		case 7032:		/* 4.00L */
			qver = 324;
tl:			if (gf)		/* Wrong endianness */
#if (SYSTYPE == 2)
				q = "0Linux";
#else
				q = "2Mac/PPC";
			else
				q = "0Linux";
#endif
			break;
		case 7072:		/* 4.00W, 4.01LWM */
			qver = 401;
			goto tt;
		case 7168:		/* 5.00LWM */
			qver = 500;
tt:			if (gf)		/* Wrong endianness */
#if (SYSTYPE == 2)
				q = "1Linux, Windows or Mac/x86";
#else
				q = "2Mac/PPC";
			else if (qbuf.version == 400)
				q = "1Windows";
#endif
			break;
		}
		if (q != NULL)
			systype = *q++ - '0';
	}
/* Endian swap if required
 *  Swap when compiled on PowerPC and dealing with non-PowerPC queue.dat,
 *  or when not compiled on PowerPC and dealing with a PowerPC queue.dat
 */
#if (SYSTYPE == 2)
	if (systype != 2)
		eswap = TRUE;
#else
	if (systype == 2)
		eswap = TRUE;
#endif
	bst   = 0.0;
	bsp   = 0.0;
	bbst  = 0.0;
	bbsp  = 0.0;
	abst  = 0.0;
	absp  = 0.0;
	abbst = 0.0;
	abbsp = 0.0;

	i = qbuf.version;
	if (eswap)
	{
		i = es32(i);
	}
	if (i > 9)
	{	bp = &qbuf;
		if(f_xmld == TRUE)
		{
			printf("  <queue>\n");
			printf("    <version>%d.%02d</version>\n", i / 100, i % 100);
		}
		else
		{
			printf("Queue version %d.%02d", i / 100, i % 100);
		}
		if ((qver == 314) && ((i >= 324) && (i < 400)))
		{	q = "Google";
			i = qver;
		}
		if ((systype != SYSTYPE) && (q != NULL)) 
		{
			if(f_xmld == TRUE)
			{
				printf("    <system_type>%s</system_type>\n", q);
			}
			else
			{
				printf(" (%s)", q);
			}
		}
		if (i > MAXQVER)
		{
			if(f_xmld == TRUE)
			{
				printf("    <warning>unknown version number</warning>\n");
			}
			else
			{
				printf("  WARNING: unknown version number");
			}
			if (qver == 0)
			{
				qver = DEFQVER;
			}
		}
		else
		{
			qver = i;
		}
		if(f_xmld == FALSE)
		{
			printf("\n");
		}
	}
	else
	{	bp = (struct qf *) ((char *) &qbuf - 4);
		qver = 0;
	}
	if (eswap) {				/* Endian swap everything if necessary */
		eswp(&qbuf);
	}
	if(f_xmld == TRUE)
	{
		printf("    <current_index>%u</current_index>\n", bp->current);
	}
	else
	{
		printf("Current index: %u\n", bp->current);
	}

	/* Try to open EM III data file */

	if (f_only == FALSE)
	{	if (mfil == NULL)
		{	cfn("emprotz.dat", 0);
			if ((fpm = fopen(wbuf, "rt")) == NULL)	/* Is EM III installed ? */
				cfn("emprotx.dat", 0);
		}
		else
			cfn(mfil, 0);
		if (fpm == NULL)
			fpm = fopen(wbuf, "rt");
	}

	/* Print data from each entry in the queue */

	for (i = 10; --i >= 0; )
	{	
		if (f_curr == TRUE) 
		{
			n = bp->current;
			if (n != i)
			{
				continue;
			}
		}
		else
		{
			n = ((bp->current & 0xFF) - i + 10) % 10;	/* Print oldest first */
		}
		p = &bp->entry[n];
		if (qver < 324)
		{
			p = (struct qs *) ((char *) p - 16 * n);
		}
		if (qver < 500)
		{
			p = (struct qs *) ((char *) p - 8 * n);
		}
		if ((qver < 401) && (systype != 1))
		{	p = (struct qs *) ((char *) p - 4 * n);
			estat = p->stat;
			p = (struct qs *) ((char *) p - 4);
		}
		else
		{
			estat = p->stat;
		}

		/* Get the time and date pointers for this index.
		 *
		 * tp:    Time Pointer
		 * 
		 * tp[0]: The Begin Time (as printed by qd at "begin: Mon Aug 9 23:41:10 2004")
		 *        This time is recorded by the client when it finishes downloading a new unit to process.  
		 *        It is an epoch 2000 value, based on the local machine's clock.  
		 *        If the clock is set accurately and the work unit is not a duplicate, the "begin" time 
		 *        will be only a few seconds after the "issue" time, the difference being simply the time 
		 *        it took to receive the unit over the Internet.
		 * 
		 * tp[4]: The End Time (as printed by qd at "end: Sun Aug 15 18:19:58 2004")
		 *        This time is recorded by the client when the core returns with an indication that the 
		 *        processing has finished and the results file should be uploaded to the server.
		 *        It is an epoch 2000 value, based on the local machine's clock, just like the "begin" time.
		 * 
		 * dp:    Date Pointer
		 * 
		 * dp[0]: The Due Date (as printed by qd at "due: Thu Aug 26 23:41:10 2004 (17 days)")
		 *        This time is calculated by the client when it downloads a unit.  
		 *        It is determined by adding the "begin" time to the expiration period, if this
		 *        expiration data is sent as part of the work unit.
		 *        The interval, which qd shows in parentheses after the date, is rounded to the 
		 *        nearest day, or to the nearest hour if it is less than two days.  
		 *        Genome units had no deadlines, nor do a few Folding units designated for machines which
		 *        are either slow or only infrequently connected to the Internet.
		 *        All other Folding units do, but not all work units have the expiration period fields 
		 *        filled in.  
		 *        The stored time is an epoch 2000 value, based on the local machine's clock.
		 *
		 *        There are actually two sorts of deadline associated with a work unit.
		 *        The one reported here, which is the only one known to the client, is what the Stanford 
		 *        project summary web page calls the "Final Deadline", after which time the client may 
		 *        delete the unit and no points will be given even if it is completed and returned.
		 *        The other deadline, shown on the project summary as "Preferred", indicates when the unit 
		 *        will be considered late enough that the server might send another copy of it to someone 
		 *        else, which means that a unit returned after that time might have little scientific value.
		 *
		 *        NOTE that if the machine clock runs, or is set, forward to a time past the "due" date, 
		 *        the client might think the unit is past due, and delete it.
		 */
		tp = p->tdata;					/* Beginning and ending times */
		dp = p->due;					/* Due date */
		if ((qver <= 9) || (systype == 2))
		{	++tp;			/* Older versions and OS X/PPC are 4 bytes higher */
			++dp;
		}
		
		/* Set the Genome flag if the Core is either of the Genome cores.
		 * Only core C9 and CA were Genome@Home cores, the others are for Folding@Home
		 */
		gf = ((p->core == 0xC9) || (p->core == 0xCA));	
		if ((systype == 2) && (!gf))	/* There was never, in fact, any Mac/PPC Genome core */
		{	na = (p->wuid.f.run[0] & 0xFE) + (p->wuid.f.clone[0] & 0xFE)
					+ (p->wuid.f.gen[0] & 0xFE);
			nc = (p->wuid.f.run[1] & 0xFE) + (p->wuid.f.clone[1] & 0xFE)
					+ (p->wuid.f.gen[1] & 0xFE);
			if (na <= nc)	/* Test for already endian swapped (probably not needed) */
			{	exch(p->wuid.f.run[0], p->wuid.f.run[1], na);
				exch(p->wuid.f.clone[0], p->wuid.f.clone[1], na);
				exch(p->wuid.f.gen[0], p->wuid.f.gen[1], na);
			}
		}
		
		/* Get the project number for this index.
		 *
		 * This is the number of the project which the work unit is part of.
		 */
		proj = gf ? le2(p->wuid.g.proj) : le2(p->wuid.f.proj);

		/* Set the status of the WU in this index. 
		 * 
		 * Status codes
		 * ------------
		 * Here is a list of all the possible status codes that can be printed for a queue entry.
		 * When qd was first written, the client had no publicly-available names, so qd made up 
		 * names according to the status of the work unit, from the perspective of the user.
		 * The following list is available if qd is started with the -h flag:
		 * 
		 *  The status code for each queue entry may be interpreted as follows:
		 *
		 *  (0) empty
		 *    The queue entry has never been used, or has been completely cleared.
		 *  (0) deleted
		 *    The unit was explicitly deleted.
		 *  (0) finished
		 *    The unit has been uploaded.  The queue entry is just history.
		 *  (0) garbage
		 *    The queue entry is available, but its history is unintelligible.
		 *  (1) folding now
		 *    The unit is in progress.  Presumably the core is running.
		 *  (1) queued for processing
		 *    The unit has been downloaded but processing hasn't begun yet.
		 *  (2) ready for upload
		 *    The core has finished the unit, but it is still in the queue.
		 *  (3) DANGER will be lost if client is restarted!
		 *    Bug before V3b5, neglected to post status (1).
		 *  (3) abandoned
		 *    Bug before V3b5, neglected to post status (1), and client was restarted.
		 *  (4) fetching from server
		 *    Client presently contacting the server, or something failed in download.
		 *    If this state persists past the current unit, the queue entry will be
		 *    unusable, but otherwise things will go on as usual.
		 *  (?) UNKNOWN STATUS = ??
		 *    Something other than 0 to 4.
		 *
		 * The numbers in parentheses are the actual value used for that status code.
		 * Code (0) is called four different names depending on other data found in the queue entry.
		 *
		 * Several months after all this was written and working as described, the guys at Stanford 
		 * added the -queueinfo option to the client, and they gave their own names to these same codes
		 * according to the queue entry, from the perspective of the client, describing what it needs 
		 * to do about it.
		 * Status code (3) really never happens any more, but here is what it calls the others:
		 *  
		 *  (0) empty
		 *    The queue index is available for reuse by a new unit.
		 *  (1) active
		 *    The unit files are actively processing, and the core should be running.
		 *  (1) ready
		 *    The unit files are ready for processing but are queued, and the core
		 *    should be started to process them when earlier units are finished.
		 *  (2) finished
		 *    The core has finished the unit, and it needs to be uploaded.
		 *  (4) fetching
		 *    The index is allocated to a unit being fetched from a server.
		 * 
		 * The "fetching" status was not handled correctly until client version 5.0, which will free 
		 * the index if it finds that status in the queue.
		 * If an earlier client was restarted and discovered the "fetching" status at one of the queue indices,
		 * it simply skipped over that index for ever afterward, never reclaiming it for further use. 
		 *
		 * It's unfortunate that the word /finished/ is used with differing meanings.
		 * In the output from qd, "finished" means it's really all done, and the information still stored
		 * is just history.
		 * But if it's the /client/ which says "finished", it means only that the /processing/ has finished, 
		 * and the work has _not_ been sent back yet.
		 */
		switch (estat)
		{
		case 0:
			if (proj == 0)
				/* The queue entry has never been used, or has been completely cleared. */
				q = "1empty";
			else if (p->ustat == 0)
				/* The unit was explicitly deleted. */
				q = "0deleted";
			else if (p->ustat == 1)
				/* The unit has been uploaded.  The queue entry is just history. */
				q = "0finished";
			else
				/* The queue entry is available, but its history is unintelligible. */
				q = "1garbage";
			break;
		case 1:
			if (n == bp->current)
				/* The unit is in progress.  Presumably the core is running. */
				q = "2folding now";
			else
				/* The unit has been downloaded but processing hasn't begun yet. */
				q = "3queued for processing";
			break;
		case 2:
			/* The core has finished the unit, but it is still in the queue. */
			q = "0ready for upload";
			break;
		case 3:				/* Before version 3 beta 5 sometimes */
			if (n == bp->current)
				/* Bug before V3b5, neglected to post status (1). */
				q = "2DANGER will be lost if client is restarted!";
			else
				/* Bug before V3b5, neglected to post status (1), and client was restarted. */
				q = "2abandoned";
			break;
		case 4:
			/* Client presently contacting the server, or something failed in download.
			 * If this state persists past the current unit, the queue entry will be
			 * unusable, but otherwise things will go on as usual.
			 */
			q = "1fetching from server";
			break;
		default:
			/* Something other than 0 to 4. */
			sprintf(wbuf, "0UNKNOWN STATUS = %d", estat);
			q = wbuf;
		}
		f = *q++ - '0';	/* extract the prefixed digit (status code) from q (q: status code and description) */
		
		
		/* Start printing the output for this index */
		if (f_indt == TRUE && f_xmld == FALSE)
		{
			printf("\n");
		}
		if (f_logd == FALSE)
		{
			if(f_xmld == TRUE)
			{
				printf("    <index>\n");
				printf("      <number>%u</number>\n", n);
				printf("      <status>%s</status>\n", q);
			}
			else
			{
				printf(" Index %u: %s", n, q);
			}
		}
		/* (f == 1), f is the first character in the q string from a few lines above,
		 * it means that one of the following things:
		 *  1empty                : The queue entry has never been used, or has been completely cleared.
		 *  1garbage              : The queue entry is available, but its history is unintelligible.
		 *  1fetching from server : Client presently contacting the server, or something failed in download.
		 *                          If this state persists past the current unit, the queue entry will be
		 *                          unusable, but otherwise things will go on as usual.
		 * 
		 * If this situation is the case, we can skip to the next queue index.
		 */
		if ((f == 1) && (f_pall == FALSE))
		{	if (f_logd == FALSE && f_xmld == FALSE)
			{
				printf("\n");			/* Nothing else worth printing */
			}
			if(f_xmld == TRUE)
			{
				printf("    </index>\n");
			}
			continue;
		}
		
		/* Get the progress information and name for this WU from the F@H client files */
		na = 0;		/* Number A: Completed number */
		nb = -1;	/* Number B: Total number */
		nc = 0;		/* Number C: Correction to the Completed number (only used for Genome@Home) */
		cl = 0;
		fc = 0.0;	/* Float Completed: Precentage completed (e.g. 0.5 == 50%) */
		fcl = 0.0;      /* Float Completed Last: Value of fc in the previous iteration */
		tcl = 0;	/* Timered Checkpoint Last: Value of tcc in the previous iteration */
		tcc = 0;	/* Timered Checkpoint Counter: Counts number of checkpoints between completed steps */
		vbuf[0] = '\0';
		nbuf[0] = '\0';
		nbuf[3] = '\0';
		cfn("work/logfile_??.txt", n);
		if	(	(stat(wbuf, &st) != 0)
			||	(st.st_size == 0)
			||	(st.st_mtime - TIME_OFS + 60 < tp[0])		/* 1 minute max clock error */
			) st.st_mtime = 0;
		else if	(	(f_only == FALSE)
				&&	(f != 3)
				&&	((fp = fopen(wbuf,"rb")) != NULL)	/* Get name and progress */
				)
		{	while (fgets(wbuf, sizeof(wbuf), fp) != NULL)
			{	if ((nbuf[0] == '\0') && (strncmp(wbuf, "Protein: ", 9) == 0))
				{	
					j = strlen(wbuf) - 1;
					while ((wbuf[j] == '\012') || (wbuf[j] == '\015'))
					{       wbuf[j] = '\0';                 /* Get rid of the CR or LF */
						--j;
					}
					
					if(f_xmld == TRUE)
					{
						sprintf(nbuf, "%.90s", &wbuf[9]);       /* Work unit name */
					}
					else
					{
						sprintf(nbuf, ", \"%.90s\"", &wbuf[9]); /* Work unit name */
					}
									
				}
				
				/* Scan the word buffer for the core version */
				if	(	(	(sscanf(wbuf, "Version %19s %c", vbufa, &zc) == 2)
						||	(sscanf(wbuf, "Folding@Home Client Core Version %19s %c", vbufa, &zc) == 2)
						)
					&&	(zc == '(')
					) strcpy(vbuf, vbufa);
				
				/* Each core has it uses its own format to print the progress in the log file.
				 * 
				 * The Gromacs based cores use pretty much the same format, only the percentage 
				 * complete format differs between the cores. Some use (0), others (0%), but 
				 * this precentage is ignored by qd.
				 * 
				 *  GPU core (0x10):
				 *   "Completed 1"
				 *   ...
				 *   "Completed 100"
				 *  Logs the percentage completed
				 * 
				 *  Core 0x65 Tinker:
				 *   "Finished a frame (1)"
				 *   ...
				 *   "Finished a frame (400)"
				 *  Logs the number of completed frames 
				 *  
				 *  Core 0x78 Gromacs:
				 *   "Completed 0 out of 125000 steps"
				 *   ...
				 *   "Completed 125000 out of 125000 steps"
				 *  Logs the number of completed steps and total number of steps
				 *   
				 *  Core 0x79 Double-precision Gromacs:
				 *   "Completed 0 out of 100000 steps"
				 *  Logs the number of completed steps and total number of steps
				 *   
				 *  Core 0x7a GB Gromacs:
				 *   "Completed 125000 out of 12500000 steps"
				 *  Logs the number of completed steps and total number of steps
				 *   
				 *  Core 0x82 Amber/PMD:
				 *   "Completed 0 out of 500000 steps"
				 *  Logs the number of completed steps and total number of steps
				 *  
                                 *  Core 0x96 QMD:
				 *   "Completed 0 out of 2000 steps"
				 *  Logs the number of completed steps and total number of steps
				 *  
				 *  Core 0xa0 Gromacs 3.3:
				 *   "Completed 40628 out of 500000 steps"
				 *  Logs the number of completed steps and total number of steps
				 */
				
				/* Scan the word buffer for progress, completed and remaining */
				if (sscanf(wbuf, "- Frames Completed: %d, Remaining: %d",
						&za, &nb) == 2)
				{	na = za;
					nb += na;		/* Tinker or Genome total frames */
					goto zn;		/* goto Zero Number, set nc to zero */
				}
				
				/* Scan the word buffer for progress */
				/* The two messages with "[SP%*C] ..." are probably from the Genome core */
				if (sscanf(wbuf, "[SP%*c] Designing protein sequence  %d of %d",
						&za, &nb) == 2)
				{	na = za - 1;
					goto zn;		/* goto Zero Number, set nc to zero */
				}
				
				if	(	(sscanf(wbuf, "[SP%*c]  %d.0 %c", &za, &zc) == 2)
					&&	(zc == '%')
					)
				{	nc = za;
					goto sl;		/* goto Store Last, 
								 *  copy the value of the previous
								 *  completed percentage from fc and
								 *  store in fc the progress current
								 *  log line
								 */
				}

				/* Scan the word buffer for the current progress */
				if	(	(sscanf(wbuf, "Iterations: %d of %d", &za, &nb) == 2)
					||	(sscanf(wbuf, "Completed %d out of %d", &za, &nb) == 2)
					||	(sscanf(wbuf, "Finished a frame (%d", &za) == 1)
					)
				{	na = za;
					goto zn;                /* goto Zero Number, set nc to zero */
				}
				
				/* Scan the word buffer for the current progress */
				if      (       (sscanf(wbuf, "Completed %d%%", &za) == 1)
					)
				{
					na = za;
					/* Up to and including v0.06, the GPU client logs only the 
					 * percentage complete in the work/logfile_??.dat file. 
					 * 
					 * It also doesn't store the total and completed number of 
					 * steps in work/wuinfo_??.dat like the other Gromacs(-based) 
					 * cores do.
					 * 
					 * Starting from v0.07 onward, the work/wuinfo_??.dat file
					 * stores the number of completed and total steps again.
					 *
					 * Because the completed number is a percentage, we'll set the 
					 * total number of steps to 100.
					 */
					nb = 100;
					
					/* calculate the progress 
					 * na = completed steps
					 * nb = total steps
					 * nc = correction to completed steps
					 */
zn:					nc = 0;
sl:					fcl = fc;
					fc = (nb > 0) ? ((float) na + (float) nc / 100.0) / (float) nb : 0.0;
					tcl = tcc;
					tcc = 0;
					continue;
				}
				
				/* Scan the word buffer for intermediate checkpoints and count them */
				if	(	(strncmp(wbuf, "Timered checkpoint triggered", 28) == 0)
					||	(strncmp(wbuf, "Writing checkpoint files", 24) == 0)
					) ++tcc;
				else if (sscanf(wbuf,
						"[SPG]   %d positions in protei%c", &za, &zc) == 2)
					cl = za;
				else
					sscanf(wbuf, "[SP%*c] Writing current.pdb, chainlength = %u", &cl);
			}
			if (tcc > tcl) tcc = tcl;
			fclose(fp);
		}
		cfn("work/current.xyz", 0);		/* Be careful not to look here too soon */
		if	(	(f_only == FALSE)
			&&	(nbuf[0] == '\0')
			&&	(n == bp->current)
			&&	(nb >= 0)
			&&	(stat(wbuf, &st2) == 0)
			&&	(st2.st_size != 0)
			&&	(st2.st_mtime - TIME_OFS + 60 >= tp[0])
			&&	((fp = fopen(wbuf, "rb")) != NULL)
			)
		{	if	(	(fgets(wbuf, sizeof(wbuf), fp) != NULL)
				&&	(sscanf(wbuf, "%*d %*c%n", &za) >= 0)
				)
			{	j = strlen(wbuf) - 1;
				while ((wbuf[j] == '\012') || (wbuf[j] == '\015'))
				{	wbuf[j] = '\0';			/* Get rid of the CR or LF */
					--j;
				}
				
				if(f_xmld == TRUE)
				{
					sprintf(nbuf, "%s", &wbuf[za - 1]);             /* Current unit name */
				}
				else
				{
					sprintf(nbuf, ", \"%s\"", &wbuf[za - 1]);       /* Current unit name */
				}
			}
			fclose(fp);
		}
		/* (f == 2), f is the first character in the q string from several lines above,
		 * it means one of the following things:
		 *  2folding now                                 : The unit is in progress. 
		 *  						   Presumably the core is running.
		 *  2DANGER will be lost if client is restarted! : Bug before V3b5, neglected to post status (1).
		 *  2abandoned                                   : Bug before V3b5, neglected to post status (1), 
		 *                                                 and client was restarted.
		 *
		 * If this situation is the case, the client is currently working on this work unit,
		 * and we can check the work/wuinfo_??.dat file for the completed and total number of steps.
		 * 
		 * The work/wuinfo_??.dat file produced by the GPU core (up to and including v0.06) contains
		 * what seems like the default values (core number and WU name) for the Gromacs core, and lacks
		 * the completed and total number of steps. Starting from v0.07 this file contains the total and
		 * completed number of steps again.
		 */
		if (f == 2)						/* One last chance to get progress */
		{	
			cfn("work/wuinfo_??.dat", n);
                        if (stat(wbuf, &st3) == 0)
                        {
                                /* The Windows SMP client v5.91 has a bug where it doesn't update the mtime of
                                 * the work/logfile_??.txt file (and/or the work/wuinfo_??.dat).
                                 *
                                 * See: http://folding-community.org/ftopic21498.html
                                 *
                                 * We need to compare the mtimes of both files and use the most recent to
                                 * calculate the progress rate with later.
                                 * The progress rate calculation uses st.st_mtime.
                                 *
                                 * Variable st  is the stat structure for work/logfile_??.txt
                                 * Variable st2 is the stat structure for work/current.xyz
                                 * Variable st3 is the stat structure for work/wuinfo_??.dat
                                 */
                                if(qver >= 501 && be4(p->cores) > 0 && systype == 1)
                                {
                                        if (st.st_mtime < st3.st_mtime)
                                        {
                                                // wuinfo_??.dat is more recent
                                                // logfile_??.txt was modified earlier than wuinfo_??.dat
                                                // We need to overwrite the mtime of logfile_??.txt

                                                st.st_mtime = st3.st_mtime;
                                        }
                                        else if (st.st_mtime > st3.st_mtime)
                                        {
                                                // logfile_??.txt is more recent
                                                // wuinfo_??.dat was modified earlier than logfile_??.txt
                                                // No need to overwrite the mtime of logfile_??.txt
                                        }
                                        else
                                        {
                                                // logfile_??.txt and wuinfo_??.dat were modified at the same time
                                                // No need to overwrite the mtime of logfile_??.txt
                                        }
                                }
                                else {
                                        // On non-Windows systems only use the mtime of work/wuinfo_??.dat
                                        // if we haven't found progress information in work/logfile_??.txt
                                        if(nb <= 0)
                                        {
                                                st.st_mtime = st3.st_mtime;
                                        }
                                }
                        }
                        else {
                                if(nb <= 0)
                                {
                                        st.st_mtime = 0;
                                }
                        }


                        if (nb <= 0)
                        {
                                if      (       (f_only == FALSE)
                                        &&      ((fp = fopen(wbuf,"rb")) != NULL)
                                        )
                                {       if (fread(wbuf, 100, 1, fp) == 1)
                                        {       na = *((u32 *) &wbuf[88]);
                                                nb = *((u32 *) &wbuf[84]);
                                                nc = 0;
                                        }
                                        fclose(fp);
                                }
                        }
                        fc = (nb > 0) ? ((float) na + (float) nc / 100.0) / (float) nb : 0.0;
                        if ((tcl > 0) && (fcl > 0))
                                fc += (fc - fcl) * (float) tcc / ((float) tcl + 0.5);
		}
		else
		{	
			fc = 1.0;
		}
		
		xt = (qver >= 324) ? p->expire : 0;	/* eXpire Time: Allowed time to process the WU */
		d = 0.0;
		pd = 0;
		kf = 0.0;
		if	(	(f_only == FALSE)
			&&	(fpm != NULL)					/* Is EM III installed ? */
			&&	!gf
			)
		{	rewind(fpm);
			while	(	(fgets(emn, sizeof(emn), fpm) != NULL)
					&&	(fscanf(fpm, "%d%f%d%d", &emd, &emp, &za, &za) >= 2)
					)
			{	q = emn;
				if (q[0] == '"') ++q;
				if ((pn = strchr(q, '"')) == NULL)
					break;
				*++pn = '\0';
				if	(	(	(sscanf(q, "%d", &za) == 1)
						&&	(za == proj)		/* Find project number in <emprotz.dat> */
						)
					||	(strcmp(&nbuf[3], q) == 0)	/* Or find name in <emprotx.dat> */
					)
					goto ed;
				if	(	(nbuf[0] == '\0')		/* We don't know the name, try "pXXX..." */
					&&	(sscanf(q, "%c%d", &zc, &za) == 2)
					&&	((zc == 'p') || (zc == 'P'))
					&&	(za == proj)
					)
				{	*--pn = '\'';				/* Use name from <emprotx.dat> */
					if(f_xmld == FALSE)
					{
						sprintf(nbuf, ", '%s'", q);	/* But with single quotes */
					}
					else
					{
						sprintf(nbuf, "%s", q);	     	/* No formatting in XML output mode */
					}
ed:					if (xt == 0)
						xt = emd;			/* Use deadline from <emprot?.dat> */
					d = emp;				/* Maybe use points from there too */
					break;
				}
			}
		}
		
		/* Get the Elapsed Time, and set the Elapsed Time to 0 in one of the following cases:
		 *
		 * ((et = (f == 2) ? (int) (st.st_mtime - TIME_OFS) : tp[4]) == 0)
		 * Set the Elapsed Time to the modification date of the file we got the progress information from,
		 * or set the Elapsed Time to the value of the End Time (tp[4]) from the Time Pointer. And if the 
		 * Elapsed Time turns out to be 0, this case will be true.
		 *
		 * (tp[0] == 0)				   
		 * There is no Begin Time for this WU.
		 *
		 * ((xt > 0) && ((et -= tp[0]) >= xt))    
		 * Incase this WU has a eXpire Time known, and the Elapsed Time is greater than or equal to the
		 * eXpire time.
		 *
		 * (et < ((f == 2) ? 30 : 900))
		 * Incase the Elapsed Time is less than 15 minutes (or 30 seconds if this is the current WU).
		 */
		if	(	((et = (f == 2) ? (int) (st.st_mtime - TIME_OFS) : tp[4]) == 0)
			||	(tp[0] == 0)				/* No Begin Time known */
                        ||      ((xt > 0) && ((et -= tp[0]) >= xt))     /* Elapsed time (max deadline time) */
			||	(et < ((f == 2) ? 30 : 900))		/* min 15 min (30 sec current unit) */
			) et = 0;

		/* Get the time the WU was finished (or is projected to be finished in case progess (fc) and the 
		 * Elapsed Time (et) are known. 
		 */
		if ((f != 2) && (f != 3)) {
			/* The status of this index is not "(2) ready for upload" or
			 * the status of this index is not "(3) DANGER will be lost if client is restarted!" or
			 *                                 "(3) abandoned"   
			 * 
			 * Set the Unsigned Int Time (ut) to the End Time of recorded for this index.
			 * Will not be printed (as the "expect" date), the End Time will be printed instead 
			 * (as the "end" date).
			 */
			
			ut = tp[4];				/* Ending time */
		}
		else if ((fc > 0) && (et != 0)) {
			/* Progress (fc: Float/Folding Completed) and Elapsed Time (et) are known for this index.
			 * The WU for this index is assumed to be running.
			 *
			 * Calculate the projected End Time and set the Unsigned Int Time (ut) to this value.
			 * Will be printed as the "expect" date.
			 */
			
			ut = tp[0] + (u32) ((float) et / fc);	/* Projected ending time */
		}
		else {
			/* There is probably no usfull End Time information known 
			 *
			 * Will not be printed (as the "expect" date).
			 */
			
			ut = 0;
		}
		
		it = (gf ? le4(p->wuid.g.issue[0]) : le4(p->wuid.f.issue[0]));	/* Issue time */
		if (it > 0)
		{
			/* Only deduct the difference between the UNIX and COSM epoch if a value is set.
			 * The new v5 work servers don't appear to set this value any more per december 2009
			 *
			 * See: 
			 * http://foldingforum.org/viewtopic.php?p=124311#p124311
			 * http://foldingforum.org/viewtopic.php?f=52&t=12630&start=15#p123768
			 * http://folding.typepad.com/news/2009/12/new-changes-to-psummary.html
			 * http://foldingforum.org/viewtopic.php?f=18&t=12489&start=45#p124112
			 */
			it -= TIME_OFS;

			ct = it;	/* Use issue time as check time */
			
		}
		else
		{
			ct = tp[0];	/* Use begin time if there is no issue time to check */
		}
		if ((ut > 0) && (ct > 0))
		{
			bet = (ut - ct);	/* elapsed time beween start and (projected) completion */
		}
		else
		{
			bet = 0;
		}
			
		sscanf(p->teamn, "%d", &za);
		if (gf)
		{	d = (0.05 * (float) cl) * (0.05 * (float) cl + 1.0);
			if (za < 100000)		/* FAH team number */
			{	d *= 5.0 / 12.0;	/* Convert to FAH point scale */
				if (it < 97804800)	/* 0000 6feb03 UTC */
					d /= 2.0;		/* Previously worth only half as much */
			}
			else
			{
				d *= 1.8;			/* Convert to GAH point scale */
			}
		}
		else if (za >= 100000)		/* Genome team number */
		{
			d = 0.0;				/* Don't count FAH points */
		}
		else
		{	
			mt = 0xFFFFFFFF;
			for (pb = pbuf; pb->proj != 0; ++pb)	/* Look up the points in our tables */
			{
				if	(	(pb->proj == proj)			/* The right project number */
					&&	(pb->until >= ct)			/* Not changed before credit was determined */
					&&	(pb->until <= mt)			/* In effect before unit was credited */
					)
				{	d = (float) pb->points / 100.0;
					mt = pb->until;
				}
			}
			
			mt = 0xFFFFFFFF;
			for (pdb = pdbuf; pdb->proj != 0; ++pdb)    /* Look up the preferred deadline in our tables */
			{
				if      (       (pdb->proj == proj)			/* The right project number */
					&&	(pdb->until >= ct)			/* Not changed before preferred deadline was determined */
					&&	(pdb->until <= mt)			/* In effect before unit was credited */
					)
				{	pd = pdb->preferred;
					mt = pdb->until;
				}
			}
	
			mt = 0xFFFFFFFF;
			for (pkb = pkbuf; pkb->proj != 0; ++pkb)    /* Look up the kfactor in our tables */
			{
				if      (       (pkb->proj == proj)			/* The right project number */
					&&	(pkb->until >= ct)			/* Not changed before kfactor was determined */
					&&	(pkb->until <= mt)			/* In effect before unit was credited */
					)
				{	kf = (float) pkb->kfactor / 100.0;
					mt = pkb->until;
				}
			}
		}
		j = tp[4];
		uf[0] = ' ';		/* uf[0] = Status 
					 *          D = Deleted
					 *	    R = Running
					 *	    U = Unknown point value
					 * uf[1] = Core   
					 * 	    N = Genome
					 * 	    P = GPU
					 * 	        psummary code: GROGPU
					 * 	    T = Tinker
					 * 	        psummary code: TINKER
					 * 	    G = Gromacs 
					 * 	        psummary code: GROMACS
					 * 	    D = Double-precision Gromacs 
					 * 	        psummary code: DGROMACS
					 * 	    B = GB Gromacs 
					 * 	        psummary code: GBGROMACS
					 * 	    d = Double-precision Gromacs B
					 * 	        psummary code: DGROMACSB
					 * 	    R = Gromacs SREM
					 * 	        psummary code: GROST (GROmacs Serial replica exchange with Temperatures)
					 * 	    I = Gromacs Simulated Tempering
					 * 	        psummary code: GROSIMT
					 * 	    A = Amber/PMD
					 * 	        psummary code: AMBER
					 * 	    Q = QMD
					 * 	    3 = Gromacs 3.3 
					 * 	        psummary code: GROMACS33
					 * 	    S = Gromacs SMP 
					 * 	        psummary code: GRO-SMP (previously: GROMACS-SMP)
					 */
		if (gf)
			uf[1] = 'N';	/* Genome */
		else if (p->core == 0x10)
			uf[1] = 'P';	/* GPU */
		else if (p->core == 0x11)
			uf[1] = '2';	/* GPU2 (ATI CAL / NVIDIA CUDA) */
		else if (p->core == 0x12)
			uf[1] = 'a';	/* GPU2 (ATI Development) */
		else if (p->core == 0x13)
			uf[1] = 'n';	/* GPU2 (NVIDIA Development) */
		else if (p->core == 0x14)
			uf[1] = 'V';	/* GPU2 (NVIDIA Development) / GROGPU2-MT */
		else if (p->core == 0x15)
			uf[1] = 'p';	/* GPU3 */
		else if (p->core == 0x20)
			uf[1] = 's';	/* SHARPEN */
		else if (p->core == 0x65)
			uf[1] = 'T';	/* Tinker */
		else if (p->core == 0x78)
			uf[1] = 'G';	/* Gromacs */
		else if (p->core == 0x79)
			uf[1] = 'D';	/* Double-precision Gromacs */
		else if (p->core == 0x7a)
			uf[1] = 'B';	/* GB Gromacs (Generalized Born implicit solvent) */
		else if (p->core == 0x7b)
			uf[1] = 'd';	/* Double-precision Gromacs B */
		else if (p->core == 0x7c)
			uf[1] = 'c';	/* Double-precision Gromacs C */
		else if (p->core == 0x80)
			uf[1] = 'R';	/* Gromacs SREM */
		else if (p->core == 0x81)
			uf[1] = 'I';	/* Gromacs Simulated Tempering */
		else if (p->core == 0x82)
			uf[1] = 'A';	/* Amber */
		else if (p->core == 0x96)
			uf[1] = 'Q';	/* QMD */
		else if (p->core == 0xa0)
			uf[1] = '3';	/* Gromacs 3.3 */
		else if (p->core == 0xa1)
			uf[1] = 'S';	/* Gromacs SMP (V1.71) */
		else if (p->core == 0xa2)
			uf[1] = 'C';	/* Gromacs CVS / Gromacs SMP (V1.90) */
		else if (p->core == 0xa3)
			uf[1] = 'M';	/* Gromacs SMP2 / Gromacs SMP (V2.13) */
		else if (p->core == 0xa4)
			uf[1] = 'b';	/* Gromacs GB (V2.04) */
		else if (p->core == 0xb4)
			uf[1] = '4';	/* ProtoMol */
		else
			uf[1] = ' ';
		if ((xt == 0) && (uf[1] != ' '))
			uf[1] += 'a' - 'A';
		if ((f == 0) && (p->ustat == 0))
		{	j = 0;			/* Deleted */
			uf[0] = 'D';
			et = 0;			/* Don't print score rate if it's deleted */
		}
		else if (f == 2)
		{	j = 1;			/* In progress */
			uf[0] = 'R';
		}
		g = d * fc;
		if ((j != 0) && (g > 0.0) && (et != 0))		/* Not deleted, has points projection, has elapsed time */
		{	bst += (float) et;
			bsp += g;
			g *= 3600.0 / (float) et;

			/* Points Per Day (PPD) calculation differs from Points Per Hour (pt/hr or pph) calculation above.
			 * It assumes that the WU is (will be) completed at the (projected/expected) end date.
			 * It does not use the percentage of completed work to show the average points per hour
			 * you have earned up to that point of completion, but it shows the average points per day
			 * that you'll earn over the total time (expected) to complete the WU.
			 */
			if (bet > 0)
			{
				ppd  = d / (float) bet;
				ppd *= 86400.0;

				abst += (float) bet;
				absp += d;
			}
			else
			{
				ppd = 0;
			}
		}
		else
		{	g = 0.0;
			ppd = 0.0;
			if (uf[0] == ' ')
				uf[0] = 'U';	/* Point value unknown */
		}

		if (f_logd == TRUE && f_xmld == FALSE)	/* Print log format data, all on one line */
		{	printf("-%9.08X%9.08X", tp[0], j);
			if (lid != NULL)
				printf("  %s.%u%6u", lid, n, proj);
			else
				printf("%3u%6u", n, proj);
			if (gf)
				printf("%6u%6u%6u", p->wuid.g.miscg1, p->wuid.g.miscg2, p->wuid.g.miscg3);
			else
				printf("%6u%6u%6u", le2(p->wuid.f.run), le2(p->wuid.f.clone), le2(p->wuid.f.gen));
			printf("%6u%8.2f%8.3f%.2s", le4(p->bench), d, g, uf);
			if (nbuf[0] != '\0')
				printf("%.299s", nbuf + 1);
			printf("\n");
			continue;
		}

		if (d > 0.0)
		{
			if(f_xmld == TRUE)
			{
				printf("      <points>%.2f</points>\n", d);
			}
			else
			{
				printf(" %.2f pts", d);
			}
		}
		if ((g > 0.0) && (ppd > 0.0))
		{
			if(f_xmld == TRUE)
			{
				printf("      <points_per_hour>%.3f</points_per_hour>\n", g);
				printf("      <points_per_day>%.2f</points_per_day>\n", ppd);
			}
			else
			{
				printf(" (%.3f pt/hr, %.2f ppd)", g, ppd);
			}
		}
		if (fc > 0.0)
		{	if ((xt != 0) && (et != 0))
			{
				if(f_xmld == TRUE)
				{
					printf("      <progress_rate>%.3g</progress_rate>\n", (float) xt * fc / (float) et);
				}
				else
				{
					printf(" %.3g X min speed", (float) xt * fc / (float) et);
				}
			}
			if (f == 2)
			{
				if(f_xmld == TRUE)
				{
					printf("      <progress>%.3g%%</progress>\n", fc * 100.0);
				}
				else
				{
					printf("; %.3g%% complete", fc * 100.0);
				}
			}
		}
		if(f_xmld == FALSE)
		{
			printf("\n");
		}
		/* Bonus Points (to stimulate rapid completion and return of WUs)
		 *
		 * Source: http://foldingforum.org/viewtopic.php?p=105038#p105038	[upcoming release: extra-large work units]
		 * 
		 * Q: How are you awarding bonuses?
		 * A: Bonuses are awarded according to the following formula:
		 *    Total points = base points * bonus factor
		 * 
		 *    The bonus factor is computed based on the time from when our server issues the work unit to when it receives the work unit (WU_time),
		 *    the time from work issuance to when the deadline would expire (deadline_time),
		 *    the time from issuance to when the work unit times out and is marked for reissuance (timeout_time),
		 *    and a constant factor k.
		 *    If WU_time > timeout time, bonus factor = 1.
		 *    If WU_time <= timeout time, bonus factor = sqrt(deadline_time * k / WU_time)
		 *    
		 *    IMPORTANT:
		 *    Bonuses are only given *if* a client has a passkey and *after* a client has completed 10 Core A2 work units.
		 *    Also, to qualify for a bonus, a client must have returned >80% of its work units within the deadline. Otherwise bonus factor = 1.
		 * 
		 *    Example:
		 *    For project 2681, we will initially set k=2. We may adjust k as necessary.
		 *    Again for project 2681, the current deadline time is 6 days and the current timeout time is 4 days.
		 *    Most users' 8-core machines, clocked at 2.8 GHz or higher, complete these work units in slightly under 3 days, so they would receive a 100% bonus.
		 * 
		 * Q: Do I have to fold 10 of these work units within the deadline before qualifying for bonuses, or does the bonus system take prior performance into account?
		 * A: The bonus system is linked to passkeys. If you have been folding A2 work units under a passkey, you should have have a prior performance record.
		 * 
		 * Source: http://foldingforum.org/viewtopic.php?f=24&t=13039 		[Points system for SMP2 work units]
		 * Source: http://folding.stanford.edu/English/FAQ-PointsNew 		[Folding@home Points FAQ (New Benchmark Machine -- January 2010)]
		 * 
		 * 
		 */
		if (    d > 0.0						/* base points */
		   &&  xt > 0						/* deadline time (final deadline) */
		   &&  pd > 0						/* timeout time (preferred deadline) */
		   &&  kf > 0.0						/* k (kfactor) */
		   && bet > 0						/* elapsed time between start (issue or begin) and (projected) completion */
		   && (p->passkey != NULL && p->passkey[0] != '\0') 	/* passkey present */
		   && (j != 0)						/* Not deleted */
		   && bet <= pd						/* time to complete is before the preferred deadline */
		   )
		{
			float bonus_factor = sqrtf((float) xt * kf / (float) bet);
			float bonus_points = d * bonus_factor;
			float bonus_pph    = 0.0;
			float bonus_ppd    = 0.0;

			if((fc > 0.0) && (bet != 0))
			{
				bonus_pph = bonus_points * fc;
					
				bbst += (float) bet;
			 	bbsp += bonus_pph;
					
				bonus_pph *= 3600.0 / (float) bet;

				/* Alternate PPD calculation */
				bonus_ppd  = bonus_points / (float) bet;
				bonus_ppd *= 86400.0;

				abbst += (float) bet;
			 	abbsp += bonus_points;
			}

			if(f_xmld == TRUE)
			{
				printf("      <bonus_points>%.2f</bonus_points>\n", bonus_points);
				if((bonus_pph > 0.0) && (bonus_ppd > 0.0))
				{
					printf("      <bonus_points_per_hour>%.3f</bonus_points_per_hour>\n", bonus_pph);
					printf("      <bonus_points_per_day>%.2f</bonus_points_per_day>\n", bonus_ppd);
				}
				printf("      <bonus_factor>%.2f</bonus_factor>\n", bonus_factor);
				printf("      <kfactor>%.2f</kfactor>\n", kf);
			}
			else
			{
				printf("%sbonus pts: %.2f", idnt, bonus_points);
				if((bonus_pph > 0.0) && (bonus_ppd > 0.0))
				{
					printf(" (%.3f pt/hr, %.2f ppd)", bonus_pph, bonus_ppd);
				}
				printf("; bonus factor: %.2f; kfactor: %.2f\n", bonus_factor, kf);
			}
		}
		if	(	(qver >= 324)
			||	(p->svr1 == p->svr2)
			||	(	(p->svr1 == 0)
				&&	(qver >= 300)
				)
			)
		{
			if(f_xmld == TRUE)
			{
				printf("      <server>\n");
				printf("        <number>2</number>\n");
				printf("        <address>");
				printip("", p->svr2, p->port);
				printf("</address>\n");
				printf("      </server>\n");
			}
			else
			{
				printf("%s", idnt);
				printip("server: ", p->svr2, p->port);
			}
		}
		else
		{	
			if(f_xmld == TRUE)
			{
				printf("      <server>\n");
				printf("        <number>1</number>\n");
				printf("        <address>");
				printip("", p->svr1, 0);
				printf("</address>\n");
				printf("        <number>2</number>\n");
				printf("        <address>");
				printip("", p->svr2, p->port);
				printf("</address>\n");
				printf("      </server>\n");
			}
			else
			{
				printf("%s", idnt);
				printip("server 1: ", p->svr1, 0);
				printip("; server 2: ", p->svr2, p->port);
			}
		}
		if(f_xmld == TRUE)
		{
			printf("      <project_number>%d</project_number>\n", proj);
			if(nbuf[0] != '\0') 
			{
				printf("      <project_name>%.300s</project_name>\n", nbuf);
			}
		}
		else
		{
			printf("; project: %d%.300s\n", proj, nbuf);
		}
		if (qver < 324)
		{	if (gf)					/* Genome */
			{
				if(f_xmld == TRUE)
				{
					printf("      <genome>\n");
					printf("        <unit>%u, %u, %u</unit>\n", 
							p->wuid.g.miscg1, p->wuid.g.miscg2, p->wuid.g.miscg3);
					printf("        <misc>%u, %u</misc>\n",
							le4(p->bench), le4(p->m476));
					printf("        <other>%u, %u</other>\n",
							p->m176, p->m184);
					printf("      </genome>\n");
				}
				else
				{
					printf("%s\
Genome: unit %u, %u, %u; misc: %u, %u; %u, %u", idnt,
						p->wuid.g.miscg1, p->wuid.g.miscg2, p->wuid.g.miscg3,
						le4(p->bench), le4(p->m476), p->m176, p->m184);
				}
			}
			else 					/* Folding */
			{
				if(f_xmld == TRUE)
				{
					printf("      <folding>\n");
					printf("        <run>%u</run>\n", le2(p->wuid.f.run));
					printf("        <clone>%u</clone>\n", le2(p->wuid.f.clone));
					printf("        <generation>%u</generation>\n", le2(p->wuid.f.gen));
					printf("        <misc>%u, %u</misc>\n", le4(p->bench), le4(p->m476));
					printf("        <other>%u, %u</other>\n", p->m176, p->m184);
					printf("      </folding>\n");
				}
				else
				{
					printf("%s\
Folding: run %u, clone %u, generation %u; misc: %u, %u; %u, %u", idnt,
						le2(p->wuid.f.run), le2(p->wuid.f.clone), le2(p->wuid.f.gen),
						le4(p->bench), le4(p->m476), p->m176, p->m184);
				}
			}
		}
		else
		{	if (gf)					/* Genome */
			{
				if(f_xmld == TRUE)
				{
					printf("      <genome>\n");
					printf("        <unit>%u, %u, %u</unit>\n", 
							p->wuid.g.miscg1, p->wuid.g.miscg2, p->wuid.g.miscg3);
					printf("        <benchmark>%u</benchmark>\n", le4(p->bench));
					printf("        <misc>%u, %u</misc>\n",	p->m176, p->m184);
					printf("      </genome>\n");
				}
				else
				{
					printf("%s\
Genome: unit %u, %u, %u; benchmark %u; misc: %u, %u", idnt,
						p->wuid.g.miscg1, p->wuid.g.miscg2, p->wuid.g.miscg3,
						le4(p->bench), p->m176, p->m184);
				}
			}
			else					/* Folding */
			{
				/* Benchmark location in the queue.dat:
				 * - FAH client >= v3.24: byte 472 in Little Endian
				 * - FAH client >= v5.00: byte 476 in Big Endian
				 */

				u32 benchmark = 0;
				if(le4(p->bench) == 0 && be4(p->m476) > 0)
				{
				        benchmark = be4(p->m476);
				}
				else
				{
				        benchmark = le4(p->bench);
				}
			
				u32 misc4a = 0;
				bool isbe = FALSE;
				if ((j = le4(p->m532)) != 0)
                		{
		        	       	if ((unsigned) j > 0xFFFF)                      /* Data stored big-endian */
                        	       	{
						misc4a = be4(p->m532);
						isbe = TRUE;
					}
					else						/* Data stored little-endian */
					{
						misc4a = le4(p->m532);
						isbe = FALSE;
					}
				}
			

				if(f_xmld == TRUE)
				{
					printf("      <folding>\n");
					printf("        <run>%u</run>\n", le2(p->wuid.f.run));
					printf("        <clone>%u</clone>\n", le2(p->wuid.f.clone));
					printf("        <generation>%u</generation>\n", le2(p->wuid.f.gen));
					printf("        <benchmark>%u</benchmark>\n", benchmark);
					printf("        <misc>%u, %u, %u (%s)</misc>\n", p->m176, p->m184, misc4a, isbe == TRUE ? "be" : "le");
					printf("      </folding>\n");
				}
				else
				{
					printf("%s\
Folding: run %u, clone %u, generation %u; benchmark %u; misc: %u, %u, %u (%s)", idnt,
						le2(p->wuid.f.run), le2(p->wuid.f.clone), le2(p->wuid.f.gen),
						benchmark, p->m176, p->m184, misc4a, isbe == TRUE ? "be" : "le");
				}
			}
		}
		
		/* print an extra line with the Project, Run, Clone & Generation
		 * in the same format as in FAHlog.txt, usefull when reporting 
		 * problems with F@H on the Folding-Community Forum.
		 * The line will only be printed for Folding@Home, not for Genome@Home
		 * It will also not be included in the XML output
		 *
		 * Format example:
		 * Project: 2052 (Run 8, Clone 26, Gen 22)
		 */
		if( (f_prcg == TRUE) && !gf && (f_xmld == FALSE) )
		{
			printf("\n%s\
Project: %u (Run %u, Clone %u, Gen %u)", idnt, proj, le2(p->wuid.f.run), le2(p->wuid.f.clone), le2(p->wuid.f.gen));
		}

		if(f_xmld == TRUE)
		{
			if(it > 0) 
			{
				printf("      <issue_timestamp>");
				prtime("", it);
				printf("</issue_timestamp>\n");
			}
			printf("      <begin_timestamp>");
			prtime("", tp[0]);
			printf("</begin_timestamp>\n");
		}
		else
		{
			printf("\n%s", idnt);
			if(it > 0)
			{
				prtime("issue: ", it);
				printf("; ");
			}
			prtime("begin: ", tp[0]);
			printf("\n");
		}
		za = 0;
		j = 1;
		if ((f != 2) && (f != 3))
			za |= 0x01;
		else if (ut != 0)
			za |= 0x02;
		if (xt != 0)
		{	if	(	(qver >= 324)
				&&	(p->svr1 != 0)
				&&	(dp[0] != 0)
				) za |= 0x04;
			else
				za |= 0x08;
		}
		while ((k = lform(&za)) != 0)
		{	if (k == 0x01)
			{
				if(f_xmld == TRUE)
				{
					printf("      <end_timestamp>");
					prtime("", tp[4]);
					printf("</end_timestamp>\n");
				}
				else
				{
					prtime("end: ", tp[4]);
				}
			}
			else if (k == 0x02)
			{
				if(f_xmld == TRUE)
				{
					printf("      <expect_timestamp>");
					prtime("", ut);
					printf("</expect_timestamp>\n");
				}
				else
				{
					prtime("expect: ", ut);
				}
			}
			else if (k == 0x04)
			{
				if(f_xmld == TRUE)
				{
					printf("      <due_timestamp>");
					prtime("", dp[0]);
					printf("</due_timestamp>\n");
				}
				else
				{
					prtime("due: ", dp[0]);
				}
			}
			else if (k == 0x08)
			{
				if(f_xmld == TRUE)
				{
					printf("      <expire_timestamp>");
					prtime("", tp[0] + xt);
					printf("</expire_timestamp>\n");
				}
				else
				{
					prtime("expire: ", tp[0] + xt);
				}
			}

			if ((k & 0x0C) != 0)
			{	if (xt < 7200)			/* Two hours */
				{
					if(f_xmld == TRUE)
					{
						printf("      <deadline>%u minutes</deadline>\n", (xt + 30) / 60);
					}
					else
					{
						printf(" (%u minutes)", (xt + 30) / 60);
					}
				}
				else if (xt < 172800)	/* Two days */
				{
					if(f_xmld == TRUE)
					{
						printf("      <deadline>%u hours</deadline>\n", (xt + 1800) / 3600);
					}
					else
					{
						printf(" (%u hours)", (xt + 1800) / 3600);
					}
				}
				else
				{
					if(f_xmld == TRUE)
					{
						printf("      <deadline>%u days</deadline>\n", (xt + 43200) / 86400);
					}
					else
					{
						printf(" (%u days)", (xt + 43200) / 86400);
					}
				}
			}
		}
		if(pd > 0)
		{	
			if(f_xmld == TRUE)
			{
				printf("      <preferred_timestamp>");
				prtime("", tp[0] + pd);
				printf("</preferred_timestamp>\n");
			}
			else 
			{
				printf("%s", idnt);
				prtime("preferred: ", tp[0] + pd);
			}
			
			if(pd < 7200)		/* Two hours */
			{
				if(f_xmld == TRUE)
				{
					printf("      <preferred_deadline>%u minutes</preferred_deadline>\n", 
							pd / 60);
				}
				else
				{
					printf(" (%u minutes)", 
							pd / 60);
				}
			}
			else if (pd < 172800)	/* Two days */
			{
				if(f_xmld == TRUE)
				{
					printf("      <preferred_deadline>%u hours</preferred_deadline>\n", 
							pd / 3600);
				}
				else
				{
					printf(" (%u hours)", 
							pd / 3600);
				}
			}
			else
			{
				if(f_xmld == TRUE)
				{
					printf("      <preferred_deadline>%u days</preferred_deadline>\n", 
							pd / 86400);
				}
				else
				{
					printf(" (%u days)", 
							pd / 86400);
				}
			}
			
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
		}
		if (f_cpct == FALSE)
		{
			/* Compact output was not requested, also display the other information if available */
			
			/* Every core should store a partial URL in the queue.dat */
			if(f_xmld == TRUE)
			{
				printf("      <core>\n");
			}
			else
			{
				printf("%score URL: ", idnt);
			}

			if (p->url[0] != '\0')
			{	if (strstr(p->url, "google") != NULL)
				{
					if(f_xmld == TRUE)
					{
						printf("        <url>http://%.128s</url>\n", p->url);
					}
					else
					{
						printf("http://%.128s", p->url);
					}
				}
				else
				{
					/* Starting at v6.02 the URL to the FAH cores may not be terminated with a '/' character.
					 * This breaks the URL once fully contructed.
					 * Append the missing '/' if it's not the last character
					 */
					char url[128];
					
					int i = 0;
					while(i < 128 && p->url[i] != '\0') {
						url[i] = p->url[i];
						i++;
					}
					if(url[i-1] != '/') {
						url[i] = '/';
						i++;
					}
					url[i] = '\0';

					q = (qver >= 300) ? "fah" : "exe";
					if(f_xmld == TRUE)
					{
						printf("        <url>http://%.128sCore_%02x.%s</url>\n", url, 
							  	                                         p->core, 
												         q);
					}
					else
					{
						printf("http://%.128sCore_%02x.%s", url, p->core, q);
					}
				}
				if (vbuf[0] != '\0')
				{
					if(f_xmld == TRUE)
					{
						printf("        <version>%s</version>\n", vbuf);
					}
					else
					{
						printf(" (V%s)\n", vbuf);
					}
				}
				else {
					if(f_xmld != TRUE)
					{
						printf("\n");
					}
				}
			}
			else {
				if(f_xmld == TRUE)
				{
					printf("        <url>MISSING</url>\n");
				}
				else
				{
					printf("MISSING\n");
				}
			}
			/* Print the name of the FAH core used on psummary.html */
			prcore(idnt, p->core, coretab);
			if(f_xmld == TRUE)
			{
				printf("      </core>\n");
			}

			/* Starting at v3.00, the queue.dat may contain the CPU and OS types */
			if (qver >= 300)
			{	za = 0;
				if ((p->cpu_type != 0) || (p->cpu_spec != 0))
				{
					za |= 0x01;
				}
				if ((p->os_type != 0) || (p->os_spec != 0))
				{
					za |= 0x02;
				}
				while ((k = lform(&za)) != 0)
				{
					if (k == 0x01)
					{
						prstr("CPU", p->cpu_type, p->cpu_spec, cputab);
					}
					else if (k == 0x02)
					{
						prstr("OS", p->os_type, p->os_spec, ostab);
					}
				}
			}
			
			if(qver >= 501)
			{
				/* Starting with the first SMP client v5.91, the queue.dat contains
				 * the number of smp cores, this client version still uses queue version 5.01
				 */
				if(be4(p->cores) > 0 || le4(p->use_cores) > 0)
				{
					if(f_xmld == TRUE)
					{
						printf("      <smp_cores>%u</smp_cores>\n", be4(p->cores));
						if(le4(p->use_cores) > 0)
						{
							printf("      <use_cores>%u</use_cores>\n", le4(p->use_cores));
						}
					}
					else
					{
						printf("%ssmp cores: %u", idnt, be4(p->cores));
						if(le4(p->use_cores) > 0)
						{
							printf("; cores to use: %u", le4(p->use_cores));
						}
						printf("\n");
					}
				}

				/* Starting at FAH client v6.00, the queue.dat can contain a tag for a
				 * work unit, set by the server. This is written to unitinfo.txt by the
				 * FAH client in the Tag: line. And printed between [] in the -queueinfo
				 * output of the FAH client.
				 */
				if(p->tag != NULL && p->tag[0] != '\0')
				{
					if(f_xmld == TRUE)
					{
						printf("      <tag>%s</tag>\n", p->tag);
					}
					else
					{
						printf("%stag: %s\n", idnt, p->tag);
					}
				}

				/* Starting at FAH client v6.01, the queue.dat can contain the passkey.
				 * The passkey is also stored in the client.cfg if it's been configured.
				 */
				if(f_show == TRUE && p->passkey != NULL && p->passkey[0] != '\0')
				{
					if(f_xmld == TRUE)
					{
						printf("      <passkey>");
						for(j = 0; j < 32; j++)
						{
							printf("%c", p->passkey[j]);
						}
						printf("</passkey>\n");
					}
					else
					{
						printf("%spasskey: ", idnt);
						for(j = 0; j < 32; j++)
						{
							printf("%c", p->passkey[j]);
						}
						printf("\n");
					}
				}

                                /* Starting at FAH client v6.00, the queue.dat can contain the amount of flops
                                 * each CPU (core) can achieve.
                                 */
                                if(be4(p->flops) > 0) {
                                        double mflops = 0;

                                        if(be4(p->flops) >= 1000000)
					{
                                                mflops = be4(p->flops) / 1000000.000000;
                                        }

                                        if(f_xmld == TRUE)
                                        {
                                                printf("      <flops>%u</flops>\n", be4(p->flops));

                                                if(mflops >= 1)
                                                {
                                                        printf("      <megaflops>%.6f</megaflops>\n", mflops);
                                                }
                                        }
                                        else
                                        {
                                                printf("%sflops: %u", idnt, be4(p->flops));

                                                if(mflops >= 1)
                                                {
                                                        printf(" (%.6f megaflops)", mflops);
                                                }

                                                printf("\n");
                                        }
                                }

                                if( (be4(p->memory) != 0) || (le4(p->gpu_memory) != 0) )
				{
                                        if(f_xmld != TRUE)
                                        {
                                                printf("%s", idnt);
                                        }
                                }

                                /* Starting at FAH client v6.00, the queue.dat can contain the amount of memory
                                 * the FAH client detected.
                                 */
                                if(be4(p->memory) != 0)
				{
                                        if(f_xmld == TRUE)
                                        {
                                                printf("      <memory>%u MB</memory>\n", be4(p->memory));
                                        }
                                        else
                                        {
                                                printf("memory: %u MB", be4(p->memory));
                                        }
                                }

                                /* Starting at FAH client v6.20 (GPU2, possibly earlier),
                                 * the queue.dat can contain the amount of memory the FAH GPU2 client can use
                                 */
                                if(le4(p->gpu_memory) != 0) {
                                        if(f_xmld == TRUE)
                                        {
                                                printf("      <gpu_memory>%u MB</gpu_memory>\n", le4(p->gpu_memory));
                                        }
                                        else
                                        {
                                                if(be4(p->memory) != 0)
						{
                                                        printf("; ");
                                                }
                                                printf("gpu memory: %u MB", le4(p->gpu_memory));
                                        }
                                }

                                if( (be4(p->memory) != 0) || (le4(p->gpu_memory) != 0) )
				{
                                        if(f_xmld != TRUE)
                                        {
                                                printf("\n");
                                        }
                                }
			}

			/* Starting at v4.00, the queue.dat may contain Assignment Info */
			if ((qver >= 400) && ((j = le4(p->aiflag)) != 0))
			{	
				if ((unsigned) j > 0xFFFF)			/* Data stored big-endian */
				{
					aibe = TRUE;

					/* Client Type Requirements */
					if(be4(p->cltype) != 0)
					{
						struct strtab *cp = cltab;

						if(f_xmld == TRUE)
						{
							printf("      <client_type>\n");
							printf("        <type>%u</type>\n", be4(p->cltype));
						}
						else
						{
							printf("%sclient type: %u", idnt, be4(p->cltype));
						}
		
						for ( ; cp->type <= be4(p->cltype); ++cp)
						{
							if (cp->type == be4(p->cltype)) {
								if(f_xmld == TRUE)
								{
									printf("        <name>%s</name>\n", cp->name);
								}
								else 
								{
									printf(" %s", cp->name);
								}
							}
						}
		
						if(f_xmld == TRUE)
						{
							printf("      </client_type>\n");
						}
						else
						{
							printf("\n");
						}
					}
	
					if(f_xmld == TRUE)
					{
						printf("      <assignment_info>\n");
						printf("        <byte_order>be</byte_order>\n");
						printf("        <timestamp>");
						prtime("", be4(p->aitime));
						printf("</timestamp>\n");
						printf("        <checksum>%.08X</checksum>\n", be4(p->aidata));
						printf("      </assignment_info>\n");
					}
					else
					{
						printf("%sassignment info ", idnt);
						prtime("(be): ", be4(p->aitime));
						printf("; %.08X\n", be4(p->aidata));
					}
				}
				else						/* Data stored little-endian */
				{	
					aibe = FALSE;
	
					/* Client Type Requirements */
					if(le4(p->cltype) != 0)
					{
						struct strtab *cp = cltab;

						if(f_xmld == TRUE)
						{
							printf("      <client_type>\n");
							printf("        <type>%u</type>\n", le4(p->cltype));
						}
						else
						{
							printf("%sclient type: %u", idnt, le4(p->cltype));
						}
		
						for ( ; cp->type <= le4(p->cltype); ++cp)
						{
							if (cp->type == le4(p->cltype)) {
								if(f_xmld == TRUE)
								{
									printf("        <name>%s</name>\n", cp->name);
								}
								else 
								{
									printf(" %s", cp->name);
								}
							}
						}
		
						if(f_xmld == TRUE)
						{
							printf("      </client_type>\n");
						}
						else
						{
							printf("\n");
						}
					}
	
					if(f_xmld == TRUE)
					{
						printf("      <assignment_info>\n");
						printf("        <byte_order>le</byte_order>\n");
						printf("        <timestamp>");
						prtime("", le4(p->aitime));
						printf("</timestamp>\n");
						printf("        <checksum>%.08X</checksum>\n", le4(p->aidata));
						printf("      </assignment_info>\n");
					}
					else
					{
						printf("%sassignment info ", idnt);
						prtime("(le): ", le4(p->aitime));
						printf("; %.08X\n", le4(p->aidata));
					}
				}
			}
			
			/* Set the qgen flag if this queue.dat was generated by qgen.
			 * Indicates that this queue.dat has been generated by the qgen utility
			 */
			if (strncmp(&p->url[124], "qgen", 4) == 0)
			{
				za = 0x10;
			}
			else
			{
				za = 0;
			}

			/* Set the Packet Size Limit.
			 * Starting at v5.00, the queue.dat contains the field Packet Size Limit
			 */
			if (qver >= 500)
			{
				za |= 0x08;
			}

			/* One or more field flags were set, print their information */
			if (za != 0)
			{	
				/* Set the Collection Server flag if the value is non-zero in the queue.dat */
				if ((j = le4(p->csip)) != 0)
				{
					za |= 0x01;
				}

				/* Set the Download Timestamp flag if the value is non-zero in the queue.dat */
				if ((m = be4(p->dstart)) != 0)
				{
					za |= 0x02;
				}

				/* Set the Upload Failures flag if this is not the current WU and either
				 * the number of Upload Failures is non-zero or the WU is marked for Upload in
				 * the queue.dat
				 */
				if	(	(f != 2)		/* Not current unit */
					&&	(	(p->uploads != 0)
						||	(estat == 2)	/* Unit is pending upload */
						)
					) za |= 0x04;
				
				/* Print all the information for which the flags were set */
				while ((k = lform(&za)) != 0)
				{
					if (k == 0x01)
					{
						if(f_xmld == TRUE)
						{
							printf("      <collection_server>");
							printip("", j, 0);
							printf("</collection_server>\n");
						}
						else
						{
							printip("CS: ", j, 0);
						}
					}
					else if (k == 0x02)
					{
						if(f_xmld == TRUE)
						{
							printf("      <download_timestamp>");
							prtime("", m);
							printf("</download_timestamp>\n");
						}
						else
						{
							prtime("DL: ", m);
						}
					}
					else if (k == 0x04)
					{
						if(f_xmld == TRUE)
						{
							printf("      <upload_failures>%u</upload_failures>\n", p->uploads);
						}
						else
						{
							printf("upload failures: %u", p->uploads);
						}
					}
					else if (k == 0x08)
					{
						if(f_xmld == TRUE)
						{
							printf("      <packet_size_limit>%u</packet_size_limit>\n", p->plimit);	
						}
						else
						{
							printf("P limit: %u", p->plimit);
						}
					}
					else if (k == 0x10)
					{
						if(f_xmld == TRUE)
						{
							printf("      <qgen>true</qgen>\n");
						}
						else
						{
							printf("(qgen)");
						}
					}
				}
			}
		}
		if(f_xmld == TRUE)
		{
			printf("      <username>%s</username>\n", p->uname);
		}
		else
		{
			printf("%.64suser: %s", idnt, p->uname);
		}
		if (p->teamn[0] != '\0')
		{
			if(f_xmld == TRUE)
			{
				printf("      <team>%.64s</team>\n", p->teamn);
			}
			else
			{
				printf("; team: %.64s", p->teamn);
			}
		}
		if(f_xmld == TRUE)
		{
			printf("      <id>");
		}
		else
		{
			printf("; ID: ");
		}
		if(aibe == TRUE)
		{
			for (j = 7; j >= 0; --j) printf("%02X", p->uid[j] & 0xFF);
		}
		else
		{
			for (j = 0; j < 8; ++j) printf("%02X", p->uid[j] & 0xFF);
		}
		if(f_xmld == TRUE) 
		{
			printf("</id>\n");
		}
		if ((j = le4(p->mid)) != 0)
		{
			if (aibe == TRUE)
			{
				if(f_xmld == TRUE)
				{
					printf("      <machine_id>%d</machine_id>\n", be4(p->mid));
				}
				else
				{
					printf("; mach ID: %d\n", be4(p->mid));
				}
			}
			else
			{
				if(f_xmld == TRUE)
				{
					printf("      <machine_id>%d</machine_id>\n", le4(p->mid));
				}
				else
				{
					printf("; mach ID: %d\n", le4(p->mid));
				}
			}
		}
		else
		{
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
		}
		if (f_cpct == FALSE)
		{	
			if(f_xmld == TRUE)
			{
				printf("      <work_unit>\n");
				printf("        <file>work/wudata_%02d.dat</file>\n", n);
				printf("        <size>%u</size>\n", p->dsiz);
			}
			else
			{
				printf("%swork/wudata_%02d.dat file size: %u", idnt, n, p->dsiz);
			}
			if (p->type[0] != '\0')
			{
				if(f_xmld == TRUE)
				{
					printf("        <type>%.64s</type>\n", p->type);
				}
				else
				{
					printf("; WU type: %.64s\n", p->type);
				}
			}
			else
			{
				if(f_xmld == FALSE)
				{
					printf("\n");
				}
			}
			if(f_xmld == TRUE)
			{
				printf("      </work_unit>\n");
			}
		}
		if (f_dbgd == TRUE && f_xmld == FALSE)
		{	
			printb(p, p->z192, 16);
			printb(p, p->z224, 36);
			if (qver < 324) 
			{
				printb(p, (char *) &p->expire, 192);
			}
			else
			{
				printb(p, p->z500, 4);
				printb(p, p->z528, 4);
				printb(p, p->z536, 8);
				printb(p, p->z564, 16);
				printb(p, p->z624, 64);
			}
		}
		if(f_xmld == TRUE)
		{
			printf("    </index>\n");
		}
	}

	/* Print a few global things from the end of the queue data */

	gf = (f_indt == TRUE);
	if (qver < 324)
	{
		bp = (struct qf *) ((char *) &qbuf - 160);
	}
	if (qver < 500)
	{
		bp = (struct qf *) ((char *) bp - 80);
	}

	if (((qver >= 401) && (bp->dunits != 0)) || ((qver >= 500) && (le4(bp->results_sent) > 0)))
	{	if (gf)
		{	
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
			gf = FALSE;
		}
	}
	
	if (qver >= 500)
	{
		/* As of v5.00 the date on which a failed upload was successfully uploaded
		 * can be stored near the end of the queue.dat file. It is set to the same
		 * time the below message is logged in the FAHlog.txt:
		 * [16:05:31] + Results successfully sent
		 */
		if(le4(bp->results_sent) > 0) {
			if(f_xmld == TRUE) {
				printf("    <results_successfully_sent>");
				prtime("", le4(bp->results_sent));
				printf("</results_successfully_sent>\n");
			}
			else 
			{
				prtime("Results successfully sent: ", le4(bp->results_sent));
				printf("\n");
			}
		}
	}	
	
	if ((qver >= 401) && (bp->dunits != 0))
	{
		if(f_xmld == TRUE)
		{
			printf("    <download_rate>\n");
			printf("      <speed>%u.%03u KB/s</speed>\n", bp->drate / 1000, bp->drate % 1000);
			printf("      <units>%u</units>\n", bp->dunits);
			printf("    </download_rate>\n");
		}
		else
		{
			printf("Average download rate %u.%03u KB/s (u=%u)",
				bp->drate / 1000, bp->drate % 1000, bp->dunits);
		}
		if (bp->uunits != 0)
		{
			if(f_xmld == TRUE)
			{
				printf("    <upload_rate>\n");
				printf("      <speed>%u.%03u KB/s</speed>\n", bp->urate / 1000, bp->urate % 1000);
				printf("      <units>%u</units>\n", bp->uunits);
				printf("    </upload_rate>\n");
			}
			else
			{
				printf("; upload rate %u.%03u KB/s (u=%u)\n",
					bp->urate / 1000, bp->urate % 1000, bp->uunits);
			}
		}
		else
		{
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
		}
	}
	if ((qver >= 324) && (bp->punits != 0))
	{	if (gf)
		{
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
			gf = FALSE;
		}
		
		/* Copy the unsigned int performance fraction from the queue to 
		 * the floating points performance fraction
		 * 
		 * This fixes the GCC warning:
		 *  dereferencing type-punned pointer will break strict-aliasing rules
		 * The code was: *(float *)&bp->pfract
		 */
		memcpy( &pfract, &bp->pfract, sizeof( float ) );
		
		if(f_xmld == TRUE)
		{
			printf("    <performance_fraction>\n");
			printf("      <fraction>%.6f</fraction>\n", pfract);
			printf("      <units>%u</units>\n", bp->punits);
			printf("    </performance_fraction>\n");
		}
		else
		{
			printf("Performance fraction %.6f (u=%u)\n",
					pfract, bp->punits);
		}
	}
	if (qver >= 500)
	{
		if ((f_dbgd == TRUE) && (f_xmld == FALSE))
		{
			printb(bp, bp->z7156, 12);
		}
	}

	/* Print out our calculated score rates */

	if (bst != 0.0)
	{	if (gf)
		{	
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
			gf = FALSE;
		}
		d = bsp / bst;
		if(f_xmld == TRUE)
		{
			printf("    <pph>%.3f</pph>\n", d * 3600.0);
			printf("    <ppd>%.2f</ppd>\n", d * 86400.0);
			printf("    <ppw>%.1f</ppw>\n", d * 604800.0);
			printf("    <ppy>%.0f</ppy>\n", d * 31556736.0);
		}
		else
		{
			printf("Average pph: %.3f, ppd: %.2f, ppw: %.1f, ppy: %.0f\n",
				d * 3600.0, d * 86400.0, d * 604800.0, d * 31556736.0);
		}
	}
	if (bbst != 0.0)
	{	
		d = bbsp / bbst;
		if(f_xmld == TRUE)
		{
			printf("    <bonus_pph>%.3f</bonus_pph>\n", d * 3600.0);
			printf("    <bonus_ppd>%.2f</bonus_ppd>\n", d * 86400.0);
			printf("    <bonus_ppw>%.1f</bonus_ppw>\n", d * 604800.0);
			printf("    <bonus_ppy>%.0f</bonus_ppy>\n", d * 31556736.0);
		}
		else
		{
			printf("Average bonus pph: %.3f, ppd: %.2f, ppw: %.1f, ppy: %.0f\n",
				d * 3600.0, d * 86400.0, d * 604800.0, d * 31556736.0);
		}
	}
	if (abst != 0.0)
	{	
		d = absp / abst;
		if(f_xmld == TRUE)
		{
			printf("    <alternate_pph>%.3f</alternate_pph>\n", d * 3600.0);
			printf("    <alternate_ppd>%.2f</alternate_ppd>\n", d * 86400.0);
			printf("    <alternate_ppw>%.1f</alternate_ppw>\n", d * 604800.0);
			printf("    <alternate_ppy>%.0f</alternate_ppy>\n", d * 31556736.0);
		}
		else
		{
			printf("Average alternate pph: %.3f, ppd: %.2f, ppw: %.1f, ppy: %.0f\n", 
				d * 3600.0, d * 86400.0, d * 604800.0, d * 31556736.0);
		}
	}
	if (abbst != 0.0)
	{	
		d = abbsp / abbst;
		if(f_xmld == TRUE)
		{
			printf("    <alternate_bonus_pph>%.3f</alternate_bonus_pph>\n", d * 3600.0);
			printf("    <alternate_bonus_ppd>%.2f</alternate_bonus_ppd>\n", d * 86400.0);
			printf("    <alternate_bonus_ppw>%.1f</alternate_bonus_ppw>\n", d * 604800.0);
			printf("    <alternate_bonus_ppy>%.0f</alternate_bonus_ppy>\n", d * 31556736.0);
		}
		else
		{
			printf("Average alternate bonus pph: %.3f, ppd: %.2f, ppw: %.1f, ppy: %.0f\n",
				d * 3600.0, d * 86400.0, d * 604800.0, d * 31556736.0);
		}
	}
	if(f_xmld == TRUE) 
	{
		printf("  </queue>\n");
		printf("</queue_dump>\n");
	}
	if (fpm != NULL)
	{
		fclose(fpm);
	}
	exit(0);
}

/* Construct file name (in wbuf) */

void cfn(char *fn, int n)
{
char *p;
int i;
char w[4];

	if	(	((i = strlen(fdir)) == 0)
		||	(strncmp(fn, "/", 1) == 0)
		||	(strncmp(fn, "./", 2) == 0)
		||	(strncmp(fn, "../", 3) == 0)
#if SYSTYPE == 1
		||	(strncmp(fn, "\\", 1) == 0)
		||	(strncmp(fn, ".\\", 2) == 0)
		||	(strncmp(fn, "..\\", 3) == 0)
		||	(fn[1] == ':')
#endif
		) sprintf(wbuf, "%.200s", fn);
	else if (fdir[i - 1] == '/')
		sprintf(wbuf, "%.200s%.90s", fdir, fn);
	else
		sprintf(wbuf, "%.200s/%.90s", fdir, fn);
	if ((p = strstr(wbuf, "??")) != NULL)
	{	sprintf(w, "%02d", n);
		*p++ = w[0];
		*p = w[1];
	}
#if SYSTYPE == 1
	for (p = wbuf; *p != '\0'; ++p)
		if (*p == '/') *p = '\\';
#endif
}

/* Construct line with variable fields */

int lform(int *p)
{
int i, n;

	n = *p;
	if ((n & 0x7FFF) == 0)
	{	if (n != 0)
		{
			if(f_xmld == FALSE)
			{
				printf("\n");
			}
		}
		return (0);
	}
	if ((n & 0x8000) == 0)
	{	
		if(f_xmld == FALSE)
		{
			printf("%s", idnt);
		}
		n |= 0x8000;
	}
	else
	{
		if(f_xmld == FALSE)
		{
			printf("; ");
		}
	}
	i = n;
	n &= (n - 1);
	*p = n;
	return (i - n);
}

/* Print CPU or OS string */

void prstr(char *q, u32 t, u32 s, struct strtab *p)
{
	if (t > 0xFFFF) t = es32(t);	/* These numbers can be either endian */
	if (s > 0xFFFF) s = es32(s);
	if(f_xmld == TRUE)
	{
		printf("      <");
		lower(q);
		printf(">\n");
		printf("        <cosm_type>%u</cosm_type>\n", t);
		printf("        <cosm_subtype>%u</cosm_subtype>\n", s);
	}
	else
	{
		printf("%s: %u,%u", q, t, s);
	}
	if (t == 0) t = 1;
	t *= 100000;
	t += s;
	for ( ; p->type != t; ++p)
	{
		if (p->type == 0) {
			if(f_xmld == TRUE)
			{
				printf("      </%s>\n", q);
			}
			return;
		}
	}
	if(f_xmld == TRUE)
	{
		printf("        <name>%s</name>\n", p->name);
		printf("      </");
		lower(q);
		printf(">\n");
	}
	else
	{
		printf(" %s", p->name);
	}
}

/* Print FAH core (psummary.html) name or (qd log entry format) short name */
void prcore(char *indent, u32 n, struct strtab *core)
{
	if(f_xmld == TRUE)
	{
		printf("        <number>0x%02x</number>\n", n);
	}
	else
	{
		printf("%score number: 0x%02x", indent, n);
	}
	
	for ( ; core->type != n; ++core)
	{
		if (core->type == 0) {
			if(f_xmld != TRUE)
			{
				printf("\n");
			}
			return;
		}
	}

	if(f_xmld == TRUE)
	{
		printf("        <name>%s</name>\n", core->name);
	}
	else
	{
		printf("; core name: %s\n", core->name);
	}
}

/* Print IP address */

void printip(char *p, unsigned int ad, unsigned int pt)
{
	printf("%s%u.%u.%u.%u", p,
			ad >> 24, (ad >> 16) & 0xFF, (ad >> 8) & 0xFF, ad & 0xFF);
	if (pt != 0) printf(":%u", pt);
}

/* Print time and date, epoch 0000 1 January 2000 */

void prtime(char *p, unsigned int t)
{
int d, i, y;
char *q, *w;
#if !NO_CTIME
time_t a;
#endif

	if (t == 0)
	{	printf("%sZERO", p);
		return;
	}
#if !NO_CTIME
	if (f_zone == FALSE)
	{	a = t + TIME_OFS;	/* Adjust epoch, "ctime" does local time zone */
		if ((q = ctime(&a)) == NULL) q = "BAD DATE";	/* ?? */
		else q[strlen(q) - 1] = '\0';	/* Get rid of the newline */
		printf("%s%s", p, q);
		return;
	}
#endif
	t += tzone;
	i = 1401 + t / 86400;
	w = &"FriSatSunMonTueWedThu"[3 * (i % 7)];
	d = i % 1461;
	d += 60 + d / 365;
	if (d == 1524) --d;
	y = 1996 + ((i / 1461) << 2) + d / 366;
	d %= 366;
	for (q = mtab; (i = d - (int) q[3]) >= 0; q += 4) d = i;
	i = t % 86400;
	printf("%s%3.3s%4.3s%3d %02d:%02d:%02d %d", p,
			w, q, d + 1, i / 3600, (i % 3600) / 60, i % 60, y);
}

/* Print hex bytes */

void printb(void *p, void *q, int n)
{
int i;
int a;
char *fmt;

	a = (int) q - (int) p;
	fmt = ((a + (n & ~0xF)) < 1000) ? " %s%03d:" : "%s%04d:";
	printf(fmt, idnt, a);
	i = 0;
	while (--n >= 0)
	{	if (i >= 16)
		{	printf("\n");
			printf(fmt, idnt, a);
			i = 0;
		}
		if (++i == 9) printf(" ");
		printf(" %02X", ((char *) p)[a++] & 0xFF);
	}
	printf("\n");
}

/* Endian-swap functions */

u32 es32(u32 i)				/* 4-byte endian swap */
{
	return ((i << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24));
}

void eswp(struct qf *bp)	/* Swap endianness of entire queue file */
{
int i, n;
struct qs *p;

	bp->version = es32(bp->version);
	bp->current = es32(bp->current);
	for (n = 10; --n >= 0; )
	{	p = &bp->entry[n];
		if (qver < 324)
			p = (struct qs *) ((char *) p - 16 * n);
		if (qver < 500)
			p = (struct qs *) ((char *) p - 8 * n);
		if ((qver < 401) && (systype != 1))
			p = (struct qs *) ((char *) p - 4 * n);
		p->stat = es32(p->stat);
		if ((qver < 401) && (systype != 1))
			p = (struct qs *) ((char *) p - 4);
		p->tdata[0] = es32(p->tdata[0]);
		p->tdata[1] = es32(p->tdata[1]);
		p->tdata[2] = es32(p->tdata[2]);
		p->tdata[3] = es32(p->tdata[3]);
		p->tdata[4] = es32(p->tdata[4]);
		p->tdata[5] = es32(p->tdata[5]);
		p->tdata[6] = es32(p->tdata[6]);
		p->tdata[7] = es32(p->tdata[7]);
		p->svr1 = es32(p->svr1);
		p->ustat = es32(p->ustat);
		p->m176 = es32(p->m176);
		p->core = es32(p->core);
		p->m184 = es32(p->m184);
		p->dsiz = es32(p->dsiz);
		if (((i = p->core) & 0xFF) == 0)
			i = es32(i);
		p->svr2 = es32(p->svr2);
		p->port = es32(p->port);
		p->expire = es32(p->expire);
		if (qver >= 324)
		{	p->due[0] = es32(p->due[0]);
			p->due[1] = es32(p->due[1]);
			p->due[2] = es32(p->due[2]);
			p->due[3] = es32(p->due[3]);
		}
		if (qver >= 500)
		{	p->uploads = es32(p->uploads);
			p->plimit  = es32(p->plimit);
			/* may also have to swap p->cores and p->tag */
		}
	}
	if (qver < 500)
		bp = (struct qf *) ((char *) bp - 80);
	if (qver >= 324)
	{	bp->pfract = es32(bp->pfract);
		bp->punits = es32(bp->punits);
	}
	if (qver >= 400)
	{	bp->drate  = es32(bp->drate);
		bp->dunits = es32(bp->dunits);
		bp->urate  = es32(bp->urate);
		bp->uunits = es32(bp->uunits);
	}
}

/* print string in lowercase */

void lower ( char *str ) {
	while (*str) {
		printf("%c", tolower(*str));
		str++;
	}
}
