package gcj.y2022.round1b

private fun solve(m: Int = 8) {
	fun ask(asked: Int): Int {
		println(asked.toString(2).padStart(m, '0'))
		return readInt()
	}
	val masks = 1 shl m
	fun rotate(mask: Int, shift: Int): Int {
		return (((mask shl m) or mask) shr shift) and (masks - 1)
	}
	val initOnes = ask(0)
	var ones = initOnes
	if (ones == 0) return; if (ones == m) { ask(masks - 1); return }
	val possible = BooleanArray(masks) { mask ->
		mask.countOneBits() == initOnes
	}
	val memo = mutableMapOf<Int, List<Int>>()
	while (true) {
		val possibleBefore = possible.count { it }
		var bestWorstGroup = masks + 1
		var bestTries: List<Int>? = null
		val id = possible.contentHashCode()
		if (id !in memo) {
			for (tried in 0 until masks / 2) /*for (tried2 in possible.indices)*/ {
				val receivable = mutableSetOf<Int>()
				for (secret in possible.indices) {
					if (!possible[secret]) continue
					for (shift in 0 until m) for (shift2 in 0 until m) {
						receivable.add(secret xor rotate(tried, shift) /*xor rotate(tried2, shift2)*/)
					}
				}
				val worstGroup = receivable.groupBy { it.countOneBits() }.maxOf { it.value.size }
				if (worstGroup < bestWorstGroup) {
					bestWorstGroup = worstGroup
					bestTries = listOf(tried/*, tried2*/)
				}
			}
			memo[id] = bestTries!!
		}
		bestTries = memo[id]!!
		if (ones % 2 == 0) bestTries = listOf(1)
		if (possibleBefore == m) {
			bestTries = listOf(1)
		}
		for (tried in bestTries) {
			val coincidence = ask(tried)
			ones = coincidence
			if (ones == 0) return; if (ones == m) { ask(masks - 1); return }
			val receivable = mutableSetOf<Int>()
			for (secret in possible.indices) {
				if (!possible[secret]) continue
				for (shift in 0 until m) {
					val new = secret xor rotate(tried, shift)
					if (new.countOneBits() == coincidence) receivable.add(new)
				}
			}
			for (mask in possible.indices) {
				possible[mask] = mask in receivable
			}
		}
	}
}

fun main() {
	repeat(readInt()) { solve() }
}

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

