package stepik.sportprogramming

private var a: Array<IntArray> = emptyArray()
private var ans: Int = Int.MAX_VALUE
private var ansPerm: String = ""
private var p: IntArray = intArrayOf()
private var used: BooleanArray = booleanArrayOf()
private var n: Int = 0

fun main() {
    n = readInt()
    a = Array(n) {
        readInts()
    }
    p = IntArray(n) { 0 }
    used = BooleanArray(n) { false }
    p[0] = 0
    recNew(1, 0)
    println("The shortest path is $ansPerm with value $ans")
}

private fun recNew(idx: Int, len: Int) {
    if (len >= ans) {
        return
    }
    if (idx == n) {
        val length = len + a[p[idx - 1]][0]
        if (length < ans) {
            ansPerm = p.joinToString(prefix = "{", postfix = "}")
            ans = length
        }
        return
    }
    for (i in 1 until n) {
        if (used[i]) continue
        p[idx] = i
        used[i] = true
        recNew(idx + 1, len + a[p[idx - 1]][i])
        used[i] = false
    }
}

private fun readInt() = readLine()!!.toInt()

private fun readInts() = readLine()!!.split(" ").map(String::toInt).toIntArray()

Compiled from "RecursiveComivoigerSolution.kt"
public final class stepik.sportprogramming.RecursiveComivoigerSolutionKt {
  private static int[][] a;

  private static int ans;

  private static java.lang.String ansPerm;

  private static int[] p;

  private static boolean[] used;

  private static int n;

  public static final void main();
    Code:
       0: invokestatic  #10                 // Method readInt:()I
       3: putstatic     #14                 // Field n:I
       6: iconst_0
       7: istore_0
       8: getstatic     #14                 // Field n:I
      11: istore_1
      12: iload_1
      13: anewarray     #16                 // class "[I"
      16: astore_2
      17: iload_0
      18: iload_1
      19: if_icmpge     36
      22: iload_0
      23: istore_3
      24: aload_2
      25: iload_3
      26: invokestatic  #20                 // Method readInts:()[I
      29: aastore
      30: iinc          0, 1
      33: goto          17
      36: aload_2
      37: putstatic     #24                 // Field a:[[I
      40: iconst_0
      41: istore_0
      42: getstatic     #14                 // Field n:I
      45: istore_1
      46: iload_1
      47: newarray       int
      49: astore_2
      50: iload_0
      51: iload_1
      52: if_icmpge     67
      55: iload_0
      56: istore_3
      57: aload_2
      58: iload_3
      59: iconst_0
      60: iastore
      61: iinc          0, 1
      64: goto          50
      67: aload_2
      68: putstatic     #27                 // Field p:[I
      71: iconst_0
      72: istore_0
      73: getstatic     #14                 // Field n:I
      76: istore_1
      77: iload_1
      78: newarray       boolean
      80: astore_2
      81: iload_0
      82: iload_1
      83: if_icmpge     98
      86: iload_0
      87: istore_3
      88: aload_2
      89: iload_3
      90: iconst_0
      91: bastore
      92: iinc          0, 1
      95: goto          81
      98: aload_2
      99: putstatic     #31                 // Field used:[Z
     102: getstatic     #27                 // Field p:[I
     105: iconst_0
     106: iconst_0
     107: iastore
     108: iconst_1
     109: iconst_0
     110: invokestatic  #35                 // Method recNew:(II)V
     113: new           #37                 // class java/lang/StringBuilder
     116: dup
     117: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
     120: ldc           #42                 // String The shortest path is
     122: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     125: getstatic     #50                 // Field ansPerm:Ljava/lang/String;
     128: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     131: ldc           #52                 // String  with value
     133: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     136: getstatic     #55                 // Field ans:I
     139: invokevirtual #58                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     142: invokevirtual #62                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     145: getstatic     #68                 // Field java/lang/System.out:Ljava/io/PrintStream;
     148: swap
     149: invokevirtual #74                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     152: return

  private static final void recNew(int, int);
    Code:
       0: iload_1
       1: getstatic     #55                 // Field ans:I
       4: if_icmplt     8
       7: return
       8: iload_0
       9: getstatic     #14                 // Field n:I
      12: if_icmpne     69
      15: iload_1
      16: getstatic     #24                 // Field a:[[I
      19: getstatic     #27                 // Field p:[I
      22: iload_0
      23: iconst_1
      24: isub
      25: iaload
      26: aaload
      27: iconst_0
      28: iaload
      29: iadd
      30: istore_2
      31: iload_2
      32: getstatic     #55                 // Field ans:I
      35: if_icmpge     68
      38: getstatic     #27                 // Field p:[I
      41: aconst_null
      42: ldc           #78                 // String {
      44: checkcast     #80                 // class java/lang/CharSequence
      47: ldc           #82                 // String }
      49: checkcast     #80                 // class java/lang/CharSequence
      52: iconst_0
      53: aconst_null
      54: aconst_null
      55: bipush        57
      57: aconst_null
      58: invokestatic  #88                 // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      61: putstatic     #50                 // Field ansPerm:Ljava/lang/String;
      64: iload_2
      65: putstatic     #55                 // Field ans:I
      68: return
      69: iconst_1
      70: istore_2
      71: getstatic     #14                 // Field n:I
      74: istore_3
      75: iload_2
      76: iload_3
      77: if_icmpge     133
      80: getstatic     #31                 // Field used:[Z
      83: iload_2
      84: baload
      85: ifne          127
      88: getstatic     #27                 // Field p:[I
      91: iload_0
      92: iload_2
      93: iastore
      94: getstatic     #31                 // Field used:[Z
      97: iload_2
      98: iconst_1
      99: bastore
     100: iload_0
     101: iconst_1
     102: iadd
     103: iload_1
     104: getstatic     #24                 // Field a:[[I
     107: getstatic     #27                 // Field p:[I
     110: iload_0
     111: iconst_1
     112: isub
     113: iaload
     114: aaload
     115: iload_2
     116: iaload
     117: iadd
     118: invokestatic  #35                 // Method recNew:(II)V
     121: getstatic     #31                 // Field used:[Z
     124: iload_2
     125: iconst_0
     126: bastore
     127: iinc          2, 1
     130: goto          75
     133: return

  private static final int readInt();
    Code:
       0: invokestatic  #97                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #102                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: invokestatic  #108                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      10: ireturn

  private static final int[] readInts();
    Code:
       0: invokestatic  #97                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #102                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: checkcast     #80                 // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #110                // class java/lang/String
      14: astore_0
      15: aload_0
      16: iconst_0
      17: ldc           #112                // String
      19: aastore
      20: aload_0
      21: iconst_0
      22: iconst_0
      23: bipush        6
      25: aconst_null
      26: invokestatic  #118                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      29: checkcast     #120                // class java/lang/Iterable
      32: astore_0
      33: iconst_0
      34: istore_1
      35: aload_0
      36: astore_2
      37: new           #122                // class java/util/ArrayList
      40: dup
      41: aload_0
      42: bipush        10
      44: invokestatic  #128                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      47: invokespecial #131                // Method java/util/ArrayList."<init>":(I)V
      50: checkcast     #133                // class java/util/Collection
      53: astore_3
      54: iconst_0
      55: istore        4
      57: aload_2
      58: invokeinterface #137,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      63: astore        5
      65: aload         5
      67: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      72: ifeq          118
      75: aload         5
      77: invokeinterface #147,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      82: astore        6
      84: aload_3
      85: aload         6
      87: checkcast     #110                // class java/lang/String
      90: astore        7
      92: astore        9
      94: iconst_0
      95: istore        8
      97: aload         7
      99: invokestatic  #108                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     102: nop
     103: invokestatic  #151                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     106: aload         9
     108: swap
     109: invokeinterface #155,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     114: pop
     115: goto          65
     118: aload_3
     119: checkcast     #157                // class java/util/List
     122: nop
     123: checkcast     #133                // class java/util/Collection
     126: invokestatic  #161                // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I
     129: areturn

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

