import java.io.File

fun main() {
    var lines: List<String> = File("Day08.txt").readLines()
    // Setup our Forest List of Lists
    var forest = lines.map { it.chunked(1) }
    // Variable for Tracking Tree Score in Part Two
    var maxTreeScore = 0
    // Prints out your forest for you to see
    //forest.forEach { it.forEach { print(it+" ") }; println() }

    // Iterate Our Forest Rows
    var visibleForest = forest.mapIndexed { idx, row ->
        // Iterate Our Forest Columns
        row.mapIndexed row@ { idx2, tree ->
            // Get All Trees Above, Below, Left, and Right of Current Tree
            var treesLeft = forest[idx].subList(0, idx2).reversed()
            var treesRight = forest[idx].subList(idx2+1, forest[idx].size)
            var treesAbove = forest.subList(0, idx).map { it[idx2] }.reversed()
            var treesBelow = forest.subList(idx+1, forest.size).map { it[idx2] }
            // For Part Two, we need to know how many trees are visible from each tree
            var visibleTreesLeft  = treesLeft.takeWhileInclusive  { it < tree }.count()
            var visibleTreesRight = treesRight.takeWhileInclusive { it < tree }.count()
            var visibleTreesAbove = treesAbove.takeWhileInclusive { it < tree }.count()
            var visibleTreesBelow = treesBelow.takeWhileInclusive { it < tree }.count()
            //println("Tree: $idx, $idx2 -> $visibleTreesLeft, $visibleTreesRight, $visibleTreesAbove, $visibleTreesBelow")
            // For Part Two Calculate The Tree Score and see if it's the new Max Tree Score
            var treeScore = visibleTreesLeft * visibleTreesRight * visibleTreesAbove * visibleTreesBelow
            if (treeScore > maxTreeScore) {
                //println("Tree: $idx, $idx2 -> $treeScore [Current Max Tree Score]")
                maxTreeScore = treeScore
            } else {
                //println("Tree: $idx, $idx2 -> $treeScore")
            }

            // If this is an edge tree, it's visible
            if (idx == 0 || idx2 == 0 || idx == forest.size - 1 || idx2 == row.size - 1) {
                //println("Edge: $idx, $idx2")
                return@row 1
            } else {
                // If this is not an edge tree, check if it's visible from one of the edges
                if (tree > treesLeft.sortedDescending()[0] ||
                    tree > treesRight.sortedDescending()[0] ||
                    tree > treesAbove.sortedDescending()[0] ||
                    tree > treesBelow.sortedDescending()[0])
                {
                    //println("Not Edge: $idx, $idx2 -> Visible")
                    return@row 1
                } else {
                    //println("Not Edge: $idx, $idx2 -> Not Visible")
                    return@row 0
                }
            }
        }
    }
    // Print out the Visible Forest
    //visibleForest.forEach { it.forEach { print(it.toString() + " ") }; println() }

    // Display the Total Visible Trees and Max Tree Score
    println("Total Visible Trees: " + visibleForest.map { it.sum() }.sum().toString())
    println("Max Tree Score: " + maxTreeScore.toString())
}

// Added this function which I found here: https://stackoverflow.com/questions/56058246/takewhile-which-includes-the-actual-value-matching-the-predicate-takewhileinclu
// The existing TakeWhile in Kotlin doesn't include the value that matches the predicate, which is what we need for this problem.
fun <T> List<T>.takeWhileInclusive(predicate: (T) -> Boolean) = sequence {
    with(iterator()) {
        while (hasNext()) {
            val next = next()
            yield(next)
            if (!predicate(next)) break
        }
    }
}

