package yandex.y2020.qual

fun main() {
	val s = readLn()
	fun solve(s: String): Pair<Int, String>? {
		if (s.length == 1) return 0 to s
		if (s.length == 2) {
			if (s[0] == s[1]) return null
			return 0 to s
		}
		val (even, odd) = List(2) { s.filterIndexed { index, _ -> index % 2 == it } }
		if (even.all { it == even[0] } && even[0] !in odd) {
			val recursive = solve(odd) ?: return null
			return recursive.first * 2 to even[0] + recursive.second
		}
		if (odd.all { it == odd[0] } && odd[0] !in even) {
			val recursive = solve(even) ?: return null
			return recursive.first * 2 + 1 to odd[0] + recursive.second
		}
		return null
	}
	val solution = solve(s) ?: return println("No solution")
	println(solution.second + ('A'..'Z').filter { it !in solution.second }.joinToString(""))
	println(solution.first + 1)
}

private fun readLn() = readLine()!!

Compiled from "a.kt"
public final class yandex.y2020.qual.AKt {
  public static final void main();
    Code:
       0: invokestatic  #10                 // Method readLn:()Ljava/lang/String;
       3: astore_0
       4: aload_0
       5: invokestatic  #14                 // Method main$solve:(Ljava/lang/String;)Lkotlin/Pair;
       8: dup
       9: ifnonnull     23
      12: pop
      13: ldc           #16                 // String No solution
      15: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      18: swap
      19: invokevirtual #28                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      22: return
      23: astore_1
      24: new           #30                 // class java/lang/StringBuilder
      27: dup
      28: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
      31: aload_1
      32: invokevirtual #39                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      35: checkcast     #41                 // class java/lang/String
      38: invokevirtual #45                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      41: new           #47                 // class kotlin/ranges/CharRange
      44: dup
      45: bipush        65
      47: bipush        90
      49: invokespecial #50                 // Method kotlin/ranges/CharRange."<init>":(CC)V
      52: checkcast     #52                 // class java/lang/Iterable
      55: astore_2
      56: astore        11
      58: iconst_0
      59: istore_3
      60: aload_2
      61: astore        4
      63: new           #54                 // class java/util/ArrayList
      66: dup
      67: invokespecial #55                 // Method java/util/ArrayList."<init>":()V
      70: checkcast     #57                 // class java/util/Collection
      73: astore        5
      75: iconst_0
      76: istore        6
      78: aload         4
      80: invokeinterface #61,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      85: astore        7
      87: aload         7
      89: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      94: ifeq          158
      97: aload         7
      99: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     104: astore        8
     106: aload         8
     108: checkcast     #72                 // class java/lang/Character
     111: invokevirtual #76                 // Method java/lang/Character.charValue:()C
     114: istore        9
     116: iconst_0
     117: istore        10
     119: aload_1
     120: invokevirtual #39                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     123: checkcast     #78                 // class java/lang/CharSequence
     126: iload         9
     128: iconst_0
     129: iconst_2
     130: aconst_null
     131: invokestatic  #84                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
     134: ifne          141
     137: iconst_1
     138: goto          142
     141: iconst_0
     142: ifeq          87
     145: aload         5
     147: aload         8
     149: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     154: pop
     155: goto          87
     158: aload         5
     160: checkcast     #90                 // class java/util/List
     163: nop
     164: aload         11
     166: swap
     167: checkcast     #52                 // class java/lang/Iterable
     170: ldc           #92                 // String
     172: checkcast     #78                 // class java/lang/CharSequence
     175: aconst_null
     176: aconst_null
     177: iconst_0
     178: aconst_null
     179: aconst_null
     180: bipush        62
     182: aconst_null
     183: invokestatic  #98                 // 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;
     186: invokevirtual #45                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: invokevirtual #101                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     192: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
     195: swap
     196: invokevirtual #28                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     199: aload_1
     200: invokevirtual #104                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     203: checkcast     #106                // class java/lang/Number
     206: invokevirtual #110                // Method java/lang/Number.intValue:()I
     209: iconst_1
     210: iadd
     211: istore_2
     212: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
     215: iload_2
     216: invokevirtual #113                // Method java/io/PrintStream.println:(I)V
     219: return

  private static final java.lang.String readLn();
    Code:
       0: invokestatic  #135                // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #140                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: areturn

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

