package gcj.y2019.round3

import java.util.TreeSet

private const val M = 1_000_000_000_000L
private const val S = 10_000_000_000L

private fun play() {
	val ranges = mutableSetOf(1..M)
	fun makeMove(p: Long) {
		val removed = ranges.first { p in it }
		ranges.remove(removed)
		val added = listOf(removed.first until p, p + S..removed.last)
		ranges.addAll(added.filter { it.size() >= S })
	}
	while (true) {
		val p = readLong()
		if (p < 0) { return }
		makeMove(p)
		val xor = ranges.map(::getGrundy).fold(0, Int::xor)
		val q = if (xor == 0) ranges.first().first else {
			val range = ranges.first { getGrundy(it) xor xor < getGrundy(it) }
			val wantedValue = getGrundy(range) xor xor
			range.first + possibleMoves.first {
				getGrundy(it) xor getGrundy(range.size() - S - it) == wantedValue
			}
		}
		println(q)
		makeMove(q)
	}
}

private val grundy = grundy()
private val possibleMoves = grundy.keys.flatMap { listOf(it.first, it.last).distinct() }

private fun getGrundy(x: Long) : Int = grundy.entries.first { x in it.key }.value
private fun getGrundy(range: LongRange) : Int = getGrundy(range.size())

private fun grundy(): Map<LongRange, Int> {
	data class Event(val x: Long, val value: Int, val delta: Int) : Comparable<Event> {
		override fun compareTo(other: Event): Int =
				compareValuesBy(this, other, { it.x }, { System.identityHashCode(it) })
	}
	val events = TreeSet<Event>()
	val ranges = mutableMapOf((0 until S) to 0)
	val reachable = mutableMapOf<Int, Int>().withDefault { 0 }
	while (true) {
		val (rangeA, valueA) = ranges.entries.maxByOrNull { it.key.first }!!
		for ((rangeB, valueB) in ranges) {
			val valueC = valueA xor valueB
			events.add(Event(rangeA.first + rangeB.first + S, valueC, +1))
			events.add(Event(rangeA.last + rangeB.last + 1 + S, valueC, -1))
		}
		val low = rangeA.last + 1
		if (low > M) { break }
		while (events.first().x <= low) {
			val event = events.pollFirst()
			@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
			reachable[event.value] = reachable.getValue(event.value) + event.delta
		}
		val high = minOf(events.first().x, low + S)
		val value = (0..reachable.size).first { reachable.getValue(it) == 0 }
		if (valueA == value) {
			ranges.remove(rangeA)
			ranges[rangeA.first until high] = value
		} else {
			ranges[low until high] = value
		}
	}
	return ranges
}

fun main() {
	repeat(readInts()[0]) {	play() }
}

private fun LongRange.size(): Long = this.last - this.first + 1

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

Compiled from "a.kt"
public final class gcj.y2019.round3.AKt {
  private static final long M;

  private static final long S;

  private static final java.util.Map<kotlin.ranges.LongRange, java.lang.Integer> grundy;

  private static final java.util.List<java.lang.Long> possibleMoves;

  private static final void play();
    Code:
       0: iconst_1
       1: anewarray     #8                  // class kotlin/ranges/LongRange
       4: astore_1
       5: aload_1
       6: iconst_0
       7: new           #8                  // class kotlin/ranges/LongRange
      10: dup
      11: lconst_1
      12: ldc2_w        #9                  // long 1000000000000l
      15: invokespecial #14                 // Method kotlin/ranges/LongRange."<init>":(JJ)V
      18: aastore
      19: aload_1
      20: invokestatic  #20                 // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;
      23: astore_0
      24: nop
      25: invokestatic  #24                 // Method readLong:()J
      28: lstore_1
      29: lload_1
      30: lconst_0
      31: lcmp
      32: ifge          36
      35: return
      36: aload_0
      37: lload_1
      38: invokestatic  #28                 // Method play$makeMove:(Ljava/util/Set;J)V
      41: aload_0
      42: checkcast     #30                 // class java/lang/Iterable
      45: astore        4
      47: iconst_0
      48: istore        5
      50: aload         4
      52: astore        6
      54: new           #32                 // class java/util/ArrayList
      57: dup
      58: aload         4
      60: bipush        10
      62: invokestatic  #38                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      65: invokespecial #41                 // Method java/util/ArrayList."<init>":(I)V
      68: checkcast     #43                 // class java/util/Collection
      71: astore        7
      73: iconst_0
      74: istore        8
      76: aload         6
      78: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      83: astore        9
      85: aload         9
      87: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      92: ifeq          138
      95: aload         9
      97: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     102: astore        10
     104: aload         7
     106: aload         10
     108: checkcast     #8                  // class kotlin/ranges/LongRange
     111: astore        11
     113: astore        15
     115: iconst_0
     116: istore        12
     118: aload         11
     120: invokestatic  #61                 // Method getGrundy:(Lkotlin/ranges/LongRange;)I
     123: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     126: aload         15
     128: swap
     129: invokeinterface #71,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     134: pop
     135: goto          85
     138: aload         7
     140: checkcast     #73                 // class java/util/List
     143: nop
     144: checkcast     #30                 // class java/lang/Iterable
     147: astore        4
     149: iconst_0
     150: istore        5
     152: iconst_0
     153: istore        6
     155: iload         5
     157: istore        7
     159: aload         4
     161: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     166: astore        8
     168: aload         8
     170: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     175: ifeq          214
     178: aload         8
     180: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     185: astore        9
     187: iload         7
     189: aload         9
     191: checkcast     #75                 // class java/lang/Number
     194: invokevirtual #79                 // Method java/lang/Number.intValue:()I
     197: istore        10
     199: istore        11
     201: iconst_0
     202: istore        12
     204: iload         11
     206: iload         10
     208: ixor
     209: istore        7
     211: goto          168
     214: iload         7
     216: istore_3
     217: iload_3
     218: ifne          237
     221: aload_0
     222: checkcast     #30                 // class java/lang/Iterable
     225: invokestatic  #83                 // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     228: checkcast     #8                  // class kotlin/ranges/LongRange
     231: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     234: goto          457
     237: aload_0
     238: checkcast     #30                 // class java/lang/Iterable
     241: astore        7
     243: iconst_0
     244: istore        8
     246: aload         7
     248: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     253: astore        9
     255: aload         9
     257: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     262: ifeq          312
     265: aload         9
     267: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     272: astore        10
     274: aload         10
     276: checkcast     #8                  // class kotlin/ranges/LongRange
     279: astore        11
     281: iconst_0
     282: istore        12
     284: aload         11
     286: invokestatic  #61                 // Method getGrundy:(Lkotlin/ranges/LongRange;)I
     289: iload_3
     290: ixor
     291: aload         11
     293: invokestatic  #61                 // Method getGrundy:(Lkotlin/ranges/LongRange;)I
     296: if_icmpge     303
     299: iconst_1
     300: goto          304
     303: iconst_0
     304: ifeq          255
     307: aload         10
     309: goto          322
     312: new           #88                 // class java/util/NoSuchElementException
     315: dup
     316: ldc           #90                 // String Collection contains no element matching the predicate.
     318: invokespecial #93                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     321: athrow
     322: checkcast     #8                  // class kotlin/ranges/LongRange
     325: astore        6
     327: aload         6
     329: invokestatic  #61                 // Method getGrundy:(Lkotlin/ranges/LongRange;)I
     332: iload_3
     333: ixor
     334: istore        7
     336: aload         6
     338: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     341: getstatic     #97                 // Field possibleMoves:Ljava/util/List;
     344: checkcast     #30                 // class java/lang/Iterable
     347: astore        8
     349: lstore        15
     351: iconst_0
     352: istore        9
     354: aload         8
     356: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     361: astore        10
     363: aload         10
     365: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     370: ifeq          434
     373: aload         10
     375: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     380: astore        11
     382: aload         11
     384: checkcast     #75                 // class java/lang/Number
     387: invokevirtual #100                // Method java/lang/Number.longValue:()J
     390: lstore        12
     392: iconst_0
     393: istore        14
     395: lload         12
     397: invokestatic  #103                // Method getGrundy:(J)I
     400: aload         6
     402: invokestatic  #107                // Method size:(Lkotlin/ranges/LongRange;)J
     405: ldc2_w        #108                // long 10000000000l
     408: lsub
     409: lload         12
     411: lsub
     412: invokestatic  #103                // Method getGrundy:(J)I
     415: ixor
     416: iload         7
     418: if_icmpne     425
     421: iconst_1
     422: goto          426
     425: iconst_0
     426: ifeq          363
     429: aload         11
     431: goto          444
     434: new           #88                 // class java/util/NoSuchElementException
     437: dup
     438: ldc           #90                 // String Collection contains no element matching the predicate.
     440: invokespecial #93                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     443: athrow
     444: astore        17
     446: lload         15
     448: aload         17
     450: checkcast     #75                 // class java/lang/Number
     453: invokevirtual #100                // Method java/lang/Number.longValue:()J
     456: ladd
     457: lstore        4
     459: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     462: lload         4
     464: invokevirtual #121                // Method java/io/PrintStream.println:(J)V
     467: aload_0
     468: lload         4
     470: invokestatic  #28                 // Method play$makeMove:(Ljava/util/Set;J)V
     473: goto          24