  static {};
    Code:
       0: iconst_0
       1: anewarray     #16                 // class "[I"
       4: putstatic     #24                 // Field a:[[I
       7: ldc           #179                // int 2147483647
       9: putstatic     #55                 // Field ans:I
      12: ldc           #181                // String
      14: putstatic     #50                 // Field ansPerm:Ljava/lang/String;
      17: iconst_0
      18: newarray       int
      20: putstatic     #27                 // Field p:[I
      23: iconst_0
      24: newarray       boolean
      26: putstatic     #31                 // Field used:[Z
      29: return
}


package stepik.sportprogramming

import java.io.File
import java.io.PrintWriter
import java.util.*
import kotlin.math.max

fun main() {
    output {
        val n = readInt()
        val a = readIntArray(n)
        val m = readInt()
        val b = readIntArray(m)
        val d = Array(n + 1) {
            IntArray(m + 1)
        }
        for (i in 0..n) {
            d[i][0] = 0
        }
        for (j in 0..m) {
            d[0][j] = 0
        }
        val path = Array(n + 1) { IntArray(m + 1) }
        for (i in 1..n) {
            for (j in 1..m) {
                if (d[i - 1][j] > d[i][j - 1]) {
                    d[i][j] = d[i - 1][j]
                    path[i][j] = d[i-1][j]
                } else {
                    d[i][j] = d[i][j - 1]
                    path[i][j] = d[i][j - 1]
                }
                if (a[i - 1] == b[j - 1] && (d[i - 1][j - 1] + 1 > d[i][j])) {
                    d[i][j] = d[i - 1][j - 1] + 1
                    path[i][j] = d[i - 1][j - 1] + 1
                }
            }
        }
        println("Longest common subsequence is ${d[n][m]}")
        println("Path of longest subsequence is ")
        recout(path, a, n, m)
    }
}

private fun PrintWriter.recout(p: Array<IntArray>, a: IntArray, i: Int, j: Int) {
    if (i <= 0 || j <= 0) {
        return
    }
    when {
        p[i][j] == p[i - 1][j] -> recout(p, a, i - 1, j)
        p[i][j] == p[i][j - 1] -> recout(p, a, i, j - 1)
        else -> {
            recout(p, a, i - 1, j - 1)
            print("${a[i - 1]} ")
        }
    }
}

/** IO code start */
//private val INPUT = System.`in`
private val INPUT = File("stepik/sportprogramming/seq2.in").inputStream()
private val OUTPUT = System.out

private val reader = INPUT.bufferedReader()
private var tokenizer: StringTokenizer = StringTokenizer("")
private fun read(): String {
    if (tokenizer.hasMoreTokens().not()) {
        tokenizer = StringTokenizer(reader.readLine() ?: return "", " ")
    }
    return tokenizer.nextToken()
}

private fun readLn() = reader.readLine()!!
private fun readInt() = read().toInt()
private fun readIntArray(n: Int) = IntArray(n) { read().toInt() }

private val writer = PrintWriter(OUTPUT, false)
private inline fun output(block: PrintWriter.() -> Unit) {
    writer.apply(block).flush()
}

Compiled from "LongestCommonSubsequenceDynamicProgramming.kt"
public final class stepik.sportprogramming.LongestCommonSubsequenceDynamicProgrammingKt {
  private static final java.io.FileInputStream INPUT;

  private static final java.io.PrintStream OUTPUT;

  private static final java.io.BufferedReader reader;

  private static java.util.StringTokenizer tokenizer;

  private static final java.io.PrintWriter writer;

  public static final void main();
    Code:
       0: iconst_0
       1: istore_0
       2: getstatic     #10                 // Field writer:Ljava/io/PrintWriter;
       5: astore_1
       6: aload_1
       7: astore_2
       8: iconst_0
       9: istore_3
      10: invokestatic  #14                 // Method readInt:()I
      13: istore        4
      15: iload         4
      17: invokestatic  #18                 // Method readIntArray:(I)[I
      20: astore        5
      22: invokestatic  #14                 // Method readInt:()I
      25: istore        6
      27: iload         6
      29: invokestatic  #18                 // Method readIntArray:(I)[I
      32: astore        7
      34: iconst_0
      35: istore        8
      37: iload         4
      39: iconst_1
      40: iadd
      41: istore        9
      43: iload         9
      45: anewarray     #20                 // class "[I"
      48: astore        10
      50: iload         8
      52: iload         9
      54: if_icmpge     78
      57: iload         8
      59: istore        11
      61: aload         10
      63: iload         11
      65: iload         6
      67: iconst_1
      68: iadd
      69: newarray       int
      71: aastore
      72: iinc          8, 1
      75: goto          50
      78: aload         10
      80: astore        12
      82: iconst_0
      83: istore        8
      85: iload         8
      87: iload         4
      89: if_icmpgt     113
      92: aload         12
      94: iload         8
      96: aaload
      97: iconst_0
      98: iconst_0
      99: iastore
     100: iload         8
     102: iload         4
     104: if_icmpeq     113
     107: iinc          8, 1
     110: goto          92
     113: iconst_0
     114: istore        8
     116: iload         8
     118: iload         6
     120: if_icmpgt     144
     123: aload         12
     125: iconst_0
     126: aaload
     127: iload         8
     129: iconst_0
     130: iastore
     131: iload         8
     133: iload         6
     135: if_icmpeq     144
     138: iinc          8, 1
     141: goto          123
     144: iconst_0
     145: istore        9
     147: iload         4
     149: iconst_1
     150: iadd
     151: istore        10
     153: iload         10
     155: anewarray     #20                 // class "[I"
     158: astore        11
     160: iload         9
     162: iload         10
     164: if_icmpge     188
     167: iload         9
     169: istore        13
     171: aload         11
     173: iload         13
     175: iload         6
     177: iconst_1
     178: iadd
     179: newarray       int
     181: aastore
     182: iinc          9, 1
     185: goto          160
     188: aload         11
     190: astore        8
     192: iconst_1
     193: istore        9
     195: iload         9
     197: iload         4
     199: if_icmpgt     422
     202: iconst_1
     203: istore        10
     205: iload         10
     207: iload         6
     209: if_icmpgt     409
     212: aload         12
     214: iload         9
     216: iconst_1
     217: isub
     218: aaload
     219: iload         10
     221: iaload
     222: aload         12
     224: iload         9
     226: aaload
     227: iload         10
     229: iconst_1
     230: isub
     231: iaload
     232: if_icmple     274
     235: aload         12
     237: iload         9
     239: aaload
     240: iload         10
     242: aload         12
     244: iload         9
     246: iconst_1
     247: isub
     248: aaload
     249: iload         10
     251: iaload
     252: iastore
     253: aload         8
     255: iload         9
     257: aaload
     258: iload         10
     260: aload         12
     262: iload         9
     264: iconst_1
     265: isub
     266: aaload
     267: iload         10
     269: iaload
     270: iastore
     271: goto          310
     274: aload         12
     276: iload         9
     278: aaload
     279: iload         10
     281: aload         12
     283: iload         9
     285: aaload
     286: iload         10
     288: iconst_1
     289: isub
     290: iaload
     291: iastore
     292: aload         8
     294: iload         9
     296: aaload
     297: iload         10
     299: aload         12
     301: iload         9
     303: aaload
     304: iload         10
     306: iconst_1
     307: isub
     308: iaload
     309: iastore
     310: aload         5
     312: iload         9
     314: iconst_1
     315: isub
     316: iaload
     317: aload         7
     319: iload         10
     321: iconst_1
     322: isub
     323: iaload
     324: if_icmpne     396
     327: aload         12
     329: iload         9
     331: iconst_1
     332: isub
     333: aaload
     334: iload         10
     336: iconst_1
     337: isub
     338: iaload
     339: iconst_1
     340: iadd
     341: aload         12
     343: iload         9
     345: aaload
     346: iload         10
     348: iaload
     349: if_icmple     396
     352: aload         12
     354: iload         9
     356: aaload
     357: iload         10
     359: aload         12
     361: iload         9
     363: iconst_1
     364: isub
     365: aaload
     366: iload         10
     368: iconst_1
     369: isub
     370: iaload
     371: iconst_1
     372: iadd
     373: iastore
     374: aload         8
     376: iload         9
     378: aaload
     379: iload         10
     381: aload         12
     383: iload         9
     385: iconst_1
     386: isub
     387: aaload
     388: iload         10
     390: iconst_1
     391: isub
     392: iaload
     393: iconst_1
     394: iadd
     395: iastore
     396: iload         10
     398: iload         6
     400: if_icmpeq     409
     403: iinc          10, 1
     406: goto          212
     409: iload         9
     411: iload         4
     413: if_icmpeq     422
     416: iinc          9, 1
     419: goto          202
     422: aload_2
     423: new           #22                 // class java/lang/StringBuilder
     426: dup
     427: invokespecial #25                 // Method java/lang/StringBuilder."<init>":()V
     430: ldc           #27                 // String Longest common subsequence is
     432: invokevirtual #31                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     435: aload         12
     437: iload         4
     439: aaload
     440: iload         6
     442: iaload
     443: invokevirtual #34                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     446: invokevirtual #38                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     449: invokevirtual #44                 // Method java/io/PrintWriter.println:(Ljava/lang/String;)V
     452: aload_2
     453: ldc           #46                 // String Path of longest subsequence is
     455: invokevirtual #44                 // Method java/io/PrintWriter.println:(Ljava/lang/String;)V
     458: aload_2
     459: aload         8
     461: aload         5
     463: iload         4
     465: iload         6
     467: invokestatic  #50                 // Method recout:(Ljava/io/PrintWriter;[[I[III)V
     470: nop
     471: aload_1
     472: invokevirtual #53                 // Method java/io/PrintWriter.flush:()V
     475: nop
     476: return