Compiled from "c_easy.kt"
public final class gcj.y2022.round1b.C_easyKt {
  private static final void solve(int);
    Code:
       0: iconst_1
       1: iload_0
       2: ishl
       3: istore_1
       4: iload_0
       5: iconst_0
       6: invokestatic  #10                 // Method solve$ask:(II)I
       9: istore_2
      10: iload_2
      11: istore_3
      12: iload_3
      13: ifne          17
      16: return
      17: iload_3
      18: iload_0
      19: if_icmpne     31
      22: iload_0
      23: iload_1
      24: iconst_1
      25: isub
      26: invokestatic  #10                 // Method solve$ask:(II)I
      29: pop
      30: return
      31: iconst_0
      32: istore        5
      34: iload_1
      35: newarray       boolean
      37: astore        6
      39: iload         5
      41: iload_1
      42: if_icmpge     74
      45: iload         5
      47: istore        7
      49: aload         6
      51: iload         7
      53: iload         7
      55: invokestatic  #16                 // Method java/lang/Integer.bitCount:(I)I
      58: iload_2
      59: if_icmpne     66
      62: iconst_1
      63: goto          67
      66: iconst_0
      67: bastore
      68: iinc          5, 1
      71: goto          39
      74: aload         6
      76: astore        4
      78: new           #18                 // class java/util/LinkedHashMap
      81: dup
      82: invokespecial #22                 // Method java/util/LinkedHashMap."<init>":()V
      85: checkcast     #24                 // class java/util/Map
      88: astore        5
      90: nop
      91: aload         4
      93: astore        7
      95: iconst_0
      96: istore        8
      98: iconst_0
      99: istore        9
     101: iconst_0
     102: istore        10
     104: aload         7
     106: arraylength
     107: istore        11
     109: iload         10
     111: iload         11
     113: if_icmpge     144
     116: aload         7
     118: iload         10
     120: baload
     121: istore        12
     123: iload         12
     125: istore        13
     127: iconst_0
     128: istore        14
     130: iload         13
     132: ifeq          138
     135: iinc          9, 1
     138: iinc          10, 1
     141: goto          109
     144: iload         9
     146: istore        6
     148: iload_1
     149: iconst_1
     150: iadd
     151: istore        7
     153: aconst_null
     154: astore        8
     156: aload         4
     158: invokestatic  #30                 // Method java/util/Arrays.hashCode:([Z)I
     161: istore        9
     163: iload         9
     165: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     168: aload         5
     170: swap
     171: invokeinterface #38,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     176: ifne          623
     179: iconst_0
     180: istore        10
     182: iload_1
     183: iconst_2
     184: idiv
     185: istore        11
     187: iload         10
     189: iload         11
     191: if_icmpge     600
     194: new           #40                 // class java/util/LinkedHashSet
     197: dup
     198: invokespecial #41                 // Method java/util/LinkedHashSet."<init>":()V
     201: checkcast     #43                 // class java/util/Set
     204: astore        12
     206: iconst_0
     207: istore        13
     209: aload         4
     211: arraylength
     212: istore        14
     214: iload         13
     216: iload         14
     218: if_icmpge     288
     221: aload         4
     223: iload         13
     225: baload
     226: ifeq          282
     229: iconst_0
     230: istore        15
     232: iload         15
     234: iload_0
     235: if_icmpge     282
     238: iconst_0
     239: istore        16
     241: iload         16
     243: iload_0
     244: if_icmpge     276
     247: aload         12
     249: iload         13
     251: iload_0
     252: iload_1
     253: iload         10
     255: iload         15
     257: invokestatic  #47                 // Method solve$rotate:(IIII)I
     260: ixor
     261: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     264: invokeinterface #50,  2           // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     269: pop
     270: iinc          16, 1
     273: goto          241
     276: iinc          15, 1
     279: goto          232
     282: iinc          13, 1
     285: goto          214
     288: aload         12
     290: checkcast     #52                 // class java/lang/Iterable
     293: astore        14
     295: iconst_0
     296: istore        15
     298: aload         14
     300: astore        16
     302: new           #18                 // class java/util/LinkedHashMap
     305: dup
     306: invokespecial #22                 // Method java/util/LinkedHashMap."<init>":()V
     309: checkcast     #24                 // class java/util/Map
     312: astore        17
     314: iconst_0
     315: istore        18
     317: aload         16
     319: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     324: astore        19
     326: aload         19
     328: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     333: ifeq          445
     336: aload         19
     338: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     343: astore        20
     345: aload         20
     347: checkcast     #68                 // class java/lang/Number
     350: invokevirtual #72                 // Method java/lang/Number.intValue:()I
     353: istore        21
     355: iconst_0
     356: istore        22
     358: iload         21
     360: invokestatic  #16                 // Method java/lang/Integer.bitCount:(I)I
     363: nop
     364: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     367: astore        23
     369: aload         17
     371: astore        24
     373: iconst_0
     374: istore        25
     376: aload         24
     378: aload         23
     380: invokeinterface #76,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     385: astore        26
     387: aload         26
     389: ifnonnull     424
     392: iconst_0
     393: istore        27
     395: new           #78                 // class java/util/ArrayList
     398: dup
     399: invokespecial #79                 // Method java/util/ArrayList."<init>":()V
     402: checkcast     #81                 // class java/util/List
     405: astore        27
     407: aload         24
     409: aload         23
     411: aload         27
     413: invokeinterface #85,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     418: pop
     419: aload         27
     421: goto          426
     424: aload         26
     426: nop
     427: checkcast     #81                 // class java/util/List
     430: astore        21
     432: aload         21
     434: aload         20
     436: invokeinterface #86,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     441: pop
     442: goto          326
     445: aload         17
     447: nop
     448: invokeinterface #90,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     453: checkcast     #52                 // class java/lang/Iterable
     456: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     461: astore        15
     463: aload         15
     465: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     470: ifne          481
     473: new           #92                 // class java/util/NoSuchElementException
     476: dup
     477: invokespecial #93                 // Method java/util/NoSuchElementException."<init>":()V
     480: athrow
     481: aload         15
     483: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     488: checkcast     #95                 // class java/util/Map$Entry
     491: astore        16
     493: iconst_0
     494: istore        17
     496: aload         16
     498: invokeinterface #98,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     503: checkcast     #81                 // class java/util/List
     506: invokeinterface #101,  1          // InterfaceMethod java/util/List.size:()I
     511: istore        16
     513: aload         15
     515: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     520: ifeq          569
     523: aload         15
     525: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     530: checkcast     #95                 // class java/util/Map$Entry
     533: astore        17
     535: iconst_0
     536: istore        18
     538: aload         17
     540: invokeinterface #98,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     545: checkcast     #81                 // class java/util/List
     548: invokeinterface #101,  1          // InterfaceMethod java/util/List.size:()I
     553: istore        17
     555: iload         16
     557: iload         17
     559: if_icmpge     513
     562: iload         17
     564: istore        16
     566: goto          513
     569: iload         16
     571: istore        13
     573: iload         13
     575: iload         7
     577: if_icmpge     594
     580: iload         13
     582: istore        7
     584: iload         10
     586: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     589: invokestatic  #107                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     592: astore        8
     594: iinc          10, 1
     597: goto          187
     600: iload         9
     602: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     605: astore        11
     607: aload         5
     609: aload         11
     611: aload         8
     613: dup
     614: invokestatic  #113                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     617: invokeinterface #85,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     622: pop
     623: aload         5
     625: iload         9
     627: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     630: invokeinterface #76,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     635: dup
     636: invokestatic  #113                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     639: checkcast     #81                 // class java/util/List
     642: astore        8
     644: iload_3
     645: iconst_2
     646: irem
     647: ifne          659
     650: iconst_1
     651: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     654: invokestatic  #107                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     657: astore        8
     659: iload         6
     661: iload_0
     662: if_icmpne     674
     665: iconst_1
     666: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     669: invokestatic  #107                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     672: astore        8
     674: aload         8
     676: invokeinterface #114,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     681: astore        10
     683: aload         10
     685: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     690: ifeq          90
     693: aload         10
     695: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     700: checkcast     #68                 // class java/lang/Number
     703: invokevirtual #72                 // Method java/lang/Number.intValue:()I
     706: istore        11
     708: iload_0
     709: iload         11
     711: invokestatic  #10                 // Method solve$ask:(II)I
     714: istore        12
     716: iload         12
     718: istore_3
     719: iload_3
     720: ifne          724
     723: return
     724: iload_3
     725: iload_0
     726: if_icmpne     738
     729: iload_0
     730: iload_1
     731: iconst_1
     732: isub
     733: invokestatic  #10                 // Method solve$ask:(II)I
     736: pop
     737: return
     738: new           #40                 // class java/util/LinkedHashSet
     741: dup
     742: invokespecial #41                 // Method java/util/LinkedHashSet."<init>":()V
     745: checkcast     #43                 // class java/util/Set
     748: astore        13
     750: iconst_0
     751: istore        14
     753: aload         4
     755: arraylength
     756: istore        15
     758: iload         14
     760: iload         15
     762: if_icmpge     831
     765: aload         4
     767: iload         14
     769: baload
     770: ifeq          825
     773: iconst_0
     774: istore        16
     776: iload         16
     778: iload_0
     779: if_icmpge     825
     782: iload         14
     784: iload_0
     785: iload_1
     786: iload         11
     788: iload         16
     790: invokestatic  #47                 // Method solve$rotate:(IIII)I
     793: ixor
     794: istore        17
     796: iload         17
     798: invokestatic  #16                 // Method java/lang/Integer.bitCount:(I)I
     801: iload         12
     803: if_icmpne     819
     806: aload         13
     808: iload         17
     810: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     813: invokeinterface #50,  2           // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     818: pop
     819: iinc          16, 1
     822: goto          776
     825: iinc          14, 1
     828: goto          758
     831: iconst_0
     832: istore        14
     834: aload         4
     836: arraylength
     837: istore        15
     839: iload         14
     841: iload         15
     843: if_icmpge     683
     846: aload         4
     848: iload         14
     850: aload         13
     852: iload         14
     854: invokestatic  #34                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     857: invokeinterface #117,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     862: bastore
     863: iinc          14, 1
     866: goto          839

  static void solve$default(int, int, java.lang.Object);
    Code:
       0: iload_1
       1: iconst_1
       2: iand
       3: ifeq          9
       6: bipush        8
       8: istore_0
       9: iload_0
      10: invokestatic  #171                // Method solve:(I)V
      13: return

  public static final void main();
    Code:
       0: invokestatic  #175                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     27
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: iconst_0
      16: iconst_1
      17: aconst_null
      18: invokestatic  #177                // Method solve$default:(IILjava/lang/Object;)V
      21: iinc          1, 1
      24: goto          6
      27: return

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

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

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

  private static final int solve$ask(int, int);
    Code:
       0: iload_1
       1: iconst_2
       2: invokestatic  #201                // Method kotlin/text/CharsKt.checkRadix:(I)I
       5: invokestatic  #205                // Method java/lang/Integer.toString:(II)Ljava/lang/String;
       8: dup
       9: ldc           #207                // String toString(...)
      11: invokestatic  #211                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      14: iload_0
      15: bipush        48
      17: invokestatic  #217                // Method kotlin/text/StringsKt.padStart:(Ljava/lang/String;IC)Ljava/lang/String;
      20: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
      23: swap
      24: invokevirtual #228                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      27: invokestatic  #175                // Method readInt:()I
      30: ireturn

