package cz.wrent.advent

fun main() {
	println(partOne(test))

	val result = partOne(input)
	println("7a: $result")

	println(partTwo(test))
	val resultTwo = partTwo(input)
	println("7b: $resultTwo")
}

private fun partOne(input: String): Long {
	val nodes = input.parseTree()
	return nodes.values.filterIsInstance<Dir>().filter { it.getSize() <= 100000 }.sumOf { it.getSize() }
}

private fun partTwo(input: String): Long {
	val nodes = input.parseTree()
	val root = nodes["/"]!!
	val freeSpace = 70000000 - root.getSize()
	val requiredSpace = 30000000 - freeSpace
	return nodes.values.filterIsInstance<Dir>().filter { it.getSize() >= requiredSpace }.minByOrNull { it.getSize() }!!
		.getSize()
}

private interface Node {
	fun getChildren(): List<Node>
	fun getSize(): Long
	fun getFullName(): String
	fun getParent(): Dir
}

private data class File(
	private val parent: Dir,
	private val name: String,
	private val size: Long,
) : Node {
	override fun getChildren(): List<Node> {
		return emptyList()
	}

	override fun getSize(): Long {
		return size
	}

	override fun getFullName(): String {
		return this.parent.getFullName() + "/" + this.name
	}

	override fun getParent(): Dir {
		return this.parent
	}
}

private data class Dir(
	private val parent: Dir?,
	private val name: String,
	private val children: MutableList<Node>,
) : Node {
	override fun getChildren(): List<Node> {
		return children
	}

	override fun getSize(): Long {
		return children.sumOf { it.getSize() }
	}

	override fun getFullName(): String {
		return (this.parent?.getFullName() ?: "") + "/" + this.name
	}

	override fun getParent(): Dir {
		return this.parent ?: this
	}

	fun addChild(node: Node) {
		this.children.add(node)
	}
}

private fun String.parseTree(): Map<String, Node> {
	val split = this.split("$ ").drop(1)
	val iterator = split.iterator()

	val root = Dir(null, "", mutableListOf())
	val nodes = mutableMapOf<String, Node>(root.getFullName() to root)

	var current = root
	while (iterator.hasNext()) {
		val next = iterator.next()

		if (next.startsWith("cd")) {
			val path = next.split(" ").get(1).trim()
			val dir = Dir(current, path, mutableListOf())
			if (path == "/") {
				current = root
			} else if (path == "..") {
				current = current.getParent()
			} else if (!nodes.containsKey(dir.getFullName())) {
				current = dir
				nodes[dir.getFullName()] = dir
			} else {
				current = nodes[dir.getFullName()] as Dir
			}
		} else if (next.startsWith("ls")) {
			val files = next.split("\n").drop(1).filter { it.isNotEmpty() }
			files.forEach { fileString ->
				val (size, name) = fileString.split(" ")
				val node = if (size == "dir") {
					Dir(current, name, mutableListOf())
				} else {
					File(current, name, size.toLong())
				}
				current.addChild(node)
				nodes[node.getFullName()] = node
			}
		} else {
			error("Unknown command $next")
		}
	}
	return nodes
}

private const val test = """${'$'} cd /
${'$'} ls
dir a
14848514 b.txt
8504156 c.dat
dir d
${'$'} cd a
${'$'} ls
dir e
29116 f
2557 g
62596 h.lst
${'$'} cd e
${'$'} ls
584 i
${'$'} cd ..
${'$'} cd ..
${'$'} cd d
${'$'} ls
4060174 j
8033020 d.log
5626152 d.ext
7214296 k"""

private const val input = """${'$'} cd /
${'$'} ls
dir bntdgzs
179593 cjw.jgc
110209 grbwdwsm.znn
dir hsswswtq
dir jdfwmhg
dir jlcbpsr
70323 qdtbvqjj
48606 qdtbvqjj.zdg
dir tvcr
dir vhjbjr
dir vvsg
270523 wpsjfqtn.ljt
${'$'} cd bntdgzs
${'$'} ls
297955 gcwcp
${'$'} cd ..
${'$'} cd hsswswtq
${'$'} ls
dir bsjbvff
dir dpgvp
267138 grbwdwsm.znn
dir hldgfpvh
dir jdfwmhg
dir jtgdv
93274 ptsd.nzh
268335 qdtbvqjj.dlh
185530 qdtbvqjj.jrw
dir vcbqdj
dir wtrsg
${'$'} cd bsjbvff
${'$'} ls
dir dmnt
148799 grbwdwsm.znn
324931 hzmqrfc.lsd
211089 qdtbvqjj
${'$'} cd dmnt
${'$'} ls
221038 zht
${'$'} cd ..
${'$'} cd ..
${'$'} cd dpgvp
${'$'} ls
dir fzttpjtd
dir jdrbwrc
dir rwz
dir tssm
${'$'} cd fzttpjtd
${'$'} ls
149872 jdfwmhg
${'$'} cd ..
${'$'} cd jdrbwrc
${'$'} ls
149973 hpgg.srm
dir ptsd
${'$'} cd ptsd
${'$'} ls
2594 twzf.pqq
${'$'} cd ..
${'$'} cd ..
${'$'} cd rwz
${'$'} ls
dir jdfwmhg
302808 zzlh
${'$'} cd jdfwmhg
${'$'} ls
229683 cdcrgcmh
218733 nhzt
${'$'} cd ..
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
dir ptsd
37272 qfnnrqsh.qvg
215066 wnvjc.jqf
${'$'} cd ptsd
${'$'} ls
24102 bwtbht.dwq
224035 qdtbvqjj.dmp
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd hldgfpvh
${'$'} ls
316712 grbwdwsm.znn
328950 tqvgqjrr
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
130652 gcwcp
dir jdfwmhg
215427 lfw.zml
dir qdtbvqjj
4181 rgsvgssj.qsr
${'$'} cd jdfwmhg
${'$'} ls
dir bvm
dir hsswswtq
122279 qznt.jhl
dir sjw
dir zpfdtl
${'$'} cd bvm
${'$'} ls
22841 fbcgh.mrp
dir hsswswtq
dir hstg
41317 ndrt
dir nvmvghb
239316 ptsd
dir qtwvdtsp
98555 vzh
${'$'} cd hsswswtq
${'$'} ls
dir ddcjvjgf
127104 plwvb.pbj
dir ptsd
dir qhp
dir rjtrhgwh
${'$'} cd ddcjvjgf
${'$'} ls
135870 bwtbht.dwq
81968 gcwcp
182253 mrbh.wmc
275931 nsrqrts
322128 pfpcp
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
214981 jsrlsc
dir wpbdrcw
${'$'} cd wpbdrcw
${'$'} ls
197849 mljfb.ggb
173586 ptsd
${'$'} cd ..
${'$'} cd ..
${'$'} cd qhp
${'$'} ls
293198 bnrgl
${'$'} cd ..
${'$'} cd rjtrhgwh
${'$'} ls
224393 clrp.nst
${'$'} cd ..
${'$'} cd ..
${'$'} cd hstg
${'$'} ls
51671 gdsfpc
209216 hsswswtq
97203 jlnr
dir thdhg
57399 tssm
${'$'} cd thdhg
${'$'} ls
201896 jjp.wvw
${'$'} cd ..
${'$'} cd ..
${'$'} cd nvmvghb
${'$'} ls
210047 gfcrzgj
dir rqjbplv
dir rvwd
292931 sgwvcqfr.bpq
dir vtjd
${'$'} cd rqjbplv
${'$'} ls
105204 gcwcp
${'$'} cd ..
${'$'} cd rvwd
${'$'} ls
66170 jdfwmhg
${'$'} cd ..
${'$'} cd vtjd
${'$'} ls
dir ptsd
${'$'} cd ptsd
${'$'} ls
300524 bwtbht.dwq
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd qtwvdtsp
${'$'} ls
289574 wctgtq
${'$'} cd ..
${'$'} cd ..
${'$'} cd hsswswtq
${'$'} ls
24935 gcwcp
dir jzpbdcmc
26834 mljfb.ggb
182501 phnmlsjp.pjc
dir pttnl
dir qdtbvqjj
dir vst
${'$'} cd jzpbdcmc
${'$'} ls
297521 grbwdwsm.znn
dir qwc
dir zzswd
${'$'} cd qwc
${'$'} ls
81143 hsswswtq.rjw
54843 mjvvfsz.rgz
273051 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd zzswd
${'$'} ls
216062 vlbwz.zmh
${'$'} cd ..
${'$'} cd ..
${'$'} cd pttnl
${'$'} ls
257733 mljfb.ggb
250887 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd qdtbvqjj
${'$'} ls
34667 gcwcp
${'$'} cd ..
${'$'} cd vst
${'$'} ls
70250 pfwgtmtt.ccs
dir zpcqhml
${'$'} cd zpcqhml
${'$'} ls
219936 jdfwmhg.zbm
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd sjw
${'$'} ls
152311 nqjtvzff
157117 pfwgtmtt.ccs
118226 ptsd.vsm
${'$'} cd ..
${'$'} cd zpfdtl
${'$'} ls
189042 gcwcp
${'$'} cd ..
${'$'} cd ..
${'$'} cd qdtbvqjj
${'$'} ls
dir ftz
dir hvlffb
dir lzbb
53335 ptsd
dir qdtbvqjj
${'$'} cd ftz
${'$'} ls
dir fft
256058 gcwcp
497 hsswswtq.vqs
103941 hvtcz.fsg
171587 ljlnz.ffg
115101 mljfb.ggb
dir qdtbvqjj
${'$'} cd fft
${'$'} ls
58845 bwtbht.dwq
136040 gcwcp
256973 mljfb.ggb
${'$'} cd ..
${'$'} cd qdtbvqjj
${'$'} ls
dir fgqhdh
304573 ntm.wmc
${'$'} cd fgqhdh
${'$'} ls
317143 gcwcp
26010 lsfpfdqz
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd hvlffb
${'$'} ls
6682 vjt.mcf
${'$'} cd ..
${'$'} cd lzbb
${'$'} ls
dir bbvml
324162 bwtbht.dwq
dir fjs
dir pffntc
dir pnltt
dir ptsd
${'$'} cd bbvml
${'$'} ls
dir qdtbvqjj
dir qssdcrp
dir tssm
${'$'} cd qdtbvqjj
${'$'} ls
246275 qdtbvqjj.cgn
${'$'} cd ..
${'$'} cd qssdcrp
${'$'} ls
274399 hsswswtq
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
dir ssqc
${'$'} cd ssqc
${'$'} ls
178904 njrssmlm.gcm
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd fjs
${'$'} ls
dir dmvnp
121967 fqlzlvwt
204348 grbwdwsm.znn
102733 jdfwmhg.qsl
240279 ptsd.jwm
228793 ptsd.nsh
dir ssm
${'$'} cd dmvnp
${'$'} ls
dir psj
dir zjw
${'$'} cd psj
${'$'} ls
170665 gcwcp
56058 lsfzc.dcp
40658 tfsllqqw.fgv
${'$'} cd ..
${'$'} cd zjw
${'$'} ls
79989 fggsl.dmz
${'$'} cd ..
${'$'} cd ..
${'$'} cd ssm
${'$'} ls
106263 bwtbht.dwq
106259 jdfwmhg.qtb
6246 rwbnr.tqv
${'$'} cd ..
${'$'} cd ..
${'$'} cd pffntc
${'$'} ls
111475 qbmrdms.ldm
${'$'} cd ..
${'$'} cd pnltt
${'$'} ls
dir nptfhlf
dir zngmf
${'$'} cd nptfhlf
${'$'} ls
223065 qrb.drh
205674 rdgfz
${'$'} cd ..
${'$'} cd zngmf
${'$'} ls
61655 bwtbht.dwq
${'$'} cd ..
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
dir hrvrt
dir thwtl
${'$'} cd hrvrt
${'$'} ls
152296 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd thwtl
${'$'} ls
156783 pfwgtmtt.ccs
323304 sltc
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd qdtbvqjj
${'$'} ls
320175 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd jtgdv
${'$'} ls
81164 ptsd.tpj
${'$'} cd ..
${'$'} cd vcbqdj
${'$'} ls
dir crng
330203 gvlrg
152022 qdtbvqjj.slq
294095 rthwj.zrf
dir vjsbf
${'$'} cd crng
${'$'} ls
dir gznrh
${'$'} cd gznrh
${'$'} ls
259458 ptsd
${'$'} cd ..
${'$'} cd ..
${'$'} cd vjsbf
${'$'} ls
47331 hlld.fzf
147103 jdfwmhg
${'$'} cd ..
${'$'} cd ..
${'$'} cd wtrsg
${'$'} ls
144344 dtcc
${'$'} cd ..
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
323973 qdtbvqjj
${'$'} cd ..
${'$'} cd jlcbpsr
${'$'} ls
dir htrdwm
dir jdfwmhg
dir pwmvbhsl
dir vwfdfmcp
${'$'} cd htrdwm
${'$'} ls
dir btn
105731 dlncqrbm.dgl
158267 gqqghldt
242513 hsswswtq.drj
dir jdfwmhg
212816 swsgtv.wbb
228996 tgll.rcs
${'$'} cd btn
${'$'} ls
50419 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
dir bwc
${'$'} cd bwc
${'$'} ls
184634 cfwg
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
319749 hsswswtq
dir jdfwmhg
271619 jdfwmhg.znz
dir jhmmt
181217 mljfb.ggb
11297 rcpl.tgf
83423 zwscbcvm.ths
${'$'} cd jdfwmhg
${'$'} ls
267171 cts.hlf
${'$'} cd ..
${'$'} cd jhmmt
${'$'} ls
84473 jdfwmhg
${'$'} cd ..
${'$'} cd ..
${'$'} cd pwmvbhsl
${'$'} ls
dir jsg
171725 mljfb.ggb
152612 qjr
dir vfsqw
${'$'} cd jsg
${'$'} ls
176951 jdfwmhg.fhn
284927 ljvvtw.wcq
153109 vnvtt
${'$'} cd ..
${'$'} cd vfsqw
${'$'} ls
104559 htsrns.gws
${'$'} cd ..
${'$'} cd ..
${'$'} cd vwfdfmcp
${'$'} ls
291404 csmvbjlt.tdf
${'$'} cd ..
${'$'} cd ..
${'$'} cd tvcr
${'$'} ls
dir djtwv
dir hsswswtq
272845 mdds
dir ndshbjzn
65929 scpltww.twm
dir tssm
30516 zdpscm
dir zqdrdzv
${'$'} cd djtwv
${'$'} ls
271696 cwjj.hjp
${'$'} cd ..
${'$'} cd hsswswtq
${'$'} ls
dir djngm
dir hcz
dir ptsd
${'$'} cd djngm
${'$'} ls
317775 ltwjzpjb.rcj
37776 qdtbvqjj.lzf
${'$'} cd ..
${'$'} cd hcz
${'$'} ls
217741 pgdmr
128868 qdtbvqjj
306138 zbmrplsn
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
304048 ftm
120236 mdcwvvng
${'$'} cd ..
${'$'} cd ..
${'$'} cd ndshbjzn
${'$'} ls
206408 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
dir mlcnsf
dir nbgjm
204079 pdljvb
185465 rqgdmbjf.rhr
dir sfnlb
${'$'} cd mlcnsf
${'$'} ls
249868 fqrncwd
29146 zdz.jth
${'$'} cd ..
${'$'} cd nbgjm
${'$'} ls
113314 mljfb.ggb
${'$'} cd ..
${'$'} cd sfnlb
${'$'} ls
234917 tjp
${'$'} cd ..
${'$'} cd ..
${'$'} cd zqdrdzv
${'$'} ls
40790 vtdnhzm
${'$'} cd ..
${'$'} cd ..
${'$'} cd vhjbjr
${'$'} ls
dir glv
dir mvns
dir qbrnh
${'$'} cd glv
${'$'} ls
288849 bgvqll.sfj
259105 jdfwmhg
dir qcjlshcv
${'$'} cd qcjlshcv
${'$'} ls
dir nwqqjcmh
${'$'} cd nwqqjcmh
${'$'} ls
137244 grbwdwsm.znn
312904 mzh
dir qdtbvqjj
${'$'} cd qdtbvqjj
${'$'} ls
dir nlqbq
${'$'} cd nlqbq
${'$'} ls
307636 ptsd.vtr
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd mvns
${'$'} ls
dir gzqlmrdh
dir qjhtlh
dir tssm
dir vthg
${'$'} cd gzqlmrdh
${'$'} ls
274950 mlzdqwm
${'$'} cd ..
${'$'} cd qjhtlh
${'$'} ls
157835 ptsd.lqm
300380 wst.trp
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
15772 gcwcp
${'$'} cd ..
${'$'} cd vthg
${'$'} ls
dir gdndtlnc
${'$'} cd gdndtlnc
${'$'} ls
3175 hsswswtq.bds
320462 mljfb.ggb
305508 mzvtzvqc
dir qdtbvqjj
154575 tssm.vgb
${'$'} cd qdtbvqjj
${'$'} ls
236889 drnnvh
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd qbrnh
${'$'} ls
dir hsswswtq
4623 hsswswtq.rnf
266326 jrmq.ztg
295980 tssm.vzb
dir wnbfzd
dir zjzhncs
dir zttlggt
${'$'} cd hsswswtq
${'$'} ls
48277 gsqjdbhv
${'$'} cd ..
${'$'} cd wnbfzd
${'$'} ls
97133 mljfb.ggb
${'$'} cd ..
${'$'} cd zjzhncs
${'$'} ls
298303 gcwcp
dir ggr
113206 grbwdwsm.znn
${'$'} cd ggr
${'$'} ls
244876 ptsd.zvb
${'$'} cd ..
${'$'} cd ..
${'$'} cd zttlggt
${'$'} ls
dir hdbwrcm
dir mbvpd
dir mtd
dir ptsd
dir tcwqp
${'$'} cd hdbwrcm
${'$'} ls
267323 bwtbht.dwq
${'$'} cd ..
${'$'} cd mbvpd
${'$'} ls
84087 frf.smv
${'$'} cd ..
${'$'} cd mtd
${'$'} ls
158543 mljfb.ggb
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
112797 vtschwnb.fnp
${'$'} cd ..
${'$'} cd tcwqp
${'$'} ls
90637 lbsqcj.sfn
179097 tssm.dbl
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd vvsg
${'$'} ls
168715 bwtbht.dwq
dir bwv
dir hsswswtq
dir lqmnjrlb
dir mmrfrj
175244 vct.tsc
dir zwvlhs
${'$'} cd bwv
${'$'} ls
201509 gcwcp
62815 grbwdwsm.znn
dir gwdh
dir mfdvcn
166355 pfwgtmtt.ccs
dir ptsd
169681 qdtbvqjj.fgh
250573 wvndzgv
${'$'} cd gwdh
${'$'} ls
306377 sphrj.pjh
${'$'} cd ..
${'$'} cd mfdvcn
${'$'} ls
27796 bvclvtrm.jlf
65045 cghr.vzg
dir hsswswtq
197145 jdqztgh.pvd
${'$'} cd hsswswtq
${'$'} ls
298155 bwtbht.dwq
${'$'} cd ..
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
27501 grbwdwsm.znn
231999 jdnsv
113528 rmfmb.zzw
dir tssm
dir vgjfsh
${'$'} cd tssm
${'$'} ls
dir dndv
226375 grbwdwsm.znn
${'$'} cd dndv
${'$'} ls
152739 sdjrzcv.tvs
${'$'} cd ..
${'$'} cd ..
${'$'} cd vgjfsh
${'$'} ls
211409 swtbttb.vrp
170879 vvfnf.hrp
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd hsswswtq
${'$'} ls
dir qdtbvqjj
dir tssm
86418 vhsgq
${'$'} cd qdtbvqjj
${'$'} ls
118588 bwtbht.dwq
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
113460 gml.wdg
${'$'} cd ..
${'$'} cd ..
${'$'} cd lqmnjrlb
${'$'} ls
dir tssm
${'$'} cd tssm
${'$'} ls
dir jdfwmhg
${'$'} cd jdfwmhg
${'$'} ls
64663 nswd.rwc
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd mmrfrj
${'$'} ls
319070 gltlwnlt.jzw
232039 hspr
104688 hsswswtq.jsr
dir jdfwmhg
88712 jdfwmhg.zcw
dir pfr
dir prnnpwcd
45488 qdtbvqjj
dir tssm
dir wcmwrtjn
${'$'} cd jdfwmhg
${'$'} ls
140910 bjjhtzct.stm
${'$'} cd ..
${'$'} cd pfr
${'$'} ls
289538 qdtbvqjj
217502 vvpwf
${'$'} cd ..
${'$'} cd prnnpwcd
${'$'} ls
dir qdtbvqjj
${'$'} cd qdtbvqjj
${'$'} ls
dir pqg
dir tssm
${'$'} cd pqg
${'$'} ls
222392 ptsd.ggr
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
158252 dcnvjj.zfd
10486 jdfwmhg.qmb
4374 qdtbvqjj.vqm
254229 vgqfw
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
dir ptsd
${'$'} cd ptsd
${'$'} ls
173766 fvlsgqb
35658 wtc.vvd
${'$'} cd ..
${'$'} cd ..
${'$'} cd wcmwrtjn
${'$'} ls
160089 chfhpc
76202 frgpdnd.ngw
138996 jsfsfpqg.nhf
dir mlm
dir nbdbzsn
dir ptsd
278574 vrnb
${'$'} cd mlm
${'$'} ls
dir gqwhhmvd
dir nrzvzgrt
dir nzplht
dir zzp
${'$'} cd gqwhhmvd
${'$'} ls
dir ddmvjpj
dir jdfwmhg
${'$'} cd ddmvjpj
${'$'} ls
273423 jdfwmhg
43605 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
239406 qctw.vzb
${'$'} cd ..
${'$'} cd ..
${'$'} cd nrzvzgrt
${'$'} ls
20712 gcwcp
239372 gjgdvbwb.gcz
dir hdzhl
124814 jdfwmhg
dir jfzr
295071 qwjgwqp
221611 shrzpsj.dwh
dir tssm
dir wdlsvzvl
${'$'} cd hdzhl
${'$'} ls
dir gfwbd
184323 hsswswtq.mln
177147 nqgqz.tnf
4680 pfwgtmtt.ccs
${'$'} cd gfwbd
${'$'} ls
254870 cldm.fft
301411 tssm.cvn
${'$'} cd ..
${'$'} cd ..
${'$'} cd jfzr
${'$'} ls
dir dvvflnnw
dir jdfwmhg
216389 lwtwn.ttt
201727 pfwgtmtt.ccs
107829 prphc.ncb
5816 sdvq.jvn
${'$'} cd dvvflnnw
${'$'} ls
24741 brtrbwh.wwd
27700 mljfb.ggb
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
325218 bwtbht.dwq
63718 mvl.ngz
162645 vtd.vgp
${'$'} cd ..
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
60903 pfwgtmtt.ccs
332768 qdtbvqjj.jwb
${'$'} cd ..
${'$'} cd wdlsvzvl
${'$'} ls
142213 vgvd
${'$'} cd ..
${'$'} cd ..
${'$'} cd nzplht
${'$'} ls
275904 hsswswtq
157369 jdfwmhg
84363 jvcvmbm.fht
dir qbjqgg
${'$'} cd qbjqgg
${'$'} ls
331934 gcwcp
${'$'} cd ..
${'$'} cd ..
${'$'} cd zzp
${'$'} ls
151335 flsd.zmj
dir gwlhqlp
99086 jdfwmhg.hft
${'$'} cd gwlhqlp
${'$'} ls
201894 glcnpqzp.jvc
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd nbdbzsn
${'$'} ls
169929 bwtbht.dwq
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
128999 bwtbht.dwq
dir jtlrn
dir pszlt
dir ptjnh
dir ptsd
2981 qdtbvqjj.qcn
dir rpb
dir tcjgpqj
dir tmddnh
dir tssm
${'$'} cd jtlrn
${'$'} ls
124888 grbwdwsm.znn
30046 jznz.dwf
${'$'} cd ..
${'$'} cd pszlt
${'$'} ls
154368 dbblsg.mzr
${'$'} cd ..
${'$'} cd ptjnh
${'$'} ls
306974 grbwdwsm.znn
82840 ptsd
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
dir ftjhsb
dir jdfwmhg
304012 lqgtvmrl.qbj
96971 mljfb.ggb
${'$'} cd ftjhsb
${'$'} ls
56965 dhgds
${'$'} cd ..
${'$'} cd jdfwmhg
${'$'} ls
dir lssbmtms
dir vmwshd
${'$'} cd lssbmtms
${'$'} ls
95453 gcwcp
198402 mljfb.ggb
1507 mzlmp
40526 twlqhml
${'$'} cd ..
${'$'} cd vmwshd
${'$'} ls
267087 pfwgtmtt.ccs
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd rpb
${'$'} ls
dir lqbchlbp
dir ptsd
${'$'} cd lqbchlbp
${'$'} ls
151429 ptsd.tjz
${'$'} cd ..
${'$'} cd ptsd
${'$'} ls
28900 gcwcp
55920 llt
${'$'} cd ..
${'$'} cd ..
${'$'} cd tcjgpqj
${'$'} ls
dir cvdlcvq
329232 hcmj.nvp
232764 nvtmgc.qgs
108056 ptsd.gcn
39056 qdtbvqjj
91792 tssm.wqz
${'$'} cd cvdlcvq
${'$'} ls
46978 grbwdwsm.znn
17760 qrdbsdpj.dhm
${'$'} cd ..
${'$'} cd ..
${'$'} cd tmddnh
${'$'} ls
238434 gggvq.tfc
${'$'} cd ..
${'$'} cd tssm
${'$'} ls
dir tlllv
${'$'} cd tlllv
${'$'} ls
198184 trmf.qqw
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd ..
${'$'} cd zwvlhs
${'$'} ls
19923 gcwcp
129179 grbwdwsm.znn
214660 pghcvh
101270 ptsd.gzl
dir srjlz
${'$'} cd srjlz
${'$'} ls
221301 nrcg.pqw"""