  private static final kotlin.Pair<java.lang.Integer, java.lang.String> main$solve(java.lang.String);
    Code:
       0: aload_0
       1: invokevirtual #149                // Method java/lang/String.length:()I
       4: iconst_1
       5: if_icmpne     17
       8: iconst_0
       9: invokestatic  #155                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: aload_0
      13: invokestatic  #161                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      16: areturn
      17: aload_0
      18: invokevirtual #149                // Method java/lang/String.length:()I
      21: iconst_2
      22: if_icmpne     49
      25: aload_0
      26: iconst_0
      27: invokevirtual #165                // Method java/lang/String.charAt:(I)C
      30: aload_0
      31: iconst_1
      32: invokevirtual #165                // Method java/lang/String.charAt:(I)C
      35: if_icmpne     40
      38: aconst_null
      39: areturn
      40: iconst_0
      41: invokestatic  #155                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      44: aload_0
      45: invokestatic  #161                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      48: areturn
      49: iconst_2
      50: istore_2
      51: new           #54                 // class java/util/ArrayList
      54: dup
      55: iload_2
      56: invokespecial #167                // Method java/util/ArrayList."<init>":(I)V
      59: astore_3
      60: iconst_0
      61: istore        4
      63: iload         4
      65: iload_2
      66: if_icmpge     226
      69: iload         4
      71: istore        5
      73: aload_3
      74: iload         5
      76: istore        6
      78: astore        23
      80: iconst_0
      81: istore        7
      83: aload_0
      84: astore        8
      86: iconst_0
      87: istore        9
      89: aload         8
      91: checkcast     #78                 // class java/lang/CharSequence
      94: astore        10
      96: new           #30                 // class java/lang/StringBuilder
      99: dup
     100: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
     103: checkcast     #169                // class java/lang/Appendable
     106: astore        11
     108: iconst_0
     109: istore        12
     111: aload         10
     113: astore        13
     115: iconst_0
     116: istore        14
     118: iconst_0
     119: istore        15
     121: iconst_0
     122: istore        16
     124: iload         16
     126: aload         13
     128: invokeinterface #170,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     133: if_icmpge     203
     136: aload         13
     138: iload         16
     140: invokeinterface #171,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     145: istore        17
     147: iload         15
     149: iinc          15, 1
     152: iload         17
     154: istore        18
     156: istore        19
     158: iconst_0
     159: istore        20
     161: iload         19
     163: istore        21
     165: iconst_0
     166: istore        22
     168: iload         21
     170: iconst_2
     171: irem
     172: iload         6
     174: if_icmpne     181
     177: iconst_1
     178: goto          182
     181: iconst_0
     182: ifeq          195
     185: aload         11
     187: iload         18
     189: invokeinterface #174,  2          // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
     194: pop
     195: nop
     196: nop
     197: iinc          16, 1
     200: goto          124
     203: nop
     204: aload         11
     206: checkcast     #30                 // class java/lang/StringBuilder
     209: invokevirtual #101                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     212: nop
     213: aload         23
     215: swap
     216: invokevirtual #175                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     219: pop
     220: iinc          4, 1
     223: goto          63
     226: aload_3
     227: checkcast     #90                 // class java/util/List
     230: astore_1
     231: aload_1
     232: iconst_0
     233: invokeinterface #179,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     238: checkcast     #41                 // class java/lang/String
     241: astore_2
     242: aload_1
     243: iconst_1
     244: invokeinterface #179,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     249: checkcast     #41                 // class java/lang/String
     252: astore_3
     253: aload_2
     254: checkcast     #78                 // class java/lang/CharSequence
     257: astore        4
     259: iconst_0
     260: istore        5
     262: iconst_0
     263: istore        6
     265: iload         6
     267: aload         4
     269: invokeinterface #170,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     274: if_icmpge     323
     277: aload         4
     279: iload         6
     281: invokeinterface #171,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     286: istore        7
     288: iload         7
     290: istore        8
     292: iconst_0
     293: istore        9
     295: iload         8
     297: aload_2
     298: iconst_0
     299: invokevirtual #165                // Method java/lang/String.charAt:(I)C
     302: if_icmpne     309
     305: iconst_1
     306: goto          310
     309: iconst_0
     310: ifne          317
     313: iconst_0
     314: goto          324
     317: iinc          6, 1
     320: goto          265
     323: iconst_1
     324: ifeq          415
     327: aload_3
     328: checkcast     #78                 // class java/lang/CharSequence
     331: aload_2
     332: iconst_0
     333: invokevirtual #165                // Method java/lang/String.charAt:(I)C
     336: iconst_0
     337: iconst_2
     338: aconst_null
     339: invokestatic  #84                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
     342: ifne          415
     345: aload_3
     346: invokestatic  #14                 // Method main$solve:(Ljava/lang/String;)Lkotlin/Pair;
     349: dup
     350: ifnonnull     356
     353: pop
     354: aconst_null
     355: areturn
     356: astore        4
     358: aload         4
     360: invokevirtual #104                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     363: checkcast     #106                // class java/lang/Number
     366: invokevirtual #110                // Method java/lang/Number.intValue:()I
     369: iconst_2
     370: imul
     371: invokestatic  #155                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     374: aload_2
     375: iconst_0
     376: invokevirtual #165                // Method java/lang/String.charAt:(I)C
     379: istore        5
     381: aload         4
     383: invokevirtual #39                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     386: checkcast     #41                 // class java/lang/String
     389: astore        6
     391: new           #30                 // class java/lang/StringBuilder
     394: dup
     395: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
     398: iload         5
     400: invokevirtual #182                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     403: aload         6
     405: invokevirtual #45                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     408: invokevirtual #101                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     411: invokestatic  #161                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     414: areturn
     415: aload_3
     416: checkcast     #78                 // class java/lang/CharSequence
     419: astore        4
     421: iconst_0
     422: istore        5
     424: iconst_0
     425: istore        6
     427: iload         6
     429: aload         4
     431: invokeinterface #170,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     436: if_icmpge     485
     439: aload         4
     441: iload         6
     443: invokeinterface #171,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     448: istore        7
     450: iload         7
     452: istore        8
     454: iconst_0
     455: istore        9
     457: iload         8
     459: aload_3
     460: iconst_0
     461: invokevirtual #165                // Method java/lang/String.charAt:(I)C
     464: if_icmpne     471
     467: iconst_1
     468: goto          472
     471: iconst_0
     472: ifne          479
     475: iconst_0
     476: goto          486
     479: iinc          6, 1
     482: goto          427
     485: iconst_1
     486: ifeq          579
     489: aload_2
     490: checkcast     #78                 // class java/lang/CharSequence
     493: aload_3
     494: iconst_0
     495: invokevirtual #165                // Method java/lang/String.charAt:(I)C
     498: iconst_0
     499: iconst_2
     500: aconst_null
     501: invokestatic  #84                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
     504: ifne          579
     507: aload_2
     508: invokestatic  #14                 // Method main$solve:(Ljava/lang/String;)Lkotlin/Pair;
     511: dup
     512: ifnonnull     518
     515: pop
     516: aconst_null
     517: areturn
     518: astore        4
     520: aload         4
     522: invokevirtual #104                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     525: checkcast     #106                // class java/lang/Number
     528: invokevirtual #110                // Method java/lang/Number.intValue:()I
     531: iconst_2
     532: imul
     533: iconst_1
     534: iadd
     535: invokestatic  #155                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     538: aload_3
     539: iconst_0
     540: invokevirtual #165                // Method java/lang/String.charAt:(I)C
     543: istore        5
     545: aload         4
     547: invokevirtual #39                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     550: checkcast     #41                 // class java/lang/String
     553: astore        6
     555: new           #30                 // class java/lang/StringBuilder
     558: dup
     559: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
     562: iload         5
     564: invokevirtual #182                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     567: aload         6
     569: invokevirtual #45                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     572: invokevirtual #101                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     575: invokestatic  #161                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     578: areturn
     579: aconst_null
     580: areturn
}


package yandex.y2020.qual

import kotlin.random.Random

fun main() {
	readLn()
	var treap: PersistentTreap? = null
	var ans = 0.toBigInteger()
	val a = readInts()
	println(a.mapIndexed { index, x ->
		ans += (PersistentTreap.split(treap, (x + 1L) * a.size)[1]?.sum ?: 0).toBigInteger()
		treap = PersistentTreap.add(treap, x.toLong() * a.size + index, x)
		ans
	}.joinToString(" "))
}

internal class PersistentTreap private constructor(val key: Long, val value: Int, val h: Int, val left: PersistentTreap?, val right: PersistentTreap?) {
	val sum: Long

	constructor(key: Long, value: Int, left: PersistentTreap?, right: PersistentTreap?) : this(key, value, r.nextInt(), left, right)

	companion object {
		var r = Random(566)
		fun split(treap: PersistentTreap?, keySplit: Long): Array<PersistentTreap?> {
			if (treap == null) return arrayOfNulls(2)
			val split: Array<PersistentTreap?>
			if (treap.key < keySplit) {
				split = split(treap.right, keySplit)
				split[0] = PersistentTreap(treap.key, treap.value, treap.h, treap.left, split[0])
			} else {
				split = split(treap.left, keySplit)
				split[1] = PersistentTreap(treap.key, treap.value, treap.h, split[1], treap.right)
			}
			return split
		}

		fun merge(left: PersistentTreap?, right: PersistentTreap?): PersistentTreap? {
			if (left == null) return right
			if (right == null) return left
			return if (left.h > right.h) {
				PersistentTreap(left.key, left.value, left.h, left.left, merge(left.right, right))
			} else PersistentTreap(right.key, right.value, right.h, merge(left, right.left), right.right)
		}

		fun add(treap: PersistentTreap?, key: Long, value: Int): PersistentTreap? {
			val split = split(treap, key)
			return merge(split[0], merge(PersistentTreap(key, value, null, null), split[1]))
		}
	}

	init {
		// calcMeta
		var sum = 0L
		if (left != null) {
			sum = left.sum
		}
		sum += value
		if (right != null) {
			sum += right.sum
		}
		this.sum = sum
	}
}