  private static final int getGrundy(long);
    Code:
       0: getstatic     #160                // Field grundy:Ljava/util/Map;
       3: invokeinterface #166,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
       8: checkcast     #30                 // class java/lang/Iterable
      11: astore_2
      12: iconst_0
      13: istore_3
      14: aload_2
      15: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      20: astore        4
      22: aload         4
      24: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      29: ifeq          104
      32: aload         4
      34: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      39: astore        5
      41: aload         5
      43: checkcast     #168                // class java/util/Map$Entry
      46: astore        6
      48: iconst_0
      49: istore        7
      51: aload         6
      53: invokeinterface #171,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
      58: checkcast     #8                  // class kotlin/ranges/LongRange
      61: astore        8
      63: aload         8
      65: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
      68: lstore        9
      70: lload_0
      71: aload         8
      73: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
      76: lcmp
      77: ifgt          95
      80: lload         9
      82: lload_0
      83: lcmp
      84: ifgt          91
      87: iconst_1
      88: goto          96
      91: iconst_0
      92: goto          96
      95: iconst_0
      96: ifeq          22
      99: aload         5
     101: goto          114
     104: new           #88                 // class java/util/NoSuchElementException
     107: dup
     108: ldc           #90                 // String Collection contains no element matching the predicate.
     110: invokespecial #93                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     113: athrow
     114: checkcast     #168                // class java/util/Map$Entry
     117: invokeinterface #177,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     122: checkcast     #75                 // class java/lang/Number
     125: invokevirtual #79                 // Method java/lang/Number.intValue:()I
     128: ireturn

  private static final int getGrundy(kotlin.ranges.LongRange);
    Code:
       0: aload_0
       1: invokestatic  #107                // Method size:(Lkotlin/ranges/LongRange;)J
       4: invokestatic  #103                // Method getGrundy:(J)I
       7: ireturn