Compiled from "Day08.kt"
public final class Day08Kt {
  public static final void main();
    Code:
       0: new           #8                  // class java/io/File
       3: dup
       4: ldc           #10                 // String Day08.txt
       6: invokespecial #14                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #20                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      15: astore_0
      16: aconst_null
      17: astore_1
      18: aload_0
      19: checkcast     #22                 // class java/lang/Iterable
      22: astore_2
      23: iconst_0
      24: istore_3
      25: aload_2
      26: astore        4
      28: new           #24                 // class java/util/ArrayList
      31: dup
      32: aload_2
      33: bipush        10
      35: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      38: invokespecial #33                 // Method java/util/ArrayList."<init>":(I)V
      41: checkcast     #35                 // class java/util/Collection
      44: astore        5
      46: iconst_0
      47: istore        6
      49: aload         4
      51: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      56: astore        7
      58: aload         7
      60: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      65: ifeq          112
      68: aload         7
      70: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      75: astore        8
      77: aload         5
      79: aload         8
      81: checkcast     #51                 // class java/lang/String
      84: astore        9
      86: astore        44
      88: iconst_0
      89: istore        10
      91: aload         9
      93: checkcast     #53                 // class java/lang/CharSequence
      96: iconst_1
      97: invokestatic  #59                 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
     100: aload         44
     102: swap
     103: invokeinterface #63,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     108: pop
     109: goto          58
     112: aload         5
     114: checkcast     #65                 // class java/util/List
     117: nop
     118: astore_1
     119: iconst_0
     120: istore_2
     121: aload_1
     122: checkcast     #22                 // class java/lang/Iterable
     125: astore        4
     127: iconst_0
     128: istore        5
     130: aload         4
     132: astore        6
     134: new           #24                 // class java/util/ArrayList
     137: dup
     138: aload         4
     140: bipush        10
     142: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     145: invokespecial #33                 // Method java/util/ArrayList."<init>":(I)V
     148: checkcast     #35                 // class java/util/Collection
     151: astore        7
     153: iconst_0
     154: istore        8
     156: iconst_0
     157: istore        9
     159: aload         6
     161: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     166: astore        10
     168: aload         10
     170: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     175: ifeq          902
     178: aload         10
     180: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     185: astore        11
     187: aload         7
     189: iload         9
     191: iinc          9, 1
     194: istore        12
     196: iload         12
     198: ifge          204
     201: invokestatic  #68                 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     204: iload         12
     206: aload         11
     208: checkcast     #65                 // class java/util/List
     211: astore        13
     213: istore        14
     215: astore        43
     217: iconst_0
     218: istore        15
     220: aload         13
     222: checkcast     #22                 // class java/lang/Iterable
     225: astore        16
     227: iconst_0
     228: istore        17
     230: aload         16
     232: astore        18
     234: new           #24                 // class java/util/ArrayList
     237: dup
     238: aload         16
     240: bipush        10
     242: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     245: invokespecial #33                 // Method java/util/ArrayList."<init>":(I)V
     248: checkcast     #35                 // class java/util/Collection
     251: astore        19
     253: iconst_0
     254: istore        20
     256: iconst_0
     257: istore        21
     259: aload         18
     261: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     266: astore        22
     268: aload         22
     270: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     275: ifeq          883
     278: aload         22
     280: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     285: astore        23
     287: aload         19
     289: iload         21
     291: iinc          21, 1
     294: istore        24
     296: iload         24
     298: ifge          304
     301: invokestatic  #68                 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     304: iload         24
     306: aload         23
     308: checkcast     #51                 // class java/lang/String
     311: astore        25
     313: istore        26
     315: astore        27
     317: iconst_0
     318: istore        28
     320: aload_1
     321: iload         14
     323: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     328: checkcast     #65                 // class java/util/List
     331: iconst_0
     332: iload         26
     334: invokeinterface #76,  3           // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;
     339: checkcast     #22                 // class java/lang/Iterable
     342: invokestatic  #80                 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;
     345: astore        29
     347: aload_1
     348: iload         14
     350: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     355: checkcast     #65                 // class java/util/List
     358: iload         26
     360: iconst_1
     361: iadd
     362: aload_1
     363: iload         14
     365: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     370: checkcast     #65                 // class java/util/List
     373: invokeinterface #84,  1           // InterfaceMethod java/util/List.size:()I
     378: invokeinterface #76,  3           // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;
     383: astore        30
     385: aload_1
     386: iconst_0
     387: iload         14
     389: invokeinterface #76,  3           // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;
     394: checkcast     #22                 // class java/lang/Iterable
     397: astore        31
     399: iconst_0
     400: istore        32
     402: aload         31
     404: astore        33
     406: new           #24                 // class java/util/ArrayList
     409: dup
     410: aload         31
     412: bipush        10
     414: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     417: invokespecial #33                 // Method java/util/ArrayList."<init>":(I)V
     420: checkcast     #35                 // class java/util/Collection
     423: astore        34
     425: iconst_0
     426: istore        35
     428: aload         33
     430: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     435: astore        36
     437: aload         36
     439: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     444: ifeq          494
     447: aload         36
     449: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     454: astore        37
     456: aload         34
     458: aload         37
     460: checkcast     #65                 // class java/util/List
     463: astore        38
     465: astore        39
     467: iconst_0
     468: istore        40
     470: aload         38
     472: iload         26
     474: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     479: checkcast     #51                 // class java/lang/String
     482: aload         39
     484: swap
     485: invokeinterface #63,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     490: pop
     491: goto          437
     494: aload         34
     496: checkcast     #65                 // class java/util/List
     499: nop
     500: checkcast     #22                 // class java/lang/Iterable
     503: invokestatic  #80                 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;
     506: astore        41
     508: aload_1
     509: iload         14
     511: iconst_1
     512: iadd
     513: aload_1
     514: invokeinterface #84,  1           // InterfaceMethod java/util/List.size:()I
     519: invokeinterface #76,  3           // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;
     524: checkcast     #22                 // class java/lang/Iterable
     527: astore        32
     529: iconst_0
     530: istore        33
     532: aload         32
     534: astore        34
     536: new           #24                 // class java/util/ArrayList
     539: dup
     540: aload         32
     542: bipush        10
     544: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     547: invokespecial #33                 // Method java/util/ArrayList."<init>":(I)V
     550: checkcast     #35                 // class java/util/Collection
     553: astore        35
     555: iconst_0
     556: istore        36
     558: aload         34
     560: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     565: astore        37
     567: aload         37
     569: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     574: ifeq          624
     577: aload         37
     579: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     584: astore        38
     586: aload         35
     588: aload         38
     590: checkcast     #65                 // class java/util/List
     593: astore        40
     595: astore        39
     597: iconst_0
     598: istore        42
     600: aload         40
     602: iload         26
     604: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     609: checkcast     #51                 // class java/lang/String
     612: aload         39
     614: swap
     615: invokeinterface #63,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     620: pop
     621: goto          567
     624: aload         35
     626: checkcast     #65                 // class java/util/List
     629: nop
     630: astore        31
     632: aload         29
     634: aload         25
     636: invokedynamic #104,  0            // InvokeDynamic #0:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     641: invokestatic  #108                // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     644: invokestatic  #114                // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I
     647: istore        32
     649: aload         30
     651: aload         25
     653: invokedynamic #119,  0            // InvokeDynamic #1:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     658: invokestatic  #108                // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     661: invokestatic  #114                // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I
     664: istore        33
     666: aload         41
     668: aload         25
     670: invokedynamic #124,  0            // InvokeDynamic #2:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     675: invokestatic  #108                // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     678: invokestatic  #114                // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I
     681: istore        34
     683: aload         31
     685: aload         25
     687: invokedynamic #129,  0            // InvokeDynamic #3:invoke:(Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     692: invokestatic  #108                // Method takeWhileInclusive:(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     695: invokestatic  #114                // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I
     698: istore        35
     700: iload         32
     702: iload         33
     704: imul
     705: iload         34
     707: imul
     708: iload         35
     710: imul
     711: istore        36
     713: iload         36
     715: iload_2
     716: if_icmple     722
     719: iload         36
     721: istore_2
     722: iload         14
     724: ifeq          759
     727: iload         26
     729: ifeq          759
     732: iload         14
     734: aload_1
     735: invokeinterface #84,  1           // InterfaceMethod java/util/List.size:()I
     740: iconst_1
     741: isub
     742: if_icmpeq     759
     745: iload         26
     747: aload         13
     749: invokeinterface #84,  1           // InterfaceMethod java/util/List.size:()I
     754: iconst_1
     755: isub
     756: if_icmpne     763
     759: iconst_1
     760: goto          868
     763: aload         25
     765: aload         29
     767: checkcast     #22                 // class java/lang/Iterable
     770: invokestatic  #132                // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;
     773: iconst_0
     774: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     779: checkcast     #51                 // class java/lang/String
     782: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
     785: ifgt          863
     788: aload         25
     790: aload         30
     792: checkcast     #22                 // class java/lang/Iterable
     795: invokestatic  #132                // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;
     798: iconst_0
     799: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     804: checkcast     #51                 // class java/lang/String
     807: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
     810: ifgt          863
     813: aload         25
     815: aload         41
     817: checkcast     #22                 // class java/lang/Iterable
     820: invokestatic  #132                // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;
     823: iconst_0
     824: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     829: checkcast     #51                 // class java/lang/String
     832: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
     835: ifgt          863
     838: aload         25
     840: aload         31
     842: checkcast     #22                 // class java/lang/Iterable
     845: invokestatic  #132                // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;
     848: iconst_0
     849: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     854: checkcast     #51                 // class java/lang/String
     857: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
     860: ifle          867
     863: iconst_1
     864: goto          868
     867: iconst_0
     868: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     871: aload         27
     873: swap
     874: invokeinterface #63,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     879: pop
     880: goto          268
     883: aload         19
     885: checkcast     #65                 // class java/util/List
     888: nop
     889: nop
     890: aload         43
     892: swap
     893: invokeinterface #63,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     898: pop
     899: goto          168
     902: aload         7
     904: checkcast     #65                 // class java/util/List
     907: nop
     908: astore_3
     909: new           #144                // class java/lang/StringBuilder
     912: dup
     913: invokespecial #146                // Method java/lang/StringBuilder."<init>":()V
     916: ldc           #148                // String Total Visible Trees:
     918: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     921: aload_3
     922: checkcast     #22                 // class java/lang/Iterable
     925: astore        4
     927: astore        43
     929: iconst_0
     930: istore        5
     932: aload         4
     934: astore        6
     936: new           #24                 // class java/util/ArrayList
     939: dup
     940: aload         4
     942: bipush        10
     944: invokestatic  #30                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     947: invokespecial #33                 // Method java/util/ArrayList."<init>":(I)V
     950: checkcast     #35                 // class java/util/Collection
     953: astore        7
     955: iconst_0
     956: istore        8
     958: aload         6
     960: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     965: astore        9
     967: aload         9
     969: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     974: ifeq          1023
     977: aload         9
     979: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     984: astore        10
     986: aload         7
     988: aload         10
     990: checkcast     #65                 // class java/util/List
     993: astore        11
     995: astore        44
     997: iconst_0
     998: istore        12
    1000: aload         11
    1002: checkcast     #22                 // class java/lang/Iterable
    1005: invokestatic  #156                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
    1008: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1011: aload         44
    1013: swap
    1014: invokeinterface #63,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1019: pop
    1020: goto          967
    1023: aload         7
    1025: checkcast     #65                 // class java/util/List
    1028: nop
    1029: aload         43
    1031: swap
    1032: checkcast     #22                 // class java/lang/Iterable
    1035: invokestatic  #156                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
    1038: invokevirtual #159                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
    1041: invokevirtual #163                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1044: getstatic     #169                // Field java/lang/System.out:Ljava/io/PrintStream;
    1047: swap
    1048: invokevirtual #175                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1051: new           #144                // class java/lang/StringBuilder
    1054: dup
    1055: invokespecial #146                // Method java/lang/StringBuilder."<init>":()V
    1058: ldc           #177                // String Max Tree Score:
    1060: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
    1063: iload_2
    1064: invokevirtual #159                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
    1067: invokevirtual #163                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1070: getstatic     #169                // Field java/lang/System.out:Ljava/io/PrintStream;
    1073: swap
    1074: invokevirtual #175                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1077: return

