package facebook.y2020.round1

import java.util.*

private fun solve(M: Int = 1_000_000_007): Int {
	val (n, k) = readInts()
	val (L, w, h) = List(3) { readInts().toMutableList().also { list ->
		val (a, b, c, d) = readInts()
		for (i in k until n) {
			list.add(((a.toLong() * list[i - 2] + b.toLong() * list[i - 1] + c) % d + 1).toInt())
		}
	}}
	data class Group(val xFrom: Int, val xTo: Int, val vertical: Long)
	fun perimeter(g: Group): Long = 2 * (g.xTo - g.xFrom) + g.vertical
	val groups = TreeMap<Int, Group>()
	var ans = 1
	var perimeter = 0L
	for (i in h.indices) {
		var new = Group(L[i], L[i] + w[i], 2L * h[i])
		while (true) {
			var g = groups.floorEntry(new.xFrom)?.value
			if (g == null || g.xTo < new.xFrom) g = groups.ceilingEntry(new.xFrom)?.value
			if (g != null && g.xFrom > new.xTo) g = null
			if (g != null && new.xFrom > g.xTo) g = null
			if (g == null) break
			perimeter -= perimeter(g)
			groups.remove(g.xFrom)
			new = Group(minOf(g.xFrom, new.xFrom), maxOf(g.xTo, new.xTo), g.vertical + new.vertical - 2 * h[i])
		}
		groups[new.xFrom] = new
		perimeter += perimeter(new)
		ans = ((ans.toLong() * (perimeter % M)) % M).toInt()
	}
	return ans
}

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 "a2.kt"
public final class facebook.y2020.round1.A2Kt {
  private static final int solve(int);
    Code:
       0: invokestatic  #10                 // Method readInts:()Ljava/util/List;
       3: astore_1
       4: aload_1
       5: iconst_0
       6: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      11: checkcast     #18                 // class java/lang/Number
      14: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      17: istore_2
      18: aload_1
      19: iconst_1
      20: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      25: checkcast     #18                 // class java/lang/Number
      28: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      31: istore_3
      32: iconst_3
      33: istore        5
      35: new           #24                 // class java/util/ArrayList
      38: dup
      39: iload         5
      41: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      44: astore        6
      46: iconst_0
      47: istore        7
      49: iload         7
      51: iload         5
      53: if_icmpge     255
      56: iload         7
      58: istore        8
      60: aload         6
      62: iload         8
      64: istore        9
      66: astore        20
      68: iconst_0
      69: istore        10
      71: invokestatic  #10                 // Method readInts:()Ljava/util/List;
      74: checkcast     #30                 // class java/util/Collection
      77: invokestatic  #36                 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
      80: astore        11
      82: aload         11
      84: astore        12
      86: iconst_0
      87: istore        13
      89: invokestatic  #10                 // Method readInts:()Ljava/util/List;
      92: astore        14
      94: aload         14
      96: iconst_0
      97: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     102: checkcast     #18                 // class java/lang/Number
     105: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     108: istore        15
     110: aload         14
     112: iconst_1
     113: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     118: checkcast     #18                 // class java/lang/Number
     121: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     124: istore        16
     126: aload         14
     128: iconst_2
     129: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     134: checkcast     #18                 // class java/lang/Number
     137: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     140: istore        17
     142: aload         14
     144: iconst_3
     145: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     150: checkcast     #18                 // class java/lang/Number
     153: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     156: istore        18
     158: iload_3
     159: istore        19
     161: iload         19
     163: iload_2
     164: if_icmpge     238
     167: aload         12
     169: iload         15
     171: i2l
     172: aload         12
     174: iload         19
     176: iconst_2
     177: isub
     178: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     183: checkcast     #18                 // class java/lang/Number
     186: invokevirtual #40                 // Method java/lang/Number.longValue:()J
     189: lmul
     190: iload         16
     192: i2l
     193: aload         12
     195: iload         19
     197: iconst_1
     198: isub
     199: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     204: checkcast     #18                 // class java/lang/Number
     207: invokevirtual #40                 // Method java/lang/Number.longValue:()J
     210: lmul
     211: ladd
     212: iload         17
     214: i2l
     215: ladd
     216: iload         18
     218: i2l
     219: lrem
     220: lconst_1
     221: ladd
     222: l2i
     223: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     226: invokeinterface #50,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     231: pop
     232: iinc          19, 1
     235: goto          161
     238: nop
     239: aload         11
     241: nop
     242: aload         20
     244: swap
     245: invokevirtual #51                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     248: pop
     249: iinc          7, 1
     252: goto          49
     255: aload         6
     257: checkcast     #12                 // class java/util/List
     260: astore        4
     262: aload         4
     264: iconst_0
     265: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     270: checkcast     #12                 // class java/util/List
     273: astore        5
     275: aload         4
     277: iconst_1
     278: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     283: checkcast     #12                 // class java/util/List
     286: astore        6
     288: aload         4
     290: iconst_2
     291: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     296: checkcast     #12                 // class java/util/List
     299: astore        7
     301: new           #53                 // class java/util/TreeMap
     304: dup
     305: invokespecial #56                 // Method java/util/TreeMap."<init>":()V
     308: astore        8
     310: iconst_1
     311: istore        9
     313: lconst_0
     314: lstore        10
     316: iconst_0
     317: istore        12
     319: aload         7
     321: checkcast     #30                 // class java/util/Collection
     324: invokeinterface #59,  1           // InterfaceMethod java/util/Collection.size:()I
     329: istore        13
     331: iload         12
     333: iload         13
     335: if_icmpge     686
     338: new           #61                 // class facebook/y2020/round1/A2Kt$solve$Group
     341: dup
     342: aload         5
     344: iload         12
     346: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     351: checkcast     #18                 // class java/lang/Number
     354: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     357: aload         5
     359: iload         12
     361: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     366: checkcast     #18                 // class java/lang/Number
     369: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     372: aload         6
     374: iload         12
     376: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     381: checkcast     #18                 // class java/lang/Number
     384: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     387: iadd
     388: ldc2_w        #62                 // long 2l
     391: aload         7
     393: iload         12
     395: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     400: checkcast     #18                 // class java/lang/Number
     403: invokevirtual #40                 // Method java/lang/Number.longValue:()J
     406: lmul
     407: invokespecial #66                 // Method facebook/y2020/round1/A2Kt$solve$Group."<init>":(IIJ)V
     410: astore        14
     412: nop
     413: aload         8
     415: aload         14
     417: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     420: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     423: invokevirtual #73                 // Method java/util/TreeMap.floorEntry:(Ljava/lang/Object;)Ljava/util/Map$Entry;
     426: dup
     427: ifnull        441
     430: invokeinterface #79,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     435: checkcast     #61                 // class facebook/y2020/round1/A2Kt$solve$Group
     438: goto          443
     441: pop
     442: aconst_null
     443: astore        15
     445: aload         15
     447: ifnull        463
     450: aload         15
     452: invokevirtual #82                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXTo:()I
     455: aload         14
     457: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     460: if_icmpge     495
     463: aload         8
     465: aload         14
     467: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     470: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     473: invokevirtual #85                 // Method java/util/TreeMap.ceilingEntry:(Ljava/lang/Object;)Ljava/util/Map$Entry;
     476: dup
     477: ifnull        491
     480: invokeinterface #79,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     485: checkcast     #61                 // class facebook/y2020/round1/A2Kt$solve$Group
     488: goto          493
     491: pop
     492: aconst_null
     493: astore        15
     495: aload         15
     497: ifnull        516
     500: aload         15
     502: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     505: aload         14
     507: invokevirtual #82                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXTo:()I
     510: if_icmple     516
     513: aconst_null
     514: astore        15
     516: aload         15
     518: ifnull        537
     521: aload         14
     523: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     526: aload         15
     528: invokevirtual #82                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXTo:()I
     531: if_icmple     537
     534: aconst_null
     535: astore        15
     537: aload         15
     539: ifnull        634
     542: lload         10
     544: aload         15
     546: invokestatic  #89                 // Method solve$perimeter:(Lfacebook/y2020/round1/A2Kt$solve$Group;)J
     549: lsub
     550: lstore        10
     552: aload         8
     554: aload         15
     556: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     559: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     562: invokevirtual #93                 // Method java/util/TreeMap.remove:(Ljava/lang/Object;)Ljava/lang/Object;
     565: pop
     566: new           #61                 // class facebook/y2020/round1/A2Kt$solve$Group
     569: dup
     570: aload         15
     572: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     575: aload         14
     577: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     580: invokestatic  #99                 // Method java/lang/Math.min:(II)I
     583: aload         15
     585: invokevirtual #82                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXTo:()I
     588: aload         14
     590: invokevirtual #82                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXTo:()I
     593: invokestatic  #102                // Method java/lang/Math.max:(II)I
     596: aload         15
     598: invokevirtual #105                // Method facebook/y2020/round1/A2Kt$solve$Group.getVertical:()J
     601: aload         14
     603: invokevirtual #105                // Method facebook/y2020/round1/A2Kt$solve$Group.getVertical:()J
     606: ladd
     607: iconst_2
     608: aload         7
     610: iload         12
     612: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     617: checkcast     #18                 // class java/lang/Number
     620: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     623: imul
     624: i2l
     625: lsub
     626: invokespecial #66                 // Method facebook/y2020/round1/A2Kt$solve$Group."<init>":(IIJ)V
     629: astore        14
     631: goto          412
     634: aload         8
     636: checkcast     #107                // class java/util/Map
     639: aload         14
     641: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
     644: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     647: aload         14
     649: invokeinterface #111,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     654: pop
     655: lload         10
     657: aload         14
     659: invokestatic  #89                 // Method solve$perimeter:(Lfacebook/y2020/round1/A2Kt$solve$Group;)J
     662: ladd
     663: lstore        10
     665: iload         9
     667: i2l
     668: lload         10
     670: iload_0
     671: i2l
     672: lrem
     673: lmul
     674: iload_0
     675: i2l
     676: lrem
     677: l2i
     678: istore        9
     680: iinc          12, 1
     683: goto          331
     686: iload         9
     688: ireturn

