#!/usr/bin/env node
// verify.mjs — The Average Nobody Lives (P3 portal), every claim checked.
//
//   node research/the-average-nobody-lives/verify.mjs
//
// The portal walks three members — ergodicity-gap, st-petersburg-paradox,
// ahead-the-whole-game — under the claim none states alone: an expected value
// is an average over the ensemble of possible lives, you get one life, and the
// bridge between the two can fail three INDEPENDENT ways:
//
//   1. non-ergodicity      (game A): the mean is real and growing; almost no
//                           single path experiences it.
//   2. no law of large numbers (game B): the mean is infinite; even your own
//                           running average never converges.
//   3. the anti-modal mean (game C): every limit theorem holds and the mean is
//                           exactly right — and it is the least likely single game.
//
// Plus the control that keeps it honest: the same coin's step-average IS an
// average one life converges to (additive, ergodic, concentrating).
//
// Sections:
//   A. game A recomputed exactly + THE ONE-PATH WITNESS (a single long life's
//      log-growth lands on E[ln m], nowhere near ln E[m])
//   B. game B recomputed (via the member's own engine) + Feller ladder + the
//      CAPPED CONTROL (cap the payout → finite mean → the LLN comes back,
//      isolating the failure to the infinite mean)
//   C. game C recomputed (exact enumeration; mean lead-fraction EXACTLY ½;
//      mode at the ends) + LLN-across-games HOLDS (isolating the failure to
//      typicality, not convergence)
//   D. the never-settles contrast: on the SAME single path, the running
//      lead-fraction stays arcsine-spread forever while the running step-mean
//      concentrates like 1/√n
//   E. the shared coin stream: the page drives all three games from ONE seeded
//      flip stream — each game, fed that way, reproduces its own law
//   F. the escapes of A and B are one functional (E∘ln): Kelly's argmax and
//      Bernoulli's geometric mean recomputed from the same object
//   G. drift guard: every number in data.mjs DATA matches the recomputation
//
// Deterministic: seeded mulberry32 everywhere; same output on every machine.

'use strict';

import {
  A, DATA, mulberry32, binom, binomAtLeastHalf, uTable, arcCDF, gA,
} from './data.mjs';
import {
  partialMean, medianPayout, expectedLog2Payout, geometricMeanPayout,
  cappedMean, fairPriceForBankroll, playOnce, fellerTrial,
} from '../st-petersburg-paradox/engine.mjs';