  private static final java.util.Map<kotlin.ranges.LongRange, java.lang.Integer> grundy();
    Code:
       0: new           #184                // class java/util/TreeSet
       3: dup
       4: invokespecial #186                // Method java/util/TreeSet."<init>":()V
       7: astore_0
       8: iconst_1
       9: anewarray     #188                // class kotlin/Pair
      12: astore_2
      13: aload_2
      14: iconst_0
      15: iconst_0
      16: ldc2_w        #108                // long 10000000000l
      19: invokestatic  #194                // Method kotlin/ranges/RangesKt.until:(IJ)Lkotlin/ranges/LongRange;
      22: iconst_0
      23: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      26: invokestatic  #200                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      29: aastore
      30: aload_2
      31: invokestatic  #206                // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
      34: astore_1
      35: new           #208                // class java/util/LinkedHashMap
      38: dup
      39: invokespecial #209                // Method java/util/LinkedHashMap."<init>":()V
      42: checkcast     #162                // class java/util/Map
      45: invokedynamic #229,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      50: invokestatic  #233                // Method kotlin/collections/MapsKt.withDefaultMutable:(Ljava/util/Map;Lkotlin/jvm/functions/Function1;)Ljava/util/Map;
      53: astore_2
      54: nop
      55: aload_1
      56: invokeinterface #166,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      61: checkcast     #30                 // class java/lang/Iterable
      64: astore        4
      66: iconst_0
      67: istore        5
      69: aload         4
      71: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      76: astore        6
      78: aload         6
      80: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      85: ifne          92
      88: aconst_null
      89: goto          203
      92: aload         6
      94: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      99: astore        7
     101: aload         6
     103: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     108: ifne          116
     111: aload         7
     113: goto          203
     116: aload         7
     118: checkcast     #168                // class java/util/Map$Entry
     121: astore        8
     123: iconst_0
     124: istore        10
     126: aload         8
     128: invokeinterface #171,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     133: checkcast     #8                  // class kotlin/ranges/LongRange
     136: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     139: lstore        8
     141: aload         6
     143: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     148: astore        10
     150: aload         10
     152: checkcast     #168                // class java/util/Map$Entry
     155: astore        11
     157: iconst_0
     158: istore        13
     160: aload         11
     162: invokeinterface #171,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     167: checkcast     #8                  // class kotlin/ranges/LongRange
     170: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     173: lstore        11
     175: lload         8
     177: lload         11
     179: lcmp
     180: ifge          191
     183: aload         10
     185: astore        7
     187: lload         11
     189: lstore        8
     191: aload         6
     193: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     198: ifne          141
     201: aload         7
     203: dup
     204: invokestatic  #239                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     207: checkcast     #168                // class java/util/Map$Entry
     210: astore_3
     211: aload_3
     212: invokeinterface #171,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     217: checkcast     #8                  // class kotlin/ranges/LongRange
     220: astore        4
     222: aload_3
     223: invokeinterface #177,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     228: checkcast     #75                 // class java/lang/Number
     231: invokevirtual #79                 // Method java/lang/Number.intValue:()I
     234: istore        5
     236: aload_1
     237: invokeinterface #166,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     242: invokeinterface #240,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     247: astore        6
     249: aload         6
     251: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     256: ifeq          370
     259: aload         6
     261: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     266: checkcast     #168                // class java/util/Map$Entry
     269: astore        7
     271: aload         7
     273: invokeinterface #171,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     278: checkcast     #8                  // class kotlin/ranges/LongRange
     281: astore        8
     283: aload         7
     285: invokeinterface #177,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     290: checkcast     #75                 // class java/lang/Number
     293: invokevirtual #79                 // Method java/lang/Number.intValue:()I
     296: istore        10
     298: iload         5
     300: iload         10
     302: ixor
     303: istore        11
     305: aload_0
     306: new           #242                // class gcj/y2019/round3/AKt$grundy$Event
     309: dup
     310: aload         4
     312: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     315: aload         8
     317: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     320: ladd
     321: ldc2_w        #108                // long 10000000000l
     324: ladd
     325: iload         11
     327: iconst_1
     328: invokespecial #245                // Method gcj/y2019/round3/AKt$grundy$Event."<init>":(JII)V
     331: invokevirtual #246                // Method java/util/TreeSet.add:(Ljava/lang/Object;)Z
     334: pop
     335: aload_0
     336: new           #242                // class gcj/y2019/round3/AKt$grundy$Event
     339: dup
     340: aload         4
     342: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
     345: aload         8
     347: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
     350: ladd
     351: lconst_1
     352: ladd
     353: ldc2_w        #108                // long 10000000000l
     356: ladd
     357: iload         11
     359: iconst_m1
     360: invokespecial #245                // Method gcj/y2019/round3/AKt$grundy$Event."<init>":(JII)V
     363: invokevirtual #246                // Method java/util/TreeSet.add:(Ljava/lang/Object;)Z
     366: pop
     367: goto          249
     370: aload         4
     372: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
     375: lconst_1
     376: ladd
     377: lstore        6
     379: lload         6
     381: ldc2_w        #9                  // long 1000000000000l
     384: lcmp
     385: ifgt          651
     388: aload_0
     389: invokevirtual #248                // Method java/util/TreeSet.first:()Ljava/lang/Object;
     392: checkcast     #242                // class gcj/y2019/round3/AKt$grundy$Event
     395: invokevirtual #251                // Method gcj/y2019/round3/AKt$grundy$Event.getX:()J
     398: lload         6
     400: lcmp
     401: ifgt          458
     404: aload_0
     405: invokevirtual #254                // Method java/util/TreeSet.pollFirst:()Ljava/lang/Object;
     408: checkcast     #242                // class gcj/y2019/round3/AKt$grundy$Event
     411: astore        8
     413: aload_2
     414: aload         8
     416: invokevirtual #256                // Method gcj/y2019/round3/AKt$grundy$Event.getValue:()I
     419: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     422: aload_2
     423: aload         8
     425: invokevirtual #256                // Method gcj/y2019/round3/AKt$grundy$Event.getValue:()I
     428: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     431: invokestatic  #259                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     434: checkcast     #75                 // class java/lang/Number
     437: invokevirtual #79                 // Method java/lang/Number.intValue:()I
     440: aload         8
     442: invokevirtual #262                // Method gcj/y2019/round3/AKt$grundy$Event.getDelta:()I
     445: iadd
     446: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     449: invokeinterface #266,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     454: pop
     455: goto          388
     458: aload_0
     459: invokevirtual #248                // Method java/util/TreeSet.first:()Ljava/lang/Object;
     462: checkcast     #242                // class gcj/y2019/round3/AKt$grundy$Event
     465: invokevirtual #251                // Method gcj/y2019/round3/AKt$grundy$Event.getX:()J
     468: lload         6
     470: ldc2_w        #108                // long 10000000000l
     473: ladd
     474: invokestatic  #272                // Method java/lang/Math.min:(JJ)J
     477: lstore        8
     479: new           #274                // class kotlin/ranges/IntRange
     482: dup
     483: iconst_0
     484: aload_2
     485: invokeinterface #276,  1          // InterfaceMethod java/util/Map.size:()I
     490: invokespecial #279                // Method kotlin/ranges/IntRange."<init>":(II)V
     493: checkcast     #30                 // class java/lang/Iterable
     496: astore        13
     498: iconst_0
     499: istore        14
     501: aload         13
     503: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     508: astore        15
     510: aload         15
     512: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     517: ifeq          568
     520: aload         15
     522: checkcast     #281                // class kotlin/collections/IntIterator
     525: invokevirtual #284                // Method kotlin/collections/IntIterator.nextInt:()I
     528: istore        16
     530: iload         16
     532: istore        17
     534: iconst_0
     535: istore        18
     537: aload_2
     538: iload         17
     540: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     543: invokestatic  #259                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     546: checkcast     #75                 // class java/lang/Number
     549: invokevirtual #79                 // Method java/lang/Number.intValue:()I
     552: ifne          559
     555: iconst_1
     556: goto          560
     559: iconst_0
     560: ifeq          510
     563: iload         16
     565: goto          578
     568: new           #88                 // class java/util/NoSuchElementException
     571: dup
     572: ldc           #90                 // String Collection contains no element matching the predicate.
     574: invokespecial #93                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     577: athrow
     578: istore        11
     580: iload         5
     582: iload         11
     584: if_icmpne     625
     587: aload_1
     588: aload         4
     590: invokeinterface #287,  2          // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
     595: pop
     596: iload         11
     598: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     601: astore        15
     603: aload_1
     604: aload         4
     606: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     609: lload         8
     611: invokestatic  #290                // Method kotlin/ranges/RangesKt.until:(JJ)Lkotlin/ranges/LongRange;
     614: aload         15
     616: invokeinterface #266,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     621: pop
     622: goto          54
     625: iload         11
     627: invokestatic  #67                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     630: astore        15
     632: aload_1
     633: lload         6
     635: lload         8
     637: invokestatic  #290                // Method kotlin/ranges/RangesKt.until:(JJ)Lkotlin/ranges/LongRange;
     640: aload         15
     642: invokeinterface #266,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     647: pop
     648: goto          54
     651: aload_1
     652: areturn

  public static final void main();
    Code:
       0: invokestatic  #318                // Method readInts:()Ljava/util/List;
       3: iconst_0
       4: invokeinterface #322,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       9: checkcast     #75                 // class java/lang/Number
      12: invokevirtual #79                 // Method java/lang/Number.intValue:()I
      15: istore_0
      16: iconst_0
      17: istore_1
      18: iload_1
      19: iload_0
      20: if_icmpge     36
      23: iload_1
      24: istore_2
      25: iconst_0
      26: istore_3
      27: invokestatic  #324                // Method play:()V
      30: iinc          1, 1
      33: goto          18
      36: return

