import java.io.File

fun main() {
    val strings = File(ClassLoader.getSystemResource("input.txt").file).readLines()
    val field = Array(1000) { Array(1000) { 0 } }
    strings.forEach {
        val words = it.split(" ")
        val start = words[2].dropLast(1).split(",").map { it.toInt() }
        val size = words[3].split("x").map { it.toInt() }
        (start[0] until start[0] + size[0]).forEach { x ->
            (start[1] until start[1] + size[1]).forEach { y ->
                field[x][y] += 1
            }
        }
    }
    println(field.sumBy { it.count { it > 1 } })

    val map = strings.map {
        val words = it.split(" ")
        val start = words[2].dropLast(1).split(",").map { it.toInt() }
        val size = words[3].split("x").map { it.toInt() }
        words[0] to (Point(start[0], start[1]) to Point(start[0] + size[0], start[1] + size[1]))
    }
    println(map.first { pair ->
        map.all {
            pair.first == it.first ||
                doNotOverlap(pair.second.first, pair.second.second, it.second.first, it.second.second)
        }
    }.first)

}

data class Point(val x: Int, val y: Int)

fun doNotOverlap(l1: Point, r1: Point, l2: Point, r2: Point) =
    l1.x >= r2.x || l2.x >= r1.x || l1.y >= r2.y || l2.y >= r1.y

