fun main(args: Array<String>) {
    println("Hello World!")

    val values = generateSequence(::readLine)
        .mapNotNull { line -> line.trim().takeUnless { trimmed -> trimmed.isBlank() } }
        .toList()
    values.forEach { println(it) }

    val bits = values.maxOf { it.length }

    val gamma = buildString {
        for (i in 0 until bits) {
            val mostCommon = if (values.countOnes(i) >= (values.size + 1) / 2) "1" else "0"
            append(mostCommon)
        }
    }

    println("gamma=$gamma")

    val epsilon = gamma.map { if (it == '0') '1' else '0' }.joinToString(separator = "")
    println("epsilon=$epsilon")

    println("power=${gamma.toInt(2) * epsilon.toInt(2)}")

    // oxygen generator rating
    val list1 = values.toMutableList()
    var oxygenGen: Int? = null
    for (i in 0 until bits) {
        val mostCommon = if (list1.countOnes(i) >= (list1.size + 1) / 2) "1" else "0"
        println("mostCommon[$i]=$mostCommon (ones=${list1.countOnes(i)} list size=${list1.size}}")
        list1.removeIf { it[i] != mostCommon[0] }
        if (list1.size <= 1) {
            println("oxygen generator: ${list1.firstOrNull()}")
            oxygenGen = list1.firstOrNull()?.toInt(2)
            break
        }
    }

    // CO2 scrubber rating
    val list2 = values.toMutableList()
    var scrubber: Int? = null
    for (i in 0 until bits) {
        val leastCommon = if (list2.countOnes(i) < (list2.size + 1) / 2) "1" else "0"
        list2.removeIf { it[i] != leastCommon[0] }
        if (list2.size <= 1) {
            println("scrubber first: ${list2.firstOrNull()}")
            scrubber = list2.firstOrNull()?.toInt(2)
            break
        }
    }

    println("oxygenGen=$oxygenGen co2scrubber=$scrubber multi=${oxygenGen?.times(scrubber ?: 0)}")
}

fun List<String>.countOnes(index: Int): Int = count { it[index] == "1"[0] }

Compiled from "Main.kt"
final class MainKt$main$values$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function0<java.lang.String> {
  public static final MainKt$main$values$1 INSTANCE;

  MainKt$main$values$1();
    Code:
       0: aload_0
       1: iconst_0
       2: ldc           #11                 // class kotlin/io/ConsoleKt
       4: ldc           #13                 // String readLine
       6: ldc           #15                 // String readLine()Ljava/lang/String;
       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 java.lang.String invoke();
    Code:
       0: invokestatic  #24                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: areturn

  public java.lang.Object invoke();
    Code:
       0: aload_0
       1: invokevirtual #27                 // Method invoke:()Ljava/lang/String;
       4: areturn