  static int solve$default(int, int, java.lang.Object);
    Code:
       0: iload_1
       1: iconst_1
       2: iand
       3: ifeq          9
       6: ldc           #139                // int 1000000007
       8: istore_0
       9: iload_0
      10: invokestatic  #141                // Method solve:(I)I
      13: ireturn

  public static final void main();
    Code:
       0: invokestatic  #145                // 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           #147                // class java/lang/StringBuilder
      18: dup
      19: invokespecial #148                // Method java/lang/StringBuilder."<init>":()V
      22: ldc           #150                // String Case #
      24: invokevirtual #154                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: iload_2
      28: iconst_1
      29: iadd
      30: invokevirtual #157                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      33: ldc           #159                // String :
      35: invokevirtual #154                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: iconst_0
      39: iconst_1
      40: aconst_null
      41: invokestatic  #161                // Method solve$default:(IILjava/lang/Object;)I
      44: invokevirtual #157                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      47: invokevirtual #165                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: getstatic     #171                // Field java/lang/System.out:Ljava/io/PrintStream;
      53: swap
      54: invokevirtual #177                // 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  #184                // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #189                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: areturn

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

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #191                // Method readLn:()Ljava/lang/String;
       3: checkcast     #199                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #201                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #203                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #209                // 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  #212                // Method readStrings:()Ljava/util/List;
       3: checkcast     #214                // 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  #218                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #30                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #222,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #228,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #231,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #201                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #195                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #232,  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  #246                // Method main:()V
       3: return

  private static final long solve$perimeter(facebook.y2020.round1.A2Kt$solve$Group);
    Code:
       0: iconst_2
       1: aload_0
       2: invokevirtual #82                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXTo:()I
       5: aload_0
       6: invokevirtual #69                 // Method facebook/y2020/round1/A2Kt$solve$Group.getXFrom:()I
       9: isub
      10: imul
      11: i2l
      12: aload_0
      13: invokevirtual #105                // Method facebook/y2020/round1/A2Kt$solve$Group.getVertical:()J
      16: ladd
      17: lreturn
}

Compiled from "a2.kt"
public final class facebook.y2020.round1.A2Kt$solve$Group {
  private final int xFrom;

  private final int xTo;

  private final long vertical;

  public facebook.y2020.round1.A2Kt$solve$Group(int, int, long);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field xFrom:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field xTo:I
      14: aload_0
      15: lload_3
      16: putfield      #20                 // Field vertical:J
      19: return

  public final int getXFrom();
    Code:
       0: aload_0
       1: getfield      #13                 // Field xFrom:I
       4: ireturn

  public final int getXTo();
    Code:
       0: aload_0
       1: getfield      #16                 // Field xTo:I
       4: ireturn

  public final long getVertical();
    Code:
       0: aload_0
       1: getfield      #20                 // Field vertical:J
       4: lreturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field xFrom:I
       4: ireturn

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

  public final long component3();
    Code:
       0: aload_0
       1: getfield      #20                 // Field vertical:J
       4: lreturn

  public final facebook.y2020.round1.A2Kt$solve$Group copy(int, int, long);
    Code:
       0: new           #2                  // class facebook/y2020/round1/A2Kt$solve$Group
       3: dup
       4: iload_1
       5: iload_2
       6: lload_3
       7: invokespecial #34                 // Method "<init>":(IIJ)V
      10: areturn

