// https://codeforces.com/contest/1911/problem/H

private fun String.splitWhitespace() = split("\\s+".toRegex())
private fun <T> List<T>.counts(): Map<T, Int> = this.groupingBy { it }.eachCount()

private fun <T : Comparable<T>> List<T>.isStrictlyDecreasing(): Boolean =
    (size <= 1) || (1 until size).all { i -> get(i) < get(i - 1) }

private fun <T : Comparable<T>> List<T>.isStrictlyIncreasing(): Boolean =
    (size <= 1) || (1 until size).all { i -> get(i) > get(i - 1) }

/** Return 0 for each index whose member in a belongs to the increasing sequence.
 * 1 otherwise. null if not possible. */
fun findIncrSeqMembers(a: List<Int>, n: Int): List<Int>? {
    val res = MutableList(n) { 0 }

    var incrMax = Int.MIN_VALUE
    var decrMin = Int.MAX_VALUE
    if (n > 1 && a[0] >= a[1]) {
        res[0] = 1
        decrMin = res[0]
        // TODO extend this using a while loop. Take all decreasing numbers into decr until we hit something that has to go into incr.
        // TODO that probably won't cover many cases...
    }

    for (k in a) {
        if (k < decrMin) {
            decrMin = k
        } else if (k > incrMax) {
            incrMax = k
        } else {
            return null
        }
    }

    return res
}

fun main() {
    val n = readln().toInt()
    val a = readln().splitWhitespace().map { it.toInt() }

    // If there are >2 of any input, print NO
    findIncrSeqMembers(a, n)?.let {
        println("YES")
        println(it.joinToString(" "))
        return
    }

    println("NO")
}