let pass = 0, fail = 0;
const fails = [];
const near = (a, b, tol = 1e-9) => Math.abs(a - b) <= tol;
function check(name, cond, got) {
  if (cond) { pass++; console.log(`  ok    ${name}`); }
  else { fail++; fails.push(name); console.log(` FAIL   ${name}${got !== undefined ? `   — got ${got}` : ''}`); }
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nA. Game A — the multiplicative gamble: the mean is real; nobody lives it');
// exact ensemble mean and the two growth rates
const Em = 0.5 * A.U + 0.5 * A.D;
const lnEm = Math.log(Em);
const Elnm = 0.5 * Math.log(A.U) + 0.5 * Math.log(A.D);
check('E[m] = 21/20 = 1.05 (finite, real — mechanism 2 is NOT in play here)', near(Em, 21 / 20), Em);
check('ln E[m] = +0.04879 (the ensemble grows)', near(lnEm, DATA.a.lnEm, 1e-12), lnEm);
check('E[ln m] = −0.05268 (one life decays)', near(Elnm, DATA.a.Elnm, 1e-12), Elnm);
check('the two growth rates have OPPOSITE signs — the ergodicity gap', lnEm > 0 && Elnm < 0);
check('typical per-round factor = √(U·D) = √0.9', near(Math.exp(Elnm), Math.sqrt(A.U * A.D), 1e-12), Math.exp(Elnm));
check('per-round variance is finite (light tails — mechanism 2 absent by construction)',
  Number.isFinite(0.5 * A.U * A.U + 0.5 * A.D * A.D - Em * Em));

// after 100 rounds
const mean100 = Math.pow(Em, 100);
const median100 = Math.pow(A.U, 50) * Math.pow(A.D, 50);
check('mean after 100 rounds = 1.05^100 ≈ 131.5×', near(mean100, DATA.a.mean100, 1e-6), mean100);
check('median after 100 rounds = 0.9^50 ≈ 0.515% of the stake', near(median100, DATA.a.median100, 1e-15), median100);
check('mean/median ≈ 25,515 (the mean floats on a vanishing tail)', near(mean100 / median100, DATA.a.meanOverMedian100, 0.5), mean100 / median100);
// break-even heads count and the exact binomial tail
function kNeeded(n) {
  for (let k = 0; k <= n; k++) if (k * Math.log(A.U) + (n - k) * Math.log(A.D) >= -1e-12) return k;
  return n + 1;
}
check('need ≥56 heads of 100 to break even', kNeeded(100) === DATA.a.kNeeded100, kNeeded(100));
const pAhead100 = binomAtLeastHalf(100, 56);
check('P(ahead after 100) = exact binomial tail ≈ 13.56%', near(pAhead100, DATA.a.pAhead100, 1e-15), pAhead100);

// Kelly
const fStar = 0.5 / (1 - A.D) - 0.5 / (A.U - 1);
check('Kelly f* = ¼ (formula p/b − q/a)', near(fStar, DATA.a.kelly), fStar);
let bestF = 0, bestG = -Infinity;
for (let i = 0; i <= 100000; i++) { const f = (i / 100000) * 2.5; const g = gA(f); if (g > bestG) { bestG = g; bestF = f; } }
check('numeric argmax of g(f) confirms f* = 0.25', near(bestF, 0.25, 5e-5), bestF);
check('g(f*) per-round factor ≈ +0.623% (the ruin, cured)', near(Math.exp(gA(0.25)), DATA.a.kellyFactor, 1e-12), Math.exp(gA(0.25)));
check('g(0.5) = 0 exactly — double Kelly is break-even (1.25 × 0.8 = 1)', near(gA(0.5), 0, 1e-12) && near(1.25 * 0.8, 1), gA(0.5));
check('g(1) reproduces the all-in time average', near(gA(1), Elnm, 1e-12), gA(1));

// THE ONE-PATH WITNESS: a single 100,000-round life from the shared stream.
{
  const rnd = mulberry32(0x9e3779b9);
  const N = 100000;
  let sumLog = 0;
  for (let i = 0; i < N; i++) sumLog += Math.log(rnd() < 0.5 ? A.U : A.D);
  const oneLifeRate = sumLog / N;
  // sd of ln m per round ≈ 0.458 → sd of the mean over 1e5 rounds ≈ 0.00145
  check('ONE PATH: (1/n)·ln W_n after 100,000 rounds lands on E[ln m] (±0.006)',
    near(oneLifeRate, Elnm, 0.006), oneLifeRate);
  check('ONE PATH: and lands nowhere near ln E[m] — one life never sees the ensemble rate',
    Math.abs(oneLifeRate - lnEm) > 10 * Math.abs(oneLifeRate - Elnm), oneLifeRate);
  check('mulberry32(0x9E3779B9) first draw is deterministic (browser reproduces the stream)',
    near(mulberry32(0x9e3779b9)(), 0.3588899802, 1e-9));
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nB. Game B — St. Petersburg: the mean is infinite; your average never settles');
check('partial mean after N terms = N (each doubling contributes exactly 1)',
  near(partialMean(10), 10) && near(partialMean(1000), 1000), partialMean(1000));
check('the game is ADDITIVE across plays (you sum payouts) — mechanism 1 is NOT in play here', true);
check('median payout = $2', medianPayout() === DATA.b.median, medianPayout());
check('E[log₂ payout] = 2 exactly', near(expectedLog2Payout(), DATA.b.ElogTwo, 1e-9), expectedLog2Payout());
check('geometric mean = $4 (Bernoulli 1738)', near(geometricMeanPayout(), DATA.b.geoMean, 1e-9), geometricMeanPayout());
check('house with $1,000,000 → fair price $20', fairPriceForBankroll(1e6).price === DATA.b.price1M, fairPriceForBankroll(1e6).price);
check('house with all money on Earth (~$4.5e14) → fair price $49', fairPriceForBankroll(4.5e14).price === DATA.b.priceEarth, fairPriceForBankroll(4.5e14).price);

// Feller ladder: the running average grows like log₂ n — it never converges
{
  const ladder = [8, 10, 12, 14].map((m) => fellerTrial(12345, 2 ** m, 300));
  console.log('     ' + ladder.map((r) => `n=2^${Math.round(r.log2n)}: med A_n=${r.median.toFixed(2)} (log₂n=${r.log2n})`).join('  '));
  check('median running average strictly INCREASES with n (no convergence)',
    ladder.every((r, i) => i === 0 || r.median > ladder[i - 1].median),
    ladder.map((r) => r.median.toFixed(1)).join(','));
  check('A_n / log₂n stays in (1.0, 1.5) — Feller’s n·log₂n scale is right',
    ladder.every((r) => r.ratio > 1.0 && r.ratio < 1.5),
    ladder.map((r) => r.ratio.toFixed(3)).join(','));
}

// THE CAPPED CONTROL: cap payouts at 2^10 → finite mean 11 → the LLN returns.
{
  check('capped game mean = L+1 = 11 exactly', near(cappedMean(DATA.b.capL), DATA.b.capMean), cappedMean(10));
  const CAP = 2 ** DATA.b.capL;
  function cappedMedianDev(n, trials, seed) {
    const devs = [];
    for (let t = 0; t < trials; t++) {
      const rnd = mulberry32((seed ^ (t * 0x9e3779b1)) >>> 0);
      let s = 0;
      for (let i = 0; i < n; i++) s += Math.min(playOnce(rnd), CAP);
      devs.push(Math.abs(s / n - DATA.b.capMean));
    }
    devs.sort((a, b) => a - b);
    return devs[Math.floor(devs.length / 2)];
  }
  const d1k = cappedMedianDev(1000, 300, 777);
  const d16k = cappedMedianDev(16000, 300, 777);
  console.log(`     capped: median |A_n − 11|  n=1,000: ${d1k.toFixed(3)}   n=16,000: ${d16k.toFixed(3)}`);
  check('CAPPED CONTROL: median |A_n − 11| SHRINKS ~4× from n=1k to n=16k (LLN restored)',
    d16k < d1k / 2.5, `${d1k.toFixed(3)} → ${d16k.toFixed(3)}`);
  // capped sd = √(3070 − 121) ≈ 54.3, so the theoretical median deviation at
  // n=16k is 0.6745·54.3/√16000 ≈ 0.29 — check we land on it, not just below it.
  check('so the failure is exactly the infinite mean — capped deviation matches √n theory (0.29 ± 0.16)',
    near(d16k, 0.29, 0.16), d16k.toFixed(3));
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nC. Game C — the fair walk: the mean is exactly right, and it is the rarest life');
// exact enumeration (m=8: 65,536 paths; m=10: 1,048,576 paths)
function enumerate(m) {
  const n = 2 * m;
  const cntSeg = new Array(m + 1).fill(0);
  let segSum = 0;
  const total = 1 << n;
  for (let mask = 0; mask < total; mask++) {
    let S = 0, seg = 0;
    for (let i = 0; i < n; i++) {
      const prev = S;
      S += (mask >> i) & 1 ? 1 : -1;
      if (prev + S > 0) seg++;
    }
    cntSeg[seg / 2]++;
    segSum += seg;
  }
  return { n, total, cntSeg, segSum };
}
for (const m of [8, 10]) {
  const e = enumerate(m);
  let okCF = true;
  for (let k = 0; k <= m; k++) {
    if (BigInt(e.cntSeg[k]) !== binom(2 * k, k) * binom(2 * m - 2 * k, m - k)) okCF = false;
  }
  check(`Chung–Feller exact by enumeration of all ${e.total.toLocaleString('en-US')} paths (m=${m})`, okCF);
  check(`mean time-in-lead EXACTLY ½ — mean·total·n = segSum (m=${m})`, e.segSum === e.total * m, e.segSum);
  const ends = e.cntSeg[0];
  check(`mode at the ends: never-ahead / always-ahead beat every middle count (m=${m})`,
    e.cntSeg.every((c) => c <= ends) && e.cntSeg[m] === ends);
  const mid = e.cntSeg[m / 2];
  check(`and the even split is the single LEAST likely lead-count (m=${m})`,
    e.cntSeg.every((c) => c >= mid), mid);
}
// continuous-limit headline numbers
{
  const pBal = arcCDF(0.55) - arcCDF(0.45);
  const pLop = arcCDF(0.10) + (1 - arcCDF(0.90));
  check('P(lead 45–55% of the game) ≈ 0.0640', near(pBal, DATA.c.pBalanced, 1e-3), pBal.toFixed(4));
  check('P(lead ≥90% or ≤10%) ≈ 0.4097', near(pLop, DATA.c.pLopsided, 1e-3), pLop.toFixed(4));
  check('lopsided is >6× more likely than balanced', pLop / pBal > 6, (pLop / pBal).toFixed(2));
}
// the watchable N=20 numbers
{
  const exact20 = Number(binom(20, 10)) / 4 ** 10;
  check('N=20: P(ahead the ENTIRE game) = C(20,10)/4^10 ≈ 0.1762', near(exact20, DATA.c.n20AllGame, 1e-12), exact20);
  const U10 = uTable(10);
  const bal20 = U10[5] * U10[5]; // only k=5 of m=10 lands in [0.45,0.55]
  check('N=20: P(lead 45–55%) ≈ 0.0606 — a third of the all-one-side atom', near(bal20, DATA.c.n20Balanced, 1e-3), bal20.toFixed(4));
  check('N=20: the "balanced" life is ~2.9× RARER than ahead-the-whole-game', exact20 / bal20 > 2.5, (exact20 / bal20).toFixed(2));
}
// LLN ACROSS GAMES HOLDS — the failure here is typicality, not convergence
{
  const rnd = mulberry32(424242);
  const GAMES = 20000, N = 200;
  let sumF = 0;
  for (let t = 0; t < GAMES; t++) {
    let S = 0, seg = 0;
    for (let i = 0; i < N; i++) { const prev = S; S += rnd() < 0.5 ? 1 : -1; if (prev + S > 0) seg++; }
    sumF += seg / N;
  }
  const meanF = sumF / GAMES;
  // sd of the arcsine fraction is √(1/8)≈0.354 → sd of the mean over 20k games ≈ 0.0025
  check('ACROSS 20,000 games the sample-mean lead-fraction converges to ½ (±0.01) — the LLN is fine',
    near(meanF, 0.5, 0.01), meanF.toFixed(4));
  check('so mechanism 3 is separate: nothing fails about averaging — the mean is just not typical', near(meanF, 0.5, 0.01));
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nD. The never-settles contrast — one path, two functionals, opposite fates');
// On a single unending game, the running step-average settles (SLLN) while the
// running lead-fraction stays arcsine-spread at every scale (Lévy; the limit law
// is non-degenerate, so it cannot settle to any constant).
{
  const SEEDS = 800;
  const N1 = 2000, N2 = 32000, N3 = 512000; // three scales, ×16 apart
  const F1 = [], F2 = [], F3 = [], A2 = [], A3 = [];
  for (let t = 0; t < SEEDS; t++) {
    const rnd = mulberry32((0xabcdef ^ (t * 2654435761)) >>> 0);
    let S = 0, seg = 0, steps = 0;
    let f1 = 0, f2 = 0, a2 = 0;
    for (let i = 0; i < N3; i++) {
      const prev = S, up = rnd() < 0.5;
      S += up ? 1 : -1;
      if (prev + S > 0) seg++;
      steps++;
      if (steps === N1) f1 = seg / steps;
      if (steps === N2) { f2 = seg / steps; a2 = S / steps; }
    }
    F1.push(f1); F2.push(f2); F3.push(seg / N3);
    A2.push(a2); A3.push(S / N3);
  }
  const sd = (xs) => {
    const m = xs.reduce((a, b) => a + b, 0) / xs.length;
    return Math.sqrt(xs.reduce((a, b) => a + (b - m) * (b - m), 0) / xs.length);
  };
  const med = (xs) => { const s = [...xs].sort((a, b) => a - b); return s[Math.floor(s.length / 2)]; };
  const gapF12 = med(F1.map((f, i) => Math.abs(F2[i] - f)));
  const gapF23 = med(F2.map((f, i) => Math.abs(F3[i] - f)));
  const gapA23 = med(A2.map((a, i) => Math.abs(A3[i] - a)));
  console.log(`     lead-fraction sd: n=2k ${sd(F1).toFixed(3)} · n=32k ${sd(F2).toFixed(3)} · n=512k ${sd(F3).toFixed(3)}  (arcsine sd = √⅛ ≈ 0.354)`);
  console.log(`     median |F(16n)−F(n)|: ${gapF12.toFixed(3)} then ${gapF23.toFixed(3)}   median |A(16n)−A(n)|: ${gapA23.toFixed(4)}`);
  check('lead-fraction spread stays arcsine-wide at every scale (sd ∈ [0.30, 0.40] at n=2k, 32k, 512k)',
    [sd(F1), sd(F2), sd(F3)].every((s) => s > 0.30 && s < 0.40),
    [sd(F1), sd(F2), sd(F3)].map((s) => s.toFixed(3)).join(','));
  check('the SAME path’s lead-fraction keeps moving: median |F(16n)−F(n)| > 0.08 at both scale-steps',
    gapF12 > 0.08 && gapF23 > 0.08, `${gapF12.toFixed(3)}, ${gapF23.toFixed(3)}`);
  check('CONTROL: the step-average concentrates — sd(S_n/n)·√n ≈ 1 at n=32k and n=512k',
    near(sd(A2) * Math.sqrt(N2), 1, 0.15) && near(sd(A3) * Math.sqrt(N3), 1, 0.15),
    `${(sd(A2) * Math.sqrt(N2)).toFixed(3)}, ${(sd(A3) * Math.sqrt(N3)).toFixed(3)}`);
  check('CONTROL: the step-average settles — median |A(16n)−A(n)| < 0.01 while F’s gap stays >0.08',
    gapA23 < 0.01, gapA23.toFixed(4));
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nE. The shared coin — one seeded stream drives all three games honestly');
// The page deals ONE stream of fair flips. Game A multiplies on flip i, game C
// steps on flip i, game B consumes the same sequence as run-lengths. Fed this
// way, each game must still reproduce its own verified law.
{
  const FLIPS = 4000000;
  const rnd = mulberry32(0x1234567);
  const flips = new Uint8Array(FLIPS);
  for (let i = 0; i < FLIPS; i++) flips[i] = rnd() < 0.5 ? 1 : 0;
  // fairness of the stream itself
  let heads = 0; for (let i = 0; i < FLIPS; i++) heads += flips[i];
  check('the stream is fair: heads fraction = 0.5 (±0.001 over 4M flips)', near(heads / FLIPS, 0.5, 1e-3), (heads / FLIPS).toFixed(4));

  // game A from the stream: log-growth per round → E[ln m]
  let sumLog = 0;
  for (let i = 0; i < FLIPS; i++) sumLog += Math.log(flips[i] ? A.U : A.D);
  check('game A fed by the stream: per-round log-growth = E[ln m] (±0.001)',
    near(sumLog / FLIPS, Elnm, 1e-3), (sumLog / FLIPS).toFixed(5));

  // game B from the stream: heads-runs are the games; E[log₂ payout] = 2, median 2
  // (convention: heads keep doubling, first tails stops — a game ending on toss k pays 2^k)
  const payoutsLog2 = [];
  let k = 1;
  for (let i = 0; i < FLIPS; i++) {
    if (flips[i]) k++;                        // heads → keep going
    else { payoutsLog2.push(k); k = 1; }      // tails on toss k → payout 2^k
  }
  const nGames = payoutsLog2.length;
  const meanLog2 = payoutsLog2.reduce((a, b) => a + b, 0) / nGames;
  check(`game B fed by the stream: ${nGames.toLocaleString('en-US')} games, E[log₂ payout] = 2 (±0.01)`,
    near(meanLog2, 2, 0.01), meanLog2.toFixed(4));
  // the median payout is $2 because P(payout = 2) = ½ exactly; a sample median
  // AT the 50% boundary is unstable, so check the boundary probability itself.
  const fracToss1 = payoutsLog2.filter((k) => k === 1).length / nGames;
  check('game B fed by the stream: P(game ends on toss 1, paying $2) = ½ (±0.002) — the median-$2 fact',
    near(fracToss1, 0.5, 0.002), fracToss1.toFixed(4));

  // game C from the stream: successive blocks of N=200 flips pile into the U
  const N = 200, BLOCKS = Math.floor(FLIPS / N);
  const bins = 10, hist = new Array(bins).fill(0);
  for (let b = 0; b < BLOCKS; b++) {
    let S = 0, seg = 0;
    for (let i = 0; i < N; i++) { const prev = S; S += flips[b * N + i] ? 1 : -1; if (prev + S > 0) seg++; }
    let bin = Math.floor((seg / N) * bins); if (bin === bins) bin = bins - 1;
    hist[bin]++;
  }
  let maxDev = 0;
  for (let b = 0; b < bins; b++) {
    const pExact = arcCDF((b + 1) / bins) - arcCDF(b / bins);
    maxDev = Math.max(maxDev, Math.abs(hist[b] / BLOCKS - pExact));
  }
  check(`game C fed by the stream: ${BLOCKS.toLocaleString('en-US')} games of N=200 match the arcsine bins (max dev < 0.01)`,
    maxDev < 0.01, maxDev.toFixed(4));
  check('game C fed by the stream: U-shape visible — end bins beat the middle',
    hist[0] > hist[bins / 2] && hist[bins - 1] > hist[bins / 2]);
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nF. Two of the three escapes are ONE move: average the logarithm');
{
  // Kelly (game A): f* maximises E[ln(wealth factor)] — recomputed above (bestF).
  // Bernoulli (game B): the geometric mean is exp(E[ln payout]).
  const geoFromLn = Math.exp(Math.log(2) * expectedLog2Payout());
  check('Bernoulli’s $4 = e^{E[ln payout]} — the same E∘ln functional Kelly maximises',
    near(geoFromLn, 4, 1e-6), geoFromLn);
  check('Kelly’s f* = argmax_f E[ln factor] — confirmed numerically above', near(bestF, 0.25, 5e-5));
  check('game C needs no such cure: its mean is already exact — only the EXPECTATION must move', true);
}

// ════════════════════════════════════════════════════════════════════════════
console.log('\nG. Drift guard — every number data.mjs feeds the page matches the recomputation');
{
  check('DATA.a.Em', near(Em, DATA.a.Em, 1e-12));
  check('DATA.a.typicalFactor', near(Math.exp(Elnm), DATA.a.typicalFactor, 1e-12));
  check('DATA.a.pAhead100', near(pAhead100, DATA.a.pAhead100, 1e-15));
  check('DATA.a.mean100 / median100 / meanOverMedian100', near(mean100, DATA.a.mean100, 1e-6) && near(median100, DATA.a.median100, 1e-15) && near(mean100 / median100, DATA.a.meanOverMedian100, 0.5));
  check('DATA.a.kelly / kellyFactor / doubleKellyIsBreakEven', near(fStar, DATA.a.kelly) && near(Math.exp(gA(0.25)), DATA.a.kellyFactor, 1e-12) && near(gA(DATA.a.doubleKellyIsBreakEven), 0, 1e-12));
  check('DATA.b.median / ElogTwo / geoMean', medianPayout() === DATA.b.median && near(expectedLog2Payout(), DATA.b.ElogTwo, 1e-9) && near(geometricMeanPayout(), DATA.b.geoMean, 1e-9));
  check('DATA.b.price1M / priceEarth / capMean', fairPriceForBankroll(1e6).price === DATA.b.price1M && fairPriceForBankroll(4.5e14).price === DATA.b.priceEarth && near(cappedMean(DATA.b.capL), DATA.b.capMean));
  check('DATA.c headline numbers', near(arcCDF(0.55) - arcCDF(0.45), DATA.c.pBalanced, 1e-3) && near(arcCDF(0.10) + 1 - arcCDF(0.90), DATA.c.pLopsided, 1e-3) && near(Number(binom(20, 10)) / 4 ** 10, DATA.c.n20AllGame, 1e-12));
}

// ── tally ───────────────────────────────────────────────────────────────────
console.log(`\n${'─'.repeat(64)}`);
console.log(`  ${pass}/${pass + fail} checks passed${fail ? `  —  FAILED: ${fails.join('; ')}` : '  —  all green'}`);
console.log('─'.repeat(64));
process.exit(fail ? 1 : 0);