  private static final int solve$rotate(int, int, int, int);
    Code:
       0: iload_2
       1: iload_0
       2: ishl
       3: iload_2
       4: ior
       5: iload_3
       6: ishr
       7: iload_1
       8: iconst_1
       9: isub
      10: iand
      11: ireturn
}


package gcj.y2022.round1b

import kotlin.math.abs

private fun solve(): Long {
	val (n, _) = readInts()
	val lists = List(n) { readInts() }
	var pLow = 0
	var pHigh = 0
	var costLow = 0L
	var costHigh = 0L
	for (list in lists) {
		val pLowNew = list.minOrNull()!!
		val pHighNew = list.maxOrNull()!!
		val costLowNew = minOf(costLow + abs(pLow - pHighNew), costHigh + abs(pHigh - pHighNew)) + pHighNew - pLowNew
		val costHighNew = minOf(costLow + abs(pLow - pLowNew), costHigh + abs(pHigh - pLowNew)) + pHighNew - pLowNew
		pLow = pLowNew; pHigh = pHighNew; costLow = costLowNew; costHigh = costHighNew
	}
	return minOf(costLow, costHigh)
}

fun main() {
	repeat(readInt()) { println("Case #${it + 1}: ${solve()}") }
}

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

Compiled from "b.kt"
public final class gcj.y2022.round1b.BKt {
  private static final long solve();
    Code:
       0: invokestatic  #10                 // Method readInts:()Ljava/util/List;
       3: iconst_0
       4: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       9: checkcast     #18                 // class java/lang/Number
      12: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      15: istore_0
      16: new           #24                 // class java/util/ArrayList
      19: dup
      20: iload_0
      21: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      24: astore_2
      25: iconst_0
      26: istore_3
      27: iload_3
      28: iload_0
      29: if_icmpge     61
      32: iload_3
      33: istore        4
      35: aload_2
      36: iload         4
      38: istore        5
      40: astore        16
      42: iconst_0
      43: istore        6
      45: invokestatic  #10                 // Method readInts:()Ljava/util/List;
      48: aload         16
      50: swap
      51: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      54: pop
      55: iinc          3, 1
      58: goto          27
      61: aload_2
      62: checkcast     #12                 // class java/util/List
      65: astore_1
      66: iconst_0
      67: istore_2
      68: iconst_0
      69: istore_3
      70: lconst_0
      71: lstore        4
      73: lconst_0
      74: lstore        6
      76: aload_1
      77: invokeinterface #36,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      82: astore        8
      84: aload         8
      86: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      91: ifeq          233
      94: aload         8
      96: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     101: checkcast     #12                 // class java/util/List
     104: astore        9
     106: aload         9
     108: checkcast     #48                 // class java/lang/Iterable
     111: invokestatic  #54                 // Method kotlin/collections/CollectionsKt.minOrNull:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     114: dup
     115: invokestatic  #60                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     118: checkcast     #18                 // class java/lang/Number
     121: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     124: istore        10
     126: aload         9
     128: checkcast     #48                 // class java/lang/Iterable
     131: invokestatic  #63                 // Method kotlin/collections/CollectionsKt.maxOrNull:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     134: dup
     135: invokestatic  #60                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     138: checkcast     #18                 // class java/lang/Number
     141: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     144: istore        11
     146: lload         4
     148: iload_2
     149: iload         11
     151: isub
     152: invokestatic  #69                 // Method java/lang/Math.abs:(I)I
     155: i2l
     156: ladd
     157: lload         6
     159: iload_3
     160: iload         11
     162: isub
     163: invokestatic  #69                 // Method java/lang/Math.abs:(I)I
     166: i2l
     167: ladd
     168: invokestatic  #73                 // Method java/lang/Math.min:(JJ)J
     171: iload         11
     173: i2l
     174: ladd
     175: iload         10
     177: i2l
     178: lsub
     179: lstore        12
     181: lload         4
     183: iload_2
     184: iload         10
     186: isub
     187: invokestatic  #69                 // Method java/lang/Math.abs:(I)I
     190: i2l
     191: ladd
     192: lload         6
     194: iload_3
     195: iload         10
     197: isub
     198: invokestatic  #69                 // Method java/lang/Math.abs:(I)I
     201: i2l
     202: ladd
     203: invokestatic  #73                 // Method java/lang/Math.min:(JJ)J
     206: iload         11
     208: i2l
     209: ladd
     210: iload         10
     212: i2l
     213: lsub
     214: lstore        14
     216: iload         10
     218: istore_2
     219: iload         11
     221: istore_3
     222: lload         12
     224: lstore        4
     226: lload         14
     228: lstore        6
     230: goto          84
     233: lload         4
     235: lload         6
     237: invokestatic  #73                 // Method java/lang/Math.min:(JJ)J
     240: lreturn

