#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define N 1000
#define BUFF10 (N * 10)
#define BIT 31
#define MASK 0x7fffffff
#define SIGN(x) (((x) >> (BIT - 1)) ? 1 : 0)
typedef unsigned int uintN[N];
void shift_div(int *mod, uintN q) {
int cy, i;
cy = 0;
for (i = 0; i < N; i++) {
q[i] = q[i] << 1;
if (cy)
q[i] = q[i] | 0x01;
cy = (q[i] >> BIT);
q[i] = q[i] & MASK;
}
*mod = *mod << 1;
if (cy)
*mod = *mod | 0x01;
}
void copy_uintN(uintN a, uintN b) {
int i;
for (i = 0; i < N; i++)
a[i] = b[i];
}
void div10(uintN n, uintN q, int *mod) {
int i;
copy_uintN(q, n);
*mod = 0;
for (i = 0; i < N * BIT; i++) {
shift_div(mod, q);
if (*mod >= 10) {
q[0] = q[0] | 0x01;
*mod = *mod - 10;
}
}
}
int iszero_uintN(uintN n) {
int i;
for (i = 0; i < N; i++)
if (n[i] != 0)
return 0;
return 1;
}
void output10(uintN m) {
int mod10[BUFF10];
uintN q, n;
int i, mod;
copy_uintN(n, m);
for(i = 0;;) {
div10(n, q, &mod);
if (iszero_uintN(q) && mod == 0)
break;
mod10[i++] = mod;
copy_uintN(n, q);
}
i--;
if (i < 0) {
putchar('0');
return;
}
for (;i >= 0; --i)
putchar('0' + mod10[i]);
}
/*---------------------------------------------------------*/
#define M 1492
uintN p;
int main(int argc, char *argv[])
{
int i, k;
for (i = 0, k = M; k >= BIT; i++, k -= BIT)
p[i] = MASK;
for (; k > 0; --k) {
p[i] = p[i] << 1;
p[i] |= 1;
}
output10(p);
return 0;
}
/* end */
/*
13701039886888296385792026546984710153720318703254
23000940460860343397025412629773580354722132225361
78332618776544677802340994331802617030289730620773
45586268707014252081678618940157309212290213490891
47825786665212943572588474466504897797632395115650
18222861530279071623083004583441915452328553554240
54950903888363366272596653369828411329981748170778
17721668107944249347540702860431744661471426170000
00683802170035386251696025540573107514389504720895
*/
I2luY2x1ZGUgPHN0ZGlvLmg+CiNp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