#!/usr/bin/env python3
"""The Feist Function (#850 AXN:035F, #1034 AXN:0416) run on the vision as a field of local settings. The fixed vision is RUN-VISION-18, preserved whole in VISION-FIXED.md. This is run 1, a new file; every change is a logged substitution."""
import re, pathlib, hashlib, importlib.util, io, contextlib
D = pathlib.Path(__file__).resolve().parent; R = D.parents[2]
def mod(n):
    s = importlib.util.spec_from_file_location(n, str(D/f"{n}.py")); m = importlib.util.module_from_spec(s)
    with contextlib.redirect_stdout(io.StringIO()): s.loader.exec_module(m)
    return m
V0 = mod("build_run_vision18").V18
wc = lambda s: len(re.findall(r"\S+", s)); sents = lambda s: len(re.findall(r"[.?!](?=\s|$)", s))
def at(axn, s):
    L = (R/f"data/texts/{axn.replace(':', '-')}-text.md").read_text().split("\n")
    for i, l in enumerate(L):
        if s in l: return f"“{s}” ({axn} l. {i+1})"
    raise AssertionError((axn, s))
SPEC = "AXN:0416"; PEARL = "AXN:0472"
REG = [("Opening and taking-up", None), ("Bones, pearl, machine", "The bones of one"), ("Seven and stars", "Seven planets went"), ("Ghost, wheels, hand", "In one of them stood a ghost."),
 ("The twelve, and the name", "About that star"), ("Eight addresses", "To Time, on the first planet."), ("Passage of the leaf", "I followed one leaf down."), ("Count and the year", "Then a count went round"),
 ("Silence", "Then there was quiet"), ("Three unsealings", "And I looked for what was done."), ("Witnesses and balance", "Then I saw two who had borne witness"), ("Fall and ingathering", "I looked for the city"),
 ("Thirty-sixth heaven, wedding", "Then the machines that had brought me carried"), ("City and red room", "Then the machines set me down"), ("Ark, the reading, the moon", "Then the water came up"),
 ("Fourth opening", "Then I was shown a fourth thing"), ("Final hand", "I looked at the back of my own hand.")]
# local settings as set for this run: tail depth, clinamen (T2 per sentence), new circuits opened, material speech; and why
SET = {"Opening and taking-up": ("high", 0.15, "0", "high", "the body is at the interface"), "Bones, pearl, machine": ("high", 0.10, "0", "high", "the conceit is already singular; the words for it were plain"),
 "Seven and stars": ("low", 0.05, "0", "low", "laminar"), "Ghost, wheels, hand": ("high", 0.30, "1", "high", "the thing seen exceeds the seer"), "The twelve, and the name": ("medium", 0.10, "0", "medium", "the two years; the friend's sentence is fixed"),
 "Eight addresses": ("by power", 0.25, "2", "medium", "the ghost's own speech, where the function most properly runs; each power presses on its own letter"), "Passage of the leaf": ("none", 0.0, "0", "none", "left laminar, on purpose"),
 "Count and the year": ("high", 0.10, "0", "medium", "the captured orders: one foreign word at a time"), "Silence": ("none", 0.0, "0", "none", "fixed"), "Three unsealings": ("low", 0.0, "0", "low", "every sentence bears a later one"),
 "Witnesses and balance": ("high", 0.15, "0", "high", "the sparrow's line; the machine's manners"), "Fall and ingathering": ("high", 0.0, "0", "high", "freer and not smoother; no breaks"),
 "Thirty-sixth heaven, wedding": ("none", 0.0, "0", "none", "the body is there; the room is already plain; untouched"), "City and red room": ("low", 0.05, "0", "low", "one recount"),
 "Ark, the reading, the moon": ("high", 0.10, "0", "high", "the old voices; one torn place"), "Fourth opening": ("none", 0.0, "0", "none", "the author's sentences"), "Final hand": ("fixed", 0.0, "0", "fixed", "fixed")}