  public static final void main();
    Code:
       0: invokestatic  #94                 // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     61
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: new           #96                 // class java/lang/StringBuilder
      18: dup
      19: invokespecial #98                 // Method java/lang/StringBuilder."<init>":()V
      22: ldc           #100                // String Case #
      24: invokevirtual #104                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: iload_2
      28: iconst_1
      29: iadd
      30: invokevirtual #107                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      33: ldc           #109                // String :
      35: invokevirtual #104                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: invokestatic  #111                // Method solve:()J
      41: invokevirtual #114                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      44: invokevirtual #118                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      47: getstatic     #124                // Field java/lang/System.out:Ljava/io/PrintStream;
      50: swap
      51: invokevirtual #129                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      54: nop
      55: iinc          1, 1
      58: goto          6
      61: return

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

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

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

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

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


package gcj.y2023.farewell_d

import kotlin.random.Random

fun generate(n: Int, m: Int): MutableList<Pair<Int, Int>> {
	var toAdd = m
	val list = mutableListOf<Pair<Int, Int>>()
	fun addEdge(v: Int, u: Int) {
		toAdd--
		list.add(v to u)
	}
	for (i in 0 until n) {
		addEdge(i, (i + 1) % n)
	}
	for (i in 2 until n) {
//		val canAdd = i - 1
//		if (canAdd >= toAdd) {
//			for (j in 0..i - 2) addEdge(i, j)
//			continue
//		}
		for (j in i - 2 downTo 0) {
			if (toAdd == 0) break
			addEdge(i, j)
		}
	}
	return list
}

private fun solve(nei: List<MutableList<Int>>): MutableList<Int> {
	val n = nei.size
	val s = nei.indices.minBy { nei[it].size }
	val used = BooleanArray(n)
	val path = mutableListOf(s)
	used[s] = true
	fun grow() {
		while (nei[path.last()].size == 2) {
			val v = nei[path.last()].firstOrNull { !used[it] } ?: break
			path.add(v)
			used[v] = true
		}
	}
	grow()
	path.reverse()
	grow()
	fun grow2() {
		while (path.size < n) {
			val v = nei[path.last()].firstOrNull { !used[it] } ?: error("")
			path.add(v)
			used[v] = true
		}
	}
//	if (nei[path.last()].size < nei[path.first()].size) path.reverse()
	grow2()
//	for (i in path.indices) if (!nei[path[i]].contains(path[(i + 1) % n])) {
//		System.setOut(java.io.PrintStream("shit.txt"))
//		println(nei)
//		println(path)
//		println()
//		for (i in 0 until n) for (j in 0 until i) if (nei[i].contains(j)) println("${i + 1} ${j + 1}")
//		System.out.flush()
//		System.exit(1)
//	}
	return path
}

private fun solve() {
	val (n, m) = readInts()
	val generated = generate(n, m)
	println(generated.joinToString("\n") { "${it.first + 1} ${it.second + 1}" })

	val nei = List(n) { mutableListOf<Int>() }
	fun addEdge(v: Int, u: Int) {
		nei[v].add(u); nei[u].add(v)
	}
	repeat(m) {
		val (u, v) = readInts().map { it - 1 }
		addEdge(u, v)
	}

	val path = solve(nei)
	println(path.map { it + 1 }.joinToString(" "))
}

fun main() {
	repeat(readInt()) { solve() }
//	research(6, 10, 10000)
//	for (n in 3..20) for (m in n..n * (n - 1) / 2) research(n, m)
//	for (n in 1000..1000) for (m in n..n+10) research(n, m)
}

fun research(n: Int, m: Int, times: Int = 100) {
	val graph = generate(n, m)
	repeat(times) {
		val random = Random(it)
		val p = (0 until n).toList().shuffled(random)
		println("//" + p)

		val nei = List(n) { mutableListOf<Int>() }
		fun addEdge(v: Int, u: Int) {
			nei[v].add(u); nei[u].add(v)
		}

		for (edge in graph) {
			addEdge(p[edge.first], p[edge.second])
		}

		val path = solve(nei)
		require(path.size == n)
		require(path.toSet() == (0 until n).toSet())
		for (i in path.indices) require(nei[path[i]].contains(path[(i + 1) % n]))
		println(path.map { it + 1 }.joinToString(" "))
	}
}

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

Compiled from "e_to_upsolve.kt"
public final class gcj.y2023.farewell_d.E_to_upsolveKt {
  public static final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>> generate(int, int);
    Code:
       0: new           #10                 // class kotlin/jvm/internal/Ref$IntRef
       3: dup
       4: invokespecial #14                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
       7: astore_2
       8: aload_2
       9: iload_1
      10: putfield      #18                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      13: new           #20                 // class java/util/ArrayList
      16: dup
      17: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
      20: checkcast     #23                 // class java/util/List
      23: astore_3
      24: iconst_0
      25: istore        4
      27: iload         4
      29: iload_0
      30: if_icmpge     52
      33: aload_2
      34: aload_3
      35: iload         4
      37: iload         4
      39: iconst_1
      40: iadd
      41: iload_0
      42: irem
      43: invokestatic  #27                 // Method generate$addEdge:(Lkotlin/jvm/internal/Ref$IntRef;Ljava/util/List;II)V
      46: iinc          4, 1
      49: goto          27
      52: iconst_2
      53: istore        4
      55: iload         4
      57: iload_0
      58: if_icmpge     101
      61: iload         4
      63: iconst_2
      64: isub
      65: istore        5
      67: iconst_m1
      68: iload         5
      70: if_icmpge     95
      73: aload_2
      74: getfield      #18                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      77: ifeq          95
      80: aload_2
      81: aload_3
      82: iload         4
      84: iload         5
      86: invokestatic  #27                 // Method generate$addEdge:(Lkotlin/jvm/internal/Ref$IntRef;Ljava/util/List;II)V
      89: iinc          5, -1
      92: goto          67
      95: iinc          4, 1
      98: goto          55
     101: aload_3
     102: areturn

  private static final java.util.List<java.lang.Integer> solve(java.util.List<? extends java.util.List<java.lang.Integer>>);
    Code:
       0: aload_0
       1: invokeinterface #42,  1           // InterfaceMethod java/util/List.size:()I
       6: istore_1
       7: aload_0
       8: checkcast     #44                 // class java/util/Collection
      11: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
      14: checkcast     #52                 // class java/lang/Iterable
      17: astore_3
      18: iconst_0
      19: istore        4
      21: aload_3
      22: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      27: astore        5
      29: aload         5
      31: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifne          47
      39: new           #64                 // class java/util/NoSuchElementException
      42: dup
      43: invokespecial #65                 // Method java/util/NoSuchElementException."<init>":()V
      46: athrow
      47: aload         5
      49: checkcast     #67                 // class kotlin/collections/IntIterator
      52: invokevirtual #70                 // Method kotlin/collections/IntIterator.nextInt:()I
      55: istore        6
      57: aload         5
      59: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      64: ifne          72
      67: iload         6
      69: goto          159
      72: iload         6
      74: istore        7
      76: iconst_0
      77: istore        8
      79: aload_0
      80: iload         7
      82: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      87: checkcast     #23                 // class java/util/List
      90: invokeinterface #42,  1           // InterfaceMethod java/util/List.size:()I
      95: istore        7
      97: aload         5
      99: checkcast     #67                 // class kotlin/collections/IntIterator
     102: invokevirtual #70                 // Method kotlin/collections/IntIterator.nextInt:()I
     105: istore        8
     107: iload         8
     109: istore        9
     111: iconst_0
     112: istore        10
     114: aload_0
     115: iload         9
     117: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     122: checkcast     #23                 // class java/util/List
     125: invokeinterface #42,  1           // InterfaceMethod java/util/List.size:()I
     130: istore        9
     132: iload         7
     134: iload         9
     136: if_icmple     147
     139: iload         8
     141: istore        6
     143: iload         9
     145: istore        7
     147: aload         5
     149: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     154: ifne          97
     157: iload         6
     159: istore_2
     160: iload_1
     161: newarray       boolean
     163: astore_3
     164: iconst_1
     165: anewarray     #76                 // class java/lang/Integer
     168: astore        5
     170: aload         5
     172: iconst_0
     173: iload_2
     174: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     177: aastore
     178: aload         5
     180: invokestatic  #84                 // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
     183: astore        4
     185: aload_3
     186: iload_2
     187: iconst_1
     188: bastore
     189: aload_0
     190: aload         4
     192: aload_3
     193: invokestatic  #88                 // Method solve$grow:(Ljava/util/List;Ljava/util/List;[Z)V
     196: aload         4
     198: invokestatic  #92                 // Method kotlin/collections/CollectionsKt.reverse:(Ljava/util/List;)V
     201: aload_0
     202: aload         4
     204: aload_3
     205: invokestatic  #88                 // Method solve$grow:(Ljava/util/List;Ljava/util/List;[Z)V
     208: aload         4
     210: iload_1
     211: aload_0
     212: aload_3
     213: invokestatic  #96                 // Method solve$grow2:(Ljava/util/List;ILjava/util/List;[Z)V
     216: aload         4
     218: areturn