  private static final void recout(java.io.PrintWriter, int[][], int[], int, int);
    Code:
       0: iload_3
       1: ifle          9
       4: iload         4
       6: ifgt          10
       9: return
      10: nop
      11: aload_1
      12: iload_3
      13: aaload
      14: iload         4
      16: iaload
      17: aload_1
      18: iload_3
      19: iconst_1
      20: isub
      21: aaload
      22: iload         4
      24: iaload
      25: if_icmpne     42
      28: aload_0
      29: aload_1
      30: aload_2
      31: iload_3
      32: iconst_1
      33: isub
      34: iload         4
      36: invokestatic  #50                 // Method recout:(Ljava/io/PrintWriter;[[I[III)V
      39: goto          113
      42: aload_1
      43: iload_3
      44: aaload
      45: iload         4
      47: iaload
      48: aload_1
      49: iload_3
      50: aaload
      51: iload         4
      53: iconst_1
      54: isub
      55: iaload
      56: if_icmpne     73
      59: aload_0
      60: aload_1
      61: aload_2
      62: iload_3
      63: iload         4
      65: iconst_1
      66: isub
      67: invokestatic  #50                 // Method recout:(Ljava/io/PrintWriter;[[I[III)V
      70: goto          113
      73: aload_0
      74: aload_1
      75: aload_2
      76: iload_3
      77: iconst_1
      78: isub
      79: iload         4
      81: iconst_1
      82: isub
      83: invokestatic  #50                 // Method recout:(Ljava/io/PrintWriter;[[I[III)V
      86: aload_0
      87: new           #22                 // class java/lang/StringBuilder
      90: dup
      91: invokespecial #25                 // Method java/lang/StringBuilder."<init>":()V
      94: aload_2
      95: iload_3
      96: iconst_1
      97: isub
      98: iaload
      99: invokevirtual #34                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     102: bipush        32
     104: invokevirtual #70                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     107: invokevirtual #38                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     110: invokevirtual #73                 // Method java/io/PrintWriter.print:(Ljava/lang/String;)V
     113: return

  private static final java.lang.String read();
    Code:
       0: getstatic     #80                 // Field tokenizer:Ljava/util/StringTokenizer;
       3: invokevirtual #86                 // Method java/util/StringTokenizer.hasMoreTokens:()Z
       6: ifne          35
       9: new           #82                 // class java/util/StringTokenizer
      12: dup
      13: getstatic     #90                 // Field reader:Ljava/io/BufferedReader;
      16: invokevirtual #95                 // Method java/io/BufferedReader.readLine:()Ljava/lang/String;
      19: dup
      20: ifnonnull     27
      23: pop
      24: ldc           #97                 // String
      26: areturn
      27: ldc           #99                 // String
      29: invokespecial #102                // Method java/util/StringTokenizer."<init>":(Ljava/lang/String;Ljava/lang/String;)V
      32: putstatic     #80                 // Field tokenizer:Ljava/util/StringTokenizer;
      35: getstatic     #80                 // Field tokenizer:Ljava/util/StringTokenizer;
      38: invokevirtual #105                // Method java/util/StringTokenizer.nextToken:()Ljava/lang/String;
      41: dup
      42: ldc           #107                // String nextToken(...)
      44: invokestatic  #113                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      47: areturn

  private static final java.lang.String readLn();
    Code:
       0: getstatic     #90                 // Field reader:Ljava/io/BufferedReader;
       3: invokevirtual #95                 // Method java/io/BufferedReader.readLine:()Ljava/lang/String;
       6: dup
       7: invokestatic  #120                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      10: areturn

  private static final int readInt();
    Code:
       0: invokestatic  #122                // Method read:()Ljava/lang/String;
       3: invokestatic  #128                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: ireturn

  private static final int[] readIntArray(int);
    Code:
       0: iconst_0
       1: istore_1
       2: iload_0
       3: newarray       int
       5: astore_2
       6: iload_1
       7: iload_0
       8: if_icmpge     28
      11: iload_1
      12: istore_3
      13: aload_2
      14: iload_3
      15: invokestatic  #122                // Method read:()Ljava/lang/String;
      18: invokestatic  #128                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      21: iastore
      22: iinc          1, 1
      25: goto          6
      28: aload_2
      29: areturn

  private static final void output(kotlin.jvm.functions.Function1<? super java.io.PrintWriter, kotlin.Unit>);
    Code:
       0: iconst_0
       1: istore_1
       2: getstatic     #10                 // Field writer:Ljava/io/PrintWriter;
       5: astore_2
       6: aload_0
       7: aload_2
       8: invokeinterface #137,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      13: pop
      14: aload_2
      15: invokevirtual #53                 // Method java/io/PrintWriter.flush:()V
      18: return

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