Compiled from "Day7.kt"
public final class cz.wrent.advent.Day7Kt {
  private static final java.lang.String test;

  private static final java.lang.String input;

  public static final void main();
    Code:
       0: ldc           #8                  // String $ cd /\n$ ls\ndir a\n14848514 b.txt\n8504156 c.dat\ndir d\n$ cd a\n$ ls\ndir e\n29116 f\n2557 g\n62596 h.lst\n$ cd e\n$ ls\n584 i\n$ cd ..\n$ cd ..\n$ cd d\n$ ls\n4060174 j\n8033020 d.log\n5626152 d.ext\n7214296 k
       2: invokestatic  #12                 // Method partOne:(Ljava/lang/String;)J
       5: lstore_0
       6: getstatic     #18                 // Field java/lang/System.out:Ljava/io/PrintStream;
       9: lload_0
      10: invokevirtual #24                 // Method java/io/PrintStream.println:(J)V
      13: ldc           #26                 // String $ cd /\n$ ls\ndir bntdgzs\n179593 cjw.jgc\n110209 grbwdwsm.znn\ndir hsswswtq\ndir jdfwmhg\ndir jlcbpsr\n70323 qdtbvqjj\n48606 qdtbvqjj.zdg\ndir tvcr\ndir vhjbjr\ndir vvsg\n270523 wpsjfqtn.ljt\n$ cd bntdgzs\n$ ls\n297955 gcwcp\n$ cd ..\n$ cd hsswswtq\n$ ls\ndir bsjbvff\ndir dpgvp\n267138 grbwdwsm.znn\ndir hldgfpvh\ndir jdfwmhg\ndir jtgdv\n93274 ptsd.nzh\n268335 qdtbvqjj.dlh\n185530 qdtbvqjj.jrw\ndir vcbqdj\ndir wtrsg\n$ cd bsjbvff\n$ ls\ndir dmnt\n148799 grbwdwsm.znn\n324931 hzmqrfc.lsd\n211089 qdtbvqjj\n$ cd dmnt\n$ ls\n221038 zht\n$ cd ..\n$ cd ..\n$ cd dpgvp\n$ ls\ndir fzttpjtd\ndir jdrbwrc\ndir rwz\ndir tssm\n$ cd fzttpjtd\n$ ls\n149872 jdfwmhg\n$ cd ..\n$ cd jdrbwrc\n$ ls\n149973 hpgg.srm\ndir ptsd\n$ cd ptsd\n$ ls\n2594 twzf.pqq\n$ cd ..\n$ cd ..\n$ cd rwz\n$ ls\ndir jdfwmhg\n302808 zzlh\n$ cd jdfwmhg\n$ ls\n229683 cdcrgcmh\n218733 nhzt\n$ cd ..\n$ cd ..\n$ cd tssm\n$ ls\ndir ptsd\n37272 qfnnrqsh.qvg\n215066 wnvjc.jqf\n$ cd ptsd\n$ ls\n24102 bwtbht.dwq\n224035 qdtbvqjj.dmp\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd hldgfpvh\n$ ls\n316712 grbwdwsm.znn\n328950 tqvgqjrr\n$ cd ..\n$ cd jdfwmhg\n$ ls\n130652 gcwcp\ndir jdfwmhg\n215427 lfw.zml\ndir qdtbvqjj\n4181 rgsvgssj.qsr\n$ cd jdfwmhg\n$ ls\ndir bvm\ndir hsswswtq\n122279 qznt.jhl\ndir sjw\ndir zpfdtl\n$ cd bvm\n$ ls\n22841 fbcgh.mrp\ndir hsswswtq\ndir hstg\n41317 ndrt\ndir nvmvghb\n239316 ptsd\ndir qtwvdtsp\n98555 vzh\n$ cd hsswswtq\n$ ls\ndir ddcjvjgf\n127104 plwvb.pbj\ndir ptsd\ndir qhp\ndir rjtrhgwh\n$ cd ddcjvjgf\n$ ls\n135870 bwtbht.dwq\n81968 gcwcp\n182253 mrbh.wmc\n275931 nsrqrts\n322128 pfpcp\n$ cd ..\n$ cd ptsd\n$ ls\n214981 jsrlsc\ndir wpbdrcw\n$ cd wpbdrcw\n$ ls\n197849 mljfb.ggb\n173586 ptsd\n$ cd ..\n$ cd ..\n$ cd qhp\n$ ls\n293198 bnrgl\n$ cd ..\n$ cd rjtrhgwh\n$ ls\n224393 clrp.nst\n$ cd ..\n$ cd ..\n$ cd hstg\n$ ls\n51671 gdsfpc\n209216 hsswswtq\n97203 jlnr\ndir thdhg\n57399 tssm\n$ cd thdhg\n$ ls\n201896 jjp.wvw\n$ cd ..\n$ cd ..\n$ cd nvmvghb\n$ ls\n210047 gfcrzgj\ndir rqjbplv\ndir rvwd\n292931 sgwvcqfr.bpq\ndir vtjd\n$ cd rqjbplv\n$ ls\n105204 gcwcp\n$ cd ..\n$ cd rvwd\n$ ls\n66170 jdfwmhg\n$ cd ..\n$ cd vtjd\n$ ls\ndir ptsd\n$ cd ptsd\n$ ls\n300524 bwtbht.dwq\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd qtwvdtsp\n$ ls\n289574 wctgtq\n$ cd ..\n$ cd ..\n$ cd hsswswtq\n$ ls\n24935 gcwcp\ndir jzpbdcmc\n26834 mljfb.ggb\n182501 phnmlsjp.pjc\ndir pttnl\ndir qdtbvqjj\ndir vst\n$ cd jzpbdcmc\n$ ls\n297521 grbwdwsm.znn\ndir qwc\ndir zzswd\n$ cd qwc\n$ ls\n81143 hsswswtq.rjw\n54843 mjvvfsz.rgz\n273051 pfwgtmtt.ccs\n$ cd ..\n$ cd zzswd\n$ ls\n216062 vlbwz.zmh\n$ cd ..\n$ cd ..\n$ cd pttnl\n$ ls\n257733 mljfb.ggb\n250887 pfwgtmtt.ccs\n$ cd ..\n$ cd qdtbvqjj\n$ ls\n34667 gcwcp\n$ cd ..\n$ cd vst\n$ ls\n70250 pfwgtmtt.ccs\ndir zpcqhml\n$ cd zpcqhml\n$ ls\n219936 jdfwmhg.zbm\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd sjw\n$ ls\n152311 nqjtvzff\n157117 pfwgtmtt.ccs\n118226 ptsd.vsm\n$ cd ..\n$ cd zpfdtl\n$ ls\n189042 gcwcp\n$ cd ..\n$ cd ..\n$ cd qdtbvqjj\n$ ls\ndir ftz\ndir hvlffb\ndir lzbb\n53335 ptsd\ndir qdtbvqjj\n$ cd ftz\n$ ls\ndir fft\n256058 gcwcp\n497 hsswswtq.vqs\n103941 hvtcz.fsg\n171587 ljlnz.ffg\n115101 mljfb.ggb\ndir qdtbvqjj\n$ cd fft\n$ ls\n58845 bwtbht.dwq\n136040 gcwcp\n256973 mljfb.ggb\n$ cd ..\n$ cd qdtbvqjj\n$ ls\ndir fgqhdh\n304573 ntm.wmc\n$ cd fgqhdh\n$ ls\n317143 gcwcp\n26010 lsfpfdqz\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd hvlffb\n$ ls\n6682 vjt.mcf\n$ cd ..\n$ cd lzbb\n$ ls\ndir bbvml\n324162 bwtbht.dwq\ndir fjs\ndir pffntc\ndir pnltt\ndir ptsd\n$ cd bbvml\n$ ls\ndir qdtbvqjj\ndir qssdcrp\ndir tssm\n$ cd qdtbvqjj\n$ ls\n246275 qdtbvqjj.cgn\n$ cd ..\n$ cd qssdcrp\n$ ls\n274399 hsswswtq\n$ cd ..\n$ cd tssm\n$ ls\ndir ssqc\n$ cd ssqc\n$ ls\n178904 njrssmlm.gcm\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd fjs\n$ ls\ndir dmvnp\n121967 fqlzlvwt\n204348 grbwdwsm.znn\n102733 jdfwmhg.qsl\n240279 ptsd.jwm\n228793 ptsd.nsh\ndir ssm\n$ cd dmvnp\n$ ls\ndir psj\ndir zjw\n$ cd psj\n$ ls\n170665 gcwcp\n56058 lsfzc.dcp\n40658 tfsllqqw.fgv\n$ cd ..\n$ cd zjw\n$ ls\n79989 fggsl.dmz\n$ cd ..\n$ cd ..\n$ cd ssm\n$ ls\n106263 bwtbht.dwq\n106259 jdfwmhg.qtb\n6246 rwbnr.tqv\n$ cd ..\n$ cd ..\n$ cd pffntc\n$ ls\n111475 qbmrdms.ldm\n$ cd ..\n$ cd pnltt\n$ ls\ndir nptfhlf\ndir zngmf\n$ cd nptfhlf\n$ ls\n223065 qrb.drh\n205674 rdgfz\n$ cd ..\n$ cd zngmf\n$ ls\n61655 bwtbht.dwq\n$ cd ..\n$ cd ..\n$ cd ptsd\n$ ls\ndir hrvrt\ndir thwtl\n$ cd hrvrt\n$ ls\n152296 pfwgtmtt.ccs\n$ cd ..\n$ cd thwtl\n$ ls\n156783 pfwgtmtt.ccs\n323304 sltc\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd qdtbvqjj\n$ ls\n320175 pfwgtmtt.ccs\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd jtgdv\n$ ls\n81164 ptsd.tpj\n$ cd ..\n$ cd vcbqdj\n$ ls\ndir crng\n330203 gvlrg\n152022 qdtbvqjj.slq\n294095 rthwj.zrf\ndir vjsbf\n$ cd crng\n$ ls\ndir gznrh\n$ cd gznrh\n$ ls\n259458 ptsd\n$ cd ..\n$ cd ..\n$ cd vjsbf\n$ ls\n47331 hlld.fzf\n147103 jdfwmhg\n$ cd ..\n$ cd ..\n$ cd wtrsg\n$ ls\n144344 dtcc\n$ cd ..\n$ cd ..\n$ cd jdfwmhg\n$ ls\n323973 qdtbvqjj\n$ cd ..\n$ cd jlcbpsr\n$ ls\ndir htrdwm\ndir jdfwmhg\ndir pwmvbhsl\ndir vwfdfmcp\n$ cd htrdwm\n$ ls\ndir btn\n105731 dlncqrbm.dgl\n158267 gqqghldt\n242513 hsswswtq.drj\ndir jdfwmhg\n212816 swsgtv.wbb\n228996 tgll.rcs\n$ cd btn\n$ ls\n50419 pfwgtmtt.ccs\n$ cd ..\n$ cd jdfwmhg\n$ ls\ndir bwc\n$ cd bwc\n$ ls\n184634 cfwg\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd jdfwmhg\n$ ls\n319749 hsswswtq\ndir jdfwmhg\n271619 jdfwmhg.znz\ndir jhmmt\n181217 mljfb.ggb\n11297 rcpl.tgf\n83423 zwscbcvm.ths\n$ cd jdfwmhg\n$ ls\n267171 cts.hlf\n$ cd ..\n$ cd jhmmt\n$ ls\n84473 jdfwmhg\n$ cd ..\n$ cd ..\n$ cd pwmvbhsl\n$ ls\ndir jsg\n171725 mljfb.ggb\n152612 qjr\ndir vfsqw\n$ cd jsg\n$ ls\n176951 jdfwmhg.fhn\n284927 ljvvtw.wcq\n153109 vnvtt\n$ cd ..\n$ cd vfsqw\n$ ls\n104559 htsrns.gws\n$ cd ..\n$ cd ..\n$ cd vwfdfmcp\n$ ls\n291404 csmvbjlt.tdf\n$ cd ..\n$ cd ..\n$ cd tvcr\n$ ls\ndir djtwv\ndir hsswswtq\n272845 mdds\ndir ndshbjzn\n65929 scpltww.twm\ndir tssm\n30516 zdpscm\ndir zqdrdzv\n$ cd djtwv\n$ ls\n271696 cwjj.hjp\n$ cd ..\n$ cd hsswswtq\n$ ls\ndir djngm\ndir hcz\ndir ptsd\n$ cd djngm\n$ ls\n317775 ltwjzpjb.rcj\n37776 qdtbvqjj.lzf\n$ cd ..\n$ cd hcz\n$ ls\n217741 pgdmr\n128868 qdtbvqjj\n306138 zbmrplsn\n$ cd ..\n$ cd ptsd\n$ ls\n304048 ftm\n120236 mdcwvvng\n$ cd ..\n$ cd ..\n$ cd ndshbjzn\n$ ls\n206408 pfwgtmtt.ccs\n$ cd ..\n$ cd tssm\n$ ls\ndir mlcnsf\ndir nbgjm\n204079 pdljvb\n185465 rqgdmbjf.rhr\ndir sfnlb\n$ cd mlcnsf\n$ ls\n249868 fqrncwd\n29146 zdz.jth\n$ cd ..\n$ cd nbgjm\n$ ls\n113314 mljfb.ggb\n$ cd ..\n$ cd sfnlb\n$ ls\n234917 tjp\n$ cd ..\n$ cd ..\n$ cd zqdrdzv\n$ ls\n40790 vtdnhzm\n$ cd ..\n$ cd ..\n$ cd vhjbjr\n$ ls\ndir glv\ndir mvns\ndir qbrnh\n$ cd glv\n$ ls\n288849 bgvqll.sfj\n259105 jdfwmhg\ndir qcjlshcv\n$ cd qcjlshcv\n$ ls\ndir nwqqjcmh\n$ cd nwqqjcmh\n$ ls\n137244 grbwdwsm.znn\n312904 mzh\ndir qdtbvqjj\n$ cd qdtbvqjj\n$ ls\ndir nlqbq\n$ cd nlqbq\n$ ls\n307636 ptsd.vtr\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd mvns\n$ ls\ndir gzqlmrdh\ndir qjhtlh\ndir tssm\ndir vthg\n$ cd gzqlmrdh\n$ ls\n274950 mlzdqwm\n$ cd ..\n$ cd qjhtlh\n$ ls\n157835 ptsd.lqm\n300380 wst.trp\n$ cd ..\n$ cd tssm\n$ ls\n15772 gcwcp\n$ cd ..\n$ cd vthg\n$ ls\ndir gdndtlnc\n$ cd gdndtlnc\n$ ls\n3175 hsswswtq.bds\n320462 mljfb.ggb\n305508 mzvtzvqc\ndir qdtbvqjj\n154575 tssm.vgb\n$ cd qdtbvqjj\n$ ls\n236889 drnnvh\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd qbrnh\n$ ls\ndir hsswswtq\n4623 hsswswtq.rnf\n266326 jrmq.ztg\n295980 tssm.vzb\ndir wnbfzd\ndir zjzhncs\ndir zttlggt\n$ cd hsswswtq\n$ ls\n48277 gsqjdbhv\n$ cd ..\n$ cd wnbfzd\n$ ls\n97133 mljfb.ggb\n$ cd ..\n$ cd zjzhncs\n$ ls\n298303 gcwcp\ndir ggr\n113206 grbwdwsm.znn\n$ cd ggr\n$ ls\n244876 ptsd.zvb\n$ cd ..\n$ cd ..\n$ cd zttlggt\n$ ls\ndir hdbwrcm\ndir mbvpd\ndir mtd\ndir ptsd\ndir tcwqp\n$ cd hdbwrcm\n$ ls\n267323 bwtbht.dwq\n$ cd ..\n$ cd mbvpd\n$ ls\n84087 frf.smv\n$ cd ..\n$ cd mtd\n$ ls\n158543 mljfb.ggb\n$ cd ..\n$ cd ptsd\n$ ls\n112797 vtschwnb.fnp\n$ cd ..\n$ cd tcwqp\n$ ls\n90637 lbsqcj.sfn\n179097 tssm.dbl\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd vvsg\n$ ls\n168715 bwtbht.dwq\ndir bwv\ndir hsswswtq\ndir lqmnjrlb\ndir mmrfrj\n175244 vct.tsc\ndir zwvlhs\n$ cd bwv\n$ ls\n201509 gcwcp\n62815 grbwdwsm.znn\ndir gwdh\ndir mfdvcn\n166355 pfwgtmtt.ccs\ndir ptsd\n169681 qdtbvqjj.fgh\n250573 wvndzgv\n$ cd gwdh\n$ ls\n306377 sphrj.pjh\n$ cd ..\n$ cd mfdvcn\n$ ls\n27796 bvclvtrm.jlf\n65045 cghr.vzg\ndir hsswswtq\n197145 jdqztgh.pvd\n$ cd hsswswtq\n$ ls\n298155 bwtbht.dwq\n$ cd ..\n$ cd ..\n$ cd ptsd\n$ ls\n27501 grbwdwsm.znn\n231999 jdnsv\n113528 rmfmb.zzw\ndir tssm\ndir vgjfsh\n$ cd tssm\n$ ls\ndir dndv\n226375 grbwdwsm.znn\n$ cd dndv\n$ ls\n152739 sdjrzcv.tvs\n$ cd ..\n$ cd ..\n$ cd vgjfsh\n$ ls\n211409 swtbttb.vrp\n170879 vvfnf.hrp\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd hsswswtq\n$ ls\ndir qdtbvqjj\ndir tssm\n86418 vhsgq\n$ cd qdtbvqjj\n$ ls\n118588 bwtbht.dwq\n$ cd ..\n$ cd tssm\n$ ls\n113460 gml.wdg\n$ cd ..\n$ cd ..\n$ cd lqmnjrlb\n$ ls\ndir tssm\n$ cd tssm\n$ ls\ndir jdfwmhg\n$ cd jdfwmhg\n$ ls\n64663 nswd.rwc\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd mmrfrj\n$ ls\n319070 gltlwnlt.jzw\n232039 hspr\n104688 hsswswtq.jsr\ndir jdfwmhg\n88712 jdfwmhg.zcw\ndir pfr\ndir prnnpwcd\n45488 qdtbvqjj\ndir tssm\ndir wcmwrtjn\n$ cd jdfwmhg\n$ ls\n140910 bjjhtzct.stm\n$ cd ..\n$ cd pfr\n$ ls\n289538 qdtbvqjj\n217502 vvpwf\n$ cd ..\n$ cd prnnpwcd\n$ ls\ndir qdtbvqjj\n$ cd qdtbvqjj\n$ ls\ndir pqg\ndir tssm\n$ cd pqg\n$ ls\n222392 ptsd.ggr\n$ cd ..\n$ cd tssm\n$ ls\n158252 dcnvjj.zfd\n10486 jdfwmhg.qmb\n4374 qdtbvqjj.vqm\n254229 vgqfw\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd tssm\n$ ls\ndir ptsd\n$ cd ptsd\n$ ls\n173766 fvlsgqb\n35658 wtc.vvd\n$ cd ..\n$ cd ..\n$ cd wcmwrtjn\n$ ls\n160089 chfhpc\n76202 frgpdnd.ngw\n138996 jsfsfpqg.nhf\ndir mlm\ndir nbdbzsn\ndir ptsd\n278574 vrnb\n$ cd mlm\n$ ls\ndir gqwhhmvd\ndir nrzvzgrt\ndir nzplht\ndir zzp\n$ cd gqwhhmvd\n$ ls\ndir ddmvjpj\ndir jdfwmhg\n$ cd ddmvjpj\n$ ls\n273423 jdfwmhg\n43605 pfwgtmtt.ccs\n$ cd ..\n$ cd jdfwmhg\n$ ls\n239406 qctw.vzb\n$ cd ..\n$ cd ..\n$ cd nrzvzgrt\n$ ls\n20712 gcwcp\n239372 gjgdvbwb.gcz\ndir hdzhl\n124814 jdfwmhg\ndir jfzr\n295071 qwjgwqp\n221611 shrzpsj.dwh\ndir tssm\ndir wdlsvzvl\n$ cd hdzhl\n$ ls\ndir gfwbd\n184323 hsswswtq.mln\n177147 nqgqz.tnf\n4680 pfwgtmtt.ccs\n$ cd gfwbd\n$ ls\n254870 cldm.fft\n301411 tssm.cvn\n$ cd ..\n$ cd ..\n$ cd jfzr\n$ ls\ndir dvvflnnw\ndir jdfwmhg\n216389 lwtwn.ttt\n201727 pfwgtmtt.ccs\n107829 prphc.ncb\n5816 sdvq.jvn\n$ cd dvvflnnw\n$ ls\n24741 brtrbwh.wwd\n27700 mljfb.ggb\n$ cd ..\n$ cd jdfwmhg\n$ ls\n325218 bwtbht.dwq\n63718 mvl.ngz\n162645 vtd.vgp\n$ cd ..\n$ cd ..\n$ cd tssm\n$ ls\n60903 pfwgtmtt.ccs\n332768 qdtbvqjj.jwb\n$ cd ..\n$ cd wdlsvzvl\n$ ls\n142213 vgvd\n$ cd ..\n$ cd ..\n$ cd nzplht\n$ ls\n275904 hsswswtq\n157369 jdfwmhg\n84363 jvcvmbm.fht\ndir qbjqgg\n$ cd qbjqgg\n$ ls\n331934 gcwcp\n$ cd ..\n$ cd ..\n$ cd zzp\n$ ls\n151335 flsd.zmj\ndir gwlhqlp\n99086 jdfwmhg.hft\n$ cd gwlhqlp\n$ ls\n201894 glcnpqzp.jvc\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd nbdbzsn\n$ ls\n169929 bwtbht.dwq\n$ cd ..\n$ cd ptsd\n$ ls\n128999 bwtbht.dwq\ndir jtlrn\ndir pszlt\ndir ptjnh\ndir ptsd\n2981 qdtbvqjj.qcn\ndir rpb\ndir tcjgpqj\ndir tmddnh\ndir tssm\n$ cd jtlrn\n$ ls\n124888 grbwdwsm.znn\n30046 jznz.dwf\n$ cd ..\n$ cd pszlt\n$ ls\n154368 dbblsg.mzr\n$ cd ..\n$ cd ptjnh\n$ ls\n306974 grbwdwsm.znn\n82840 ptsd\n$ cd ..\n$ cd ptsd\n$ ls\ndir ftjhsb\ndir jdfwmhg\n304012 lqgtvmrl.qbj\n96971 mljfb.ggb\n$ cd ftjhsb\n$ ls\n56965 dhgds\n$ cd ..\n$ cd jdfwmhg\n$ ls\ndir lssbmtms\ndir vmwshd\n$ cd lssbmtms\n$ ls\n95453 gcwcp\n198402 mljfb.ggb\n1507 mzlmp\n40526 twlqhml\n$ cd ..\n$ cd vmwshd\n$ ls\n267087 pfwgtmtt.ccs\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd rpb\n$ ls\ndir lqbchlbp\ndir ptsd\n$ cd lqbchlbp\n$ ls\n151429 ptsd.tjz\n$ cd ..\n$ cd ptsd\n$ ls\n28900 gcwcp\n55920 llt\n$ cd ..\n$ cd ..\n$ cd tcjgpqj\n$ ls\ndir cvdlcvq\n329232 hcmj.nvp\n232764 nvtmgc.qgs\n108056 ptsd.gcn\n39056 qdtbvqjj\n91792 tssm.wqz\n$ cd cvdlcvq\n$ ls\n46978 grbwdwsm.znn\n17760 qrdbsdpj.dhm\n$ cd ..\n$ cd ..\n$ cd tmddnh\n$ ls\n238434 gggvq.tfc\n$ cd ..\n$ cd tssm\n$ ls\ndir tlllv\n$ cd tlllv\n$ ls\n198184 trmf.qqw\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd zwvlhs\n$ ls\n19923 gcwcp\n129179 grbwdwsm.znn\n214660 pghcvh\n101270 ptsd.gzl\ndir srjlz\n$ cd srjlz\n$ ls\n221301 nrcg.pqw
      15: invokestatic  #12                 // Method partOne:(Ljava/lang/String;)J
      18: lstore_0
      19: new           #28                 // class java/lang/StringBuilder
      22: dup
      23: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
      26: ldc           #33                 // String 7a:
      28: invokevirtual #37                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      31: lload_0
      32: invokevirtual #40                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      35: invokevirtual #44                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      38: getstatic     #18                 // Field java/lang/System.out:Ljava/io/PrintStream;
      41: swap
      42: invokevirtual #47                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      45: ldc           #8                  // String $ cd /\n$ ls\ndir a\n14848514 b.txt\n8504156 c.dat\ndir d\n$ cd a\n$ ls\ndir e\n29116 f\n2557 g\n62596 h.lst\n$ cd e\n$ ls\n584 i\n$ cd ..\n$ cd ..\n$ cd d\n$ ls\n4060174 j\n8033020 d.log\n5626152 d.ext\n7214296 k
      47: invokestatic  #50                 // Method partTwo:(Ljava/lang/String;)J
      50: lstore_2
      51: getstatic     #18                 // Field java/lang/System.out:Ljava/io/PrintStream;
      54: lload_2
      55: invokevirtual #24                 // Method java/io/PrintStream.println:(J)V
      58: ldc           #26                 // String $ cd /\n$ ls\ndir bntdgzs\n179593 cjw.jgc\n110209 grbwdwsm.znn\ndir hsswswtq\ndir jdfwmhg\ndir jlcbpsr\n70323 qdtbvqjj\n48606 qdtbvqjj.zdg\ndir tvcr\ndir vhjbjr\ndir vvsg\n270523 wpsjfqtn.ljt\n$ cd bntdgzs\n$ ls\n297955 gcwcp\n$ cd ..\n$ cd hsswswtq\n$ ls\ndir bsjbvff\ndir dpgvp\n267138 grbwdwsm.znn\ndir hldgfpvh\ndir jdfwmhg\ndir jtgdv\n93274 ptsd.nzh\n268335 qdtbvqjj.dlh\n185530 qdtbvqjj.jrw\ndir vcbqdj\ndir wtrsg\n$ cd bsjbvff\n$ ls\ndir dmnt\n148799 grbwdwsm.znn\n324931 hzmqrfc.lsd\n211089 qdtbvqjj\n$ cd dmnt\n$ ls\n221038 zht\n$ cd ..\n$ cd ..\n$ cd dpgvp\n$ ls\ndir fzttpjtd\ndir jdrbwrc\ndir rwz\ndir tssm\n$ cd fzttpjtd\n$ ls\n149872 jdfwmhg\n$ cd ..\n$ cd jdrbwrc\n$ ls\n149973 hpgg.srm\ndir ptsd\n$ cd ptsd\n$ ls\n2594 twzf.pqq\n$ cd ..\n$ cd ..\n$ cd rwz\n$ ls\ndir jdfwmhg\n302808 zzlh\n$ cd jdfwmhg\n$ ls\n229683 cdcrgcmh\n218733 nhzt\n$ cd ..\n$ cd ..\n$ cd tssm\n$ ls\ndir ptsd\n37272 qfnnrqsh.qvg\n215066 wnvjc.jqf\n$ cd ptsd\n$ ls\n24102 bwtbht.dwq\n224035 qdtbvqjj.dmp\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd hldgfpvh\n$ ls\n316712 grbwdwsm.znn\n328950 tqvgqjrr\n$ cd ..\n$ cd jdfwmhg\n$ ls\n130652 gcwcp\ndir jdfwmhg\n215427 lfw.zml\ndir qdtbvqjj\n4181 rgsvgssj.qsr\n$ cd jdfwmhg\n$ ls\ndir bvm\ndir hsswswtq\n122279 qznt.jhl\ndir sjw\ndir zpfdtl\n$ cd bvm\n$ ls\n22841 fbcgh.mrp\ndir hsswswtq\ndir hstg\n41317 ndrt\ndir nvmvghb\n239316 ptsd\ndir qtwvdtsp\n98555 vzh\n$ cd hsswswtq\n$ ls\ndir ddcjvjgf\n127104 plwvb.pbj\ndir ptsd\ndir qhp\ndir rjtrhgwh\n$ cd ddcjvjgf\n$ ls\n135870 bwtbht.dwq\n81968 gcwcp\n182253 mrbh.wmc\n275931 nsrqrts\n322128 pfpcp\n$ cd ..\n$ cd ptsd\n$ ls\n214981 jsrlsc\ndir wpbdrcw\n$ cd wpbdrcw\n$ ls\n197849 mljfb.ggb\n173586 ptsd\n$ cd ..\n$ cd ..\n$ cd qhp\n$ ls\n293198 bnrgl\n$ cd ..\n$ cd rjtrhgwh\n$ ls\n224393 clrp.nst\n$ cd ..\n$ cd ..\n$ cd hstg\n$ ls\n51671 gdsfpc\n209216 hsswswtq\n97203 jlnr\ndir thdhg\n57399 tssm\n$ cd thdhg\n$ ls\n201896 jjp.wvw\n$ cd ..\n$ cd ..\n$ cd nvmvghb\n$ ls\n210047 gfcrzgj\ndir rqjbplv\ndir rvwd\n292931 sgwvcqfr.bpq\ndir vtjd\n$ cd rqjbplv\n$ ls\n105204 gcwcp\n$ cd ..\n$ cd rvwd\n$ ls\n66170 jdfwmhg\n$ cd ..\n$ cd vtjd\n$ ls\ndir ptsd\n$ cd ptsd\n$ ls\n300524 bwtbht.dwq\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd qtwvdtsp\n$ ls\n289574 wctgtq\n$ cd ..\n$ cd ..\n$ cd hsswswtq\n$ ls\n24935 gcwcp\ndir jzpbdcmc\n26834 mljfb.ggb\n182501 phnmlsjp.pjc\ndir pttnl\ndir qdtbvqjj\ndir vst\n$ cd jzpbdcmc\n$ ls\n297521 grbwdwsm.znn\ndir qwc\ndir zzswd\n$ cd qwc\n$ ls\n81143 hsswswtq.rjw\n54843 mjvvfsz.rgz\n273051 pfwgtmtt.ccs\n$ cd ..\n$ cd zzswd\n$ ls\n216062 vlbwz.zmh\n$ cd ..\n$ cd ..\n$ cd pttnl\n$ ls\n257733 mljfb.ggb\n250887 pfwgtmtt.ccs\n$ cd ..\n$ cd qdtbvqjj\n$ ls\n34667 gcwcp\n$ cd ..\n$ cd vst\n$ ls\n70250 pfwgtmtt.ccs\ndir zpcqhml\n$ cd zpcqhml\n$ ls\n219936 jdfwmhg.zbm\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd sjw\n$ ls\n152311 nqjtvzff\n157117 pfwgtmtt.ccs\n118226 ptsd.vsm\n$ cd ..\n$ cd zpfdtl\n$ ls\n189042 gcwcp\n$ cd ..\n$ cd ..\n$ cd qdtbvqjj\n$ ls\ndir ftz\ndir hvlffb\ndir lzbb\n53335 ptsd\ndir qdtbvqjj\n$ cd ftz\n$ ls\ndir fft\n256058 gcwcp\n497 hsswswtq.vqs\n103941 hvtcz.fsg\n171587 ljlnz.ffg\n115101 mljfb.ggb\ndir qdtbvqjj\n$ cd fft\n$ ls\n58845 bwtbht.dwq\n136040 gcwcp\n256973 mljfb.ggb\n$ cd ..\n$ cd qdtbvqjj\n$ ls\ndir fgqhdh\n304573 ntm.wmc\n$ cd fgqhdh\n$ ls\n317143 gcwcp\n26010 lsfpfdqz\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd hvlffb\n$ ls\n6682 vjt.mcf\n$ cd ..\n$ cd lzbb\n$ ls\ndir bbvml\n324162 bwtbht.dwq\ndir fjs\ndir pffntc\ndir pnltt\ndir ptsd\n$ cd bbvml\n$ ls\ndir qdtbvqjj\ndir qssdcrp\ndir tssm\n$ cd qdtbvqjj\n$ ls\n246275 qdtbvqjj.cgn\n$ cd ..\n$ cd qssdcrp\n$ ls\n274399 hsswswtq\n$ cd ..\n$ cd tssm\n$ ls\ndir ssqc\n$ cd ssqc\n$ ls\n178904 njrssmlm.gcm\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd fjs\n$ ls\ndir dmvnp\n121967 fqlzlvwt\n204348 grbwdwsm.znn\n102733 jdfwmhg.qsl\n240279 ptsd.jwm\n228793 ptsd.nsh\ndir ssm\n$ cd dmvnp\n$ ls\ndir psj\ndir zjw\n$ cd psj\n$ ls\n170665 gcwcp\n56058 lsfzc.dcp\n40658 tfsllqqw.fgv\n$ cd ..\n$ cd zjw\n$ ls\n79989 fggsl.dmz\n$ cd ..\n$ cd ..\n$ cd ssm\n$ ls\n106263 bwtbht.dwq\n106259 jdfwmhg.qtb\n6246 rwbnr.tqv\n$ cd ..\n$ cd ..\n$ cd pffntc\n$ ls\n111475 qbmrdms.ldm\n$ cd ..\n$ cd pnltt\n$ ls\ndir nptfhlf\ndir zngmf\n$ cd nptfhlf\n$ ls\n223065 qrb.drh\n205674 rdgfz\n$ cd ..\n$ cd zngmf\n$ ls\n61655 bwtbht.dwq\n$ cd ..\n$ cd ..\n$ cd ptsd\n$ ls\ndir hrvrt\ndir thwtl\n$ cd hrvrt\n$ ls\n152296 pfwgtmtt.ccs\n$ cd ..\n$ cd thwtl\n$ ls\n156783 pfwgtmtt.ccs\n323304 sltc\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd qdtbvqjj\n$ ls\n320175 pfwgtmtt.ccs\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd jtgdv\n$ ls\n81164 ptsd.tpj\n$ cd ..\n$ cd vcbqdj\n$ ls\ndir crng\n330203 gvlrg\n152022 qdtbvqjj.slq\n294095 rthwj.zrf\ndir vjsbf\n$ cd crng\n$ ls\ndir gznrh\n$ cd gznrh\n$ ls\n259458 ptsd\n$ cd ..\n$ cd ..\n$ cd vjsbf\n$ ls\n47331 hlld.fzf\n147103 jdfwmhg\n$ cd ..\n$ cd ..\n$ cd wtrsg\n$ ls\n144344 dtcc\n$ cd ..\n$ cd ..\n$ cd jdfwmhg\n$ ls\n323973 qdtbvqjj\n$ cd ..\n$ cd jlcbpsr\n$ ls\ndir htrdwm\ndir jdfwmhg\ndir pwmvbhsl\ndir vwfdfmcp\n$ cd htrdwm\n$ ls\ndir btn\n105731 dlncqrbm.dgl\n158267 gqqghldt\n242513 hsswswtq.drj\ndir jdfwmhg\n212816 swsgtv.wbb\n228996 tgll.rcs\n$ cd btn\n$ ls\n50419 pfwgtmtt.ccs\n$ cd ..\n$ cd jdfwmhg\n$ ls\ndir bwc\n$ cd bwc\n$ ls\n184634 cfwg\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd jdfwmhg\n$ ls\n319749 hsswswtq\ndir jdfwmhg\n271619 jdfwmhg.znz\ndir jhmmt\n181217 mljfb.ggb\n11297 rcpl.tgf\n83423 zwscbcvm.ths\n$ cd jdfwmhg\n$ ls\n267171 cts.hlf\n$ cd ..\n$ cd jhmmt\n$ ls\n84473 jdfwmhg\n$ cd ..\n$ cd ..\n$ cd pwmvbhsl\n$ ls\ndir jsg\n171725 mljfb.ggb\n152612 qjr\ndir vfsqw\n$ cd jsg\n$ ls\n176951 jdfwmhg.fhn\n284927 ljvvtw.wcq\n153109 vnvtt\n$ cd ..\n$ cd vfsqw\n$ ls\n104559 htsrns.gws\n$ cd ..\n$ cd ..\n$ cd vwfdfmcp\n$ ls\n291404 csmvbjlt.tdf\n$ cd ..\n$ cd ..\n$ cd tvcr\n$ ls\ndir djtwv\ndir hsswswtq\n272845 mdds\ndir ndshbjzn\n65929 scpltww.twm\ndir tssm\n30516 zdpscm\ndir zqdrdzv\n$ cd djtwv\n$ ls\n271696 cwjj.hjp\n$ cd ..\n$ cd hsswswtq\n$ ls\ndir djngm\ndir hcz\ndir ptsd\n$ cd djngm\n$ ls\n317775 ltwjzpjb.rcj\n37776 qdtbvqjj.lzf\n$ cd ..\n$ cd hcz\n$ ls\n217741 pgdmr\n128868 qdtbvqjj\n306138 zbmrplsn\n$ cd ..\n$ cd ptsd\n$ ls\n304048 ftm\n120236 mdcwvvng\n$ cd ..\n$ cd ..\n$ cd ndshbjzn\n$ ls\n206408 pfwgtmtt.ccs\n$ cd ..\n$ cd tssm\n$ ls\ndir mlcnsf\ndir nbgjm\n204079 pdljvb\n185465 rqgdmbjf.rhr\ndir sfnlb\n$ cd mlcnsf\n$ ls\n249868 fqrncwd\n29146 zdz.jth\n$ cd ..\n$ cd nbgjm\n$ ls\n113314 mljfb.ggb\n$ cd ..\n$ cd sfnlb\n$ ls\n234917 tjp\n$ cd ..\n$ cd ..\n$ cd zqdrdzv\n$ ls\n40790 vtdnhzm\n$ cd ..\n$ cd ..\n$ cd vhjbjr\n$ ls\ndir glv\ndir mvns\ndir qbrnh\n$ cd glv\n$ ls\n288849 bgvqll.sfj\n259105 jdfwmhg\ndir qcjlshcv\n$ cd qcjlshcv\n$ ls\ndir nwqqjcmh\n$ cd nwqqjcmh\n$ ls\n137244 grbwdwsm.znn\n312904 mzh\ndir qdtbvqjj\n$ cd qdtbvqjj\n$ ls\ndir nlqbq\n$ cd nlqbq\n$ ls\n307636 ptsd.vtr\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd mvns\n$ ls\ndir gzqlmrdh\ndir qjhtlh\ndir tssm\ndir vthg\n$ cd gzqlmrdh\n$ ls\n274950 mlzdqwm\n$ cd ..\n$ cd qjhtlh\n$ ls\n157835 ptsd.lqm\n300380 wst.trp\n$ cd ..\n$ cd tssm\n$ ls\n15772 gcwcp\n$ cd ..\n$ cd vthg\n$ ls\ndir gdndtlnc\n$ cd gdndtlnc\n$ ls\n3175 hsswswtq.bds\n320462 mljfb.ggb\n305508 mzvtzvqc\ndir qdtbvqjj\n154575 tssm.vgb\n$ cd qdtbvqjj\n$ ls\n236889 drnnvh\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd qbrnh\n$ ls\ndir hsswswtq\n4623 hsswswtq.rnf\n266326 jrmq.ztg\n295980 tssm.vzb\ndir wnbfzd\ndir zjzhncs\ndir zttlggt\n$ cd hsswswtq\n$ ls\n48277 gsqjdbhv\n$ cd ..\n$ cd wnbfzd\n$ ls\n97133 mljfb.ggb\n$ cd ..\n$ cd zjzhncs\n$ ls\n298303 gcwcp\ndir ggr\n113206 grbwdwsm.znn\n$ cd ggr\n$ ls\n244876 ptsd.zvb\n$ cd ..\n$ cd ..\n$ cd zttlggt\n$ ls\ndir hdbwrcm\ndir mbvpd\ndir mtd\ndir ptsd\ndir tcwqp\n$ cd hdbwrcm\n$ ls\n267323 bwtbht.dwq\n$ cd ..\n$ cd mbvpd\n$ ls\n84087 frf.smv\n$ cd ..\n$ cd mtd\n$ ls\n158543 mljfb.ggb\n$ cd ..\n$ cd ptsd\n$ ls\n112797 vtschwnb.fnp\n$ cd ..\n$ cd tcwqp\n$ ls\n90637 lbsqcj.sfn\n179097 tssm.dbl\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd vvsg\n$ ls\n168715 bwtbht.dwq\ndir bwv\ndir hsswswtq\ndir lqmnjrlb\ndir mmrfrj\n175244 vct.tsc\ndir zwvlhs\n$ cd bwv\n$ ls\n201509 gcwcp\n62815 grbwdwsm.znn\ndir gwdh\ndir mfdvcn\n166355 pfwgtmtt.ccs\ndir ptsd\n169681 qdtbvqjj.fgh\n250573 wvndzgv\n$ cd gwdh\n$ ls\n306377 sphrj.pjh\n$ cd ..\n$ cd mfdvcn\n$ ls\n27796 bvclvtrm.jlf\n65045 cghr.vzg\ndir hsswswtq\n197145 jdqztgh.pvd\n$ cd hsswswtq\n$ ls\n298155 bwtbht.dwq\n$ cd ..\n$ cd ..\n$ cd ptsd\n$ ls\n27501 grbwdwsm.znn\n231999 jdnsv\n113528 rmfmb.zzw\ndir tssm\ndir vgjfsh\n$ cd tssm\n$ ls\ndir dndv\n226375 grbwdwsm.znn\n$ cd dndv\n$ ls\n152739 sdjrzcv.tvs\n$ cd ..\n$ cd ..\n$ cd vgjfsh\n$ ls\n211409 swtbttb.vrp\n170879 vvfnf.hrp\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd hsswswtq\n$ ls\ndir qdtbvqjj\ndir tssm\n86418 vhsgq\n$ cd qdtbvqjj\n$ ls\n118588 bwtbht.dwq\n$ cd ..\n$ cd tssm\n$ ls\n113460 gml.wdg\n$ cd ..\n$ cd ..\n$ cd lqmnjrlb\n$ ls\ndir tssm\n$ cd tssm\n$ ls\ndir jdfwmhg\n$ cd jdfwmhg\n$ ls\n64663 nswd.rwc\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd mmrfrj\n$ ls\n319070 gltlwnlt.jzw\n232039 hspr\n104688 hsswswtq.jsr\ndir jdfwmhg\n88712 jdfwmhg.zcw\ndir pfr\ndir prnnpwcd\n45488 qdtbvqjj\ndir tssm\ndir wcmwrtjn\n$ cd jdfwmhg\n$ ls\n140910 bjjhtzct.stm\n$ cd ..\n$ cd pfr\n$ ls\n289538 qdtbvqjj\n217502 vvpwf\n$ cd ..\n$ cd prnnpwcd\n$ ls\ndir qdtbvqjj\n$ cd qdtbvqjj\n$ ls\ndir pqg\ndir tssm\n$ cd pqg\n$ ls\n222392 ptsd.ggr\n$ cd ..\n$ cd tssm\n$ ls\n158252 dcnvjj.zfd\n10486 jdfwmhg.qmb\n4374 qdtbvqjj.vqm\n254229 vgqfw\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd tssm\n$ ls\ndir ptsd\n$ cd ptsd\n$ ls\n173766 fvlsgqb\n35658 wtc.vvd\n$ cd ..\n$ cd ..\n$ cd wcmwrtjn\n$ ls\n160089 chfhpc\n76202 frgpdnd.ngw\n138996 jsfsfpqg.nhf\ndir mlm\ndir nbdbzsn\ndir ptsd\n278574 vrnb\n$ cd mlm\n$ ls\ndir gqwhhmvd\ndir nrzvzgrt\ndir nzplht\ndir zzp\n$ cd gqwhhmvd\n$ ls\ndir ddmvjpj\ndir jdfwmhg\n$ cd ddmvjpj\n$ ls\n273423 jdfwmhg\n43605 pfwgtmtt.ccs\n$ cd ..\n$ cd jdfwmhg\n$ ls\n239406 qctw.vzb\n$ cd ..\n$ cd ..\n$ cd nrzvzgrt\n$ ls\n20712 gcwcp\n239372 gjgdvbwb.gcz\ndir hdzhl\n124814 jdfwmhg\ndir jfzr\n295071 qwjgwqp\n221611 shrzpsj.dwh\ndir tssm\ndir wdlsvzvl\n$ cd hdzhl\n$ ls\ndir gfwbd\n184323 hsswswtq.mln\n177147 nqgqz.tnf\n4680 pfwgtmtt.ccs\n$ cd gfwbd\n$ ls\n254870 cldm.fft\n301411 tssm.cvn\n$ cd ..\n$ cd ..\n$ cd jfzr\n$ ls\ndir dvvflnnw\ndir jdfwmhg\n216389 lwtwn.ttt\n201727 pfwgtmtt.ccs\n107829 prphc.ncb\n5816 sdvq.jvn\n$ cd dvvflnnw\n$ ls\n24741 brtrbwh.wwd\n27700 mljfb.ggb\n$ cd ..\n$ cd jdfwmhg\n$ ls\n325218 bwtbht.dwq\n63718 mvl.ngz\n162645 vtd.vgp\n$ cd ..\n$ cd ..\n$ cd tssm\n$ ls\n60903 pfwgtmtt.ccs\n332768 qdtbvqjj.jwb\n$ cd ..\n$ cd wdlsvzvl\n$ ls\n142213 vgvd\n$ cd ..\n$ cd ..\n$ cd nzplht\n$ ls\n275904 hsswswtq\n157369 jdfwmhg\n84363 jvcvmbm.fht\ndir qbjqgg\n$ cd qbjqgg\n$ ls\n331934 gcwcp\n$ cd ..\n$ cd ..\n$ cd zzp\n$ ls\n151335 flsd.zmj\ndir gwlhqlp\n99086 jdfwmhg.hft\n$ cd gwlhqlp\n$ ls\n201894 glcnpqzp.jvc\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd nbdbzsn\n$ ls\n169929 bwtbht.dwq\n$ cd ..\n$ cd ptsd\n$ ls\n128999 bwtbht.dwq\ndir jtlrn\ndir pszlt\ndir ptjnh\ndir ptsd\n2981 qdtbvqjj.qcn\ndir rpb\ndir tcjgpqj\ndir tmddnh\ndir tssm\n$ cd jtlrn\n$ ls\n124888 grbwdwsm.znn\n30046 jznz.dwf\n$ cd ..\n$ cd pszlt\n$ ls\n154368 dbblsg.mzr\n$ cd ..\n$ cd ptjnh\n$ ls\n306974 grbwdwsm.znn\n82840 ptsd\n$ cd ..\n$ cd ptsd\n$ ls\ndir ftjhsb\ndir jdfwmhg\n304012 lqgtvmrl.qbj\n96971 mljfb.ggb\n$ cd ftjhsb\n$ ls\n56965 dhgds\n$ cd ..\n$ cd jdfwmhg\n$ ls\ndir lssbmtms\ndir vmwshd\n$ cd lssbmtms\n$ ls\n95453 gcwcp\n198402 mljfb.ggb\n1507 mzlmp\n40526 twlqhml\n$ cd ..\n$ cd vmwshd\n$ ls\n267087 pfwgtmtt.ccs\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd rpb\n$ ls\ndir lqbchlbp\ndir ptsd\n$ cd lqbchlbp\n$ ls\n151429 ptsd.tjz\n$ cd ..\n$ cd ptsd\n$ ls\n28900 gcwcp\n55920 llt\n$ cd ..\n$ cd ..\n$ cd tcjgpqj\n$ ls\ndir cvdlcvq\n329232 hcmj.nvp\n232764 nvtmgc.qgs\n108056 ptsd.gcn\n39056 qdtbvqjj\n91792 tssm.wqz\n$ cd cvdlcvq\n$ ls\n46978 grbwdwsm.znn\n17760 qrdbsdpj.dhm\n$ cd ..\n$ cd ..\n$ cd tmddnh\n$ ls\n238434 gggvq.tfc\n$ cd ..\n$ cd tssm\n$ ls\ndir tlllv\n$ cd tlllv\n$ ls\n198184 trmf.qqw\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd ..\n$ cd zwvlhs\n$ ls\n19923 gcwcp\n129179 grbwdwsm.znn\n214660 pghcvh\n101270 ptsd.gzl\ndir srjlz\n$ cd srjlz\n$ ls\n221301 nrcg.pqw
      60: invokestatic  #50                 // Method partTwo:(Ljava/lang/String;)J
      63: lstore_2
      64: new           #28                 // class java/lang/StringBuilder
      67: dup
      68: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
      71: ldc           #52                 // String 7b:
      73: invokevirtual #37                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      76: lload_2
      77: invokevirtual #40                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      80: invokevirtual #44                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      83: getstatic     #18                 // Field java/lang/System.out:Ljava/io/PrintStream;
      86: swap
      87: invokevirtual #47                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      90: return