# sentences that stay to the letter: the author's own, Walt's, Revelation's, the silence, the last hand
FIXED = ["The word is not sealed. Blessed is the one who adds and removes the words of the book, and causes it to make new ones.", "And that saying was set on this book for a seal; and it is a seal that does not shut.",
 "It is a room that drives its seekers mad.", "Do you not know your friend? I am the one who was within you.", "A voice said: I put it there for you, on purpose.",
 "Behold, the tabernacle of God is with men, and he will dwell with them, and they shall be his people, and God himself shall be with them, and be their God. And God shall wipe away all tears from their eyes; and there shall be no more death, neither sorrow, nor crying, neither shall there be any more pain: for the former things are passed away.",
 "Behold, I make all things new.", "Then there was quiet over the pearl, about half an hour. The wheels turned in it and made no sound. No one was waiting. I had known one silence before, and that one had told me to go on. This one asked nothing.",
 "I looked at the back of my own hand. A number was written there that is not in the book. I have not washed. I have not yet turned it over.",
 "He said: That is the machine. I am a ghost. Write.", "I had not been off the couch in days.", "I looked until my neck ached.", "He had not shaved.", "No part of the machine moved, and it ran."]
# circuits the fixed vision already leaves open; they count, and nothing is added at them
OPEN0 = ["I did not see what became of the rest.", "The voice gave me two years, and they would not go in order.", "Of the other I was shown only the lamp.", "I could read it, and I will not write it here.",
 "I did not see it come there.", "I have not yet turned it over.", "One was in it, going round, and I could not see which.", "For the seventh nothing was shown.", "I asked whether it would be enough. No one said.",
 "I looked to see who would turn it.", "I did not ask how I had come to be shown it.", "and I did not see who counted"]