private fun readLn() = readLine()!!
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "e.kt"
public final class yandex.y2020.qual.EKt {
  public static final void main();
    Code:
       0: invokestatic  #10                 // Method readLn:()Ljava/lang/String;
       3: pop
       4: aconst_null
       5: astore_0
       6: aconst_null
       7: astore_1
       8: lconst_0
       9: invokestatic  #16                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
      12: dup
      13: ldc           #18                 // String valueOf(...)
      15: invokestatic  #24                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      18: astore_1
      19: invokestatic  #28                 // Method readInts:()Ljava/util/List;
      22: astore_2
      23: aload_2
      24: checkcast     #30                 // class java/lang/Iterable
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_3
      32: astore        5
      34: new           #32                 // class java/util/ArrayList
      37: dup
      38: aload_3
      39: bipush        10
      41: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      44: invokespecial #42                 // Method java/util/ArrayList."<init>":(I)V
      47: checkcast     #44                 // class java/util/Collection
      50: astore        6
      52: iconst_0
      53: istore        7
      55: iconst_0
      56: istore        8
      58: aload         5
      60: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      65: astore        9
      67: aload         9
      69: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      74: ifeq          222
      77: aload         9
      79: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      84: astore        10
      86: aload         6
      88: iload         8
      90: iinc          8, 1
      93: istore        11
      95: iload         11
      97: ifge          103
     100: invokestatic  #61                 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     103: iload         11
     105: aload         10
     107: checkcast     #63                 // class java/lang/Number
     110: invokevirtual #67                 // Method java/lang/Number.intValue:()I
     113: istore        12
     115: istore        13
     117: astore        17
     119: iconst_0
     120: istore        14
     122: aload_1
     123: astore        15
     125: getstatic     #73                 // Field yandex/y2020/qual/PersistentTreap.Companion:Lyandex/y2020/qual/PersistentTreap$Companion;
     128: aload_0
     129: iload         12
     131: i2l
     132: lconst_1
     133: ladd
     134: aload_2
     135: invokeinterface #78,  1           // InterfaceMethod java/util/List.size:()I
     140: i2l
     141: lmul
     142: invokevirtual #84                 // Method yandex/y2020/qual/PersistentTreap$Companion.split:(Lyandex/y2020/qual/PersistentTreap;J)[Lyandex/y2020/qual/PersistentTreap;
     145: iconst_1
     146: aaload
     147: dup
     148: ifnull        157
     151: invokevirtual #88                 // Method yandex/y2020/qual/PersistentTreap.getSum:()J
     154: goto          159
     157: pop
     158: lconst_0
     159: invokestatic  #16                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
     162: dup
     163: ldc           #18                 // String valueOf(...)
     165: invokestatic  #24                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     168: astore        16
     170: aload         15
     172: aload         16
     174: invokevirtual #92                 // Method java/math/BigInteger.add:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     177: dup
     178: ldc           #94                 // String add(...)
     180: invokestatic  #24                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     183: astore_1
     184: getstatic     #73                 // Field yandex/y2020/qual/PersistentTreap.Companion:Lyandex/y2020/qual/PersistentTreap$Companion;
     187: aload_0
     188: iload         12
     190: i2l
     191: aload_2
     192: invokeinterface #78,  1           // InterfaceMethod java/util/List.size:()I
     197: i2l
     198: lmul
     199: iload         13
     201: i2l
     202: ladd
     203: iload         12
     205: invokevirtual #97                 // Method yandex/y2020/qual/PersistentTreap$Companion.add:(Lyandex/y2020/qual/PersistentTreap;JI)Lyandex/y2020/qual/PersistentTreap;
     208: astore_0
     209: aload_1
     210: aload         17
     212: swap
     213: invokeinterface #100,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     218: pop
     219: goto          67
     222: aload         6
     224: checkcast     #75                 // class java/util/List
     227: nop
     228: checkcast     #30                 // class java/lang/Iterable
     231: ldc           #102                // String
     233: checkcast     #104                // class java/lang/CharSequence
     236: aconst_null
     237: aconst_null
     238: iconst_0
     239: aconst_null
     240: aconst_null
     241: bipush        62
     243: aconst_null
     244: invokestatic  #108                // 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;
     247: astore_3
     248: getstatic     #114                // Field java/lang/System.out:Ljava/io/PrintStream;
     251: aload_3
     252: invokevirtual #120                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     255: return

  private static final java.lang.String readLn();
    Code:
       0: invokestatic  #143                // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #146                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: areturn

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #10                 // Method readLn:()Ljava/lang/String;
       3: checkcast     #104                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #150                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #102                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #156                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      25: areturn

  private static final java.util.List<java.lang.Integer> readInts();
    Code:
       0: invokestatic  #159                // Method readStrings:()Ljava/util/List;
       3: checkcast     #30                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #32                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #42                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #44                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #150                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #165                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #168                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #100,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #75                 // class java/util/List
      96: nop
      97: areturn

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


package juuxel.basiks.iterable

/**
 * A combined iterable of types [A] and [B].
 *
 * @param outer the outer iterable of type [A]
 * @param inner the inner iterable of type [B]
 */
private class CombinedIterable<A, B>(
    private val outer: Iterable<A>,
    private val inner: Iterable<B>
): Iterable<Pair<A, B>> {
    override fun iterator() = outer.flatMap { i ->
        inner.map { j ->
            i to j
        }
    }.iterator()
}

/**
 * Combines the two iterables.
 *
 * ### Example
 * ```
 * val letters = listOf('A', 'B', 'C')
 * val numbers = listOf(1, 2, 3)
 *
 * for ((letter, number) in combine(letters, numbers))
 *     println("$letter + $number")
 *
 * Output:
 * A: 1
 * A: 2
 * A: 3
 * B: 1
 * B: 2
 * B: 3
 * C: 1
 * C: 2
 * C: 3
 * ```
 */
fun <A, B> combine(outer: Iterable<A>, inner: Iterable<B>): Iterable<Pair<A, B>> =
    CombinedIterable(outer, inner)

inline fun <A, B, R> Iterable<Pair<A, B>>.map(transform: (A, B) -> R): List<R> =
    map { (a, b) -> transform(a, b) }

inline fun <A, B, R> Iterable<Pair<A, B>>.flatMap(transform: (A, B) -> Iterable<R>): List<R> =
    flatMap { (a, b) -> transform(a, b) }

Compiled from "CombinedIterable.kt"
final class juuxel.basiks.iterable.CombinedIterable<A, B> implements java.lang.Iterable<kotlin.Pair<? extends A, ? extends B>>, kotlin.jvm.internal.markers.KMappedMarker {
  private final java.lang.Iterable<A> outer;

  private final java.lang.Iterable<B> inner;

  public juuxel.basiks.iterable.CombinedIterable(java.lang.Iterable<? extends A>, java.lang.Iterable<? extends B>);
    Code:
       0: aload_1
       1: ldc           #15                 // String outer
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #23                 // String inner
       9: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokespecial #26                 // Method java/lang/Object."<init>":()V
      16: aload_0
      17: aload_1
      18: putfield      #29                 // Field outer:Ljava/lang/Iterable;
      21: aload_0
      22: aload_2
      23: putfield      #31                 // Field inner:Ljava/lang/Iterable;
      26: return

  public java.util.Iterator<kotlin.Pair<A, B>> iterator();
    Code:
       0: aload_0
       1: getfield      #29                 // Field outer:Ljava/lang/Iterable;
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #38                 // class java/util/ArrayList
      12: dup
      13: invokespecial #39                 // Method java/util/ArrayList."<init>":()V
      16: checkcast     #41                 // class java/util/Collection
      19: astore        4
      21: iconst_0
      22: istore        5
      24: aload_3
      25: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      30: astore        6
      32: aload         6
      34: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      39: ifeq          174
      42: aload         6
      44: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      49: astore        7
      51: aload         7
      53: astore        8
      55: iconst_0
      56: istore        9
      58: aload_0
      59: getfield      #31                 // Field inner:Ljava/lang/Iterable;
      62: astore        10
      64: iconst_0
      65: istore        11
      67: aload         10
      69: astore        12
      71: new           #38                 // class java/util/ArrayList
      74: dup
      75: aload         10
      77: bipush        10
      79: invokestatic  #59                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      82: invokespecial #62                 // Method java/util/ArrayList."<init>":(I)V
      85: checkcast     #41                 // class java/util/Collection
      88: astore        13
      90: iconst_0
      91: istore        14
      93: aload         12
      95: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     100: astore        15
     102: aload         15
     104: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          151
     112: aload         15
     114: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: astore        16
     121: aload         13
     123: aload         16
     125: astore        17
     127: astore        18
     129: iconst_0
     130: istore        19
     132: aload         8
     134: aload         17
     136: invokestatic  #68                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     139: aload         18
     141: swap
     142: invokeinterface #72,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     147: pop
     148: goto          102
     151: aload         13
     153: checkcast     #74                 // class java/util/List
     156: nop
     157: checkcast     #7                  // class java/lang/Iterable
     160: nop
     161: astore        8
     163: aload         4
     165: aload         8
     167: invokestatic  #78                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     170: pop
     171: goto          32
     174: aload         4
     176: checkcast     #74                 // class java/util/List
     179: nop
     180: invokeinterface #79,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     185: areturn
}

Compiled from "CombinedIterable.kt"
public final class juuxel.basiks.iterable.CombinedIterableKt {
  public static final <A, B> java.lang.Iterable<kotlin.Pair<A, B>> combine(java.lang.Iterable<? extends A>, java.lang.Iterable<? extends B>);
    Code:
       0: aload_0
       1: ldc           #10                 // String outer
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #18                 // String inner
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #20                 // class juuxel/basiks/iterable/CombinedIterable
      15: dup
      16: aload_0
      17: aload_1
      18: invokespecial #24                 // Method juuxel/basiks/iterable/CombinedIterable."<init>":(Ljava/lang/Iterable;Ljava/lang/Iterable;)V
      21: checkcast     #26                 // class java/lang/Iterable
      24: areturn

