import java.math.BigInteger;
import java.util.Scanner;
class Ideone
{
{ "", "いち", "に", "さん", "よん", "ご", "ろく", "なな", "はち", "きゅう" },
{ "", "じゅう", "にじゅう", "さんじゅう", "よんじゅう", "ごじゅう", "ろくじゅう", "ななじゅう", "はちじゅう", "きゅうじゅう" },
{ "", "ひゃく", "にひゃく", "さんびゃく", "よんひゃく", "ごひゃく", "ろっぴゃく", "ななひゃく", "はっぴゃく", "きゅうひゃく" },
{ "", "せん", "にせん", "さんぜん", "よんせん", "ごせん", "ろくせん", "ななせん", "はっせん", "きゅうせん" } };
{ "", "いっ", "に", "さん", "よん", "ご", "ろく", "なな", "はっ", "きゅう" },
{ "", "じゅっ", "にじゅっ", "さんじゅっ", "よんじゅっ", "ごじゅっ", "ろくじゅっ", "ななじゅっ", "はちじゅっ", "きゅうじゅっ" },
{ "", "ひゃく", "にひゃく", "さんびゃく", "よんひゃく", "ごひゃく", "ろっぴゃく", "ななひゃく", "はっぴゃく", "きゅうひゃく" },
{ "", "せん", "にせん", "さんぜん", "よんせん", "ごせん", "ろくせん", "ななせん", "はっせん", "きゅうせん" } };
static String[] numerals
= { "",
"まん",
"おく",
"ちょう",
"けい",
"がい",
"じょ",
"じょう",
"こう",
"かん",
"せい",
"さい",
"ごく",
"ごうがしゃ",
"あそうぎ",
"なゆた",
"ふかしぎ",
"むりょうたいすう" };
{
int signum = b.signum();
if (signum == 0)
{
return;
}
if (bi.compareTo(MAX_NUM) == 1)
{
System.
out.
printf("%,d => 数が大きすぎるので読めません%n%n", b
); return;
}
StringBuilder sb = new StringBuilder();
int n = 0;
{
int r10000 = dr[1].intValue();
bi = dr[0];
boolean flag = n == 3 || n == 4;
if (r10000 != 0)
{
sb.insert(0, numerals[n]);
int size = sb.length();
for (int i = 0; i < 4; i++)
{
sb.insert(0, flag ? digitB[i][r10000 % 10] : digit[i][r10000 % 10]);
r10000 /= 10;
flag &= size == sb.length();
}
sb.insert(0, " ");
}
n++;
}
if (signum == -1) sb.insert(0, "まいなす"); // 自然数に入らんか…まあいいやw
System.
out.
printf("%,d => %s%n%n", b, sb.
toString().
trim()); }
public static void main
(String[] args
) {
try (Scanner in
= new Scanner
(System.
in)) {
while (in.hasNextBigInteger())
{
print(in.nextBigInteger());
}
}
}
}
aW1wb3J0IGphdmEubWF0aC5CaWdJbnRlZ2VyOwppbXBvcnQgamF2YS51dGlsLlNjYW5uZXI7CgpjbGFzcyBJZGVvbmUKewogICAgc3RhdGljIGZpbmFsIEJpZ0ludGVnZXIgTjEwMDAwID0gQmlnSW50ZWdlci52YWx1ZU9mKDEwMDAwKTsKICAgIHN0YXRpYyBmaW5hbCBCaWdJbnRlZ2VyIE1BWF9OVU0gPSBCaWdJbnRlZ2VyLlRFTi5wb3coNzIpLnN1YnRyYWN0KEJpZ0ludGVnZXIuT05FKTsKICAgIHN0YXRpYyBTdHJpbmdbXVtdIGRpZ2l0ID0gewogICAgICAgICAgICB7ICIiLCAi44GE44GhIiwgIuOBqyIsICLjgZXjgpMiLCAi44KI44KTIiwgIuOBlCIsICLjgo3jgY8iLCAi44Gq44GqIiwgIuOBr+OBoSIsICLjgY3jgoXjgYYiIH0sCiAgICAgICAgICAgIHsgIiIsICLjgZjjgoXjgYYiLCAi44Gr44GY44KF44GGIiwgIuOBleOCk+OBmOOCheOBhiIsICLjgojjgpPjgZjjgoXjgYYiLCAi44GU44GY44KF44GGIiwgIuOCjeOBj+OBmOOCheOBhiIsICLjgarjgarjgZjjgoXjgYYiLCAi44Gv44Gh44GY44KF44GGIiwgIuOBjeOCheOBhuOBmOOCheOBhiIgfSwKICAgICAgICAgICAgeyAiIiwgIuOBsuOCg+OBjyIsICLjgavjgbLjgoPjgY8iLCAi44GV44KT44Gz44KD44GPIiwgIuOCiOOCk+OBsuOCg+OBjyIsICLjgZTjgbLjgoPjgY8iLCAi44KN44Gj44G044KD44GPIiwgIuOBquOBquOBsuOCg+OBjyIsICLjga/jgaPjgbTjgoPjgY8iLCAi44GN44KF44GG44Gy44KD44GPIiB9L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51bWVyYWxzID0geyAiIiwgIuOBvuOCkyIsICLjgYrjgY8iLCAi44Gh44KH44GGIiwgIuOBkeOBhCIsICLjgYzjgYQiLCAi44GY44KHIiwgIuOBmOOCh+OBhiIsICLjgZPjgYYiLCAi44GL44KTIiwgIuOBm+OBhCIsICLjgZXjgYQiLCAi44GU44GPIiwgIuOBlOOBhuOBjOOBl+OCgyIsICLjgYLjgZ3jgYbjgY4iLCAi44Gq44KG44GfIiwgIuOBteOBi+OBl+OBjiIsICLjgoDjgorjgofjgYbjgZ/jgYTjgZnjgYYiIH07CgogICAgc3RhdGljIHZvaWQgcHJpbnQoQmlnSW50ZWdlciBiKQogICAgewogICAgICAgIGludCBzaWdudW0gPSBiLnNpZ251bSgpOwogICAgICAgIGlmIChzaWdudW0gPT0gMCkKICAgICAgICB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigi44Gc44KNIik7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CgogICAgICAgIEJpZ0ludGVnZXIgYmkgPSBiLmFicygpOwogICAgICAgIGlmIChiaS5jb21wYXJlVG8oTUFYX05VTSkgPT0gMSkKICAgICAgICB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRmKCIlLGQgPT4g5pWw44GM5aSn44GN44GZ44GO44KL44Gu44Gn6Kqt44KB44G+44Gb44KTJW4lbiIsIGIpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKICAgICAgICBpbnQgbiA9IDA7CiAgICAgICAgd2hpbGUgKCFiaS5lcXVhbHMoQmlnSW50ZWdlci5aRVJPKSkKICAgICAgICB7CiAgICAgICAgICAgIEJpZ0ludGVnZXJbXSBkciA9IGJpLmRpdmlkZUFuZFJlbWFpbmRlcihOMTAwMDApOwogICAgICAgICAgICBpbnQgcjEwMDAwID0gZHJbMV0uaW50VmFsdWUoKTsKICAgICAgICAgICAgYmkgPSBkclswXTsKICAgICAgICAgICAgYm9vbGVhbiBmbGFnID0gbiA9PSAzIHx8IG4gPT0gNDsKICAgICAgICAgICAgaWYgKHIxMDAwMCAhPSAwKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBzYi5pbnNlcnQoMCwgbnVtZXJhbHNbbl0pOwogICAgICAgICAgICAgICAgaW50IHNpemUgPSBzYi5sZW5ndGgoKTsKICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNDsgaSsrKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIHNiLmluc2VydCgwLCBmbGFnID8gZGlnaXRCW2ldW3IxMDAwMCAlIDEwXSA6IGRpZ2l0W2ldW3IxMDAwMCAlIDEwXSk7CiAgICAgICAgICAgICAgICAgICAgcjEwMDAwIC89IDEwOwogICAgICAgICAgICAgICAgICAgIGZsYWcgJj0gc2l6ZSA9PSBzYi5sZW5ndGgoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHNiLmluc2VydCgwLCAiICIpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIG4rKzsKICAgICAgICB9CiAgICAgICAgaWYgKHNpZ251bSA9PSAtMSkgc2IuaW5zZXJ0KDAsICLjgb7jgYTjgarjgZkiKTsgLy8g6Ieq54S25pWw44Gr5YWl44KJ44KT44GL4oCm44G+44GC44GE44GE44KE772XCiAgICAgICAgU3lzdGVtLm91dC5wcmludGYoIiUsZCA9PiAlcyVuJW4iLCBiLCBzYi50b1N0cmluZygpLnRyaW0oKSk7CiAgICB9CgogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykKICAgIHsKICAgICAgICB0cnkgKFNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pKQogICAgICAgIHsKICAgICAgICAgICAgd2hpbGUgKGluLmhhc05leHRCaWdJbnRlZ2VyKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHByaW50KGluLm5leHRCaWdJbnRlZ2VyKCkpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQp9Cg==
512 => ごひゃくじゅうに
8,978,456,234,578,681 => はっせんきゅうひゃくななじゅうはっちょう よんせんごひゃくろくじゅうにおく さんぜんよんひゃくごじゅうななまん はっせんろっぴゃくはちじゅういち
8,714,511,145,614,898,415,345,614,111,486,987,891,731,511,661,165 => はちごく ななせんひゃくよんじゅうごさい せんひゃくじゅうよんせい ごせんろっぴゃくじゅうよんかん はっせんきゅうひゃくはちじゅうよんこう せんごひゃくさんじゅうよんじょう ごせんろっぴゃくじゅうよんじょ せんひゃくじゅうよんがい はっせんろっぴゃくきゅうじゅうはっけい ななせんはっぴゃくきゅうじゅういっちょう ななせんさんびゃくじゅうごおく せんひゃくろくじゅうろくまん せんひゃくろくじゅうご
154,616,486,144,861,786,715,645,165,456,145,614,864,156,867,186,745,161,756,171,867,564,561,451 => せんごひゃくよんじゅうろくむりょうたいすう せんろっぴゃくよんじゅうはちふかしぎ ろくせんひゃくよんじゅうよんなゆた はっせんろっぴゃくじゅうななあそうぎ はっせんろっぴゃくななじゅういちごうがしゃ ごせんろっぴゃくよんじゅうごごく せんろっぴゃくごじゅうよんさい ごせんろっぴゃくじゅうよんせい ごせんろっぴゃくじゅうよんかん はっせんろっぴゃくよんじゅういちこう ごせんろっぴゃくはちじゅうろくじょう ななせんひゃくはちじゅうろくじょ ななせんよんひゃくごじゅういちがい ろくせんひゃくななじゅうごけい ろくせんひゃくななじゅういっちょう はっせんろっぴゃくななじゅうごおく ろくせんよんひゃくごじゅうろくまん せんよんひゃくごじゅういち
890,054,605,607,484,040,064,045,400,000,884,045,056,040,045,980,040,800,808,488,080,000,584,084 => はっせんきゅうひゃくむりょうたいすう ごせんよんひゃくろくじゅうふかしぎ ごせんろっぴゃくなななゆた よんせんはっぴゃくよんじゅうあそうぎ よんせんろくごうがしゃ よんせんよんじゅうごごく よんせんさい はちじゅうはちせい よんせんよんじゅうごかん ごひゃくろくじゅうこう よんせんよんじょう ごせんきゅうひゃくはちじゅうじょ よんひゃくはちがい はちじゅっけい はっせんよんひゃくはちじゅうはっちょう はっぴゃくおく ごじゅうはちまん よんせんはちじゅうよん
1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 => 数が大きすぎるので読めません