  public static facebook.y2020.round1.A2Kt$solve$Group copy$default(facebook.y2020.round1.A2Kt$solve$Group, int, int, long, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field xFrom:I
      11: istore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field xTo:I
      23: istore_2
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #20                 // Field vertical:J
      35: lstore_3
      36: aload_0
      37: iload_1
      38: iload_2
      39: lload_3
      40: invokevirtual #38                 // Method copy:(IIJ)Lfacebook/y2020/round1/A2Kt$solve$Group;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #42                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #43                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #45                 // String Group(xFrom=
       9: invokevirtual #49                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field xFrom:I
      16: invokevirtual #52                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #54                 // String , xTo=
      21: invokevirtual #49                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field xTo:I
      28: invokevirtual #52                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #56                 // String , vertical=
      33: invokevirtual #49                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #20                 // Field vertical:J
      40: invokevirtual #59                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #62                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #64                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field xFrom:I
       4: invokestatic  #70                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field xTo:I
      16: invokestatic  #70                 // 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      #20                 // Field vertical:J
      29: invokestatic  #75                 // Method java/lang/Long.hashCode:(J)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 facebook/y2020/round1/A2Kt$solve$Group
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class facebook/y2020/round1/A2Kt$solve$Group
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field xFrom:I
      25: aload_2
      26: getfield      #13                 // Field xFrom:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field xTo:I
      38: aload_2
      39: getfield      #16                 // Field xTo:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: aload_0
      48: getfield      #20                 // Field vertical:J
      51: aload_2
      52: getfield      #20                 // Field vertical:J
      55: lcmp
      56: ifeq          61
      59: iconst_0
      60: ireturn
      61: iconst_1
      62: ireturn
}


package facebook.y2020.round1

private fun solve(M: Int = 1_000_000_007): Int {
	val (n, k, w) = readInts()
	val (L, h) = List(2) { readInts().toMutableList().also { list ->
		val (a, b, c, d) = readInts()
		for (i in k until n) {
			list.add(((a.toLong() * list[i - 2] + b.toLong() * list[i - 1] + c) % d + 1).toInt())
		}
	}}
	var ans = 1
	var perimeter = 0L
	val height = mutableMapOf<Int, Int>()
	fun perimeter(xMax: Int): Long {
		var res = 0L
		for (x in xMax - w - 1 .. xMax) {
			val y = height.getOrDefault(x, 0)
			val yLeft = height.getOrDefault(x - 1, 0)
			if (y > 0) res += 2
			res += (y - yLeft).abs()
		}
		return res
	}
	for (i in h.indices) {
		val xMax = L[i] + w
		perimeter -= perimeter(xMax)
		for (x in L[i] until xMax) {
			height[x] = maxOf(height.getOrDefault(x, 0), h[i])
		}
		perimeter += perimeter(xMax)
		ans = ((ans.toLong() * (perimeter % M)) % M).toInt()
	}
	return ans
}

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

private fun Int.abs() = kotlin.math.abs(this)
private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "a1.kt"
public final class facebook.y2020.round1.A1Kt {
  private static final int solve(int);
    Code:
       0: invokestatic  #10                 // Method readInts:()Ljava/util/List;
       3: astore_1
       4: aload_1
       5: iconst_0
       6: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      11: checkcast     #18                 // class java/lang/Number
      14: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      17: istore_2
      18: aload_1
      19: iconst_1
      20: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      25: checkcast     #18                 // class java/lang/Number
      28: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      31: istore_3
      32: aload_1
      33: iconst_2
      34: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      39: checkcast     #18                 // class java/lang/Number
      42: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      45: istore        4
      47: iconst_2
      48: istore        6
      50: new           #24                 // class java/util/ArrayList
      53: dup
      54: iload         6
      56: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      59: astore        7
      61: iconst_0
      62: istore        8
      64: iload         8
      66: iload         6
      68: if_icmpge     270
      71: iload         8
      73: istore        9
      75: aload         7
      77: iload         9
      79: istore        10
      81: astore        21
      83: iconst_0
      84: istore        11
      86: invokestatic  #10                 // Method readInts:()Ljava/util/List;
      89: checkcast     #30                 // class java/util/Collection
      92: invokestatic  #36                 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
      95: astore        12
      97: aload         12
      99: astore        13
     101: iconst_0
     102: istore        14
     104: invokestatic  #10                 // Method readInts:()Ljava/util/List;
     107: astore        15
     109: aload         15
     111: iconst_0
     112: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     117: checkcast     #18                 // class java/lang/Number
     120: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     123: istore        16
     125: aload         15
     127: iconst_1
     128: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     133: checkcast     #18                 // class java/lang/Number
     136: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     139: istore        17
     141: aload         15
     143: iconst_2
     144: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     149: checkcast     #18                 // class java/lang/Number
     152: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     155: istore        18
     157: aload         15
     159: iconst_3
     160: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     165: checkcast     #18                 // class java/lang/Number
     168: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     171: istore        19
     173: iload_3
     174: istore        20
     176: iload         20
     178: iload_2
     179: if_icmpge     253
     182: aload         13
     184: iload         16
     186: i2l
     187: aload         13
     189: iload         20
     191: iconst_2
     192: isub
     193: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     198: checkcast     #18                 // class java/lang/Number
     201: invokevirtual #40                 // Method java/lang/Number.longValue:()J
     204: lmul
     205: iload         17
     207: i2l
     208: aload         13
     210: iload         20
     212: iconst_1
     213: isub
     214: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     219: checkcast     #18                 // class java/lang/Number
     222: invokevirtual #40                 // Method java/lang/Number.longValue:()J
     225: lmul
     226: ladd
     227: iload         18
     229: i2l
     230: ladd
     231: iload         19
     233: i2l
     234: lrem
     235: lconst_1
     236: ladd
     237: l2i
     238: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     241: invokeinterface #50,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     246: pop
     247: iinc          20, 1
     250: goto          176
     253: nop
     254: aload         12
     256: nop
     257: aload         21
     259: swap
     260: invokevirtual #51                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     263: pop
     264: iinc          8, 1
     267: goto          64
     270: aload         7
     272: checkcast     #12                 // class java/util/List
     275: astore        5
     277: aload         5
     279: iconst_0
     280: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     285: checkcast     #12                 // class java/util/List
     288: astore        6
     290: aload         5
     292: iconst_1
     293: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     298: checkcast     #12                 // class java/util/List
     301: astore        7
     303: iconst_1
     304: istore        8
     306: lconst_0
     307: lstore        9
     309: new           #53                 // class java/util/LinkedHashMap
     312: dup
     313: invokespecial #56                 // Method java/util/LinkedHashMap."<init>":()V
     316: checkcast     #58                 // class java/util/Map
     319: astore        11
     321: iconst_0
     322: istore        12
     324: aload         7
     326: checkcast     #30                 // class java/util/Collection
     329: invokeinterface #61,  1           // InterfaceMethod java/util/Collection.size:()I
     334: istore        13
     336: iload         12
     338: iload         13
     340: if_icmpge     503
     343: aload         6
     345: iload         12
     347: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     352: checkcast     #18                 // class java/lang/Number
     355: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     358: iload         4
     360: iadd
     361: istore        14
     363: lload         9
     365: iload         4
     367: aload         11
     369: iload         14
     371: invokestatic  #65                 // Method solve$perimeter:(ILjava/util/Map;I)J
     374: lsub
     375: lstore        9
     377: aload         6
     379: iload         12
     381: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     386: checkcast     #18                 // class java/lang/Number
     389: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     392: istore        15
     394: iload         15
     396: iload         14
     398: if_icmpge     468
     401: iload         15
     403: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     406: astore        17
     408: nop
     409: aload         11
     411: aload         17
     413: aload         11
     415: iload         15
     417: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     420: iconst_0
     421: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     424: invokeinterface #69,  3           // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     429: checkcast     #18                 // class java/lang/Number
     432: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     435: aload         7
     437: iload         12
     439: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     444: checkcast     #18                 // class java/lang/Number
     447: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     450: invokestatic  #75                 // Method java/lang/Math.max:(II)I
     453: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     456: invokeinterface #78,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     461: pop
     462: iinc          15, 1
     465: goto          394
     468: lload         9
     470: iload         4
     472: aload         11
     474: iload         14
     476: invokestatic  #65                 // Method solve$perimeter:(ILjava/util/Map;I)J
     479: ladd
     480: lstore        9
     482: iload         8
     484: i2l
     485: lload         9
     487: iload_0
     488: i2l
     489: lrem
     490: lmul
     491: iload_0
     492: i2l
     493: lrem
     494: l2i
     495: istore        8
     497: iinc          12, 1
     500: goto          336
     503: iload         8
     505: ireturn