  private static final void solve();
    Code:
       0: invokestatic  #116                // Method readInts:()Ljava/util/List;
       3: astore_0
       4: aload_0
       5: iconst_0
       6: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      11: checkcast     #118                // class java/lang/Number
      14: invokevirtual #121                // Method java/lang/Number.intValue:()I
      17: istore_1
      18: aload_0
      19: iconst_1
      20: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      25: checkcast     #118                // class java/lang/Number
      28: invokevirtual #121                // Method java/lang/Number.intValue:()I
      31: istore_2
      32: iload_1
      33: iload_2
      34: invokestatic  #123                // Method generate:(II)Ljava/util/List;
      37: astore_3
      38: aload_3
      39: checkcast     #52                 // class java/lang/Iterable
      42: ldc           #125                // String \n
      44: checkcast     #127                // class java/lang/CharSequence
      47: aconst_null
      48: aconst_null
      49: iconst_0
      50: aconst_null
      51: invokedynamic #146,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      56: bipush        30
      58: aconst_null
      59: invokestatic  #150                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      62: getstatic     #156                // Field java/lang/System.out:Ljava/io/PrintStream;
      65: swap
      66: invokevirtual #162                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      69: new           #20                 // class java/util/ArrayList
      72: dup
      73: iload_1
      74: invokespecial #165                // Method java/util/ArrayList."<init>":(I)V
      77: astore        5
      79: iconst_0
      80: istore        6
      82: iload         6
      84: iload_1
      85: if_icmpge     127
      88: iload         6
      90: istore        7
      92: aload         5
      94: iload         7
      96: istore        8
      98: astore        19
     100: iconst_0
     101: istore        9
     103: new           #20                 // class java/util/ArrayList
     106: dup
     107: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
     110: checkcast     #23                 // class java/util/List
     113: nop
     114: aload         19
     116: swap
     117: invokevirtual #169                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     120: pop
     121: iinc          6, 1
     124: goto          82
     127: aload         5
     129: checkcast     #23                 // class java/util/List
     132: astore        4
     134: iconst_0
     135: istore        5
     137: iload         5
     139: iload_2
     140: if_icmpge     307
     143: iload         5
     145: istore        6
     147: iconst_0
     148: istore        7
     150: invokestatic  #116                // Method readInts:()Ljava/util/List;
     153: checkcast     #52                 // class java/lang/Iterable
     156: astore        8
     158: iconst_0
     159: istore        9
     161: aload         8
     163: astore        10
     165: new           #20                 // class java/util/ArrayList
     168: dup
     169: aload         8
     171: bipush        10
     173: invokestatic  #173                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     176: invokespecial #165                // Method java/util/ArrayList."<init>":(I)V
     179: checkcast     #44                 // class java/util/Collection
     182: astore        11
     184: iconst_0
     185: istore        12
     187: aload         10
     189: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     194: astore        13
     196: aload         13
     198: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     203: ifeq          251
     206: aload         13
     208: invokeinterface #177,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     213: astore        14
     215: aload         11
     217: aload         14
     219: checkcast     #118                // class java/lang/Number
     222: invokevirtual #121                // Method java/lang/Number.intValue:()I
     225: istore        15
     227: astore        16
     229: iconst_0
     230: istore        17
     232: iload         15
     234: iconst_1
     235: isub
     236: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     239: aload         16
     241: swap
     242: invokeinterface #178,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     247: pop
     248: goto          196
     251: aload         11
     253: checkcast     #23                 // class java/util/List
     256: nop
     257: astore        18
     259: aload         18
     261: iconst_0
     262: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     267: checkcast     #118                // class java/lang/Number
     270: invokevirtual #121                // Method java/lang/Number.intValue:()I
     273: istore        8
     275: aload         18
     277: iconst_1
     278: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     283: checkcast     #118                // class java/lang/Number
     286: invokevirtual #121                // Method java/lang/Number.intValue:()I
     289: istore        9
     291: aload         4
     293: iload         8
     295: iload         9
     297: invokestatic  #182                // Method solve$addEdge$5:(Ljava/util/List;II)V
     300: nop
     301: iinc          5, 1
     304: goto          137
     307: aload         4
     309: invokestatic  #184                // Method solve:(Ljava/util/List;)Ljava/util/List;
     312: astore        5
     314: aload         5
     316: checkcast     #52                 // class java/lang/Iterable
     319: astore        6
     321: iconst_0
     322: istore        7
     324: aload         6
     326: astore        8
     328: new           #20                 // class java/util/ArrayList
     331: dup
     332: aload         6
     334: bipush        10
     336: invokestatic  #173                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     339: invokespecial #165                // Method java/util/ArrayList."<init>":(I)V
     342: checkcast     #44                 // class java/util/Collection
     345: astore        9
     347: iconst_0
     348: istore        10
     350: aload         8
     352: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     357: astore        11
     359: aload         11
     361: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     366: ifeq          414
     369: aload         11
     371: invokeinterface #177,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     376: astore        12
     378: aload         9
     380: aload         12
     382: checkcast     #118                // class java/lang/Number
     385: invokevirtual #121                // Method java/lang/Number.intValue:()I
     388: istore        13
     390: astore        19
     392: iconst_0
     393: istore        14
     395: iload         13
     397: iconst_1
     398: iadd
     399: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     402: aload         19
     404: swap
     405: invokeinterface #178,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     410: pop
     411: goto          359
     414: aload         9
     416: checkcast     #23                 // class java/util/List
     419: nop
     420: checkcast     #52                 // class java/lang/Iterable
     423: ldc           #186                // String
     425: checkcast     #127                // class java/lang/CharSequence
     428: aconst_null
     429: aconst_null
     430: iconst_0
     431: aconst_null
     432: aconst_null
     433: bipush        62
     435: aconst_null
     436: invokestatic  #150                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     439: getstatic     #156                // Field java/lang/System.out:Ljava/io/PrintStream;
     442: swap
     443: invokevirtual #162                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     446: return

  public static final void main();
    Code:
       0: invokestatic  #205                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     24
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: invokestatic  #207                // Method solve:()V
      18: iinc          1, 1
      21: goto          6
      24: return