  private static final long size(kotlin.ranges.LongRange);
    Code:
       0: aload_0
       1: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
       4: aload_0
       5: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
       8: lsub
       9: lconst_1
      10: ladd
      11: lreturn

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

  private static final long readLong();
    Code:
       0: invokestatic  #335                // Method readLn:()Ljava/lang/String;
       3: invokestatic  #341                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
       6: lreturn

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

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

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

  private static final void play$makeMove(java.util.Set<kotlin.ranges.LongRange>, long);
    Code:
       0: aload_0
       1: checkcast     #30                 // class java/lang/Iterable
       4: astore        4
       6: iconst_0
       7: istore        5
       9: aload         4
      11: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      16: astore        6
      18: aload         6
      20: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      25: ifeq          88
      28: aload         6
      30: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      35: astore        7
      37: aload         7
      39: checkcast     #8                  // class kotlin/ranges/LongRange
      42: astore        8
      44: iconst_0
      45: istore        9
      47: aload         8
      49: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
      52: lstore        10
      54: lload_1
      55: aload         8
      57: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
      60: lcmp
      61: ifgt          79
      64: lload         10
      66: lload_1
      67: lcmp
      68: ifgt          75
      71: iconst_1
      72: goto          80
      75: iconst_0
      76: goto          80
      79: iconst_0
      80: ifeq          18
      83: aload         7
      85: goto          98
      88: new           #88                 // class java/util/NoSuchElementException
      91: dup
      92: ldc           #90                 // String Collection contains no element matching the predicate.
      94: invokespecial #93                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
      97: athrow
      98: checkcast     #8                  // class kotlin/ranges/LongRange
     101: astore_3
     102: aload_0
     103: aload_3
     104: invokeinterface #372,  2          // InterfaceMethod java/util/Set.remove:(Ljava/lang/Object;)Z
     109: pop
     110: iconst_2
     111: anewarray     #8                  // class kotlin/ranges/LongRange
     114: astore        5
     116: aload         5
     118: iconst_0
     119: aload_3
     120: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
     123: lload_1
     124: invokestatic  #290                // Method kotlin/ranges/RangesKt.until:(JJ)Lkotlin/ranges/LongRange;
     127: aastore
     128: aload         5
     130: iconst_1
     131: new           #8                  // class kotlin/ranges/LongRange
     134: dup
     135: lload_1
     136: ldc2_w        #108                // long 10000000000l
     139: ladd
     140: aload_3
     141: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
     144: invokespecial #14                 // Method kotlin/ranges/LongRange."<init>":(JJ)V
     147: aastore
     148: aload         5
     150: invokestatic  #376                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     153: astore        4
     155: aload_0
     156: aload         4
     158: checkcast     #30                 // class java/lang/Iterable
     161: astore        5
     163: astore        14
     165: iconst_0
     166: istore        6
     168: aload         5
     170: astore        7
     172: new           #32                 // class java/util/ArrayList
     175: dup
     176: invokespecial #377                // Method java/util/ArrayList."<init>":()V
     179: checkcast     #43                 // class java/util/Collection
     182: astore        8
     184: iconst_0
     185: istore        9
     187: aload         7
     189: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     194: astore        10
     196: aload         10
     198: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     203: ifeq          258
     206: aload         10
     208: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     213: astore        11
     215: aload         11
     217: checkcast     #8                  // class kotlin/ranges/LongRange
     220: astore        12
     222: iconst_0
     223: istore        13
     225: aload         12
     227: invokestatic  #107                // Method size:(Lkotlin/ranges/LongRange;)J
     230: ldc2_w        #108                // long 10000000000l
     233: lcmp
     234: iflt          241
     237: iconst_1
     238: goto          242
     241: iconst_0
     242: ifeq          196
     245: aload         8
     247: aload         11
     249: invokeinterface #71,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     254: pop
     255: goto          196
     258: aload         8
     260: checkcast     #73                 // class java/util/List
     263: nop
     264: aload         14
     266: swap
     267: checkcast     #43                 // class java/util/Collection
     270: invokeinterface #381,  2          // InterfaceMethod java/util/Set.addAll:(Ljava/util/Collection;)Z
     275: pop
     276: return

  private static final int grundy$lambda$7(int);
    Code:
       0: iconst_0
       1: ireturn

  static {};
    Code:
       0: invokestatic  #393                // Method grundy:()Ljava/util/Map;
       3: putstatic     #160                // Field grundy:Ljava/util/Map;
       6: getstatic     #160                // Field grundy:Ljava/util/Map;
       9: invokeinterface #396,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
      14: checkcast     #30                 // class java/lang/Iterable
      17: astore_0
      18: iconst_0
      19: istore_1
      20: aload_0
      21: astore_2
      22: new           #32                 // class java/util/ArrayList
      25: dup
      26: invokespecial #377                // Method java/util/ArrayList."<init>":()V
      29: checkcast     #43                 // class java/util/Collection
      32: astore_3
      33: iconst_0
      34: istore        4
      36: aload_2
      37: invokeinterface #47,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      42: astore        5
      44: aload         5
      46: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      51: ifeq          129
      54: aload         5
      56: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: astore        6
      63: aload         6
      65: checkcast     #8                  // class kotlin/ranges/LongRange
      68: astore        7
      70: iconst_0
      71: istore        8
      73: iconst_2
      74: anewarray     #337                // class java/lang/Long
      77: astore        9
      79: aload         9
      81: iconst_0
      82: aload         7
      84: invokevirtual #86                 // Method kotlin/ranges/LongRange.getFirst:()J
      87: invokestatic  #399                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      90: aastore
      91: aload         9
      93: iconst_1
      94: aload         7
      96: invokevirtual #174                // Method kotlin/ranges/LongRange.getLast:()J
      99: invokestatic  #399                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     102: aastore
     103: aload         9
     105: invokestatic  #376                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     108: checkcast     #30                 // class java/lang/Iterable
     111: invokestatic  #403                // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;
     114: checkcast     #30                 // class java/lang/Iterable
     117: astore        7
     119: aload_3
     120: aload         7
     122: invokestatic  #406                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     125: pop
     126: goto          44
     129: aload_3
     130: checkcast     #73                 // class java/util/List
     133: nop
     134: putstatic     #97                 // Field possibleMoves:Ljava/util/List;
     137: return
}

Compiled from "a.kt"
public final class gcj.y2019.round3.AKt$grundy$Event implements java.lang.Comparable<gcj.y2019.round3.AKt$grundy$Event> {
  private final long x;

  private final int value;

  private final int delta;

  public gcj.y2019.round3.AKt$grundy$Event(long, int, int);
    Code:
       0: aload_0
       1: invokespecial #12                 // Method java/lang/Object."<init>":()V
       4: aload_0
       5: lload_1
       6: putfield      #16                 // Field x:J
       9: aload_0
      10: iload_3
      11: putfield      #20                 // Field value:I
      14: aload_0
      15: iload         4
      17: putfield      #23                 // Field delta:I
      20: return