  static int solve$default(int, int, java.lang.Object);
    Code:
       0: iload_1
       1: iconst_1
       2: iand
       3: ifeq          9
       6: ldc           #105                // int 1000000007
       8: istore_0
       9: iload_0
      10: invokestatic  #107                // Method solve:(I)I
      13: ireturn

  public static final void main();
    Code:
       0: invokestatic  #111                // 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           #113                // class java/lang/StringBuilder
      18: dup
      19: invokespecial #114                // Method java/lang/StringBuilder."<init>":()V
      22: ldc           #116                // String Case #
      24: invokevirtual #120                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      27: iload_2
      28: iconst_1
      29: iadd
      30: invokevirtual #123                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      33: ldc           #125                // String :
      35: invokevirtual #120                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: iconst_0
      39: iconst_1
      40: aconst_null
      41: invokestatic  #127                // Method solve$default:(IILjava/lang/Object;)I
      44: invokevirtual #123                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      47: invokevirtual #131                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: getstatic     #137                // Field java/lang/System.out:Ljava/io/PrintStream;
      53: swap
      54: invokevirtual #143                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      57: nop
      58: iinc          1, 1
      61: goto          6
      64: return

  private static final int abs(int);
    Code:
       0: iload_0
       1: invokestatic  #147                // Method java/lang/Math.abs:(I)I
       4: ireturn

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

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

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #161                // Method readLn:()Ljava/lang/String;
       3: checkcast     #169                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #171                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #173                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #179                // 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  #182                // Method readStrings:()Ljava/util/List;
       3: checkcast     #184                // 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  #188                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #30                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #192,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #198,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #202,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #171                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #165                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #203,  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  #217                // Method main:()V
       3: return