  static {};
    Code:
       0: new           #147                // class java/io/FileInputStream
       3: dup
       4: new           #149                // class java/io/File
       7: dup
       8: ldc           #151                // String stepik/sportprogramming/seq2.in
      10: invokespecial #153                // Method java/io/File."<init>":(Ljava/lang/String;)V
      13: invokespecial #156                // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      16: putstatic     #160                // Field INPUT:Ljava/io/FileInputStream;
      19: getstatic     #166                // Field java/lang/System.out:Ljava/io/PrintStream;
      22: putstatic     #169                // Field OUTPUT:Ljava/io/PrintStream;
      25: getstatic     #160                // Field INPUT:Ljava/io/FileInputStream;
      28: checkcast     #171                // class java/io/InputStream
      31: astore_0
      32: getstatic     #177                // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      35: astore_1
      36: new           #179                // class java/io/InputStreamReader
      39: dup
      40: aload_0
      41: aload_1
      42: invokespecial #182                // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      45: checkcast     #184                // class java/io/Reader
      48: astore_2
      49: sipush        8192
      52: istore_3
      53: aload_2
      54: instanceof    #92                 // class java/io/BufferedReader
      57: ifeq          67
      60: aload_2
      61: checkcast     #92                 // class java/io/BufferedReader
      64: goto          76
      67: new           #92                 // class java/io/BufferedReader
      70: dup
      71: aload_2
      72: iload_3
      73: invokespecial #187                // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      76: putstatic     #90                 // Field reader:Ljava/io/BufferedReader;
      79: new           #82                 // class java/util/StringTokenizer
      82: dup
      83: ldc           #97                 // String
      85: invokespecial #188                // Method java/util/StringTokenizer."<init>":(Ljava/lang/String;)V
      88: putstatic     #80                 // Field tokenizer:Ljava/util/StringTokenizer;
      91: new           #40                 // class java/io/PrintWriter
      94: dup
      95: getstatic     #169                // Field OUTPUT:Ljava/io/PrintStream;
      98: checkcast     #190                // class java/io/OutputStream
     101: iconst_0
     102: invokespecial #193                // Method java/io/PrintWriter."<init>":(Ljava/io/OutputStream;Z)V
     105: putstatic     #10                 // Field writer:Ljava/io/PrintWriter;
     108: return
}


package org.rsultan.bandit.algorithms

import java.security.SecureRandom

interface BanditAlgorithm {

    fun selectArm(): Int

    fun update(chosenArm: Int, reward: Float)
}

abstract class AbstractBanditAlgorithm(nbArms: Int) : BanditAlgorithm {

    protected val random = SecureRandom()
    protected val counts = (1..nbArms).map { 0 }.toTypedArray()
    protected val values = (1..nbArms).map { 0.0f }.toTypedArray()

    override fun update(chosenArm: Int, reward: Float) {
        val armCount = ++counts[chosenArm]
        val armValue = values[chosenArm]
        values[chosenArm] = ((armCount - 1) / armCount.toFloat()) * armValue + (1 / armCount.toFloat()) * reward
    }
}

abstract class AbstractSoftmaxAlgorithm(nbArms: Int) : AbstractBanditAlgorithm(nbArms) {

    fun categoricalDraw(probabilities: List<Float>): Int {
        val rand = random.nextFloat()
        var cumulativeProbability = 0.0f
        for (i in probabilities.indices) {
            cumulativeProbability += probabilities[i]
            if (cumulativeProbability > rand) {
                return i
            }
        }
        return probabilities.lastIndex
    }
}

Compiled from "BanditAlgorithm.kt"
public interface org.rsultan.bandit.algorithms.BanditAlgorithm {
  public abstract int selectArm();

  public abstract void update(int, float);
}


package complexity

// ------------------------------ Time complexity ----------------------------------

//Big O notation for the different level of scalability in two dimension
//-- Execution time
//-- Memory Usage

//Time complexity - is the time it take for algorithm to run compare with data size.

//Constant Time - is the same running time regardless of an input size.
fun checkFirst(name: List<String>){
    if(name.firstOrNull()!=null){
        println(name.first())
    }else
        println("No name")
}

//Liner time complexity - As the input increase the time to execute also increase
fun printName(names:List<String>){
    for (element in names){
        println(element)
    }
}

//Quadratic Time Complexity - refer to algorithm that takes time proportional to the square input size.
//Big O notation for quadratic time is = O(n^2)
fun multiplicationBoard(n:Int){
    for (number in 1 ..n){
        print("|")
        for (otherNumber in 1..n){
            println("$number * $otherNumber = ${number * otherNumber}|")
        }
    }
}

//Logarithmic Time Complexity -
fun linearContains(value:Int, numbers:List<Int>):Boolean {
    for(element in numbers) {
        return value == element
    }
    return false
}

//This is not efficient lets sort the values of number and divide in half
//As input increase the time takes to execute the algorithm increase at slowly rate.
//Big O notation for logarithm time complexity is Q(log n)
fun pseudoBinaryContains(value: Int, numbers: List<Int>):Boolean {
    if (numbers.isEmpty()) return false
    numbers.sorted()
    val middleIndex = numbers.size/2
    if (value <= numbers[middleIndex]){
        for (element in 0 .. middleIndex){
            return (numbers[element] == value)
        }
    }else{
        for (elements in middleIndex until numbers.size){
            return numbers[elements] == value
        }
    }
    return false
}

//Quasilinear Time Complexity - perform worse than liner time but dramatically better than quadratic time.
//Other complexity time (polynomial , exponential and factorial time).
//NOTE: for small data sets, time complexity may not be an accurate measure of speed.

//Comparing Time complexity.
//suppose you find sums of numbers from 1 to n
fun sumFromOne(n:Int):Int{
    var result = 0
    for (i in 1..n){
        result += i
    }
    return result
}

//This sum can be rewritten also with reduce function
//The time complexity of reduce function it also Q(n)
fun sumFromOnes(n:Int):Int{
    return (1..n).reduce { element, sum -> sum + element }
}

//We can use the famous mathematician <NAME>
//That use the time complexity constant Q(1)
fun sumFrom1(n:Int):Int{
    return n * (n + 1)/2
}

//--------------------------------------- Space complexity ---------------------------------

//space complexity - is measure of the resources for algorithm required to manipulate input data.
//Let's create the copy of sorted list and print it.
//The space complexity is Q(n)

fun printedSorted(number: List<Int>){
    val sorted = number.sorted()
    for (element in sorted){
        println(element)
    }
}

/*
NOTE: key Point

-Big O notation it used to represent the general form of space and time complexity.
-Time and space are high-level measures of scalability,
they don't measure the actual speed of algorithm itself
-For small dataset time complexity is usually irrelevant, a quasilinear algorithm can be slower than liner algo
* */