  public static final <A, B, R> java.util.List<R> map(java.lang.Iterable<? extends kotlin.Pair<? extends A, ? extends B>>, kotlin.jvm.functions.Function2<? super A, ? super B, ? extends R>);
    Code:
       0: aload_0
       1: ldc           #32                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #34                 // String transform
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_2
      14: aload_0
      15: astore_3
      16: iconst_0
      17: istore        4
      19: aload_3
      20: astore        5
      22: new           #36                 // class java/util/ArrayList
      25: dup
      26: aload_3
      27: bipush        10
      29: invokestatic  #42                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      32: invokespecial #45                 // Method java/util/ArrayList."<init>":(I)V
      35: checkcast     #47                 // class java/util/Collection
      38: astore        6
      40: iconst_0
      41: istore        7
      43: aload         5
      45: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        8
      52: aload         8
      54: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          121
      62: aload         8
      64: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        9
      71: aload         6
      73: aload         9
      75: checkcast     #63                 // class kotlin/Pair
      78: astore        10
      80: astore        14
      82: iconst_0
      83: istore        11
      85: aload         10
      87: invokevirtual #66                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      90: astore        12
      92: aload         10
      94: invokevirtual #69                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      97: astore        13
      99: aload_1
     100: aload         12
     102: aload         13
     104: invokeinterface #75,  3           // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     109: aload         14
     111: swap
     112: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     117: pop
     118: goto          52
     121: aload         6
     123: checkcast     #81                 // class java/util/List
     126: nop
     127: areturn

  public static final <A, B, R> java.util.List<R> flatMap(java.lang.Iterable<? extends kotlin.Pair<? extends A, ? extends B>>, kotlin.jvm.functions.Function2<? super A, ? super B, ? extends java.lang.Iterable<? extends R>>);
    Code:
       0: aload_0
       1: ldc           #32                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #34                 // String transform
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_2
      14: aload_0
      15: astore_3
      16: iconst_0
      17: istore        4
      19: aload_3
      20: astore        5
      22: new           #36                 // class java/util/ArrayList
      25: dup
      26: invokespecial #100                // Method java/util/ArrayList."<init>":()V
      29: checkcast     #47                 // class java/util/Collection
      32: astore        6
      34: iconst_0
      35: istore        7
      37: aload         5
      39: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      44: astore        8
      46: aload         8
      48: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          115
      56: aload         8
      58: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      63: astore        9
      65: aload         9
      67: checkcast     #63                 // class kotlin/Pair
      70: astore        10
      72: iconst_0
      73: istore        11
      75: aload         10
      77: invokevirtual #66                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      80: astore        12
      82: aload         10
      84: invokevirtual #69                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      87: astore        13
      89: aload_1
      90: aload         12
      92: aload         13
      94: invokeinterface #75,  3           // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      99: checkcast     #26                 // class java/lang/Iterable
     102: astore        10
     104: aload         6
     106: aload         10
     108: invokestatic  #104                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     111: pop
     112: goto          46
     115: aload         6
     117: checkcast     #81                 // class java/util/List
     120: nop
     121: areturn
}


package com.adventofcode

import com.adventofcode.Day.process
import com.adventofcode.Day.solution
import java.util.*

object Day {
  private var script = false
  private val scheme = mutableListOf<String>()
  private val stackedColumns = mutableListOf<LinkedList<Char>>()

  fun process(line: String) {
    if (script) {
      return processCode(line)
    }
    if (line.isBlank()) {
      processScheme()
      script = true
      return
    }
    scheme.add(line)
  }

  private fun processScheme() {
    val columns = scheme.last().split("   ").last().trim().toInt()
    for (x in 0 until columns) {
      stackedColumns.add(LinkedList())
    }
    for (line in scheme.dropLast(1).asReversed()) {
      line.windowed(3, 4).forEachIndexed { idx, crateEncoded ->
        if (crateEncoded.isNotBlank()) {
          check(crateEncoded.length == 3 && crateEncoded.first() == '[' && crateEncoded.last() == ']')
          val crate = crateEncoded[1]
          stackedColumns[idx].push(crate)
        }
      }
    }
  }

  private fun processCode(line: String) {
    val (crates, from, to) = line.split("move ", " from ", " to ").filterNot(String::isBlank).map(String::toInt)
    val fromColumn = stackedColumns[from - 1]
    val toColumn = stackedColumns[to - 1]
    if(crates == 1) {
      fromColumn.pop().let(toColumn::push)
    } else {
      val buffered = fromColumn.take(crates)
      for(x in buffered.asReversed()) {
        fromColumn.removeFirst()
        toColumn.push(x)
      }
    }
  }

  fun solution(): String {
    return stackedColumns.map(LinkedList<Char>::getFirst).joinToString("")
  }
}

fun main() {
  ::main.javaClass
    .getResourceAsStream("/input")!!
    .bufferedReader()
    .forEachLine(::process)
  println(solution())
}

Compiled from "Day.kt"
final class com.adventofcode.DayKt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.lang.String, kotlin.Unit> {
  com.adventofcode.DayKt$main$2(java.lang.Object);
    Code:
       0: aload_0
       1: iconst_1
       2: aload_1
       3: ldc           #11                 // class com/adventofcode/Day
       5: ldc           #13                 // String process
       7: ldc           #15                 // String process(Ljava/lang/String;)V
       9: iconst_0
      10: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Object;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      13: return

  public final void invoke(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #26                 // String p0
       3: invokestatic  #32                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #34                 // Field receiver:Ljava/lang/Object;
      10: checkcast     #11                 // class com/adventofcode/Day
      13: aload_1
      14: invokevirtual #36                 // Method com/adventofcode/Day.process:(Ljava/lang/String;)V
      17: return

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #40                 // class java/lang/String
       5: invokevirtual #42                 // Method invoke:(Ljava/lang/String;)V
       8: getstatic     #48                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      11: areturn
}

Compiled from "Day.kt"
public final class com.adventofcode.DayKt {
  public static final void main();
    Code:
       0: getstatic     #12                 // Field com/adventofcode/DayKt$main$1.INSTANCE:Lcom/adventofcode/DayKt$main$1;
       3: invokevirtual #16                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
       6: ldc           #18                 // String /input
       8: invokevirtual #24                 // Method java/lang/Class.getResourceAsStream:(Ljava/lang/String;)Ljava/io/InputStream;
      11: dup
      12: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      15: astore_0
      16: getstatic     #36                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      19: astore_1
      20: new           #38                 // class java/io/InputStreamReader
      23: dup
      24: aload_0
      25: aload_1
      26: invokespecial #42                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      29: checkcast     #44                 // class java/io/Reader
      32: astore_2
      33: sipush        8192
      36: istore_3
      37: aload_2
      38: instanceof    #46                 // class java/io/BufferedReader
      41: ifeq          51
      44: aload_2
      45: checkcast     #46                 // class java/io/BufferedReader
      48: goto          60
      51: new           #46                 // class java/io/BufferedReader
      54: dup
      55: aload_2
      56: iload_3
      57: invokespecial #49                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      60: checkcast     #44                 // class java/io/Reader
      63: new           #51                 // class com/adventofcode/DayKt$main$2
      66: dup
      67: getstatic     #56                 // Field com/adventofcode/Day.INSTANCE:Lcom/adventofcode/Day;
      70: invokespecial #58                 // Method com/adventofcode/DayKt$main$2."<init>":(Ljava/lang/Object;)V
      73: checkcast     #60                 // class kotlin/jvm/functions/Function1
      76: invokestatic  #66                 // Method kotlin/io/TextStreamsKt.forEachLine:(Ljava/io/Reader;Lkotlin/jvm/functions/Function1;)V
      79: getstatic     #56                 // Field com/adventofcode/Day.INSTANCE:Lcom/adventofcode/Day;
      82: invokevirtual #70                 // Method com/adventofcode/Day.solution:()Ljava/lang/String;
      85: getstatic     #76                 // Field java/lang/System.out:Ljava/io/PrintStream;
      88: swap
      89: invokevirtual #81                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      92: return

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

Compiled from "Day.kt"
final class com.adventofcode.DayKt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function0<kotlin.Unit> {
  public static final com.adventofcode.DayKt$main$1 INSTANCE;