  public final long getX();
    Code:
       0: aload_0
       1: getfield      #16                 // Field x:J
       4: lreturn

  public final int getValue();
    Code:
       0: aload_0
       1: getfield      #20                 // Field value:I
       4: ireturn

  public final int getDelta();
    Code:
       0: aload_0
       1: getfield      #23                 // Field delta:I
       4: ireturn

  public int compareTo(gcj.y2019.round3.AKt$grundy$Event);
    Code:
       0: aload_1
       1: ldc           #34                 // String other
       3: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: iconst_2
       9: anewarray     #42                 // class kotlin/jvm/functions/Function1
      12: astore_2
      13: aload_2
      14: iconst_0
      15: invokedynamic #61,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      20: aastore
      21: aload_2
      22: iconst_1
      23: invokedynamic #66,  0             // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
      28: aastore
      29: aload_2
      30: invokestatic  #72                 // Method kotlin/comparisons/ComparisonsKt.compareValuesBy:(Ljava/lang/Object;Ljava/lang/Object;[Lkotlin/jvm/functions/Function1;)I
      33: ireturn

  public final long component1();
    Code:
       0: aload_0
       1: getfield      #16                 // Field x:J
       4: lreturn

  public final int component2();
    Code:
       0: aload_0
       1: getfield      #20                 // Field value:I
       4: ireturn

  public final int component3();
    Code:
       0: aload_0
       1: getfield      #23                 // Field delta:I
       4: ireturn

  public final gcj.y2019.round3.AKt$grundy$Event copy(long, int, int);
    Code:
       0: new           #2                  // class gcj/y2019/round3/AKt$grundy$Event
       3: dup
       4: lload_1
       5: iload_3
       6: iload         4
       8: invokespecial #79                 // Method "<init>":(JII)V
      11: areturn