Compiled from "Main.kt"
public final class MainKt {
  public static final void main();
    Code:
       0: new           #8                  // class java/io/File
       3: dup
       4: ldc           #10                 // String input.txt
       6: invokestatic  #16                 // Method java/lang/ClassLoader.getSystemResource:(Ljava/lang/String;)Ljava/net/URL;
       9: invokevirtual #22                 // Method java/net/URL.getFile:()Ljava/lang/String;
      12: invokespecial #26                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      15: aconst_null
      16: iconst_1
      17: aconst_null
      18: invokestatic  #32                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      21: astore_0
      22: iconst_0
      23: istore_2
      24: sipush        1000
      27: anewarray     #34                 // class "[Ljava/lang/Integer;"
      30: astore_3
      31: iload_2
      32: sipush        1000
      35: if_icmpge     99
      38: iload_2
      39: istore        4
      41: aload_3
      42: iload         4
      44: iconst_0
      45: istore        5
      47: sipush        1000
      50: anewarray     #36                 // class java/lang/Integer
      53: astore        6
      55: istore        26
      57: astore        25
      59: iload         5
      61: sipush        1000
      64: if_icmpge     86
      67: iload         5
      69: istore        7
      71: aload         6
      73: iload         7
      75: iconst_0
      76: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      79: aastore
      80: iinc          5, 1
      83: goto          59
      86: aload         25
      88: iload         26
      90: aload         6
      92: aastore
      93: iinc          2, 1
      96: goto          31
      99: aload_3
     100: astore_1
     101: aload_0
     102: checkcast     #42                 // class java/lang/Iterable
     105: astore_2
     106: iconst_0
     107: istore_3
     108: aload_2
     109: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     114: astore        4
     116: aload         4
     118: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     123: ifeq          678
     126: aload         4
     128: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     133: astore        5
     135: aload         5
     137: checkcast     #58                 // class java/lang/String
     140: astore        6
     142: iconst_0
     143: istore        7
     145: aload         6
     147: checkcast     #60                 // class java/lang/CharSequence
     150: iconst_1
     151: anewarray     #58                 // class java/lang/String
     154: astore        8
     156: aload         8
     158: iconst_0
     159: ldc           #62                 // String
     161: aastore
     162: aload         8
     164: iconst_0
     165: iconst_0
     166: bipush        6
     168: aconst_null
     169: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     172: astore        9
     174: aload         9
     176: iconst_2
     177: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     182: checkcast     #58                 // class java/lang/String
     185: iconst_1
     186: invokestatic  #78                 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;
     189: checkcast     #60                 // class java/lang/CharSequence
     192: iconst_1
     193: anewarray     #58                 // class java/lang/String
     196: astore        10
     198: aload         10
     200: iconst_0
     201: ldc           #80                 // String ,
     203: aastore
     204: aload         10
     206: iconst_0
     207: iconst_0
     208: bipush        6
     210: aconst_null
     211: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     214: checkcast     #42                 // class java/lang/Iterable
     217: astore        10
     219: iconst_0
     220: istore        11
     222: aload         10
     224: astore        12
     226: new           #82                 // class java/util/ArrayList
     229: dup
     230: aload         10
     232: bipush        10
     234: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     237: invokespecial #91                 // Method java/util/ArrayList."<init>":(I)V
     240: checkcast     #93                 // class java/util/Collection
     243: astore        13
     245: iconst_0
     246: istore        14
     248: aload         12
     250: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     255: astore        15
     257: aload         15
     259: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     264: ifeq          311
     267: aload         15
     269: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     274: astore        16
     276: aload         13
     278: aload         16
     280: checkcast     #58                 // class java/lang/String
     283: astore        17
     285: astore        18
     287: iconst_0
     288: istore        19
     290: aload         17
     292: invokestatic  #97                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     295: nop
     296: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     299: aload         18
     301: swap
     302: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     307: pop
     308: goto          257
     311: aload         13
     313: checkcast     #70                 // class java/util/List
     316: nop
     317: astore        8
     319: aload         9
     321: iconst_3
     322: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     327: checkcast     #60                 // class java/lang/CharSequence
     330: iconst_1
     331: anewarray     #58                 // class java/lang/String
     334: astore        11
     336: aload         11
     338: iconst_0
     339: ldc           #103                // String x
     341: aastore
     342: aload         11
     344: iconst_0
     345: iconst_0
     346: bipush        6
     348: aconst_null
     349: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     352: checkcast     #42                 // class java/lang/Iterable
     355: astore        11
     357: iconst_0
     358: istore        12
     360: aload         11
     362: astore        13
     364: new           #82                 // class java/util/ArrayList
     367: dup
     368: aload         11
     370: bipush        10
     372: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     375: invokespecial #91                 // Method java/util/ArrayList."<init>":(I)V
     378: checkcast     #93                 // class java/util/Collection
     381: astore        14
     383: iconst_0
     384: istore        15
     386: aload         13
     388: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     393: astore        16
     395: aload         16
     397: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     402: ifeq          449
     405: aload         16
     407: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     412: astore        17
     414: aload         14
     416: aload         17
     418: checkcast     #58                 // class java/lang/String
     421: astore        19
     423: astore        18
     425: iconst_0
     426: istore        20
     428: aload         19
     430: invokestatic  #97                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     433: nop
     434: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     437: aload         18
     439: swap
     440: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     445: pop
     446: goto          395
     449: aload         14
     451: checkcast     #70                 // class java/util/List
     454: nop
     455: astore        10
     457: aload         8
     459: iconst_0
     460: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     465: checkcast     #105                // class java/lang/Number
     468: invokevirtual #109                // Method java/lang/Number.intValue:()I
     471: aload         8
     473: iconst_0
     474: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     479: checkcast     #105                // class java/lang/Number
     482: invokevirtual #109                // Method java/lang/Number.intValue:()I
     485: aload         10
     487: iconst_0
     488: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     493: checkcast     #105                // class java/lang/Number
     496: invokevirtual #109                // Method java/lang/Number.intValue:()I
     499: iadd
     500: invokestatic  #115                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     503: checkcast     #42                 // class java/lang/Iterable
     506: astore        11
     508: iconst_0
     509: istore        12
     511: aload         11
     513: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     518: astore        13
     520: aload         13
     522: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     527: ifeq          672
     530: aload         13
     532: checkcast     #117                // class kotlin/collections/IntIterator
     535: invokevirtual #120                // Method kotlin/collections/IntIterator.nextInt:()I
     538: istore        14
     540: iload         14
     542: istore        15
     544: iconst_0
     545: istore        16
     547: aload         8
     549: iconst_1
     550: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     555: checkcast     #105                // class java/lang/Number
     558: invokevirtual #109                // Method java/lang/Number.intValue:()I
     561: aload         8
     563: iconst_1
     564: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     569: checkcast     #105                // class java/lang/Number
     572: invokevirtual #109                // Method java/lang/Number.intValue:()I
     575: aload         10
     577: iconst_1
     578: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     583: checkcast     #105                // class java/lang/Number
     586: invokevirtual #109                // Method java/lang/Number.intValue:()I
     589: iadd
     590: invokestatic  #115                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     593: checkcast     #42                 // class java/lang/Iterable
     596: astore        17
     598: iconst_0
     599: istore        19
     601: aload         17
     603: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     608: astore        20
     610: aload         20
     612: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     617: ifeq          666
     620: aload         20
     622: checkcast     #117                // class kotlin/collections/IntIterator
     625: invokevirtual #120                // Method kotlin/collections/IntIterator.nextInt:()I
     628: istore        21
     630: iload         21
     632: istore        22
     634: iconst_0
     635: istore        23
     637: aload_1
     638: iload         15
     640: aaload
     641: astore        24
     643: aload         24
     645: iload         22
     647: aload         24
     649: iload         22
     651: aaload
     652: invokevirtual #121                // Method java/lang/Integer.intValue:()I
     655: iconst_1
     656: iadd
     657: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     660: aastore
     661: nop
     662: nop
     663: goto          610
     666: nop
     667: nop
     668: nop
     669: goto          520
     672: nop
     673: nop
     674: nop
     675: goto          116
     678: nop
     679: aload_1
     680: checkcast     #123                // class "[Ljava/lang/Object;"
     683: astore_2
     684: iconst_0
     685: istore_3
     686: iconst_0
     687: istore        4
     689: iconst_0
     690: istore        5
     692: aload_2
     693: arraylength
     694: istore        6
     696: iload         5
     698: iload         6
     700: if_icmpge     809
     703: aload_2
     704: iload         5
     706: aaload
     707: astore        7
     709: iload         4
     711: aload         7
     713: checkcast     #34                 // class "[Ljava/lang/Integer;"
     716: astore        8
     718: istore        25
     720: iconst_0
     721: istore        9
     723: aload         8
     725: astore        10
     727: iconst_0
     728: istore        11
     730: iconst_0
     731: istore        12
     733: iconst_0
     734: istore        13
     736: aload         10
     738: arraylength
     739: istore        14
     741: iload         13
     743: iload         14
     745: if_icmpge     791
     748: aload         10
     750: iload         13
     752: aaload
     753: astore        15
     755: aload         15
     757: checkcast     #105                // class java/lang/Number
     760: invokevirtual #109                // Method java/lang/Number.intValue:()I
     763: istore        16
     765: iconst_0
     766: istore        17
     768: iload         16
     770: iconst_1
     771: if_icmple     778
     774: iconst_1
     775: goto          779
     778: iconst_0
     779: ifeq          785
     782: iinc          12, 1
     785: iinc          13, 1
     788: goto          741
     791: iload         12
     793: nop
     794: istore        26
     796: iload         25
     798: iload         26
     800: iadd
     801: istore        4
     803: iinc          5, 1
     806: goto          696
     809: iload         4
     811: istore_2
     812: getstatic     #129                // Field java/lang/System.out:Ljava/io/PrintStream;
     815: iload_2
     816: invokevirtual #134                // Method java/io/PrintStream.println:(I)V
     819: aload_0
     820: checkcast     #42                 // class java/lang/Iterable
     823: astore_3
     824: iconst_0
     825: istore        4
     827: aload_3
     828: astore        5
     830: new           #82                 // class java/util/ArrayList
     833: dup
     834: aload_3
     835: bipush        10
     837: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     840: invokespecial #91                 // Method java/util/ArrayList."<init>":(I)V
     843: checkcast     #93                 // class java/util/Collection
     846: astore        6
     848: iconst_0
     849: istore        7
     851: aload         5
     853: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     858: astore        8
     860: aload         8
     862: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     867: ifeq          1331
     870: aload         8
     872: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     877: astore        9
     879: aload         6
     881: aload         9
     883: checkcast     #58                 // class java/lang/String
     886: astore        10
     888: astore        25
     890: iconst_0
     891: istore        11
     893: aload         10
     895: checkcast     #60                 // class java/lang/CharSequence
     898: iconst_1
     899: anewarray     #58                 // class java/lang/String
     902: astore        12
     904: aload         12
     906: iconst_0
     907: ldc           #62                 // String
     909: aastore
     910: aload         12
     912: iconst_0
     913: iconst_0
     914: bipush        6
     916: aconst_null
     917: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     920: astore        13
     922: aload         13
     924: iconst_2
     925: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     930: checkcast     #58                 // class java/lang/String
     933: iconst_1
     934: invokestatic  #78                 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;
     937: checkcast     #60                 // class java/lang/CharSequence
     940: iconst_1
     941: anewarray     #58                 // class java/lang/String
     944: astore        14
     946: aload         14
     948: iconst_0
     949: ldc           #80                 // String ,
     951: aastore
     952: aload         14
     954: iconst_0
     955: iconst_0
     956: bipush        6
     958: aconst_null
     959: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     962: checkcast     #42                 // class java/lang/Iterable
     965: astore        14
     967: iconst_0
     968: istore        15
     970: aload         14
     972: astore        16
     974: new           #82                 // class java/util/ArrayList
     977: dup
     978: aload         14
     980: bipush        10
     982: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     985: invokespecial #91                 // Method java/util/ArrayList."<init>":(I)V
     988: checkcast     #93                 // class java/util/Collection
     991: astore        17
     993: iconst_0
     994: istore        18
     996: aload         16
     998: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1003: astore        19
    1005: aload         19
    1007: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1012: ifeq          1059
    1015: aload         19
    1017: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1022: astore        20
    1024: aload         17
    1026: aload         20
    1028: checkcast     #58                 // class java/lang/String
    1031: astore        21
    1033: astore        22
    1035: iconst_0
    1036: istore        23
    1038: aload         21
    1040: invokestatic  #97                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
    1043: nop
    1044: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1047: aload         22
    1049: swap
    1050: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1055: pop
    1056: goto          1005
    1059: aload         17
    1061: checkcast     #70                 // class java/util/List
    1064: nop
    1065: astore        12
    1067: aload         13
    1069: iconst_3
    1070: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1075: checkcast     #60                 // class java/lang/CharSequence
    1078: iconst_1
    1079: anewarray     #58                 // class java/lang/String
    1082: astore        15
    1084: aload         15
    1086: iconst_0
    1087: ldc           #103                // String x
    1089: aastore
    1090: aload         15
    1092: iconst_0
    1093: iconst_0
    1094: bipush        6
    1096: aconst_null
    1097: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
    1100: checkcast     #42                 // class java/lang/Iterable
    1103: astore        15
    1105: iconst_0
    1106: istore        16
    1108: aload         15
    1110: astore        17
    1112: new           #82                 // class java/util/ArrayList
    1115: dup
    1116: aload         15
    1118: bipush        10
    1120: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1123: invokespecial #91                 // Method java/util/ArrayList."<init>":(I)V
    1126: checkcast     #93                 // class java/util/Collection
    1129: astore        18
    1131: iconst_0
    1132: istore        19
    1134: aload         17
    1136: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1141: astore        20
    1143: aload         20
    1145: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1150: ifeq          1197
    1153: aload         20
    1155: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1160: astore        21
    1162: aload         18
    1164: aload         21
    1166: checkcast     #58                 // class java/lang/String
    1169: astore        23
    1171: astore        22
    1173: iconst_0
    1174: istore        24
    1176: aload         23
    1178: invokestatic  #97                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
    1181: nop
    1182: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1185: aload         22
    1187: swap
    1188: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1193: pop
    1194: goto          1143
    1197: aload         18
    1199: checkcast     #70                 // class java/util/List
    1202: nop
    1203: astore        14
    1205: aload         13
    1207: iconst_0
    1208: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1213: new           #136                // class Point
    1216: dup
    1217: aload         12
    1219: iconst_0
    1220: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1225: checkcast     #105                // class java/lang/Number
    1228: invokevirtual #109                // Method java/lang/Number.intValue:()I
    1231: aload         12
    1233: iconst_1
    1234: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1239: checkcast     #105                // class java/lang/Number
    1242: invokevirtual #109                // Method java/lang/Number.intValue:()I
    1245: invokespecial #139                // Method Point."<init>":(II)V
    1248: new           #136                // class Point
    1251: dup
    1252: aload         12
    1254: iconst_0
    1255: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1260: checkcast     #105                // class java/lang/Number
    1263: invokevirtual #109                // Method java/lang/Number.intValue:()I
    1266: aload         14
    1268: iconst_0
    1269: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1274: checkcast     #105                // class java/lang/Number
    1277: invokevirtual #109                // Method java/lang/Number.intValue:()I
    1280: iadd
    1281: aload         12
    1283: iconst_1
    1284: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1289: checkcast     #105                // class java/lang/Number
    1292: invokevirtual #109                // Method java/lang/Number.intValue:()I
    1295: aload         14
    1297: iconst_1
    1298: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1303: checkcast     #105                // class java/lang/Number
    1306: invokevirtual #109                // Method java/lang/Number.intValue:()I
    1309: iadd
    1310: invokespecial #139                // Method Point."<init>":(II)V
    1313: invokestatic  #145                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
    1316: invokestatic  #145                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
    1319: aload         25
    1321: swap
    1322: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1327: pop
    1328: goto          860
    1331: aload         6
    1333: checkcast     #70                 // class java/util/List
    1336: nop
    1337: astore_2
    1338: aload_2
    1339: checkcast     #42                 // class java/lang/Iterable
    1342: astore_3
    1343: iconst_0
    1344: istore        4
    1346: aload_3
    1347: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1352: astore        5
    1354: aload         5
    1356: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1361: ifeq          1555
    1364: aload         5
    1366: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1371: astore        6
    1373: aload         6
    1375: checkcast     #147                // class kotlin/Pair
    1378: astore        7
    1380: iconst_0
    1381: istore        8
    1383: aload_2
    1384: checkcast     #42                 // class java/lang/Iterable
    1387: astore        9
    1389: iconst_0
    1390: istore        10
    1392: aload         9
    1394: instanceof    #93                 // class java/util/Collection
    1397: ifeq          1417
    1400: aload         9
    1402: checkcast     #93                 // class java/util/Collection
    1405: invokeinterface #150,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
    1410: ifeq          1417
    1413: iconst_1
    1414: goto          1546
    1417: aload         9
    1419: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1424: astore        11
    1426: aload         11
    1428: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1433: ifeq          1545
    1436: aload         11
    1438: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1443: astore        12
    1445: aload         12
    1447: checkcast     #147                // class kotlin/Pair
    1450: astore        13
    1452: iconst_0
    1453: istore        14
    1455: aload         7
    1457: invokevirtual #153                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1460: aload         13
    1462: invokevirtual #153                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1465: invokestatic  #159                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
    1468: ifne          1533
    1471: aload         7
    1473: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1476: checkcast     #147                // class kotlin/Pair
    1479: invokevirtual #153                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1482: checkcast     #136                // class Point
    1485: aload         7
    1487: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1490: checkcast     #147                // class kotlin/Pair
    1493: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1496: checkcast     #136                // class Point
    1499: aload         13
    1501: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1504: checkcast     #147                // class kotlin/Pair
    1507: invokevirtual #153                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1510: checkcast     #136                // class Point
    1513: aload         13
    1515: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1518: checkcast     #147                // class kotlin/Pair
    1521: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1524: checkcast     #136                // class Point
    1527: invokestatic  #166                // Method doNotOverlap:(LPoint;LPoint;LPoint;LPoint;)Z
    1530: ifeq          1537
    1533: iconst_1
    1534: goto          1538
    1537: iconst_0
    1538: ifne          1426
    1541: iconst_0
    1542: goto          1546
    1545: iconst_1
    1546: nop
    1547: ifeq          1354
    1550: aload         6
    1552: goto          1565
    1555: new           #168                // class java/util/NoSuchElementException
    1558: dup
    1559: ldc           #170                // String Collection contains no element matching the predicate.
    1561: invokespecial #171                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
    1564: athrow
    1565: checkcast     #147                // class kotlin/Pair
    1568: invokevirtual #153                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1571: astore_3
    1572: getstatic     #129                // Field java/lang/System.out:Ljava/io/PrintStream;
    1575: aload_3
    1576: invokevirtual #174                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1579: return