  com.adventofcode.DayKt$main$1();
    Code:
       0: aload_0
       1: iconst_0
       2: ldc           #11                 // class com/adventofcode/DayKt
       4: ldc           #13                 // String main
       6: ldc           #15                 // String main()V
       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 void invoke();
    Code:
       0: invokestatic  #23                 // Method com/adventofcode/DayKt.main:()V
       3: return

  public java.lang.Object invoke();
    Code:
       0: aload_0
       1: invokevirtual #26                 // Method invoke:()V
       4: getstatic     #32                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
       7: areturn

  static {};
    Code:
       0: new           #2                  // class com/adventofcode/DayKt$main$1
       3: dup
       4: invokespecial #35                 // Method "<init>":()V
       7: putstatic     #37                 // Field INSTANCE:Lcom/adventofcode/DayKt$main$1;
      10: return
}

Compiled from "Day.kt"
public final class com.adventofcode.Day {
  public static final com.adventofcode.Day INSTANCE;

  private static boolean script;

  private static final java.util.List<java.lang.String> scheme;

  private static final java.util.List<java.util.LinkedList<java.lang.Character>> stackedColumns;

  private com.adventofcode.Day();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final void process(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String line
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #25                 // Field script:Z
       9: ifeq          18
      12: aload_0
      13: aload_1
      14: invokespecial #28                 // Method processCode:(Ljava/lang/String;)V
      17: return
      18: aload_1
      19: checkcast     #30                 // class java/lang/CharSequence
      22: invokestatic  #36                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      25: ifeq          37
      28: aload_0
      29: invokespecial #39                 // Method processScheme:()V
      32: iconst_1
      33: putstatic     #25                 // Field script:Z
      36: return
      37: getstatic     #43                 // Field scheme:Ljava/util/List;
      40: aload_1
      41: invokeinterface #49,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      46: pop
      47: return

  private final void processScheme();
    Code:
       0: getstatic     #43                 // Field scheme:Ljava/util/List;
       3: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
       6: checkcast     #30                 // class java/lang/CharSequence
       9: iconst_1
      10: anewarray     #58                 // class java/lang/String
      13: astore_2
      14: aload_2
      15: iconst_0
      16: ldc           #60                 // String
      18: aastore
      19: aload_2
      20: iconst_0
      21: iconst_0
      22: bipush        6
      24: aconst_null
      25: invokestatic  #64                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      28: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      31: checkcast     #58                 // class java/lang/String
      34: checkcast     #30                 // class java/lang/CharSequence
      37: invokestatic  #68                 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      40: invokevirtual #72                 // Method java/lang/Object.toString:()Ljava/lang/String;
      43: invokestatic  #78                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      46: istore_1
      47: iconst_0
      48: istore_2
      49: iload_2
      50: iload_1
      51: if_icmpge     76
      54: getstatic     #81                 // Field stackedColumns:Ljava/util/List;
      57: new           #83                 // class java/util/LinkedList
      60: dup
      61: invokespecial #84                 // Method java/util/LinkedList."<init>":()V
      64: invokeinterface #49,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      69: pop
      70: iinc          2, 1
      73: goto          49
      76: getstatic     #43                 // Field scheme:Ljava/util/List;
      79: iconst_1
      80: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;
      83: invokestatic  #92                 // Method kotlin/collections/CollectionsKt.asReversed:(Ljava/util/List;)Ljava/util/List;
      86: invokeinterface #96,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      91: astore_2
      92: aload_2
      93: invokeinterface #102,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      98: ifeq          301
     101: aload_2
     102: invokeinterface #106,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     107: checkcast     #58                 // class java/lang/String
     110: astore_3
     111: aload_3
     112: checkcast     #30                 // class java/lang/CharSequence
     115: iconst_3
     116: iconst_4
     117: iconst_0
     118: iconst_4
     119: aconst_null
     120: invokestatic  #110                // Method kotlin/text/StringsKt.windowed$default:(Ljava/lang/CharSequence;IIZILjava/lang/Object;)Ljava/util/List;
     123: checkcast     #112                // class java/lang/Iterable
     126: astore        4
     128: iconst_0
     129: istore        5
     131: iconst_0
     132: istore        6
     134: aload         4
     136: invokeinterface #113,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     141: astore        7
     143: aload         7
     145: invokeinterface #102,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     150: ifeq          297
     153: aload         7
     155: invokeinterface #106,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     160: astore        8
     162: iload         6
     164: iinc          6, 1
     167: istore        9
     169: iload         9
     171: ifge          177
     174: invokestatic  #116                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     177: iload         9
     179: aload         8
     181: checkcast     #58                 // class java/lang/String
     184: astore        10
     186: istore        11
     188: iconst_0
     189: istore        12
     191: aload         10
     193: checkcast     #30                 // class java/lang/CharSequence
     196: invokestatic  #36                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     199: ifne          206
     202: iconst_1
     203: goto          207
     206: iconst_0
     207: ifeq          292
     210: aload         10
     212: invokevirtual #120                // Method java/lang/String.length:()I
     215: iconst_3
     216: if_icmpne     249
     219: aload         10
     221: checkcast     #30                 // class java/lang/CharSequence
     224: invokestatic  #124                // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C
     227: bipush        91
     229: if_icmpne     249
     232: aload         10
     234: checkcast     #30                 // class java/lang/CharSequence
     237: invokestatic  #126                // Method kotlin/text/StringsKt.last:(Ljava/lang/CharSequence;)C
     240: bipush        93
     242: if_icmpne     249
     245: iconst_1
     246: goto          250
     249: iconst_0
     250: ifne          263
     253: new           #128                // class java/lang/IllegalStateException
     256: dup
     257: ldc           #130                // String Check failed.
     259: invokespecial #132                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     262: athrow
     263: aload         10
     265: iconst_1
     266: invokevirtual #136                // Method java/lang/String.charAt:(I)C
     269: istore        13
     271: getstatic     #81                 // Field stackedColumns:Ljava/util/List;
     274: iload         11
     276: invokeinterface #140,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     281: checkcast     #83                 // class java/util/LinkedList
     284: iload         13
     286: invokestatic  #146                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     289: invokevirtual #150                // Method java/util/LinkedList.push:(Ljava/lang/Object;)V
     292: nop
     293: nop
     294: goto          143
     297: nop
     298: goto          92
     301: return

  private final void processCode(java.lang.String);
    Code:
       0: aload_1
       1: checkcast     #30                 // class java/lang/CharSequence
       4: iconst_3
       5: anewarray     #58                 // class java/lang/String
       8: astore_3
       9: aload_3
      10: iconst_0
      11: ldc           #166                // String move
      13: aastore
      14: aload_3
      15: iconst_1
      16: ldc           #168                // String  from
      18: aastore
      19: aload_3
      20: iconst_2
      21: ldc           #170                // String  to
      23: aastore
      24: aload_3
      25: iconst_0
      26: iconst_0
      27: bipush        6
      29: aconst_null
      30: invokestatic  #64                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      33: checkcast     #112                // class java/lang/Iterable
      36: astore_3
      37: iconst_0
      38: istore        4
      40: aload_3
      41: astore        5
      43: new           #172                // class java/util/ArrayList
      46: dup
      47: invokespecial #173                // Method java/util/ArrayList."<init>":()V
      50: checkcast     #175                // class java/util/Collection
      53: astore        6
      55: iconst_0
      56: istore        7
      58: aload         5
      60: invokeinterface #113,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      65: astore        8
      67: aload         8
      69: invokeinterface #102,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      74: ifeq          120
      77: aload         8
      79: invokeinterface #106,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      84: astore        9
      86: aload         9
      88: checkcast     #58                 // class java/lang/String
      91: astore        10
      93: iconst_0
      94: istore        11
      96: aload         10
      98: checkcast     #30                 // class java/lang/CharSequence
     101: invokestatic  #36                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     104: ifne          67
     107: aload         6
     109: aload         9
     111: invokeinterface #176,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     116: pop
     117: goto          67
     120: aload         6
     122: checkcast     #45                 // class java/util/List
     125: nop
     126: checkcast     #112                // class java/lang/Iterable
     129: astore_3
     130: nop
     131: iconst_0
     132: istore        4
     134: aload_3
     135: astore        5
     137: new           #172                // class java/util/ArrayList
     140: dup
     141: aload_3
     142: bipush        10
     144: invokestatic  #180                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     147: invokespecial #183                // Method java/util/ArrayList."<init>":(I)V
     150: checkcast     #175                // class java/util/Collection
     153: astore        6
     155: iconst_0
     156: istore        7
     158: aload         5
     160: invokeinterface #113,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     165: astore        8
     167: aload         8
     169: invokeinterface #102,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     174: ifeq          221
     177: aload         8
     179: invokeinterface #106,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     184: astore        9
     186: aload         6
     188: aload         9
     190: checkcast     #58                 // class java/lang/String
     193: astore        10
     195: astore        12
     197: iconst_0
     198: istore        11
     200: aload         10
     202: invokestatic  #78                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     205: nop
     206: invokestatic  #186                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     209: aload         12
     211: swap
     212: invokeinterface #176,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     217: pop
     218: goto          167
     221: aload         6
     223: checkcast     #45                 // class java/util/List
     226: nop
     227: astore_2
     228: aload_2
     229: iconst_0
     230: invokeinterface #140,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     235: checkcast     #188                // class java/lang/Number
     238: invokevirtual #191                // Method java/lang/Number.intValue:()I
     241: istore_3
     242: aload_2
     243: iconst_1
     244: invokeinterface #140,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     249: checkcast     #188                // class java/lang/Number
     252: invokevirtual #191                // Method java/lang/Number.intValue:()I
     255: istore        4
     257: aload_2
     258: iconst_2
     259: invokeinterface #140,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     264: checkcast     #188                // class java/lang/Number
     267: invokevirtual #191                // Method java/lang/Number.intValue:()I
     270: istore        5
     272: getstatic     #81                 // Field stackedColumns:Ljava/util/List;
     275: iload         4
     277: iconst_1
     278: isub
     279: invokeinterface #140,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     284: checkcast     #83                 // class java/util/LinkedList
     287: astore        6
     289: getstatic     #81                 // Field stackedColumns:Ljava/util/List;
     292: iload         5
     294: iconst_1
     295: isub
     296: invokeinterface #140,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     301: checkcast     #83                 // class java/util/LinkedList
     304: astore        7
     306: iload_3
     307: iconst_1
     308: if_icmpne     334
     311: aload         6
     313: invokevirtual #194                // Method java/util/LinkedList.pop:()Ljava/lang/Object;
     316: checkcast     #142                // class java/lang/Character
     319: astore        9
     321: iconst_0
     322: istore        10
     324: aload         7
     326: aload         9
     328: invokevirtual #150                // Method java/util/LinkedList.push:(Ljava/lang/Object;)V
     331: goto          401
     334: aload         6
     336: checkcast     #112                // class java/lang/Iterable
     339: iload_3
     340: invokestatic  #198                // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
     343: astore        8
     345: aload         8
     347: invokestatic  #92                 // Method kotlin/collections/CollectionsKt.asReversed:(Ljava/util/List;)Ljava/util/List;
     350: invokeinterface #96,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     355: astore        9
     357: aload         9
     359: invokeinterface #102,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     364: ifeq          401
     367: aload         9
     369: invokeinterface #106,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     374: checkcast     #142                // class java/lang/Character
     377: invokevirtual #202                // Method java/lang/Character.charValue:()C
     380: istore        10
     382: aload         6
     384: invokevirtual #205                // Method java/util/LinkedList.removeFirst:()Ljava/lang/Object;
     387: pop
     388: aload         7
     390: iload         10
     392: invokestatic  #146                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     395: invokevirtual #150                // Method java/util/LinkedList.push:(Ljava/lang/Object;)V
     398: goto          357
     401: return

  public final java.lang.String solution();
    Code:
       0: getstatic     #81                 // Field stackedColumns:Ljava/util/List;
       3: checkcast     #112                // class java/lang/Iterable
       6: astore_1
       7: iconst_0
       8: istore_2
       9: aload_1
      10: astore_3
      11: new           #172                // class java/util/ArrayList
      14: dup
      15: aload_1
      16: bipush        10
      18: invokestatic  #180                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #183                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #175                // class java/util/Collection
      27: astore        4
      29: iconst_0
      30: istore        5
      32: aload_3
      33: invokeinterface #113,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        6
      40: aload         6
      42: invokeinterface #102,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          93
      50: aload         6
      52: invokeinterface #106,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        7
      59: aload         4
      61: aload         7
      63: checkcast     #83                 // class java/util/LinkedList
      66: astore        8
      68: astore        10
      70: iconst_0
      71: istore        9
      73: aload         8
      75: invokevirtual #233                // Method java/util/LinkedList.getFirst:()Ljava/lang/Object;
      78: checkcast     #142                // class java/lang/Character
      81: aload         10
      83: swap
      84: invokeinterface #176,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      89: pop
      90: goto          40
      93: aload         4
      95: checkcast     #45                 // class java/util/List
      98: nop
      99: checkcast     #112                // class java/lang/Iterable
     102: ldc           #235                // String
     104: checkcast     #30                 // class java/lang/CharSequence
     107: aconst_null
     108: aconst_null
     109: iconst_0
     110: aconst_null
     111: aconst_null
     112: bipush        62
     114: aconst_null
     115: invokestatic  #239                // 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;
     118: areturn

  static {};
    Code:
       0: new           #2                  // class com/adventofcode/Day
       3: dup
       4: invokespecial #242                // Method "<init>":()V
       7: putstatic     #245                // Field INSTANCE:Lcom/adventofcode/Day;
      10: new           #172                // class java/util/ArrayList
      13: dup
      14: invokespecial #173                // Method java/util/ArrayList."<init>":()V
      17: checkcast     #45                 // class java/util/List
      20: putstatic     #43                 // Field scheme:Ljava/util/List;
      23: new           #172                // class java/util/ArrayList
      26: dup
      27: invokespecial #173                // Method java/util/ArrayList."<init>":()V
      30: checkcast     #45                 // class java/util/List
      33: putstatic     #81                 // Field stackedColumns:Ljava/util/List;
      36: return
}


package aoc10

import java.nio.file.Paths

fun main() {
    val lines = Paths.get("src/main/resources/aoc_10.txt").toFile().useLines { it.toList() }

    println(solution1(lines))
    println(solution2(lines))
}

fun solution1(lines: List<String>): Int {
    return solve(lines)
        .filter { it.first == 20 || ((it.first - 20) % 40) == 0 }
        .sumOf { it.first * it.second }
}

fun solution2(lines: List<String>): Int {

    val crt = Array(6) { CharArray(40) }

    for (row in 0 until 6) {
        for (column in 0 until 40) {
            crt[row][column] = '.'
        }
    }

    solve(lines)
        .forEach {
            val row = (it.first - 1) / 40
            val column = (it.first - 1) % 40

            if (IntRange(it.second - 1, it.second + 1).contains(column)) {
                crt[row][column] = '#'
            }
        }

    crt.forEach { println(it) }
    return 0
}

fun solve(lines: List<String>): List<Pair<Int, Int>> {
    val cycles = mutableListOf<Pair<Int, Int>>()
    lines
        .map { if (it.startsWith("addx")) listOf("noop", it) else listOf(it) }
        .flatten()
        .map { it.split(" ").getOrElse(1) { "0" }.toInt() }
        .foldIndexed(1) { index, result, add ->
            cycles.add(Pair(index + 1, result));
            result.plus(add)
        }
    return cycles
}

Compiled from "Solution10.kt"
public final class aoc10.Solution10Kt {
  public static final void main();
    Code:
       0: ldc           #10                 // String src/main/resources/aoc_10.txt
       2: iconst_0
       3: anewarray     #12                 // class java/lang/String
       6: invokestatic  #18                 // Method java/nio/file/Paths.get:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
       9: invokeinterface #24,  1           // InterfaceMethod java/nio/file/Path.toFile:()Ljava/io/File;
      14: dup
      15: ldc           #26                 // String toFile(...)
      17: invokestatic  #32                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      20: astore_1
      21: getstatic     #38                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      24: astore_2
      25: iconst_0
      26: istore_3
      27: aload_1
      28: astore        4
      30: sipush        8192
      33: istore        5
      35: aload         4
      37: astore        6
      39: new           #40                 // class java/io/InputStreamReader
      42: dup
      43: new           #42                 // class java/io/FileInputStream
      46: dup
      47: aload         6
      49: invokespecial #46                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      52: checkcast     #48                 // class java/io/InputStream
      55: aload_2
      56: invokespecial #51                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      59: checkcast     #53                 // class java/io/Reader
      62: astore        6
      64: aload         6
      66: instanceof    #55                 // class java/io/BufferedReader
      69: ifeq          80
      72: aload         6
      74: checkcast     #55                 // class java/io/BufferedReader
      77: goto          91
      80: new           #55                 // class java/io/BufferedReader
      83: dup
      84: aload         6
      86: iload         5
      88: invokespecial #58                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      91: checkcast     #60                 // class java/io/Closeable
      94: astore        4
      96: aconst_null
      97: astore        5
      99: nop
     100: aload         4
     102: checkcast     #55                 // class java/io/BufferedReader
     105: astore        6
     107: iconst_0
     108: istore        7
     110: aload         6
     112: invokestatic  #66                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     115: astore        8
     117: iconst_0
     118: istore        9
     120: aload         8
     122: invokestatic  #72                 // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     125: astore        6
     127: aload         4
     129: aload         5
     131: invokestatic  #78                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     134: aload         6
     136: goto          160
     139: astore        7
     141: aload         7
     143: astore        5
     145: aload         7
     147: athrow
     148: astore        7
     150: aload         4
     152: aload         5
     154: invokestatic  #78                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     157: aload         7
     159: athrow
     160: nop
     161: astore_0
     162: aload_0
     163: invokestatic  #82                 // Method solution1:(Ljava/util/List;)I
     166: istore_1
     167: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     170: iload_1
     171: invokevirtual #94                 // Method java/io/PrintStream.println:(I)V
     174: aload_0
     175: invokestatic  #97                 // Method solution2:(Ljava/util/List;)I
     178: istore_1
     179: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     182: iload_1
     183: invokevirtual #94                 // Method java/io/PrintStream.println:(I)V
     186: return
    Exception table:
       from    to  target type
          99   127   139   Class java/lang/Throwable
          99   127   148   any
         139   148   148   any
         148   150   148   any