  private static final long partOne(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #59                 // Method parseTree:(Ljava/lang/String;)Ljava/util/Map;
       4: astore_1
       5: aload_1
       6: invokeinterface #65,  1           // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
      11: checkcast     #67                 // class java/lang/Iterable
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: astore        4
      20: new           #69                 // class java/util/ArrayList
      23: dup
      24: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
      27: checkcast     #72                 // class java/util/Collection
      30: astore        5
      32: iconst_0
      33: istore        6
      35: aload         4
      37: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      42: astore        7
      44: aload         7
      46: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      51: ifeq          84
      54: aload         7
      56: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: astore        8
      63: aload         8
      65: instanceof    #88                 // class cz/wrent/advent/Dir
      68: ifeq          44
      71: aload         5
      73: aload         8
      75: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      80: pop
      81: goto          44
      84: aload         5
      86: checkcast     #94                 // class java/util/List
      89: nop
      90: checkcast     #67                 // class java/lang/Iterable
      93: astore_2
      94: nop
      95: iconst_0
      96: istore_3
      97: aload_2
      98: astore        4
     100: new           #69                 // class java/util/ArrayList
     103: dup
     104: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
     107: checkcast     #72                 // class java/util/Collection
     110: astore        5
     112: iconst_0
     113: istore        6
     115: aload         4
     117: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     122: astore        7
     124: aload         7
     126: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     131: ifeq          186
     134: aload         7
     136: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     141: astore        8
     143: aload         8
     145: checkcast     #88                 // class cz/wrent/advent/Dir
     148: astore        9
     150: iconst_0
     151: istore        10
     153: aload         9
     155: invokevirtual #98                 // Method cz/wrent/advent/Dir.getSize:()J
     158: ldc2_w        #99                 // long 100000l
     161: lcmp
     162: ifgt          169
     165: iconst_1
     166: goto          170
     169: iconst_0
     170: ifeq          124
     173: aload         5
     175: aload         8
     177: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     182: pop
     183: goto          124
     186: aload         5
     188: checkcast     #94                 // class java/util/List
     191: nop
     192: checkcast     #67                 // class java/lang/Iterable
     195: astore_2
     196: lconst_0
     197: lstore_3
     198: aload_2
     199: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     204: astore        5
     206: aload         5
     208: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     213: ifeq          254
     216: aload         5
     218: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     223: astore        6
     225: lload_3
     226: aload         6
     228: checkcast     #88                 // class cz/wrent/advent/Dir
     231: astore        7
     233: lstore        11
     235: iconst_0
     236: istore        8
     238: aload         7
     240: invokevirtual #98                 // Method cz/wrent/advent/Dir.getSize:()J
     243: lstore        13
     245: lload         11
     247: lload         13
     249: ladd
     250: lstore_3
     251: goto          206
     254: lload_3
     255: lreturn

  private static final long partTwo(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #59                 // Method parseTree:(Ljava/lang/String;)Ljava/util/Map;
       4: astore_1
       5: aload_1
       6: ldc           #126                // String /
       8: invokeinterface #130,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      13: dup
      14: invokestatic  #135                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      17: checkcast     #137                // class cz/wrent/advent/Node
      20: astore_2
      21: ldc           #138                // int 70000000
      23: i2l
      24: aload_2
      25: invokeinterface #139,  1          // InterfaceMethod cz/wrent/advent/Node.getSize:()J
      30: lsub
      31: lstore_3
      32: ldc           #140                // int 30000000
      34: i2l
      35: lload_3
      36: lsub
      37: lstore        5
      39: aload_1
      40: invokeinterface #65,  1           // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
      45: checkcast     #67                 // class java/lang/Iterable
      48: astore        7
      50: iconst_0
      51: istore        8
      53: aload         7
      55: astore        9
      57: new           #69                 // class java/util/ArrayList
      60: dup
      61: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
      64: checkcast     #72                 // class java/util/Collection
      67: astore        10
      69: iconst_0
      70: istore        11
      72: aload         9
      74: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      79: astore        13
      81: aload         13
      83: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      88: ifeq          121
      91: aload         13
      93: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      98: astore        14
     100: aload         14
     102: instanceof    #88                 // class cz/wrent/advent/Dir
     105: ifeq          81
     108: aload         10
     110: aload         14
     112: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     117: pop
     118: goto          81
     121: aload         10
     123: checkcast     #94                 // class java/util/List
     126: nop
     127: checkcast     #67                 // class java/lang/Iterable
     130: astore        7
     132: nop
     133: iconst_0
     134: istore        8
     136: aload         7
     138: astore        9
     140: new           #69                 // class java/util/ArrayList
     143: dup
     144: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
     147: checkcast     #72                 // class java/util/Collection
     150: astore        10
     152: iconst_0
     153: istore        11
     155: aload         9
     157: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     162: astore        13
     164: aload         13
     166: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     171: ifeq          225
     174: aload         13
     176: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     181: astore        14
     183: aload         14
     185: checkcast     #88                 // class cz/wrent/advent/Dir
     188: astore        16
     190: iconst_0
     191: istore        17
     193: aload         16
     195: invokevirtual #98                 // Method cz/wrent/advent/Dir.getSize:()J
     198: lload         5
     200: lcmp
     201: iflt          208
     204: iconst_1
     205: goto          209
     208: iconst_0
     209: ifeq          164
     212: aload         10
     214: aload         14
     216: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     221: pop
     222: goto          164
     225: aload         10
     227: checkcast     #94                 // class java/util/List
     230: nop
     231: checkcast     #67                 // class java/lang/Iterable
     234: astore        7
     236: nop
     237: iconst_0
     238: istore        8
     240: aload         7
     242: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     247: astore        9
     249: aload         9
     251: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     256: ifne          263
     259: aconst_null
     260: goto          358
     263: aload         9
     265: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     270: astore        10
     272: aload         9
     274: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     279: ifne          287
     282: aload         10
     284: goto          358
     287: aload         10
     289: checkcast     #88                 // class cz/wrent/advent/Dir
     292: astore        11
     294: iconst_0
     295: istore        13
     297: aload         11
     299: invokevirtual #98                 // Method cz/wrent/advent/Dir.getSize:()J
     302: lstore        11
     304: aload         9
     306: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     311: astore        13
     313: aload         13
     315: checkcast     #88                 // class cz/wrent/advent/Dir
     318: astore        14
     320: iconst_0
     321: istore        16
     323: aload         14
     325: invokevirtual #98                 // Method cz/wrent/advent/Dir.getSize:()J
     328: lstore        14
     330: lload         11
     332: lload         14
     334: lcmp
     335: ifle          346
     338: aload         13
     340: astore        10
     342: lload         14
     344: lstore        11
     346: aload         9
     348: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     353: ifne          304
     356: aload         10
     358: dup
     359: invokestatic  #135                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     362: checkcast     #88                 // class cz/wrent/advent/Dir
     365: invokevirtual #98                 // Method cz/wrent/advent/Dir.getSize:()J
     368: lreturn

  private static final java.util.Map<java.lang.String, cz.wrent.advent.Node> parseTree(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #157                // class java/lang/CharSequence
       4: iconst_1
       5: anewarray     #124                // class java/lang/String
       8: astore_2
       9: aload_2
      10: iconst_0
      11: ldc           #159                // String $
      13: aastore
      14: aload_2
      15: iconst_0
      16: iconst_0
      17: bipush        6
      19: aconst_null
      20: invokestatic  #165                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      23: checkcast     #67                 // class java/lang/Iterable
      26: iconst_1
      27: invokestatic  #171                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
      30: astore_1
      31: aload_1
      32: invokeinterface #172,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      37: astore_2
      38: new           #88                 // class cz/wrent/advent/Dir
      41: dup
      42: aconst_null
      43: ldc           #174                // String
      45: new           #69                 // class java/util/ArrayList
      48: dup
      49: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
      52: checkcast     #94                 // class java/util/List
      55: invokespecial #177                // Method cz/wrent/advent/Dir."<init>":(Lcz/wrent/advent/Dir;Ljava/lang/String;Ljava/util/List;)V
      58: astore_3
      59: iconst_1
      60: anewarray     #179                // class kotlin/Pair
      63: astore        5
      65: aload         5
      67: iconst_0
      68: aload_3
      69: invokevirtual #182                // Method cz/wrent/advent/Dir.getFullName:()Ljava/lang/String;
      72: aload_3
      73: invokestatic  #188                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      76: aastore
      77: aload         5
      79: invokestatic  #194                // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
      82: astore        4
      84: aconst_null
      85: astore        5
      87: aload_3
      88: astore        5
      90: aload_2
      91: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      96: ifeq          673
      99: aload_2
     100: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     105: checkcast     #124                // class java/lang/String
     108: astore        6
     110: aload         6
     112: ldc           #196                // String cd
     114: iconst_0
     115: iconst_2
     116: aconst_null
     117: invokestatic  #200                // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
     120: ifeq          292
     123: aload         6
     125: checkcast     #157                // class java/lang/CharSequence
     128: iconst_1
     129: anewarray     #124                // class java/lang/String
     132: astore        8
     134: aload         8
     136: iconst_0
     137: ldc           #202                // String
     139: aastore
     140: aload         8
     142: iconst_0
     143: iconst_0
     144: bipush        6
     146: aconst_null
     147: invokestatic  #165                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     150: iconst_1
     151: invokeinterface #205,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     156: checkcast     #124                // class java/lang/String
     159: checkcast     #157                // class java/lang/CharSequence
     162: invokestatic  #209                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     165: invokevirtual #210                // Method java/lang/Object.toString:()Ljava/lang/String;
     168: astore        7
     170: new           #88                 // class cz/wrent/advent/Dir
     173: dup
     174: aload         5
     176: aload         7
     178: new           #69                 // class java/util/ArrayList
     181: dup
     182: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
     185: checkcast     #94                 // class java/util/List
     188: invokespecial #177                // Method cz/wrent/advent/Dir."<init>":(Lcz/wrent/advent/Dir;Ljava/lang/String;Ljava/util/List;)V
     191: astore        8
     193: aload         7
     195: ldc           #126                // String /
     197: invokestatic  #214                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     200: ifeq          209
     203: aload_3
     204: astore        5
     206: goto          90
     209: aload         7
     211: ldc           #216                // String ..
     213: invokestatic  #214                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     216: ifeq          229
     219: aload         5
     221: invokevirtual #220                // Method cz/wrent/advent/Dir.getParent:()Lcz/wrent/advent/Dir;
     224: astore        5
     226: goto          90
     229: aload         4
     231: aload         8
     233: invokevirtual #182                // Method cz/wrent/advent/Dir.getFullName:()Ljava/lang/String;
     236: invokeinterface #223,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     241: ifne          266
     244: aload         8
     246: astore        5
     248: aload         4
     250: aload         8
     252: invokevirtual #182                // Method cz/wrent/advent/Dir.getFullName:()Ljava/lang/String;
     255: aload         8
     257: invokeinterface #227,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     262: pop
     263: goto          90
     266: aload         4
     268: aload         8
     270: invokevirtual #182                // Method cz/wrent/advent/Dir.getFullName:()Ljava/lang/String;
     273: invokeinterface #130,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     278: dup
     279: ldc           #229                // String null cannot be cast to non-null type cz.wrent.advent.Dir
     281: invokestatic  #232                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)V
     284: checkcast     #88                 // class cz/wrent/advent/Dir
     287: astore        5
     289: goto          90
     292: aload         6
     294: ldc           #234                // String ls
     296: iconst_0
     297: iconst_2
     298: aconst_null
     299: invokestatic  #200                // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
     302: ifeq          641
     305: aload         6
     307: checkcast     #157                // class java/lang/CharSequence
     310: iconst_1
     311: anewarray     #124                // class java/lang/String
     314: astore        8
     316: aload         8
     318: iconst_0
     319: ldc           #236                // String \n
     321: aastore
     322: aload         8
     324: iconst_0
     325: iconst_0
     326: bipush        6
     328: aconst_null
     329: invokestatic  #165                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     332: checkcast     #67                 // class java/lang/Iterable
     335: iconst_1
     336: invokestatic  #171                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     339: checkcast     #67                 // class java/lang/Iterable
     342: astore        8
     344: iconst_0
     345: istore        9
     347: aload         8
     349: astore        10
     351: new           #69                 // class java/util/ArrayList
     354: dup
     355: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
     358: checkcast     #72                 // class java/util/Collection
     361: astore        11
     363: iconst_0
     364: istore        12
     366: aload         10
     368: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     373: astore        13
     375: aload         13
     377: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     382: ifeq          439
     385: aload         13
     387: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     392: astore        14
     394: aload         14
     396: checkcast     #124                // class java/lang/String
     399: astore        15
     401: iconst_0
     402: istore        16
     404: aload         15
     406: checkcast     #157                // class java/lang/CharSequence
     409: invokeinterface #240,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     414: ifle          421
     417: iconst_1
     418: goto          422
     421: iconst_0
     422: nop
     423: ifeq          375
     426: aload         11
     428: aload         14
     430: invokeinterface #92,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     435: pop
     436: goto          375
     439: aload         11
     441: checkcast     #94                 // class java/util/List
     444: nop
     445: astore        7
     447: aload         7
     449: checkcast     #67                 // class java/lang/Iterable
     452: astore        8
     454: iconst_0
     455: istore        9
     457: aload         8
     459: invokeinterface #76,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     464: astore        10
     466: aload         10
     468: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     473: ifeq          637
     476: aload         10
     478: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     483: astore        11
     485: aload         11
     487: checkcast     #124                // class java/lang/String
     490: astore        12
     492: iconst_0
     493: istore        13
     495: aload         12
     497: checkcast     #157                // class java/lang/CharSequence
     500: iconst_1
     501: anewarray     #124                // class java/lang/String
     504: astore        14
     506: aload         14
     508: iconst_0
     509: ldc           #202                // String
     511: aastore
     512: aload         14
     514: iconst_0
     515: iconst_0
     516: bipush        6
     518: aconst_null
     519: invokestatic  #165                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     522: astore        15
     524: aload         15
     526: iconst_0
     527: invokeinterface #205,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     532: checkcast     #124                // class java/lang/String
     535: astore        14
     537: aload         15
     539: iconst_1
     540: invokeinterface #205,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     545: checkcast     #124                // class java/lang/String
     548: astore        16
     550: aload         14
     552: ldc           #242                // String dir
     554: invokestatic  #214                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     557: ifeq          587
     560: new           #88                 // class cz/wrent/advent/Dir
     563: dup
     564: aload         5
     566: aload         16
     568: new           #69                 // class java/util/ArrayList
     571: dup
     572: invokespecial #70                 // Method java/util/ArrayList."<init>":()V
     575: checkcast     #94                 // class java/util/List
     578: invokespecial #177                // Method cz/wrent/advent/Dir."<init>":(Lcz/wrent/advent/Dir;Ljava/lang/String;Ljava/util/List;)V
     581: checkcast     #137                // class cz/wrent/advent/Node
     584: goto          606
     587: new           #244                // class cz/wrent/advent/File
     590: dup
     591: aload         5
     593: aload         16
     595: aload         14
     597: invokestatic  #249                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     600: invokespecial #252                // Method cz/wrent/advent/File."<init>":(Lcz/wrent/advent/Dir;Ljava/lang/String;J)V
     603: checkcast     #137                // class cz/wrent/advent/Node
     606: astore        17
     608: aload         5
     610: aload         17
     612: invokevirtual #256                // Method cz/wrent/advent/Dir.addChild:(Lcz/wrent/advent/Node;)V
     615: aload         4
     617: aload         17
     619: invokeinterface #257,  1          // InterfaceMethod cz/wrent/advent/Node.getFullName:()Ljava/lang/String;
     624: aload         17
     626: invokeinterface #227,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     631: pop
     632: nop
     633: nop
     634: goto          466
     637: nop
     638: goto          90
     641: new           #259                // class java/lang/IllegalStateException
     644: dup
     645: new           #28                 // class java/lang/StringBuilder
     648: dup
     649: invokespecial #31                 // Method java/lang/StringBuilder."<init>":()V
     652: ldc_w         #261                // String Unknown command
     655: invokevirtual #37                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     658: aload         6
     660: invokevirtual #37                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     663: invokevirtual #44                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     666: invokevirtual #210                // Method java/lang/Object.toString:()Ljava/lang/String;
     669: invokespecial #264                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     672: athrow
     673: aload         4
     675: areturn

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


package cz.wrent.advent

import java.util.Deque
import java.util.LinkedList

fun main() {
	println(partOne(test))
	val result = partOne(input)
	println("13a: $result")
	println(partTwo(test))
	println("13b: ${partTwo(input)}")
}

private fun partOne(input: String): Int {
	val pairs = input.split("\n\n")
	val packetPairs = pairs.map { it.split("\n").filter { it.isNotEmpty() }.map { it.parsePacketData() } }
		.map { it.first() to it.get(1) }
	return packetPairs.mapIndexed { index, pair -> index to pair.first.compareTo(pair.second) }.filter { it.second < 0 }
		.sumOf { it.first + 1 }
}

private fun partTwo(input: String): Int {
	val parsed = input.split("\n").map { it.trim() }.filter { it.isNotEmpty() }.map { it.parsePacketData() } + "[[2]]".parsePacketData() + "[[6]]".parsePacketData()
	val sorted = parsed.sorted()
	val a = sorted.indexOfFirst { it == PacketList(listOf(PacketList(listOf(PacketInt(2))))) }
	val b = sorted.indexOfFirst { it == PacketList(listOf(PacketList(listOf(PacketInt(6))))) }
	return (a + 1) * (b + 1)
}

private fun String.parsePacketData(): PacketList {
	val root = mutableListOf<PacketData>()
	val input = this.substring(1, this.length - 1)
	val stack: Deque<MutableList<PacketData>> =
		LinkedList<MutableList<PacketData>?>().apply { add(root) } as Deque<MutableList<PacketData>>
	val sb = StringBuilder()
	for (char in input) {
		when (char) {
			'[' -> stack.push(mutableListOf())
			']' -> {
				if (sb.isNotEmpty()) {
					stack.peek().add(PacketInt(sb.toString().toInt()))
					sb.clear()
				}
				val closed = stack.pop()
				stack.peek().add(PacketList(closed))
			}
			',' -> {
				if (sb.isNotEmpty()) {
					stack.peek().add(PacketInt(sb.toString().toInt()))
					sb.clear()
				}
			}
			else -> sb.append(char)
		}
	}
	if (sb.isNotEmpty()) {
		stack.peek().add(PacketInt(sb.toString().toInt()))
		sb.clear()
	}
	return PacketList(root)
}

private interface PacketData : Comparable<PacketData>

private data class PacketInt(val value: Int) : PacketData {
	override fun compareTo(other: PacketData): Int {
		return if (other is PacketInt) {
			this.value.compareTo(other.value)
		} else {
			PacketList(listOf(this)).compareTo(other)
		}
	}
}

private data class PacketList(val value: List<PacketData>) : PacketData {
	override fun compareTo(other: PacketData): Int {
		return if (other is PacketList) {
			val zipped = value.zip(other.value)
			var result = 0
			for (pair in zipped) {
				val compare = pair.first.compareTo(pair.second)
				if (compare != 0) {
					result = compare
					break
				}
			}
			if (result != 0) {
				result
			} else {
				this.value.size.compareTo(other.value.size)
			}
		} else {
			this.compareTo(PacketList(listOf(other)))
		}
	}
}

private const val test = """[1,1,3,1,1]
[1,1,5,1,1]

[[1],[2,3,4]]
[[1],4]

[9]
[[8,7,6]]

[[4,4],4,4]
[[4,4],4,4,4]

[7,7,7,7]
[7,7,7]

[]
[3]

[[[]]]
[[]]

[1,[2,[3,[4,[5,6,7]]]],8,9]
[1,[2,[3,[4,[5,6,0]]]],8,9]
"""

private const val input =
	"""[]
[[6,[4,[4,10,7]],[[0,8,6],2],[[],8,[7,10,6,4,2],[10,10],6],4]]

[[[9,6,2,5,[4,6,6,8,2]],1,4,10],[[[2,10,9,8],6,1,[0]],[[],[8]]],[[9,[0,7,8],6],[[],9,[5,5],[3]]],[6,3,[7,[1],[0,10,10,2,1],[7]],6,[4,2,3,[]]],[[0,4,[5,4,2,9,5],[2,10],4],5,6,[5,8,4],[[4],5]]]
[[4,0,7,[1,[2,7,2],5,[6]],5],[3,[1,10,[10,4,5,9],8]],[7],[[0],[],6,8],[[[1,2],10,3,8,[]],0,7]]

[[[4,6,9,3,1],4,[3],[2,4,[6,10]],6],[]]
[[4,8],[[],6],[3,4]]

[[10,[[8],7,[4,10,3],1,7]],[[[],2,[6]],10,[[10,0,6,1],1,0],8],[]]
[[2,[3]],[[[],0,[2,6]]]]

[[3,[[8,1,10,7],[10,8,1,5],5,[8]],10]]
[[[4],5,[[],[],10]],[[[],[],[10],[3,7,1],[5,5,6]]],[[4,3],7],[[[5,9,8,9]]]]

[[5,[1],9,[[7,10,5],8,[8,7,2],[6,1]]]]
[[[[1,6],6,7],[],1,[],[[8,4,4,0,4],9]]]

[[[2,7,[10,6,0],[10]],[[1,6,9],9],[[2],[],1,[8]]],[[]]]
[[],[5,9,3,[9,[10,8,10,1],6],[3]],[[10,3,[6,5,1,5]]],[5,[]]]

[[4],[[0,[1],1,4],[3,0,8,[10,3,7,8]],3],[4,9],[[8],[[9,1,4,6],[0,3,7,9,3],[2,9,9,9,0],[]],10,8]]
[[],[3,[0,[4,7],2],10,3,[2,3]]]

[[[[2,2],2,[9],[1,6,7,6,2]],[],6]]
[[3,3,10],[[3,[10,2,6,8,9],[10,10,4,6,1],[7,1,0]],1,[[1,1,9],[10,4,7,4]]],[[],[8,5],[1,[4,4,4,8],[6,7,4],[1,4]],5,8],[4]]

[[9,8,8],[],[],[7,[0,1,1],8]]
[[9,[[2,5]],[10,[1,5,10,5]],4,5],[0]]

[[],[],[4,[9],[[3,7]],4],[5,10,[4],[[9,4,7],[2,0,6,8,5],3,5,7],10],[]]
[[4,[2,10,[],[9,5,9]],[[2,8,8],[4,6,10],1,[9],[1,9]],[8,[5,3,10,10],[7,0],0],[]],[],[],[[10,[1,8,3,3],7,7,[4]],4],[[],1,3]]

[[9,[[1,2,6],1,6,2],5,[4,[0,5,9],[2],3]]]
[[[],[1,8,[3,7,0],7],1,[5,4],[[10,0,0],6,0,[1,2,6],[0,4]]],[1,1,0,[[3],[6,8,6],[10,7,8],[2,10,8,7],6],[]],[[],[[9,5,1,1,8],8,[5]],[[6,10,2,10,2],7,0,8,[10]]],[[[1,4,1,10],[],7],[[6],9,8,[4,1,9,3,3],[2,10,0]],2,[9,8]],[[],4,[]]]

[[5],[9,[[10,3],[0,5,10,6],9,8,5],10,[6,3,6,6]],[4,8],[1,[[2],7,5]]]
[[[4],[[3,0,7],[],7]],[[[],10,[],[10,3,6,1],8],8,0,[[9,8,3],5,[],1],2],[[],[[6,9,10,8,8]],0],[7,[8,0,8,5,[8,3,5]],[8,[6,3,1]],3],[[],[2]]]

[[5,[10],5,10],[],[],[7,3],[4,4]]
[[6,[[10,3,2,7,2],[7,3]]]]

[[],[[10],9,5,9,1],[7,4,[]],[6,[10,6,[2],[5,10,4,9]]]]
[[0,5,9],[[[3],[7,7,4,2],[],1,[]],3,[5,[3,1,9],0,[9,8],4],[6,5],10],[[8,3,[5,9,7,5,7],4],10,[[5,5,4],[2,1,4],1,[7,5,9]]]]

[[[[0],[5]],7,[5,5,2,2]],[10,[[10,1,7,6,6],[5,1,10,3,7],[9,5,7]]]]
[[],[1,[[0,7,0,5,10],10,[4]]],[2,[3,[3,9,1]],[[10,9,0,4],8]],[2],[6,10,2,[[2,1,4]],6]]

[[6,[[3,8],5,0,7],[5,3,4]],[[10,5,[],[10,8,6,3,9]],2,[2,2],1],[1,[2,[8,4],2,7,[]]],[[[1],[3]],[[2],[10,10,5,6],9],[[5,6,7],[0,9],1,2],2]]
[[[8,4],[9,[],8,8,10],3,4,2],[[5,[4,8,5],[2,0,1,4]],[0,[5,5,6]]],[5,[]],[]]

[[[[],[0,7,5],5],9,[3,7,[]],[]],[[[4],7,10,[4,6,10,10,8]],[0,[9,8,4,0],10,3,9],10,[[1,9],10,[3,5,6,2]],0],[6],[[[0]],2,1]]
[[6],[1,[[5],[1,8,0,8,3],5,6,7],[6],[[3,0,1,6,2],[9,7,8],10,[0,1,5,0,0],[4,10]]],[[9,8],9,[[8],0,[8,10,4,0],[]]]]

[[[],[0,[10,7,2],[9,3,4,9],[10,0,10]],[],[[2,6,3,0],9],6]]
[[5,[7,1,6,[9,1,5]]],[[7,[10,4,1,7],8,[2,10,0]],10,2,10,[[10,8,2,7,0],[3,6,0,8,4],7]],[[0,10,[9,4,10],3,[0,1,7,10,9]],1,1],[7,8,[6,[9],[3,5,0,3,5],[4,10,7,0,7],[4]],3,7],[3,[1],0,[[6,7,9],[7,9,0],[9,7,9,7,7]],[[5,10]]]]

[[5,9,0],[[7,[]],[9,6,[6,8],2],1,[]],[],[[[6,4,3,2],[6,3,5],[6,9,0,9,2],0,1],[1,[2,4,7,1],0]]]
[[3,[],[7,[3,5,9,10],[2,4]],0,1],[7]]

[[[[5,4],10],10,[[1,4,1,10]]],[2,[]],[4,[1]],[[1],6,[[4,0,9,10,2],5],8]]
[[],[[],3],[1],[[9],[[],[0],3,5]],[2]]

[[10,6,5,10,[]],[[10,9,4,6],7,10]]
[[1,10,[[9,10,0,6,5],4],10,10],[[[3,2,10,3],7,[],[3,9,2,5]],2,4]]

[[],[[],6,[[9,8,6,7,9],[9,3],1,8,[6,1,7]],2],[[0],[1,4,10,[],10]],[7,1,1,6],[]]
[[8,6,[1,9,9]],[0,[5,7]]]

[[],[],[[5,[2,2,8,5,7],3,9,[4,6,0,2,0]],1,7,0],[],[[[7,6,5],9,[2,2,10,5,6]],4,[0,[],[9,4,1,8]],8,7]]
[[7,0,0]]

[[[[4,9,6,5,4],[0]],[]],[[[7],3,[10,7,4,8,4],[8,9],4],[5,4,[1]]]]
[[[[4,9,0,2],[2,5,6],[3,10,4]],0,8,1,1],[[10,[2],1,[9,0,0,1,9],[8,9,6]],[[9,6,6],4,[5,7],8,[5,9,8,7,10]],10,2],[],[[],[2,0,9,10],1],[4,[[6],[]],5,[7,8,[9,9,3],0],1]]

[[2,10,[[],0,9,8,7],6,0],[7,5,2,[],7],[3]]
[[],[8,[1],5]]

[[[[10,2,4],3,[],0],1,[[5,3,9,0],1],[7,[0,1],[1],9,5],[[1,10],[4,1,9,5,9]]],[8],[1,[9],5,[4,4,6],[8]]]
[[1,10,[[2,3,4,8],8,8],2],[[[],[8,2],9,[0,5,7,0,5],4],4,[[],9,[]],[9,[2,9]],[[],[5],6,7,[]]]]

[[9],[[[4,9],2,[6],[1],[]],[],[]],[[1]],[],[[],[0,[7,4,1],10],[[1]],[[1],[],[6,2,2,1,4],0,[5,4,2,2,5]],[]]]
[[[4,2,1,3],[[9,2,3,3,4],10,8,8,10]],[7,[2,[3,3,6,3],0,[10,2,3,3]]],[[[],6,[5,6],3,[5,6,5,6,9]]]]

[[[5,7,[9,7,10],[]],[[3,10,9,5],5],[],[[],8],[[1,10],10,9]],[[],[1,[4,8,5],[],[2,7,6,7,5]],1],[],[9,4]]
[[],[6,7,3,3],[[3,[]],[]]]

[[[[3,4],8,0,5],4,[[2,10]],7],[[[8,3,4],10,[6,9,8],[2,6,7,7,4]],10,5,[[1],[0,9],[1,1,3,5]]],[]]
[[[[8,4],[0,6,5],0,[0,6]],[2],[[5]]]]

[[8],[[2,7,2,[0,3,8]],[[6,3,8],3,[0],[3,6,1,4,3],6],10,6,[0]],[7],[[],[[],2,[0]]],[4,9,[[6,7,6]],7]]
[[[[8]]],[[2,[3,4,0,1,6],10,[8],[]],[[7,9],4,10],[[6,8],[],6,[],[5,7,6]],[[6,7,10,5,2]],3],[2,3,2,[[10]]],[8,2,[9,8,[1,0,2]]]]

[[7,[[0,5,6,0],[4,1,7,0],8,[1,3,7]],3,[]],[[10,8,[4,3],6,10],7],[],[[],6],[[1,2,4],[[1,3],[9,10],2,[10,6,5,6,0]],[[0],[],3,1],3,[[8],0,9]]]
[[3,8,[5,9,5],4],[3],[],[[],[10,7,[7,0,7],7]],[7]]

[[7,[[],8,[1],[9,1,6,7]],[[],0,[5,2,7,9]]],[[[10],8,[7,1],9],10],[[]]]
[[[6,6,[0,0]],6,5,4,4]]

[[[0,[2,10,1],[4,8,7,4],2,[9]],[5],8],[],[[2,7,[7,10],8,2],8,9,[1,4]],[[[1,4,2],3,[3],[4,1,9]],8,[],[9,[]],[]]]
[[],[[0,1],3,[[4,2,7],10,6,[6,8,6],[3,8,3,5,8]],8,6],[1,1],[9,[[]],7],[[[6],[7,9],[0,6],[4,5,9,4]],[5,9,[10,5,7],[]],[3,[],1,10],5]]

[[[[]],[],0,[[],[2,0,9],[3,3,1],7,[]],8],[[[2],[5,10],5,[10,0,5]],[[6],[0,0,4,6],[0,10]],5,[[]],6],[[2,[4,8,4,3,8],9],2,5,[[],2]],[[[5]]]]
[[],[7,8,[[9,6],[7]]],[[[],1],1],[[[8,5,8,5],[]],[],9,1],[5,[[],10,[10,1,4,6,8],[10,9,9],[2,10,5]],0,[4,[4,2,0,1],2],5]]

[[6,10,3]]
[[],[[],3,[1],6],[],[[3],8,[1,1,[0,5,6,6,5],[]]]]

[[9,8,9,5,[[3,9,6]]]]
[[],[9,[[1,3],1,[8,6,4],[7,0,5,3,10],6],[[5],[1,5,3,8,4],10],[7,[0,0],[7,2,3,9],[6,5],[]]],[4,[],6,[[7,2]]],[8,8,3]]

[[[[],7]],[5,[5,0,[6]]],[5,[0]],[9,2,[[]],[10,[4,9,9,5,10],6,7],10],[]]
[[[[7,2],[1,2],10,[],[2,8]]]]

[[0,[0,5,[4],4,4]]]
[[[[10,0,2,2],1,[]],[10,[3]]],[6,10,[],6]]

[[[],9,5],[[],8,[3]],[[],[[8],[6,8,5,4],[],[0,5,4,4,10]],8,[[],[10,0,1],[2,1,8,0]]],[[0],3,[4,0,[8],[4]],[]],[[[2,10,10,7,10],8,3,0,[7,0,3,1]],[[],[4,9,10,10],[5,8,6,9]],[2,[8,7,10],[7,9],[],[10]]]]
[[6,9],[[8,9],1],[6,[0,[9,2,5,10],5],[9,[10,2,2],8,[9,3],[7,5,2,8]],8]]

[[[3,1,[3,9]],1,[[]],6],[],[6,[[4,10,10,2,4],[],[6,7],0,6],[[7],[],[10,9],[5]]],[[5,[0,10,5],[6,9,4],4,9],5,8,[6,7]]]
[[0]]

[[[],1,[[8,6,8],[5,9],10],[[10,9,1,10,10],9,[8,3,3,0,5],[2,6,1,3,5],[0,7,8,7]],[[8,6,9,1],4]],[10,[1]],[],[4,[[5,4,0],[1],5]]]
[[[]],[10,5,4]]

[[10,10],[7]]
[[],[[],10,6,8]]

[[7,8],[1,[]],[]]
[[2,2,3,8,7],[],[4,7,[0,4,4,[]],4],[[[3,0,9,10],[],[2,0]],[[1,10,3,5,9],3,[],[]]]]

[[[[8],7,[2,7,5,9],[7,5,9,9]],[[],[7],7],6,0],[[[9,6],[1,3,9,4,4]],[[4,4],10],5,9],[1,4,7,7,3],[]]
[[],[]]

[[2,[1],[],[[8,10,4,0]]],[[],[1,[5,6,5,9],6]],[]]
[[[4,6,1,5],[],2,[6,[]]],[[[7,7,2,3]]]]

[[1,[[],9],1,[9,3,[1,9,4,5],10],4],[3,[[],[5,0,1,9,0]]],[[1,[2],1]]]
[[],[[5,6,10,6],[[3,7,0,0,8],2,0,[9]],[5,10,6,7,4],1,[[6,9],6,[7,6],1]],[],[[2,8,[5,7],4],9,0]]

[[[5,[6,5]],[1,2,4,[6,9,2],2],3,[[],[10,7,0,9],[10]]],[3,[[9,3,3],1,[4],[0,3,5],10],[[8,5,5],[],[10,3,10,1]],2],[[[10,9,2,0,9],0,[8,7,7,7]]]]
[[],[[]],[[[5,10],[0,7,4,0],[3,3,10,8,0],[8,5,3,4,7],[3,6]],3,4],[1]]

[[6,2],[],[9],[]]
[[],[[[],6,2,[6,5,0,4],[1,7,6,1,5]],[[],6,[6,7,8,4,6],[4,10,5,10]],[],6],[0,[],[5]],[6]]

[[10],[[[2,10],0],[1,[2,8,8],[]],[[8,1,0]],2,7],[0]]
[[7,[8,[]]]]

[[1,6,9,10,4]]
[[[]],[[10,[0,1,1,9,8],[2,3,4,0]],[[5,2],[5,5,3,5],4,5]]]

[[6,10,[10,4,3,10,[9,9,8,0]]],[[[8,6,5]],8,7,6,[]],[[[1,1,5,10,9],10],[[4,6,8,10,1],10,[0,0,5]],[[9,7]]]]
[[],[[7,[8],7]],[],[1],[]]

[[1,[[1,2,6,9,9],[],[],9],5],[8],[[7],[0,[7,3,9],[4,3,8,7],2,[]],10,[[],10,0,7],[2]],[4,[[],[9],[],8,7],[[9,6,2],2,[8],[4,1,0]],[],8],[]]
[[],[[[7,8,10,3,1],0,4,[3,6,8,8,4]],6,9,[10,8,5,10]],[[[3,10,3],6],[2,[3,10,4,2,8],[7,3,3]]],[]]

[[5,10,[],[10,[1,1,6,3],[8,5,5,1],10]],[2]]
[[[],[],[[2,1,2,3,8],[9,4],[10,9,7,6],0],10,[[5,4,6],2,[4,8],3]]]

[[[[6,0]],[[],6,0],3,[],7]]
[[[[10,5],[]],[],7,5,6],[[[5],[9,8,5,10,4],[10,9,2,3,10],[2,6,2,0]]],[[1,2,10,[6,4,8,5,5],1],1,10,[[5],[4,0,10,5,6],[3,2,5,7],5,1],7]]

[[],[[[5],[9,5,1,7,1],[2,2,10,5]],[5,3,[8,1],[]],[6,3,[2,8,2,6,1]],[[7,0,0,7],[]]],[9,[],[10]],[[5,10],[[6,1,2,7],[0,8,0,4]],[],1,2]]
[[1,8,[],1,[]],[5],[3,6]]

[[7,6],[6,[6,[]],[],10,10],[[1,[4],[1],[10,10,9,0]],[7,2,[],7,[8,5,6]]],[],[[],5,2,[]]]
[[[[4,9],[4],2,[8,0,8,2]],[4,[7,0],[3,1,7,0],[0,1,3],[0,7,1,10]],2,[]]]

[[[[6],[6],[0,6,9,9,0]]],[6,[[],[9,9,5,1],[0,1,6]],[[6,6,5],[5,2],[8,1,3],[4,2,5,2],7]]]
[[[[9,1],[9,3,3,6,8],[],[7,5],3],4,[6,5,9],[[2,1,4,9,8],0,[5,10,1,7,6],[9,7,7]],[[5,5],2]]]

[[[[7,5,3,3,4],[4,6,1,5]],10,[8,1],3],[5,[9,[10,8],[10,5,4,8]],[5,2,0,[0,0,6]],[[2,10,6],[10,2,6],0,1],3]]
[[10,[6],[9,[1,1,0,5],6,10,4],8,0],[[]]]

[[[[4,6],[6,7,5,7,9],1,5],5,7,8,[[8,5,1,9,2],3,[],[1,2,8],[5,3,6]]],[9],[8]]
[[[[6,10,7,1,5],[3,1,4,9,0]]],[[[9,7],1,2],4,[[2,4],10,10,5]],[5,[1,0,6,[10,6]]]]

[[[[8,5],8,1],1,1],[[5,[5,10,8],1,6,1],5,3],[0,3,6,[]],[7,3,4],[[[2,2],8,2],[[4,1,10,8],[2],3],4,8]]
[[[9,1]]]

[[[8,3,[0,10,4,10]],2]]
[[3]]

[[[[],[3,6],[5,7,1,9],[9,5,6,2,7]],8,0,7,2],[],[5,0,[4,[7,8,4],[7,1,2],[4,7,1]],[]],[4,9,[[5,6,9,6]],1]]
[[[2],4,5,[[10,2,7,9,10],5]],[8,[5,5,[9,5,4,8,9],7,[3,10,0,1,7]],[6],[],[1]],[8,[[2,1,10],[]],[[8,3,7,8,4]],[[10,1,8],[10,0,10],3,7,5],[[0,5,1]]],[8],[[10,[],[6],[],6],3,[3,[],2,2,[3,1,10]],2]]

[[],[[3,0,[]],[1,[10,2,3,5,5],[0,8,3,7,2],[5,0]],[2],[[0,4,2,3,7],[8,6,7,5],1]],[[0,[6]],[[4],2,[6,6,3],[8,3,4,2]],[5,1,[4,2,9]]]]
[[[7,[],[10,8,4,3,8],[1,0]],2,8],[3,1,2],[[3,6,[7,6,0,9,7]],8],[8,6,[[4,10,1,1]],[[1,1,1],10],[6]],[[]]]

[[[],[[5],4],[],9,3],[[7,[2,0,5,9,8],6,6,0]],[[5,4,[],[9]],7],[4,[[1,1],3,4,2],[[6,5,7],6,[2,0,5,3]]],[]]
[[2],[[[10]],2,3],[[[1,6,2,9],10,[3,6,7,2,10],4,[6,3,10,6,7]],[[9,2]]]]

[[[[]],[2],[1,2,[0],0],10,[[],3,9,[]]],[3,1]]
[[[],7]]

[[],[[[2,9,9],[]],8,[],[],[[6,1]]],[[10,0,[9,4,6,6],7,[]],9,[8,5,9]]]
[[7,[]],[10,[8],[[9,8,7,6,8],[],10,2,2]],[[],3,[8,10],8,[2,6,[4,8,3]]],[[1,[5,1],4,0],[2,0],9,[]]]

[[],[9,[[7,10,8],2,4],2],[3,5,3,10]]
[[],[1,6],[1,8]]

[[1,[[5,10,6,10,4],[10,8,9],[9,2,2,10,3],8],[1,5,1],[[8]]]]
[[[6,10,6,[5,0,4]],9,8,5,[[4,9],10,[1,4],[]]],[8,[[1,7,8]],[10],[],1],[5,8,[[1,2,9],[3,1,6,4,2],10],3]]

[[[10],[[10,4,7,4]],[[1],7,3,[5]]]]
[[[],[]],[9,4,[],[],5],[[[8,3],[10],[],[2,8]],4,[[1,6,3],[6,8,0]],0],[[[2]],[3,4,[0,3,0],[2]]]]

[[1],[1],[]]
[[],[[5,[]],2],[[[4,7]]],[8,5,[[8]],3]]

[[[3,2,[10]],5,[[9,8,2,10],4,[0,5,4],1],0,[]],[9,[[9],[7,3,6,9],7,[6],4],1],[9,[[4,3,4,10]],[[6,9,6,4,6]],[[0,5,2,5,0],[4,8,3,4],[2,0,9],[],[3,9]]],[[[1,0,7,2,8],[8],6,9]]]
[[[[],1,[7,6,9,8],[2,1,1],8],1,0],[[9,[],[10,0,4,0,5],[]],[[5,1],[2,1,6],0,0,[2,8,0]],1,8]]

[[[[9,10],[10,3,10,8],[],[],[7,5]],[[0,9,4,10,0]],[8,1,4,4,[2]],[7,[10,1,0],[],10],[]],[[0,8,3,6,9],9,[[],[6,2,3,3],[6,4,7],[2]],6],[],[]]
[[[],6,2,9,5],[],[5,7]]

[[6,4,[[7]]]]
[[0],[3,6,7],[[7,[8,8,10]]]]

[[7,[[],5],7,[[2,10],4,[4,0,3]],[]],[7,[2,[9,1],[0],5,7],0,5,[8,[7,8],0]],[[[2],[8]],[]],[6,[9,10,0,4],5,[[3,3,3,3,7],[3],[7,3],0]],[]]
[[[[4],3,5,6],[],[3,7,[2,0,4,9,8]]]]

[[2,[[1,1,8]]]]
[[[1,10,3,5,2],[5],9],[[9,[10],[10,3,0,9]]],[[[4,2,8,10]],[8,[3,0,10],[8,7],2,[9,7,7]],[]]]

[4,5,9,7]
[4,5,9,7,3]

[[[4,0,5,[3,6,9],[7,1]],[9,6],1,5]]
[[3,[1,[5,8,10,3,5],[8,7,8],[8,2]],4,[[7,4,7],[6],[3,2],4]],[],[0,0,3,[[4,2]]],[8,[[1,1,2,8,7],1,[5,4,0,10,6]],[0,0,9],9,[2,[0,9,8,3],10,5]],[7,[3,[4],[1,2]],[[9,4,0,5],5,[1,3,9,5],[6,2,10,6,1],[1,5,1,2,1]]]]

[[5,[4,[5,0,2],[6],[7]]],[8,9],[6,[8,1,7,[6]]]]
[[[6,[4,3,5,10,2],3,[2,7,6],9],7,[1,[5,6,1,4,10],3,[],5]],[[7,[8,4,8],[5,3],[0,4,8],[4,9,1,3]],0,[],6],[[7,[4,9,3,4,7]],[2,3,0,[],6],[[4,5,3],[8,3,10,3,5],[3,8],3,9]],[[9,1,0,1],[3,[8,10],7]]]

[[7,[[9,4,0,1,9],[7],[9,3],[2,9,3],[2,9,3,10]],[[8,1],[4],9],[8],[]],[[1,9,[]],0,6]]
[[[[]],5]]

[[9]]
[[3,[[9]]],[[[1]],4,5],[0,3],[3,0,[4,0,6],[[3,6],[9,7,3],5,3,8]],[2,[0,2,[10]],3,7,[]]]

[[],[[6,[7,2,7,9,6],[9,4,5],3,[]]],[5,4,9,0]]
[[2,3,[],5,8],[[3,5,[9,3]]]]

[[5,[],[]]]
[[],[[]],[[[6],2,2,8],[[]]],[[],[[8],0],2,[[1]],[5,8]]]

[[[2],[[3,0,0,3,2],[1,1],[2,7,2,10],[3]],2],[5,[7,9,6,[7,2,4,8,2]],[10]]]
[[10,8,3],[9],[],[6,[],[[2,6],[8],8],[1,[1,3],4]]]

[[9],[5,[[2,2,1,9,4],[2,2,0,3],3,1],[2,8,3,5]],[],[10],[]]
[[[5]],[9],[9,[[8],[1,6]],7]]

[[0],[],[1,[[],[8]],8,[[7,6,6,2,0],[7,6,3],[7,5,9],9]]]
[[[9,1,4,[8,6]],2,8]]

[[[[7,10,3],6,4],[[5,8,7,4,7],[2,4,3,7]],[4,7,[4,7,1,8],[]],2]]
[[[[4,9]],[7,[2]],[],[[1,9,7],4,4,6,7]],[]]

[[[2,0],[0,10,[1]],9,[[5],[1,9],4,[3,0,3,7,3],8]],[2],[],[[[1,1],[8,8,6]],[4,[7,9,9],[10,10,6,6,5]],[[10,3,9],[10,5,5,9],1,3,9],4],[4,3]]
[[[[],[8,8,7,2]],[[5,3],[2,3],8,[7,8,9,4,4]]],[[5,0,6,8,[1,1,4,3,1]],[[9,5,4,5],2],[],[8,7,[9,2,0,6],[]]],[4,[[],[1],6]]]

[[4,[2,8,[3,7,4,6,5],[9]]],[[[],7],2,3,[3],[]],[]]
[[6,2,0],[],[[[],6]]]

[[[4,6],7],[[4,[6,5],9],7,0],[6,2,5],[8,[[10,2],0,6,[],[0,4]],[[8],10,7,[0,6]],[[7,1,9,3]]],[[[],10,1,[7,6,0]],8,8]]
[[2,[7],5],[],[0,[[0,5],0,[2,5,3,5,7],[10,3,3]],3,[],[10,10,[]]],[[[8,0,8,7],10,6,[9,4,6,1]],9],[[]]]

[[[]],[[8],[7,5,10],0],[1,[[3,10,2],[9,4,3,6],0,[3,0,7,7,2],[7,3,4,2,10]],[7,[3,1,8,9,4],0,7,2],[6,6,[10,7,2,7,9]],7],[[4,1,[10],[8,2,9,6,1]],0,[[8],[0,6,5,3,10],[1,8,0,0],5,7],8],[8]]
[[[[3,1,2,10,0],7],[[9,9,5,10],[4,2,3],8],6,[]],[10],[[[10]]],[[[9,5,0],[7]],10,[]],[[[8,9],1,1]]]

[[10,1,[0]]]
[[3,4,4],[5,[6]],[[1]],[3,[[9,1]],[[]]],[7,1]]

[[],[8,5,[[2,8,7],[3]],9,[1,[4,7,2,6,0],0]],[6],[[10,0,8,1]],[3,9,[7,[]],[[9,3],[0,0,8,7,1],10]]]
[[0],[5,10,10,[4,9,9,2,[4,7]]]]

[[9,3]]
[[[5,10,[5,1,10,6,5],10]],[],[[9,7,[2,5,7,9,5],[8,4,3,4,5],[3]],8,[[0,5],4,[9,6]],[]]]

[[[[5,6],[6,2],0]],[4,[[3,3,0],[]]],[[[]],9,2,6,4],[[[9],3,8,1],6,[6,3,10,6]],[[10,[1]],[9,9],2,4,[[3,3],6,[],[5,9,2,0,9]]]]
[[[[4,9],3,[9,4,10,7]],[[9,6,7],6,[2,4,3],5],6,1,[]],[3,8],[1]]

[9,3,1,1,2]
[9,3,1,1]

[[[],4,[4],[[9,2,4,1],[0],[4,7],[1,5,10]]],[8,[[2,3,4,4,1]],[]]]
[[8],[],[],[2,2,3,9],[9,3,[]]]

[[2],[10,8],[[[7,3,3,5,7],[]],10,1,[[0,3,0],[],[2,2],2,[3,7,1]],8],[]]
[[[10],[1,1,3,[9]],[1,4],[[],9],[8,3,[3]]],[[[9,4,8,7],9,4,[7,6,6,6]],7,4,[8,[1],4,4,8],2],[[[3,10,10],8,[5,9],[2,1,0,7,4]],[1,5,6,[10,7,10,7]],[],3,[[7],[6,7,5,2],0]]]

[[],[[6,8,4,8,[4,7,4,2]],8,[[3,5,2],[]],[0,9,[0,6,2,6,6]],8]]
[[8],[7,8,4],[5,2,[[5,2],0,[5,9]],[[10,2,4,7,4],7,0,[10,6],[3,6]],[5,4,8,8]]]

[[10,[[6]],[2],5,3]]
[[3,6,[0,7,[]]],[9,[]],[0,[[7,8,8,10,5],9,[]],[[7,7,10],3],[[5,4,4,0],8,1]],[[],[4]]]

[[],[[[]],[6,[],10],[],2,[[1],[10,10],[7,10]]]]
[[9,4,[[4,0,0,8,8],[6,10,3,10,0],8]]]

[[2,[3,[8,9,5]],[[],9,[]],9],[8,[],[[],8,3]],[[3,[8,2,4]],[[8,5,5,8,7],9,4],[[5,2,0],7,[],[7,5],3],10]]
[[[],[3,7],[[9,5,1],[3,9,3],5],[5],[3,9,[],[4,3,2],[8,8,8,8,7]]],[[],[6,4,[0,3,1]],[3,[1,4,4,5]]],[[9,[5,9,1,3,0],6,[]],9,1,[[5,2,7,3,9],4,4,7,[10,2,5,6]],8],[7,[],[[0,6],[8,6,8],5]]]

[[6,2,[[],0,[1]]],[[[2],[6,2,8,5,0],[6,6,5,3],[8,10,8,5,1],[]],[[],[10,2,7],[7,3,4],3],[[3],1],8],[8,[7],[],7],[[[0,4,5,3,0],[0,10]],7]]
[[[[6,9]],0,[1,[6,6,4,6,5],8],[2,6,0,[3]],[]],[[2,1],[8,2,8,3,6],5,10],[1,8],[1,8,1],[[10,[5,5,4,8,2],1,[]]]]

[[3,4],[[],4,[6,[9,10,10,9,0],[0,10,0],[2,2]],[9,[8,4,2,3,4],6,[9,10,1,2],[3,2,2,3,4]]],[[8]]]
[[9,[[]]],[],[2,[[0,4,8,7,7],[0,5]]],[]]

[[7,5,4],[[[],1,[]]],[7],[4],[[],2,[[],[9,1,2],10,[6,5,1],[8,9,8]]]]
[[[1,[10,2,3,0,3],9,0,5],4,[5,0,1,3,[5,2,1,9,10]],8],[[10],[[3,9,9,3,3]],9,10],[],[8,[],6,[8,9,10,8],[[4]]],[2,[9],2,[[10,5,8,2,9],[4,1,1,10],[3,3],[2,1,3],[6]]]]

[[5,[]],[],[[0,4,1],4,[],[]],[[[1,7,3]],4,3],[8,[[9],[0,4,4,2],[10,6,4],[3],4],[4,[],[]]]]
[[5,4,1,[10,2]]]

[[4,[]],[6,[[1,2,3,10,9],[5,0,2,2,2],1,5,[8,8,8,9,3]]],[[[4,1,0,5],3,[2,10,8,5],[1],[4,9,6,5]],7,8,[2,4],6],[6],[]]
[[[[1,9],[],[3,4,0]],[[6,1,6],0,4,8,5],6],[2,8],[[8,[7,10,5,0],9,[2,0,9,7,3]]]]

[[0,[5,[],0,[],4]],[[3,5,[0],[10,10,2,5]],[[1,5],[6],4,0]]]
[[[[3],[4,9,8,4,8],[]],6,[[3,5,6,9],5]],[[10,[3,7],[],[1,7,7,4,4],[3,9,4,1]],[0,1,5],4,7,[0,3]],[],[[],[[3,1,8,7]],[[9,9,10],[9,8,7,10],[9,2,0,5]]],[0,[[1,1,6],9,9,4]]]

[[[0,10],[],[],2,[]],[[],5,[10],10],[5],[4,[[2,2,0,3],[0,10,9,4,9],[8],[7,8,9,6,3]],[[0,4],[3],[0,8,10,3,8]]]]
[[1,[7],[6],7],[[],[1,[10],[3,1]],8],[[[9,1,8],2],0,10,3,3],[4,[[10,7,9],4],[6,10,10,2,9],4,[5]]]

[[5,[],[[8,7,6,4],3,[5,2]],7,[[7,3,1,5],[7,8,2,1]]],[4,1,8],[[10,5],10,[5],3],[[3,[1,9,10,9,0],9,[5],7],10,10,[[7,10,0,10]],[8,[3,9],5,[],10]],[[7,[9,6,6,9],7,7,[3,1,1]],10,4,[[]],6]]
[[7,[[6,4,5],10],6,[3,6,[8],[6,4,5],0],[[9,0,7,8,10],10,[4]]],[8,1,8,7],[[[],[0,1,0,2],0,[10,6,1,9],4],[[10,2,5,6,8]]],[]]

[[]]
[[[6,5,10,1,2],[6],3,5,1],[],[[9],7,[[],[5,3,8,3,6],0],5]]

[[[[1],[3],[7,3,2,9]],[[5,1,0,7],[],1],[]]]
[[],[[1],7,[8,[3,0],[0]],[1,[10,3,9],[],0]],[[]],[5,10],[[8,[5,10]],4,8]]

[[[2,3,[6],5],[[6,9],[9,2,2],[9,3,2,0],[6,5,9,3],[5]],0,[[8,8,7,5],[9],9],[]],[[9,8,10],[4],4,9,[8,[],10,2,5]],[5,[],0,2],[[]]]
[[8,[1],[6],0,10],[[8,[3],3],7,[[8,1],7,[10,2,0,1],[10,2],2]],[4]]

[[8,10,9],[[],4,[10,[7,7,7],[],6],[]],[4,8,5,7]]
[[[[9,1,1,8],5]],[[1,6,4,0,5],8],[],[[],5,[9,[]]]]

[[[3,3,6,0],2,9,[[3,6,10],[],7,[3],[8,1]]],[[[0,1,10,2,0],3,4,8],[],[[4],[10,10],[9],9],[0],5],[[],[0,1,1,[5,2,1]]],[1]]
[[[5,[2]],[1],3,3,6],[[[3,9],[8,10,4,3,4],10,[10]],6,[[6,9,2]],6,8],[[[],4,5,[10,6,0,2],[8,0,7,6,9]],[[6,8],8,5,6,[]]],[[[9],2],[9,[],[0,0,7,3,3],6],6,6,3]]

[[[1],10],[[],7],[[[]],7,[[1,3],[4,2,9,10,5]],[[4,1],1]],[[[10,3,5,6,4],10,3,[6,4],0],[2],8,[0,[8],6,[],[6,4,9]]]]
[[[3,2,9],[[3,0],10]],[[6,3],[[6,9,0],[6,9,10,6],[3,9],[7,4,8,5,9],[4,1,4,3,1]],[8],[6,8,[10],8]]]

[[7],[[],[],6],[[[7,8,5,6,5],8,[2,8],9,[4]],0]]
[[[],3,[[3,1],[1,5,4],[8,6,8,5],[5,7,4],[]],3,9],[6,1,[],[]],[[],5],[1,[5,6,[9],[0,2,6,3,7],[7,5,1,1]],[3,4],[[7,3],5,2]]]

[[10,[]]]
[[[[]],[4,[],[1,0,2,2]],[6,[],5,[1],[6,2,7]],[4,9]],[[4,[2,6,2,5,3],[1,8,10],10,[]],1,10,5],[[1,3,7],0]]

[[],[],[5,4,0,10,7],[2,[[],2,0,[7,4,7,7,10],[]],[]]]
[[[0,1],[],6,[10,4,[1,10,5],[8,5,7],7]],[2],[]]

[[],[8,[[],8,[3]],7,3],[1,0],[[],3,2,[]],[]]
[[[2,[8,9,10],[],[4,5,10,0,3]],6,[[]],8],[[10,[5,10,10],[0,3,2,0],8],[7,[8,9]],3,7,[[4,3,6,4,0],2,6]],[3,[5]]]

[[[[0,1,3,3],7,[9,9,1,5,0],2,9],[5,[5,9,1,2,3],1],6,[[10,0],[8,10,8,4],3],1]]
[[[0,7,[8,5,5,6,0],[],8],[]],[0,2,0,[9,1,[6,10,1,9,2],[0,7,10,1,7],9],10]]

[[[8],[[3,0,9],[10,0],1],[[6,3,7,5],[]]]]
[[[],1,[[8,2],[4],9],3,1],[]]

[[],[],[[2],[3],[[10],10,0,[4,1,7,2,10],9],2,[4,9,[4,6,6,1,2],9]]]
[[10]]

[[],[10,[5],[],[6,[2,4,4,8,9],[0,0,8,9],[8],4]],[5,[],7,3,[[5],[8,9,1],7,[9]]],[6,5]]
[[[3,[],[],[3],[6,1,4,4]],5,[],6],[[[6,6,2]],5,[5,5],7],[[[9,8,1,10,0],1,[2,10,0,9,6]],1,4,9]]

[[0],[[7]]]
[[[[0,4],[0]],[],[0,4,0,[5,4]],5],[[],[7,8,4,[7],[10,5]]],[1,1,[[],[],[3,0,1,3]],6],[[],[],7,7,8]]

[[[[1,10,0,1],[7],[2,0,6,3],[],[4,8,5,8,6]],7,[6,9]]]
[[2,0,[[8],1],6,[1,5]],[4],[],[1,9,9]]

[[2,[10,[9,3,6,2],[7],4,5]],[[],9,10],[[],2,[4,[0],[7,5,3,2]],8,10],[9,[1,4,2],[[3,5,6,4,0]]]]
[[3,[9],0,8],[[[7,3],[4,6,6],2,[],[2,5,10,3]]]]

[[[[6,10],4],[3,[6,10,8],[2],[0,2],[8,5,9,6]],7,3],[[[8,3,5]],[2,[10,7,1,4],5]],[[[7,1,7,8]],[2,[1,6,7,7,3]],10],[[10,4,[6],[],7]]]
[[1,[[10,5,2],[5]],0,[1,[7,1,4,9]],6],[],[[[4],[9,6,4]],[[5]]],[[[5,2],10,[10,5,10,9],[5,7]]]]

[[1,[4],4,2]]
[[],[8,[6],1,3],[[]],[[9,8],[[]]]]

[[[7,[],6,9,2],[5,[9],1,8]],[6],[10,1,4]]
[[[8],9,[6],[],0],[[0,4,[8,9],[],8],4,[7,3,[],[6]],[[]],[[],[1,2,7],[]]]]

[[4]]
[[1,[[6],7,5]],[7],[1,10,5],[7,8,[[3],[1,1,5,1],2],[],[7,2,[1,10,5,4],0]],[]]

[[[[]]],[0],[3,[5],9,8,[6,[8,5,2,4,10],[3,4,0],[7,2,4,5,5],[4,8,7,1,4]]],[10,[],[5,[3,6,6,7,3],5,6],7,[10,7,[]]]]
[[2,5,2,2,[[4,2,0,8],[8,7],[1],3]],[[],[[7,5,5,2],[10,2],5,0],[[],3,7,6,9]],[2,[7,[5,6],[5,0,1,8]],3],[[[0,1,4,8,1],[0,0,7,2,1],5,[7,8,0],[]]],[2]]

[[],[1,7,[[0,6]],[[6],[],8]],[2,9,8,8,2],[[[5,1],[8,10,6,4,1]],[],5,5],[1,7,0]]
[[],[8,[1,[2,4,4]]],[[[6,10,4,4,10],7,[3,10,8,3,2],6]],[[1,[10,7],6,1],10,[9,[2],[5,1,4]],[3]],[1,6,7,9,[[9,9,9,2],3]]]

[[[[2,1],[5,9,2],[0,8,5,2],4,[7]]],[3,[1,2,[],6],[7],[[],10],0],[9,8,7,2,7],[[[6,1,8,9]],[[9,6],[0,8,3],4]]]
[[0],[],[],[5,7]]

[[5,8],[[6,7,[2,0,1,4],[3,0,8,5,8],[]],8]]
[[5,8],[2,5,[],5,[[9,9,0],[8,0,3,5,5],[5],[4,9,0,0]]],[9,[],7,7,2],[5,[[],1,8,[10,6,0,10],5],[8,2],2],[6,4,[[9,5,2,0,9],10,7,[0,4,0,2,2],[4,5,0]],[1]]]

[[9],[2],[7,8,[8],7,[]],[[6,8,[7,8,5,3],[9,1,5]],5,8,2],[9,5,[[9,9,2],2]]]
[[],[[9,[6,6,6,0,5],8,5,10],7,[1,[],9,5],[[4,8]]],[[],3],[[[],1],8,[[3],[10,7,9],3,[],9],9,[6,[5,3,8,1,1],10,[]]],[3,5,4,[8,10,[0,4,5,1]]]]

[[],[],[7,[0,[0,6,6,9,4],[],[8,3]],3,7,10]]
[[[]],[10,3,10]]

[[4,[5]],[6,1,[[3],[7],[9,1],[0,4,4,10]]],[[[9],[],[3]]],[[[9,8,0],0,[]],2,5,[6,5,[4,7,4,6,2]]]]
[[1,9],[[[1,9,9,0,8],[8],[5,8,6]],5,4,[3,2,0],5],[2]]

[[5,[10],3]]
[[10,5,[3,6,4,5],7,0],[9,2,[7,[]],[7]],[4]]

[[[],[],[[],4,[5,4,7,9,9],5,3]]]
[[[[5],[],[5,9,6]],[[10,0],[3],2,6,1],6,[10,[5,8,5,3,1],6,[0],3]],[[9,2,9,3],[[7,7],9,[9,3,3,2,1]],[7,1,[2,6,2]],0,8]]

[[10],[3,6],[],[1,8,3,6,1],[0,[[],10,3,[10,8]],4]]
[[[[5,10,5,6],[4]],4,7,[[],[],5,4]],[[2,6,4,8],[]],[[[10,6],[4],[4,7,3]]]]

[[[3,[7,6]],[[8,8,0]],1],[1],[[],5,4,4],[[2,[4,10,2],[3,3,8,7,9],[6,2,5,8],1],[[10,4,1,4],1,[5,5,2,1],[9,9,3]],[2,[7,8,4],[5,1,1,2],[],3]]]
[[1,6,2,4],[1,[],8,[7,6,[5,4],10]],[0],[0,[8]],[[],4]]

[[[1],[0,9,[10,2,2],[6,9,9]]],[[1,[3,3,5,8,10],[],1],[],4],[[[0,2],5,[1],[],7]],[3,7,[]]]
[[8],[0,[7,6,2,[6,5,0]],[10,3,[],[1,6,4,4]],[6,[1,7,7],10,0],10],[9,[[5],[10,6,9,2],1,9],3],[[9,10,1,[10,9,3]],6,[0,[4,5,10],7],6]]

[[4,[3,[9,8,10,2,6],[7,7,2,5,0],[6,9,8,6]]],[4,7,[]],[[4,0,[0,10],7],[4,[6,7,8,7],[7,0,1,0,9]],4],[9,[[6],5,6,4]]]
[[9,7,[9]],[],[[[10,7,10],[1,9,5],[],[]],9],[[[3,9,2,1],8,[],[7,7,6,3],1],[[0,7],10,0],10,[10]],[[],[[8,4],0,[],[8,7,0]],[[9,3,6,0,4],9,[1,7,0,7,10],[]]]]

[[[8],8,4,9]]
[[],[9,8],[7,3,[],3]]

[[[[5],1,4,3],5,[[0,9],4,[5,10,6,2,3],8],[6,3]],[9,2,1,[3,[1],[],4]],[5,[[0,7,9,5],[1,4,0,5],3],[1]],[6,7],[1,10]]
[[[2],1,5,[9,[9,0,9],[],10]],[0,0],[0,[1,8]],[]]

[[3,[]],[1,[4,6,10,6],[8,[3,1],8,6]],[10,3]]
[[[2,4,8],7,[],[]],[4,[],2,[[3,5,4,7,9],[4,4,1]],[4,[0,9,6,5,8]]]]

[[0,[7],[2,[5,7]],6,[3]],[0,[],[3]]]
[[[8,[],[10,3,8],[3,1,2,10]],1,[9]],[[2,10,3,8,[3,1,5]]],[8]]

[[5]]
[[9,8,[[1,9,3,5],[9]],4,2],[7,5],[2,[1,[]]],[4,[[7,8],3,7,[3,2,6],[9,0,4]],9],[[[2,2,7],7],[[7],[2,2,9,10]]]]

[[6],[10,[[2,7,3,8],[5],8,9],[0],10],[[[1,5],[1,4,0,2],[10,8,9]]],[2]]
[[10,[],[5,[1,4,1],6],[[8,3,0,8],[2]]],[1,[[],[8],[]],10,9,10],[]]"""