Compiled from "Complexity.kt"
public final class complexity.ComplexityKt {
  public static final void checkFirst(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #10                 // String name
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokestatic  #22                 // Method kotlin/collections/CollectionsKt.firstOrNull:(Ljava/util/List;)Ljava/lang/Object;
      10: ifnull        27
      13: aload_0
      14: invokestatic  #25                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      17: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      20: swap
      21: invokevirtual #37                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      24: goto          36
      27: ldc           #39                 // String No name
      29: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      32: swap
      33: invokevirtual #37                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      36: return

  public static final void printName(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #43                 // String names
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokeinterface #49,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      12: astore_1
      13: aload_1
      14: invokeinterface #55,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      19: ifeq          42
      22: aload_1
      23: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      28: checkcast     #61                 // class java/lang/String
      31: astore_2
      32: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      35: aload_2
      36: invokevirtual #37                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      39: goto          13
      42: return

  public static final void multiplicationBoard(int);
    Code:
       0: iconst_1
       1: istore_1
       2: iload_1
       3: iload_0
       4: if_icmpgt     91
       7: ldc           #67                 // String |
       9: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      12: swap
      13: invokevirtual #70                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      16: iconst_1
      17: istore_2
      18: iload_2
      19: iload_0
      20: if_icmpgt     80
      23: new           #72                 // class java/lang/StringBuilder
      26: dup
      27: invokespecial #76                 // Method java/lang/StringBuilder."<init>":()V
      30: iload_1
      31: invokevirtual #80                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      34: ldc           #82                 // String  *
      36: invokevirtual #85                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      39: iload_2
      40: invokevirtual #80                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: ldc           #87                 // String  =
      45: invokevirtual #85                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: iload_1
      49: iload_2
      50: imul
      51: invokevirtual #80                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      54: bipush        124
      56: invokevirtual #90                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      59: invokevirtual #94                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      62: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      65: swap
      66: invokevirtual #37                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      69: iload_2
      70: iload_0
      71: if_icmpeq     80
      74: iinc          2, 1
      77: goto          23
      80: iload_1
      81: iload_0
      82: if_icmpeq     91
      85: iinc          1, 1
      88: goto          7
      91: return

  public static final boolean linearContains(int, java.util.List<java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #103                // String numbers
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokeinterface #49,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      12: astore_2
      13: aload_2
      14: invokeinterface #55,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      19: ifeq          46
      22: aload_2
      23: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      28: checkcast     #105                // class java/lang/Number
      31: invokevirtual #109                // Method java/lang/Number.intValue:()I
      34: istore_3
      35: iload_0
      36: iload_3
      37: if_icmpne     44
      40: iconst_1
      41: goto          45
      44: iconst_0
      45: ireturn
      46: iconst_0
      47: ireturn

  public static final boolean pseudoBinaryContains(int, java.util.List<java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #103                // String numbers
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokeinterface #114,  1          // InterfaceMethod java/util/List.isEmpty:()Z
      12: ifeq          17
      15: iconst_0
      16: ireturn
      17: aload_1
      18: checkcast     #116                // class java/lang/Iterable
      21: invokestatic  #120                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      24: pop
      25: aload_1
      26: invokeinterface #123,  1          // InterfaceMethod java/util/List.size:()I
      31: iconst_2
      32: idiv
      33: istore_2
      34: iload_0
      35: aload_1
      36: iload_2
      37: invokeinterface #127,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      42: checkcast     #105                // class java/lang/Number
      45: invokevirtual #109                // Method java/lang/Number.intValue:()I
      48: if_icmpgt     81
      51: iconst_0
      52: istore_3
      53: iload_3
      54: iload_2
      55: if_icmpgt     120
      58: aload_1
      59: iload_3
      60: invokeinterface #127,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      65: checkcast     #105                // class java/lang/Number
      68: invokevirtual #109                // Method java/lang/Number.intValue:()I
      71: iload_0
      72: if_icmpne     79
      75: iconst_1
      76: goto          80
      79: iconst_0
      80: ireturn
      81: iload_2
      82: istore_3
      83: aload_1
      84: invokeinterface #123,  1          // InterfaceMethod java/util/List.size:()I
      89: istore        4
      91: iload_3
      92: iload         4
      94: if_icmpge     120
      97: aload_1
      98: iload_3
      99: invokeinterface #127,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     104: checkcast     #105                // class java/lang/Number
     107: invokevirtual #109                // Method java/lang/Number.intValue:()I
     110: iload_0
     111: if_icmpne     118
     114: iconst_1
     115: goto          119
     118: iconst_0
     119: ireturn
     120: iconst_0
     121: ireturn

  public static final int sumFromOne(int);
    Code:
       0: iconst_0
       1: istore_1
       2: iconst_1
       3: istore_2
       4: iload_2
       5: iload_0
       6: if_icmpgt     24
       9: iload_1
      10: iload_2
      11: iadd
      12: istore_1
      13: iload_2
      14: iload_0
      15: if_icmpeq     24
      18: iinc          2, 1
      21: goto          9
      24: iload_1
      25: ireturn

  public static final int sumFromOnes(int);
    Code:
       0: new           #136                // class kotlin/ranges/IntRange
       3: dup
       4: iconst_1
       5: iload_0
       6: invokespecial #139                // Method kotlin/ranges/IntRange."<init>":(II)V
       9: checkcast     #116                // class java/lang/Iterable
      12: astore_1
      13: iconst_0
      14: istore_2
      15: aload_1
      16: invokeinterface #140,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      21: astore_3
      22: aload_3
      23: invokeinterface #55,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      28: ifne          41
      31: new           #142                // class java/lang/UnsupportedOperationException
      34: dup
      35: ldc           #144                // String Empty collection can\'t be reduced.
      37: invokespecial #147                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
      40: athrow
      41: aload_3
      42: checkcast     #149                // class kotlin/collections/IntIterator
      45: invokevirtual #152                // Method kotlin/collections/IntIterator.nextInt:()I
      48: istore        4
      50: aload_3
      51: invokeinterface #55,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      56: ifeq          85
      59: iload         4
      61: aload_3
      62: checkcast     #149                // class kotlin/collections/IntIterator
      65: invokevirtual #152                // Method kotlin/collections/IntIterator.nextInt:()I
      68: istore        5
      70: istore        6
      72: iconst_0
      73: istore        7
      75: iload         5
      77: iload         6
      79: iadd
      80: istore        4
      82: goto          50
      85: iload         4
      87: ireturn

  public static final int sumFrom1(int);
    Code:
       0: iload_0
       1: iload_0
       2: iconst_1
       3: iadd
       4: imul
       5: iconst_2
       6: idiv
       7: ireturn

  public static final void printedSorted(java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #164                // String number
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #116                // class java/lang/Iterable
      10: invokestatic  #120                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      13: astore_1
      14: aload_1
      15: invokeinterface #49,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      20: astore_2
      21: aload_2
      22: invokeinterface #55,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      27: ifeq          53
      30: aload_2
      31: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      36: checkcast     #105                // class java/lang/Number
      39: invokevirtual #109                // Method java/lang/Number.intValue:()I
      42: istore_3
      43: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      46: iload_3
      47: invokevirtual #166                // Method java/io/PrintStream.println:(I)V
      50: goto          21
      53: return
}


package aoc.day5

class SupplyStacks(private val input: List<String>) {

    val stacks = mutableListOf<Stack>()

    init {
        val rawStacks = input.slice(0..input.indexOf(""))
            .filter { line -> line.isNotEmpty() }
            .map {
                it.split(",")
            }
            .flatten()
            .map {
                it.chunked(4).map {
                        s -> s.trim().removePrefix("[").removeSuffix("]")
                }
            }
        val s = rawStacks.toMutableList()
        s.removeLast()

        for (i in 0 until rawStacks.last().count())
        {
            stacks.add(i, Stack())
            s.forEach {
                if (i in it.indices && it[i]!!.isNotEmpty()) {
                    stacks[i].addCrate(Crate(it[i]))
                }
            }
        }
        stacks.map { it.crates.reverse() }
    }

    fun rearrangeStacksBySingle(): String
    {
        val moves = input.slice(input.indexOf("") + 1 until input.count()).map {
            val move = it.split(" ")
            val quantity = move[1].toInt()
            val from = move[3].toInt() - 1
            val to = move[5].toInt() - 1

            stacks[to].crates.addAll(stacks[from].crates.takeLast(quantity).reversed())
            stacks[from].crates = stacks[from].crates.dropLast(quantity).toMutableList()

        }

        return stacks.map {
            it.crates.last().toString()
        }.joinToString("")
    }

    fun useCrateMover9001(): String
    {
        val moves = input.slice(input.indexOf("") + 1 until input.count()).map {
            val move = it.split(" ")
            val quantity = move[1].toInt()
            val from = move[3].toInt() - 1
            val to = move[5].toInt() - 1

            stacks[to].crates.addAll(stacks[from].crates.takeLast(quantity))
            stacks[from].crates = stacks[from].crates.dropLast(quantity).toMutableList()
            stacks.forEach { println(it.crates.toString()) }
        }

        return stacks.map {
            it.crates.last().toString()
        }.joinToString("")
    }
}

class Stack
{
    public var crates = mutableListOf<Crate>()

    fun addCrate(crate: Crate)
    {
        crates.add(crate)
    }
}

class Crate(public val crateCode: String) {
    override fun toString(): String {
        return crateCode
    }
}

Compiled from "SupplyStacks.kt"
public final class aoc.day5.SupplyStacks {
  private final java.util.List<java.lang.String> input;

  private final java.util.List<aoc.day5.Stack> stacks;

  public aoc.day5.SupplyStacks(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #10                 // String input
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #19                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #22                 // Field input:Ljava/util/List;
      15: aload_0
      16: new           #24                 // class java/util/ArrayList
      19: dup
      20: invokespecial #25                 // Method java/util/ArrayList."<init>":()V
      23: checkcast     #27                 // class java/util/List
      26: putfield      #30                 // Field stacks:Ljava/util/List;
      29: nop
      30: aload_0
      31: getfield      #22                 // Field input:Ljava/util/List;
      34: new           #32                 // class kotlin/ranges/IntRange
      37: dup
      38: iconst_0
      39: aload_0
      40: getfield      #22                 // Field input:Ljava/util/List;
      43: ldc           #34                 // String
      45: invokeinterface #38,  2           // InterfaceMethod java/util/List.indexOf:(Ljava/lang/Object;)I
      50: invokespecial #41                 // Method kotlin/ranges/IntRange."<init>":(II)V
      53: invokestatic  #47                 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;
      56: checkcast     #49                 // class java/lang/Iterable
      59: astore_3
      60: nop
      61: iconst_0
      62: istore        4
      64: aload_3
      65: astore        5
      67: new           #24                 // class java/util/ArrayList
      70: dup
      71: invokespecial #25                 // Method java/util/ArrayList."<init>":()V
      74: checkcast     #51                 // class java/util/Collection
      77: astore        6
      79: iconst_0
      80: istore        7
      82: aload         5
      84: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      89: astore        8
      91: aload         8
      93: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      98: ifeq          155
     101: aload         8
     103: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     108: astore        9
     110: aload         9
     112: checkcast     #67                 // class java/lang/String
     115: astore        10
     117: iconst_0
     118: istore        11
     120: aload         10
     122: checkcast     #69                 // class java/lang/CharSequence
     125: invokeinterface #73,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     130: ifle          137
     133: iconst_1
     134: goto          138
     137: iconst_0
     138: nop
     139: ifeq          91
     142: aload         6
     144: aload         9
     146: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     151: pop
     152: goto          91
     155: aload         6
     157: checkcast     #27                 // class java/util/List
     160: nop
     161: checkcast     #49                 // class java/lang/Iterable
     164: astore_3
     165: nop
     166: iconst_0
     167: istore        4
     169: aload_3
     170: astore        5
     172: new           #24                 // class java/util/ArrayList
     175: dup
     176: aload_3
     177: bipush        10
     179: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     182: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     185: checkcast     #51                 // class java/util/Collection
     188: astore        6
     190: iconst_0
     191: istore        7
     193: aload         5
     195: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     200: astore        8
     202: aload         8
     204: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     209: ifeq          274
     212: aload         8
     214: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     219: astore        9
     221: aload         6
     223: aload         9
     225: checkcast     #67                 // class java/lang/String
     228: astore        10
     230: astore        22
     232: iconst_0
     233: istore        11
     235: aload         10
     237: checkcast     #69                 // class java/lang/CharSequence
     240: iconst_1
     241: anewarray     #67                 // class java/lang/String
     244: astore        12
     246: aload         12
     248: iconst_0
     249: ldc           #86                 // String ,
     251: aastore
     252: aload         12
     254: iconst_0
     255: iconst_0
     256: bipush        6
     258: aconst_null
     259: invokestatic  #92                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     262: aload         22
     264: swap
     265: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     270: pop
     271: goto          202
     274: aload         6
     276: checkcast     #27                 // class java/util/List
     279: nop
     280: checkcast     #49                 // class java/lang/Iterable
     283: invokestatic  #96                 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     286: checkcast     #49                 // class java/lang/Iterable
     289: astore_3
     290: nop
     291: iconst_0
     292: istore        4
     294: aload_3
     295: astore        5
     297: new           #24                 // class java/util/ArrayList
     300: dup
     301: aload_3
     302: bipush        10
     304: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     307: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     310: checkcast     #51                 // class java/util/Collection
     313: astore        6
     315: iconst_0
     316: istore        7
     318: aload         5
     320: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     325: astore        8
     327: aload         8
     329: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     334: ifeq          503
     337: aload         8
     339: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     344: astore        9
     346: aload         6
     348: aload         9
     350: checkcast     #67                 // class java/lang/String
     353: astore        10
     355: astore        22
     357: iconst_0
     358: istore        11
     360: aload         10
     362: checkcast     #69                 // class java/lang/CharSequence
     365: iconst_4
     366: invokestatic  #100                // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
     369: checkcast     #49                 // class java/lang/Iterable
     372: astore        12
     374: iconst_0
     375: istore        13
     377: aload         12
     379: astore        14
     381: new           #24                 // class java/util/ArrayList
     384: dup
     385: aload         12
     387: bipush        10
     389: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     392: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     395: checkcast     #51                 // class java/util/Collection
     398: astore        15
     400: iconst_0
     401: istore        16
     403: aload         14
     405: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     410: astore        17
     412: aload         17
     414: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     419: ifeq          484
     422: aload         17
     424: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     429: astore        18
     431: aload         15
     433: aload         18
     435: checkcast     #67                 // class java/lang/String
     438: astore        19
     440: astore        20
     442: iconst_0
     443: istore        21
     445: aload         19
     447: checkcast     #69                 // class java/lang/CharSequence
     450: invokestatic  #104                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     453: invokevirtual #108                // Method java/lang/Object.toString:()Ljava/lang/String;
     456: ldc           #110                // String [
     458: checkcast     #69                 // class java/lang/CharSequence
     461: invokestatic  #114                // Method kotlin/text/StringsKt.removePrefix:(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String;
     464: ldc           #116                // String ]
     466: checkcast     #69                 // class java/lang/CharSequence
     469: invokestatic  #119                // Method kotlin/text/StringsKt.removeSuffix:(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String;
     472: aload         20
     474: swap
     475: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     480: pop
     481: goto          412
     484: aload         15
     486: checkcast     #27                 // class java/util/List
     489: nop
     490: nop
     491: aload         22
     493: swap
     494: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     499: pop
     500: goto          327
     503: aload         6
     505: checkcast     #27                 // class java/util/List
     508: nop
     509: astore_2
     510: aload_2
     511: checkcast     #51                 // class java/util/Collection
     514: invokestatic  #123                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     517: astore_3
     518: aload_3
     519: invokeinterface #126,  1          // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;
     524: pop
     525: iconst_0
     526: istore        4
     528: aload_2
     529: invokestatic  #130                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     532: checkcast     #51                 // class java/util/Collection
     535: invokeinterface #133,  1          // InterfaceMethod java/util/Collection.size:()I
     540: istore        5
     542: iload         4
     544: iload         5
     546: if_icmpge     727
     549: aload_0
     550: getfield      #30                 // Field stacks:Ljava/util/List;
     553: iload         4
     555: new           #135                // class aoc/day5/Stack
     558: dup
     559: invokespecial #136                // Method aoc/day5/Stack."<init>":()V
     562: invokeinterface #139,  3          // InterfaceMethod java/util/List.add:(ILjava/lang/Object;)V
     567: aload_3
     568: checkcast     #49                 // class java/lang/Iterable
     571: astore        6
     573: iconst_0
     574: istore        7
     576: aload         6
     578: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     583: astore        8
     585: aload         8
     587: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     592: ifeq          720
     595: aload         8
     597: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     602: astore        9
     604: aload         9
     606: checkcast     #27                 // class java/util/List
     609: astore        10
     611: iconst_0
     612: istore        11
     614: iconst_0
     615: iload         4
     617: if_icmpgt     643
     620: iload         4
     622: aload         10
     624: checkcast     #51                 // class java/util/Collection
     627: invokeinterface #133,  1          // InterfaceMethod java/util/Collection.size:()I
     632: if_icmpge     639
     635: iconst_1
     636: goto          644
     639: iconst_0
     640: goto          644
     643: iconst_0
     644: ifeq          715
     647: aload         10
     649: iload         4
     651: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     656: dup
     657: invokestatic  #147                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     660: checkcast     #69                 // class java/lang/CharSequence
     663: invokeinterface #73,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     668: ifle          675
     671: iconst_1
     672: goto          676
     675: iconst_0
     676: ifeq          715
     679: aload_0
     680: getfield      #30                 // Field stacks:Ljava/util/List;
     683: iload         4
     685: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     690: checkcast     #135                // class aoc/day5/Stack
     693: new           #149                // class aoc/day5/Crate
     696: dup
     697: aload         10
     699: iload         4
     701: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     706: checkcast     #67                 // class java/lang/String
     709: invokespecial #152                // Method aoc/day5/Crate."<init>":(Ljava/lang/String;)V
     712: invokevirtual #156                // Method aoc/day5/Stack.addCrate:(Laoc/day5/Crate;)V
     715: nop
     716: nop
     717: goto          585
     720: nop
     721: iinc          4, 1
     724: goto          542
     727: aload_0
     728: getfield      #30                 // Field stacks:Ljava/util/List;
     731: checkcast     #49                 // class java/lang/Iterable
     734: astore        4
     736: iconst_0
     737: istore        5
     739: aload         4
     741: astore        6
     743: new           #24                 // class java/util/ArrayList
     746: dup
     747: aload         4
     749: bipush        10
     751: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     754: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     757: checkcast     #51                 // class java/util/Collection
     760: astore        7
     762: iconst_0
     763: istore        8
     765: aload         6
     767: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     772: astore        9
     774: aload         9
     776: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     781: ifeq          829
     784: aload         9
     786: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     791: astore        10
     793: aload         7
     795: aload         10
     797: checkcast     #135                // class aoc/day5/Stack
     800: astore        11
     802: astore        22
     804: iconst_0
     805: istore        12
     807: aload         11
     809: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     812: invokestatic  #163                // Method kotlin/collections/CollectionsKt.reverse:(Ljava/util/List;)V
     815: aload         22
     817: getstatic     #169                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     820: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     825: pop
     826: goto          774
     829: aload         7
     831: checkcast     #27                 // class java/util/List
     834: nop
     835: pop
     836: nop
     837: return

  public final java.util.List<aoc.day5.Stack> getStacks();
    Code:
       0: aload_0
       1: getfield      #30                 // Field stacks:Ljava/util/List;
       4: areturn

  public final java.lang.String rearrangeStacksBySingle();
    Code:
       0: aload_0
       1: getfield      #22                 // Field input:Ljava/util/List;
       4: aload_0
       5: getfield      #22                 // Field input:Ljava/util/List;
       8: ldc           #34                 // String
      10: invokeinterface #38,  2           // InterfaceMethod java/util/List.indexOf:(Ljava/lang/Object;)I
      15: iconst_1
      16: iadd
      17: aload_0
      18: getfield      #22                 // Field input:Ljava/util/List;
      21: checkcast     #51                 // class java/util/Collection
      24: invokeinterface #133,  1          // InterfaceMethod java/util/Collection.size:()I
      29: invokestatic  #211                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      32: invokestatic  #47                 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;
      35: checkcast     #49                 // class java/lang/Iterable
      38: astore_2
      39: iconst_0
      40: istore_3
      41: aload_2
      42: astore        4
      44: new           #24                 // class java/util/ArrayList
      47: dup
      48: aload_2
      49: bipush        10
      51: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      54: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      57: checkcast     #51                 // class java/util/Collection
      60: astore        5
      62: iconst_0
      63: istore        6
      65: aload         4
      67: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      72: astore        7
      74: aload         7
      76: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      81: ifeq          302
      84: aload         7
      86: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      91: astore        8
      93: aload         5
      95: aload         8
      97: checkcast     #67                 // class java/lang/String
     100: astore        9
     102: astore        15
     104: iconst_0
     105: istore        10
     107: aload         9
     109: checkcast     #69                 // class java/lang/CharSequence
     112: iconst_1
     113: anewarray     #67                 // class java/lang/String
     116: astore        11
     118: aload         11
     120: iconst_0
     121: ldc           #213                // String
     123: aastore
     124: aload         11
     126: iconst_0
     127: iconst_0
     128: bipush        6
     130: aconst_null
     131: invokestatic  #92                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     134: astore        12
     136: aload         12
     138: iconst_1
     139: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     144: checkcast     #67                 // class java/lang/String
     147: invokestatic  #219                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     150: istore        11
     152: aload         12
     154: iconst_3
     155: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     160: checkcast     #67                 // class java/lang/String
     163: invokestatic  #219                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     166: iconst_1
     167: isub
     168: istore        13
     170: aload         12
     172: iconst_5
     173: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     178: checkcast     #67                 // class java/lang/String
     181: invokestatic  #219                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     184: iconst_1
     185: isub
     186: istore        14
     188: aload_0
     189: getfield      #30                 // Field stacks:Ljava/util/List;
     192: iload         14
     194: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     199: checkcast     #135                // class aoc/day5/Stack
     202: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     205: aload_0
     206: getfield      #30                 // Field stacks:Ljava/util/List;
     209: iload         13
     211: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     216: checkcast     #135                // class aoc/day5/Stack
     219: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     222: iload         11
     224: invokestatic  #223                // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;
     227: checkcast     #49                 // class java/lang/Iterable
     230: invokestatic  #226                // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;
     233: checkcast     #51                 // class java/util/Collection
     236: invokeinterface #230,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
     241: pop
     242: aload_0
     243: getfield      #30                 // Field stacks:Ljava/util/List;
     246: iload         13
     248: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     253: checkcast     #135                // class aoc/day5/Stack
     256: aload_0
     257: getfield      #30                 // Field stacks:Ljava/util/List;
     260: iload         13
     262: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     267: checkcast     #135                // class aoc/day5/Stack
     270: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     273: iload         11
     275: invokestatic  #233                // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;
     278: checkcast     #51                 // class java/util/Collection
     281: invokestatic  #123                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     284: invokevirtual #236                // Method aoc/day5/Stack.setCrates:(Ljava/util/List;)V
     287: nop
     288: aload         15
     290: getstatic     #169                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     293: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     298: pop
     299: goto          74
     302: aload         5
     304: checkcast     #27                 // class java/util/List
     307: nop
     308: astore_1
     309: aload_0
     310: getfield      #30                 // Field stacks:Ljava/util/List;
     313: checkcast     #49                 // class java/lang/Iterable
     316: astore_2
     317: iconst_0
     318: istore_3
     319: aload_2
     320: astore        4
     322: new           #24                 // class java/util/ArrayList
     325: dup
     326: aload_2
     327: bipush        10
     329: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     332: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     335: checkcast     #51                 // class java/util/Collection
     338: astore        5
     340: iconst_0
     341: istore        6
     343: aload         4
     345: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     350: astore        7
     352: aload         7
     354: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     359: ifeq          411
     362: aload         7
     364: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     369: astore        8
     371: aload         5
     373: aload         8
     375: checkcast     #135                // class aoc/day5/Stack
     378: astore        9
     380: astore        15
     382: iconst_0
     383: istore        10
     385: aload         9
     387: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     390: invokestatic  #130                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     393: checkcast     #149                // class aoc/day5/Crate
     396: invokevirtual #237                // Method aoc/day5/Crate.toString:()Ljava/lang/String;
     399: aload         15
     401: swap
     402: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     407: pop
     408: goto          352
     411: aload         5
     413: checkcast     #27                 // class java/util/List
     416: nop
     417: checkcast     #49                 // class java/lang/Iterable
     420: ldc           #34                 // String
     422: checkcast     #69                 // class java/lang/CharSequence
     425: aconst_null
     426: aconst_null
     427: iconst_0
     428: aconst_null
     429: aconst_null
     430: bipush        62
     432: aconst_null
     433: invokestatic  #241                // 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;
     436: areturn

  public final java.lang.String useCrateMover9001();
    Code:
       0: aload_0
       1: getfield      #22                 // Field input:Ljava/util/List;
       4: aload_0
       5: getfield      #22                 // Field input:Ljava/util/List;
       8: ldc           #34                 // String
      10: invokeinterface #38,  2           // InterfaceMethod java/util/List.indexOf:(Ljava/lang/Object;)I
      15: iconst_1
      16: iadd
      17: aload_0
      18: getfield      #22                 // Field input:Ljava/util/List;
      21: checkcast     #51                 // class java/util/Collection
      24: invokeinterface #133,  1          // InterfaceMethod java/util/Collection.size:()I
      29: invokestatic  #211                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      32: invokestatic  #47                 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;
      35: checkcast     #49                 // class java/lang/Iterable
      38: astore_2
      39: iconst_0
      40: istore_3
      41: aload_2
      42: astore        4
      44: new           #24                 // class java/util/ArrayList
      47: dup
      48: aload_2
      49: bipush        10
      51: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      54: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
      57: checkcast     #51                 // class java/util/Collection
      60: astore        5
      62: iconst_0
      63: istore        6
      65: aload         4
      67: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      72: astore        7
      74: aload         7
      76: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      81: ifeq          367
      84: aload         7
      86: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      91: astore        8
      93: aload         5
      95: aload         8
      97: checkcast     #67                 // class java/lang/String
     100: astore        9
     102: astore        21
     104: iconst_0
     105: istore        10
     107: aload         9
     109: checkcast     #69                 // class java/lang/CharSequence
     112: iconst_1
     113: anewarray     #67                 // class java/lang/String
     116: astore        11
     118: aload         11
     120: iconst_0
     121: ldc           #213                // String
     123: aastore
     124: aload         11
     126: iconst_0
     127: iconst_0
     128: bipush        6
     130: aconst_null
     131: invokestatic  #92                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     134: astore        12
     136: aload         12
     138: iconst_1
     139: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     144: checkcast     #67                 // class java/lang/String
     147: invokestatic  #219                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     150: istore        11
     152: aload         12
     154: iconst_3
     155: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     160: checkcast     #67                 // class java/lang/String
     163: invokestatic  #219                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     166: iconst_1
     167: isub
     168: istore        13
     170: aload         12
     172: iconst_5
     173: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     178: checkcast     #67                 // class java/lang/String
     181: invokestatic  #219                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     184: iconst_1
     185: isub
     186: istore        14
     188: aload_0
     189: getfield      #30                 // Field stacks:Ljava/util/List;
     192: iload         14
     194: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     199: checkcast     #135                // class aoc/day5/Stack
     202: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     205: aload_0
     206: getfield      #30                 // Field stacks:Ljava/util/List;
     209: iload         13
     211: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     216: checkcast     #135                // class aoc/day5/Stack
     219: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     222: iload         11
     224: invokestatic  #223                // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;
     227: checkcast     #51                 // class java/util/Collection
     230: invokeinterface #230,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
     235: pop
     236: aload_0
     237: getfield      #30                 // Field stacks:Ljava/util/List;
     240: iload         13
     242: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     247: checkcast     #135                // class aoc/day5/Stack
     250: aload_0
     251: getfield      #30                 // Field stacks:Ljava/util/List;
     254: iload         13
     256: invokeinterface #143,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     261: checkcast     #135                // class aoc/day5/Stack
     264: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     267: iload         11
     269: invokestatic  #233                // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;
     272: checkcast     #51                 // class java/util/Collection
     275: invokestatic  #123                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     278: invokevirtual #236                // Method aoc/day5/Stack.setCrates:(Ljava/util/List;)V
     281: aload_0
     282: getfield      #30                 // Field stacks:Ljava/util/List;
     285: checkcast     #49                 // class java/lang/Iterable
     288: astore        15
     290: iconst_0
     291: istore        16
     293: aload         15
     295: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     300: astore        17
     302: aload         17
     304: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     309: ifeq          351
     312: aload         17
     314: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     319: astore        18
     321: aload         18
     323: checkcast     #135                // class aoc/day5/Stack
     326: astore        19
     328: iconst_0
     329: istore        20
     331: aload         19
     333: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     336: invokevirtual #108                // Method java/lang/Object.toString:()Ljava/lang/String;
     339: getstatic     #255                // Field java/lang/System.out:Ljava/io/PrintStream;
     342: swap
     343: invokevirtual #260                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     346: nop
     347: nop
     348: goto          302
     351: nop
     352: nop
     353: aload         21
     355: getstatic     #169                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     358: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     363: pop
     364: goto          74
     367: aload         5
     369: checkcast     #27                 // class java/util/List
     372: nop
     373: astore_1
     374: aload_0
     375: getfield      #30                 // Field stacks:Ljava/util/List;
     378: checkcast     #49                 // class java/lang/Iterable
     381: astore_2
     382: iconst_0
     383: istore_3
     384: aload_2
     385: astore        4
     387: new           #24                 // class java/util/ArrayList
     390: dup
     391: aload_2
     392: bipush        10
     394: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     397: invokespecial #84                 // Method java/util/ArrayList."<init>":(I)V
     400: checkcast     #51                 // class java/util/Collection
     403: astore        5
     405: iconst_0
     406: istore        6
     408: aload         4
     410: invokeinterface #55,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     415: astore        7
     417: aload         7
     419: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     424: ifeq          476
     427: aload         7
     429: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     434: astore        8
     436: aload         5
     438: aload         8
     440: checkcast     #135                // class aoc/day5/Stack
     443: astore        9
     445: astore        21
     447: iconst_0
     448: istore        10
     450: aload         9
     452: invokevirtual #160                // Method aoc/day5/Stack.getCrates:()Ljava/util/List;
     455: invokestatic  #130                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     458: checkcast     #149                // class aoc/day5/Crate
     461: invokevirtual #237                // Method aoc/day5/Crate.toString:()Ljava/lang/String;
     464: aload         21
     466: swap
     467: invokeinterface #77,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     472: pop
     473: goto          417
     476: aload         5
     478: checkcast     #27                 // class java/util/List
     481: nop
     482: checkcast     #49                 // class java/lang/Iterable
     485: ldc           #34                 // String
     487: checkcast     #69                 // class java/lang/CharSequence
     490: aconst_null
     491: aconst_null
     492: iconst_0
     493: aconst_null
     494: aconst_null
     495: bipush        62
     497: aconst_null
     498: invokestatic  #241                // 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;
     501: areturn
}