  public static gcj.y2019.round3.AKt$grundy$Event copy$default(gcj.y2019.round3.AKt$grundy$Event, long, int, int, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #16                 // Field x:J
      11: lstore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #20                 // Field value:I
      23: istore_3
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          37
      31: aload_0
      32: getfield      #23                 // Field delta:I
      35: istore        4
      37: aload_0
      38: lload_1
      39: iload_3
      40: iload         4
      42: invokevirtual #83                 // Method copy:(JII)Lgcj/y2019/round3/AKt$grundy$Event;
      45: areturn

  public java.lang.String toString();
    Code:
       0: new           #87                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #88                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #90                 // String Event(x=
       9: invokevirtual #94                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #16                 // Field x:J
      16: invokevirtual #97                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      19: ldc           #99                 // String , value=
      21: invokevirtual #94                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #20                 // Field value:I
      28: invokevirtual #102                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #104                // String , delta=
      33: invokevirtual #94                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #23                 // Field delta:I
      40: invokevirtual #102                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #107                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #109                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #16                 // Field x:J
       4: invokestatic  #115                // Method java/lang/Long.hashCode:(J)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #20                 // Field value:I
      16: invokestatic  #120                // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #23                 // Field delta:I
      29: invokestatic  #120                // Method java/lang/Integer.hashCode:(I)I
      32: iadd
      33: istore_1
      34: iload_1
      35: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class gcj/y2019/round3/AKt$grundy$Event
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class gcj/y2019/round3/AKt$grundy$Event
      20: astore_2
      21: aload_0
      22: getfield      #16                 // Field x:J
      25: aload_2
      26: getfield      #16                 // Field x:J
      29: lcmp
      30: ifeq          35
      33: iconst_0
      34: ireturn
      35: aload_0
      36: getfield      #20                 // Field value:I
      39: aload_2
      40: getfield      #20                 // Field value:I
      43: if_icmpeq     48
      46: iconst_0
      47: ireturn
      48: aload_0
      49: getfield      #23                 // Field delta:I
      52: aload_2
      53: getfield      #23                 // Field delta:I
      56: if_icmpeq     61
      59: iconst_0
      60: ireturn
      61: iconst_1
      62: ireturn

  private static final java.lang.Comparable compareTo$lambda$0(gcj.y2019.round3.AKt$grundy$Event);
    Code:
       0: aload_0
       1: ldc           #126                // String it
       3: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #16                 // Field x:J
      10: invokestatic  #130                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      13: checkcast     #7                  // class java/lang/Comparable
      16: areturn

  private static final java.lang.Comparable compareTo$lambda$1(gcj.y2019.round3.AKt$grundy$Event);
    Code:
       0: aload_0
       1: ldc           #126                // String it
       3: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokestatic  #136                // Method java/lang/System.identityHashCode:(Ljava/lang/Object;)I
      10: invokestatic  #139                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: checkcast     #7                  // class java/lang/Comparable
      16: areturn

  public int compareTo(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #2                  // class gcj/y2019/round3/AKt$grundy$Event
       5: invokevirtual #141                // Method compareTo:(Lgcj/y2019/round3/AKt$grundy$Event;)I
       8: ireturn
}


package gcj.y2020.round1a

private fun solve(n: Int) = (0..n).first { solve(n.toLong(), it, true) }

private fun solve(n: Long, p: Int, dir: Boolean): Boolean {
	if (p < 0) return true
	if (n <= p || n >= 1L shl (p + 1)) return false
	val order = if (dir) 0..p else p downTo 0
	when {
		solve(n - (1L shl p), p - 1, !dir) -> order
		solve(n - 1, p - 1, dir) -> order.last..order.last
		else -> return false
	}.forEach { println("${p + 1} ${it + 1}") }
	return true
}

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

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

Compiled from "b.kt"
public final class gcj.y2020.round1a.BKt {
  private static final int solve(int);
    Code:
       0: new           #8                  // class kotlin/ranges/IntRange
       3: dup
       4: iconst_0
       5: iload_0
       6: invokespecial #12                 // Method kotlin/ranges/IntRange."<init>":(II)V
       9: checkcast     #14                 // class java/lang/Iterable
      12: astore_1
      13: iconst_0
      14: istore_2
      15: aload_1
      16: invokeinterface #18,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      21: astore_3
      22: aload_3
      23: invokeinterface #24,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      28: ifeq          63
      31: aload_3
      32: checkcast     #26                 // class kotlin/collections/IntIterator
      35: invokevirtual #30                 // Method kotlin/collections/IntIterator.nextInt:()I
      38: istore        4
      40: iload         4
      42: istore        5
      44: iconst_0
      45: istore        6
      47: iload_0
      48: i2l
      49: iload         5
      51: iconst_1
      52: invokestatic  #33                 // Method solve:(JIZ)Z
      55: ifeq          22
      58: iload         4
      60: goto          73
      63: new           #35                 // class java/util/NoSuchElementException
      66: dup
      67: ldc           #37                 // String Collection contains no element matching the predicate.
      69: invokespecial #40                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
      72: athrow
      73: ireturn

  private static final boolean solve(long, int, boolean);
    Code:
       0: iload_2
       1: ifge          6
       4: iconst_1
       5: ireturn
       6: lload_0
       7: iload_2
       8: i2l
       9: lcmp
      10: ifle          23
      13: lload_0
      14: lconst_1
      15: iload_2
      16: iconst_1
      17: iadd
      18: lshl
      19: lcmp
      20: iflt          25
      23: iconst_0
      24: ireturn
      25: iload_3
      26: ifeq          44
      29: new           #8                  // class kotlin/ranges/IntRange
      32: dup
      33: iconst_0
      34: iload_2
      35: invokespecial #12                 // Method kotlin/ranges/IntRange."<init>":(II)V
      38: checkcast     #50                 // class kotlin/ranges/IntProgression
      41: goto          49
      44: iload_2
      45: iconst_0
      46: invokestatic  #56                 // Method kotlin/ranges/RangesKt.downTo:(II)Lkotlin/ranges/IntProgression;
      49: astore        4
      51: nop
      52: lload_0
      53: lconst_1
      54: iload_2
      55: lshl
      56: lsub
      57: iload_2
      58: iconst_1
      59: isub
      60: iload_3
      61: ifne          68
      64: iconst_1
      65: goto          69
      68: iconst_0
      69: invokestatic  #33                 // Method solve:(JIZ)Z
      72: ifeq          80
      75: aload         4
      77: goto          118
      80: lload_0
      81: lconst_1
      82: lsub
      83: iload_2
      84: iconst_1
      85: isub
      86: iload_3
      87: invokestatic  #33                 // Method solve:(JIZ)Z
      90: ifeq          116
      93: new           #8                  // class kotlin/ranges/IntRange
      96: dup
      97: aload         4
      99: invokevirtual #59                 // Method kotlin/ranges/IntProgression.getLast:()I
     102: aload         4
     104: invokevirtual #59                 // Method kotlin/ranges/IntProgression.getLast:()I
     107: invokespecial #12                 // Method kotlin/ranges/IntRange."<init>":(II)V
     110: checkcast     #50                 // class kotlin/ranges/IntProgression
     113: goto          118
     116: iconst_0
     117: ireturn
     118: checkcast     #14                 // class java/lang/Iterable
     121: astore        5
     123: nop
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokeinterface #18,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     134: astore        7
     136: aload         7
     138: invokeinterface #24,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     143: ifeq          203
     146: aload         7
     148: checkcast     #26                 // class kotlin/collections/IntIterator
     151: invokevirtual #30                 // Method kotlin/collections/IntIterator.nextInt:()I
     154: istore        8
     156: iload         8
     158: istore        9
     160: iconst_0
     161: istore        10
     163: new           #61                 // class java/lang/StringBuilder
     166: dup
     167: invokespecial #64                 // Method java/lang/StringBuilder."<init>":()V
     170: iload_2
     171: iconst_1
     172: iadd
     173: invokevirtual #68                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     176: bipush        32
     178: invokevirtual #71                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     181: iload         9
     183: iconst_1
     184: iadd
     185: invokevirtual #68                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     188: invokevirtual #75                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     191: getstatic     #81                 // Field java/lang/System.out:Ljava/io/PrintStream;
     194: swap
     195: invokevirtual #87                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     198: nop
     199: nop
     200: goto          136
     203: nop
     204: iconst_1
     205: ireturn

  public static final void main();
    Code:
       0: invokestatic  #100                // 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           #61                 // class java/lang/StringBuilder
      18: dup
      19: invokespecial #64                 // Method java/lang/StringBuilder."<init>":()V
      22: ldc           #102                // String Case #
      24: invokevirtual #105                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: iload_2
      28: iconst_1
      29: iadd
      30: invokevirtual #68                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      33: bipush        58
      35: invokevirtual #71                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      38: invokevirtual #75                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      41: getstatic     #81                 // Field java/lang/System.out:Ljava/io/PrintStream;
      44: swap
      45: invokevirtual #87                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      48: invokestatic  #100                // Method readInt:()I
      51: invokestatic  #107                // Method solve:(I)I
      54: pop
      55: iinc          1, 1
      58: goto          6
      61: return

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

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

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


package gcj.y2020.round1a

private fun solve(impossible: String = "*"): String {
	return List(readInt()) { readLn() }.fold("**") { s, t ->
		val split = listOf(s, t).map { it.split("*") }
		val prefix = unite(split.map { it[0] }, String::startsWith) ?: return impossible
		val suffix = unite(split.map { it.last() }, String::endsWith) ?: return impossible
		prefix + "*" + split.flatMap { it.drop(1).dropLast(1) }.joinToString("") + "*" + suffix
	}.replace("*", "")
}

fun unite(s: List<String>, f: (String, String, Boolean) -> Boolean): String? {
	return s.maxByOrNull { it.length }!!.takeIf { res -> s.all { f(res, it, false) } }
}

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

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

Compiled from "a.kt"
final class gcj.y2020.round1a.AKt$solve$2$prefix$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function3<java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean> {
  public static final gcj.y2020.round1a.AKt$solve$2$prefix$2 INSTANCE;

  gcj.y2020.round1a.AKt$solve$2$prefix$2();
    Code:
       0: aload_0
       1: iconst_3
       2: ldc           #11                 // class kotlin/text/StringsKt
       4: ldc           #13                 // String startsWith
       6: ldc           #15                 // String startsWith(Ljava/lang/String;Ljava/lang/String;Z)Z
       8: iconst_1
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Boolean invoke(java.lang.String, java.lang.String, boolean);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: iload_3
      15: invokestatic  #35                 // Method kotlin/text/StringsKt.startsWith:(Ljava/lang/String;Ljava/lang/String;Z)Z
      18: invokestatic  #41                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
      21: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/lang/String
       5: aload_2
       6: checkcast     #47                 // class java/lang/String
       9: aload_3
      10: checkcast     #37                 // class java/lang/Boolean
      13: invokevirtual #51                 // Method java/lang/Boolean.booleanValue:()Z
      16: invokevirtual #53                 // Method invoke:(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/Boolean;
      19: areturn

  static {};
    Code:
       0: new           #2                  // class gcj/y2020/round1a/AKt$solve$2$prefix$2
       3: dup
       4: invokespecial #58                 // Method "<init>":()V
       7: putstatic     #61                 // Field INSTANCE:Lgcj/y2020/round1a/AKt$solve$2$prefix$2;
      10: return
}

Compiled from "a.kt"
public final class gcj.y2020.round1a.AKt {
  private static final java.lang.String solve(java.lang.String);
    Code:
       0: invokestatic  #10                 // Method readInt:()I
       3: istore_1
       4: new           #12                 // class java/util/ArrayList
       7: dup
       8: iload_1
       9: invokespecial #16                 // Method java/util/ArrayList."<init>":(I)V
      12: astore_2
      13: iconst_0
      14: istore_3
      15: iload_3
      16: iload_1
      17: if_icmpge     49
      20: iload_3
      21: istore        4
      23: aload_2
      24: iload         4
      26: istore        5
      28: astore        24
      30: iconst_0
      31: istore        6
      33: invokestatic  #20                 // Method readLn:()Ljava/lang/String;
      36: aload         24
      38: swap
      39: invokevirtual #24                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      42: pop
      43: iinc          3, 1
      46: goto          15
      49: aload_2
      50: checkcast     #26                 // class java/util/List
      53: checkcast     #28                 // class java/lang/Iterable
      56: astore_1
      57: ldc           #30                 // String **
      59: astore_2
      60: iconst_0
      61: istore_3
      62: aload_2
      63: astore        4
      65: aload_1
      66: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      71: astore        5
      73: aload         5
      75: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      80: ifeq          663
      83: aload         5
      85: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      90: astore        6
      92: aload         4
      94: aload         6
      96: checkcast     #46                 // class java/lang/String
      99: astore        7
     101: astore        8
     103: iconst_0
     104: istore        9
     106: iconst_2
     107: anewarray     #46                 // class java/lang/String
     110: astore        10
     112: aload         10
     114: iconst_0
     115: aload         8
     117: aastore
     118: aload         10
     120: iconst_1
     121: aload         7
     123: aastore
     124: aload         10
     126: invokestatic  #52                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     129: checkcast     #28                 // class java/lang/Iterable
     132: astore        10
     134: iconst_0
     135: istore        11
     137: aload         10
     139: astore        12
     141: new           #12                 // class java/util/ArrayList
     144: dup
     145: aload         10
     147: bipush        10
     149: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     152: invokespecial #16                 // Method java/util/ArrayList."<init>":(I)V
     155: checkcast     #58                 // class java/util/Collection
     158: astore        13
     160: iconst_0
     161: istore        14
     163: aload         12
     165: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     170: astore        15
     172: aload         15
     174: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     179: ifeq          244
     182: aload         15
     184: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     189: astore        16
     191: aload         13
     193: aload         16
     195: checkcast     #46                 // class java/lang/String
     198: astore        17
     200: astore        18
     202: iconst_0
     203: istore        19
     205: aload         17
     207: checkcast     #60                 // class java/lang/CharSequence
     210: iconst_1
     211: anewarray     #46                 // class java/lang/String
     214: astore        20
     216: aload         20
     218: iconst_0
     219: ldc           #62                 // String *
     221: aastore
     222: aload         20
     224: iconst_0
     225: iconst_0
     226: bipush        6
     228: aconst_null
     229: invokestatic  #68                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     232: aload         18
     234: swap
     235: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     240: pop
     241: goto          172
     244: aload         13
     246: checkcast     #26                 // class java/util/List
     249: nop
     250: astore        21
     252: aload         21
     254: checkcast     #28                 // class java/lang/Iterable
     257: astore        12
     259: iconst_0
     260: istore        13
     262: aload         12
     264: astore        14
     266: new           #12                 // class java/util/ArrayList
     269: dup
     270: aload         12
     272: bipush        10
     274: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     277: invokespecial #16                 // Method java/util/ArrayList."<init>":(I)V
     280: checkcast     #58                 // class java/util/Collection
     283: astore        15
     285: iconst_0
     286: istore        16
     288: aload         14
     290: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     295: astore        17
     297: aload         17
     299: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     304: ifeq          353
     307: aload         17
     309: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     314: astore        19
     316: aload         15
     318: aload         19
     320: checkcast     #26                 // class java/util/List
     323: astore        20
     325: astore        18
     327: iconst_0
     328: istore        22
     330: aload         20
     332: iconst_0
     333: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     338: checkcast     #46                 // class java/lang/String
     341: aload         18
     343: swap
     344: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     349: pop
     350: goto          297
     353: aload         15
     355: checkcast     #26                 // class java/util/List
     358: nop
     359: getstatic     #79                 // Field gcj/y2020/round1a/AKt$solve$2$prefix$2.INSTANCE:Lgcj/y2020/round1a/AKt$solve$2$prefix$2;
     362: checkcast     #81                 // class kotlin/jvm/functions/Function3
     365: invokestatic  #85                 // Method unite:(Ljava/util/List;Lkotlin/jvm/functions/Function3;)Ljava/lang/String;
     368: dup
     369: ifnonnull     375
     372: pop
     373: aload_0
     374: areturn
     375: astore        10
     377: aload         21
     379: checkcast     #28                 // class java/lang/Iterable
     382: astore        13
     384: iconst_0
     385: istore        14
     387: aload         13
     389: astore        15
     391: new           #12                 // class java/util/ArrayList
     394: dup
     395: aload         13
     397: bipush        10
     399: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     402: invokespecial #16                 // Method java/util/ArrayList."<init>":(I)V
     405: checkcast     #58                 // class java/util/Collection
     408: astore        16
     410: iconst_0
     411: istore        17
     413: aload         15
     415: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     420: astore        19
     422: aload         19
     424: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     429: ifeq          475
     432: aload         19
     434: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     439: astore        20
     441: aload         16
     443: aload         20
     445: checkcast     #26                 // class java/util/List
     448: astore        22
     450: astore        18
     452: iconst_0
     453: istore        23
     455: aload         22
     457: invokestatic  #89                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     460: checkcast     #46                 // class java/lang/String
     463: aload         18
     465: swap
     466: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     471: pop
     472: goto          422
     475: aload         16
     477: checkcast     #26                 // class java/util/List
     480: nop
     481: getstatic     #94                 // Field gcj/y2020/round1a/AKt$solve$2$suffix$2.INSTANCE:Lgcj/y2020/round1a/AKt$solve$2$suffix$2;
     484: checkcast     #81                 // class kotlin/jvm/functions/Function3
     487: invokestatic  #85                 // Method unite:(Ljava/util/List;Lkotlin/jvm/functions/Function3;)Ljava/lang/String;
     490: dup
     491: ifnonnull     497
     494: pop
     495: aload_0
     496: areturn
     497: astore        11
     499: new           #96                 // class java/lang/StringBuilder
     502: dup
     503: invokespecial #99                 // Method java/lang/StringBuilder."<init>":()V
     506: aload         10
     508: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     511: bipush        42
     513: invokevirtual #106                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     516: aload         21
     518: checkcast     #28                 // class java/lang/Iterable
     521: astore        12
     523: astore        18
     525: iconst_0
     526: istore        13
     528: aload         12
     530: astore        14
     532: new           #12                 // class java/util/ArrayList
     535: dup
     536: invokespecial #107                // Method java/util/ArrayList."<init>":()V
     539: checkcast     #58                 // class java/util/Collection
     542: astore        15
     544: iconst_0
     545: istore        16
     547: aload         14
     549: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     554: astore        17
     556: aload         17
     558: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     563: ifeq          614
     566: aload         17
     568: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     573: astore        19
     575: aload         19
     577: checkcast     #26                 // class java/util/List
     580: astore        20
     582: iconst_0
     583: istore        22
     585: aload         20
     587: checkcast     #28                 // class java/lang/Iterable
     590: iconst_1
     591: invokestatic  #111                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     594: iconst_1
     595: invokestatic  #115                // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;
     598: checkcast     #28                 // class java/lang/Iterable
     601: astore        20
     603: aload         15
     605: aload         20
     607: invokestatic  #119                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     610: pop
     611: goto          556
     614: aload         15
     616: checkcast     #26                 // class java/util/List
     619: nop
     620: aload         18
     622: swap
     623: checkcast     #28                 // class java/lang/Iterable
     626: ldc           #121                // String
     628: checkcast     #60                 // class java/lang/CharSequence
     631: aconst_null
     632: aconst_null
     633: iconst_0
     634: aconst_null
     635: aconst_null
     636: bipush        62
     638: aconst_null
     639: invokestatic  #125                // 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;
     642: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     645: bipush        42
     647: invokevirtual #106                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     650: aload         11
     652: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     655: invokevirtual #128                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     658: astore        4
     660: goto          73
     663: aload         4
     665: ldc           #62                 // String *
     667: ldc           #121                // String
     669: iconst_0
     670: iconst_4
     671: aconst_null
     672: invokestatic  #132                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
     675: areturn

  static java.lang.String solve$default(java.lang.String, int, java.lang.Object);
    Code:
       0: iload_1
       1: iconst_1
       2: iand
       3: ifeq          9
       6: ldc           #62                 // String *
       8: astore_0
       9: aload_0
      10: invokestatic  #172                // Method solve:(Ljava/lang/String;)Ljava/lang/String;
      13: areturn

  public static final java.lang.String unite(java.util.List<java.lang.String>, kotlin.jvm.functions.Function3<? super java.lang.String, ? super java.lang.String, ? super java.lang.Boolean, java.lang.Boolean>);
    Code:
       0: aload_0
       1: ldc           #176                // String s
       3: invokestatic  #182                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #184                // String f
       9: invokestatic  #182                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: checkcast     #28                 // class java/lang/Iterable
      16: astore_2
      17: iconst_0
      18: istore_3
      19: aload_2
      20: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      25: astore        4
      27: aload         4
      29: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      34: ifne          41
      37: aconst_null
      38: goto          135
      41: aload         4
      43: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      48: astore        5
      50: aload         4
      52: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifne          65
      60: aload         5
      62: goto          135
      65: aload         5
      67: checkcast     #46                 // class java/lang/String
      70: astore        6
      72: iconst_0
      73: istore        7
      75: aload         6
      77: invokevirtual #187                // Method java/lang/String.length:()I
      80: istore        6
      82: aload         4
      84: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      89: astore        7
      91: aload         7
      93: checkcast     #46                 // class java/lang/String
      96: astore        8
      98: iconst_0
      99: istore        9
     101: aload         8
     103: invokevirtual #187                // Method java/lang/String.length:()I
     106: istore        8
     108: iload         6
     110: iload         8
     112: if_icmpge     123
     115: aload         7
     117: astore        5
     119: iload         8
     121: istore        6
     123: aload         4
     125: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     130: ifne          82
     133: aload         5
     135: dup
     136: invokestatic  #191                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     139: astore_2
     140: aload_2
     141: checkcast     #46                 // class java/lang/String
     144: astore_3
     145: iconst_0
     146: istore        4
     148: aload_0
     149: checkcast     #28                 // class java/lang/Iterable
     152: astore        5
     154: iconst_0
     155: istore        6
     157: aload         5
     159: instanceof    #58                 // class java/util/Collection
     162: ifeq          182
     165: aload         5
     167: checkcast     #58                 // class java/util/Collection
     170: invokeinterface #194,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     175: ifeq          182
     178: iconst_1
     179: goto          247
     182: aload         5
     184: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     189: astore        7
     191: aload         7
     193: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     198: ifeq          246
     201: aload         7
     203: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     208: astore        8
     210: aload         8
     212: checkcast     #46                 // class java/lang/String
     215: astore        9
     217: iconst_0
     218: istore        10
     220: aload_1
     221: aload_3
     222: aload         9
     224: iconst_0
     225: invokestatic  #200                // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
     228: invokeinterface #204,  4          // InterfaceMethod kotlin/jvm/functions/Function3.invoke:(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     233: checkcast     #196                // class java/lang/Boolean
     236: invokevirtual #207                // Method java/lang/Boolean.booleanValue:()Z
     239: ifne          191
     242: iconst_0
     243: goto          247
     246: iconst_1
     247: nop
     248: ifeq          255
     251: aload_2
     252: goto          256
     255: aconst_null
     256: checkcast     #46                 // class java/lang/String
     259: areturn

  public static final void main();
    Code:
       0: invokestatic  #10                 // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     64
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: new           #96                 // class java/lang/StringBuilder
      18: dup
      19: invokespecial #99                 // Method java/lang/StringBuilder."<init>":()V
      22: ldc           #225                // String Case #
      24: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: iload_2
      28: iconst_1
      29: iadd
      30: invokevirtual #228                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      33: ldc           #230                // String :
      35: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: aconst_null
      39: iconst_1
      40: aconst_null
      41: invokestatic  #232                // Method solve$default:(Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      44: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      47: invokevirtual #128                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: getstatic     #238                // Field java/lang/System.out:Ljava/io/PrintStream;
      53: swap
      54: invokevirtual #243                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      57: nop
      58: iinc          1, 1
      61: goto          6
      64: return

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

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

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

Compiled from "a.kt"
final class gcj.y2020.round1a.AKt$solve$2$suffix$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function3<java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean> {
  public static final gcj.y2020.round1a.AKt$solve$2$suffix$2 INSTANCE;

  gcj.y2020.round1a.AKt$solve$2$suffix$2();
    Code:
       0: aload_0
       1: iconst_3
       2: ldc           #11                 // class kotlin/text/StringsKt
       4: ldc           #13                 // String endsWith
       6: ldc           #15                 // String endsWith(Ljava/lang/String;Ljava/lang/String;Z)Z
       8: iconst_1
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Boolean invoke(java.lang.String, java.lang.String, boolean);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: iload_3
      15: invokestatic  #35                 // Method kotlin/text/StringsKt.endsWith:(Ljava/lang/String;Ljava/lang/String;Z)Z
      18: invokestatic  #41                 // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
      21: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/lang/String
       5: aload_2
       6: checkcast     #47                 // class java/lang/String
       9: aload_3
      10: checkcast     #37                 // class java/lang/Boolean
      13: invokevirtual #51                 // Method java/lang/Boolean.booleanValue:()Z
      16: invokevirtual #53                 // Method invoke:(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/Boolean;
      19: areturn

  static {};
    Code:
       0: new           #2                  // class gcj/y2020/round1a/AKt$solve$2$suffix$2
       3: dup
       4: invokespecial #58                 // Method "<init>":()V
       7: putstatic     #61                 // Field INSTANCE:Lgcj/y2020/round1a/AKt$solve$2$suffix$2;
      10: return
}