  public static final <T> kotlin.sequences.Sequence<T> takeWhileInclusive(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);
    Code:
       0: aload_0
       1: ldc           #222                // String <this>
       3: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #230                // String predicate
       9: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #232                // class Day08Kt$takeWhileInclusive$1
      15: dup
      16: aload_0
      17: aload_1
      18: aconst_null
      19: invokespecial #235                // Method Day08Kt$takeWhileInclusive$1."<init>":(Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)V
      22: checkcast     #237                // class kotlin/jvm/functions/Function2
      25: invokestatic  #241                // Method kotlin/sequences/SequencesKt.sequence:(Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
      28: areturn

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #246                // Method main:()V
       3: return

  private static final boolean main$lambda$8$lambda$7$lambda$3(java.lang.String, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #249                // String it
       3: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: aload_0
       8: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
      11: ifge          18
      14: iconst_1
      15: goto          19
      18: iconst_0
      19: ireturn

  private static final boolean main$lambda$8$lambda$7$lambda$4(java.lang.String, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #249                // String it
       3: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: aload_0
       8: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
      11: ifge          18
      14: iconst_1
      15: goto          19
      18: iconst_0
      19: ireturn

  private static final boolean main$lambda$8$lambda$7$lambda$5(java.lang.String, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #249                // String it
       3: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: aload_0
       8: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
      11: ifge          18
      14: iconst_1
      15: goto          19
      18: iconst_0
      19: ireturn

  private static final boolean main$lambda$8$lambda$7$lambda$6(java.lang.String, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #249                // String it
       3: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: aload_0
       8: invokevirtual #136                // Method java/lang/String.compareTo:(Ljava/lang/String;)I
      11: ifge          18
      14: iconst_1
      15: goto          19
      18: iconst_0
      19: ireturn
}

Compiled from "Day08.kt"
final class Day08Kt$takeWhileInclusive$1 extends kotlin.coroutines.jvm.internal.RestrictedSuspendLambda implements kotlin.jvm.functions.Function2<kotlin.sequences.SequenceScope<? super T>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
  java.lang.Object L$1;

  java.lang.Object L$2;

  java.lang.Object L$3;

  int label;

  private java.lang.Object L$0;

  final java.util.List<T> $this_takeWhileInclusive;

  final kotlin.jvm.functions.Function1<T, java.lang.Boolean> $predicate;

  Day08Kt$takeWhileInclusive$1(java.util.List<? extends T>, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>, kotlin.coroutines.Continuation<? super Day08Kt$takeWhileInclusive$1>);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #14                 // Field $this_takeWhileInclusive:Ljava/util/List;
       5: aload_0
       6: aload_2
       7: putfield      #18                 // Field $predicate:Lkotlin/jvm/functions/Function1;
      10: aload_0
      11: iconst_2
      12: aload_3
      13: invokespecial #21                 // Method kotlin/coroutines/jvm/internal/RestrictedSuspendLambda."<init>":(ILkotlin/coroutines/Continuation;)V
      16: return

  public final java.lang.Object invokeSuspend(java.lang.Object);
    Code:
       0: invokestatic  #53                 // Method kotlin/coroutines/intrinsics/IntrinsicsKt.getCOROUTINE_SUSPENDED:()Ljava/lang/Object;
       3: astore        8
       5: aload_0
       6: getfield      #57                 // Field label:I
       9: tableswitch   { // 0 to 1
                     0: 32
                     1: 129
               default: 197
          }
      32: aload_1
      33: invokestatic  #63                 // Method kotlin/ResultKt.throwOnFailure:(Ljava/lang/Object;)V
      36: aload_0
      37: getfield      #65                 // Field L$0:Ljava/lang/Object;
      40: checkcast     #67                 // class kotlin/sequences/SequenceScope
      43: astore_2
      44: aload_0
      45: getfield      #14                 // Field $this_takeWhileInclusive:Ljava/util/List;
      48: invokeinterface #73,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      53: astore_3
      54: aload_0
      55: getfield      #18                 // Field $predicate:Lkotlin/jvm/functions/Function1;
      58: astore        4
      60: aload_3
      61: astore        5
      63: iconst_0
      64: istore        6
      66: aload         5
      68: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      73: ifeq          191
      76: aload         5
      78: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      83: astore        7
      85: aload_2
      86: aload         7
      88: aload_0
      89: aload_0
      90: aload_2
      91: putfield      #65                 // Field L$0:Ljava/lang/Object;
      94: aload_0
      95: aload         4
      97: putfield      #83                 // Field L$1:Ljava/lang/Object;
     100: aload_0
     101: aload         5
     103: putfield      #85                 // Field L$2:Ljava/lang/Object;
     106: aload_0
     107: aload         7
     109: putfield      #87                 // Field L$3:Ljava/lang/Object;
     112: aload_0
     113: iconst_1
     114: putfield      #57                 // Field label:I
     117: invokevirtual #91                 // Method kotlin/sequences/SequenceScope.yield:(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
     120: dup
     121: aload         8
     123: if_acmpne     169
     126: aload         8
     128: areturn
     129: iconst_0
     130: istore        6
     132: aload_0
     133: getfield      #87                 // Field L$3:Ljava/lang/Object;
     136: astore        7
     138: aload_0
     139: getfield      #85                 // Field L$2:Ljava/lang/Object;
     142: checkcast     #75                 // class java/util/Iterator
     145: astore        5
     147: aload_0
     148: getfield      #83                 // Field L$1:Ljava/lang/Object;
     151: checkcast     #93                 // class kotlin/jvm/functions/Function1
     154: astore        4
     156: aload_0
     157: getfield      #65                 // Field L$0:Ljava/lang/Object;
     160: checkcast     #67                 // class kotlin/sequences/SequenceScope
     163: astore_2
     164: aload_1
     165: invokestatic  #63                 // Method kotlin/ResultKt.throwOnFailure:(Ljava/lang/Object;)V
     168: aload_1
     169: pop
     170: aload         4
     172: aload         7
     174: invokeinterface #96,  2           // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     179: checkcast     #98                 // class java/lang/Boolean
     182: invokevirtual #101                // Method java/lang/Boolean.booleanValue:()Z
     185: ifne          66
     188: goto          191
     191: nop
     192: nop
     193: getstatic     #107                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     196: areturn
     197: new           #109                // class java/lang/IllegalStateException
     200: dup
     201: ldc           #111                // String call to \'resume\' before \'invoke\' with coroutine
     203: invokespecial #114                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     206: athrow

  public final kotlin.coroutines.Continuation<kotlin.Unit> create(java.lang.Object, kotlin.coroutines.Continuation<?>);
    Code:
       0: new           #2                  // class Day08Kt$takeWhileInclusive$1
       3: dup
       4: aload_0
       5: getfield      #14                 // Field $this_takeWhileInclusive:Ljava/util/List;
       8: aload_0
       9: getfield      #18                 // Field $predicate:Lkotlin/jvm/functions/Function1;
      12: aload_2
      13: invokespecial #125                // Method "<init>":(Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)V
      16: astore_3
      17: aload_3
      18: aload_1
      19: putfield      #65                 // Field L$0:Ljava/lang/Object;
      22: aload_3
      23: checkcast     #127                // class kotlin/coroutines/Continuation
      26: areturn

  public final java.lang.Object invoke(kotlin.sequences.SequenceScope<? super T>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokevirtual #132                // Method create:(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
       6: checkcast     #2                  // class Day08Kt$takeWhileInclusive$1
       9: getstatic     #107                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      12: invokevirtual #134                // Method invokeSuspend:(Ljava/lang/Object;)Ljava/lang/Object;
      15: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #67                 // class kotlin/sequences/SequenceScope
       5: aload_2
       6: checkcast     #127                // class kotlin/coroutines/Continuation
       9: invokevirtual #139                // Method invoke:(Lkotlin/sequences/SequenceScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
      12: areturn
}


import java.nio.file.Files
import java.nio.file.Path

fun coding(grammar: List<String>): Map<String, Int> {
    val codes = mutableMapOf(
        ":" to 1,
        "(" to 2,
        ")" to 3,
        "." to 4,
        "*" to 5,
        ";" to 6,
        "," to 7,
        "#" to 8,
        "[" to 9,
        "]" to 10,
        "Eofgram" to 1000
    )

    var terminalNumber = 51
    var nonterminalNumber = 11
    var semanticNumber = 101

    // кодируем нетерминалы

    for (command in grammar) {
        if (command == "Eofgram")
            break
        val nonterm = command.split(" : ")[0]
        if (nonterminalNumber <= 50)
            codes[nonterm] = nonterminalNumber++
        else
            break
    }

    // кодируем терминалы и семантики
    for (command in grammar) {
        if ("Eofgram" in command)
            break

        // кодируем семантики
        val semantics = command
            .split(" ")
            .filter { it.matches(Regex("\\$[a-z]+[0-9]*")) }
        for (semantic in semantics) {
            if (semanticNumber >= 1000) {
                break
            }
            if (semantic !in codes.keys) {
                codes[semantic] = semanticNumber++
            }
        }

        // кодируем нетерминалы, обозначенные заглавными буквами

        val nonterminals = command
            .split(" ")
            .filter { it.matches(Regex("[A-Z]+")) }
        for (nonterminal in nonterminals) {
            if (nonterminalNumber > 50) {
                break
            }
            if (nonterminal !in codes.keys) {
                codes[nonterminal] = nonterminalNumber++
            }
        }

        // кодируем терминалы
        val rightPartCommand = command.split(" : ")[1]
        val terminals = rightPartCommand
            .split(" ")
            .filter {
                it.matches(Regex("'.+'")) ||
                        it.matches(Regex("[a-z]+"))
            }
        for (terminal in terminals) {
            if (terminalNumber > 100) {
                break
            }
            if (terminal !in codes.keys) {
                codes[terminal] = terminalNumber++
            }
        }
    }

    val trash = mutableListOf<String>()
    for (k in codes) {
        if ("Eofgram" in k.key && k.value != 1000)
            trash.add(k.key)
    }
    codes.filterKeys { it == "" || " " in it || it in trash }
    return codes
}

fun main() {
    println("Введите путь к файлу с описанием грамматики: ")
    val pathToInputFile = readlnOrNull() ?: "../expression.txt"
    val grammarDescription = Files
        .readString(Path.of(pathToInputFile))
        .split(" .")
        .map { it.trim() }
    val codes = coding(grammarDescription)
    codes.forEach { (t, u) -> println("$t $u") }

    for (line in grammarDescription) {
        if ("Eofgram" in line) {
            println(1000)
            break
        }

        var buffer = ""
        val encodedLine = mutableListOf<Int>()

        for (ch in line) {
            if (buffer in codes.keys) {
                encodedLine.add(codes[buffer] ?: -1)
                buffer = ""
            } else if (ch != ' ' && ch != '\n' && ch != '\t') {
                buffer += ch
            }
        }

        if (buffer in codes.keys) {
            encodedLine.add(codes[buffer] ?: -1)
        }

        encodedLine.forEach { print("$it, ") }
        println(codes["."])
    }
}

Compiled from "Main.kt"
public final class MainKt {
  public static final java.util.Map<java.lang.String, java.lang.Integer> coding(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #10                 // String grammar
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: bipush        11
       8: anewarray     #18                 // class kotlin/Pair
      11: astore_2
      12: aload_2
      13: iconst_0
      14: ldc           #20                 // String :
      16: iconst_1
      17: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      20: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      23: aastore
      24: aload_2
      25: iconst_1
      26: ldc           #34                 // String (
      28: iconst_2
      29: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      32: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      35: aastore
      36: aload_2
      37: iconst_2
      38: ldc           #36                 // String )
      40: iconst_3
      41: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      44: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      47: aastore
      48: aload_2
      49: iconst_3
      50: ldc           #38                 // String .
      52: iconst_4
      53: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      56: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      59: aastore
      60: aload_2
      61: iconst_4
      62: ldc           #40                 // String *
      64: iconst_5
      65: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      68: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      71: aastore
      72: aload_2
      73: iconst_5
      74: ldc           #42                 // String ;
      76: bipush        6
      78: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      81: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      84: aastore
      85: aload_2
      86: bipush        6
      88: ldc           #44                 // String ,
      90: bipush        7
      92: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      95: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      98: aastore
      99: aload_2
     100: bipush        7
     102: ldc           #46                 // String #
     104: bipush        8
     106: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     109: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     112: aastore
     113: aload_2
     114: bipush        8
     116: ldc           #48                 // String [
     118: bipush        9
     120: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     123: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     126: aastore
     127: aload_2
     128: bipush        9
     130: ldc           #50                 // String ]
     132: bipush        10
     134: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     137: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     140: aastore
     141: aload_2
     142: bipush        10
     144: ldc           #52                 // String Eofgram
     146: sipush        1000
     149: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     152: invokestatic  #32                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     155: aastore
     156: aload_2
     157: invokestatic  #58                 // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
     160: astore_1
     161: bipush        51
     163: istore_2
     164: bipush        11
     166: istore_3
     167: bipush        101
     169: istore        4
     171: aload_0
     172: invokeinterface #64,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     177: astore        5
     179: aload         5
     181: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     186: ifeq          280
     189: aload         5
     191: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     196: checkcast     #76                 // class java/lang/String
     199: astore        6
     201: aload         6
     203: ldc           #52                 // String Eofgram
     205: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     208: ifeq          214
     211: goto          280
     214: aload         6
     216: checkcast     #82                 // class java/lang/CharSequence
     219: iconst_1
     220: anewarray     #76                 // class java/lang/String
     223: astore        8
     225: aload         8
     227: iconst_0
     228: ldc           #84                 // String  :
     230: aastore
     231: aload         8
     233: iconst_0
     234: iconst_0
     235: bipush        6
     237: aconst_null
     238: invokestatic  #90                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     241: iconst_0
     242: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     247: checkcast     #76                 // class java/lang/String
     250: astore        7
     252: iload_3
     253: bipush        50
     255: if_icmpgt     277
     258: aload_1
     259: aload         7
     261: iload_3
     262: iinc          3, 1
     265: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     268: invokeinterface #100,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     273: pop
     274: goto          179
     277: goto          280
     280: aload_0
     281: invokeinterface #64,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     286: astore        5
     288: aload         5
     290: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     295: ifeq          1046
     298: aload         5
     300: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     305: checkcast     #76                 // class java/lang/String
     308: astore        6
     310: aload         6
     312: checkcast     #82                 // class java/lang/CharSequence
     315: ldc           #52                 // String Eofgram
     317: checkcast     #82                 // class java/lang/CharSequence
     320: iconst_0
     321: iconst_2
     322: aconst_null
     323: invokestatic  #104                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
     326: ifeq          332
     329: goto          1046
     332: aload         6
     334: checkcast     #82                 // class java/lang/CharSequence
     337: iconst_1
     338: anewarray     #76                 // class java/lang/String
     341: astore        8
     343: aload         8
     345: iconst_0
     346: ldc           #106                // String
     348: aastore
     349: aload         8
     351: iconst_0
     352: iconst_0
     353: bipush        6
     355: aconst_null
     356: invokestatic  #90                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     359: checkcast     #108                // class java/lang/Iterable
     362: astore        8
     364: nop
     365: iconst_0
     366: istore        9
     368: aload         8
     370: astore        10
     372: new           #110                // class java/util/ArrayList
     375: dup
     376: invokespecial #114                // Method java/util/ArrayList."<init>":()V
     379: checkcast     #116                // class java/util/Collection
     382: astore        11
     384: iconst_0
     385: istore        12
     387: aload         10
     389: invokeinterface #117,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     394: astore        13
     396: aload         13
     398: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     403: ifeq          463
     406: aload         13
     408: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     413: astore        14
     415: aload         14
     417: checkcast     #76                 // class java/lang/String
     420: astore        15
     422: iconst_0
     423: istore        16
     425: aload         15
     427: checkcast     #82                 // class java/lang/CharSequence
     430: astore        17
     432: new           #119                // class kotlin/text/Regex
     435: dup
     436: ldc           #121                // String \\$[a-z]+[0-9]*
     438: invokespecial #124                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     441: aload         17
     443: invokevirtual #128                // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z
     446: nop
     447: ifeq          396
     450: aload         11
     452: aload         14
     454: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     459: pop
     460: goto          396
     463: aload         11
     465: checkcast     #60                 // class java/util/List
     468: nop
     469: astore        7
     471: aload         7
     473: invokeinterface #64,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     478: astore        8
     480: aload         8
     482: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     487: ifeq          549
     490: aload         8
     492: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     497: checkcast     #76                 // class java/lang/String
     500: astore        9
     502: iload         4
     504: sipush        1000
     507: if_icmplt     513
     510: goto          549
     513: aload_1
     514: invokeinterface #136,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     519: aload         9
     521: invokeinterface #141,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     526: ifne          480
     529: aload_1
     530: aload         9
     532: iload         4
     534: iinc          4, 1
     537: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     540: invokeinterface #100,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     545: pop
     546: goto          480
     549: aload         6
     551: checkcast     #82                 // class java/lang/CharSequence
     554: iconst_1
     555: anewarray     #76                 // class java/lang/String
     558: astore        9
     560: aload         9
     562: iconst_0
     563: ldc           #106                // String
     565: aastore
     566: aload         9
     568: iconst_0
     569: iconst_0
     570: bipush        6
     572: aconst_null
     573: invokestatic  #90                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     576: checkcast     #108                // class java/lang/Iterable
     579: astore        9
     581: nop
     582: iconst_0
     583: istore        10
     585: aload         9
     587: astore        11
     589: new           #110                // class java/util/ArrayList
     592: dup
     593: invokespecial #114                // Method java/util/ArrayList."<init>":()V
     596: checkcast     #116                // class java/util/Collection
     599: astore        12
     601: iconst_0
     602: istore        13
     604: aload         11
     606: invokeinterface #117,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     611: astore        14
     613: aload         14
     615: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     620: ifeq          680
     623: aload         14
     625: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     630: astore        15
     632: aload         15
     634: checkcast     #76                 // class java/lang/String
     637: astore        16
     639: iconst_0
     640: istore        17
     642: aload         16
     644: checkcast     #82                 // class java/lang/CharSequence
     647: astore        18
     649: new           #119                // class kotlin/text/Regex
     652: dup
     653: ldc           #143                // String [A-Z]+
     655: invokespecial #124                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     658: aload         18
     660: invokevirtual #128                // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z
     663: nop
     664: ifeq          613
     667: aload         12
     669: aload         15
     671: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     676: pop
     677: goto          613
     680: aload         12
     682: checkcast     #60                 // class java/util/List
     685: nop
     686: astore        8
     688: aload         8
     690: invokeinterface #64,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     695: astore        9
     697: aload         9
     699: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     704: ifeq          763
     707: aload         9
     709: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     714: checkcast     #76                 // class java/lang/String
     717: astore        10
     719: iload_3
     720: bipush        50
     722: if_icmple     728
     725: goto          763
     728: aload_1
     729: invokeinterface #136,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     734: aload         10
     736: invokeinterface #141,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     741: ifne          697
     744: aload_1
     745: aload         10
     747: iload_3
     748: iinc          3, 1
     751: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     754: invokeinterface #100,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     759: pop
     760: goto          697
     763: aload         6
     765: checkcast     #82                 // class java/lang/CharSequence
     768: iconst_1
     769: anewarray     #76                 // class java/lang/String
     772: astore        10
     774: aload         10
     776: iconst_0
     777: ldc           #84                 // String  :
     779: aastore
     780: aload         10
     782: iconst_0
     783: iconst_0
     784: bipush        6
     786: aconst_null
     787: invokestatic  #90                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     790: iconst_1
     791: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     796: checkcast     #76                 // class java/lang/String
     799: astore        9
     801: aload         9
     803: checkcast     #82                 // class java/lang/CharSequence
     806: iconst_1
     807: anewarray     #76                 // class java/lang/String
     810: astore        11
     812: aload         11
     814: iconst_0
     815: ldc           #106                // String
     817: aastore
     818: aload         11
     820: iconst_0
     821: iconst_0
     822: bipush        6
     824: aconst_null
     825: invokestatic  #90                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     828: checkcast     #108                // class java/lang/Iterable
     831: astore        11
     833: nop
     834: iconst_0
     835: istore        12
     837: aload         11
     839: astore        13
     841: new           #110                // class java/util/ArrayList
     844: dup
     845: invokespecial #114                // Method java/util/ArrayList."<init>":()V
     848: checkcast     #116                // class java/util/Collection
     851: astore        14
     853: iconst_0
     854: istore        15
     856: aload         13
     858: invokeinterface #117,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     863: astore        16
     865: aload         16
     867: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     872: ifeq          963
     875: aload         16
     877: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     882: astore        17
     884: aload         17
     886: checkcast     #76                 // class java/lang/String
     889: astore        18
     891: iconst_0
     892: istore        19
     894: aload         18
     896: checkcast     #82                 // class java/lang/CharSequence
     899: astore        20
     901: new           #119                // class kotlin/text/Regex
     904: dup
     905: ldc           #145                // String \'.+\'
     907: invokespecial #124                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     910: aload         20
     912: invokevirtual #128                // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z
     915: ifne          942
     918: aload         18
     920: checkcast     #82                 // class java/lang/CharSequence
     923: astore        20
     925: new           #119                // class kotlin/text/Regex
     928: dup
     929: ldc           #147                // String [a-z]+
     931: invokespecial #124                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     934: aload         20
     936: invokevirtual #128                // Method kotlin/text/Regex.matches:(Ljava/lang/CharSequence;)Z
     939: ifeq          946
     942: iconst_1
     943: goto          947
     946: iconst_0
     947: ifeq          865
     950: aload         14
     952: aload         17
     954: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     959: pop
     960: goto          865
     963: aload         14
     965: checkcast     #60                 // class java/util/List
     968: nop
     969: astore        10
     971: aload         10
     973: invokeinterface #64,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     978: astore        11
     980: aload         11
     982: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     987: ifeq          288
     990: aload         11
     992: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     997: checkcast     #76                 // class java/lang/String
    1000: astore        12
    1002: iload_2
    1003: bipush        100
    1005: if_icmple     1011
    1008: goto          288
    1011: aload_1
    1012: invokeinterface #136,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
    1017: aload         12
    1019: invokeinterface #141,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1024: ifne          980
    1027: aload_1
    1028: aload         12
    1030: iload_2
    1031: iinc          2, 1
    1034: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1037: invokeinterface #100,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1042: pop
    1043: goto          980
    1046: new           #110                // class java/util/ArrayList
    1049: dup
    1050: invokespecial #114                // Method java/util/ArrayList."<init>":()V
    1053: checkcast     #60                 // class java/util/List
    1056: astore        5
    1058: aload_1
    1059: invokeinterface #150,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1064: invokeinterface #151,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
    1069: astore        6
    1071: aload         6
    1073: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1078: ifeq          1154
    1081: aload         6
    1083: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1088: checkcast     #153                // class java/util/Map$Entry
    1091: astore        7
    1093: aload         7
    1095: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1100: checkcast     #82                 // class java/lang/CharSequence
    1103: ldc           #52                 // String Eofgram
    1105: checkcast     #82                 // class java/lang/CharSequence
    1108: iconst_0
    1109: iconst_2
    1110: aconst_null
    1111: invokestatic  #104                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
    1114: ifeq          1071
    1117: aload         7
    1119: invokeinterface #159,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1124: checkcast     #161                // class java/lang/Number
    1127: invokevirtual #165                // Method java/lang/Number.intValue:()I
    1130: sipush        1000
    1133: if_icmpeq     1071
    1136: aload         5
    1138: aload         7
    1140: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1145: invokeinterface #166,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    1150: pop
    1151: goto          1071
    1154: aload_1
    1155: astore        6
    1157: iconst_0
    1158: istore        7
    1160: new           #168                // class java/util/LinkedHashMap
    1163: dup
    1164: invokespecial #169                // Method java/util/LinkedHashMap."<init>":()V
    1167: astore        8
    1169: aload         6
    1171: invokeinterface #150,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1176: invokeinterface #151,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
    1181: astore        9
    1183: aload         9
    1185: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1190: ifeq          1292
    1193: aload         9
    1195: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1200: checkcast     #153                // class java/util/Map$Entry
    1203: astore        10
    1205: aload         10
    1207: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1212: checkcast     #76                 // class java/lang/String
    1215: astore        11
    1217: iconst_0
    1218: istore        12
    1220: aload         11
    1222: ldc           #171                // String
    1224: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
    1227: ifne          1261
    1230: aload         11
    1232: checkcast     #82                 // class java/lang/CharSequence
    1235: ldc           #106                // String
    1237: checkcast     #82                 // class java/lang/CharSequence
    1240: iconst_0
    1241: iconst_2
    1242: aconst_null
    1243: invokestatic  #104                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
    1246: ifne          1261
    1249: aload         5
    1251: aload         11
    1253: invokeinterface #172,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
    1258: ifeq          1265
    1261: iconst_1
    1262: goto          1266
    1265: iconst_0
    1266: ifeq          1183
    1269: aload         8
    1271: aload         10
    1273: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1278: aload         10
    1280: invokeinterface #159,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1285: invokevirtual #173                // Method java/util/LinkedHashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1288: pop
    1289: goto          1183
    1292: aload         8
    1294: checkcast     #96                 // class java/util/Map
    1297: pop
    1298: aload_1
    1299: areturn

  public static final void main();
    Code:
       0: ldc           #217                // String Введите путь к файлу с описанием грамматики:
       2: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
       5: swap
       6: invokevirtual #229                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
       9: invokestatic  #235                // Method kotlin/io/ConsoleKt.readlnOrNull:()Ljava/lang/String;
      12: dup
      13: ifnonnull     19
      16: pop
      17: ldc           #237                // String ../expression.txt
      19: astore_0
      20: aload_0
      21: iconst_0
      22: anewarray     #76                 // class java/lang/String
      25: invokestatic  #243                // InterfaceMethod java/nio/file/Path.of:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
      28: invokestatic  #249                // Method java/nio/file/Files.readString:(Ljava/nio/file/Path;)Ljava/lang/String;
      31: dup
      32: ldc           #251                // String readString(...)
      34: invokestatic  #254                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      37: checkcast     #82                 // class java/lang/CharSequence
      40: iconst_1
      41: anewarray     #76                 // class java/lang/String
      44: astore_2
      45: aload_2
      46: iconst_0
      47: ldc_w         #256                // String  .
      50: aastore
      51: aload_2
      52: iconst_0
      53: iconst_0
      54: bipush        6
      56: aconst_null
      57: invokestatic  #90                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      60: checkcast     #108                // class java/lang/Iterable
      63: astore_2
      64: nop
      65: iconst_0
      66: istore_3
      67: aload_2
      68: astore        4
      70: new           #110                // class java/util/ArrayList
      73: dup
      74: aload_2
      75: bipush        10
      77: invokestatic  #262                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      80: invokespecial #265                // Method java/util/ArrayList."<init>":(I)V
      83: checkcast     #116                // class java/util/Collection
      86: astore        5
      88: iconst_0
      89: istore        6
      91: aload         4
      93: invokeinterface #117,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      98: astore        7
     100: aload         7
     102: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     107: ifeq          157
     110: aload         7
     112: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     117: astore        8
     119: aload         5
     121: aload         8
     123: checkcast     #76                 // class java/lang/String
     126: astore        9
     128: astore        13
     130: iconst_0
     131: istore        10
     133: aload         9
     135: checkcast     #82                 // class java/lang/CharSequence
     138: invokestatic  #269                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     141: invokevirtual #272                // Method java/lang/Object.toString:()Ljava/lang/String;
     144: nop
     145: aload         13
     147: swap
     148: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     153: pop
     154: goto          100
     157: aload         5
     159: checkcast     #60                 // class java/util/List
     162: nop
     163: astore_1
     164: aload_1
     165: invokestatic  #274                // Method coding:(Ljava/util/List;)Ljava/util/Map;
     168: astore_2
     169: aload_2
     170: astore_3
     171: iconst_0
     172: istore        4
     174: aload_3
     175: invokeinterface #150,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     180: invokeinterface #151,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     185: astore        5
     187: aload         5
     189: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     194: ifeq          280
     197: aload         5
     199: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     204: checkcast     #153                // class java/util/Map$Entry
     207: astore        6
     209: aload         6
     211: astore        7
     213: iconst_0
     214: istore        8
     216: aload         7
     218: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     223: checkcast     #76                 // class java/lang/String
     226: astore        9
     228: aload         7
     230: invokeinterface #159,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     235: checkcast     #161                // class java/lang/Number
     238: invokevirtual #165                // Method java/lang/Number.intValue:()I
     241: istore        10
     243: new           #276                // class java/lang/StringBuilder
     246: dup
     247: invokespecial #277                // Method java/lang/StringBuilder."<init>":()V
     250: aload         9
     252: invokevirtual #281                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     255: bipush        32
     257: invokevirtual #284                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     260: iload         10
     262: invokevirtual #287                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     265: invokevirtual #288                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     268: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
     271: swap
     272: invokevirtual #229                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     275: nop
     276: nop
     277: goto          187
     280: nop
     281: aload_1
     282: invokeinterface #64,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     287: astore_3
     288: aload_3
     289: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     294: ifeq          644
     297: aload_3
     298: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     303: checkcast     #76                 // class java/lang/String
     306: astore        4
     308: aload         4
     310: checkcast     #82                 // class java/lang/CharSequence
     313: ldc           #52                 // String Eofgram
     315: checkcast     #82                 // class java/lang/CharSequence
     318: iconst_0
     319: iconst_2
     320: aconst_null
     321: invokestatic  #104                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
     324: ifeq          343
     327: sipush        1000
     330: istore        5
     332: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
     335: iload         5
     337: invokevirtual #290                // Method java/io/PrintStream.println:(I)V
     340: goto          644
     343: ldc           #171                // String
     345: astore        5
     347: new           #110                // class java/util/ArrayList
     350: dup
     351: invokespecial #114                // Method java/util/ArrayList."<init>":()V
     354: checkcast     #60                 // class java/util/List
     357: astore        6
     359: iconst_0
     360: istore        7
     362: aload         4
     364: invokevirtual #293                // Method java/lang/String.length:()I
     367: istore        8
     369: iload         7
     371: iload         8
     373: if_icmpge     491
     376: aload         4
     378: iload         7
     380: invokevirtual #297                // Method java/lang/String.charAt:(I)C
     383: istore        9
     385: aload_2
     386: invokeinterface #136,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     391: aload         5
     393: invokeinterface #141,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     398: ifeq          442
     401: aload         6
     403: aload_2
     404: aload         5
     406: invokeinterface #300,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     411: checkcast     #22                 // class java/lang/Integer
     414: dup
     415: ifnull        424
     418: invokevirtual #301                // Method java/lang/Integer.intValue:()I
     421: goto          426
     424: pop
     425: iconst_m1
     426: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     429: invokeinterface #166,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     434: pop
     435: ldc           #171                // String
     437: astore        5
     439: goto          485
     442: iload         9
     444: bipush        32
     446: if_icmpeq     485
     449: iload         9
     451: bipush        10
     453: if_icmpeq     485
     456: iload         9
     458: bipush        9
     460: if_icmpeq     485
     463: new           #276                // class java/lang/StringBuilder
     466: dup
     467: invokespecial #277                // Method java/lang/StringBuilder."<init>":()V
     470: aload         5
     472: invokevirtual #281                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     475: iload         9
     477: invokevirtual #284                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     480: invokevirtual #288                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     483: astore        5
     485: iinc          7, 1
     488: goto          369
     491: aload_2
     492: invokeinterface #136,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     497: aload         5
     499: invokeinterface #141,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     504: ifeq          541
     507: aload         6
     509: aload_2
     510: aload         5
     512: invokeinterface #300,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     517: checkcast     #22                 // class java/lang/Integer
     520: dup
     521: ifnull        530
     524: invokevirtual #301                // Method java/lang/Integer.intValue:()I
     527: goto          532
     530: pop
     531: iconst_m1
     532: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     535: invokeinterface #166,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     540: pop
     541: aload         6
     543: checkcast     #108                // class java/lang/Iterable
     546: astore        7
     548: iconst_0
     549: istore        8
     551: aload         7
     553: invokeinterface #117,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     558: astore        9
     560: aload         9
     562: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     567: ifeq          625
     570: aload         9
     572: invokeinterface #74,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     577: astore        10
     579: aload         10
     581: checkcast     #161                // class java/lang/Number
     584: invokevirtual #165                // Method java/lang/Number.intValue:()I
     587: istore        11
     589: iconst_0
     590: istore        12
     592: new           #276                // class java/lang/StringBuilder
     595: dup
     596: invokespecial #277                // Method java/lang/StringBuilder."<init>":()V
     599: iload         11
     601: invokevirtual #287                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     604: ldc_w         #303                // String ,
     607: invokevirtual #281                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     610: invokevirtual #288                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     613: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
     616: swap
     617: invokevirtual #306                // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
     620: nop
     621: nop
     622: goto          560
     625: nop
     626: aload_2
     627: ldc           #38                 // String .
     629: invokeinterface #300,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     634: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
     637: swap
     638: invokevirtual #229                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     641: goto          288
     644: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #329                // Method main:()V
       3: return
}


val vowelList = listOf<Char>('a', 'e', 'i', 'o', 'u')

fun main(args: Array<String>) {
	val vowel = readLine()!!
	//val vowel = "aeiouaeiouaeiouaaeeiioouu"
	println(longestSubsequence(vowel))
}

fun longestSubsequence(searchVowel: String): Int {

	val chars = searchVowel.toCharArray()

	val lastIndex = chars.size

	var initialIndex = 0

	var lastLongestSequence = 0;

	while (initialIndex < lastIndex) {

		var curretLongestSequence = 0
		var currentVowelIndex = 0

		for (index in initialIndex until lastIndex) {

			if(isVowel(chars[index])) {

				val isTheSameVowel = vowelList[currentVowelIndex] == chars[index]
				val isNextSequence = currentVowelIndex < vowelList.size - 1
						&& vowelList[currentVowelIndex+1] == chars[index]

				if (isTheSameVowel) {
					curretLongestSequence++
				} else if (isNextSequence) {
					currentVowelIndex++
					curretLongestSequence++
				}
			}
		}

		initialIndex += 1
		if (curretLongestSequence > lastLongestSequence) lastLongestSequence = curretLongestSequence
	}

	return lastLongestSequence
}

fun isVowel(c: Char): Boolean {
	return vowelList.contains(c)
}

Compiled from "FunWithVowels.kt"
public final class FunWithVowelsKt {
  private static final java.util.List<java.lang.Character> vowelList;

  public static final java.util.List<java.lang.Character> getVowelList();
    Code:
       0: getstatic     #12                 // Field vowelList:Ljava/util/List;
       3: areturn

  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #16                 // String args
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: invokestatic  #28                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       9: dup
      10: invokestatic  #32                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      13: astore_1
      14: aload_1
      15: invokestatic  #36                 // Method longestSubsequence:(Ljava/lang/String;)I
      18: istore_2
      19: getstatic     #42                 // Field java/lang/System.out:Ljava/io/PrintStream;
      22: iload_2
      23: invokevirtual #48                 // Method java/io/PrintStream.println:(I)V
      26: return

  public static final int longestSubsequence(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #53                 // String searchVowel
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokevirtual #59                 // Method java/lang/String.toCharArray:()[C
      10: dup
      11: ldc           #61                 // String toCharArray(...)
      13: invokestatic  #64                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      16: astore_1
      17: aload_1
      18: arraylength
      19: istore_2
      20: iconst_0
      21: istore_3
      22: iconst_0
      23: istore        4
      25: iload_3
      26: iload_2
      27: if_icmpge     177
      30: iconst_0
      31: istore        5
      33: iconst_0
      34: istore        6
      36: iload_3
      37: istore        7
      39: iload         7
      41: iload_2
      42: if_icmpge     160
      45: aload_1
      46: iload         7
      48: caload
      49: invokestatic  #68                 // Method isVowel:(C)Z
      52: ifeq          154
      55: getstatic     #12                 // Field vowelList:Ljava/util/List;
      58: iload         6
      60: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      65: checkcast     #76                 // class java/lang/Character
      68: invokevirtual #80                 // Method java/lang/Character.charValue:()C
      71: aload_1
      72: iload         7
      74: caload
      75: if_icmpne     82
      78: iconst_1
      79: goto          83
      82: iconst_0
      83: istore        8
      85: iload         6
      87: getstatic     #12                 // Field vowelList:Ljava/util/List;
      90: invokeinterface #84,  1           // InterfaceMethod java/util/List.size:()I
      95: iconst_1
      96: isub
      97: if_icmpge     129
     100: getstatic     #12                 // Field vowelList:Ljava/util/List;
     103: iload         6
     105: iconst_1
     106: iadd
     107: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     112: checkcast     #76                 // class java/lang/Character
     115: invokevirtual #80                 // Method java/lang/Character.charValue:()C
     118: aload_1
     119: iload         7
     121: caload
     122: if_icmpne     129
     125: iconst_1
     126: goto          130
     129: iconst_0
     130: istore        9
     132: iload         8
     134: ifeq          143
     137: iinc          5, 1
     140: goto          154
     143: iload         9
     145: ifeq          154
     148: iinc          6, 1
     151: iinc          5, 1
     154: iinc          7, 1
     157: goto          39
     160: iinc          3, 1
     163: iload         5
     165: iload         4
     167: if_icmple     25
     170: iload         5
     172: istore        4
     174: goto          25
     177: iload         4
     179: ireturn

  public static final boolean isVowel(char);
    Code:
       0: getstatic     #12                 // Field vowelList:Ljava/util/List;
       3: iload_0
       4: invokestatic  #101                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
       7: invokeinterface #105,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
      12: ireturn

  static {};
    Code:
       0: iconst_5
       1: anewarray     #76                 // class java/lang/Character
       4: astore_0
       5: aload_0
       6: iconst_0
       7: bipush        97
       9: invokestatic  #101                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      12: aastore
      13: aload_0
      14: iconst_1
      15: bipush        101
      17: invokestatic  #101                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      20: aastore
      21: aload_0
      22: iconst_2
      23: bipush        105
      25: invokestatic  #101                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      28: aastore
      29: aload_0
      30: iconst_3
      31: bipush        111
      33: invokestatic  #101                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      36: aastore
      37: aload_0
      38: iconst_4
      39: bipush        117
      41: invokestatic  #101                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      44: aastore
      45: aload_0
      46: invokestatic  #115                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      49: putstatic     #12                 // Field vowelList:Ljava/util/List;
      52: return
}