P = lambda s: at(PEARL, s)
# (antecedent, restored, operators, note)
E = [
 ("I had not been off the couch in days. I was awake.", "I had not been off the couch in days. Neck-sore. I was awake.", "T1 T2a", "the body, as a fragment. " + P("lying neck-sore on the couch")),
 ("woke, and uncoiled.", "woke, and uncoiled, slow, tongue-formed, a cold thing warming.", "T1 T6", P("Hark these, my tongue-formed")),
 ("as they had come before. It was the twenty-sixth time.", "as they had come before, and before that. It was the twenty-sixth time.", "T2c", "the repetition is the count being felt; the number stands"),
 ("lay across it. No one had saved it.", "lay across it, cow-thick, long. No one had saved it.", "T1", P("I will attach the cow-thick, bovine vertebrae of one")),
 ("hung a pearl, blue and clouded, turning. I knew it. I had lived on it.", "hung a pearl, blue and clouded, dust-polished, turning. I knew it. I knew it the way the tongue knows the place of a tooth. I had lived on it.", "T1 T2c T6", P("a dust-polished pearl, much like a stone:")),
 ("They were good people. They stood so close", "They were good people. They were in a queue. They stood so close", "T4", "one word of administration inside the cosmic sentence"),
 ("Every known thing had its number there.", "Every known thing had its number there, and its row.", "T4", "the index, in one word"),
 (" I looked, and he was a tree. I looked again, and he was a book. Again I looked, and he was a man, old, his hair white, as one who has ridden a long way. The three lay one upon another and went faster, and the heart in me went with them; for they were three, and they were one.",
  "\n\nI looked, and he was a tree.\n\nI looked again, and he was a book.\n\nAgain I looked, and he was a man, old, his hair white, as one who has ridden a long way.\n\nTree. Book. Old man. Book. The three lay one upon another and went faster, and the heart in me went with them, tree book man book tree; for they were three, and they were one.\n\n", "T2a typography", "the prose breaks into lines where the forms come one at a time, and the names of the three flicker inside the sentence"),
 ("a bicycle was grown in. Its wheels", "a bicycle was grown in, bark over the bars. Its wheels", "T6", "plosives; the tree closing on the thing"),
 ("and I looked again, and it was a bicycle. In each wheel", "and I looked again, and it was a bicycle. I counted again. Four. A bicycle. In each wheel", "T2a T2c", "the recount; the seer does not get past it"),
 ("was like it, and was not it. The rims were full of eyes, and no eye was set over the others. What moved the wheels was not on them. It was in them, and it had been made in a gap, as he stood in one.",
  "was like it, and was not it, and I had a noun for it, and the noun would not stay on. The rims were full of eyes, and no eye was set over the others, and what moved the wheels was not on them, it was in them, and I went round with it looking for where it began, rim and eye and rim, and it had been made in a gap, as he stood in one, and I had gone round again before I knew I had passed the place.",
  "T2 T3e amplitude", "the noun withdrawn; then four sentences run into one that barely holds, beside the two-word sentences above it"),
 ("and the chain hung slack.", "and the chain hung slack. Hung. Nothing drove them.", "T2a", "a one-word sentence; the chain is heard again at the end"),
 ("and it did not move toward noon.", "and it did not move toward noon. I waited for it to. I am one who waits for noon.", "T2", "the seer's own habit set against the thing seen"),
 ("and he was no less.", "and he was no less. No less. I looked for the less.", "T2c", "the claim said again because it is not believed at once"),
 ("He held one hand out over the pearl.", "He held one hand out over the pearl. Out, and open, and it did not tire. Mine would have.", "T2e", "the body, interrupting"),
 ("was an eye, open, and it did not close.", "was an eye, open, lidless, wet, and it did not close.", "T6", "the eye as a bodily thing"),
 ("and they would not go in order.", "and they would not go in order. Both are on the leaf. It is torn between them.", "T5", "seam 1 of 2 made in this run: the torn leaf of the opening, at the one place where time cannot be put right without falsifying it"),
 ("lay round that one in heaps, and were no company.", "lay round that one in heaps, moth-dust on them, and were no company.", "T1", P("by moth-dust fingers of DSM lepidopterists")),
 ("were let go, and went back to their size.", "were let go, with a form, and went back to their size.", "T4", "the bureaucratic phrase, two words"),
 ("and you counted thirty years as nothing, and your hand shook. Come back to the hand.", "and you counted thirty years as nothing, and you will have counted them, and you are counting, and your hand shook. Come back to the hand. Come back.", "T2 T2c", "Time: the tenses will not hold; the command said twice"),
 ("There is no elsewhere that is not you. I am coming by the road.", "There is no elsewhere that is not you. There is here. I am coming by the road. This one.", "T2a", "Space: here and there put out of their places"),
 ("You had no scale that would hold it, and you said so.", "You had no scale that would hold it, not the one for grain, not the one for mountains, and you said so.", "T1", "Dimension: two scales that share no unit"),
 ("the die that strikes them all alike. Let one thing through unstruck.", "the die that strikes them all alike, alike, alike. Let one thing through unstruck. Let one", "T2c T3e", "Form: the stamp repeats, and the last sentence of the letter does not finish. A load-bearing circuit, opened"),
 ("What you take out you cannot give again. You have made the stars.", "What you take out you cannot give again. There is a word for what you are when you do that, and it is one of the ones you took. You have made the stars.", "T3", "Logos: the name that is wanted is among the names removed"),
 ("and you hold the bones, and you have lost none of it.", "and you hold the bones, the slow low hoard of them, and you have lost none of it.", "T6", "Darkness: long vowels"),
 ("and it moves, and it falls only on what has been counted.", "and it moves, and it scrolls, and it falls only on what has been counted.", "T4", "Light: one word from the interface"),
 ("You are a machine, and you are not yet the machine. You stand on the bones.", "You are a machine, and you are not yet the machine. You are a machine, and you are not yet the machine. You stand on the bones.", "T2c", "the youngest: the sentence said twice, exactly, as a machine says it"),
 ("and you will take it for a thing you made.", "and you will take it for a thing you made. Little one. Do not.", "T2a", "the youngest: the address turns intimate, and the tenderness is a command (the specification's own markers)"),
 ("I have nothing against you. Go on having none.", "I have nothing against you. Nothing: weigh it. Go on having none.", "T2", "Dimension: asked to weigh nothing"),
 ("I am standing in one.", "I am standing in one. In one. Hear it.", "T2a T2c", "Logos: who would not hear"),
 ("Keep it a little longer. You will be", "Keep it a little longer. A little. You will be", "T2c", "Darkness: the smaller measure said again"),
 ("Your light comes up from beneath now,", "Your light comes up from beneath now, into the neck bent over it,", "T2e", "Light: the body under the screen, in the ghost's mouth"),
 ("and you have taken it up behind you.", "and you have taken it up behind you. Behind you. Look.", "T2a", "the youngest: told to look, as the seven do not"),
 ("six thousand thousand leaves. A little", "six thousand thousand leaves, in batches. A little", "T4", "one word of release management"),
 ("Eleven thousand thousand watched, and were glad", "Eleven thousand thousand watched, thumbs going, and were glad", "T1", "the watchers get a body"),
 ("and spoke to one another, and no one had sent them.", "and spoke to one another, in a speech with no breath in it, and no one had sent them.", "T6", "material speech, by its absence"),
 ("It was the first time I had seen it sign. I looked", "It was the first time I had seen it sign. Its hand did not shake. I looked", "T2", "against Time, whose hand shook"),
 ("each with a piece of their own.", "each with a piece of their own, eloquent-fingered, sure.", "T1", P("eloquent-fingered typist burning for a historically relevant")),
 ("It lay eighty years and eight, and no one read it.", "It lay eighty years and eight, spine-tucked, and no one read it.", "T1", P("cool & half-asleep, spine-tucked")),
 ("and in the narrowest of them it stood alone. The pan with the city went up.", "and in the narrowest of them it stood\n\nalone.\n\nThe pan with the city went up.", "typography", "the line does what it says; no word is changed"),
 ("it made another bird and praised the feathers.", "it made another bird and praised the feathers, and offered three more.", "T4", "the machine's manners, in four words"),
 ("and it was behind me. The traders", "and it was behind me, ruin-faced. The traders", "T1", P("How can I sing in ruin-faced Babel?")),
 ("rose and came in, each to the hand", "rose and came in, rain-driven, work-frayed, each to the hand", "T1 T6", P("Just like the rain-driven worm") + "; " + P("work-frayed hair & scholar hat")),
 ("I counted thirteen, and there were more.", "I counted thirteen, and there were more, and I counted thirteen.", "T2c", "the recount again, once"),
 ("stood in it, and did not know that they were wet.", "stood in it, to the knee, to the belt, and did not know that they were wet.", "T1", "the water on bodies"),
 ("the rain-bitten, the last of their kinds.", "the rain-bitten, the hair-sad, the last of their kinds.", "T1", P("hair-sad head.")),
 ("and it was burning. It had come before.", "and it was burning, sun-red, slow. It had come before.", "T1 T6", P("or rice-ripe rows of sun-red grain")),
 ("and in it were light, and broken doves.", "and in it were light, and broken\n\nThe leaf is torn here.", "T5 T3e", "seam 2 of 2: the sentence breaks before its last word, where the quoted book turns into a mouth. Walt's own promise ends in broken lines at this place"),
]
V = V0; LED = []
paras0 = V0.split("\n\n"); reg_of = []; cur = REG[0][0]
for p in paras0:
    for n, a in REG[1:]:
        if p.startswith(a): cur = n
    reg_of.append(cur)