  public static final boolean doNotOverlap(Point, Point, Point, Point);
    Code:
       0: aload_0
       1: ldc           #228                // String l1
       3: invokestatic  #232                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #234                // String r1
       9: invokestatic  #232                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_2
      13: ldc           #236                // String l2
      15: invokestatic  #232                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: aload_3
      19: ldc           #238                // String r2
      21: invokestatic  #232                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      24: aload_0
      25: invokevirtual #241                // Method Point.getX:()I
      28: aload_3
      29: invokevirtual #241                // Method Point.getX:()I
      32: if_icmpge     68
      35: aload_2
      36: invokevirtual #241                // Method Point.getX:()I
      39: aload_1
      40: invokevirtual #241                // Method Point.getX:()I
      43: if_icmpge     68
      46: aload_0
      47: invokevirtual #244                // Method Point.getY:()I
      50: aload_3
      51: invokevirtual #244                // Method Point.getY:()I
      54: if_icmpge     68
      57: aload_2
      58: invokevirtual #244                // Method Point.getY:()I
      61: aload_1
      62: invokevirtual #244                // Method Point.getY:()I
      65: if_icmplt     72
      68: iconst_1
      69: goto          73
      72: iconst_0
      73: ireturn

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


import java.io.File
import java.util.stream.IntStream

import java.util.concurrent.atomic.AtomicInteger

data class Observation (val label: String , val Pixels: IntArray)

typealias Distance = (IntArray, IntArray) -> Int
typealias Classifier = (IntArray) -> String
typealias Observations = Array<Observation>

fun observationData(csvData: String) : Observation
{
  val columns = csvData.split(',')
  val label = columns[0]
  val pixels = columns.subList(1, columns.lastIndex).map(String::toInt)

  return Observation(label, pixels.toIntArray())
}

fun reader(path: String) : Array<Observation>
{
  val observations = File(path).useLines { lines ->
      lines.drop(1).map(::observationData).toList().toTypedArray() }

  return observations
}

val manhattanDistance = { pixels1: IntArray, pixels2: IntArray ->   // Using zip and map
  val dist = pixels1.zip(pixels2)
      .map { p -> Math.abs(p.first - p.second) }
      .sum()
  dist
}

val manhattanDistanceImperative = fun(pixels1: IntArray, pixels2: IntArray) : Int
{
  var dist = 0

  for (i in 0 until pixels1.size)
    dist += Math.abs(pixels1[i] - pixels2[i])

  return dist
}

val euclideanDistance = { pixels1: IntArray, pixels2: IntArray ->
    val dist = pixels1.zip(pixels2)
//      .map { p -> Math.pow((p.first - p.second).toDouble(), 2.0) }
      .map({ p -> val dist = (p.first - p.second); dist * dist })
      .sum()
  dist
}

val euclideanDistanceImperative = fun(pixels1: IntArray, pixels2: IntArray) : Int
{
  var dist = 0

  for (i in 0 until pixels1.size)
  {
    val dif = Math.abs(pixels1[i] - pixels2[i])
    dist += dif * dif
  }

  return dist
}

fun classify(trainingSet: Array<Observation>, dist: Distance, pixels: IntArray) : String
{
  val observation =  trainingSet.minBy { (_, Pixels) -> dist(Pixels, pixels) }
  return observation!!.label
}

fun evaluate(validationSet: Array<Observation>, classifier: (IntArray) -> String) : Unit
{
//  val average = validationSet
//      .map({ (label, Pixels) -> if (classifier(Pixels) == label) 1.0 else 0.0 })
//      .average()
//  println("Correct: $average")
//}
    val count = validationSet.size
    val sum = AtomicInteger(0)

    IntStream.range(0, validationSet.size).parallel().forEach { i ->
      if (classifier(validationSet[i].Pixels) == validationSet[i].label)
        sum.addAndGet(1)
    }

    println("Correct:  ${sum.toDouble() / count}")
  }

//-----------------------------------------------------------------------------------------

fun main(args: Array<String>)
{
  val trainingPath = "./Data/trainingsample.csv"
  val trainingData = reader(trainingPath)

  val validationPath = "./Data/validationsample.csv"
  val validationData = reader(validationPath)

  val manhattanClassifier = fun(pixels: IntArray) : String
  {
    return classify(trainingData, manhattanDistanceImperative, pixels)
  }

  val euclideanClassifier = fun(pixels: IntArray) : String
  {
    return classify(trainingData, euclideanDistanceImperative, pixels)
  }

  run {
    val startTime = System.currentTimeMillis()

    println("  Manhattan Kotlin")
    evaluate(validationData, manhattanClassifier)

    val endTime = System.currentTimeMillis()
    val elapsedTime = (endTime - startTime) / 1000.0

    println(">>> Elapsed time is: $elapsedTime sec")
  }

  run {
    val startTime = System.currentTimeMillis()

    println("  Euclidean Kotlin")
    evaluate(validationData, euclideanClassifier)

    val endTime = System.currentTimeMillis()
    val elapsedTime = (endTime - startTime) / 1000.0

    println(">>> Elapsed time is: $elapsedTime sec")
  }
}

Compiled from "DigitsRecognizer.kt"
public final class DigitsRecognizerKt {
  private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> manhattanDistance;