  public static final int solution1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #121                // String lines
       3: invokestatic  #124                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokestatic  #128                // Method solve:(Ljava/util/List;)Ljava/util/List;
      10: checkcast     #130                // class java/lang/Iterable
      13: astore_1
      14: nop
      15: iconst_0
      16: istore_2
      17: aload_1
      18: astore_3
      19: new           #132                // class java/util/ArrayList
      22: dup
      23: invokespecial #134                // Method java/util/ArrayList."<init>":()V
      26: checkcast     #136                // class java/util/Collection
      29: astore        4
      31: iconst_0
      32: istore        5
      34: aload_3
      35: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      40: astore        6
      42: aload         6
      44: invokeinterface #146,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      49: ifeq          128
      52: aload         6
      54: invokeinterface #150,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      59: astore        7
      61: aload         7
      63: checkcast     #152                // class kotlin/Pair
      66: astore        8
      68: iconst_0
      69: istore        9
      71: aload         8
      73: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      76: checkcast     #157                // class java/lang/Number
      79: invokevirtual #161                // Method java/lang/Number.intValue:()I
      82: bipush        20
      84: if_icmpeq     107
      87: aload         8
      89: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      92: checkcast     #157                // class java/lang/Number
      95: invokevirtual #161                // Method java/lang/Number.intValue:()I
      98: bipush        20
     100: isub
     101: bipush        40
     103: irem
     104: ifne          111
     107: iconst_1
     108: goto          112
     111: iconst_0
     112: ifeq          42
     115: aload         4
     117: aload         7
     119: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     124: pop
     125: goto          42
     128: aload         4
     130: checkcast     #116                // class java/util/List
     133: nop
     134: checkcast     #130                // class java/lang/Iterable
     137: astore_1
     138: iconst_0
     139: istore_2
     140: aload_1
     141: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     146: astore_3
     147: aload_3
     148: invokeinterface #146,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     153: ifeq          211
     156: aload_3
     157: invokeinterface #150,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     162: astore        4
     164: iload_2
     165: aload         4
     167: checkcast     #152                // class kotlin/Pair
     170: astore        5
     172: istore        10
     174: iconst_0
     175: istore        6
     177: aload         5
     179: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     182: checkcast     #157                // class java/lang/Number
     185: invokevirtual #161                // Method java/lang/Number.intValue:()I
     188: aload         5
     190: invokevirtual #168                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     193: checkcast     #157                // class java/lang/Number
     196: invokevirtual #161                // Method java/lang/Number.intValue:()I
     199: imul
     200: istore        11
     202: iload         10
     204: iload         11
     206: iadd
     207: istore_2
     208: goto          147
     211: iload_2
     212: ireturn