  public static final void research(int, int, int);
    Code:
       0: iload_0
       1: iload_1
       2: invokestatic  #123                // Method generate:(II)Ljava/util/List;
       5: astore_3
       6: iconst_0
       7: istore        4
       9: iload         4
      11: iload_2
      12: if_icmpge     546
      15: iload         4
      17: istore        5
      19: iconst_0
      20: istore        6
      22: iload         5
      24: invokestatic  #216                // Method kotlin/random/RandomKt.Random:(I)Lkotlin/random/Random;
      27: astore        7
      29: iconst_0
      30: iload_0
      31: invokestatic  #222                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      34: checkcast     #52                 // class java/lang/Iterable
      37: invokestatic  #226                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
      40: checkcast     #52                 // class java/lang/Iterable
      43: aload         7
      45: invokestatic  #230                // Method kotlin/collections/CollectionsKt.shuffled:(Ljava/lang/Iterable;Lkotlin/random/Random;)Ljava/util/List;
      48: astore        8
      50: new           #232                // class java/lang/StringBuilder
      53: dup
      54: invokespecial #233                // Method java/lang/StringBuilder."<init>":()V
      57: ldc           #235                // String //
      59: invokevirtual #239                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      62: aload         8
      64: invokevirtual #242                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      67: invokevirtual #246                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      70: getstatic     #156                // Field java/lang/System.out:Ljava/io/PrintStream;
      73: swap
      74: invokevirtual #162                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      77: new           #20                 // class java/util/ArrayList
      80: dup
      81: iload_0
      82: invokespecial #165                // Method java/util/ArrayList."<init>":(I)V
      85: astore        9
      87: iconst_0
      88: istore        10
      90: iload         10
      92: iload_0
      93: if_icmpge     135
      96: iload         10
      98: istore        11
     100: aload         9
     102: iload         11
     104: istore        12
     106: astore        13
     108: iconst_0
     109: istore        14
     111: new           #20                 // class java/util/ArrayList
     114: dup
     115: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
     118: checkcast     #23                 // class java/util/List
     121: nop
     122: aload         13
     124: swap
     125: invokevirtual #169                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     128: pop
     129: iinc          10, 1
     132: goto          90
     135: aload         9
     137: checkcast     #23                 // class java/util/List
     140: astore        15
     142: aload_3
     143: invokeinterface #247,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     148: astore        9
     150: aload         9
     152: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     157: ifeq          228
     160: aload         9
     162: invokeinterface #177,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     167: checkcast     #249                // class kotlin/Pair
     170: astore        10
     172: aload         15
     174: aload         8
     176: aload         10
     178: invokevirtual #252                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     181: checkcast     #118                // class java/lang/Number
     184: invokevirtual #121                // Method java/lang/Number.intValue:()I
     187: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     192: checkcast     #118                // class java/lang/Number
     195: invokevirtual #121                // Method java/lang/Number.intValue:()I
     198: aload         8
     200: aload         10
     202: invokevirtual #255                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     205: checkcast     #118                // class java/lang/Number
     208: invokevirtual #121                // Method java/lang/Number.intValue:()I
     211: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     216: checkcast     #118                // class java/lang/Number
     219: invokevirtual #121                // Method java/lang/Number.intValue:()I
     222: invokestatic  #258                // Method research$lambda$13$addEdge$11:(Ljava/util/List;II)V
     225: goto          150
     228: aload         15
     230: invokestatic  #184                // Method solve:(Ljava/util/List;)Ljava/util/List;
     233: astore        9
     235: aload         9
     237: invokeinterface #42,  1           // InterfaceMethod java/util/List.size:()I
     242: iload_0
     243: if_icmpne     250
     246: iconst_1
     247: goto          251
     250: iconst_0
     251: ifne          272
     254: ldc_w         #260                // String Failed requirement.
     257: astore        11
     259: new           #262                // class java/lang/IllegalArgumentException
     262: dup
     263: aload         11
     265: invokevirtual #263                // Method java/lang/Object.toString:()Ljava/lang/String;
     268: invokespecial #266                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     271: athrow
     272: aload         9
     274: checkcast     #52                 // class java/lang/Iterable
     277: invokestatic  #270                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     280: iconst_0
     281: iload_0
     282: invokestatic  #222                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     285: checkcast     #52                 // class java/lang/Iterable
     288: invokestatic  #270                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     291: invokestatic  #276                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     294: ifne          315
     297: ldc_w         #260                // String Failed requirement.
     300: astore        11
     302: new           #262                // class java/lang/IllegalArgumentException
     305: dup
     306: aload         11
     308: invokevirtual #263                // Method java/lang/Object.toString:()Ljava/lang/String;
     311: invokespecial #266                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     314: athrow
     315: iconst_0
     316: istore        10
     318: aload         9
     320: checkcast     #44                 // class java/util/Collection
     323: invokeinterface #277,  1          // InterfaceMethod java/util/Collection.size:()I
     328: istore        11
     330: iload         10
     332: iload         11
     334: if_icmpge     407
     337: aload         15
     339: aload         9
     341: iload         10
     343: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     348: checkcast     #118                // class java/lang/Number
     351: invokevirtual #121                // Method java/lang/Number.intValue:()I
     354: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     359: checkcast     #23                 // class java/util/List
     362: aload         9
     364: iload         10
     366: iconst_1
     367: iadd
     368: iload_0
     369: irem
     370: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     375: invokeinterface #280,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     380: ifne          401
     383: ldc_w         #260                // String Failed requirement.
     386: astore        14
     388: new           #262                // class java/lang/IllegalArgumentException
     391: dup
     392: aload         14
     394: invokevirtual #263                // Method java/lang/Object.toString:()Ljava/lang/String;
     397: invokespecial #266                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     400: athrow
     401: iinc          10, 1
     404: goto          330
     407: aload         9
     409: checkcast     #52                 // class java/lang/Iterable
     412: astore        10
     414: iconst_0
     415: istore        11
     417: aload         10
     419: astore        12
     421: new           #20                 // class java/util/ArrayList
     424: dup
     425: aload         10
     427: bipush        10
     429: invokestatic  #173                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     432: invokespecial #165                // Method java/util/ArrayList."<init>":(I)V
     435: checkcast     #44                 // class java/util/Collection
     438: astore        14
     440: iconst_0
     441: istore        16
     443: aload         12
     445: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     450: astore        17
     452: aload         17
     454: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     459: ifeq          507
     462: aload         17
     464: invokeinterface #177,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     469: astore        18
     471: aload         14
     473: aload         18
     475: checkcast     #118                // class java/lang/Number
     478: invokevirtual #121                // Method java/lang/Number.intValue:()I
     481: istore        19
     483: astore        13
     485: iconst_0
     486: istore        20
     488: iload         19
     490: iconst_1
     491: iadd
     492: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     495: aload         13
     497: swap
     498: invokeinterface #178,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     503: pop
     504: goto          452
     507: aload         14
     509: checkcast     #23                 // class java/util/List
     512: nop
     513: checkcast     #52                 // class java/lang/Iterable
     516: ldc           #186                // String
     518: checkcast     #127                // class java/lang/CharSequence
     521: aconst_null
     522: aconst_null
     523: iconst_0
     524: aconst_null
     525: aconst_null
     526: bipush        62
     528: aconst_null
     529: invokestatic  #150                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     532: getstatic     #156                // Field java/lang/System.out:Ljava/io/PrintStream;
     535: swap
     536: invokevirtual #162                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     539: nop
     540: iinc          4, 1
     543: goto          9
     546: return