  private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> manhattanDistanceImperative;

  private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> euclideanDistance;

  private static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> euclideanDistanceImperative;

  public static final Observation observationData(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #9                  // String csvData
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #17                 // class java/lang/CharSequence
      10: iconst_1
      11: newarray       char
      13: astore_2
      14: aload_2
      15: iconst_0
      16: bipush        44
      18: castore
      19: aload_2
      20: iconst_0
      21: iconst_0
      22: bipush        6
      24: aconst_null
      25: invokestatic  #23                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;
      28: astore_1
      29: aload_1
      30: iconst_0
      31: invokeinterface #29,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      36: checkcast     #31                 // class java/lang/String
      39: astore_2
      40: aload_1
      41: iconst_1
      42: aload_1
      43: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I
      46: invokeinterface #41,  3           // InterfaceMethod java/util/List.subList:(II)Ljava/util/List;
      51: checkcast     #43                 // class java/lang/Iterable
      54: astore        4
      56: iconst_0
      57: istore        5
      59: aload         4
      61: astore        6
      63: new           #45                 // class java/util/ArrayList
      66: dup
      67: aload         4
      69: bipush        10
      71: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      74: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      77: checkcast     #55                 // class java/util/Collection
      80: astore        7
      82: iconst_0
      83: istore        8
      85: aload         6
      87: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      92: astore        9
      94: aload         9
      96: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     101: ifeq          148
     104: aload         9
     106: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     111: astore        10
     113: aload         7
     115: aload         10
     117: checkcast     #31                 // class java/lang/String
     120: astore        11
     122: astore        13
     124: iconst_0
     125: istore        12
     127: aload         11
     129: invokestatic  #75                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     132: nop
     133: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     136: aload         13
     138: swap
     139: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     144: pop
     145: goto          94
     148: aload         7
     150: checkcast     #25                 // class java/util/List
     153: nop
     154: astore_3
     155: new           #85                 // class Observation
     158: dup
     159: aload_2
     160: aload_3
     161: checkcast     #55                 // class java/util/Collection
     164: invokestatic  #89                 // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I
     167: invokespecial #92                 // Method Observation."<init>":(Ljava/lang/String;[I)V
     170: areturn

  public static final Observation[] reader(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #115                // String path
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #117                // class java/io/File
       9: dup
      10: aload_0
      11: invokespecial #120                // Method java/io/File."<init>":(Ljava/lang/String;)V
      14: astore_2
      15: getstatic     #126                // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      18: astore_3
      19: iconst_0
      20: istore        4
      22: aload_2
      23: astore        5
      25: sipush        8192
      28: istore        6
      30: aload         5
      32: astore        7
      34: new           #128                // class java/io/InputStreamReader
      37: dup
      38: new           #130                // class java/io/FileInputStream
      41: dup
      42: aload         7
      44: invokespecial #133                // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      47: checkcast     #135                // class java/io/InputStream
      50: aload_3
      51: invokespecial #138                // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      54: checkcast     #140                // class java/io/Reader
      57: astore        7
      59: aload         7
      61: instanceof    #142                // class java/io/BufferedReader
      64: ifeq          75
      67: aload         7
      69: checkcast     #142                // class java/io/BufferedReader
      72: goto          86
      75: new           #142                // class java/io/BufferedReader
      78: dup
      79: aload         7
      81: iload         6
      83: invokespecial #145                // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      86: checkcast     #147                // class java/io/Closeable
      89: astore        5
      91: aconst_null
      92: astore        6
      94: nop
      95: aload         5
      97: checkcast     #142                // class java/io/BufferedReader
     100: astore        7
     102: iconst_0
     103: istore        8
     105: aload         7
     107: invokestatic  #153                // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     110: astore        9
     112: iconst_0
     113: istore        10
     115: aload         9
     117: iconst_1
     118: invokestatic  #159                // Method kotlin/sequences/SequencesKt.drop:(Lkotlin/sequences/Sequence;I)Lkotlin/sequences/Sequence;
     121: getstatic     #165                // Field DigitsRecognizerKt$reader$observations$1$1.INSTANCE:LDigitsRecognizerKt$reader$observations$1$1;
     124: checkcast     #167                // class kotlin/jvm/functions/Function1
     127: invokestatic  #171                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     130: invokestatic  #175                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     133: checkcast     #55                 // class java/util/Collection
     136: astore        11
     138: iconst_0
     139: istore        12
     141: aload         11
     143: astore        13
     145: aload         13
     147: iconst_0
     148: anewarray     #85                 // class Observation
     151: invokeinterface #179,  2          // InterfaceMethod java/util/Collection.toArray:([Ljava/lang/Object;)[Ljava/lang/Object;
     156: checkcast     #181                // class "[LObservation;"
     159: nop
     160: astore        7
     162: aload         5
     164: aload         6
     166: invokestatic  #187                // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     169: aload         7
     171: goto          195
     174: astore        8
     176: aload         8
     178: astore        6
     180: aload         8
     182: athrow
     183: astore        8
     185: aload         5
     187: aload         6
     189: invokestatic  #187                // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     192: aload         8
     194: athrow
     195: nop
     196: astore_1
     197: aload_1
     198: areturn
    Exception table:
       from    to  target type
          94   162   174   Class java/lang/Throwable
          94   162   183   any
         174   183   183   any
         183   185   183   any

  public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getManhattanDistance();
    Code:
       0: getstatic     #212                // Field manhattanDistance:Lkotlin/jvm/functions/Function2;
       3: areturn

  public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getManhattanDistanceImperative();
    Code:
       0: getstatic     #216                // Field manhattanDistanceImperative:Lkotlin/jvm/functions/Function2;
       3: areturn

  public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getEuclideanDistance();
    Code:
       0: getstatic     #220                // Field euclideanDistance:Lkotlin/jvm/functions/Function2;
       3: areturn

  public static final kotlin.jvm.functions.Function2<int[], int[], java.lang.Integer> getEuclideanDistanceImperative();
    Code:
       0: getstatic     #224                // Field euclideanDistanceImperative:Lkotlin/jvm/functions/Function2;
       3: areturn

  public static final java.lang.String classify(Observation[], kotlin.jvm.functions.Function2<? super int[], ? super int[], java.lang.Integer>, int[]);
    Code:
       0: aload_0
       1: ldc           #229                // String trainingSet
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #231                // String dist
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_2
      13: ldc           #232                // String pixels
      15: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: aload_0
      19: astore        4
      21: iconst_0
      22: istore        5
      24: aload         4
      26: arraylength
      27: ifne          34
      30: iconst_1
      31: goto          35
      34: iconst_0
      35: ifeq          46
      38: new           #234                // class java/util/NoSuchElementException
      41: dup
      42: invokespecial #237                // Method java/util/NoSuchElementException."<init>":()V
      45: athrow
      46: aload         4
      48: iconst_0
      49: aaload
      50: astore        6
      52: aload         4
      54: invokestatic  #242                // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I
      57: istore        7
      59: iload         7
      61: ifne          69
      64: aload         6
      66: goto          178
      69: aload         6
      71: astore        8
      73: iconst_0
      74: istore        9
      76: aload         8
      78: invokevirtual #246                // Method Observation.component2:()[I
      81: astore        10
      83: aload_1
      84: aload         10
      86: aload_2
      87: invokeinterface #252,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      92: checkcast     #254                // class java/lang/Number
      95: invokevirtual #258                // Method java/lang/Number.intValue:()I
      98: istore        8
     100: iconst_1
     101: istore        9
     103: iload         9
     105: iload         7
     107: if_icmpgt     176
     110: aload         4
     112: iload         9
     114: aaload
     115: astore        10
     117: aload         10
     119: astore        11
     121: iconst_0
     122: istore        12
     124: aload         11
     126: invokevirtual #246                // Method Observation.component2:()[I
     129: astore        13
     131: aload_1
     132: aload         13
     134: aload_2
     135: invokeinterface #252,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     140: checkcast     #254                // class java/lang/Number
     143: invokevirtual #258                // Method java/lang/Number.intValue:()I
     146: istore        11
     148: iload         8
     150: iload         11
     152: if_icmple     163
     155: aload         10
     157: astore        6
     159: iload         11
     161: istore        8
     163: iload         9
     165: iload         7
     167: if_icmpeq     176
     170: iinc          9, 1
     173: goto          110
     176: aload         6
     178: astore_3
     179: aload_3
     180: dup
     181: invokestatic  #262                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     184: invokevirtual #266                // Method Observation.getLabel:()Ljava/lang/String;
     187: areturn

  public static final void evaluate(Observation[], kotlin.jvm.functions.Function1<? super int[], java.lang.String>);
    Code:
       0: aload_0
       1: ldc_w         #286                // String validationSet
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: ldc_w         #288                // String classifier
      11: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: aload_0
      15: arraylength
      16: istore_2
      17: new           #290                // class java/util/concurrent/atomic/AtomicInteger
      20: dup
      21: iconst_0
      22: invokespecial #291                // Method java/util/concurrent/atomic/AtomicInteger."<init>":(I)V
      25: astore_3
      26: iconst_0
      27: aload_0
      28: arraylength
      29: invokestatic  #297                // InterfaceMethod java/util/stream/IntStream.range:(II)Ljava/util/stream/IntStream;
      32: invokeinterface #301,  1          // InterfaceMethod java/util/stream/IntStream.parallel:()Ljava/util/stream/IntStream;
      37: aload_1
      38: aload_0
      39: aload_3
      40: invokedynamic #318,  0            // InvokeDynamic #0:accept:(Lkotlin/jvm/functions/Function1;[LObservation;Ljava/util/concurrent/atomic/AtomicInteger;)Ljava/util/function/IntConsumer;
      45: invokeinterface #322,  2          // InterfaceMethod java/util/stream/IntStream.forEach:(Ljava/util/function/IntConsumer;)V
      50: new           #324                // class java/lang/StringBuilder
      53: dup
      54: invokespecial #325                // Method java/lang/StringBuilder."<init>":()V
      57: ldc_w         #327                // String Correct:
      60: invokevirtual #331                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      63: aload_3
      64: invokevirtual #335                // Method java/util/concurrent/atomic/AtomicInteger.doubleValue:()D
      67: iload_2
      68: i2d
      69: ddiv
      70: invokevirtual #338                // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
      73: invokevirtual #341                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      76: getstatic     #347                // Field java/lang/System.out:Ljava/io/PrintStream;
      79: swap
      80: invokevirtual #352                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      83: return

  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc_w         #360                // String args
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: ldc_w         #362                // String ./Data/trainingsample.csv
      10: astore_1
      11: aload_1
      12: invokestatic  #364                // Method reader:(Ljava/lang/String;)[LObservation;
      15: astore_2
      16: ldc_w         #366                // String ./Data/validationsample.csv
      19: astore_3
      20: aload_3
      21: invokestatic  #364                // Method reader:(Ljava/lang/String;)[LObservation;
      24: astore        4
      26: aload_2
      27: invokedynamic #378,  0            // InvokeDynamic #1:invoke:([LObservation;)Lkotlin/jvm/functions/Function1;
      32: astore        5
      34: aload_2
      35: invokedynamic #383,  0            // InvokeDynamic #2:invoke:([LObservation;)Lkotlin/jvm/functions/Function1;
      40: astore        6
      42: iconst_0
      43: istore        7
      45: invokestatic  #387                // Method java/lang/System.currentTimeMillis:()J
      48: lstore        8
      50: ldc_w         #389                // String   Manhattan Kotlin
      53: getstatic     #347                // Field java/lang/System.out:Ljava/io/PrintStream;
      56: swap
      57: invokevirtual #352                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      60: aload         4
      62: aload         5
      64: invokestatic  #391                // Method evaluate:([LObservation;Lkotlin/jvm/functions/Function1;)V
      67: invokestatic  #387                // Method java/lang/System.currentTimeMillis:()J
      70: lstore        10
      72: lload         10
      74: lload         8
      76: lsub
      77: l2d
      78: ldc2_w        #392                // double 1000.0d
      81: ddiv
      82: dstore        12
      84: new           #324                // class java/lang/StringBuilder
      87: dup
      88: invokespecial #325                // Method java/lang/StringBuilder."<init>":()V
      91: ldc_w         #395                // String >>> Elapsed time is:
      94: invokevirtual #331                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      97: dload         12
      99: invokevirtual #338                // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
     102: ldc_w         #397                // String  sec
     105: invokevirtual #331                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     108: invokevirtual #341                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     111: getstatic     #347                // Field java/lang/System.out:Ljava/io/PrintStream;
     114: swap
     115: invokevirtual #352                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     118: nop
     119: nop
     120: iconst_0
     121: istore        7
     123: invokestatic  #387                // Method java/lang/System.currentTimeMillis:()J
     126: lstore        8
     128: ldc_w         #399                // String   Euclidean Kotlin
     131: getstatic     #347                // Field java/lang/System.out:Ljava/io/PrintStream;
     134: swap
     135: invokevirtual #352                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     138: aload         4
     140: aload         6
     142: invokestatic  #391                // Method evaluate:([LObservation;Lkotlin/jvm/functions/Function1;)V
     145: invokestatic  #387                // Method java/lang/System.currentTimeMillis:()J
     148: lstore        10
     150: lload         10
     152: lload         8
     154: lsub
     155: l2d
     156: ldc2_w        #392                // double 1000.0d
     159: ddiv
     160: dstore        12
     162: new           #324                // class java/lang/StringBuilder
     165: dup
     166: invokespecial #325                // Method java/lang/StringBuilder."<init>":()V
     169: ldc_w         #395                // String >>> Elapsed time is:
     172: invokevirtual #331                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     175: dload         12
     177: invokevirtual #338                // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
     180: ldc_w         #397                // String  sec
     183: invokevirtual #331                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     186: invokevirtual #341                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     189: getstatic     #347                // Field java/lang/System.out:Ljava/io/PrintStream;
     192: swap
     193: invokevirtual #352                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     196: nop
     197: nop
     198: return

  private static final int manhattanDistance$lambda$2(int[], int[]);
    Code:
       0: aload_0
       1: ldc_w         #417                // String pixels1
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: ldc_w         #419                // String pixels2
      11: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: aload_0
      15: aload_1
      16: invokestatic  #423                // Method kotlin/collections/ArraysKt.zip:([I[I)Ljava/util/List;
      19: checkcast     #43                 // class java/lang/Iterable
      22: astore_3
      23: nop
      24: iconst_0
      25: istore        4
      27: aload_3
      28: astore        5
      30: new           #45                 // class java/util/ArrayList
      33: dup
      34: aload_3
      35: bipush        10
      37: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      40: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      43: checkcast     #55                 // class java/util/Collection
      46: astore        6
      48: iconst_0
      49: istore        7
      51: aload         5
      53: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      58: astore        8
      60: aload         8
      62: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      67: ifeq          134
      70: aload         8
      72: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      77: astore        9
      79: aload         6
      81: aload         9
      83: checkcast     #425                // class kotlin/Pair
      86: astore        10
      88: astore        12
      90: iconst_0
      91: istore        11
      93: aload         10
      95: invokevirtual #428                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      98: checkcast     #254                // class java/lang/Number
     101: invokevirtual #258                // Method java/lang/Number.intValue:()I
     104: aload         10
     106: invokevirtual #431                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     109: checkcast     #254                // class java/lang/Number
     112: invokevirtual #258                // Method java/lang/Number.intValue:()I
     115: isub
     116: invokestatic  #437                // Method java/lang/Math.abs:(I)I
     119: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     122: aload         12
     124: swap
     125: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     130: pop
     131: goto          60
     134: aload         6
     136: checkcast     #25                 // class java/util/List
     139: nop
     140: checkcast     #43                 // class java/lang/Iterable
     143: invokestatic  #441                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     146: istore_2
     147: iload_2
     148: ireturn

  private static final int manhattanDistanceImperative$lambda$3(int[], int[]);
    Code:
       0: iconst_0
       1: istore_2
       2: iconst_0
       3: istore_3
       4: aload_0
       5: arraylength
       6: istore        4
       8: iload_3
       9: iload         4
      11: if_icmpge     33
      14: iload_2
      15: aload_0
      16: iload_3
      17: iaload
      18: aload_1
      19: iload_3
      20: iaload
      21: isub
      22: invokestatic  #437                // Method java/lang/Math.abs:(I)I
      25: iadd
      26: istore_2
      27: iinc          3, 1
      30: goto          8
      33: iload_2
      34: ireturn

  private static final int euclideanDistance$lambda$5(int[], int[]);
    Code:
       0: aload_0
       1: ldc_w         #417                // String pixels1
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: ldc_w         #419                // String pixels2
      11: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: aload_0
      15: aload_1
      16: invokestatic  #423                // Method kotlin/collections/ArraysKt.zip:([I[I)Ljava/util/List;
      19: checkcast     #43                 // class java/lang/Iterable
      22: astore_3
      23: nop
      24: iconst_0
      25: istore        4
      27: aload_3
      28: astore        5
      30: new           #45                 // class java/util/ArrayList
      33: dup
      34: aload_3
      35: bipush        10
      37: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      40: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      43: checkcast     #55                 // class java/util/Collection
      46: astore        6
      48: iconst_0
      49: istore        7
      51: aload         5
      53: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      58: astore        8
      60: aload         8
      62: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      67: ifeq          138
      70: aload         8
      72: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      77: astore        9
      79: aload         6
      81: aload         9
      83: checkcast     #425                // class kotlin/Pair
      86: astore        10
      88: astore        13
      90: iconst_0
      91: istore        11
      93: aload         10
      95: invokevirtual #428                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      98: checkcast     #254                // class java/lang/Number
     101: invokevirtual #258                // Method java/lang/Number.intValue:()I
     104: aload         10
     106: invokevirtual #431                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     109: checkcast     #254                // class java/lang/Number
     112: invokevirtual #258                // Method java/lang/Number.intValue:()I
     115: isub
     116: istore        12
     118: iload         12
     120: iload         12
     122: imul
     123: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     126: aload         13
     128: swap
     129: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     134: pop
     135: goto          60
     138: aload         6
     140: checkcast     #25                 // class java/util/List
     143: nop
     144: checkcast     #43                 // class java/lang/Iterable
     147: invokestatic  #441                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     150: istore_2
     151: iload_2
     152: ireturn

  private static final int euclideanDistanceImperative$lambda$6(int[], int[]);
    Code:
       0: iconst_0
       1: istore_2
       2: iconst_0
       3: istore_3
       4: aload_0
       5: arraylength
       6: istore        4
       8: iload_3
       9: iload         4
      11: if_icmpge     40
      14: aload_0
      15: iload_3
      16: iaload
      17: aload_1
      18: iload_3
      19: iaload
      20: isub
      21: invokestatic  #437                // Method java/lang/Math.abs:(I)I
      24: istore        5
      26: iload_2
      27: iload         5
      29: iload         5
      31: imul
      32: iadd
      33: istore_2
      34: iinc          3, 1
      37: goto          8
      40: iload_2
      41: ireturn

  private static final void evaluate$lambda$8(kotlin.jvm.functions.Function1, Observation[], java.util.concurrent.atomic.AtomicInteger, int);
    Code:
       0: aload_0
       1: aload_1
       2: iload_3
       3: aaload
       4: invokevirtual #453                // Method Observation.getPixels:()[I
       7: invokeinterface #455,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      12: aload_1
      13: iload_3
      14: aaload
      15: invokevirtual #266                // Method Observation.getLabel:()Ljava/lang/String;
      18: invokestatic  #459                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      21: ifeq          30
      24: aload_2
      25: iconst_1
      26: invokevirtual #462                // Method java/util/concurrent/atomic/AtomicInteger.addAndGet:(I)I
      29: pop
      30: return

  private static final java.lang.String main$lambda$9(Observation[], int[]);
    Code:
       0: aload_0
       1: getstatic     #216                // Field manhattanDistanceImperative:Lkotlin/jvm/functions/Function2;
       4: aload_1
       5: invokestatic  #467                // Method classify:([LObservation;Lkotlin/jvm/functions/Function2;[I)Ljava/lang/String;
       8: areturn

  private static final java.lang.String main$lambda$10(Observation[], int[]);
    Code:
       0: aload_0
       1: getstatic     #224                // Field euclideanDistanceImperative:Lkotlin/jvm/functions/Function2;
       4: aload_1
       5: invokestatic  #467                // Method classify:([LObservation;Lkotlin/jvm/functions/Function2;[I)Ljava/lang/String;
       8: areturn

  static {};
    Code:
       0: invokedynamic #476,  0            // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function2;
       5: putstatic     #212                // Field manhattanDistance:Lkotlin/jvm/functions/Function2;
       8: invokedynamic #480,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function2;
      13: putstatic     #216                // Field manhattanDistanceImperative:Lkotlin/jvm/functions/Function2;
      16: invokedynamic #484,  0            // InvokeDynamic #5:invoke:()Lkotlin/jvm/functions/Function2;
      21: putstatic     #220                // Field euclideanDistance:Lkotlin/jvm/functions/Function2;
      24: invokedynamic #488,  0            // InvokeDynamic #6:invoke:()Lkotlin/jvm/functions/Function2;
      29: putstatic     #224                // Field euclideanDistanceImperative:Lkotlin/jvm/functions/Function2;
      32: return
}

Compiled from "DigitsRecognizer.kt"
final class DigitsRecognizerKt$reader$observations$1$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.lang.String, Observation> {
  public static final DigitsRecognizerKt$reader$observations$1$1 INSTANCE;

  DigitsRecognizerKt$reader$observations$1$1();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class DigitsRecognizerKt
       4: ldc           #13                 // String observationData
       6: ldc           #15                 // String observationData(Ljava/lang/String;)LObservation;
       8: iconst_1
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final Observation invoke(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #32                 // Method DigitsRecognizerKt.observationData:(Ljava/lang/String;)LObservation;
      10: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #36                 // class java/lang/String
       5: invokevirtual #38                 // Method invoke:(Ljava/lang/String;)LObservation;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class DigitsRecognizerKt$reader$observations$1$1
       3: dup
       4: invokespecial #43                 // Method "<init>":()V
       7: putstatic     #46                 // Field INSTANCE:LDigitsRecognizerKt$reader$observations$1$1;
      10: return
}


import java.util.*

fun main(args: Array<String>) {

    val input: StringBuilder = StringBuilder("10.3 + -2")
    val queueNumbers: Queue<Double> = LinkedList<Double>()
    val queueActions: Queue<Char> = LinkedList<Char>()
    println('\"' + input.toString() + '\"')
    prepareIn(input, queueNumbers, queueActions)
    calculateIn(queueNumbers, queueActions)
}

fun prepareIn(input: StringBuilder, queueNumbers: Queue<Double>, queueActions: Queue<Char>) {

    var numDetected = false
    var startIndex = 0
    val trimmedIn = input.filter { !it.isWhitespace() }

    for (i in 0..trimmedIn.lastIndex) {
        when {
            trimmedIn[i].isDigit() && !numDetected -> {
                startIndex = i
                numDetected = true
            }
            !trimmedIn[i].isDigit() && numDetected && trimmedIn[i] != '.' -> {
                queueNumbers.add(trimmedIn.substring(startIndex, i).toDouble())
                queueActions.add(trimmedIn[i])
                numDetected = false
            }
            !trimmedIn[i].isDigit() && !numDetected && trimmedIn[i] == '-' -> {
                startIndex = i
                numDetected = true
            }
        }
    }
    if (numDetected) {
        queueNumbers.add(trimmedIn.substring(startIndex..trimmedIn.lastIndex).toDouble())
    }
    println(queueNumbers)
    println(queueActions)
}

fun calculateIn(queueNumbers: Queue<Double>, queueActions: Queue<Char>) {
    var action: Char
    var result = queueNumbers.poll()
    var operand: Double

    while (!queueNumbers.isEmpty()) {
        operand = queueNumbers.poll()
        action = queueActions.poll()
        when (action) {
            '-' -> result -= operand
            '+' -> result += operand
            '*' -> result *= operand
            '/' -> result /= operand
            '%' -> result = result % operand * -1.0
        }
    }
    var pointNum = 8.3

    println("pointNum = " + pointNum)
    println(if(pointNum.compareTo(pointNum.toInt()) == 0) pointNum.toInt() else pointNum)

    println("result = " + result)
    println(if(result.compareTo(result.toInt()) == 0) result.toInt() else result)
}

Compiled from "Main.kt"
public final class MainKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #17                 // class java/lang/StringBuilder
       9: dup
      10: ldc           #19                 // String 10.3 + -2
      12: invokespecial #23                 // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
      15: astore_1
      16: new           #25                 // class java/util/LinkedList
      19: dup
      20: invokespecial #28                 // Method java/util/LinkedList."<init>":()V
      23: checkcast     #30                 // class java/util/Queue
      26: astore_2
      27: new           #25                 // class java/util/LinkedList
      30: dup
      31: invokespecial #28                 // Method java/util/LinkedList."<init>":()V
      34: checkcast     #30                 // class java/util/Queue
      37: astore_3
      38: new           #17                 // class java/lang/StringBuilder
      41: dup
      42: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
      45: bipush        34
      47: istore        4
      49: aload_1
      50: invokevirtual #35                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      53: dup
      54: ldc           #37                 // String toString(...)
      56: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      59: astore        5
      61: new           #17                 // class java/lang/StringBuilder
      64: dup
      65: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
      68: iload         4
      70: invokevirtual #44                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      73: aload         5
      75: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      78: invokevirtual #35                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      81: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      84: bipush        34
      86: invokevirtual #44                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      89: invokevirtual #35                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      92: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
      95: swap
      96: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      99: aload_1
     100: aload_2
     101: aload_3
     102: invokestatic  #63                 // Method prepareIn:(Ljava/lang/StringBuilder;Ljava/util/Queue;Ljava/util/Queue;)V
     105: aload_2
     106: aload_3
     107: invokestatic  #67                 // Method calculateIn:(Ljava/util/Queue;Ljava/util/Queue;)V
     110: return

  public static final void prepareIn(java.lang.StringBuilder, java.util.Queue<java.lang.Double>, java.util.Queue<java.lang.Character>);
    Code:
       0: aload_0
       1: ldc           #75                 // String input
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #76                 // String queueNumbers
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_2
      13: ldc           #77                 // String queueActions
      15: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: iconst_0
      19: istore_3
      20: iconst_0
      21: istore        4
      23: aload_0
      24: checkcast     #79                 // class java/lang/CharSequence
      27: astore        6
      29: iconst_0
      30: istore        7
      32: aload         6
      34: astore        8
      36: new           #17                 // class java/lang/StringBuilder
      39: dup
      40: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
      43: checkcast     #81                 // class java/lang/Appendable
      46: astore        9
      48: iconst_0
      49: istore        10
      51: iconst_0
      52: istore        11
      54: aload         8
      56: invokeinterface #85,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      61: istore        12
      63: iload         11
      65: iload         12
      67: if_icmpge     120
      70: aload         8
      72: iload         11
      74: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      79: istore        13
      81: iload         13
      83: istore        14
      85: iconst_0
      86: istore        15
      88: iload         14
      90: invokestatic  #95                 // Method kotlin/text/CharsKt.isWhitespace:(C)Z
      93: ifne          100
      96: iconst_1
      97: goto          101
     100: iconst_0
     101: ifeq          114
     104: aload         9
     106: iload         13
     108: invokeinterface #98,  2           // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
     113: pop
     114: iinc          11, 1
     117: goto          63
     120: aload         9
     122: checkcast     #79                 // class java/lang/CharSequence
     125: nop
     126: astore        5
     128: iconst_0
     129: istore        6
     131: aload         5
     133: invokestatic  #104                // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I
     136: istore        7
     138: iload         6
     140: iload         7
     142: if_icmpgt     310
     145: nop
     146: aload         5
     148: iload         6
     150: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     155: invokestatic  #109                // Method java/lang/Character.isDigit:(C)Z
     158: ifeq          174
     161: iload_3
     162: ifne          174
     165: iload         6
     167: istore        4
     169: iconst_1
     170: istore_3
     171: goto          297
     174: aload         5
     176: iload         6
     178: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     183: invokestatic  #109                // Method java/lang/Character.isDigit:(C)Z
     186: ifne          258
     189: iload_3
     190: ifeq          258
     193: aload         5
     195: iload         6
     197: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     202: bipush        46
     204: if_icmpeq     258
     207: aload_1
     208: aload         5
     210: iload         4
     212: iload         6
     214: invokeinterface #113,  3          // InterfaceMethod java/lang/CharSequence.subSequence:(II)Ljava/lang/CharSequence;
     219: invokevirtual #114                // Method java/lang/Object.toString:()Ljava/lang/String;
     222: invokestatic  #120                // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
     225: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     228: invokeinterface #128,  2          // InterfaceMethod java/util/Queue.add:(Ljava/lang/Object;)Z
     233: pop
     234: aload_2
     235: aload         5
     237: iload         6
     239: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     244: invokestatic  #131                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     247: invokeinterface #128,  2          // InterfaceMethod java/util/Queue.add:(Ljava/lang/Object;)Z
     252: pop
     253: iconst_0
     254: istore_3
     255: goto          297
     258: aload         5
     260: iload         6
     262: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     267: invokestatic  #109                // Method java/lang/Character.isDigit:(C)Z
     270: ifne          297
     273: iload_3
     274: ifne          297
     277: aload         5
     279: iload         6
     281: invokeinterface #89,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     286: bipush        45
     288: if_icmpne     297
     291: iload         6
     293: istore        4
     295: iconst_1
     296: istore_3
     297: iload         6
     299: iload         7
     301: if_icmpeq     310
     304: iinc          6, 1
     307: goto          145
     310: iload_3
     311: ifeq          346
     314: aload_1
     315: aload         5
     317: new           #133                // class kotlin/ranges/IntRange
     320: dup
     321: iload         4
     323: aload         5
     325: invokestatic  #104                // Method kotlin/text/StringsKt.getLastIndex:(Ljava/lang/CharSequence;)I
     328: invokespecial #136                // Method kotlin/ranges/IntRange."<init>":(II)V
     331: invokestatic  #140                // Method kotlin/text/StringsKt.substring:(Ljava/lang/CharSequence;Lkotlin/ranges/IntRange;)Ljava/lang/String;
     334: invokestatic  #120                // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
     337: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     340: invokeinterface #128,  2          // InterfaceMethod java/util/Queue.add:(Ljava/lang/Object;)Z
     345: pop
     346: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
     349: aload_1
     350: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     353: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
     356: aload_2
     357: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     360: return

  public static final void calculateIn(java.util.Queue<java.lang.Double>, java.util.Queue<java.lang.Character>);
    Code:
       0: aload_0
       1: ldc           #76                 // String queueNumbers
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #77                 // String queueActions
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_2
      14: aload_0
      15: invokeinterface #163,  1          // InterfaceMethod java/util/Queue.poll:()Ljava/lang/Object;
      20: checkcast     #116                // class java/lang/Double
      23: astore_3
      24: dconst_0
      25: dstore        4
      27: aload_0
      28: invokeinterface #167,  1          // InterfaceMethod java/util/Queue.isEmpty:()Z
      33: ifne          202
      36: aload_0
      37: invokeinterface #163,  1          // InterfaceMethod java/util/Queue.poll:()Ljava/lang/Object;
      42: dup
      43: ldc           #169                // String poll(...)
      45: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      48: checkcast     #171                // class java/lang/Number
      51: invokevirtual #175                // Method java/lang/Number.doubleValue:()D
      54: dstore        4
      56: aload_1
      57: invokeinterface #163,  1          // InterfaceMethod java/util/Queue.poll:()Ljava/lang/Object;
      62: dup
      63: ldc           #169                // String poll(...)
      65: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      68: checkcast     #106                // class java/lang/Character
      71: invokevirtual #179                // Method java/lang/Character.charValue:()C
      74: istore_2
      75: iload_2
      76: lookupswitch  { // 5
                    37: 184
                    42: 156
                    43: 142
                    45: 128
                    47: 170
               default: 199
          }
     128: aload_3
     129: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     132: dload         4
     134: dsub
     135: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     138: astore_3
     139: goto          27
     142: aload_3
     143: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     146: dload         4
     148: dadd
     149: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     152: astore_3
     153: goto          27
     156: aload_3
     157: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     160: dload         4
     162: dmul
     163: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     166: astore_3
     167: goto          27
     170: aload_3
     171: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     174: dload         4
     176: ddiv
     177: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     180: astore_3
     181: goto          27
     184: aload_3
     185: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     188: dload         4
     190: drem
     191: ldc2_w        #181                // double -1.0d
     194: dmul
     195: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     198: astore_3
     199: goto          27
     202: ldc2_w        #183                // double 8.3d
     205: dstore        6
     207: new           #17                 // class java/lang/StringBuilder
     210: dup
     211: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
     214: ldc           #186                // String pointNum =
     216: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     219: dload         6
     221: invokevirtual #189                // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
     224: invokevirtual #35                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     227: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
     230: swap
     231: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     234: dload         6
     236: dload         6
     238: d2i
     239: i2d
     240: invokestatic  #193                // Method java/lang/Double.compare:(DD)I
     243: ifne          255
     246: dload         6
     248: d2i
     249: invokestatic  #198                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     252: goto          260
     255: dload         6
     257: invokestatic  #124                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     260: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
     263: swap
     264: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     267: new           #17                 // class java/lang/StringBuilder
     270: dup
     271: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
     274: ldc           #200                // String result =
     276: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     279: aload_3
     280: invokevirtual #203                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     283: invokevirtual #35                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     286: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
     289: swap
     290: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     293: aload_3
     294: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     297: aload_3
     298: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     301: d2i
     302: i2d
     303: invokestatic  #193                // Method java/lang/Double.compare:(DD)I
     306: ifne          320
     309: aload_3
     310: invokevirtual #180                // Method java/lang/Double.doubleValue:()D
     313: d2i
     314: invokestatic  #198                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     317: goto          321
     320: aload_3
     321: getstatic     #53                 // Field java/lang/System.out:Ljava/io/PrintStream;
     324: swap
     325: invokevirtual #59                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     328: return
}