  private static final long solve$perimeter(int, java.util.Map<java.lang.Integer, java.lang.Integer>, int);
    Code:
       0: lconst_0
       1: lstore_3
       2: iload_2
       3: iload_0
       4: isub
       5: iconst_1
       6: isub
       7: istore        5
       9: iload         5
      11: iload_2
      12: if_icmpgt     97
      15: aload_1
      16: iload         5
      18: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      21: iconst_0
      22: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: invokeinterface #69,  3           // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      30: checkcast     #18                 // class java/lang/Number
      33: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      36: istore        6
      38: aload_1
      39: iload         5
      41: iconst_1
      42: isub
      43: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      46: iconst_0
      47: invokestatic  #46                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      50: invokeinterface #69,  3           // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      55: checkcast     #18                 // class java/lang/Number
      58: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      61: istore        7
      63: iload         6
      65: ifle          73
      68: lload_3
      69: iconst_2
      70: i2l
      71: ladd
      72: lstore_3
      73: lload_3
      74: iload         6
      76: iload         7
      78: isub
      79: invokestatic  #221                // Method abs:(I)I
      82: i2l
      83: ladd
      84: lstore_3
      85: iload         5
      87: iload_2
      88: if_icmpeq     97
      91: iinc          5, 1
      94: goto          15
      97: lload_3
      98: lreturn
}


package atcoder.agc044

fun main() {
	val n = readInt()
	val p = readInts().map { it - 1 }
	val dist = List(n) { x -> IntArray(n) { y -> sequenceOf(x, y, n - 1 - x, n - 1 - y).minOrNull()!! + 1 } }
	val on = List(n) { x -> BooleanArray(n) { true } }
	var ans = 0
	val stack = IntArray(n * n)
	for (r in p) {
		val rx = r / n
		val ry = r % n
		ans += dist[rx][ry] - 1
		on[rx][ry] = false
		dist[rx][ry]--
		stack[0] = r
		var stackSize = 1
		while (stackSize > 0) {
			val xy = stack[--stackSize]
			val x = xy / n
			val y = xy % n
			val distHere = dist[x][y]
			for (d in DX.indices) {
				val xx = x + DX[d]
				val yy = y + DY[d]
				val onNei = on.getOrNull(xx)?.getOrNull(yy) ?: continue
				val distNei = dist[xx][yy]
				val distNew = distHere + if (onNei) 1 else 0
				if (distNew < distNei) {
					dist[xx][yy]--
					stack[stackSize++] = xx * n + yy
				}
			}
		}
	}
	println(ans)
}

val DX = intArrayOf(1, 0, -1, 0)
val DY = intArrayOf(0, 1, 0, -1)

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 atcoder.agc044.BKt {
  private static final int[] DX;

  private static final int[] DY;

  public static final void main();
    Code:
       0: invokestatic  #10                 // Method readInt:()I
       3: istore_0
       4: invokestatic  #14                 // Method readInts:()Ljava/util/List;
       7: checkcast     #16                 // class java/lang/Iterable
      10: astore_2
      11: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #18                 // class java/util/ArrayList
      19: dup
      20: aload_2
      21: bipush        10
      23: invokestatic  #24                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      26: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      29: checkcast     #30                 // class java/util/Collection
      32: astore        5
      34: iconst_0
      35: istore        6
      37: aload         4
      39: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      44: astore        7
      46: aload         7
      48: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          101
      56: aload         7
      58: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      63: astore        8
      65: aload         5
      67: aload         8
      69: checkcast     #46                 // class java/lang/Number
      72: invokevirtual #49                 // Method java/lang/Number.intValue:()I
      75: istore        9
      77: astore        26
      79: iconst_0
      80: istore        10
      82: iload         9
      84: iconst_1
      85: isub
      86: invokestatic  #55                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      89: aload         26
      91: swap
      92: invokeinterface #59,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      97: pop
      98: goto          46
     101: aload         5
     103: checkcast     #61                 // class java/util/List
     106: nop
     107: astore_1
     108: new           #18                 // class java/util/ArrayList
     111: dup
     112: iload_0
     113: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     116: astore_3
     117: iconst_0
     118: istore        4
     120: iload         4
     122: iload_0
     123: if_icmpge     254
     126: iload         4
     128: istore        5
     130: aload_3
     131: iload         5
     133: istore        6
     135: astore        26
     137: iconst_0
     138: istore        7
     140: iconst_0
     141: istore        8
     143: iload_0
     144: newarray       int
     146: astore        9
     148: iload         8
     150: iload_0
     151: if_icmpge     239
     154: iload         8
     156: istore        10
     158: aload         9
     160: iload         10
     162: iconst_4
     163: anewarray     #51                 // class java/lang/Integer
     166: astore        11
     168: aload         11
     170: iconst_0
     171: iload         6
     173: invokestatic  #55                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     176: aastore
     177: aload         11
     179: iconst_1
     180: iload         10
     182: invokestatic  #55                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     185: aastore
     186: aload         11
     188: iconst_2
     189: iload_0
     190: iconst_1
     191: isub
     192: iload         6
     194: isub
     195: invokestatic  #55                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     198: aastore
     199: aload         11
     201: iconst_3
     202: iload_0
     203: iconst_1
     204: isub
     205: iload         10
     207: isub
     208: invokestatic  #55                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     211: aastore
     212: aload         11
     214: invokestatic  #67                 // Method kotlin/sequences/SequencesKt.sequenceOf:([Ljava/lang/Object;)Lkotlin/sequences/Sequence;
     217: invokestatic  #71                 // Method kotlin/sequences/SequencesKt.minOrNull:(Lkotlin/sequences/Sequence;)Ljava/lang/Comparable;
     220: dup
     221: invokestatic  #77                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     224: checkcast     #46                 // class java/lang/Number
     227: invokevirtual #49                 // Method java/lang/Number.intValue:()I
     230: iconst_1
     231: iadd
     232: iastore
     233: iinc          8, 1
     236: goto          148
     239: aload         9
     241: aload         26
     243: swap
     244: invokevirtual #78                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     247: pop
     248: iinc          4, 1
     251: goto          120
     254: aload_3
     255: checkcast     #61                 // class java/util/List
     258: astore_2
     259: new           #18                 // class java/util/ArrayList
     262: dup
     263: iload_0
     264: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     267: astore        4
     269: iconst_0
     270: istore        5
     272: iload         5
     274: iload_0
     275: if_icmpge     338
     278: iload         5
     280: istore        6
     282: aload         4
     284: iload         6
     286: istore        7
     288: astore        26
     290: iconst_0
     291: istore        8
     293: iconst_0
     294: istore        9
     296: iload_0
     297: newarray       boolean
     299: astore        10
     301: iload         9
     303: iload_0
     304: if_icmpge     323
     307: iload         9
     309: istore        11
     311: aload         10
     313: iload         11
     315: iconst_1
     316: bastore
     317: iinc          9, 1
     320: goto          301
     323: aload         10
     325: aload         26
     327: swap
     328: invokevirtual #78                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     331: pop
     332: iinc          5, 1
     335: goto          272
     338: aload         4
     340: checkcast     #61                 // class java/util/List
     343: astore_3
     344: iconst_0
     345: istore        4
     347: iload_0
     348: iload_0
     349: imul
     350: newarray       int
     352: astore        5
     354: aload_1
     355: invokeinterface #79,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     360: astore        6
     362: aload         6
     364: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     369: ifeq          676
     372: aload         6
     374: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     379: checkcast     #46                 // class java/lang/Number
     382: invokevirtual #49                 // Method java/lang/Number.intValue:()I
     385: istore        7
     387: iload         7
     389: iload_0
     390: idiv
     391: istore        8
     393: iload         7
     395: iload_0
     396: irem
     397: istore        9
     399: iload         4
     401: aload_2
     402: iload         8
     404: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     409: checkcast     #85                 // class "[I"
     412: iload         9
     414: iaload
     415: iconst_1
     416: isub
     417: iadd
     418: istore        4
     420: aload_3
     421: iload         8
     423: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     428: checkcast     #87                 // class "[Z"
     431: iload         9
     433: iconst_0
     434: bastore
     435: aload_2
     436: iload         8
     438: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     443: checkcast     #85                 // class "[I"
     446: astore        10
     448: aload         10
     450: iload         9
     452: iaload
     453: istore        11
     455: aload         10
     457: iload         9
     459: iload         11
     461: iconst_m1
     462: iadd
     463: iastore
     464: aload         5
     466: iconst_0
     467: iload         7
     469: iastore
     470: iconst_1
     471: istore        12
     473: iload         12
     475: ifle          362
     478: aload         5
     480: iinc          12, -1
     483: iload         12
     485: iaload
     486: istore        13
     488: iload         13
     490: iload_0
     491: idiv
     492: istore        14
     494: iload         13
     496: iload_0
     497: irem
     498: istore        15
     500: aload_2
     501: iload         14
     503: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     508: checkcast     #85                 // class "[I"
     511: iload         15
     513: iaload
     514: istore        16
     516: iconst_0
     517: istore        17
     519: getstatic     #90                 // Field DX:[I
     522: arraylength
     523: istore        18
     525: iload         17
     527: iload         18
     529: if_icmpge     473
     532: iload         14
     534: getstatic     #90                 // Field DX:[I
     537: iload         17
     539: iaload
     540: iadd
     541: istore        19
     543: iload         15
     545: getstatic     #93                 // Field DY:[I
     548: iload         17
     550: iaload
     551: iadd
     552: istore        20
     554: aload_3
     555: iload         19
     557: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.getOrNull:(Ljava/util/List;I)Ljava/lang/Object;
     560: checkcast     #87                 // class "[Z"
     563: dup
     564: ifnull        582
     567: iload         20
     569: invokestatic  #102                // Method kotlin/collections/ArraysKt.getOrNull:([ZI)Ljava/lang/Boolean;
     572: dup
     573: ifnull        582
     576: invokevirtual #107                // Method java/lang/Boolean.booleanValue:()Z
     579: goto          586
     582: pop
     583: goto          670
     586: istore        21
     588: aload_2
     589: iload         19
     591: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     596: checkcast     #85                 // class "[I"
     599: iload         20
     601: iaload
     602: istore        22
     604: iload         16
     606: iload         21
     608: ifeq          615
     611: iconst_1
     612: goto          616
     615: iconst_0
     616: iadd
     617: istore        23
     619: iload         23
     621: iload         22
     623: if_icmpge     670
     626: aload_2
     627: iload         19
     629: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     634: checkcast     #85                 // class "[I"
     637: astore        24
     639: aload         24
     641: iload         20
     643: iaload
     644: istore        25
     646: aload         24
     648: iload         20
     650: iload         25
     652: iconst_m1
     653: iadd
     654: iastore
     655: aload         5
     657: iload         12
     659: iinc          12, 1
     662: iload         19
     664: iload_0
     665: imul
     666: iload         20
     668: iadd
     669: iastore
     670: iinc          17, 1
     673: goto          525
     676: getstatic     #113                // Field java/lang/System.out:Ljava/io/PrintStream;
     679: iload         4
     681: invokevirtual #118                // Method java/io/PrintStream.println:(I)V
     684: return

  public static final int[] getDX();
    Code:
       0: getstatic     #90                 // Field DX:[I
       3: areturn

  public static final int[] getDY();
    Code:
       0: getstatic     #93                 // Field DY:[I
       3: areturn

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

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

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #167                // Method readLn:()Ljava/lang/String;
       3: checkcast     #175                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #177                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #179                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #185                // 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  #188                // Method readStrings:()Ljava/util/List;
       3: checkcast     #16                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #18                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #24                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #30                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #177                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #171                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #55                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #59,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #61                 // class java/util/List
      96: nop
      97: areturn

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

  static {};
    Code:
       0: iconst_4
       1: newarray       int
       3: astore_0
       4: aload_0
       5: iconst_0
       6: iconst_1
       7: iastore
       8: aload_0
       9: iconst_1
      10: iconst_0
      11: iastore
      12: aload_0
      13: iconst_2
      14: iconst_m1
      15: iastore
      16: aload_0
      17: iconst_3
      18: iconst_0
      19: iastore
      20: aload_0
      21: putstatic     #90                 // Field DX:[I
      24: iconst_4
      25: newarray       int
      27: astore_0
      28: aload_0
      29: iconst_0
      30: iconst_0
      31: iastore
      32: aload_0
      33: iconst_1
      34: iconst_1
      35: iastore
      36: aload_0
      37: iconst_2
      38: iconst_0
      39: iastore
      40: aload_0
      41: iconst_3
      42: iconst_m1
      43: iastore
      44: aload_0
      45: putstatic     #93                 // Field DY:[I
      48: return
}


package atcoder.agc043

fun main() {
//	val (n, m) = readInts()
	val memo = HashMap<Long, Int>()

	fun solve(x: Int, y: Int, z: Int): Int {
		if (z == 0 && y == x - 1) return 1
		if (y < 0 || y >= x || z >= x) return 0
		val code = (x.toLong() shl 42) + (y.toLong() shl 21) + z
		if (memo.containsKey(code)) return memo[code]!!
		var res = 0
		for (xx in 0 until x) {
			res += solve(xx, y - (x - xx - 1), z)
		}
		if (z > 0) {
			if (z == 1 && x - 1 - y <= 2) {
				res += c(x - 1, x - 1 - y)
			}
			for (xx in 0 until x) {
				for (r1 in 0..2) {
					if (r1 > x - xx - 1) break
					for (r2 in 0..2 - r1) {
						if (r2 >= xx) break
						if (r1 + r2 == 0) continue
						res += solve(xx, y - (x - xx - 1 - r1) + r2, z - 1) * c(x - xx - 1, r1) * c(xx - 1, r2)
					}
				}
			}
		}
		memo[code] = res
		return res
	}

	fun solve(n: Int) = (0..n).sumBy { solve(3 * n, 0, it) }

	println(solve(1))
	println(solve(2))
}

private fun c(n: Int, k: Int): Int {
	return when (k) {
		0 -> 1
		1 -> n
		2 -> n * (n - 1) / 2
		else -> error("")
	}
}

Compiled from "d_wrong.kt"
public final class atcoder.agc043.D_wrongKt {
  public static final void main();
    Code:
       0: new           #8                  // class java/util/HashMap
       3: dup
       4: invokespecial #11                 // Method java/util/HashMap."<init>":()V
       7: astore_0
       8: aload_0
       9: iconst_1
      10: invokestatic  #15                 // Method main$solve$1:(Ljava/util/HashMap;I)I
      13: istore_1
      14: getstatic     #21                 // Field java/lang/System.out:Ljava/io/PrintStream;
      17: iload_1
      18: invokevirtual #27                 // Method java/io/PrintStream.println:(I)V
      21: aload_0
      22: iconst_2
      23: invokestatic  #15                 // Method main$solve$1:(Ljava/util/HashMap;I)I
      26: istore_1
      27: getstatic     #21                 // Field java/lang/System.out:Ljava/io/PrintStream;
      30: iload_1
      31: invokevirtual #27                 // Method java/io/PrintStream.println:(I)V
      34: return

