#include <chrono>
#include <iostream>
#include <string>
#include <vector>

using namespace std;
typedef chrono::high_resolution_clock hr_clock;

#define loop(i, n) for (int i = 0; i < n; ++i)
#define len(arr) sizeof(arr) / sizeof(arr[0])

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

/*
function s(n) {
  let result = '';
  const characters = 'abcdefghijklmnopqrstuvwxyz0123456789 ';
  for (let i = 0; i < n; i++)
    result += characters.charAt(Math.floor(Math.random() * characters.length));
  return result;
}
*/

const string CHARS = "abcdefghijklmnopqrstuvwxyz0123456789 ";
const uint8_t C = CHARS.length();
const int MOD = 2000000000;
const int TARGET[4] = {92227, 32143, 23135, 72362};
const int T3[13][37] = {
    {
        1000000000,
        97319313,
        806601997,
        1045284633,
        480480962,
        1396926208,
        1090169944,
        408070965,
        24359497,
        1308693936,
        1736481777,
        829475929,
        1135454576,
        419218956,
        1843385247,
        0,
        1843385247,
        419218956,
        1135454576,
        829475929,
        1736481777,
        1308693936,
        24359497,
        408070965,
        1090169944,
        1396926208,
        480480962,
        1045284633,
        806601997,
        97319313,
        1000000000,
        1746065934,
        1612616959,
        90169944,
        348994967,
        339555569,
        218523993,
    },
    {
        0,
        386705679,
        1135454576,
        1564344650,
        568551745,
        340741737,
        909830056,
        293203910,
        1945218954,
        539904997,
        1000000000,
        13704652,
        122147477,
        1583679495,
        1781476007,
        1071067812,
        1920883092,
        664195735,
        1909830056,
        523359562,
        660254038,
        910065242,
        1045284633,
        228540385,
        489434837,
        1411809549,
        691306064,
        1876883406,
        67366431,
        553609650,
        0,
        553609650,
        67366431,
        1876883406,
        691306064,
        1411809549,
        489434837,
    },
    {
        660254038,
        1908089954,
        1843385247,
        13704652,
        1053416295,
        871557427,
        90169944,
        1743700648,
        694715628,
        416320505,
        603073792,
        1253802929,
        1920883092,
        18150232,
        1975640503,
        1071067812,
        1302435263,
        13644900,
        218523993,
        1151903798,
        1420201433,
        1335804265,
        829475929,
        249510543,
        122147477,
        38053019,
        806601997,
        523359562,
        1880107536,
        1816271834,
        1000000000,
        744318455,
        728161454,
        1089934758,
        1580781044,
        1735764364,
        1945218954,
    },
    {
        0,
        122147477,
        1090169944,
        1510565163,
        90169944,
        0,
        1909830056,
        489434837,
        909830056,
        1877852523,
        0,
        1877852523,
        909830056,
        489434837,
        1909830056,
        0,
        90169944,
        1510565163,
        1090169944,
        122147477,
        0,
        122147477,
        1090169944,
        1510565163,
        90169944,
        0,
        1909830056,
        489434837,
        909830056,
        1877852523,
        0,
        1877852523,
        909830056,
        489434837,
        1909830056,
        0,
        90169944,
    },
    {
        660254038,
        746197071,
        348994967,
        1613294321,
        1012059537,
        1128442573,
        90169944,
        1205048535,
        1391731010,
        228540385,
        603073792,
        91910046,
        1431448255,
        1563047560,
        419218956,
        928932188,
        297042737,
        1076282953,
        691306064,
        1816271834,
        1420201433,
        1706796090,
        97319313,
        92688715,
        1877852523,
        1961946981,
        383711468,
        553609650,
        6091730,
        1151903798,
        1000000000,
        1998476952,
        1299192642,
        1460095003,
        24359497,
        264235636,
        67366431,
    },
    {
        0,
        228540385,
        218523993,
        1460095003,
        67366431,
        1659258263,
        90169944,
        523359562,
        568551745,
        123116594,
        1000000000,
        1583679495,
        1510565163,
        386705679,
        1045284633,
        928932188,
        54781046,
        553609650,
        1090169944,
        1335804265,
        660254038,
        1564344650,
        1308693936,
        13704652,
        122147477,
        588190451,
        1135454576,
        910065242,
        79116908,
        1706796090,
        0,
        1706796090,
        79116908,
        910065242,
        1135454576,
        588190451,
        122147477,
    },
    {
        1000000000,
        383711468,
        1902680687,
        691306064,
        1580781044,
        603073792,
        1909830056,
        348994967,
        480480962,
        1135454576,
        1736481777,
        806601997,
        218523993,
        253934066,
        1591929035,
        0,
        1591929035,
        253934066,
        218523993,
        806601997,
        1736481777,
        1135454576,
        480480962,
        348994967,
        1909830056,
        603073792,
        1580781044,
        691306064,
        1902680687,
        383711468,
        1000000000,
        24359497,
        1843385247,
        1090169944,
        1612616959,
        1660444431,
        954715367,
    },
    {
        0,
        691306064,
        954715367,
        1909830056,
        218523993,
        1000000000,
        1090169944,
        1135454576,
        1135454576,
        1090169944,
        1000000000,
        218523993,
        1909830056,
        954715367,
        691306064,
        0,
        691306064,
        954715367,
        1909830056,
        218523993,
        1000000000,
        1090169944,
        1135454576,
        1135454576,
        1090169944,
        1000000000,
        218523993,
        1909830056,
        954715367,
        691306064,
        0,
        691306064,
        954715367,
        1909830056,
        218523993,
        1000000000,
        1090169944,
    },
    {
        1339745962,
        794951465,
        1580781044,
        293203910,
        1993908270,
        1735764364,
        909830056,
        544814244,
        1709624274,
        1476640438,
        1660444431,
        1743700648,
        67366431,
        1151903798,
        97319313,
        928932188,
        1391731010,
        746197071,
        1135454576,
        249510543,
        1572123903,
        13704652,
        408070965,
        1255681545,
        1510565163,
        191520443,
        348994967,
        228540385,
        297042737,
        92688715,
        1000000000,
        1925461516,
        946583705,
        435655350,
        1170524071,
        936922130,
        1920883092,
    },
    {
        1000000000,
        1993908270,
        1591929035,
        1932633569,
        97319313,
        1572123903,
        1090169944,
        1702957263,
        1193398003,
        1920883092,
        603073792,
        119892464,
        1045284633,
        987940463,
        480480962,
        0,
        1519519038,
        1012059537,
        954715367,
        1880107536,
        1396926208,
        79116908,
        806601997,
        297042737,
        909830056,
        427876097,
        1902680687,
        67366431,
        408070965,
        6091730,
        1000000000,
        694715628,
        1975640503,
        1877852523,
        253934066,
        151922470,
        1308693936,
    },
    {
        1000000000,
        579798567,
        603073792,
        1339745962,
        263518223,
        427876097,
        0,
        427876097,
        263518223,
        1339745962,
        603073792,
        579798567,
        1000000000,
        1848077530,
        1660444431,
        0,
        339555569,
        151922470,
        1000000000,
        1420201433,
        1396926208,
        660254038,
        1736481777,
        1572123903,
        0,
        1572123903,
        1736481777,
        660254038,
        1396926208,
        1420201433,
        1000000000,
        151922470,
        339555569,
        0,
        1660444431,
        1848077530,
        1000000000,
    },
    {
        1339745962,
        1128442573,
        1660444431,
        1659258263,
        1420201433,
        264235636,
        0,
        264235636,
        1420201433,
        1659258263,
        1660444431,
        1128442573,
        1339745962,
        936922130,
        263518223,
        1071067812,
        1848077530,
        226182617,
        1000000000,
        38053019,
        1572123903,
        588190451,
        1396926208,
        191520443,
        0,
        1808479557,
        603073792,
        1411809549,
        427876097,
        1961946981,
        1000000000,
        1773817383,
        151922470,
        928932188,
        1736481777,
        1063077870,
        660254038,
    },
    {
        660254038,
        1563047560,
        383711468,
        416320505,
        728161454,
        936922130,
        909830056,
        848096202,
        1702957263,
        386705679,
        1736481777,
        1981849768,
        54781046,
        452904198,
        1651005033,
        1071067812,
        1993908270,
        560590290,
        954715367,
        13644900,
        151922470,
        553609650,
        419218956,
        746197071,
        1510565163,
        226182617,
        253934066,
        664195735,
        1012059537,
        1076282953,
        1000000000,
        1743700648,
        290375726,
        1564344650,
        1843385247,
        38053019,
        568551745,
    },
};
const int L = 20, D = 100000, ERR = L * (D - 1);
// 1, 1 = 0
// 20, 1 = 0
// 20, 10 = 200
vector<uint8_t> dp[MOD / D] = {};

bool check(int hash[], int tolerance)
{
  for (int i = 0; i < 4; i++)
    if (abs(hash[i] - TARGET[i]) > tolerance)
      return false;
  return true;
}

int main()
{
  const hr_clock::time_point start = hr_clock::now();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  int target[4] = {};
  loop(i, len(TARGET))
      target[i] = TARGET[i] * D;

  int t3[len(T3)][len(T3[0])] = {};
  loop(i, len(T3))
      loop(j, len(T3))
          t3[i][j] = T3[i][j] / D;

  for (int l = 0; l < L; l++)
    for (int s = 0; s < MOD; s++)
    {
      if (!dp[s].empty())
        for (char c = 0; c < C; c++)
        {
          int h = T3[l][c];
          // dp[(s + h) % MOD] = dp[s] + c;
          if ((s + h) % MOD == TARGET[3])
            break;
          // cout << i << endl;
        }
    }
  const hr_clock::time_point end = hr_clock::now();
  cout << "Elapsed time : " << (end - start).count() << " seconds\n";
}
zsh: bus error  ./main