  public static void research$default(int, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_4
       2: iand
       3: ifeq          9
       6: bipush        100
       8: istore_2
       9: iload_0
      10: iload_1
      11: iload_2
      12: invokestatic  #296                // Method research:(III)V
      15: return

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

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

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

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

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

  private static final void generate$addEdge(kotlin.jvm.internal.Ref$IntRef, java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>>, int, int);
    Code:
       0: aload_0
       1: getfield      #18                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
       4: istore        4
       6: aload_0
       7: iload         4
       9: iconst_m1
      10: iadd
      11: putfield      #18                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      14: aload_1
      15: iload_2
      16: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      19: iload_3
      20: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      23: invokestatic  #338                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      26: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      31: pop
      32: return

  private static final void solve$grow(java.util.List<? extends java.util.List<java.lang.Integer>>, java.util.List<java.lang.Integer>, boolean[]);
    Code:
       0: aload_0
       1: aload_1
       2: invokestatic  #344                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
       5: checkcast     #118                // class java/lang/Number
       8: invokevirtual #121                // Method java/lang/Number.intValue:()I
      11: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      16: checkcast     #23                 // class java/util/List
      19: invokeinterface #42,  1           // InterfaceMethod java/util/List.size:()I
      24: iconst_2
      25: if_icmpne     150
      28: aload_0
      29: aload_1
      30: invokestatic  #344                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      33: checkcast     #118                // class java/lang/Number
      36: invokevirtual #121                // Method java/lang/Number.intValue:()I
      39: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      44: checkcast     #52                 // class java/lang/Iterable
      47: astore        4
      49: iconst_0
      50: istore        5
      52: aload         4
      54: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      59: astore        6
      61: aload         6
      63: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      68: ifeq          113
      71: aload         6
      73: invokeinterface #177,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      78: astore        7
      80: aload         7
      82: checkcast     #118                // class java/lang/Number
      85: invokevirtual #121                // Method java/lang/Number.intValue:()I
      88: istore        8
      90: iconst_0
      91: istore        9
      93: aload_2
      94: iload         8
      96: baload
      97: ifne          104
     100: iconst_1
     101: goto          105
     104: iconst_0
     105: ifeq          61
     108: aload         7
     110: goto          114
     113: aconst_null
     114: checkcast     #76                 // class java/lang/Integer
     117: dup
     118: ifnull        127
     121: invokevirtual #345                // Method java/lang/Integer.intValue:()I
     124: goto          131
     127: pop
     128: goto          150
     131: istore_3
     132: aload_1
     133: iload_3
     134: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     137: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     142: pop
     143: aload_2
     144: iload_3
     145: iconst_1
     146: bastore
     147: goto          0
     150: return

  private static final void solve$grow2(java.util.List<java.lang.Integer>, int, java.util.List<? extends java.util.List<java.lang.Integer>>, boolean[]);
    Code:
       0: aload_0
       1: invokeinterface #42,  1           // InterfaceMethod java/util/List.size:()I
       6: iload_1
       7: if_icmpge     146
      10: aload_2
      11: aload_0
      12: invokestatic  #344                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      15: checkcast     #118                // class java/lang/Number
      18: invokevirtual #121                // Method java/lang/Number.intValue:()I
      21: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      26: checkcast     #52                 // class java/lang/Iterable
      29: astore        5
      31: iconst_0
      32: istore        6
      34: aload         5
      36: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        7
      43: aload         7
      45: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          95
      53: aload         7
      55: invokeinterface #177,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        8
      62: aload         8
      64: checkcast     #118                // class java/lang/Number
      67: invokevirtual #121                // Method java/lang/Number.intValue:()I
      70: istore        9
      72: iconst_0
      73: istore        10
      75: aload_3
      76: iload         9
      78: baload
      79: ifne          86
      82: iconst_1
      83: goto          87
      86: iconst_0
      87: ifeq          43
      90: aload         8
      92: goto          96
      95: aconst_null
      96: checkcast     #76                 // class java/lang/Integer
      99: dup
     100: ifnull        109
     103: invokevirtual #345                // Method java/lang/Integer.intValue:()I
     106: goto          124
     109: pop
     110: new           #354                // class java/lang/IllegalStateException
     113: dup
     114: ldc_w         #356                // String
     117: invokevirtual #263                // Method java/lang/Object.toString:()Ljava/lang/String;
     120: invokespecial #357                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     123: athrow
     124: istore        4
     126: aload_0
     127: iload         4
     129: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     132: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     137: pop
     138: aload_3
     139: iload         4
     141: iconst_1
     142: bastore
     143: goto          0
     146: return

  private static final java.lang.CharSequence solve$lambda$3(kotlin.Pair);
    Code:
       0: aload_0
       1: ldc_w         #359                // String it
       4: invokestatic  #363                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: new           #232                // class java/lang/StringBuilder
      10: dup
      11: invokespecial #233                // Method java/lang/StringBuilder."<init>":()V
      14: aload_0
      15: invokevirtual #252                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      18: checkcast     #118                // class java/lang/Number
      21: invokevirtual #121                // Method java/lang/Number.intValue:()I
      24: iconst_1
      25: iadd
      26: invokevirtual #366                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      29: bipush        32
      31: invokevirtual #369                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      34: aload_0
      35: invokevirtual #255                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      38: checkcast     #118                // class java/lang/Number
      41: invokevirtual #121                // Method java/lang/Number.intValue:()I
      44: iconst_1
      45: iadd
      46: invokevirtual #366                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      49: invokevirtual #246                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      52: checkcast     #127                // class java/lang/CharSequence
      55: areturn

  private static final void solve$addEdge$5(java.util.List<? extends java.util.List<java.lang.Integer>>, int, int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #23                 // class java/util/List
      10: iload_2
      11: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      19: pop
      20: aload_0
      21: iload_2
      22: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      27: checkcast     #23                 // class java/util/List
      30: iload_1
      31: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      34: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      39: pop
      40: return

  private static final void research$lambda$13$addEdge$11(java.util.List<? extends java.util.List<java.lang.Integer>>, int, int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #23                 // class java/util/List
      10: iload_2
      11: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      19: pop
      20: aload_0
      21: iload_2
      22: invokeinterface #74,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      27: checkcast     #23                 // class java/util/List
      30: iload_1
      31: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      34: invokeinterface #339,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      39: pop
      40: return
}


package gcj.y2023.farewell_d

private fun solve(): String {
	val (a, b, qIn) = readLn().split(" ")
	val leftMost = HashMap<Long, Int>(a.length * a.length)
	for (i in a.indices) {
		var h = 0L
		for (j in i until a.length) {
			h = mix(h + a[j].code)
			leftMost.putIfAbsent(h, j + 1)
		}
	}
	val ans = List(qIn.toInt()) {
		val (aLen, bLen) = readInts()
		val bStart = b.length - bLen
		var h = 0L
		for (j in bStart until b.length) {
			h = mix(h + b[j].code)
			val pos = leftMost.get(h) ?: (a.length + 1)
			if (pos > aLen) {
				return@List j - bStart
			}
		}
		bLen
	}
	return ans.joinToString(" ")
}

fun mix(x: Long): Long {
	var y = x
	y = y xor (y ushr 33)
	y *= -0xae502812aa7333L
//	y = y xor (y ushr 33)
//	y *= -0x3b314601e57a13adL
//	y = y xor (y ushr 33)
	return y
}

fun main() = repeat(readInt()) { println("Case #${it + 1}: ${solve()}") }

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

Compiled from "b_small_to_upsolve.kt"
public final class gcj.y2023.farewell_d.B_small_to_upsolveKt {
  private static final java.lang.String solve();
    Code:
       0: invokestatic  #9                  // Method readLn:()Ljava/lang/String;
       3: checkcast     #11                 // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #13                 // class java/lang/String
      10: astore_1
      11: aload_1
      12: iconst_0
      13: ldc           #15                 // String
      15: aastore
      16: aload_1
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #21                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      25: astore_0
      26: aload_0
      27: iconst_0
      28: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      33: checkcast     #13                 // class java/lang/String
      36: astore_1
      37: aload_0
      38: iconst_1
      39: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      44: checkcast     #13                 // class java/lang/String
      47: astore_2
      48: aload_0
      49: iconst_2
      50: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      55: checkcast     #13                 // class java/lang/String
      58: astore_3
      59: new           #29                 // class java/util/HashMap
      62: dup
      63: aload_1
      64: invokevirtual #33                 // Method java/lang/String.length:()I
      67: aload_1
      68: invokevirtual #33                 // Method java/lang/String.length:()I
      71: imul
      72: invokespecial #37                 // Method java/util/HashMap."<init>":(I)V
      75: astore        4
      77: iconst_0
      78: istore        5
      80: aload_1
      81: checkcast     #11                 // class java/lang/CharSequence
      84: invokeinterface #38,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      89: istore        6
      91: iload         5
      93: iload         6
      95: if_icmpge     163
      98: lconst_0
      99: lstore        7
     101: iload         5
     103: istore        9
     105: aload_1
     106: invokevirtual #33                 // Method java/lang/String.length:()I
     109: istore        10
     111: iload         9
     113: iload         10
     115: if_icmpge     157
     118: lload         7
     120: aload_1
     121: iload         9
     123: invokevirtual #42                 // Method java/lang/String.charAt:(I)C
     126: i2l
     127: ladd
     128: invokestatic  #46                 // Method mix:(J)J
     131: lstore        7
     133: aload         4
     135: lload         7
     137: invokestatic  #52                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     140: iload         9
     142: iconst_1
     143: iadd
     144: invokestatic  #57                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     147: invokevirtual #61                 // Method java/util/HashMap.putIfAbsent:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     150: pop
     151: iinc          9, 1
     154: goto          111
     157: iinc          5, 1
     160: goto          91
     163: aload_3
     164: invokestatic  #65                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     167: istore        6
     169: new           #67                 // class java/util/ArrayList
     172: dup
     173: iload         6
     175: invokespecial #68                 // Method java/util/ArrayList."<init>":(I)V
     178: astore        7
     180: iconst_0
     181: istore        8
     183: iload         8
     185: iload         6
     187: if_icmpge     357
     190: iload         8
     192: istore        9
     194: aload         7
     196: iload         9
     198: istore        10
     200: astore        21
     202: iconst_0
     203: istore        11
     205: invokestatic  #72                 // Method readInts:()Ljava/util/List;
     208: astore        12
     210: aload         12
     212: iconst_0
     213: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     218: checkcast     #74                 // class java/lang/Number
     221: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     224: istore        13
     226: aload         12
     228: iconst_1
     229: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     234: checkcast     #74                 // class java/lang/Number
     237: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     240: istore        14
     242: aload_2
     243: invokevirtual #33                 // Method java/lang/String.length:()I
     246: iload         14
     248: isub
     249: istore        15
     251: lconst_0
     252: lstore        16
     254: iload         15
     256: istore        18
     258: aload_2
     259: invokevirtual #33                 // Method java/lang/String.length:()I
     262: istore        19
     264: iload         18
     266: iload         19
     268: if_icmpge     339
     271: lload         16
     273: aload_2
     274: iload         18
     276: invokevirtual #42                 // Method java/lang/String.charAt:(I)C
     279: i2l
     280: ladd
     281: invokestatic  #46                 // Method mix:(J)J
     284: lstore        16
     286: aload         4
     288: lload         16
     290: invokestatic  #52                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     293: invokevirtual #80                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     296: checkcast     #54                 // class java/lang/Integer
     299: dup
     300: ifnull        309
     303: invokevirtual #81                 // Method java/lang/Integer.intValue:()I
     306: goto          316
     309: pop
     310: aload_1
     311: invokevirtual #33                 // Method java/lang/String.length:()I
     314: iconst_1
     315: iadd
     316: istore        20
     318: iload         20
     320: iload         13
     322: if_icmple     333
     325: iload         18
     327: iload         15
     329: isub
     330: goto          341
     333: iinc          18, 1
     336: goto          264
     339: iload         14
     341: invokestatic  #57                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     344: aload         21
     346: swap
     347: invokevirtual #85                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     350: pop
     351: iinc          8, 1
     354: goto          183
     357: aload         7
     359: checkcast     #23                 // class java/util/List
     362: astore        5
     364: aload         5
     366: checkcast     #87                 // class java/lang/Iterable
     369: ldc           #15                 // String
     371: checkcast     #11                 // class java/lang/CharSequence
     374: aconst_null
     375: aconst_null
     376: iconst_0
     377: aconst_null
     378: aconst_null
     379: bipush        62
     381: aconst_null
     382: invokestatic  #93                 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     385: areturn

  public static final long mix(long);
    Code:
       0: lload_0
       1: lstore_2
       2: lload_2
       3: lload_2
       4: bipush        33
       6: lushr
       7: lxor
       8: lstore_2
       9: lload_2
      10: ldc2_w        #113                // long -49064778989728563l
      13: lmul
      14: lstore_2
      15: lload_2
      16: lreturn

  public static final void main();
    Code:
       0: invokestatic  #121                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     61
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: new           #123                // class java/lang/StringBuilder
      18: dup
      19: invokespecial #125                // Method java/lang/StringBuilder."<init>":()V
      22: ldc           #127                // String Case #
      24: invokevirtual #131                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: iload_2
      28: iconst_1
      29: iadd
      30: invokevirtual #134                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      33: ldc           #136                // String :
      35: invokevirtual #131                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: invokestatic  #138                // Method solve:()Ljava/lang/String;
      41: invokevirtual #131                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      44: invokevirtual #141                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      47: getstatic     #147                // Field java/lang/System.out:Ljava/io/PrintStream;
      50: swap
      51: invokevirtual #153                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      54: nop
      55: iinc          1, 1
      58: goto          6
      61: return

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

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

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

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

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