var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  default: () => stdin_default,
  sha256_encode_bytes: () => sha256_encode_bytes
});
module.exports = __toCommonJS(stdin_exports);
function rotateRight(n, x) {
  return x >>> n | x << 32 - n;
}
function choice(x, y, z) {
  return x & y ^ ~x & z;
}
function majority(x, y, z) {
  return x & y ^ x & z ^ y & z;
}
function sha256_Sigma0(x) {
  return rotateRight(2, x) ^ rotateRight(13, x) ^ rotateRight(22, x);
}
function sha256_Sigma1(x) {
  return rotateRight(6, x) ^ rotateRight(11, x) ^ rotateRight(25, x);
}
function sha256_sigma0(x) {
  return rotateRight(7, x) ^ rotateRight(18, x) ^ x >>> 3;
}
function sha256_sigma1(x) {
  return rotateRight(17, x) ^ rotateRight(19, x) ^ x >>> 10;
}
function sha256_expand(W, j) {
  return W[j & 15] += sha256_sigma1(W[j + 14 & 15]) + W[j + 9 & 15] + sha256_sigma0(W[j + 1 & 15]);
}
const K256 = [
  1116352408,
  1899447441,
  3049323471,
  3921009573,
  961987163,
  1508970993,
  2453635748,
  2870763221,
  3624381080,
  310598401,
  607225278,
  1426881987,
  1925078388,
  2162078206,
  2614888103,
  3248222580,
  3835390401,
  4022224774,
  264347078,
  604807628,
  770255983,
  1249150122,
  1555081692,
  1996064986,
  2554220882,
  2821834349,
  2952996808,
  3210313671,
  3336571891,
  3584528711,
  113926993,
  338241895,
  666307205,
  773529912,
  1294757372,
  1396182291,
  1695183700,
  1986661051,
  2177026350,
  2456956037,
  2730485921,
  2820302411,
  3259730800,
  3345764771,
  3516065817,
  3600352804,
  4094571909,
  275423344,
  430227734,
  506948616,
  659060556,
  883997877,
  958139571,
  1322822218,
  1537002063,
  1747873779,
  1955562222,
  2024104815,
  2227730452,
  2361852424,
  2428436474,
  2756734187,
  3204031479,
  3329325298
];
let ihash;
let count;
let buffer;
const sha256_hex_digits = "0123456789abcdef";
function safe_add(x, y) {
  const lsw = (x & 65535) + (y & 65535);
  const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return msw << 16 | lsw & 65535;
}
function sha256_init() {
  ihash = new Array(8);
  count = new Array(2);
  buffer = new Array(64);
  count[0] = count[1] = 0;
  ihash[0] = 1779033703;
  ihash[1] = 3144134277;
  ihash[2] = 1013904242;
  ihash[3] = 2773480762;
  ihash[4] = 1359893119;
  ihash[5] = 2600822924;
  ihash[6] = 528734635;
  ihash[7] = 1541459225;
}
function sha256_transform() {
  let a;
  let b;
  let c;
  let d;
  let e;
  let f;
  let g;
  let h;
  let T1;
  let T2;
  const W = new Array(16);
  a = ihash[0];
  b = ihash[1];
  c = ihash[2];
  d = ihash[3];
  e = ihash[4];
  f = ihash[5];
  g = ihash[6];
  h = ihash[7];
  for (let i = 0; i < 16; i++) {
    W[i] = buffer[(i << 2) + 3] | buffer[(i << 2) + 2] << 8 | buffer[(i << 2) + 1] << 16 | buffer[i << 2] << 24;
  }
  for (let j = 0; j < 64; j++) {
    T1 = h + sha256_Sigma1(e) + choice(e, f, g) + K256[j];
    if (j < 16) T1 += W[j];
    else T1 += sha256_expand(W, j);
    T2 = sha256_Sigma0(a) + majority(a, b, c);
    h = g;
    g = f;
    f = e;
    e = safe_add(d, T1);
    d = c;
    c = b;
    b = a;
    a = safe_add(T1, T2);
  }
  ihash[0] += a;
  ihash[1] += b;
  ihash[2] += c;
  ihash[3] += d;
  ihash[4] += e;
  ihash[5] += f;
  ihash[6] += g;
  ihash[7] += h;
}
function sha256_update(data, inputLen) {
  let i;
  let index;
  let curpos = 0;
  index = count[0] >> 3 & 63;
  const remainder = inputLen & 63;
  if ((count[0] += inputLen << 3) < inputLen << 3) count[1]++;
  count[1] += inputLen >> 29;
  for (i = 0; i + 63 < inputLen; i += 64) {
    for (let j = index; j < 64; j++) buffer[j] = data.charCodeAt(curpos++);
    sha256_transform();
    index = 0;
  }
  for (let j = 0; j < remainder; j++) buffer[j] = data.charCodeAt(curpos++);
}
function sha256_final() {
  let index = count[0] >> 3 & 63;
  buffer[index++] = 128;
  if (index <= 56) {
    for (let i = index; i < 56; i++) buffer[i] = 0;
  } else {
    for (let i = index; i < 64; i++) buffer[i] = 0;
    sha256_transform();
    for (let i = 0; i < 56; i++) buffer[i] = 0;
  }
  buffer[56] = count[1] >>> 24 & 255;
  buffer[57] = count[1] >>> 16 & 255;
  buffer[58] = count[1] >>> 8 & 255;
  buffer[59] = count[1] & 255;
  buffer[60] = count[0] >>> 24 & 255;
  buffer[61] = count[0] >>> 16 & 255;
  buffer[62] = count[0] >>> 8 & 255;
  buffer[63] = count[0] & 255;
  sha256_transform();
}
function sha256_encode_bytes() {
  let j = 0;
  const output = new Array(32);
  for (let i = 0; i < 8; i++) {
    output[j++] = ihash[i] >>> 24 & 255;
    output[j++] = ihash[i] >>> 16 & 255;
    output[j++] = ihash[i] >>> 8 & 255;
    output[j++] = ihash[i] & 255;
  }
  return output;
}
function sha256_encode_hex() {
  let output = new String();
  for (let i = 0; i < 8; i++) {
    for (let j = 28; j >= 0; j -= 4)
      output += sha256_hex_digits.charAt(ihash[i] >>> j & 15);
  }
  return output;
}
function digest(data) {
  sha256_init();
  sha256_update(data, data.length);
  sha256_final();
  return sha256_encode_hex();
}
var stdin_default = digest;