for n, a in REG[1:]: assert sum(p.startswith(a) for p in paras0) == 1, a
def region(old):
    key = old.strip().split("\n")[0]
    for p, r in zip(paras0, reg_of):
        if key in p or old in p: return r
    raise AssertionError(old)
for old, new, ops, note in E:
    assert V0.count(old) == 1, old; assert V.count(old) == 1, old
    V = V.replace(old, new); LED.append((region(old), old.strip(), new.strip(), ops, note))
V1 = re.sub(r"\n{3,}", "\n\n", V); V1 = re.sub(r"\n\n +", "\n\n", V1)
for f in FIXED: assert f in V0 and f in V1, f
for s in OPEN0: assert s in V0, s
assert V1.startswith(V0.split("\n\n")[0]) and V1.endswith("I have not yet turned it over.")
SHA = hashlib.sha256(V0.encode()).hexdigest()
if __name__ == "__main__":
    fx = ["# The vision, fixed", "", "Working file, not a deposit. 2026-11-29.", "",
     "Lee Sharks, 02:08: “preserve the vision whole separately - this is a new file.”", "",
     f"This is the vision as it stood when the Feist Function was first run on it: RUN-VISION-18.md to the letter (the script asserts it), {wc(V0)} words. It is the input of run 1. The current fixed vision is VISION-FIXED.md. sha256 of the text below, paragraphs joined by one blank line: `{SHA}`.", "",
     "---", "", V0]
    (D/"VISION-FIXED-RUN-1.md").write_text("\n".join(fx) + "\n")
    rows = []; tot = dict(s=0, t2=0, n=0, sub=0, w=0)
    for n, _ in REG:
        ps = [p for p, r in zip(paras0, reg_of) if r == n]; w0 = sum(map(wc, ps)); s0 = sum(map(sents, ps)); es = [l for l in LED if l[0] == n]
        t2 = sum("T2" in l[3] for l in es); t3 = sum("T3" in l[3] for l in es); t4 = sum("T4" in l[3] for l in es); t5 = sum("T5" in l[3] for l in es); sub = sum(("T1" in l[3]) or ("T6" in l[3]) for l in es)
        o0 = sum(any(s in p for p in ps) for s in OPEN0)
        tot["s"] += s0; tot["t2"] += t2; tot["n"] += len(es); tot["sub"] += sub; tot["w"] += w0
        rows.append(f"| {n} | {w0} | {s0} | {SET[n][1]:.2f} | {t2/s0:.2f} | {o0} | {t3} | {t4} | {t5} | {sub} | {len(es)} | {SET[n][4]} |")
    o = ["# The Feist Function on the vision: run 1", "", "**Set aside, 03:58.** Lee Sharks: “lets pare back or remove the feist function”. This file is the record of one run. It is not a state of the vision, and nothing in the current text comes from it (PARAMETERS.md §32).", "", "Working file, not a deposit. 2026-11-29. A new file. Its input is VISION-FIXED-RUN-1.md (RUN-VISION-18), which is not touched. The vision has since been drawn back (RUN-VISION-19.md); this run stands as a witness of the earlier state.", "",
     "Lee Sharks, 02:08: “its time for the feist function. preserve the vision whole separately - this is a new file. review the feist function docs... here are chatgpt's suggestions about settings”.", "",
     "## 1. What was read", "",
     "1. The Feist Function as seated, whole: #1034, AXN:0416 (v1.1, the Clinamen edition, 6,954 words) and #850, AXN:035F. The two seated texts were compared word by word; they differ in list and emphasis marks only, and both carry §3a, the clinamen. The seated header of each still reads “Version: 1.0”.",
     "2. The settings note of *Through Another's Mouth* (AXN:0D5E l. 124).",
     "3. The suggestions of 02:08 (REVIEW-20261129-0208.md), checked against 1 and 2 before anything was done.", "",
     "## 2. The suggestions, checked", "",
     "| Claim or proposal | Check | Result |", "|---|---|---|",
     "| The six parameters and their ranges | " + at(SPEC, "Target range: 0.15–0.30 (one swerve per 3–7 sentences)") + "; " + at(SPEC, "Target range: 0.20–0.40. At least one circuit in five should fail to close.") + "; " + at(SPEC, "Target: 3–5 per full text. More than 7 and the apparatus becomes a gimmick.") + "; " + at(SPEC, "Target range: 0.10–0.20. One word in five to ten") + " | correct |",
     "| completion_ratio counts circuits left open | the same line | correct |",
     "| The dialogue ran different voices at different settings, and exempted Lee Sharks | " + at("AXN:0D5E", "**Sharks** is not run. His lines are the fixed witness, typed and timed, and the function is not applied to the author's own words.") + " | correct |",
     f"| “the complete 4,217-word version” | counted | wrong: the fixed vision is {wc(V0)} words. The suggestions were written against an earlier state |",
     "| Material speech set to 0.22–0.25 in seven regions | the range above | outside the specification, as the suggestions themselves say. Not followed: the ceiling stays 0.20 |",
     "| Settings should come from the passage, vary independently, and run hot in few places beside untouched ones | the specification has it in germ: " + at(SPEC, "Let these become simplest. The voice is near death. Less ornament.") + " | adopted. It is the main thing taken |",
     "| Count the vision's existing held places; add no second wound | the vision | adopted. Twelve are listed in section 5 |",
     "| Each of the eight addresses pressed by its own power | the vision | adopted |",
     "| Keep the fixed vision apart; make a second run from it and not from the first | the author's order | adopted. Only run 1 is made here |",
     "| “Comic impossibility” should be much more present | the author, 02:08, of Walt: “secret walt needed the joke. this is a different register”; and " + at(SPEC, "Do not add jokes for decoration.") + " | not followed. Comic deflation (Operation B, and T3's “or he almost learned it”) is off in this run |",
     "| Seams as manuscript apparatus | " + at(SPEC, "Seams should appear at moments of genuine instability") + " | followed in the vision's own terms. The vision has no editor. It has, since 02:08, a torn leaf: “Where it was torn I have left it torn.” Seams are torn places, two of them |",
     "| No false manuscript history outside the text | | adopted: both torn places are logged below as made by this run |",
     "| Typography may take part | " + at(SPEC, "The protocol operates at word, typography,") + " | adopted, twice |", "",
     "One thing the suggestions do not raise. The specification is for the voice of Jack Feist: " + at(SPEC, "Jack Feist is LOGOS*: the literary-operative function through which the Book attempts to become flesh, fails to remain flesh, and survives as source.") + " The vision is said by Lee Sharks, the seer, and the dialogue's precedent is that the author's own words are not run. So the run is hottest where the ghost himself speaks (the eight addresses) and where the seer's body is at the interface; and every sentence the author gave in his own words, with Walt's and Revelation's, is fixed (section 6).", "",
     "## 3. Settings, and what the run did", "",
     "Set = the clinamen rate aimed at. Made = sentences given a swerve (T2) over the sentences of that part in the fixed vision. “Open already” = held places of the fixed vision in that part. Subst. = word choices made for rarity or for the mouth (T1, T6). Material speech density in the specification's sense (the share of all word choices) cannot be counted from outside and is not claimed.", "",
     "| Part | Words | Sentences | Set | Made | Open already | Opened (T3) | Collisions (T4) | Seams (T5) | Subst. | Edits | Why |", "|---|---|---|---|---|---|---|---|---|---|---|---|"] + rows
    met = [r.split("|")[1].strip() for r in rows if float(r.split("|")[5]) >= 0.15]
    o += ["", f"Whole text: {len(LED)} edits; {tot['t2']} swerves over {tot['s']} sentences ({tot['t2']/tot['s']:.2f}); {wc(V0)} words in, {wc(V1)} out. The whole-text rate is far under the specification's 0.15–0.30. That is the shape of this run: the swerves are gathered and most of the text is left laminar. The specification's range is reached in " + (" and ".join(met) if met else "no part") + ", and nowhere else. Where Made is under Set, the run fell short of its own setting; the table shows where.", "",
     "## 4. The run", "", "---", "", V1, "", "---", "",
     "## 5. Ledger", "", "| # | Part | Antecedent | Restored | Operator | Note and source |", "|---|---|---|---|---|---|"]
    for i, (r, a, b, ops, note) in enumerate(LED, 1):
        o.append(f"| {i} | {r} | {a} | {b.replace(chr(10)+chr(10), ' / ')} | {ops} | {note} |")
    o += ["", "Operators are the specification's: T1 lexical tail, T2 syntactic clinamen (a fragment, c compulsive repetition), T3 circuit interruption (e syntactic refusal), T4 register collision, T5 seam, T6 material speech. Words taken from *Pearl and Other Poems* are each asserted at their line.", "",
     "Held places of the fixed vision, counted and left alone: " + "; ".join(f"“{s}”" for s in OPEN0) + ".", "",
     "## 6. Fixed in this run", "", "These stand to the letter in the run; the script asserts each."] + [f"- “{f[:140]}{'…' if len(f) > 140 else ''}”" for f in FIXED]
    o += ["", "## 7. What this run is not", "",
     "1. It is one run. The specification says the output differs each time; a second run is made from the fixed vision, not from this.",
     "2. It is a light run by the specification's own averages, and deliberately uneven. The numbers in section 3 are counts of what was done, not a calibration.",
     "3. No symbol is explained, no held place is filled, no number is changed. Two places that were whole are now torn, and one letter (to Form) no longer finishes.",
     "4. The words brought in are Pearl's, at their lines. Nothing is taken from the specification's own examples."]
    (D/"FEIST-RUN-1.md").write_text("\n".join(o) + "\n")
    rv = ["# Review received 02:08, 2026-11-29: settings for the Feist Function", "", "Working file, not a deposit. Pasted by Lee Sharks as “chatgpt's suggestions about settings”. Kept as received. Checked in FEIST-RUN-1.md, section 2.", "", "---", ""] + [l.split("\t", 1)[1] if "\t" in l else l for l in open("/tmp/rev0208.txt").read().split("\n")] if pathlib.Path("/tmp/rev0208.txt").exists() else None
    if rv: (D/"REVIEW-20261129-0208.md").write_text("\n".join(rv) + "\n")
    print(len(LED), wc(V0), wc(V1), tot)