  public static final int solution2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #121                // String lines
       3: invokestatic  #124                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_2
       8: bipush        6
      10: anewarray     #182                // class "[C"
      13: astore_3
      14: iload_2
      15: bipush        6
      17: if_icmpge     37
      20: iload_2
      21: istore        4
      23: aload_3
      24: iload         4
      26: bipush        40
      28: newarray       char
      30: aastore
      31: iinc          2, 1
      34: goto          14
      37: aload_3
      38: astore_1
      39: iconst_0
      40: istore_2
      41: iload_2
      42: bipush        6
      44: if_icmpge     74
      47: iconst_0
      48: istore_3
      49: iload_3
      50: bipush        40
      52: if_icmpge     68
      55: aload_1
      56: iload_2
      57: aaload
      58: iload_3
      59: bipush        46
      61: castore
      62: iinc          3, 1
      65: goto          49
      68: iinc          2, 1
      71: goto          41
      74: aload_0
      75: invokestatic  #128                // Method solve:(Ljava/util/List;)Ljava/util/List;
      78: checkcast     #130                // class java/lang/Iterable
      81: astore_2
      82: nop
      83: iconst_0
      84: istore_3
      85: aload_2
      86: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      91: astore        4
      93: aload         4
      95: invokeinterface #146,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     100: ifeq          213
     103: aload         4
     105: invokeinterface #150,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     110: astore        5
     112: aload         5
     114: checkcast     #152                // class kotlin/Pair
     117: astore        6
     119: iconst_0
     120: istore        7
     122: aload         6
     124: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     127: checkcast     #157                // class java/lang/Number
     130: invokevirtual #161                // Method java/lang/Number.intValue:()I
     133: iconst_1
     134: isub
     135: bipush        40
     137: idiv
     138: istore        8
     140: aload         6
     142: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     145: checkcast     #157                // class java/lang/Number
     148: invokevirtual #161                // Method java/lang/Number.intValue:()I
     151: iconst_1
     152: isub
     153: bipush        40
     155: irem
     156: istore        9
     158: new           #184                // class kotlin/ranges/IntRange
     161: dup
     162: aload         6
     164: invokevirtual #168                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     167: checkcast     #157                // class java/lang/Number
     170: invokevirtual #161                // Method java/lang/Number.intValue:()I
     173: iconst_1
     174: isub
     175: aload         6
     177: invokevirtual #168                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     180: checkcast     #157                // class java/lang/Number
     183: invokevirtual #161                // Method java/lang/Number.intValue:()I
     186: iconst_1
     187: iadd
     188: invokespecial #187                // Method kotlin/ranges/IntRange."<init>":(II)V
     191: iload         9
     193: invokevirtual #191                // Method kotlin/ranges/IntRange.contains:(I)Z
     196: ifeq          208
     199: aload_1
     200: iload         8
     202: aaload
     203: iload         9
     205: bipush        35
     207: castore
     208: nop
     209: nop
     210: goto          93
     213: nop
     214: aload_1
     215: checkcast     #193                // class "[Ljava/lang/Object;"
     218: astore_2
     219: iconst_0
     220: istore_3
     221: iconst_0
     222: istore        4
     224: aload_2
     225: arraylength
     226: istore        5
     228: iload         4
     230: iload         5
     232: if_icmpge     267
     235: aload_2
     236: iload         4
     238: aaload
     239: astore        6
     241: aload         6
     243: checkcast     #182                // class "[C"
     246: astore        7
     248: iconst_0
     249: istore        8
     251: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     254: aload         7
     256: invokevirtual #196                // Method java/io/PrintStream.println:([C)V
     259: nop
     260: nop
     261: iinc          4, 1
     264: goto          228
     267: nop
     268: iconst_0
     269: ireturn