Compiled from "H.kt"
public final class HKt {
  private static final java.util.List<java.lang.String> splitWhitespace(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #9                  // class java/lang/CharSequence
       4: astore_1
       5: new           #11                 // class kotlin/text/Regex
       8: dup
       9: ldc           #13                 // String \\s+
      11: invokespecial #17                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: aload_1
      19: iload_3
      20: invokevirtual #21                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      23: areturn

  private static final <T> java.util.Map<T, java.lang.Integer> counts(java.util.List<? extends T>);
    Code:
       0: aload_0
       1: checkcast     #28                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: new           #30                 // class HKt$counts$$inlined$groupingBy$1
      10: dup
      11: aload_1
      12: invokespecial #33                 // Method HKt$counts$$inlined$groupingBy$1."<init>":(Ljava/lang/Iterable;)V
      15: checkcast     #35                 // class kotlin/collections/Grouping
      18: invokestatic  #41                 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;
      21: areturn

  private static final <T extends java.lang.Comparable<? super T>> boolean isStrictlyDecreasing(java.util.List<? extends T>);
    Code:
       0: aload_0
       1: invokeinterface #56,  1           // InterfaceMethod java/util/List.size:()I
       6: iconst_1
       7: if_icmple     126
      10: iconst_1
      11: aload_0
      12: invokeinterface #56,  1           // InterfaceMethod java/util/List.size:()I
      17: invokestatic  #62                 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      20: checkcast     #28                 // class java/lang/Iterable
      23: astore_1
      24: iconst_0
      25: istore_2
      26: aload_1
      27: instanceof    #64                 // class java/util/Collection
      30: ifeq          49
      33: aload_1
      34: checkcast     #64                 // class java/util/Collection
      37: invokeinterface #68,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      42: ifeq          49
      45: iconst_1
      46: goto          123
      49: aload_1
      50: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      55: astore_3
      56: aload_3
      57: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      62: ifeq          122
      65: aload_3
      66: checkcast     #79                 // class kotlin/collections/IntIterator
      69: invokevirtual #82                 // Method kotlin/collections/IntIterator.nextInt:()I
      72: istore        4
      74: iload         4
      76: istore        5
      78: iconst_0
      79: istore        6
      81: aload_0
      82: iload         5
      84: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      89: checkcast     #88                 // class java/lang/Comparable
      92: aload_0
      93: iload         5
      95: iconst_1
      96: isub
      97: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     102: invokeinterface #92,  2           // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     107: ifge          114
     110: iconst_1
     111: goto          115
     114: iconst_0
     115: ifne          56
     118: iconst_0
     119: goto          123
     122: iconst_1
     123: ifeq          130
     126: iconst_1
     127: goto          131
     130: iconst_0
     131: ireturn

  private static final <T extends java.lang.Comparable<? super T>> boolean isStrictlyIncreasing(java.util.List<? extends T>);
    Code:
       0: aload_0
       1: invokeinterface #56,  1           // InterfaceMethod java/util/List.size:()I
       6: iconst_1
       7: if_icmple     126
      10: iconst_1
      11: aload_0
      12: invokeinterface #56,  1           // InterfaceMethod java/util/List.size:()I
      17: invokestatic  #62                 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      20: checkcast     #28                 // class java/lang/Iterable
      23: astore_1
      24: iconst_0
      25: istore_2
      26: aload_1
      27: instanceof    #64                 // class java/util/Collection
      30: ifeq          49
      33: aload_1
      34: checkcast     #64                 // class java/util/Collection
      37: invokeinterface #68,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      42: ifeq          49
      45: iconst_1
      46: goto          123
      49: aload_1
      50: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      55: astore_3
      56: aload_3
      57: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      62: ifeq          122
      65: aload_3
      66: checkcast     #79                 // class kotlin/collections/IntIterator
      69: invokevirtual #82                 // Method kotlin/collections/IntIterator.nextInt:()I
      72: istore        4
      74: iload         4
      76: istore        5
      78: iconst_0
      79: istore        6
      81: aload_0
      82: iload         5
      84: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      89: checkcast     #88                 // class java/lang/Comparable
      92: aload_0
      93: iload         5
      95: iconst_1
      96: isub
      97: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     102: invokeinterface #92,  2           // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     107: ifle          114
     110: iconst_1
     111: goto          115
     114: iconst_0
     115: ifne          56
     118: iconst_0
     119: goto          123
     122: iconst_1
     123: ifeq          130
     126: iconst_1
     127: goto          131
     130: iconst_0
     131: ireturn

  public static final java.util.List<java.lang.Integer> findIncrSeqMembers(java.util.List<java.lang.Integer>, int);
    Code:
       0: aload_0
       1: ldc           #108                // String a
       3: invokestatic  #114                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #116                // class java/util/ArrayList
       9: dup
      10: iload_1
      11: invokespecial #119                // Method java/util/ArrayList."<init>":(I)V
      14: astore_3
      15: iconst_0
      16: istore        4
      18: iload         4
      20: iload_1
      21: if_icmpge     55
      24: iload         4
      26: istore        5
      28: aload_3
      29: iload         5
      31: istore        6
      33: astore        8
      35: iconst_0
      36: istore        7
      38: iconst_0
      39: invokestatic  #125                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      42: aload         8
      44: swap
      45: invokevirtual #129                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      48: pop
      49: iinc          4, 1
      52: goto          18
      55: aload_3
      56: checkcast     #52                 // class java/util/List
      59: astore_2
      60: ldc           #130                // int -2147483648
      62: istore_3
      63: ldc           #131                // int 2147483647
      65: istore        4
      67: iload_1
      68: iconst_1
      69: if_icmple     128
      72: aload_0
      73: iconst_0
      74: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      79: checkcast     #133                // class java/lang/Number
      82: invokevirtual #136                // Method java/lang/Number.intValue:()I
      85: aload_0
      86: iconst_1
      87: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      92: checkcast     #133                // class java/lang/Number
      95: invokevirtual #136                // Method java/lang/Number.intValue:()I
      98: if_icmplt     128
     101: aload_2
     102: iconst_0
     103: iconst_1
     104: invokestatic  #125                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     107: invokeinterface #140,  3          // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;
     112: pop
     113: aload_2
     114: iconst_0
     115: invokeinterface #86,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     120: checkcast     #133                // class java/lang/Number
     123: invokevirtual #136                // Method java/lang/Number.intValue:()I
     126: istore        4
     128: aload_0
     129: invokeinterface #141,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     134: astore        5
     136: aload         5
     138: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     143: ifeq          189
     146: aload         5
     148: invokeinterface #145,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     153: checkcast     #133                // class java/lang/Number
     156: invokevirtual #136                // Method java/lang/Number.intValue:()I
     159: istore        6
     161: iload         6
     163: iload         4
     165: if_icmpge     175
     168: iload         6
     170: istore        4
     172: goto          136
     175: iload         6
     177: iload_3
     178: if_icmple     187
     181: iload         6
     183: istore_3
     184: goto          136
     187: aconst_null
     188: areturn
     189: aload_2
     190: areturn

  public static final void main();
    Code:
       0: invokestatic  #160                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #164                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: istore_0
       7: invokestatic  #160                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
      10: invokestatic  #166                // Method splitWhitespace:(Ljava/lang/String;)Ljava/util/List;
      13: checkcast     #28                 // class java/lang/Iterable
      16: astore_2
      17: iconst_0
      18: istore_3
      19: aload_2
      20: astore        4
      22: new           #116                // class java/util/ArrayList
      25: dup
      26: aload_2
      27: bipush        10
      29: invokestatic  #172                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      32: invokespecial #119                // Method java/util/ArrayList."<init>":(I)V
      35: checkcast     #64                 // class java/util/Collection
      38: astore        5
      40: iconst_0
      41: istore        6
      43: aload         4
      45: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        7
      52: aload         7
      54: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          106
      62: aload         7
      64: invokeinterface #145,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        8
      71: aload         5
      73: aload         8
      75: checkcast     #174                // class java/lang/String
      78: astore        9
      80: astore        11
      82: iconst_0
      83: istore        10
      85: aload         9
      87: invokestatic  #164                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      90: nop
      91: invokestatic  #125                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      94: aload         11
      96: swap
      97: invokeinterface #175,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     102: pop
     103: goto          52
     106: aload         5
     108: checkcast     #52                 // class java/util/List
     111: nop
     112: astore_1
     113: aload_1
     114: iload_0
     115: invokestatic  #177                // Method findIncrSeqMembers:(Ljava/util/List;I)Ljava/util/List;
     118: astore_2
     119: aload_2
     120: ifnull        167
     123: aload_2
     124: astore        4
     126: iconst_0
     127: istore        5
     129: ldc           #179                // String YES
     131: getstatic     #185                // Field java/lang/System.out:Ljava/io/PrintStream;
     134: swap
     135: invokevirtual #191                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     138: aload         4
     140: checkcast     #28                 // class java/lang/Iterable
     143: ldc           #193                // String
     145: checkcast     #9                  // class java/lang/CharSequence
     148: aconst_null
     149: aconst_null
     150: iconst_0
     151: aconst_null
     152: aconst_null
     153: bipush        62
     155: aconst_null
     156: invokestatic  #197                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     159: getstatic     #185                // Field java/lang/System.out:Ljava/io/PrintStream;
     162: swap
     163: invokevirtual #191                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     166: return
     167: ldc           #199                // String NO
     169: getstatic     #185                // Field java/lang/System.out:Ljava/io/PrintStream;
     172: swap
     173: invokevirtual #191                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     176: return

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

Compiled from "_Collections.kt"
public final class HKt$counts$$inlined$groupingBy$1 implements kotlin.collections.Grouping<T, T> {
  final java.lang.Iterable $this_groupingBy;

  public HKt$counts$$inlined$groupingBy$1(java.lang.Iterable);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       5: aload_0
       6: invokespecial #21                 // Method java/lang/Object."<init>":()V
       9: return

  public java.util.Iterator<T> sourceIterator();
    Code:
       0: aload_0
       1: getfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       4: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
       9: areturn

  public T keyOf(T);
    Code:
       0: aload_1
       1: astore_2
       2: iconst_0
       3: istore_3
       4: aload_2
       5: areturn
}


// https://codeforces.com/contest/1911/problem/F

private fun String.splitWhitespace() = split("\\s+".toRegex())
private fun <T> List<T>.counts(): Map<T, Int> = this.groupingBy { it }.eachCount()

fun idealUniqueWeights(weights: List<Int>): Set<Int> {
    val uniqueWeights = mutableSetOf<Int>()
    for (weight in weights.sorted()) {
        if (weight > 1) {
            // First try to insert weight-1
            if (!uniqueWeights.contains(weight - 1)) {
                uniqueWeights.add(weight - 1)
                continue
            }
        }
        // Next try to insert weight
        if (!uniqueWeights.contains(weight)) {
            uniqueWeights.add(weight)
            continue
        }
        // Finally try to insert weight+1
        if (!uniqueWeights.contains(weight + 1)) {
            uniqueWeights.add(weight + 1)
        }
    }
    return uniqueWeights
}

fun main() {
    // n boxers. n in 1..=150_000
    val n = readln().toInt()

    // weight of each boxer.
    // n ints, a_i where a_i in 1..150_000
    val a = readln().splitWhitespace().map { it.toInt() }

    println(idealUniqueWeights(a).size)
}

Compiled from "_Collections.kt"
public final class FKt$counts$$inlined$groupingBy$1 implements kotlin.collections.Grouping<T, T> {
  final java.lang.Iterable $this_groupingBy;

  public FKt$counts$$inlined$groupingBy$1(java.lang.Iterable);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       5: aload_0
       6: invokespecial #21                 // Method java/lang/Object."<init>":()V
       9: return

  public java.util.Iterator<T> sourceIterator();
    Code:
       0: aload_0
       1: getfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       4: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
       9: areturn

  public T keyOf(T);
    Code:
       0: aload_1
       1: astore_2
       2: iconst_0
       3: istore_3
       4: aload_2
       5: areturn
}

Compiled from "F.kt"
public final class FKt {
  private static final java.util.List<java.lang.String> splitWhitespace(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #9                  // class java/lang/CharSequence
       4: astore_1
       5: new           #11                 // class kotlin/text/Regex
       8: dup
       9: ldc           #13                 // String \\s+
      11: invokespecial #17                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: aload_1
      19: iload_3
      20: invokevirtual #21                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      23: areturn

  private static final <T> java.util.Map<T, java.lang.Integer> counts(java.util.List<? extends T>);
    Code:
       0: aload_0
       1: checkcast     #28                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: new           #30                 // class FKt$counts$$inlined$groupingBy$1
      10: dup
      11: aload_1
      12: invokespecial #33                 // Method FKt$counts$$inlined$groupingBy$1."<init>":(Ljava/lang/Iterable;)V
      15: checkcast     #35                 // class kotlin/collections/Grouping
      18: invokestatic  #41                 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;
      21: areturn

  public static final java.util.Set<java.lang.Integer> idealUniqueWeights(java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #53                 // String weights
       3: invokestatic  #59                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #61                 // class java/util/LinkedHashSet
       9: dup
      10: invokespecial #64                 // Method java/util/LinkedHashSet."<init>":()V
      13: checkcast     #66                 // class java/util/Set
      16: astore_1
      17: aload_0
      18: checkcast     #28                 // class java/lang/Iterable
      21: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
      24: invokeinterface #78,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      29: astore_2
      30: aload_2
      31: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifeq          146
      39: aload_2
      40: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: checkcast     #90                 // class java/lang/Number
      48: invokevirtual #94                 // Method java/lang/Number.intValue:()I
      51: istore_3
      52: iload_3
      53: iconst_1
      54: if_icmple     88
      57: aload_1
      58: iload_3
      59: iconst_1
      60: isub
      61: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      64: invokeinterface #104,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      69: ifne          88
      72: aload_1
      73: iload_3
      74: iconst_1
      75: isub
      76: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      79: invokeinterface #107,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
      84: pop
      85: goto          30
      88: aload_1
      89: iload_3
      90: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      93: invokeinterface #104,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      98: ifne          115
     101: aload_1
     102: iload_3
     103: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     106: invokeinterface #107,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     111: pop
     112: goto          30
     115: aload_1
     116: iload_3
     117: iconst_1
     118: iadd
     119: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     122: invokeinterface #104,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     127: ifne          30
     130: aload_1
     131: iload_3
     132: iconst_1
     133: iadd
     134: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     137: invokeinterface #107,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     142: pop
     143: goto          30
     146: aload_1
     147: areturn

  public static final void main();
    Code:
       0: invokestatic  #117                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #121                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: istore_0
       7: invokestatic  #117                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
      10: invokestatic  #123                // Method splitWhitespace:(Ljava/lang/String;)Ljava/util/List;
      13: checkcast     #28                 // class java/lang/Iterable
      16: astore_2
      17: iconst_0
      18: istore_3
      19: aload_2
      20: astore        4
      22: new           #125                // class java/util/ArrayList
      25: dup
      26: aload_2
      27: bipush        10
      29: invokestatic  #129                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      32: invokespecial #132                // Method java/util/ArrayList."<init>":(I)V
      35: checkcast     #134                // class java/util/Collection
      38: astore        5
      40: iconst_0
      41: istore        6
      43: aload         4
      45: invokeinterface #135,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      50: astore        7
      52: aload         7
      54: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          106
      62: aload         7
      64: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      69: astore        8
      71: aload         5
      73: aload         8
      75: checkcast     #137                // class java/lang/String
      78: astore        9
      80: astore        11
      82: iconst_0
      83: istore        10
      85: aload         9
      87: invokestatic  #121                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      90: nop
      91: invokestatic  #100                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      94: aload         11
      96: swap
      97: invokeinterface #138,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     102: pop
     103: goto          52
     106: aload         5
     108: checkcast     #74                 // class java/util/List
     111: nop
     112: astore_1
     113: aload_1
     114: invokestatic  #140                // Method idealUniqueWeights:(Ljava/util/List;)Ljava/util/Set;
     117: invokeinterface #143,  1          // InterfaceMethod java/util/Set.size:()I
     122: istore_2
     123: getstatic     #149                // Field java/lang/System.out:Ljava/io/PrintStream;
     126: iload_2
     127: invokevirtual #154                // Method java/io/PrintStream.println:(I)V
     130: return

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


import java.util.*

private fun String.splitWhitespace() = split("\\s+".toRegex())

fun greatestPowerUpTo(n: Int): Int? {
    if (n < 1) {
        return null
    }
    var p = 1
    while (p < n) {
        if (p * 2 > n) {
            return p
        }
        p *= 2
    }
    return p
}

fun asPower2Sum(n: Int, k: Int): List<Int>? {
    // First, find the smallest list of powers of 2 we can use to write n. If it's longer than k, return null.
    val powers = LinkedList<Int>()
    var remainder = n
    var powersUsed = 0
    while (remainder > 0) {
        val p = greatestPowerUpTo(remainder)!!
        remainder -= p
        powers.add(p)
        powersUsed++
        if (powersUsed > k) {
            // return null if not possible
            return null
        }
    }

    // Next, break up any powers we can until we can reach k, or we get all 1's.
    while (powers.size < k) {
        val f = powers.first
        if (f == 1) {
            // first value is a 1 - we can't reach k
            return null
        }
        powers.removeFirst()
        if (f == 2) {
            powers.add(1)
            powers.add(1)
        } else {
            powers.add(0, f / 2)
            powers.add(0, f / 2)
        }
    }
    return powers.sorted()
}

fun main() {
    // Can we write n as a sum of exactly k powers of 2?
    // n in 1..=1e9
    // k in 1..=2e5
    val (n, k) = readln().splitWhitespace().map { it.toInt() }
    asPower2Sum(n, k)?.let {
        println("YES")
        println(it.joinToString(" "))
        return
    }
    println("NO")
}

Compiled from "e.kt"
public final class EKt {
  private static final java.util.List<java.lang.String> splitWhitespace(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #9                  // class java/lang/CharSequence
       4: astore_1
       5: new           #11                 // class kotlin/text/Regex
       8: dup
       9: ldc           #13                 // String \\s+
      11: invokespecial #17                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: aload_1
      19: iload_3
      20: invokevirtual #21                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      23: areturn

  public static final java.lang.Integer greatestPowerUpTo(int);
    Code:
       0: iload_0
       1: iconst_1
       2: if_icmpge     7
       5: aconst_null
       6: areturn
       7: iconst_1
       8: istore_1
       9: iload_1
      10: iload_0
      11: if_icmpge     33
      14: iload_1
      15: iconst_2
      16: imul
      17: iload_0
      18: if_icmple     26
      21: iload_1
      22: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: areturn
      26: iload_1
      27: iconst_2
      28: imul
      29: istore_1
      30: goto          9
      33: iload_1
      34: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      37: areturn

  public static final java.util.List<java.lang.Integer> asPower2Sum(int, int);
    Code:
       0: new           #39                 // class java/util/LinkedList
       3: dup
       4: invokespecial #42                 // Method java/util/LinkedList."<init>":()V
       7: astore_2
       8: iload_0
       9: istore_3
      10: iconst_0
      11: istore        4
      13: iload_3
      14: ifle          56
      17: iload_3
      18: invokestatic  #44                 // Method greatestPowerUpTo:(I)Ljava/lang/Integer;
      21: dup
      22: invokestatic  #50                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      25: invokevirtual #54                 // Method java/lang/Integer.intValue:()I
      28: istore        5
      30: iload_3
      31: iload         5
      33: isub
      34: istore_3
      35: aload_2
      36: iload         5
      38: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      41: invokevirtual #58                 // Method java/util/LinkedList.add:(Ljava/lang/Object;)Z
      44: pop
      45: iinc          4, 1
      48: iload         4
      50: iload_1
      51: if_icmple     13
      54: aconst_null
      55: areturn
      56: aload_2
      57: invokevirtual #61                 // Method java/util/LinkedList.size:()I
      60: iload_1
      61: if_icmpge     176
      64: aload_2
      65: invokevirtual #65                 // Method java/util/LinkedList.getFirst:()Ljava/lang/Object;
      68: checkcast     #28                 // class java/lang/Integer
      71: astore        5
      73: aload         5
      75: iconst_1
      76: istore        6
      78: dup
      79: ifnonnull     86
      82: pop
      83: goto          96
      86: invokevirtual #54                 // Method java/lang/Integer.intValue:()I
      89: iload         6
      91: if_icmpne     96
      94: aconst_null
      95: areturn
      96: aload_2
      97: invokevirtual #68                 // Method java/util/LinkedList.removeFirst:()Ljava/lang/Object;
     100: pop
     101: aload         5
     103: iconst_2
     104: istore        6
     106: dup
     107: ifnonnull     114
     110: pop
     111: goto          143
     114: invokevirtual #54                 // Method java/lang/Integer.intValue:()I
     117: iload         6
     119: if_icmpne     143
     122: aload_2
     123: iconst_1
     124: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     127: invokevirtual #58                 // Method java/util/LinkedList.add:(Ljava/lang/Object;)Z
     130: pop
     131: aload_2
     132: iconst_1
     133: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     136: invokevirtual #58                 // Method java/util/LinkedList.add:(Ljava/lang/Object;)Z
     139: pop
     140: goto          56
     143: aload_2
     144: iconst_0
     145: aload         5
     147: invokevirtual #54                 // Method java/lang/Integer.intValue:()I
     150: iconst_2
     151: idiv
     152: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     155: invokevirtual #71                 // Method java/util/LinkedList.add:(ILjava/lang/Object;)V
     158: aload_2
     159: iconst_0
     160: aload         5
     162: invokevirtual #54                 // Method java/lang/Integer.intValue:()I
     165: iconst_2
     166: idiv
     167: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     170: invokevirtual #71                 // Method java/util/LinkedList.add:(ILjava/lang/Object;)V
     173: goto          56
     176: aload_2
     177: checkcast     #73                 // class java/lang/Iterable
     180: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
     183: areturn

  public static final void main();
    Code:
       0: invokestatic  #93                 // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #95                 // Method splitWhitespace:(Ljava/lang/String;)Ljava/util/List;
       6: checkcast     #73                 // class java/lang/Iterable
       9: astore_1
      10: iconst_0
      11: istore_2
      12: aload_1
      13: astore_3
      14: new           #97                 // class java/util/ArrayList
      17: dup
      18: aload_1
      19: bipush        10
      21: invokestatic  #101                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      24: invokespecial #104                // Method java/util/ArrayList."<init>":(I)V
      27: checkcast     #106                // class java/util/Collection
      30: astore        4
      32: iconst_0
      33: istore        5
      35: aload_3
      36: invokeinterface #110,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        6
      43: aload         6
      45: invokeinterface #116,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          97
      53: aload         6
      55: invokeinterface #119,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        7
      62: aload         4
      64: aload         7
      66: checkcast     #121                // class java/lang/String
      69: astore        8
      71: astore        10
      73: iconst_0
      74: istore        9
      76: aload         8
      78: invokestatic  #125                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      81: nop
      82: invokestatic  #31                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      85: aload         10
      87: swap
      88: invokeinterface #126,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      93: pop
      94: goto          43
      97: aload         4
      99: checkcast     #128                // class java/util/List
     102: nop
     103: astore_0
     104: aload_0
     105: iconst_0
     106: invokeinterface #132,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     111: checkcast     #134                // class java/lang/Number
     114: invokevirtual #135                // Method java/lang/Number.intValue:()I
     117: istore_1
     118: aload_0
     119: iconst_1
     120: invokeinterface #132,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     125: checkcast     #134                // class java/lang/Number
     128: invokevirtual #135                // Method java/lang/Number.intValue:()I
     131: istore_2
     132: iload_1
     133: iload_2
     134: invokestatic  #137                // Method asPower2Sum:(II)Ljava/util/List;
     137: astore_3
     138: aload_3
     139: ifnull        186
     142: aload_3
     143: astore        5
     145: iconst_0
     146: istore        6
     148: ldc           #139                // String YES
     150: getstatic     #145                // Field java/lang/System.out:Ljava/io/PrintStream;
     153: swap
     154: invokevirtual #150                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     157: aload         5
     159: checkcast     #73                 // class java/lang/Iterable
     162: ldc           #152                // String
     164: checkcast     #9                  // class java/lang/CharSequence
     167: aconst_null
     168: aconst_null
     169: iconst_0
     170: aconst_null
     171: aconst_null
     172: bipush        62
     174: aconst_null
     175: invokestatic  #156                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     178: getstatic     #145                // Field java/lang/System.out:Ljava/io/PrintStream;
     181: swap
     182: invokevirtual #150                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     185: return
     186: ldc           #158                // String NO
     188: getstatic     #145                // Field java/lang/System.out:Ljava/io/PrintStream;
     191: swap
     192: invokevirtual #150                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     195: return

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


import kotlin.streams.toList

// https://codeforces.com/contest/1907/problem/C
private fun readInt(): Int = readln().toInt()
private fun <T> List<T>.counts(): Map<T, Int> = this.groupingBy { it }.eachCount()
private fun solve(n: Int, s: String): Int {
    // https://codeforces.com/blog/entry/123012

    // The final string will always have all of the same characters.
    // If a character appears more than n/2 times, the final string will consist only of that character.
    val charCounts = s.chars().toList().counts().toMutableMap()
    var dominantChar: Int? = null
    var dominantCharCount: Int? = null
    for (charCount in charCounts) {
        if (charCount.value > n / 2) {
            // One char dominates
            dominantChar = charCount.key
            dominantCharCount = charCount.value
            break
        }
    }
    if (dominantChar == null || dominantCharCount == null) {
        // No character dominates - all pairs can be deleted
        return n % 2
    }

    charCounts.remove(dominantChar)
    return dominantCharCount - charCounts.values.sum()
}

private fun testcase() {
    val n = readInt()
    val s = readln()
    val min = solve(n, s)
    println(min)
}

fun main() {
//    val min = solve(20000, "abacd".repeat(20000 / 5))
//    val min = solve(2000, "aaacd".repeat(2000 / 5))
//    println(min)
//    return
    val t = readInt()
    for (i in 0..<t) {
        testcase()
    }
}

Compiled from "_Collections.kt"
public final class CFixedKt$counts$$inlined$groupingBy$1 implements kotlin.collections.Grouping<T, T> {
  final java.lang.Iterable $this_groupingBy;

  public CFixedKt$counts$$inlined$groupingBy$1(java.lang.Iterable);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       5: aload_0
       6: invokespecial #21                 // Method java/lang/Object."<init>":()V
       9: return

  public java.util.Iterator<T> sourceIterator();
    Code:
       0: aload_0
       1: getfield      #18                 // Field $this_groupingBy:Ljava/lang/Iterable;
       4: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
       9: areturn

  public T keyOf(T);
    Code:
       0: aload_1
       1: astore_2
       2: iconst_0
       3: istore_3
       4: aload_2
       5: areturn
}

Compiled from "CFixed.kt"
public final class CFixedKt {
  private static final int readInt();
    Code:
       0: invokestatic  #12                 // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #18                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: ireturn

  private static final <T> java.util.Map<T, java.lang.Integer> counts(java.util.List<? extends T>);
    Code:
       0: aload_0
       1: checkcast     #23                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: new           #25                 // class CFixedKt$counts$$inlined$groupingBy$1
      10: dup
      11: aload_1
      12: invokespecial #29                 // Method CFixedKt$counts$$inlined$groupingBy$1."<init>":(Ljava/lang/Iterable;)V
      15: checkcast     #31                 // class kotlin/collections/Grouping
      18: invokestatic  #37                 // Method kotlin/collections/GroupingKt.eachCount:(Lkotlin/collections/Grouping;)Ljava/util/Map;
      21: areturn

  private static final int solve(int, java.lang.String);
    Code:
       0: aload_1
       1: invokevirtual #51                 // Method java/lang/String.chars:()Ljava/util/stream/IntStream;
       4: dup
       5: ldc           #53                 // String chars(...)
       7: invokestatic  #59                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      10: invokestatic  #65                 // Method kotlin/streams/jdk8/StreamsKt.toList:(Ljava/util/stream/IntStream;)Ljava/util/List;
      13: invokestatic  #67                 // Method counts:(Ljava/util/List;)Ljava/util/Map;
      16: invokestatic  #73                 // Method kotlin/collections/MapsKt.toMutableMap:(Ljava/util/Map;)Ljava/util/Map;
      19: astore_2
      20: aconst_null
      21: astore_3
      22: aconst_null
      23: astore        4
      25: aload_2
      26: invokeinterface #79,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      31: invokeinterface #85,  1           // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      36: astore        5
      38: aload         5
      40: invokeinterface #91,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          105
      48: aload         5
      50: invokeinterface #95,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: checkcast     #97                 // class java/util/Map$Entry
      58: astore        6
      60: aload         6
      62: invokeinterface #100,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
      67: checkcast     #102                // class java/lang/Number
      70: invokevirtual #105                // Method java/lang/Number.intValue:()I
      73: iload_0
      74: iconst_2
      75: idiv
      76: if_icmple     38
      79: aload         6
      81: invokeinterface #108,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
      86: checkcast     #14                 // class java/lang/Integer
      89: astore_3
      90: aload         6
      92: invokeinterface #100,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
      97: checkcast     #14                 // class java/lang/Integer
     100: astore        4
     102: goto          105
     105: aload_3
     106: ifnull        114
     109: aload         4
     111: ifnonnull     118
     114: iload_0
     115: iconst_2
     116: irem
     117: ireturn
     118: aload_2
     119: aload_3
     120: invokeinterface #112,  2          // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
     125: pop
     126: aload         4
     128: invokevirtual #113                // Method java/lang/Integer.intValue:()I
     131: aload_2
     132: invokeinterface #117,  1          // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
     137: checkcast     #23                 // class java/lang/Iterable
     140: invokestatic  #123                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     143: isub
     144: ireturn

  private static final void testcase();
    Code:
       0: invokestatic  #137                // Method readInt:()I
       3: istore_0
       4: invokestatic  #12                 // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       7: astore_1
       8: iload_0
       9: aload_1
      10: invokestatic  #139                // Method solve:(ILjava/lang/String;)I
      13: istore_2
      14: getstatic     #145                // Field java/lang/System.out:Ljava/io/PrintStream;
      17: iload_2
      18: invokevirtual #151                // Method java/io/PrintStream.println:(I)V
      21: return

  public static final void main();
    Code:
       0: invokestatic  #137                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     20
      11: invokestatic  #155                // Method testcase:()V
      14: iinc          1, 1
      17: goto          6
      20: return

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


import kotlin.math.max
import kotlin.math.min

// https://codeforces.com/contest/1907/problem/D

private fun String.splitWhitespace() = split("\\s+".toRegex())
private fun readInt(): Int = readln().toInt()
private fun readInts(): List<Int> = readln().splitWhitespace().map { it.toInt() }

private fun testK(segments: List<IntRange>, k: Int): Boolean {
    var location = 0..0
    for (segment in segments) {
        // Our location becomes the intersection of this segment, with the locations we can be after
        // jumping up to k.
        val locMin = max(0, location.first - k)
        val locMax = min(1_000_000_000, location.last + k)
        location = max(locMin, segment.first)..min(locMax, segment.last)

        // If the intersection is empty, return false.
        if (location.isEmpty()) {
            return false
        }
    }

    return true
}

private fun solve(segments: List<IntRange>): Int {
    // Find smallest k where testK is true
    var kL = 0
    var kR = 1_000_000_000

    var minPassed = kR
    while (kL < kR) {
        val kM = (kL + kR) / 2
        if (testK(segments, kM)) {
            minPassed = min(minPassed, kM)
            // try smaller
            kR = kM - 1
        } else {
            // Try bigger
            kL = kM + 1
        }
    }
    if (kL == kR) {
        if (testK(segments, kL)) {
            minPassed = min(minPassed, kL)
        }
    }
    return minPassed
}

private fun testcase() {
    val n = readInt()
    val segments = MutableList(n) { 0..0 }
    for (i in 0..<n) {
        val lr = readInts()
        val l = lr[0]
        val r = lr[1]
        segments[i] = l..r
    }
    println(solve(segments))
}

fun main() {
    val t = readInt()
    for (i in 0..<t) {
        testcase()
    }
}

Compiled from "D.kt"
public final class DKt {
  private static final java.util.List<java.lang.String> splitWhitespace(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #9                  // class java/lang/CharSequence
       4: astore_1
       5: new           #11                 // class kotlin/text/Regex
       8: dup
       9: ldc           #13                 // String \\s+
      11: invokespecial #17                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: aload_1
      19: iload_3
      20: invokevirtual #21                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      23: areturn

  private static final int readInt();
    Code:
       0: invokestatic  #31                 // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #37                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: ireturn

  private static final java.util.List<java.lang.Integer> readInts();
    Code:
       0: invokestatic  #31                 // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #42                 // Method splitWhitespace:(Ljava/lang/String;)Ljava/util/List;
       6: checkcast     #44                 // class java/lang/Iterable
       9: astore_0
      10: iconst_0
      11: istore_1
      12: aload_0
      13: astore_2
      14: new           #46                 // class java/util/ArrayList
      17: dup
      18: aload_0
      19: bipush        10
      21: invokestatic  #52                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      24: invokespecial #55                 // Method java/util/ArrayList."<init>":(I)V
      27: checkcast     #57                 // class java/util/Collection
      30: astore_3
      31: iconst_0
      32: istore        4
      34: aload_2
      35: invokeinterface #61,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      40: astore        5
      42: aload         5
      44: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      49: ifeq          95
      52: aload         5
      54: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      59: astore        6
      61: aload_3
      62: aload         6
      64: checkcast     #73                 // class java/lang/String
      67: astore        7
      69: astore        9
      71: iconst_0
      72: istore        8
      74: aload         7
      76: invokestatic  #37                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      79: nop
      80: invokestatic  #77                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      83: aload         9
      85: swap
      86: invokeinterface #81,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      91: pop
      92: goto          42
      95: aload_3
      96: checkcast     #83                 // class java/util/List
      99: nop
     100: areturn

  private static final boolean testK(java.util.List<kotlin.ranges.IntRange>, int);
    Code:
       0: new           #100                // class kotlin/ranges/IntRange
       3: dup
       4: iconst_0
       5: iconst_0
       6: invokespecial #103                // Method kotlin/ranges/IntRange."<init>":(II)V
       9: astore_2
      10: aload_0
      11: invokeinterface #104,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      16: astore_3
      17: aload_3
      18: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      23: ifeq          99
      26: aload_3
      27: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      32: checkcast     #100                // class kotlin/ranges/IntRange
      35: astore        4
      37: iconst_0
      38: aload_2
      39: invokevirtual #107                // Method kotlin/ranges/IntRange.getFirst:()I
      42: iload_1
      43: isub
      44: invokestatic  #113                // Method java/lang/Math.max:(II)I
      47: istore        5
      49: ldc           #114                // int 1000000000
      51: aload_2
      52: invokevirtual #117                // Method kotlin/ranges/IntRange.getLast:()I
      55: iload_1
      56: iadd
      57: invokestatic  #120                // Method java/lang/Math.min:(II)I
      60: istore        6
      62: new           #100                // class kotlin/ranges/IntRange
      65: dup
      66: iload         5
      68: aload         4
      70: invokevirtual #107                // Method kotlin/ranges/IntRange.getFirst:()I
      73: invokestatic  #113                // Method java/lang/Math.max:(II)I
      76: iload         6
      78: aload         4
      80: invokevirtual #117                // Method kotlin/ranges/IntRange.getLast:()I
      83: invokestatic  #120                // Method java/lang/Math.min:(II)I
      86: invokespecial #103                // Method kotlin/ranges/IntRange."<init>":(II)V
      89: astore_2
      90: aload_2
      91: invokevirtual #123                // Method kotlin/ranges/IntRange.isEmpty:()Z
      94: ifeq          17
      97: iconst_0
      98: ireturn
      99: iconst_1
     100: ireturn

  private static final int solve(java.util.List<kotlin.ranges.IntRange>);
    Code:
       0: iconst_0
       1: istore_1
       2: ldc           #114                // int 1000000000
       4: istore_2
       5: iload_2
       6: istore_3
       7: iload_1
       8: iload_2
       9: if_icmpge     51
      12: iload_1
      13: iload_2
      14: iadd
      15: iconst_2
      16: idiv
      17: istore        4
      19: aload_0
      20: iload         4
      22: invokestatic  #136                // Method testK:(Ljava/util/List;I)Z
      25: ifeq          43
      28: iload_3
      29: iload         4
      31: invokestatic  #120                // Method java/lang/Math.min:(II)I
      34: istore_3
      35: iload         4
      37: iconst_1
      38: isub
      39: istore_2
      40: goto          7
      43: iload         4
      45: iconst_1
      46: iadd
      47: istore_1
      48: goto          7
      51: iload_1
      52: iload_2
      53: if_icmpne     70
      56: aload_0
      57: iload_1
      58: invokestatic  #136                // Method testK:(Ljava/util/List;I)Z
      61: ifeq          70
      64: iload_3
      65: iload_1
      66: invokestatic  #120                // Method java/lang/Math.min:(II)I
      69: istore_3
      70: iload_3
      71: ireturn

  private static final void testcase();
    Code:
       0: invokestatic  #144                // Method readInt:()I
       3: istore_0
       4: new           #46                 // class java/util/ArrayList
       7: dup
       8: iload_0
       9: invokespecial #55                 // Method java/util/ArrayList."<init>":(I)V
      12: astore_2
      13: iconst_0
      14: istore_3
      15: iload_3
      16: iload_0
      17: if_icmpge     55
      20: iload_3
      21: istore        4
      23: aload_2
      24: iload         4
      26: istore        5
      28: astore        7
      30: iconst_0
      31: istore        6
      33: new           #100                // class kotlin/ranges/IntRange
      36: dup
      37: iconst_0
      38: iconst_0
      39: invokespecial #103                // Method kotlin/ranges/IntRange."<init>":(II)V
      42: aload         7
      44: swap
      45: invokevirtual #145                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      48: pop
      49: iinc          3, 1
      52: goto          15
      55: aload_2
      56: checkcast     #83                 // class java/util/List
      59: astore_1
      60: iconst_0
      61: istore_2
      62: iload_2
      63: iload_0
      64: if_icmpge     126
      67: invokestatic  #147                // Method readInts:()Ljava/util/List;
      70: astore_3
      71: aload_3
      72: iconst_0
      73: invokeinterface #151,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      78: checkcast     #153                // class java/lang/Number
      81: invokevirtual #156                // Method java/lang/Number.intValue:()I
      84: istore        4
      86: aload_3
      87: iconst_1
      88: invokeinterface #151,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      93: checkcast     #153                // class java/lang/Number
      96: invokevirtual #156                // Method java/lang/Number.intValue:()I
      99: istore        5
     101: aload_1
     102: iload_2
     103: new           #100                // class kotlin/ranges/IntRange
     106: dup
     107: iload         4
     109: iload         5
     111: invokespecial #103                // Method kotlin/ranges/IntRange."<init>":(II)V
     114: invokeinterface #160,  3          // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;
     119: pop
     120: iinc          2, 1
     123: goto          62
     126: aload_1
     127: invokestatic  #162                // Method solve:(Ljava/util/List;)I
     130: istore_2
     131: getstatic     #168                // Field java/lang/System.out:Ljava/io/PrintStream;
     134: iload_2
     135: invokevirtual #173                // Method java/io/PrintStream.println:(I)V
     138: return

  public static final void main();
    Code:
       0: invokestatic  #144                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     20
      11: invokestatic  #182                // Method testcase:()V
      14: iinc          1, 1
      17: goto          6
      20: return

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


import java.math.BigInteger

private fun String.splitWhitespace() = split("\\s+".toRegex())

// s1 and s2 both have the same length
fun averageString(s1: String, s2: String, len: Int): String {
//    // Work backwards from the end
//    val avgStrChars = MutableList<Char>(len) { '?' }
//    var remainder = 0
//    for (i in len - 1 downTo 0) {
//        // Add the chars together, then divide by two
//        val c1Val = s1[i] - 'a'
//        val c2Val = s2[i] - 'a'
//        val (avgC, nextRemainder) = if (c1Val == c2Val) {
//            Pair(c1Val, 0)
//        } else if (c1Val < c2Val) {
//            Pair((c1Val + c2Val) / 2, 0)
//        } else {
//            // c1Val > c2Val
//            Pair((c1Val + c2Val + 26) / 2, -1)
//        }
//
//        avgStrChars[i] = (remainder + avgC % 26 + ('a'.code)).toChar()
//        remainder = if (c1Val + c2Val > 25) 1 else 0
//    }
//
//    return avgStrChars.joinToString("")

    var s1Num = BigInteger.ZERO
    var s2Num = BigInteger.ZERO
    for (i in 0 until len) {
        val c1Val = (s1[i] - 'a').toLong()
        val c2Val = (s2[i] - 'a').toLong()

        val placeFactor = BigInteger.valueOf(26).pow(len - i - 1)
        s1Num = s1Num.plus(BigInteger.valueOf(c1Val).times(placeFactor))
        s2Num = s2Num.plus(BigInteger.valueOf(c2Val).times(placeFactor))
    }
    val sAvg = s1Num.plus(s2Num).divide(BigInteger.valueOf(2))

    val resChars = mutableListOf<Char>()
    var rem = sAvg
    var exp = len - 1
    while (exp >= 0) {
        val divisor = BigInteger.valueOf(26).pow(exp)
        val n = rem.divide(divisor).toInt()
        rem = rem.mod(divisor)
        exp--

        val c = (n + 'a'.code).toChar()
        resChars.add(c)
    }
    return resChars.joinToString("")
}

fun main() {
    // len(s) = len(t) = k
    // k in 1..=2e5
    val k = readln().toInt()

    val s = readln()
    val t = readln()

    // Find the median string that is (> s) and (< t)
    // We know there are an odd number of such strings

    // Median will be the same as the mean
    // Treat strings like k-digit numbers in base 26.
    println(averageString(s, t, k))
}

Compiled from "G.kt"
public final class GKt {
  private static final java.util.List<java.lang.String> splitWhitespace(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #9                  // class java/lang/CharSequence
       4: astore_1
       5: new           #11                 // class kotlin/text/Regex
       8: dup
       9: ldc           #13                 // String \\s+
      11: invokespecial #17                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: aload_1
      19: iload_3
      20: invokevirtual #21                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      23: areturn

  public static final java.lang.String averageString(java.lang.String, java.lang.String, int);
    Code:
       0: aload_0
       1: ldc           #28                 // String s1
       3: invokestatic  #34                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #36                 // String s2
       9: invokestatic  #34                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: getstatic     #42                 // Field java/math/BigInteger.ZERO:Ljava/math/BigInteger;
      15: astore_3
      16: getstatic     #42                 // Field java/math/BigInteger.ZERO:Ljava/math/BigInteger;
      19: astore        4
      21: iconst_0
      22: istore        5
      24: iload         5
      26: iload_2
      27: if_icmpge     192
      30: aload_0
      31: iload         5
      33: invokevirtual #48                 // Method java/lang/String.charAt:(I)C
      36: bipush        97
      38: isub
      39: i2l
      40: lstore        6
      42: aload_1
      43: iload         5
      45: invokevirtual #48                 // Method java/lang/String.charAt:(I)C
      48: bipush        97
      50: isub
      51: i2l
      52: lstore        8
      54: ldc2_w        #49                 // long 26l
      57: invokestatic  #54                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
      60: iload_2
      61: iload         5
      63: isub
      64: iconst_1
      65: isub
      66: invokevirtual #58                 // Method java/math/BigInteger.pow:(I)Ljava/math/BigInteger;
      69: astore        10
      71: aload_3
      72: astore        11
      74: aload         11
      76: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      79: aload         11
      81: astore        11
      83: lload         6
      85: invokestatic  #54                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
      88: dup
      89: ldc           #64                 // String valueOf(...)
      91: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      94: astore        12
      96: aload         10
      98: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     101: aload         12
     103: aload         10
     105: invokevirtual #71                 // Method java/math/BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     108: dup
     109: ldc           #73                 // String multiply(...)
     111: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     114: astore        12
     116: aload         11
     118: aload         12
     120: invokevirtual #76                 // Method java/math/BigInteger.add:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     123: dup
     124: ldc           #78                 // String add(...)
     126: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     129: astore_3
     130: aload         4
     132: astore        11
     134: aload         11
     136: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     139: aload         11
     141: astore        11
     143: lload         8
     145: invokestatic  #54                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
     148: dup
     149: ldc           #64                 // String valueOf(...)
     151: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     154: astore        12
     156: aload         12
     158: aload         10
     160: invokevirtual #71                 // Method java/math/BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     163: dup
     164: ldc           #73                 // String multiply(...)
     166: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     169: astore        12
     171: aload         11
     173: aload         12
     175: invokevirtual #76                 // Method java/math/BigInteger.add:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     178: dup
     179: ldc           #78                 // String add(...)
     181: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     184: astore        4
     186: iinc          5, 1
     189: goto          24
     192: aload_3
     193: astore        6
     195: aload         6
     197: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     200: aload         6
     202: astore        6
     204: aload         4
     206: astore        7
     208: aload         7
     210: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     213: aload         6
     215: aload         7
     217: invokevirtual #76                 // Method java/math/BigInteger.add:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     220: dup
     221: ldc           #78                 // String add(...)
     223: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     226: ldc2_w        #79                 // long 2l
     229: invokestatic  #54                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
     232: invokevirtual #83                 // Method java/math/BigInteger.divide:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     235: astore        5
     237: new           #85                 // class java/util/ArrayList
     240: dup
     241: invokespecial #88                 // Method java/util/ArrayList."<init>":()V
     244: checkcast     #90                 // class java/util/List
     247: astore        6
     249: aload         5
     251: astore        7
     253: iload_2
     254: iconst_1
     255: isub
     256: istore        8
     258: iload         8
     260: iflt          324
     263: ldc2_w        #49                 // long 26l
     266: invokestatic  #54                 // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
     269: iload         8
     271: invokevirtual #58                 // Method java/math/BigInteger.pow:(I)Ljava/math/BigInteger;
     274: astore        9
     276: aload         7
     278: aload         9
     280: invokevirtual #83                 // Method java/math/BigInteger.divide:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     283: invokevirtual #94                 // Method java/math/BigInteger.intValue:()I
     286: istore        10
     288: aload         7
     290: aload         9
     292: invokevirtual #97                 // Method java/math/BigInteger.mod:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     295: astore        7
     297: iinc          8, -1
     300: iload         10
     302: bipush        97
     304: iadd
     305: i2c
     306: istore        11
     308: aload         6
     310: iload         11
     312: invokestatic  #102                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     315: invokeinterface #105,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     320: pop
     321: goto          258
     324: aload         6
     326: checkcast     #107                // class java/lang/Iterable
     329: ldc           #109                // String
     331: checkcast     #9                  // class java/lang/CharSequence
     334: aconst_null
     335: aconst_null
     336: iconst_0
     337: aconst_null
     338: aconst_null
     339: bipush        62
     341: aconst_null
     342: invokestatic  #115                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     345: areturn

  public static final void main();
    Code:
       0: invokestatic  #140                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #146                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: istore_0
       7: invokestatic  #140                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
      10: astore_1
      11: invokestatic  #140                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
      14: astore_2
      15: aload_1
      16: aload_2
      17: iload_0
      18: invokestatic  #148                // Method averageString:(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;
      21: getstatic     #154                // Field java/lang/System.out:Ljava/io/PrintStream;
      24: swap
      25: invokevirtual #159                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      28: return

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