  private static final int c(int, int);
    Code:
       0: iload_1
       1: tableswitch   { // 0 to 2
                     0: 28
                     1: 32
                     2: 36
               default: 46
          }
      28: iconst_1
      29: goto          59
      32: iload_0
      33: goto          59
      36: iload_0
      37: iload_0
      38: iconst_1
      39: isub
      40: imul
      41: iconst_2
      42: idiv
      43: goto          59
      46: new           #33                 // class java/lang/IllegalStateException
      49: dup
      50: ldc           #35                 // String
      52: invokevirtual #39                 // Method java/lang/Object.toString:()Ljava/lang/String;
      55: invokespecial #42                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      58: athrow
      59: ireturn

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

  private static final int main$solve(java.util.HashMap<java.lang.Long, java.lang.Integer>, int, int, int);
    Code:
       0: iload_3
       1: ifne          13
       4: iload_2
       5: iload_1
       6: iconst_1
       7: isub
       8: if_icmpne     13
      11: iconst_1
      12: ireturn
      13: iload_2
      14: iflt          27
      17: iload_2
      18: iload_1
      19: if_icmpge     27
      22: iload_3
      23: iload_1
      24: if_icmplt     29
      27: iconst_0
      28: ireturn
      29: iload_1
      30: i2l
      31: bipush        42
      33: lshl
      34: iload_2
      35: i2l
      36: bipush        21
      38: lshl
      39: ladd
      40: iload_3
      41: i2l
      42: ladd
      43: lstore        4
      45: aload_0
      46: lload         4
      48: invokestatic  #59                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      51: invokevirtual #63                 // Method java/util/HashMap.containsKey:(Ljava/lang/Object;)Z
      54: ifeq          77
      57: aload_0
      58: lload         4
      60: invokestatic  #59                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      63: invokevirtual #67                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
      66: dup
      67: invokestatic  #73                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      70: checkcast     #75                 // class java/lang/Number
      73: invokevirtual #79                 // Method java/lang/Number.intValue:()I
      76: ireturn
      77: iconst_0
      78: istore        6
      80: iconst_0
      81: istore        7
      83: iload         7
      85: iload_1
      86: if_icmpge     115
      89: iload         6
      91: aload_0
      92: iload         7
      94: iload_2
      95: iload_1
      96: iload         7
      98: isub
      99: iconst_1
     100: isub
     101: isub
     102: iload_3
     103: invokestatic  #81                 // Method main$solve:(Ljava/util/HashMap;III)I
     106: iadd
     107: istore        6
     109: iinc          7, 1
     112: goto          83
     115: iload_3
     116: ifle          284
     119: iload_3
     120: iconst_1
     121: if_icmpne     149
     124: iload_1
     125: iconst_1
     126: isub
     127: iload_2
     128: isub
     129: iconst_2
     130: if_icmpgt     149
     133: iload         6
     135: iload_1
     136: iconst_1
     137: isub
     138: iload_1
     139: iconst_1
     140: isub
     141: iload_2
     142: isub
     143: invokestatic  #83                 // Method c:(II)I
     146: iadd
     147: istore        6
     149: iconst_0
     150: istore        7
     152: iload         7
     154: iload_1
     155: if_icmpge     284
     158: iconst_0
     159: istore        8
     161: iload         8
     163: iconst_3
     164: if_icmpge     278
     167: iload         8
     169: iload_1
     170: iload         7
     172: isub
     173: iconst_1
     174: isub
     175: if_icmpgt     278
     178: iconst_0
     179: istore        9
     181: iconst_2
     182: iload         8
     184: isub
     185: istore        10
     187: iload         9
     189: iload         10
     191: if_icmpgt     272
     194: iload         9
     196: iload         7
     198: if_icmpge     272
     201: iload         8
     203: iload         9
     205: iadd
     206: ifeq          259
     209: iload         6
     211: aload_0
     212: iload         7
     214: iload_2
     215: iload_1
     216: iload         7
     218: isub
     219: iconst_1
     220: isub
     221: iload         8
     223: isub
     224: isub
     225: iload         9
     227: iadd
     228: iload_3
     229: iconst_1
     230: isub
     231: invokestatic  #81                 // Method main$solve:(Ljava/util/HashMap;III)I
     234: iload_1
     235: iload         7
     237: isub
     238: iconst_1
     239: isub
     240: iload         8
     242: invokestatic  #83                 // Method c:(II)I
     245: imul
     246: iload         7
     248: iconst_1
     249: isub
     250: iload         9
     252: invokestatic  #83                 // Method c:(II)I
     255: imul
     256: iadd
     257: istore        6
     259: iload         9
     261: iload         10
     263: if_icmpeq     272
     266: iinc          9, 1
     269: goto          194
     272: iinc          8, 1
     275: goto          161
     278: iinc          7, 1
     281: goto          152
     284: lload         4
     286: invokestatic  #59                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     289: astore        8
     291: iload         6
     293: invokestatic  #88                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     296: astore        9
     298: aload_0
     299: checkcast     #90                 // class java/util/Map
     302: aload         8
     304: aload         9
     306: invokeinterface #94,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     311: pop
     312: iload         6
     314: ireturn