  public static final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> solve(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #121                // String lines
       3: invokestatic  #124                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #132                // class java/util/ArrayList
       9: dup
      10: invokespecial #134                // Method java/util/ArrayList."<init>":()V
      13: checkcast     #116                // class java/util/List
      16: astore_1
      17: aload_0
      18: checkcast     #130                // class java/lang/Iterable
      21: astore_2
      22: nop
      23: iconst_0
      24: istore_3
      25: aload_2
      26: astore        4
      28: new           #132                // class java/util/ArrayList
      31: dup
      32: aload_2
      33: bipush        10
      35: invokestatic  #213                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      38: invokespecial #215                // Method java/util/ArrayList."<init>":(I)V
      41: checkcast     #136                // class java/util/Collection
      44: astore        5
      46: iconst_0
      47: istore        6
      49: aload         4
      51: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      56: astore        7
      58: aload         7
      60: invokeinterface #146,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      65: ifeq          147
      68: aload         7
      70: invokeinterface #150,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      75: astore        8
      77: aload         5
      79: aload         8
      81: checkcast     #12                 // class java/lang/String
      84: astore        9
      86: astore        15
      88: iconst_0
      89: istore        10
      91: aload         9
      93: ldc           #217                // String addx
      95: iconst_0
      96: iconst_2
      97: aconst_null
      98: invokestatic  #223                // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
     101: ifeq          130
     104: iconst_2
     105: anewarray     #12                 // class java/lang/String
     108: astore        11
     110: aload         11
     112: iconst_0
     113: ldc           #225                // String noop
     115: aastore
     116: aload         11
     118: iconst_1
     119: aload         9
     121: aastore
     122: aload         11
     124: invokestatic  #229                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     127: goto          135
     130: aload         9
     132: invokestatic  #232                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     135: aload         15
     137: swap
     138: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     143: pop
     144: goto          58
     147: aload         5
     149: checkcast     #116                // class java/util/List
     152: nop
     153: checkcast     #130                // class java/lang/Iterable
     156: invokestatic  #236                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     159: checkcast     #130                // class java/lang/Iterable
     162: astore_2
     163: nop
     164: iconst_0
     165: istore_3
     166: aload_2
     167: astore        4
     169: new           #132                // class java/util/ArrayList
     172: dup
     173: aload_2
     174: bipush        10
     176: invokestatic  #213                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     179: invokespecial #215                // Method java/util/ArrayList."<init>":(I)V
     182: checkcast     #136                // class java/util/Collection
     185: astore        5
     187: iconst_0
     188: istore        6
     190: aload         4
     192: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     197: astore        7
     199: aload         7
     201: invokeinterface #146,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     206: ifeq          327
     209: aload         7
     211: invokeinterface #150,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     216: astore        8
     218: aload         5
     220: aload         8
     222: checkcast     #12                 // class java/lang/String
     225: astore        9
     227: astore        15
     229: iconst_0
     230: istore        10
     232: aload         9
     234: checkcast     #238                // class java/lang/CharSequence
     237: iconst_1
     238: anewarray     #12                 // class java/lang/String
     241: astore        11
     243: aload         11
     245: iconst_0
     246: ldc           #240                // String
     248: aastore
     249: aload         11
     251: iconst_0
     252: iconst_0
     253: bipush        6
     255: aconst_null
     256: invokestatic  #244                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     259: astore        11
     261: iconst_1
     262: istore        12
     264: iload         12
     266: aload         11
     268: invokeinterface #247,  1          // InterfaceMethod java/util/List.size:()I
     273: if_icmpge     280
     276: iconst_1
     277: goto          281
     280: iconst_0
     281: ifeq          296
     284: aload         11
     286: iload         12
     288: invokeinterface #250,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     293: goto          305
     296: iload         12
     298: istore        13
     300: iconst_0
     301: istore        14
     303: ldc           #252                // String 0
     305: checkcast     #12                 // class java/lang/String
     308: invokestatic  #258                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     311: nop
     312: invokestatic  #262                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     315: aload         15
     317: swap
     318: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     323: pop
     324: goto          199
     327: aload         5
     329: checkcast     #116                // class java/util/List
     332: nop
     333: checkcast     #130                // class java/lang/Iterable
     336: astore_2
     337: iconst_1
     338: istore_3
     339: iconst_0
     340: istore        4
     342: iconst_0
     343: istore        5
     345: iload_3
     346: istore        6
     348: aload_2
     349: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     354: astore        7
     356: aload         7
     358: invokeinterface #146,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     363: ifeq          447
     366: aload         7
     368: invokeinterface #150,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     373: astore        8
     375: iload         5
     377: iinc          5, 1
     380: istore        9
     382: iload         9
     384: ifge          390
     387: invokestatic  #265                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     390: iload         9
     392: iload         6
     394: aload         8
     396: checkcast     #157                // class java/lang/Number
     399: invokevirtual #161                // Method java/lang/Number.intValue:()I
     402: istore        10
     404: istore        11
     406: istore        12
     408: iconst_0
     409: istore        13
     411: aload_1
     412: new           #152                // class kotlin/Pair
     415: dup
     416: iload         12
     418: iconst_1
     419: iadd
     420: invokestatic  #262                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     423: iload         11
     425: invokestatic  #262                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     428: invokespecial #268                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     431: invokeinterface #269,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     436: pop
     437: iload         11
     439: iload         10
     441: iadd
     442: istore        6
     444: goto          356
     447: nop
     448: aload_1
     449: areturn

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