  static {};
    Code:
       0: new           #2                  // class MainKt$main$values$1
       3: dup
       4: invokespecial #30                 // Method "<init>":()V
       7: putstatic     #33                 // Field INSTANCE:LMainKt$main$values$1;
      10: return
}

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: ldc           #17                 // String Hello World!
       8: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: getstatic     #35                 // Field MainKt$main$values$1.INSTANCE:LMainKt$main$values$1;
      18: checkcast     #37                 // class kotlin/jvm/functions/Function0
      21: invokestatic  #43                 // Method kotlin/sequences/SequencesKt.generateSequence:(Lkotlin/jvm/functions/Function0;)Lkotlin/sequences/Sequence;
      24: invokedynamic #62,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      29: invokestatic  #66                 // Method kotlin/sequences/SequencesKt.mapNotNull:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      32: invokestatic  #70                 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      35: astore_1
      36: aload_1
      37: checkcast     #72                 // class java/lang/Iterable
      40: astore_2
      41: iconst_0
      42: istore_3
      43: aload_2
      44: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      49: astore        4
      51: aload         4
      53: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      58: ifeq          93
      61: aload         4
      63: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      68: astore        5
      70: aload         5
      72: checkcast     #88                 // class java/lang/String
      75: astore        6
      77: iconst_0
      78: istore        7
      80: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      83: aload         6
      85: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      88: nop
      89: nop
      90: goto          51
      93: nop
      94: aload_1
      95: checkcast     #72                 // class java/lang/Iterable
      98: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     103: astore        4
     105: aload         4
     107: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     112: ifne          123
     115: new           #90                 // class java/util/NoSuchElementException
     118: dup
     119: invokespecial #94                 // Method java/util/NoSuchElementException."<init>":()V
     122: athrow
     123: aload         4
     125: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     130: checkcast     #88                 // class java/lang/String
     133: astore        5
     135: iconst_0
     136: istore        6
     138: aload         5
     140: invokevirtual #98                 // Method java/lang/String.length:()I
     143: istore        5
     145: aload         4
     147: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     152: ifeq          191
     155: aload         4
     157: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     162: checkcast     #88                 // class java/lang/String
     165: astore        6
     167: iconst_0
     168: istore        7
     170: aload         6
     172: invokevirtual #98                 // Method java/lang/String.length:()I
     175: istore        6
     177: iload         5
     179: iload         6
     181: if_icmpge     145
     184: iload         6
     186: istore        5
     188: goto          145
     191: iload         5
     193: istore_2
     194: new           #100                // class java/lang/StringBuilder
     197: dup
     198: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     201: astore        4
     203: aload         4
     205: astore        5
     207: iconst_0
     208: istore        6
     210: iconst_0
     211: istore        7
     213: iload         7
     215: iload_2
     216: if_icmpge     261
     219: aload_1
     220: iload         7
     222: invokestatic  #105                // Method countOnes:(Ljava/util/List;I)I
     225: aload_1
     226: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     231: iconst_1
     232: iadd
     233: iconst_2
     234: idiv
     235: if_icmplt     243
     238: ldc           #112                // String 1
     240: goto          245
     243: ldc           #114                // String 0
     245: astore        8
     247: aload         5
     249: aload         8
     251: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     254: pop
     255: iinc          7, 1
     258: goto          213
     261: nop
     262: aload         4
     264: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     267: astore_3
     268: new           #100                // class java/lang/StringBuilder
     271: dup
     272: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     275: ldc           #124                // String gamma=
     277: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     280: aload_3
     281: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     284: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     287: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     290: swap
     291: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     294: aload_3
     295: checkcast     #126                // class java/lang/CharSequence
     298: astore        5
     300: iconst_0
     301: istore        6
     303: aload         5
     305: astore        7
     307: new           #128                // class java/util/ArrayList
     310: dup
     311: aload         5
     313: invokeinterface #129,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     318: invokespecial #132                // Method java/util/ArrayList."<init>":(I)V
     321: checkcast     #134                // class java/util/Collection
     324: astore        8
     326: iconst_0
     327: istore        9
     329: iconst_0
     330: istore        10
     332: iload         10
     334: aload         7
     336: invokeinterface #129,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     341: if_icmpge     398
     344: aload         7
     346: iload         10
     348: invokeinterface #138,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     353: istore        11
     355: aload         8
     357: iload         11
     359: istore        12
     361: astore        14
     363: iconst_0
     364: istore        13
     366: iload         12
     368: bipush        48
     370: if_icmpne     378
     373: bipush        49
     375: goto          380
     378: bipush        48
     380: invokestatic  #144                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     383: aload         14
     385: swap
     386: invokeinterface #148,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     391: pop
     392: iinc          10, 1
     395: goto          332
     398: aload         8
     400: checkcast     #107                // class java/util/List
     403: nop
     404: checkcast     #72                 // class java/lang/Iterable
     407: ldc           #150                // String
     409: checkcast     #126                // class java/lang/CharSequence
     412: aconst_null
     413: aconst_null
     414: iconst_0
     415: aconst_null
     416: aconst_null
     417: bipush        62
     419: aconst_null
     420: invokestatic  #156                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     423: astore        4
     425: new           #100                // class java/lang/StringBuilder
     428: dup
     429: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     432: ldc           #158                // String epsilon=
     434: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     437: aload         4
     439: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     442: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     445: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     448: swap
     449: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     452: new           #100                // class java/lang/StringBuilder
     455: dup
     456: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     459: ldc           #160                // String power=
     461: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     464: aload_3
     465: iconst_2
     466: invokestatic  #166                // Method kotlin/text/CharsKt.checkRadix:(I)I
     469: invokestatic  #172                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     472: aload         4
     474: iconst_2
     475: invokestatic  #166                // Method kotlin/text/CharsKt.checkRadix:(I)I
     478: invokestatic  #172                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     481: imul
     482: invokevirtual #175                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     485: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     488: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     491: swap
     492: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     495: aload_1
     496: checkcast     #134                // class java/util/Collection
     499: invokestatic  #179                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     502: astore        5
     504: aconst_null
     505: astore        6
     507: iconst_0
     508: istore        7
     510: iload         7
     512: iload_2
     513: if_icmpge     722
     516: aload         5
     518: iload         7
     520: invokestatic  #105                // Method countOnes:(Ljava/util/List;I)I
     523: aload         5
     525: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     530: iconst_1
     531: iadd
     532: iconst_2
     533: idiv
     534: if_icmplt     542
     537: ldc           #112                // String 1
     539: goto          544
     542: ldc           #114                // String 0
     544: astore        8
     546: new           #100                // class java/lang/StringBuilder
     549: dup
     550: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     553: ldc           #181                // String mostCommon[
     555: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     558: iload         7
     560: invokevirtual #175                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     563: ldc           #183                // String ]=
     565: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     568: aload         8
     570: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     573: ldc           #185                // String  (ones=
     575: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     578: aload         5
     580: iload         7
     582: invokestatic  #105                // Method countOnes:(Ljava/util/List;I)I
     585: invokevirtual #175                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     588: ldc           #187                // String  list size=
     590: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     593: aload         5
     595: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     600: invokevirtual #175                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     603: bipush        125
     605: invokevirtual #190                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     608: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     611: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     614: swap
     615: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     618: aload         5
     620: iload         7
     622: aload         8
     624: invokedynamic #200,  0            // InvokeDynamic #1:invoke:(ILjava/lang/String;)Lkotlin/jvm/functions/Function1;
     629: invokedynamic #210,  0            // InvokeDynamic #2:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
     634: invokeinterface #214,  2          // InterfaceMethod java/util/List.removeIf:(Ljava/util/function/Predicate;)Z
     639: pop
     640: aload         5
     642: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     647: iconst_1
     648: if_icmpgt     716
     651: new           #100                // class java/lang/StringBuilder
     654: dup
     655: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     658: ldc           #216                // String oxygen generator:
     660: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     663: aload         5
     665: invokestatic  #220                // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;
     668: checkcast     #88                 // class java/lang/String
     671: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     674: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     677: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     680: swap
     681: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     684: aload         5
     686: invokestatic  #220                // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;
     689: checkcast     #88                 // class java/lang/String
     692: dup
     693: ifnull        709
     696: iconst_2
     697: invokestatic  #166                // Method kotlin/text/CharsKt.checkRadix:(I)I
     700: invokestatic  #172                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     703: invokestatic  #223                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     706: goto          711
     709: pop
     710: aconst_null
     711: astore        6
     713: goto          722
     716: iinc          7, 1
     719: goto          510
     722: aload_1
     723: checkcast     #134                // class java/util/Collection
     726: invokestatic  #179                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     729: astore        7
     731: aconst_null
     732: astore        8
     734: iconst_0
     735: istore        9
     737: iload         9
     739: iload_2
     740: if_icmpge     877
     743: aload         7
     745: iload         9
     747: invokestatic  #105                // Method countOnes:(Ljava/util/List;I)I
     750: aload         7
     752: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     757: iconst_1
     758: iadd
     759: iconst_2
     760: idiv
     761: if_icmpge     769
     764: ldc           #112                // String 1
     766: goto          771
     769: ldc           #114                // String 0
     771: astore        10
     773: aload         7
     775: iload         9
     777: aload         10
     779: invokedynamic #228,  0            // InvokeDynamic #3:invoke:(ILjava/lang/String;)Lkotlin/jvm/functions/Function1;
     784: invokedynamic #233,  0            // InvokeDynamic #4:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
     789: invokeinterface #214,  2          // InterfaceMethod java/util/List.removeIf:(Ljava/util/function/Predicate;)Z
     794: pop
     795: aload         7
     797: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     802: iconst_1
     803: if_icmpgt     871
     806: new           #100                // class java/lang/StringBuilder
     809: dup
     810: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     813: ldc           #235                // String scrubber first:
     815: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     818: aload         7
     820: invokestatic  #220                // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;
     823: checkcast     #88                 // class java/lang/String
     826: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     829: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     832: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     835: swap
     836: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     839: aload         7
     841: invokestatic  #220                // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;
     844: checkcast     #88                 // class java/lang/String
     847: dup
     848: ifnull        864
     851: iconst_2
     852: invokestatic  #166                // Method kotlin/text/CharsKt.checkRadix:(I)I
     855: invokestatic  #172                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     858: invokestatic  #223                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     861: goto          866
     864: pop
     865: aconst_null
     866: astore        8
     868: goto          877
     871: iinc          9, 1
     874: goto          737
     877: new           #100                // class java/lang/StringBuilder
     880: dup
     881: invokespecial #101                // Method java/lang/StringBuilder."<init>":()V
     884: ldc           #237                // String oxygenGen=
     886: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     889: aload         6
     891: invokevirtual #240                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     894: ldc           #242                // String  co2scrubber=
     896: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     899: aload         8
     901: invokevirtual #240                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     904: ldc           #244                // String  multi=
     906: invokevirtual #118                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     909: aload         6
     911: dup
     912: ifnull        939
     915: invokevirtual #247                // Method java/lang/Integer.intValue:()I
     918: aload         8
     920: dup
     921: ifnull        930
     924: invokevirtual #247                // Method java/lang/Integer.intValue:()I
     927: goto          932
     930: pop
     931: iconst_0
     932: imul
     933: invokestatic  #223                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     936: goto          941
     939: pop
     940: aconst_null
     941: invokevirtual #240                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     944: invokevirtual #122                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     947: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     950: swap
     951: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     954: return

  public static final int countOnes(java.util.List<java.lang.String>, int);
    Code:
       0: aload_0
       1: ldc_w         #288                // String <this>
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: checkcast     #72                 // class java/lang/Iterable
      11: astore_2
      12: iconst_0
      13: istore_3
      14: aload_2
      15: instanceof    #134                // class java/util/Collection
      18: ifeq          37
      21: aload_2
      22: checkcast     #134                // class java/util/Collection
      25: invokeinterface #291,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      30: ifeq          37
      33: iconst_0
      34: goto          112
      37: iconst_0
      38: istore        4
      40: aload_2
      41: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      46: astore        5
      48: aload         5
      50: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      55: ifeq          110
      58: aload         5
      60: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      65: astore        6
      67: aload         6
      69: checkcast     #88                 // class java/lang/String
      72: astore        7
      74: iconst_0
      75: istore        8
      77: aload         7
      79: iload_1
      80: invokevirtual #292                // Method java/lang/String.charAt:(I)C
      83: bipush        49
      85: if_icmpne     92
      88: iconst_1
      89: goto          93
      92: iconst_0
      93: ifeq          48
      96: iinc          4, 1
      99: iload         4
     101: ifge          48
     104: invokestatic  #295                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     107: goto          48
     110: iload         4
     112: ireturn

  private static final java.lang.String main$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #303                // String line
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: checkcast     #126                // class java/lang/CharSequence
      11: invokestatic  #309                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      14: invokevirtual #310                // Method java/lang/Object.toString:()Ljava/lang/String;
      17: astore_1
      18: aload_1
      19: astore_2
      20: iconst_0
      21: istore_3
      22: aload_2
      23: checkcast     #126                // class java/lang/CharSequence
      26: invokestatic  #314                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      29: ifne          36
      32: aload_1
      33: goto          37
      36: aconst_null
      37: areturn

  private static final boolean main$lambda$6(int, java.lang.String, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #317                // String it
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_2
       8: iload_0
       9: invokevirtual #292                // Method java/lang/String.charAt:(I)C
      12: aload_1
      13: iconst_0
      14: invokevirtual #292                // Method java/lang/String.charAt:(I)C
      17: if_icmpeq     24
      20: iconst_1
      21: goto          25
      24: iconst_0
      25: ireturn

  private static final boolean main$lambda$7(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #323,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #325                // class java/lang/Boolean
      10: invokevirtual #328                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  private static final boolean main$lambda$8(int, java.lang.String, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #317                // String it
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_2
       8: iload_0
       9: invokevirtual #292                // Method java/lang/String.charAt:(I)C
      12: aload_1
      13: iconst_0
      14: invokevirtual #292                // Method java/lang/String.charAt:(I)C
      17: if_icmpeq     24
      20: iconst_1
      21: goto          25
      24: iconst_0
      25: ireturn

  private static final boolean main$lambda$9(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #323,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #325                // class java/lang/Boolean
      10: invokevirtual #328                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn
}


val CARD_WIDTH = 5
val CARD_HEIGHT = 5

fun List<Int>.isBingo(inputs: List<Int>) = this.all { inputs.contains(it) }

data class BingoCard(
    val numbers: List<Int>
) {
    fun get(row: Int, column: Int): Int = numbers[row * CARD_WIDTH + column]
    fun getRow(row: Int) = (0 until CARD_WIDTH).map { get(row, it) }
    fun getColumn(column: Int) = (0 until CARD_HEIGHT).map { get(it, column) }

    fun isBingo(inputs: List<Int>): Boolean {
        for (row in 0 until CARD_HEIGHT) {
            if (getRow(row).isBingo(inputs)) {
                return true
            }
        }

        for (col in 0 until CARD_WIDTH) {
            if (getColumn(col).isBingo(inputs)) {
                return true
            }
        }

        return false
    }

    fun getScore(inputs: List<Int>): Int = numbers.filter { it !in inputs }.sum()
}

fun main(args: Array<String>) {
    println("Hello World!")

    val values = generateSequence(::readLine)
        .mapNotNull { line -> line.trim().takeUnless { trimmed -> trimmed.isBlank() } }
        .toList()

    val bingoInput = values.first().split(",").map { it.toInt() }

    val boards = values
        .drop(1)
        .windowed(CARD_HEIGHT, step = CARD_HEIGHT)
        .map { list -> BingoCard(list.joinToString(" ").split(" ").filter { it.isNotBlank() }.map { num -> num.toInt() }) }

    for (i in bingoInput.indices) {
        val inputs = bingoInput.take(i)
        val winner = boards.firstOrNull { it.isBingo(inputs) }
        if (winner != null) {
            println("score: ${winner.getScore(inputs)}")
            println("result: ${winner.getScore(inputs) * bingoInput[i - 1]}")
            break
        }
    }

    val boards2 = boards.toMutableList()
    for (i in 1 until bingoInput.size) {
        val inputs = bingoInput.take(i)
        println("i=$i inputs=$inputs")
        val winners = boards2.filter { it.isBingo(inputs) }
        if (winners.size == 1 && boards2.size == 1) {
            println("2nd score: ${winners.first().getScore(inputs)}")
            println("2nd result: ${winners.first().getScore(inputs) * inputs.last()}")
            break
        }
        println("removed $winners, remaining ${boards2.size}")
        boards2.removeAll(winners)
    }
}

Compiled from "Day4.kt"
final class Day4Kt$main$values$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function0<java.lang.String> {
  public static final Day4Kt$main$values$1 INSTANCE;

  Day4Kt$main$values$1();
    Code:
       0: aload_0
       1: iconst_0
       2: ldc           #11                 // class kotlin/io/ConsoleKt
       4: ldc           #13                 // String readLine
       6: ldc           #15                 // String readLine()Ljava/lang/String;
       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 java.lang.String invoke();
    Code:
       0: invokestatic  #24                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: areturn

  public java.lang.Object invoke();
    Code:
       0: aload_0
       1: invokevirtual #27                 // Method invoke:()Ljava/lang/String;
       4: areturn

  static {};
    Code:
       0: new           #2                  // class Day4Kt$main$values$1
       3: dup
       4: invokespecial #30                 // Method "<init>":()V
       7: putstatic     #33                 // Field INSTANCE:LDay4Kt$main$values$1;
      10: return
}

Compiled from "Day4.kt"
public final class Day4Kt {
  private static final int CARD_WIDTH;

  private static final int CARD_HEIGHT;

  public static final int getCARD_WIDTH();
    Code:
       0: getstatic     #10                 // Field CARD_WIDTH:I
       3: ireturn

  public static final int getCARD_HEIGHT();
    Code:
       0: getstatic     #14                 // Field CARD_HEIGHT:I
       3: ireturn

  public static final boolean isBingo(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #20                 // String <this>
       3: invokestatic  #26                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #28                 // String inputs
       9: invokestatic  #26                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: checkcast     #30                 // class java/lang/Iterable
      16: astore_2
      17: iconst_0
      18: istore_3
      19: aload_2
      20: instanceof    #32                 // class java/util/Collection
      23: ifeq          42
      26: aload_2
      27: checkcast     #32                 // class java/util/Collection
      30: invokeinterface #36,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      35: ifeq          42
      38: iconst_1
      39: goto          101
      42: aload_2
      43: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      48: astore        4
      50: aload         4
      52: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          100
      60: aload         4
      62: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        5
      69: aload         5
      71: checkcast     #51                 // class java/lang/Number
      74: invokevirtual #54                 // Method java/lang/Number.intValue:()I
      77: istore        6
      79: iconst_0
      80: istore        7
      82: aload_1
      83: iload         6
      85: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      88: invokeinterface #66,  2           // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
      93: ifne          50
      96: iconst_0
      97: goto          101
     100: iconst_1
     101: ireturn

  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #79                 // String args
       3: invokestatic  #26                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #81                 // String Hello World!
       8: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: getstatic     #99                 // Field Day4Kt$main$values$1.INSTANCE:LDay4Kt$main$values$1;
      18: checkcast     #101                // class kotlin/jvm/functions/Function0
      21: invokestatic  #107                // Method kotlin/sequences/SequencesKt.generateSequence:(Lkotlin/jvm/functions/Function0;)Lkotlin/sequences/Sequence;
      24: invokedynamic #126,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      29: invokestatic  #130                // Method kotlin/sequences/SequencesKt.mapNotNull:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      32: invokestatic  #134                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      35: astore_1
      36: aload_1
      37: invokestatic  #140                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      40: checkcast     #142                // class java/lang/CharSequence
      43: iconst_1
      44: anewarray     #144                // class java/lang/String
      47: astore_3
      48: aload_3
      49: iconst_0
      50: ldc           #146                // String ,
      52: aastore
      53: aload_3
      54: iconst_0
      55: iconst_0
      56: bipush        6
      58: aconst_null
      59: invokestatic  #152                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      62: checkcast     #30                 // class java/lang/Iterable
      65: astore_3
      66: iconst_0
      67: istore        4
      69: aload_3
      70: astore        5
      72: new           #154                // class java/util/ArrayList
      75: dup
      76: aload_3
      77: bipush        10
      79: invokestatic  #158                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      82: invokespecial #162                // Method java/util/ArrayList."<init>":(I)V
      85: checkcast     #32                 // class java/util/Collection
      88: astore        6
      90: iconst_0
      91: istore        7
      93: aload         5
      95: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     100: astore        8
     102: aload         8
     104: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          156
     112: aload         8
     114: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: astore        9
     121: aload         6
     123: aload         9
     125: checkcast     #144                // class java/lang/String
     128: astore        10
     130: astore        25
     132: iconst_0
     133: istore        11
     135: aload         10
     137: invokestatic  #166                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     140: nop
     141: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     144: aload         25
     146: swap
     147: invokeinterface #169,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     152: pop
     153: goto          102
     156: aload         6
     158: checkcast     #62                 // class java/util/List
     161: nop
     162: astore_2
     163: aload_1
     164: checkcast     #30                 // class java/lang/Iterable
     167: iconst_1
     168: invokestatic  #173                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     171: checkcast     #30                 // class java/lang/Iterable
     174: getstatic     #14                 // Field CARD_HEIGHT:I
     177: getstatic     #14                 // Field CARD_HEIGHT:I
     180: iconst_0
     181: iconst_4
     182: aconst_null
     183: invokestatic  #177                // Method kotlin/collections/CollectionsKt.windowed$default:(Ljava/lang/Iterable;IIZILjava/lang/Object;)Ljava/util/List;
     186: checkcast     #30                 // class java/lang/Iterable
     189: astore        4
     191: nop
     192: iconst_0
     193: istore        5
     195: aload         4
     197: astore        6
     199: new           #154                // class java/util/ArrayList
     202: dup
     203: aload         4
     205: bipush        10
     207: invokestatic  #158                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     210: invokespecial #162                // Method java/util/ArrayList."<init>":(I)V
     213: checkcast     #32                 // class java/util/Collection
     216: astore        7
     218: iconst_0
     219: istore        8
     221: aload         6
     223: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     228: astore        9
     230: aload         9
     232: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     237: ifeq          539
     240: aload         9
     242: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     247: astore        10
     249: aload         7
     251: aload         10
     253: checkcast     #62                 // class java/util/List
     256: astore        11
     258: astore        25
     260: iconst_0
     261: istore        12
     263: aload         11
     265: checkcast     #30                 // class java/lang/Iterable
     268: ldc           #179                // String
     270: checkcast     #142                // class java/lang/CharSequence
     273: aconst_null
     274: aconst_null
     275: iconst_0
     276: aconst_null
     277: aconst_null
     278: bipush        62
     280: aconst_null
     281: invokestatic  #183                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     284: checkcast     #142                // class java/lang/CharSequence
     287: iconst_1
     288: anewarray     #144                // class java/lang/String
     291: astore        13
     293: aload         13
     295: iconst_0
     296: ldc           #179                // String
     298: aastore
     299: aload         13
     301: iconst_0
     302: iconst_0
     303: bipush        6
     305: aconst_null
     306: invokestatic  #152                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     309: checkcast     #30                 // class java/lang/Iterable
     312: astore        13
     314: iconst_0
     315: istore        16
     317: aload         13
     319: astore        17
     321: new           #154                // class java/util/ArrayList
     324: dup
     325: invokespecial #186                // Method java/util/ArrayList."<init>":()V
     328: checkcast     #32                 // class java/util/Collection
     331: astore        18
     333: iconst_0
     334: istore        19
     336: aload         17
     338: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     343: astore        20
     345: aload         20
     347: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     352: ifeq          407
     355: aload         20
     357: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     362: astore        21
     364: aload         21
     366: checkcast     #144                // class java/lang/String
     369: astore        22
     371: iconst_0
     372: istore        23
     374: aload         22
     376: checkcast     #142                // class java/lang/CharSequence
     379: invokestatic  #190                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     382: ifne          389
     385: iconst_1
     386: goto          390
     389: iconst_0
     390: nop
     391: ifeq          345
     394: aload         18
     396: aload         21
     398: invokeinterface #169,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     403: pop
     404: goto          345
     407: aload         18
     409: checkcast     #62                 // class java/util/List
     412: nop
     413: checkcast     #30                 // class java/lang/Iterable
     416: astore        13
     418: iconst_0
     419: istore        16
     421: aload         13
     423: astore        17
     425: new           #154                // class java/util/ArrayList
     428: dup
     429: aload         13
     431: bipush        10
     433: invokestatic  #158                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     436: invokespecial #162                // Method java/util/ArrayList."<init>":(I)V
     439: checkcast     #32                 // class java/util/Collection
     442: astore        18
     444: iconst_0
     445: istore        19
     447: aload         17
     449: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     454: astore        20
     456: aload         20
     458: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     463: ifeq          510
     466: aload         20
     468: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     473: astore        21
     475: aload         18
     477: aload         21
     479: checkcast     #144                // class java/lang/String
     482: astore        22
     484: astore        24
     486: iconst_0
     487: istore        23
     489: aload         22
     491: invokestatic  #166                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     494: nop
     495: invokestatic  #60                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     498: aload         24
     500: swap
     501: invokeinterface #169,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     506: pop
     507: goto          456
     510: aload         18
     512: checkcast     #62                 // class java/util/List
     515: nop
     516: astore        26
     518: new           #192                // class BingoCard
     521: dup
     522: aload         26
     524: invokespecial #195                // Method BingoCard."<init>":(Ljava/util/List;)V
     527: aload         25
     529: swap
     530: invokeinterface #169,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     535: pop
     536: goto          230
     539: aload         7
     541: checkcast     #62                 // class java/util/List
     544: nop
     545: astore_3
     546: iconst_0
     547: istore        4
     549: aload_2
     550: checkcast     #32                 // class java/util/Collection
     553: invokeinterface #198,  1          // InterfaceMethod java/util/Collection.size:()I
     558: istore        5
     560: iload         4
     562: iload         5
     564: if_icmpge     741
     567: aload_2
     568: checkcast     #30                 // class java/lang/Iterable
     571: iload         4
     573: invokestatic  #201                // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
     576: astore        6
     578: aload_3
     579: checkcast     #30                 // class java/lang/Iterable
     582: astore        8
     584: iconst_0
     585: istore        9
     587: aload         8
     589: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     594: astore        10
     596: aload         10
     598: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     603: ifeq          640
     606: aload         10
     608: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     613: astore        11
     615: aload         11
     617: checkcast     #192                // class BingoCard
     620: astore        12
     622: iconst_0
     623: istore        13
     625: aload         12
     627: aload         6
     629: invokevirtual #204                // Method BingoCard.isBingo:(Ljava/util/List;)Z
     632: ifeq          596
     635: aload         11
     637: goto          641
     640: aconst_null
     641: checkcast     #192                // class BingoCard
     644: astore        7
     646: aload         7
     648: ifnull        735
     651: new           #206                // class java/lang/StringBuilder
     654: dup
     655: invokespecial #207                // Method java/lang/StringBuilder."<init>":()V
     658: ldc           #209                // String score:
     660: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     663: aload         7
     665: aload         6
     667: invokevirtual #217                // Method BingoCard.getScore:(Ljava/util/List;)I
     670: invokevirtual #220                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     673: invokevirtual #224                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     676: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
     679: swap
     680: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     683: new           #206                // class java/lang/StringBuilder
     686: dup
     687: invokespecial #207                // Method java/lang/StringBuilder."<init>":()V
     690: ldc           #226                // String result:
     692: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     695: aload         7
     697: aload         6
     699: invokevirtual #217                // Method BingoCard.getScore:(Ljava/util/List;)I
     702: aload_2
     703: iload         4
     705: iconst_1
     706: isub
     707: invokeinterface #230,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     712: checkcast     #51                 // class java/lang/Number
     715: invokevirtual #54                 // Method java/lang/Number.intValue:()I
     718: imul
     719: invokevirtual #220                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     722: invokevirtual #224                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     725: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
     728: swap
     729: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     732: goto          741
     735: iinc          4, 1
     738: goto          560
     741: aload_3
     742: checkcast     #32                 // class java/util/Collection
     745: invokestatic  #234                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     748: astore        4
     750: iconst_1
     751: istore        5
     753: aload_2
     754: invokeinterface #235,  1          // InterfaceMethod java/util/List.size:()I
     759: istore        6
     761: iload         5
     763: iload         6
     765: if_icmpge     1088
     768: aload_2
     769: checkcast     #30                 // class java/lang/Iterable
     772: iload         5
     774: invokestatic  #201                // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
     777: astore        7
     779: new           #206                // class java/lang/StringBuilder
     782: dup
     783: invokespecial #207                // Method java/lang/StringBuilder."<init>":()V
     786: ldc           #237                // String i=
     788: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     791: iload         5
     793: invokevirtual #220                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     796: ldc           #239                // String  inputs=
     798: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     801: aload         7
     803: invokevirtual #242                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     806: invokevirtual #224                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     809: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
     812: swap
     813: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     816: aload         4
     818: checkcast     #30                 // class java/lang/Iterable
     821: astore        9
     823: iconst_0
     824: istore        10
     826: aload         9
     828: astore        11
     830: new           #154                // class java/util/ArrayList
     833: dup
     834: invokespecial #186                // Method java/util/ArrayList."<init>":()V
     837: checkcast     #32                 // class java/util/Collection
     840: astore        12
     842: iconst_0
     843: istore        13
     845: aload         11
     847: invokeinterface #40,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     852: astore        14
     854: aload         14
     856: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     861: ifeq          906
     864: aload         14
     866: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     871: astore        15
     873: aload         15
     875: checkcast     #192                // class BingoCard
     878: astore        16
     880: iconst_0
     881: istore        17
     883: aload         16
     885: aload         7
     887: invokevirtual #204                // Method BingoCard.isBingo:(Ljava/util/List;)Z
     890: ifeq          854
     893: aload         12
     895: aload         15
     897: invokeinterface #169,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     902: pop
     903: goto          854
     906: aload         12
     908: checkcast     #62                 // class java/util/List
     911: nop
     912: astore        8
     914: aload         8
     916: invokeinterface #235,  1          // InterfaceMethod java/util/List.size:()I
     921: iconst_1
     922: if_icmpne     1027
     925: aload         4
     927: invokeinterface #235,  1          // InterfaceMethod java/util/List.size:()I
     932: iconst_1
     933: if_icmpne     1027
     936: new           #206                // class java/lang/StringBuilder
     939: dup
     940: invokespecial #207                // Method java/lang/StringBuilder."<init>":()V
     943: ldc           #244                // String 2nd score:
     945: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     948: aload         8
     950: invokestatic  #140                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     953: checkcast     #192                // class BingoCard
     956: aload         7
     958: invokevirtual #217                // Method BingoCard.getScore:(Ljava/util/List;)I
     961: invokevirtual #220                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     964: invokevirtual #224                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     967: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
     970: swap
     971: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     974: new           #206                // class java/lang/StringBuilder
     977: dup
     978: invokespecial #207                // Method java/lang/StringBuilder."<init>":()V
     981: ldc           #246                // String 2nd result:
     983: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     986: aload         8
     988: invokestatic  #140                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     991: checkcast     #192                // class BingoCard
     994: aload         7
     996: invokevirtual #217                // Method BingoCard.getScore:(Ljava/util/List;)I
     999: aload         7
    1001: invokestatic  #249                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
    1004: checkcast     #51                 // class java/lang/Number
    1007: invokevirtual #54                 // Method java/lang/Number.intValue:()I
    1010: imul
    1011: invokevirtual #220                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
    1014: invokevirtual #224                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1017: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
    1020: swap
    1021: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1024: goto          1088
    1027: new           #206                // class java/lang/StringBuilder
    1030: dup
    1031: invokespecial #207                // Method java/lang/StringBuilder."<init>":()V
    1034: ldc           #251                // String removed
    1036: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
    1039: aload         8
    1041: invokevirtual #242                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    1044: ldc           #253                // String , remaining
    1046: invokevirtual #213                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
    1049: aload         4
    1051: invokeinterface #235,  1          // InterfaceMethod java/util/List.size:()I
    1056: invokevirtual #220                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
    1059: invokevirtual #224                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1062: getstatic     #87                 // Field java/lang/System.out:Ljava/io/PrintStream;
    1065: swap
    1066: invokevirtual #93                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1069: aload         4
    1071: aload         8
    1073: checkcast     #32                 // class java/util/Collection
    1076: invokeinterface #257,  2          // InterfaceMethod java/util/List.removeAll:(Ljava/util/Collection;)Z
    1081: pop
    1082: iinc          5, 1
    1085: goto          761
    1088: return

  private static final java.lang.String main$lambda$2(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #292                // String line
       4: invokestatic  #26                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: checkcast     #142                // class java/lang/CharSequence
      11: invokestatic  #296                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      14: invokevirtual #297                // Method java/lang/Object.toString:()Ljava/lang/String;
      17: astore_1
      18: aload_1
      19: astore_2
      20: iconst_0
      21: istore_3
      22: aload_2
      23: checkcast     #142                // class java/lang/CharSequence
      26: invokestatic  #190                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      29: ifne          36
      32: aload_1
      33: goto          37
      36: aconst_null
      37: areturn

  static {};
    Code:
       0: iconst_5
       1: putstatic     #10                 // Field CARD_WIDTH:I
       4: iconst_5
       5: putstatic     #14                 // Field CARD_HEIGHT:I
       8: return
}


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

fun main(args: Array<String>) {
    val values = generateSequence(::readLine)
        .mapNotNull { line -> line.trim().takeUnless { trimmed -> trimmed.isBlank() } }
        .toList()

    val coords = values
        .filter { it.contains(",") }
        .map {
            val (x, y) = it.split(",")
            PointI(x.toInt(), y.toInt())
        }

    val folds = mutableListOf<(PointI) -> PointI>()
    values
        .filter { it.contains("=") }
        .forEach {
            val (a, b) = it.split("=")
            val axis = a.last()
            val coord = b.toInt()
            if (axis == 'x') {
                folds += { point -> point.copy(x = if (point.x > coord) 2 * coord - point.x else point.x) }
            } else if (axis == 'y') {
                folds += { point -> point.copy(y = if (point.y > coord) 2 * coord - point.y else point.y) }
            }
        }

    val foldedCoords1 = coords.map { point -> folds.take(1).fold(point) { i, p -> p(i) } }.toSet()
    println("foldedCoords1.size=${foldedCoords1.size}")

    val foldedCoords2 = coords.map { point -> folds.fold(point) { i, p -> p(i) } }.toSet()
    println("foldedCoords2.size=${foldedCoords2.size}")

    for (y in 0..foldedCoords2.maxOf { it.y }) {
        println(buildString {
            for (x in 0..foldedCoords2.maxOf { it.x }) {
                if (PointI(x, y) in foldedCoords2) append("#") else append(".")
            }
        })
    }
}

Compiled from "Day13.kt"
public final class Day13Kt {
  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: getstatic     #21                 // Field Day13Kt$main$values$1.INSTANCE:LDay13Kt$main$values$1;
       9: checkcast     #23                 // class kotlin/jvm/functions/Function0
      12: invokestatic  #29                 // Method kotlin/sequences/SequencesKt.generateSequence:(Lkotlin/jvm/functions/Function0;)Lkotlin/sequences/Sequence;
      15: invokedynamic #48,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      20: invokestatic  #52                 // Method kotlin/sequences/SequencesKt.mapNotNull:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      23: invokestatic  #56                 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      26: astore_1
      27: aload_1
      28: checkcast     #58                 // class java/lang/Iterable
      31: astore_3
      32: nop
      33: iconst_0
      34: istore        4
      36: aload_3
      37: astore        5
      39: new           #60                 // class java/util/ArrayList
      42: dup
      43: invokespecial #64                 // Method java/util/ArrayList."<init>":()V
      46: checkcast     #66                 // class java/util/Collection
      49: astore        6
      51: iconst_0
      52: istore        7
      54: aload         5
      56: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      61: astore        8
      63: aload         8
      65: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      70: ifeq          124
      73: aload         8
      75: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      80: astore        9
      82: aload         9
      84: checkcast     #82                 // class java/lang/String
      87: astore        10
      89: iconst_0
      90: istore        11
      92: aload         10
      94: checkcast     #84                 // class java/lang/CharSequence
      97: ldc           #86                 // String ,
      99: checkcast     #84                 // class java/lang/CharSequence
     102: iconst_0
     103: iconst_2
     104: aconst_null
     105: invokestatic  #92                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
     108: ifeq          63
     111: aload         6
     113: aload         9
     115: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     120: pop
     121: goto          63
     124: aload         6
     126: checkcast     #98                 // class java/util/List
     129: nop
     130: checkcast     #58                 // class java/lang/Iterable
     133: astore_3
     134: nop
     135: iconst_0
     136: istore        4
     138: aload_3
     139: astore        5
     141: new           #60                 // class java/util/ArrayList
     144: dup
     145: aload_3
     146: bipush        10
     148: invokestatic  #104                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     151: invokespecial #107                // Method java/util/ArrayList."<init>":(I)V
     154: checkcast     #66                 // class java/util/Collection
     157: astore        6
     159: iconst_0
     160: istore        7
     162: aload         5
     164: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     169: astore        8
     171: aload         8
     173: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     178: ifeq          288
     181: aload         8
     183: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     188: astore        9
     190: aload         6
     192: aload         9
     194: checkcast     #82                 // class java/lang/String
     197: astore        10
     199: astore        23
     201: iconst_0
     202: istore        11
     204: aload         10
     206: checkcast     #84                 // class java/lang/CharSequence
     209: iconst_1
     210: anewarray     #82                 // class java/lang/String
     213: astore        12
     215: aload         12
     217: iconst_0
     218: ldc           #86                 // String ,
     220: aastore
     221: aload         12
     223: iconst_0
     224: iconst_0
     225: bipush        6
     227: aconst_null
     228: invokestatic  #111                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     231: astore        13
     233: aload         13
     235: iconst_0
     236: invokeinterface #115,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     241: checkcast     #82                 // class java/lang/String
     244: astore        12
     246: aload         13
     248: iconst_1
     249: invokeinterface #115,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     254: checkcast     #82                 // class java/lang/String
     257: astore        14
     259: new           #117                // class PointI
     262: dup
     263: aload         12
     265: invokestatic  #123                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     268: aload         14
     270: invokestatic  #123                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     273: invokespecial #126                // Method PointI."<init>":(II)V
     276: aload         23
     278: swap
     279: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     284: pop
     285: goto          171
     288: aload         6
     290: checkcast     #98                 // class java/util/List
     293: nop
     294: astore_2
     295: new           #60                 // class java/util/ArrayList
     298: dup
     299: invokespecial #64                 // Method java/util/ArrayList."<init>":()V
     302: checkcast     #98                 // class java/util/List
     305: astore_3
     306: aload_1
     307: checkcast     #58                 // class java/lang/Iterable
     310: astore        4
     312: nop
     313: iconst_0
     314: istore        5
     316: aload         4
     318: astore        6
     320: new           #60                 // class java/util/ArrayList
     323: dup
     324: invokespecial #64                 // Method java/util/ArrayList."<init>":()V
     327: checkcast     #66                 // class java/util/Collection
     330: astore        7
     332: iconst_0
     333: istore        8
     335: aload         6
     337: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     342: astore        9
     344: aload         9
     346: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     351: ifeq          405
     354: aload         9
     356: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     361: astore        10
     363: aload         10
     365: checkcast     #82                 // class java/lang/String
     368: astore        11
     370: iconst_0
     371: istore        12
     373: aload         11
     375: checkcast     #84                 // class java/lang/CharSequence
     378: ldc           #128                // String =
     380: checkcast     #84                 // class java/lang/CharSequence
     383: iconst_0
     384: iconst_2
     385: aconst_null
     386: invokestatic  #92                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
     389: ifeq          344
     392: aload         7
     394: aload         10
     396: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     401: pop
     402: goto          344
     405: aload         7
     407: checkcast     #98                 // class java/util/List
     410: nop
     411: checkcast     #58                 // class java/lang/Iterable
     414: astore        4
     416: nop
     417: iconst_0
     418: istore        5
     420: aload         4
     422: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     427: astore        6
     429: aload         6
     431: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     436: ifeq          598
     439: aload         6
     441: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     446: astore        7
     448: aload         7
     450: checkcast     #82                 // class java/lang/String
     453: astore        8
     455: iconst_0
     456: istore        9
     458: aload         8
     460: checkcast     #84                 // class java/lang/CharSequence
     463: iconst_1
     464: anewarray     #82                 // class java/lang/String
     467: astore        10
     469: aload         10
     471: iconst_0
     472: ldc           #128                // String =
     474: aastore
     475: aload         10
     477: iconst_0
     478: iconst_0
     479: bipush        6
     481: aconst_null
     482: invokestatic  #111                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     485: astore        11
     487: aload         11
     489: iconst_0
     490: invokeinterface #115,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     495: checkcast     #82                 // class java/lang/String
     498: astore        10
     500: aload         11
     502: iconst_1
     503: invokeinterface #115,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     508: checkcast     #82                 // class java/lang/String
     511: astore        12
     513: aload         10
     515: checkcast     #84                 // class java/lang/CharSequence
     518: invokestatic  #132                // Method kotlin/text/StringsKt.last:(Ljava/lang/CharSequence;)C
     521: istore        13
     523: aload         12
     525: invokestatic  #123                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     528: istore        14
     530: iload         13
     532: tableswitch   { // 120 to 121
                   120: 556
                   121: 576
               default: 593
          }
     556: aload_3
     557: checkcast     #66                 // class java/util/Collection
     560: iload         14
     562: invokedynamic #142,  0            // InvokeDynamic #1:invoke:(I)Lkotlin/jvm/functions/Function1;
     567: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     572: pop
     573: goto          593
     576: aload_3
     577: checkcast     #66                 // class java/util/Collection
     580: iload         14
     582: invokedynamic #147,  0            // InvokeDynamic #2:invoke:(I)Lkotlin/jvm/functions/Function1;
     587: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     592: pop
     593: nop
     594: nop
     595: goto          429
     598: nop
     599: aload_2
     600: checkcast     #58                 // class java/lang/Iterable
     603: astore        5
     605: iconst_0
     606: istore        6
     608: aload         5
     610: astore        7
     612: new           #60                 // class java/util/ArrayList
     615: dup
     616: aload         5
     618: bipush        10
     620: invokestatic  #104                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     623: invokespecial #107                // Method java/util/ArrayList."<init>":(I)V
     626: checkcast     #66                 // class java/util/Collection
     629: astore        8
     631: iconst_0
     632: istore        9
     634: aload         7
     636: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     641: astore        10
     643: aload         10
     645: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     650: ifeq          770
     653: aload         10
     655: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     660: astore        11
     662: aload         8
     664: aload         11
     666: checkcast     #117                // class PointI
     669: astore        12
     671: astore        23
     673: iconst_0
     674: istore        13
     676: aload_3
     677: checkcast     #58                 // class java/lang/Iterable
     680: iconst_1
     681: invokestatic  #151                // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
     684: checkcast     #58                 // class java/lang/Iterable
     687: astore        14
     689: iconst_0
     690: istore        15
     692: aload         12
     694: astore        16
     696: aload         14
     698: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     703: astore        17
     705: aload         17
     707: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     712: ifeq          755
     715: aload         17
     717: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     722: astore        18
     724: aload         16
     726: aload         18
     728: checkcast     #153                // class kotlin/jvm/functions/Function1
     731: astore        19
     733: astore        20
     735: iconst_0
     736: istore        21
     738: aload         19
     740: aload         20
     742: invokeinterface #155,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     747: checkcast     #117                // class PointI
     750: astore        16
     752: goto          705
     755: aload         16
     757: nop
     758: aload         23
     760: swap
     761: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     766: pop
     767: goto          643
     770: aload         8
     772: checkcast     #98                 // class java/util/List
     775: nop
     776: checkcast     #58                 // class java/lang/Iterable
     779: invokestatic  #159                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     782: astore        4
     784: new           #161                // class java/lang/StringBuilder
     787: dup
     788: invokespecial #162                // Method java/lang/StringBuilder."<init>":()V
     791: ldc           #164                // String foldedCoords1.size=
     793: invokevirtual #168                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     796: aload         4
     798: invokeinterface #174,  1          // InterfaceMethod java/util/Set.size:()I
     803: invokevirtual #177                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     806: invokevirtual #181                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     809: getstatic     #187                // Field java/lang/System.out:Ljava/io/PrintStream;
     812: swap
     813: invokevirtual #193                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     816: aload_2
     817: checkcast     #58                 // class java/lang/Iterable
     820: astore        6
     822: iconst_0
     823: istore        7
     825: aload         6
     827: astore        8
     829: new           #60                 // class java/util/ArrayList
     832: dup
     833: aload         6
     835: bipush        10
     837: invokestatic  #104                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     840: invokespecial #107                // Method java/util/ArrayList."<init>":(I)V
     843: checkcast     #66                 // class java/util/Collection
     846: astore        9
     848: iconst_0
     849: istore        10
     851: aload         8
     853: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     858: astore        11
     860: aload         11
     862: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     867: ifeq          980
     870: aload         11
     872: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     877: astore        12
     879: aload         9
     881: aload         12
     883: checkcast     #117                // class PointI
     886: astore        13
     888: astore        23
     890: iconst_0
     891: istore        14
     893: aload_3
     894: checkcast     #58                 // class java/lang/Iterable
     897: astore        15
     899: iconst_0
     900: istore        16
     902: aload         13
     904: astore        17
     906: aload         15
     908: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     913: astore        18
     915: aload         18
     917: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     922: ifeq          965
     925: aload         18
     927: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     932: astore        19
     934: aload         17
     936: aload         19
     938: checkcast     #153                // class kotlin/jvm/functions/Function1
     941: astore        20
     943: astore        21
     945: iconst_0
     946: istore        22
     948: aload         20
     950: aload         21
     952: invokeinterface #155,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     957: checkcast     #117                // class PointI
     960: astore        17
     962: goto          915
     965: aload         17
     967: nop
     968: aload         23
     970: swap
     971: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     976: pop
     977: goto          860
     980: aload         9
     982: checkcast     #98                 // class java/util/List
     985: nop
     986: checkcast     #58                 // class java/lang/Iterable
     989: invokestatic  #159                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     992: astore        5
     994: new           #161                // class java/lang/StringBuilder
     997: dup
     998: invokespecial #162                // Method java/lang/StringBuilder."<init>":()V
    1001: ldc           #195                // String foldedCoords2.size=
    1003: invokevirtual #168                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
    1006: aload         5
    1008: invokeinterface #174,  1          // InterfaceMethod java/util/Set.size:()I
    1013: invokevirtual #177                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
    1016: invokevirtual #181                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1019: getstatic     #187                // Field java/lang/System.out:Ljava/io/PrintStream;
    1022: swap
    1023: invokevirtual #193                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1026: iconst_0
    1027: istore        6
    1029: aload         5
    1031: checkcast     #58                 // class java/lang/Iterable
    1034: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1039: astore        9
    1041: aload         9
    1043: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1048: ifne          1059
    1051: new           #197                // class java/util/NoSuchElementException
    1054: dup
    1055: invokespecial #198                // Method java/util/NoSuchElementException."<init>":()V
    1058: athrow
    1059: aload         9
    1061: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1066: checkcast     #117                // class PointI
    1069: astore        10
    1071: iconst_0
    1072: istore        11
    1074: aload         10
    1076: invokevirtual #201                // Method PointI.getY:()I
    1079: istore        10
    1081: aload         9
    1083: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1088: ifeq          1127
    1091: aload         9
    1093: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1098: checkcast     #117                // class PointI
    1101: astore        11
    1103: iconst_0
    1104: istore        12
    1106: aload         11
    1108: invokevirtual #201                // Method PointI.getY:()I
    1111: istore        11
    1113: iload         10
    1115: iload         11
    1117: if_icmpge     1081
    1120: iload         11
    1122: istore        10
    1124: goto          1081
    1127: iload         10
    1129: istore        7
    1131: iload         6
    1133: iload         7
    1135: if_icmpgt     1347
    1138: new           #161                // class java/lang/StringBuilder
    1141: dup
    1142: invokespecial #162                // Method java/lang/StringBuilder."<init>":()V
    1145: astore        8
    1147: aload         8
    1149: astore        9
    1151: iconst_0
    1152: istore        10
    1154: iconst_0
    1155: istore        11
    1157: aload         5
    1159: checkcast     #58                 // class java/lang/Iterable
    1162: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1167: astore        12
    1169: aload         12
    1171: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1176: ifne          1187
    1179: new           #197                // class java/util/NoSuchElementException
    1182: dup
    1183: invokespecial #198                // Method java/util/NoSuchElementException."<init>":()V
    1186: athrow
    1187: aload         12
    1189: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1194: checkcast     #117                // class PointI
    1197: astore        13
    1199: iconst_0
    1200: istore        14
    1202: aload         13
    1204: invokevirtual #204                // Method PointI.getX:()I
    1207: istore        13
    1209: aload         12
    1211: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1216: ifeq          1255
    1219: aload         12
    1221: invokeinterface #80,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1226: checkcast     #117                // class PointI
    1229: astore        14
    1231: iconst_0
    1232: istore        15
    1234: aload         14
    1236: invokevirtual #204                // Method PointI.getX:()I
    1239: istore        14
    1241: iload         13
    1243: iload         14
    1245: if_icmpge     1209
    1248: iload         14
    1250: istore        13
    1252: goto          1209
    1255: iload         13
    1257: istore        16
    1259: iload         11
    1261: iload         16
    1263: if_icmpgt     1318
    1266: aload         5
    1268: new           #117                // class PointI
    1271: dup
    1272: iload         11
    1274: iload         6
    1276: invokespecial #126                // Method PointI."<init>":(II)V
    1279: invokeinterface #207,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1284: ifeq          1297
    1287: aload         9
    1289: ldc           #209                // String #
    1291: invokevirtual #168                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
    1294: goto          1304
    1297: aload         9
    1299: ldc           #211                // String .
    1301: invokevirtual #168                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
    1304: pop
    1305: iload         11
    1307: iload         16
    1309: if_icmpeq     1318
    1312: iinc          11, 1
    1315: goto          1266
    1318: nop
    1319: aload         8
    1321: invokevirtual #181                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
    1324: astore        8
    1326: getstatic     #187                // Field java/lang/System.out:Ljava/io/PrintStream;
    1329: aload         8
    1331: invokevirtual #193                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1334: iload         6
    1336: iload         7
    1338: if_icmpeq     1347
    1341: iinc          6, 1
    1344: goto          1138
    1347: return

  private static final java.lang.String main$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #270                // String line
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: checkcast     #84                 // class java/lang/CharSequence
      11: invokestatic  #274                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      14: invokevirtual #275                // Method java/lang/Object.toString:()Ljava/lang/String;
      17: astore_1
      18: aload_1
      19: astore_2
      20: iconst_0
      21: istore_3
      22: aload_2
      23: checkcast     #84                 // class java/lang/CharSequence
      26: invokestatic  #279                // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      29: ifne          36
      32: aload_1
      33: goto          37
      36: aconst_null
      37: areturn

  private static final PointI main$lambda$7$lambda$5(int, PointI);
    Code:
       0: aload_1
       1: ldc_w         #282                // String point
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: aload_1
       9: invokevirtual #204                // Method PointI.getX:()I
      12: iload_0
      13: if_icmple     27
      16: iconst_2
      17: iload_0
      18: imul
      19: aload_1
      20: invokevirtual #204                // Method PointI.getX:()I
      23: isub
      24: goto          31
      27: aload_1
      28: invokevirtual #204                // Method PointI.getX:()I
      31: iconst_0
      32: iconst_2
      33: aconst_null
      34: invokestatic  #286                // Method PointI.copy$default:(LPointI;IIILjava/lang/Object;)LPointI;
      37: areturn

  private static final PointI main$lambda$7$lambda$6(int, PointI);
    Code:
       0: aload_1
       1: ldc_w         #282                // String point
       4: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: iconst_0
       9: aload_1
      10: invokevirtual #201                // Method PointI.getY:()I
      13: iload_0
      14: if_icmple     28
      17: iconst_2
      18: iload_0
      19: imul
      20: aload_1
      21: invokevirtual #201                // Method PointI.getY:()I
      24: isub
      25: goto          32
      28: aload_1
      29: invokevirtual #201                // Method PointI.getY:()I
      32: iconst_1
      33: aconst_null
      34: invokestatic  #286                // Method PointI.copy$default:(LPointI;IIILjava/lang/Object;)LPointI;
      37: areturn
}

Compiled from "Day13.kt"
final class Day13Kt$main$values$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function0<java.lang.String> {
  public static final Day13Kt$main$values$1 INSTANCE;

  Day13Kt$main$values$1();
    Code:
       0: aload_0
       1: iconst_0
       2: ldc           #11                 // class kotlin/io/ConsoleKt
       4: ldc           #13                 // String readLine
       6: ldc           #15                 // String readLine()Ljava/lang/String;
       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 java.lang.String invoke();
    Code:
       0: invokestatic  #24                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: areturn

  public java.lang.Object invoke();
    Code:
       0: aload_0
       1: invokevirtual #27                 // Method invoke:()Ljava/lang/String;
       4: areturn

  static {};
    Code:
       0: new           #2                  // class Day13Kt$main$values$1
       3: dup
       4: invokespecial #30                 // Method "<init>":()V
       7: putstatic     #33                 // Field INSTANCE:LDay13Kt$main$values$1;
      10: return
}