  private static final int main$solve$1(java.util.HashMap<java.lang.Long, java.lang.Integer>, int);
    Code:
       0: new           #106                // class kotlin/ranges/IntRange
       3: dup
       4: iconst_0
       5: iload_1
       6: invokespecial #109                // Method kotlin/ranges/IntRange."<init>":(II)V
       9: checkcast     #111                // class java/lang/Iterable
      12: astore_2
      13: iconst_0
      14: istore_3
      15: iconst_0
      16: istore        4
      18: aload_2
      19: invokeinterface #115,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      24: astore        5
      26: aload         5
      28: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      33: ifeq          79
      36: aload         5
      38: checkcast     #123                // class kotlin/collections/IntIterator
      41: invokevirtual #126                // Method kotlin/collections/IntIterator.nextInt:()I
      44: istore        6
      46: iload         4
      48: iload         6
      50: istore        7
      52: istore        9
      54: iconst_0
      55: istore        8
      57: aload_0
      58: iconst_3
      59: iload_1
      60: imul
      61: iconst_0
      62: iload         7
      64: invokestatic  #81                 // Method main$solve:(Ljava/util/HashMap;III)I
      67: istore        10
      69: iload         9
      71: iload         10
      73: iadd
      74: istore        4
      76: goto          26
      79: iload         4
      81: ireturn
}


package atcoder.arc155

private fun solve(a: List<Int>, b: List<Int>): Boolean {
	if (a.sorted() != b.sorted()) return false
	val aIsOmnipotent = isOmnipotent(a)
	val bIsOmnipotent = isOmnipotent(b)
	val aEven = mutableListOf<Int>()
	val bEven = mutableListOf<Int>()
	fun canSortEven(): Boolean {
		return (aEven.size >= 3 && aEven.sorted() == bEven.sorted()) || aEven == bEven
	}
	if (aIsOmnipotent && bIsOmnipotent) {
		aEven.addAll(a.filter { it % 2 == 0 })
		bEven.addAll(b.filter { it % 2 == 0 })
		return canSortEven()
	}
	if (aIsOmnipotent xor bIsOmnipotent) return false
	for (i in a.indices) {
		if (a[i] % 2 != 0) {
			if (b[i] != a[i]) return false
			if (!canSortEven()) return false
			aEven.clear(); bEven.clear()
			continue
		}
		if (b[i] % 2 != 0) return false
		aEven.add(a[i]); bEven.add(b[i])
	}
	if (!canSortEven()) return false
	return true
}

private fun isOmnipotent(a: List<Int>): Boolean {
	for (i in 0..a.size - 3) {
		if ((a[i] + a[i + 1] + a[i + 2]) % 2 == 0 && (a[i] % 2 != 0 || a[i + 1] % 2 != 0 || a[i + 2] % 2 != 0))
			return true
	}
	return false
}

fun main() {
	readInt()
	val a = readInts()
	val b = readInts()
	println(solve(a, b).iif("Yes", "No"))
}

private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }
private fun <T> Boolean.iif(onTrue: T, onFalse: T) = if (this) onTrue else onFalse

Compiled from "c.kt"
public final class atcoder.arc155.CKt {
  private static final boolean solve(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: checkcast     #9                  // class java/lang/Iterable
       4: invokestatic  #15                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
       7: aload_1
       8: checkcast     #9                  // class java/lang/Iterable
      11: invokestatic  #15                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      14: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      17: ifne          22
      20: iconst_0
      21: ireturn
      22: aload_0
      23: invokestatic  #25                 // Method isOmnipotent:(Ljava/util/List;)Z
      26: istore_2
      27: aload_1
      28: invokestatic  #25                 // Method isOmnipotent:(Ljava/util/List;)Z
      31: istore_3
      32: new           #27                 // class java/util/ArrayList
      35: dup
      36: invokespecial #31                 // Method java/util/ArrayList."<init>":()V
      39: checkcast     #33                 // class java/util/List
      42: astore        4
      44: new           #27                 // class java/util/ArrayList
      47: dup
      48: invokespecial #31                 // Method java/util/ArrayList."<init>":()V
      51: checkcast     #33                 // class java/util/List
      54: astore        5
      56: iload_2
      57: ifeq          310
      60: iload_3
      61: ifeq          310
      64: aload         4
      66: aload_0
      67: checkcast     #9                  // class java/lang/Iterable
      70: astore        6
      72: astore        15
      74: iconst_0
      75: istore        7
      77: aload         6
      79: astore        8
      81: new           #27                 // class java/util/ArrayList
      84: dup
      85: invokespecial #31                 // Method java/util/ArrayList."<init>":()V
      88: checkcast     #35                 // class java/util/Collection
      91: astore        9
      93: iconst_0
      94: istore        10
      96: aload         8
      98: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     103: astore        11
     105: aload         11
     107: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     112: ifeq          165
     115: aload         11
     117: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     122: astore        12
     124: aload         12
     126: checkcast     #51                 // class java/lang/Number
     129: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     132: istore        13
     134: iconst_0
     135: istore        14
     137: iload         13
     139: iconst_2
     140: irem
     141: ifne          148
     144: iconst_1
     145: goto          149
     148: iconst_0
     149: ifeq          105
     152: aload         9
     154: aload         12
     156: invokeinterface #59,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     161: pop
     162: goto          105
     165: aload         9
     167: checkcast     #33                 // class java/util/List
     170: nop
     171: aload         15
     173: swap
     174: checkcast     #35                 // class java/util/Collection
     177: invokeinterface #63,  2           // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
     182: pop
     183: aload         5
     185: aload_1
     186: checkcast     #9                  // class java/lang/Iterable
     189: astore        6
     191: astore        15
     193: iconst_0
     194: istore        7
     196: aload         6
     198: astore        8
     200: new           #27                 // class java/util/ArrayList
     203: dup
     204: invokespecial #31                 // Method java/util/ArrayList."<init>":()V
     207: checkcast     #35                 // class java/util/Collection
     210: astore        9
     212: iconst_0
     213: istore        10
     215: aload         8
     217: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     222: astore        11
     224: aload         11
     226: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     231: ifeq          284
     234: aload         11
     236: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     241: astore        12
     243: aload         12
     245: checkcast     #51                 // class java/lang/Number
     248: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     251: istore        13
     253: iconst_0
     254: istore        14
     256: iload         13
     258: iconst_2
     259: irem
     260: ifne          267
     263: iconst_1
     264: goto          268
     267: iconst_0
     268: ifeq          224
     271: aload         9
     273: aload         12
     275: invokeinterface #59,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     280: pop
     281: goto          224
     284: aload         9
     286: checkcast     #33                 // class java/util/List
     289: nop
     290: aload         15
     292: swap
     293: checkcast     #35                 // class java/util/Collection
     296: invokeinterface #63,  2           // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
     301: pop
     302: aload         4
     304: aload         5
     306: invokestatic  #66                 // Method solve$canSortEven:(Ljava/util/List;Ljava/util/List;)Z
     309: ireturn
     310: iload_2
     311: iload_3
     312: ixor
     313: ifeq          318
     316: iconst_0
     317: ireturn
     318: iconst_0
     319: istore        6
     321: aload_0
     322: checkcast     #35                 // class java/util/Collection
     325: invokeinterface #69,  1           // InterfaceMethod java/util/Collection.size:()I
     330: istore        7
     332: iload         6
     334: iload         7
     336: if_icmpge     479
     339: aload_0
     340: iload         6
     342: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     347: checkcast     #51                 // class java/lang/Number
     350: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     353: iconst_2
     354: irem
     355: ifeq          420
     358: aload_1
     359: iload         6
     361: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     366: checkcast     #51                 // class java/lang/Number
     369: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     372: aload_0
     373: iload         6
     375: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     380: checkcast     #51                 // class java/lang/Number
     383: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     386: if_icmpeq     391
     389: iconst_0
     390: ireturn
     391: aload         4
     393: aload         5
     395: invokestatic  #66                 // Method solve$canSortEven:(Ljava/util/List;Ljava/util/List;)Z
     398: ifne          403
     401: iconst_0
     402: ireturn
     403: aload         4
     405: invokeinterface #76,  1           // InterfaceMethod java/util/List.clear:()V
     410: aload         5
     412: invokeinterface #76,  1           // InterfaceMethod java/util/List.clear:()V
     417: goto          473
     420: aload_1
     421: iload         6
     423: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     428: checkcast     #51                 // class java/lang/Number
     431: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     434: iconst_2
     435: irem
     436: ifeq          441
     439: iconst_0
     440: ireturn
     441: aload         4
     443: aload_0
     444: iload         6
     446: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     451: invokeinterface #77,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     456: pop
     457: aload         5
     459: aload_1
     460: iload         6
     462: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     467: invokeinterface #77,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     472: pop
     473: iinc          6, 1
     476: goto          332
     479: aload         4
     481: aload         5
     483: invokestatic  #66                 // Method solve$canSortEven:(Ljava/util/List;Ljava/util/List;)Z
     486: ifne          491
     489: iconst_0
     490: ireturn
     491: iconst_1
     492: ireturn

  private static final boolean isOmnipotent(java.util.List<java.lang.Integer>);
    Code:
       0: iconst_0
       1: istore_1
       2: aload_0
       3: invokeinterface #101,  1          // InterfaceMethod java/util/List.size:()I
       8: iconst_3
       9: isub
      10: istore_2
      11: iload_1
      12: iload_2
      13: if_icmpgt     137
      16: aload_0
      17: iload_1
      18: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      23: checkcast     #51                 // class java/lang/Number
      26: invokevirtual #55                 // Method java/lang/Number.intValue:()I
      29: aload_0
      30: iload_1
      31: iconst_1
      32: iadd
      33: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      38: checkcast     #51                 // class java/lang/Number
      41: invokevirtual #55                 // Method java/lang/Number.intValue:()I
      44: iadd
      45: aload_0
      46: iload_1
      47: iconst_2
      48: iadd
      49: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      54: checkcast     #51                 // class java/lang/Number
      57: invokevirtual #55                 // Method java/lang/Number.intValue:()I
      60: iadd
      61: iconst_2
      62: irem
      63: ifne          126
      66: aload_0
      67: iload_1
      68: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      73: checkcast     #51                 // class java/lang/Number
      76: invokevirtual #55                 // Method java/lang/Number.intValue:()I
      79: iconst_2
      80: irem
      81: ifne          124
      84: aload_0
      85: iload_1
      86: iconst_1
      87: iadd
      88: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      93: checkcast     #51                 // class java/lang/Number
      96: invokevirtual #55                 // Method java/lang/Number.intValue:()I
      99: iconst_2
     100: irem
     101: ifne          124
     104: aload_0
     105: iload_1
     106: iconst_2
     107: iadd
     108: invokeinterface #73,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     113: checkcast     #51                 // class java/lang/Number
     116: invokevirtual #55                 // Method java/lang/Number.intValue:()I
     119: iconst_2
     120: irem
     121: ifeq          126
     124: iconst_1
     125: ireturn
     126: iload_1
     127: iload_2
     128: if_icmpeq     137
     131: iinc          1, 1
     134: goto          16
     137: iconst_0
     138: ireturn

  public static final void main();
    Code:
       0: invokestatic  #105                // Method readInt:()I
       3: pop
       4: invokestatic  #109                // Method readInts:()Ljava/util/List;
       7: astore_0
       8: invokestatic  #109                // Method readInts:()Ljava/util/List;
      11: astore_1
      12: aload_0
      13: aload_1
      14: invokestatic  #111                // Method solve:(Ljava/util/List;Ljava/util/List;)Z
      17: ldc           #113                // String Yes
      19: ldc           #115                // String No
      21: invokestatic  #119                // Method iif:(ZLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      24: getstatic     #125                // Field java/lang/System.out:Ljava/io/PrintStream;
      27: swap
      28: invokevirtual #131                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      31: return

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

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

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #143                // Method readLn:()Ljava/lang/String;
       3: checkcast     #153                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #155                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #157                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #163                // 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  #166                // Method readStrings:()Ljava/util/List;
       3: checkcast     #9                  // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #27                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #170                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #173                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #35                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #39,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #155                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #149                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #177                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #59,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #33                 // class java/util/List
      96: nop
      97: areturn

  private static final <T> T iif(boolean, T, T);
    Code:
       0: iload_0
       1: ifeq          8
       4: aload_1
       5: goto          9
       8: aload_2
       9: areturn

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

  private static final boolean solve$canSortEven(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: invokeinterface #101,  1          // InterfaceMethod java/util/List.size:()I
       6: iconst_3
       7: if_icmplt     30
      10: aload_0
      11: checkcast     #9                  // class java/lang/Iterable
      14: invokestatic  #15                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      17: aload_1
      18: checkcast     #9                  // class java/lang/Iterable
      21: invokestatic  #15                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      24: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      27: ifne          38
      30: aload_0
      31: aload_1
      32: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      35: ifeq          42
      38: iconst_1
      39: goto          43
      42: iconst_0
      43: ireturn
}