from sys import stdin   input_1 = stdin . readline ( ) . split ( )   cities = int ( input_1 [ 0 ] ) roads = int ( input_1 [ 1 ] ) warehouses = int ( input_1 [ 2 ] )   graph = [ dict ( ) for _ in range ( cities ) ]   if warehouses == 0 or warehouses >= cities :   print ( ' - 1' )   else :   for i in range ( roads ) :   new_road = stdin . readline ( ) . split ( )   city_1 = int ( new_road [ 0 ] ) city_2 = new_road [ 1 ] length = int ( new_road [ 2 ] )   if graph [ city_1 - 1 ] . setdefault ( city_2 , length ) > length : graph [ city_1 - 1 ] [ city_2 ] = length   city_1 , city_2 = int ( city_2 ) , str ( city_1 )   if graph [ city_1 - 1 ] . setdefault ( city_2 , length ) > length : graph [ city_1 - 1 ] [ city_2 ] = length   warehouse_cities = [ int ( x ) for x in stdin . readline ( ) . split ( ) ]   shortest_road = None   for warehouse_city in warehouse_cities :   for city , road in graph [ warehouse_city - 1 ] . items ( ) :   if int ( city ) not in warehouse_cities and ( not shortest_road or road < shortest_road ) : shortest_road = road     if shortest_road : print ( shortest_road ) else : print ( ' - 1' )   NEW_LINE


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . time . LocalTime ; import java . util . * ; import java . util . concurrent . * ; import java . util . regex . * ;    import java . math . * ;     public class A {   static boolean found ; public static void main ( String [ ] args ) { FastScanner scan = new FastScanner ( ) ; int t = 1 ;

n , m , k = map ( int , input ( ) . split ( ) ) e = [ tuple ( map ( int , input ( ) . split ( ) ) ) for _ in range ( m ) ] if k : a = set ( map ( int , input ( ) . split ( ) ) ) else : a = set ( ) ans = - 1 for i in e : if i [ 0 ] in a and i [ 1 ] not in a or i [ 1 ] in a and i [ 0 ] not in a : if ans == - 1 : ans = i [ 2 ] else : ans = min ( ans , i [ 2 ] ) print ( ans ) NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) if k == 0 : print ( - 1 ) else : city = [ 0 ] * ( n + 1 ) a = [ ] for i in range ( m ) : a . append ( list ( map ( int , input ( ) . split ( ) ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( k ) : city [ b [ i ] ] = 1 mini = 10000000000 for i in range ( m ) : if city [ a [ i ] [ 0 ] ] == 1 and city [ a [ i ] [ 1 ] ] == 0 : if a [ i ] [ 2 ] < mini : mini = a [ i ] [ 2 ] elif city [ a [ i ] [ 0 ] ] == 0 and city [ a [ i ] [ 1 ] ] == 1 : if a [ i ] [ 2 ] < mini : mini = a [ i ] [ 2 ] if mini == 10000000000 : print ( - 1 ) else : print ( mini ) NEW_LINE


import sysinput = sys . stdin . readline   x , y , z = map ( int , input ( ) . split ( ) ) dict1 = { } for _ in range ( y ) : a , b , c = map ( int , input ( ) . split ( ) ) if a in dict1 . keys ( ) : dict1 [ a ] . append ( [ b , c ] ) else : dict1 [ a ] = [ [ b , c ] ] if b in dict1 . keys ( ) : dict1 [ b ] . append ( [ a , c ] ) else : dict1 [ b ] = [ [ a , c ] ] ans = 1e18 if z : * li , = map ( int , input ( ) . split ( ) ) li = set ( li ) for i in dict1 . keys ( ) : for j in dict1 [ i ] : if i in li and j [ 0 ] in li : continue elif i in li or j [ 0 ] in li : ans = min ( ans , j [ 1 ] ) print ( - 1 if ans == 1e18 else ans ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class DigestThread {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = in . nextInt ( ) ; int sumA = 0 , sumB = 0 ; int a [ ] = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { a [ j ] = in . nextInt ( ) ; } Arrays . sort ( a ) ; for ( int k = n - 1 ; k >= 0 ; k -- ) { if ( sumA >= sumB ) { sumB += a [ k ] ; } else { sumA += a [ k ] ; } } if ( sumA == sumB ) System . out . println ( " YES " ) ; else System . out . println ( " No " ) ; } } }

n = int ( input ( ) ) NEW_LINE for i in range ( n ) : input ( ) NEW_LINE ls = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE s = sum ( ls ) NEW_LINE if s % 2 == 1 : NEW_LINE INDENT print ( ' NO ' ) elif s % 2 == 0 : NEW_LINE s = s / 2 NEW_LINE DEDENT if s % 2 == 0 : NEW_LINE INDENT print ( ' YES ' ) elif s % 2 == 1 : NEW_LINE if NEW_LINE DEDENT 1 in ls : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE i = [ int ( a ) for a in input ( ) . split ( ) ] NEW_LINE t , o = i . count ( 1 ) , i . count ( 2 ) NEW_LINE if t % 2 == 0 and ( o % 2 == 0 or t >= 2 ) : NEW_LINE INDENT print ( ' YES ' ) else : NEW_LINE print ( ' NO ' ) NEW_LINE DEDENT


t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE sum = 0 NEW_LINE c1 = 0 NEW_LINE c2 = 0 NEW_LINE for j in range ( len ( a ) ) : sum = sum + a [ j ] NEW_LINE if sum % 2 != 0 : NEW_LINE INDENT print ( ' NO ' ) else : NEW_LINE for NEW_LINE DEDENT j in a : NEW_LINE if j == 1 : NEW_LINE INDENT c1 += 1 else : NEW_LINE c2 += 1 NEW_LINE DEDENT if ( sum % 4 == 0 or ( sum % 4 == 2 and c1 != 0 ) ) : NEW_LINE INDENT print ( ' YES ' ) else : NEW_LINE print ( ' NO ' ) NEW_LINE DEDENT


import sys , mathimport NEW_LINE heapq   from collections import NEW_LINE INDENT dequeinput = sys . stdin . readline   NEW_LINE DEDENT


t = int ( input ( ) ) NEW_LINE otv = list ( ) NEW_LINE while ( t != 0 ) : t -= 1 NEW_LINE konf = int ( input ( ) ) NEW_LINE cpisok_konf = list ( ) NEW_LINE cpisok_konf = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE sum_konf = sum ( cpisok_konf ) NEW_LINE if ( sum_konf % 2 == 0 and cpisok_konf . count ( 1 ) >= 2 ) : otv . append ( " YES " ) NEW_LINE continue NEW_LINE if ( sum_konf % 2 == 0 and konf % 2 == 0 ) : NEW_LINE INDENT otv . append ( " YES " ) else : NEW_LINE otv . append ( " NO " )   for i in otv : print ( i ) NEW_LINE DEDENT


import java . util . Scanner ;   public class B1472 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = scanner . nextInt ( ) , weight = 0 ; for ( int j = 0 ; j < n ; j ++ ) { int a = scanner . nextInt ( ) ; weight += a ; } if ( n % 2 == 1 ) { if ( weight == 2 * n ) { System . out . println ( " NO " ) ; continue ; } } if ( weight % 2 == 0 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }


import java . util . * ;   public class B_Fair_Division { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int q = sc . nextInt ( ) ; while ( q -- > 0 ) { int n = sc . nextInt ( ) ; int ar [ ] = new int [ n ] ; int i = 0 ; int s = 0 ; for ( i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; s += ar [ i ] ; } if ( s % 2 != 0 ) { System . out . println ( " NO " ) ; continue ; } boolean dp [ ] [ ] = new boolean [ n + 1 ] [ s + 1 ] ; int j = 0 ; for ( i = 0 ; i <= s ; i ++ ) { dp [ 0 ] [ i ] = false ; } for ( i = 0 ; i <= n ; i ++ ) { dp [ i ] [ 0 ] = true ; } for ( i = 1 ; i <= n ; i ++ ) { for ( j = 1 ; j <= s ; j ++ ) { dp [ i ] [ j ] = dp [ i - 1 ] [ j ] ; if ( j - ar [ i - 1 ] >= 0 ) dp [ i ] [ j ] = dp [ i ] [ j ] || dp [ i - 1 ] [ j - ar [ i - 1 ] ] ; } } if ( dp [ n ] [ s / 2 ] ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }


import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; while ( n -- > 0 ) { int m = sc . nextInt ( ) ; int ones = 0 ; int twos = 0 ; while ( m -- > 0 ) { if ( sc . nextInt ( ) == 1 ) { ones ++ ; } else { twos ++ ; } } if ( twos % 2 == 1 ) { if ( ones % 2 == 0 ) { if ( ones >= 2 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } else { System . out . println ( " NO " ) ; } } else { if ( ones % 2 == 0 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int c1 = 0 , c2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int m = sc . nextInt ( ) ; if ( m == 1 ) c1 ++ ; else c2 ++ ; } if ( c1 % 2 == 0 && c1 != 0 ) { System . out . println ( " YES " ) ; continue ; } if ( c1 == 0 && c2 % 2 == 0 ) { System . out . println ( " YES " ) ; continue ; } System . out . println ( " NO " ) ; } } }


import java . util . Scanner ;   public class JavaApplication1 {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long n = input . nextLong ( ) ; long k = input . nextLong ( ) ; if ( n % 2 != 0 ) { if ( k <= n / 2 + 1 ) System . out . println ( 2 * k - 1 ) ; else System . out . println ( 2 * ( k - n / 2 - 1 ) ) ; } else { if ( k <= n / 2 ) System . out . println ( 2 * k - 1 ) ; else System . out . println ( 2 * ( k - n / 2 ) ) ; } input . close ( ) ; } }

from math import ceilx = [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   if k <= ( n + 1 ) // 2 : print ( ( k * 2 ) - 1 ) else : print ( ( k - ( n + 1 ) // 2 ) * 2 ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) if a % 2 == 0 : if b > a / 2 : print ( int ( ( b - a / 2 ) * 2 ) ) else : print ( int ( b * 2 - 1 ) ) else : if b > a // 2 + 1 : print ( int ( ( b - ( a // 2 + 1 ) ) * 2 ) ) else : print ( int ( b * 2 - 1 ) ) NEW_LINE


from math import ceiln , k = map ( int , input ( ) . split ( ) ) if k <= ceil ( n / 2 ) : print ( 2 * k - 1 ) else : print ( ( k - ceil ( n / 2 ) ) * 2 ) NEW_LINE


import java . util . Scanner ;   public class EvenOdds { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; if ( k <= ( n + 1 ) / 2 ) { System . out . println ( k * 2 - 1 ) ; } else { System . out . println ( ( k - ( n + 1 ) / 2 ) * 2 ) ; }   } }


import java . util . * ; import java . lang . Math ;   public class NewClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) , k = sc . nextLong ( ) ; if ( k > Math . ceil ( n / 2.0 ) ) { long num = 0 ; k -= Math . ceil ( n / 2.0 ) ; num += 2 * k ; System . out . println ( num ) ; } else { k -- ; long num = 1 ; num += k * 2 ; System . out . println ( num ) ; } } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class FastIO { BufferedReader br ; StringTokenizer st ; public FastIO ( ) {


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Vector ; import java . util . Scanner ; import java . util . Collections ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class TaskB { Vector < Integer > vec = new Vector < > ( ) ;   void generate ( long number ) { if ( number > ( long ) 1e9 ) return ; vec . add ( ( int ) number ) ; generate ( number * 10 + 4 ) ; generate ( number * 10 + 7 ) ; }   int length ( int l , int r ) { if ( l > r ) return 0 ; return r - l + 1 ; }   int intersect ( int l1 , int r1 , int l2 , int r2 ) { int l = Math . max ( l1 , l2 ) ; int r = Math . min ( r1 , r2 ) ; return length ( l , r ) ; }   public void solve ( int testNumber , Scanner in , PrintWriter out ) { int pl = in . nextInt ( ) , pr = in . nextInt ( ) , vl = in . nextInt ( ) , vr = in . nextInt ( ) , k = in . nextInt ( ) ; generate ( 4 ) ; generate ( 7 ) ; Collections . sort ( vec ) ; double ans = 0 ; for ( int i = k - 1 ; i < vec . size ( ) ; i ++ ) { int bfl , bfr , afl , afr , idx = i - k + 1 ; bfr = vec . elementAt ( idx ) ; if ( idx - 1 < 0 ) bfl = 1 ; else bfl = vec . elementAt ( idx - 1 ) + 1 ; afl = vec . elementAt ( i ) ; if ( i + 1 == vec . size ( ) ) afr = ( int ) 1e9 ; else afr = vec . elementAt ( i + 1 ) - 1 ;

s = list ( ) def rec ( x ) : if x > 100000000000 : return s . append ( x ) rec ( x * 10 + 4 ) rec ( x * 10 + 7 )     def f ( l1 , r1 , l2 , r2 ) : l1 = max ( l1 , l2 ) r1 = min ( r1 , r2 ) return max ( r1 - l1 + 1 , 0 )     def main ( ) : rec ( 0 ) s . sort ( ) args = input ( ) . split ( ) pl , pr , vl , vr , k = int ( args [ 0 ] ) , int ( args [ 1 ] ) , int ( args [ 2 ] ) , int ( args [ 3 ] ) , int ( args [ 4 ] ) ans = 0 i = 1 while i + k < len ( s ) : l1 = s [ i - 1 ] + 1 r1 = s [ i ] l2 = s [ i + k - 1 ] r2 = s [ i + k ] - 1 a = f ( l1 , r1 , vl , vr ) * f ( l2 , r2 , pl , pr ) b = f ( l1 , r1 , pl , pr ) * f ( l2 , r2 , vl , vr ) ans += a + b if k == 1 and a > 0 and b > 0 : ans -= 1 i += 1 all = ( pr - pl + 1 ) * ( vr - vl + 1 ) print ( 1.0 * ans / all )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import itertools as it       all_lucky = [ ]   for length in range ( 1 , 10 ) : for comb in it . product ( [ '7' , '4' ] , repeat = length ) : all_lucky += [ int ( ' ' . join ( comb ) ) ]   all_lucky . sort ( )   NEW_LINE


def gen_len ( l ) : gen = [ ] for i in range ( 2 ** l ) : k = int ( bin ( i ) [ 2 : ] . rjust ( l , '0' ) . replace ( '0' , '4' ) . replace ( '1' , '7' ) ) if k <= 10 ** 9 : gen . append ( k ) return gen     def pairs_with_k_len ( a , k ) : l = 0 r = k - 1 while r < len ( a ) : yield l , r l += 1 r += 1     def get_intersection_length ( l1 , r1 , l2 , r2 ) : return max ( min ( r1 , r2 ) - max ( l1 , l2 ) + 1 , 0 )     def main ( ) : gen = set ( ) for i in range ( 1 , 10 ) : for e in gen_len ( i ) : gen . add ( e ) gen = list ( sorted ( gen ) )   pl , pr , vl , vr , k = map ( int , input ( ) . split ( ) ) denominator = ( pr - pl + 1 ) * ( vr - vl + 1 ) p = ( pl , pr ) v = ( vl , vr )   count = 0 for l , r in pairs_with_k_len ( gen , k ) : if gen [ l ] >= min ( pl , vl ) and gen [ r ] <= max ( pr , vr ) : l1 = gen [ l - 1 ] if l != 0 else 0 r1 = gen [ l ] l2 = gen [ r ] r2 = gen [ r + 1 ] if r != len ( gen ) - 1 else 10 ** 9 + 1 count += ( get_intersection_length ( l1 + 1 , r1 , pl , pr ) * get_intersection_length ( l2 , r2 - 1 , vl , vr ) ) count += ( get_intersection_length ( l1 + 1 , r1 , vl , vr ) * get_intersection_length ( l2 , r2 - 1 , pl , pr ) ) if k == 1 and get_intersection_length ( vl , vr , pl , pr ) != 0 : count -= 1   print ( f " { ( count ▁ / ▁ denominator ) : . {12 } f } " )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;

count = 0 l , r = map ( int , input ( ) . split ( ) ) for i in range ( 50 ) : for j in range ( 50 ) : if l <= ( 2 ** i ) * ( 3 ** j ) <= r : count += 1 if ( 2 ** i ) * ( 3 ** j ) > r : break   print ( count ) NEW_LINE


import mathl , r = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) NEW_LINE


l , r = map ( int , input ( ) . split ( ) ) max_pow = 0 while 2 ** max_pow <= r : max_pow += 1 ans = set ( ) for i in range ( 0 , max_pow + 1 ) : for j in range ( 0 , max_pow + 1 ) : num = 2 ** i * 3 ** j if l <= num <= r : ans . add ( num ) print ( len ( ans ) ) NEW_LINE


l , r = [ int ( j ) for j in input ( ) . split ( ) ] count = 0 for j in range ( 32 ) : for k in range ( 32 ) : res = ( 2 ** j ) * ( 3 ** k ) if res >= l and res <= r : count += 1 print ( count ) NEW_LINE


import java . math . BigInteger ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collection ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . InputMismatchException ; import java . util . Iterator ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Map . Entry ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . TreeMap ; import java . util . TreeSet ; public class Main { static InputReader rd = new InputReader ( System . in ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long l = sc . nextLong ( ) ; long r = sc . nextLong ( ) ; solve ( l , r , 1l ) ; System . out . println ( c ) ; } static HashMap < Long , Integer > map = new HashMap < Long , Integer > ( ) ; static int c = 0 ; static void solve ( long l , long r , long n ) { if ( r < n ) { return ; } if ( l <= n && r >= n ) { if ( ! map . containsKey ( n ) ) { c ++ ;


import java . util . HashSet ; import java . util . Scanner ;   public class numbers23 {   public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; HashSet < Integer > h = new HashSet < Integer > ( ) ; for ( int j = 0 ; Math . pow ( 2 , j ) <= b ; j ++ ) { if ( Math . pow ( 2 , j ) >= a && Math . pow ( 2 , j ) <= b ) { h . add ( ( int ) Math . pow ( 2 , j ) ) ; } if ( Math . pow ( 3 , j ) >= a && Math . pow ( 3 , j ) <= b ) { h . add ( ( int ) Math . pow ( 3 , j ) ) ; }   } for ( int i = 0 ; Math . pow ( 2 , i ) <= b ; i ++ ) { for ( int j = 0 ; Math . pow ( 3 , j ) <= b ; j ++ ) { if ( Math . pow ( 3 , j ) * Math . pow ( 2 , i ) >= a && Math . pow ( 3 , j ) * Math . pow ( 2 , i ) <= b ) { h . add ( ( int ) Math . pow ( 3 , j ) * ( int ) Math . pow ( 2 , i ) ) ; } }   } System . out . println ( h . size ( ) ) ;   } }


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int x [ ] = new int [ n + 1 ] ; int y [ ] = new int [ n + 1 ] ; int arr [ ] = new int [ n ] ; int ans = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { x [ i ] = sc . nextInt ( ) ; y [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 0 ) { dfs ( x , y , arr , i ) ; ans ++ ; } } System . out . println ( ans ) ; }   private static void dfs ( int [ ] x , int [ ] y , int [ ] arr , int a ) { arr [ a ] = 1 ; for ( int i = 0 ; i < x . length ; i ++ ) { if ( ( x [ a ] == x [ i ] || y [ a ] == y [ i ] ) && arr [ i ] == 0 ) { dfs ( x , y , arr , i ) ; } } } }

n = int ( input ( ) ) a = [ ] k = [ 0 for i in range ( n ) ] for i in range ( n ) : x , y = [ int ( i ) for i in input ( ) . split ( ) ] a . append ( ( x , y ) ) count = 0 queue = [ ] for i in range ( n ) : if ( k [ i ] == 0 ) : queue . append ( i ) k [ i ] = 1 count += 1 while queue : node = queue . pop ( 0 ) for j in range ( n ) : if k [ j ] == 1 : continue if a [ node ] [ 0 ] == a [ j ] [ 0 ] or a [ node ] [ 1 ] == a [ j ] [ 1 ] : queue . append ( j ) k [ j ] = 1 print ( count - 1 ) NEW_LINE


n = int ( input ( ) )   val = 110 x = [ 0 ] * valy = [ 0 ] * valf = [ 0 ] * valcont = 0 def result ( i ) : f [ i ] = 1 for j in range ( 1 , n ) : if ( f [ j ] != 1 and ( x [ i ] == x [ j ] or y [ i ] == y [ j ] ) ) : result ( j ) return for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) x [ i ] = a y [ i ] = b for i in range ( n ) : if ( f [ i ] != 1 ) : result ( i ) cont += 1 print ( cont - 1 ) NEW_LINE


snow_drifts = [ ]   def check_groups ( i ) : snow_drifts [ i ] [ 2 ] = True for j in range ( n ) : if not snow_drifts [ j ] [ 2 ] : if snow_drifts [ i ] [ 0 ] == snow_drifts [ j ] [ 0 ] or snow_drifts [ i ] [ 1 ] == snow_drifts [ j ] [ 1 ] : check_groups ( j )   n = int ( input ( ) ) for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) snow_drifts . append ( [ x , y , False ] )   groups = - 1 for i in range ( n ) : if not snow_drifts [ i ] [ 2 ] : check_groups ( i ) groups += 1   print ( groups ) NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Node [ ] gr = new Node [ 4005 ] ; for ( int i = 0 ; i < n ; i ++ ) { int u = sc . nextInt ( ) ; int v = 2000 + sc . nextInt ( ) ; if ( gr [ u ] == null ) { gr [ u ] = new Node ( ) ; } if ( gr [ v ] == null ) { gr [ v ] = new Node ( ) ; } gr [ u ] . adj . add ( v ) ; gr [ v ] . adj . add ( u ) ; } int count = - 1 ; for ( int i = 0 ; i < gr . length ; i ++ ) { if ( gr [ i ] != null && ! gr [ i ] . visited ) { count ++ ; recur ( i , gr ) ; } } System . out . println ( count ) ; } static void recur ( int idx , Node [ ] graph ) { if ( graph [ idx ] . visited ) return ; graph [ idx ] . visited = true ; for ( int adj : graph [ idx ] . adj ) { recur ( adj , graph ) ; } } static class Node { boolean visited ; HashSet < Integer > adj ; public Node ( ) { visited = false ; adj = new HashSet < > ( ) ; } } }


import java . awt . * ; import java . util . * ;   public class Main { static boolean [ ] vis ; public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Point [ ] p = new Point [ n ] ; for ( int i = 0 ; i < n ; i ++ ) p [ i ] = new Point ( sc . nextInt ( ) , sc . nextInt ( ) ) ; vis = new boolean [ n ] ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! vis [ i ] ) { dfs ( i , n , p ) ; count ++ ; } } System . out . println ( count - 1 ) ; } static void dfs ( int i , int n , Point [ ] p ) { vis [ i ] = true ; for ( int j = 0 ; j < n ; j ++ ) { if ( ! vis [ j ] ) { if ( p [ i ] . x == p [ j ] . x || p [ i ] . y == p [ j ] . y ) { dfs ( j , n , p ) ; } } } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Collections ; import java . util . PriorityQueue ; import java . util . StringTokenizer ;    @ SuppressWarnings ( " unused " ) public class A { public static FastScannerA scan = new FastScannerA ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ;   public static void solve ( ) { int m = scan . nextInt ( ) , n = scan . nextInt ( ) ; double ans = m ; for ( int i = 1 ; i < m ; i ++ ) { ans -= Math . pow ( ( double ) i / m , n ) ; } System . out . println ( ans ) ; } public static void main ( String [ ] args ) { solve ( ) ; out . close ( ) ; }   } class FastScannerA { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } void sort ( long [ ] a ) { ArrayList < Long > l = new ArrayList < > ( ) ; for ( long i : a ) l . add ( i ) ; Collections . sort ( l ) ; for ( int i = 0 ; i < a . length ; i ++ ) a [ i ] = l . get ( i ) ; }   }

m , n = map ( int , input ( ) . split ( ) ) res = 0 for i in range ( m ) : res += float ( ( i + 1 ) * ( pow ( float ( i + 1 ) / float ( m ) , n ) - pow ( float ( i ) / float ( m ) , n ) ) ) print ( res ) NEW_LINE


from math import pow   m , n = map ( int , input ( ) . split ( ) ) r = 0 for i in range ( m ) : r += ( i + 1 ) * ( pow ( ( i + 1 ) / m , n ) - pow ( i / m , n ) ) print ( r ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) sum = 0 for i in range ( 1 , a + 1 ) : sum += i * ( ( i / a ) ** b - ( ( i - 1 ) / a ) ** b ) print ( sum ) NEW_LINE


import math   if __name__ == ' _ _ main _ _ ' : m , n = [ int ( item ) for item in input ( ) . split ( ) ] res = 0 for i in range ( 1 , m + 1 ) : current = i * ( math . pow ( ( i / m ) , n ) - math . pow ( ( ( i - 1 ) / m ) , n ) ) res += current print ( res )   NEW_LINE


m , n = map ( int , input ( ) . split ( ) ) score = 0 for k in range ( 1 , m + 1 ) : score += k * ( ( k / m ) ** ( n ) - ( ( k - 1 ) / ( m ) ) ** n ) print ( score ) NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { new Main ( ) . run ( ) ; } void run ( ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; StringBuilder res = new StringBuilder ( ) ; boolean skipped = false ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == '0' && ! skipped ) { skipped = true ; continue ; } res . append ( s . charAt ( i ) ) ; } if ( ! skipped ) res . deleteCharAt ( res . length ( ) - 1 ) ; System . out . println ( res ) ; } }

def solution ( ) : st = input ( ) n = len ( st ) for i in range ( n ) : if st [ i ] == '0' : print ( st [ : i ] + st [ i + 1 : ] ) return print ( st [ : - 1 ] )     return 	 	       solution ( ) NEW_LINE


li = list ( map ( int , input ( ) ) ) n = len ( li ) st = Falseif 0 in li : li . remove ( 0 ) print ( * li , sep = ' ' ) else : li . pop ( ) print ( * li , sep = ' ' ) NEW_LINE


binary = input ( )   try : charIndex = binary . index ( "0" ) except : charIndex = 0   newBinary = f " { binary [ : charIndex ] } { binary [ charIndex ▁ + ▁ 1 : ] } "   print ( newBinary ) NEW_LINE


def answer ( a ) : al = list ( a ) NEW_LINE


ll = lambda : map ( int , input ( ) . split ( ) ) t = lambda : int ( input ( ) ) ss = lambda : input ( ) lx = lambda x : map ( int , input ( ) . split ( x ) ) NEW_LINE


import java . util . * ;    public class dummycodes {   public static class Pair { int l ; int r ; int index ; public Pair ( int x , int y , int i ) { l = x ; r = y ; index = i ; } } public static class sortByL implements Comparator < Pair > { @ Override public int compare ( Pair o1 , Pair o2 ) { return ( o1 . l == o2 . l ) ? o2 . r - o1 . r : o1 . l - o2 . l ; }   }   public static void solve ( ArrayList < Pair > arr , int sze , int maxR ) { Collections . sort ( arr , new sortByL ( ) ) ; Pair P = arr . get ( 0 ) ; int a = P . l ; int b = P . r ;   if ( a <= b && b >= maxR ) System . out . println ( P . index + 1 ) ; else System . out . println ( " - 1" ) ; }   public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String res = " " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == '0' ) { res += s . substring ( 0 , i ) ; res += s . substring ( i + 1 ) ; break ; } } if ( res != " " ) System . out . println ( res ) ; else System . out . println ( s . substring ( 0 , s . length ( ) - 1 ) ) ; } }


import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ;   public class absolute { public static String process ( String s ) { if ( s . length ( ) == 1 ) return "0" ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == '0' ) return s . substring ( 0 , i ) + s . substring ( i + 1 ) ; } return s . substring ( 1 ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; System . out . println ( process ( s ) ) ; } }


import java . util . * ; import java . lang . * ;


import java . util . Scanner ;   public class A258 { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String input = s . nextLine ( ) ; System . out . println ( input . replaceFirst ( input . contains ( "0" ) ? "0" : "1" , " " ) ) ; } }


import java . math . * ; import java . util . * ; import java . io . * ;   public class CFA { BufferedReader br ; PrintWriter out ; StringTokenizer st ; boolean eof ; private static final long MOD = 1000L * 1000L * 1000L + 7 ; private static final int [ ] dx = { 0 , - 1 , 0 , 1 } ; private static final int [ ] dy = { 1 , 0 , - 1 , 0 } ; private static final String yes = " Yes " ; private static final String no = " No " ;   void solve ( ) { int T = nextInt ( ) ;

from sys import stdininput = stdin . readline   t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] b = [ int ( x ) for x in input ( ) . split ( ) ] print ( * sorted ( a ) ) print ( * sorted ( b ) ) NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] b = [ int ( x ) for x in input ( ) . split ( ) ] a = [ str ( x ) for x in sorted ( a ) ] b = [ str ( x ) for x in sorted ( b ) ] print ( ' ▁ ' . join ( a ) ) print ( ' ▁ ' . join ( b ) ) NEW_LINE


import sys   def main ( ) : inp = sys . stdin . read ( ) . strip ( ) . split ( ' \n ' ) out = [ ] for i in range ( 2 , len ( inp ) , 3 ) : a = ' ▁ ' . join ( sorted ( inp [ i ] . split ( ) , key = int ) ) b = ' ▁ ' . join ( sorted ( inp [ i + 1 ] . split ( ) , key = int ) ) out . extend ( ( a , b ) ) return out print ( * main ( ) , sep = ' \n ' ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int test = sc . nextInt ( ) ; while ( test > 0 ) { int i , n ; n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; int b [ ] = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; for ( i = 0 ; i < n ; i ++ ) b [ i ] = sc . nextInt ( ) ; Arrays . sort ( a ) ; Arrays . sort ( b ) ; for ( i = 0 ; i < n ; i ++ ) System . out . print ( a [ i ] + " ▁ " ) ; System . out . println ( ) ; for ( i = 0 ; i < n ; i ++ ) System . out . print ( b [ i ] + " ▁ " ) ; System . out . println ( ) ; test -= 1 ; }   }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . LinkedList ; import java . util . Locale ; import java . util . Objects ; import java . util . Queue ; import java . util . Scanner ; import java . util . Stack ; import java . util . TreeSet ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . lang . reflect . Array ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Map ; import java . util . Vector ;   public class Main {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int cases = Integer . parseInt ( br . readLine ( ) ) ; while ( cases > 0 ) { int daughters = Integer . parseInt ( br . readLine ( ) ) ; int [ ] necklaces = Arrays . stream ( br . readLine ( ) . split ( " ▁ " ) ) . mapToInt ( x -> Integer . parseInt ( x ) ) . toArray ( ) ; int [ ] bracelets = Arrays . stream ( br . readLine ( ) . split ( " ▁ " ) ) . mapToInt ( x -> Integer . parseInt ( x ) ) . toArray ( ) ; Arrays . sort ( necklaces ) ; Arrays . sort ( bracelets ) ; for ( int i = 0 ; i < daughters ; i ++ ) { if ( i + 1 != daughters ) { System . out . print ( necklaces [ i ] + " ▁ " ) ; } else { System . out . println ( necklaces [ i ] ) ; } } for ( int i = 0 ; i < daughters ; i ++ ) { if ( i + 1 != daughters ) { System . out . print ( bracelets [ i ] + " ▁ " ) ; } else { System . out . println ( bracelets [ i ] ) ; } } cases -- ; } }   }


import java . util . Scanner ;   public class Game { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int n ; String s ;   n = Integer . parseInt ( input . nextLine ( ) ) ; s = input . nextLine ( ) ;   for ( int i = 0 ; i < n ; ++ i ) { if ( s . charAt ( i ) != ' . ' ) { if ( s . charAt ( i ) == ' R ' ) { while ( s . charAt ( i ) == ' R ' ) { ++ i ; } System . out . println ( i + " ▁ " + ( i + 1 ) ) ; } else { System . out . println ( ( i + 1 ) + " ▁ " + i ) ; } break ; } } } }

n = int ( input ( ) ) a = input ( ) f = n - a . count ( ' . ' ) m = a . count ( ' L ' ) q0 = 0 flag = 1 for i in range ( n ) : if ( m == 0 ) : if ( a [ i ] == ' . ' and a [ i - 1 ] == ' R ' and i > 0 ) : q1 = i + 1 break if ( a [ i ] == ' . ' ) : continue else : if ( a [ i ] == ' L ' ) : q1 = i if ( flag and q0 == 0 ) : q0 = i + 1 break if ( flag ) : q0 = i + 1 flag -= 1 print ( q0 , q1 ) NEW_LINE


n = int ( input ( ) ) a = list ( input ( ) ) b = a [ : : - 1 ] if a . count ( " R " ) == 0 : s = 0 t = 0 for i in range ( 0 , len ( b ) ) : if b [ i ] == " L " : s = n - ( i ) break for i in range ( 0 , len ( a ) ) : if a [ i ] == " L " : t = i break print ( s , t ) elif a . count ( " L " ) == 0 : s = 0 t = 0 for i in range ( 0 , len ( a ) ) : if a [ i ] == " R " : s = i + 1 break for i in range ( 0 , len ( b ) ) : if b [ i ] == " R " : t = n - i + 1 break print ( s , t ) else : s = 0 t = 0 for i in range ( 0 , len ( a ) ) : if a [ i ] == " L " : t = i + 1 break for i in range ( t - 1 , len ( a ) ) : if a [ i ] != " L " : s = i break print ( s , t ) NEW_LINE


n = int ( input ( ) ) path = list ( input ( ) ) if path . count ( ' R ' ) == 0 : t = path . index ( ' L ' ) s = n - path [ : : - 1 ] . index ( ' L ' ) elif path . count ( ' L ' ) == 0 : s = path . index ( ' R ' ) + 1 t = n - path [ : : - 1 ] . index ( ' R ' ) + 1 else : s = path . index ( ' R ' ) + 1 t = path . index ( ' L ' ) print ( s , t ) NEW_LINE


n , footprint = int ( input ( ) ) , input ( )   for i in range ( n ) : if footprint [ i ] != ' . ' : first = i breakfor i in range ( n - 1 , 0 , - 1 ) : if footprint [ i ] != " . " : last = i break   if footprint [ first ] == footprint [ last ] and footprint [ first ] == ' R ' : print ( first + 1 , last + 2 )   elif footprint [ first ] == footprint [ last ] and footprint [ first ] == ' L ' : print ( last + 1 , first )   elif footprint [ first ] == ' R ' and footprint [ last ] == ' L ' : for i in range ( first , last ) : if footprint [ i ] != ' R ' : last = i break print ( first + 1 , last ) NEW_LINE


n = int ( input ( ) ) myStr = input ( ) tempListL = 0 tempListR = 0 if myStr . find ( " R " ) == - 1 : forRevarse = range ( len ( myStr ) , 0 , - 1 ) for i in forRevarse : if myStr [ i - 1 ] == " L " : tempListL = i break else : continue print ( tempListL , myStr . index ( " L " ) ) elif myStr . find ( " L " ) == - 1 : forRevarse = range ( len ( myStr ) , 0 , - 1 ) for i in forRevarse : if myStr [ i - 1 ] == " R " : tempListR = i break else : continue print ( myStr . find ( " R " ) + 1 , tempListR + 1 ) else : print ( myStr . index ( " R " ) + 1 , myStr . index ( " L " ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . util . StringTokenizer ;    @ SuppressWarnings ( " unused " ) public class A { public static FastScannerA scan = new FastScannerA ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; public static void solve ( ) { int t = scan . nextInt ( ) ; String str = scan . next ( ) ; int s = str . indexOf ( " R " ) ; int e = str . indexOf ( " L " ) ; if ( s >= 0 && e >= 0 ) out . println ( s + 1 + " ▁ " + e ) ; else if ( s >= 0 ) out . println ( s + 1 + " ▁ " + ( str . lastIndexOf ( " R " ) + 2 ) ) ; else out . println ( str . lastIndexOf ( " L " ) + 1 + " ▁ " + e ) ; } public static void main ( String [ ] args ) { solve ( ) ; out . close ( ) ; }   } class FastScannerA { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } }


import java . util . * ; import java . math . * ; public class SnowFootprints { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int size = sc . nextInt ( ) ; String s = sc . next ( ) ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;    public class MainCP {   public static void main ( String [ ] args ) { FastReader s = new FastReader ( ) ; int n = s . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = s . nextInt ( ) ; }   int m = s . nextInt ( ) ;   for ( int i = 0 ; i < m ; i ++ ) { int x = s . nextInt ( ) - 1 ; int y = s . nextInt ( ) ; if ( x == 0 && a . length > 1 ) { a [ x + 1 ] += a [ x ] - y ; a [ x ] = 0 ; } else if ( x > 0 && x < n - 1 ) { a [ x - 1 ] += y - 1 ; a [ x + 1 ] += a [ x ] - y ; a [ x ] = 0 ; } else if ( x == n - 1 && a . length > 1 ) { a [ x - 1 ] += y - 1 ; a [ x ] = 0 ; } else { a [ x ] = 0 ; } } for ( int i = 0 ; i < n ; i ++ ) { System . out . println ( a [ i ] ) ; }   }

for _ in range ( 1 ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   m = int ( input ( ) ) for i in range ( m ) : x , y = map ( int , input ( ) . split ( ) ) if x == 1 : if x <= n - 1 : arr [ x ] += arr [ x - 1 ] - y arr [ x - 1 ] = 0 elif x == n : arr [ x - 2 ] += y - 1 arr [ x - 1 ] = 0 else : arr [ x ] += arr [ x - 1 ] - y arr [ x - 2 ] += y - 1 arr [ x - 1 ] = 0 for i in range ( n ) : print ( arr [ i ] ) NEW_LINE


n = int ( input ( ) ) wires = [ * map ( int , input ( ) . split ( " ▁ " ) ) ] m = int ( input ( ) ) for i in range ( m ) : x , y = map ( int , input ( ) . split ( " ▁ " ) ) if x > 1 : wires [ x - 2 ] += y - 1 if x < n : wires [ x ] += wires [ x - 1 ] - y wires [ x - 1 ] = 0 for n in wires : print ( n ) NEW_LINE


n = int ( input ( ) )   wires = [ * map ( int , input ( ) . split ( " ▁ " ) ) ]   m = int ( input ( ) )   for i in range ( m ) : value = [ * map ( int , input ( ) . split ( " ▁ " ) ) ] if value [ 0 ] < n : wires [ value [ 0 ] ] += ( wires [ value [ 0 ] - 1 ] - value [ 1 ] ) if value [ 0 ] >= 2 : wires [ value [ 0 ] - 2 ] += ( value [ 1 ] - 1 ) wires [ value [ 0 ] - 1 ] = 0   for i in wires : print ( i ) NEW_LINE


n = int ( input ( ) ) list = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) shot = int ( input ( ) ) for i in range ( shot ) : x , y = ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) if x - 2 >= 0 : list [ x - 2 ] += y - 1 if x <= n - 1 : list [ x ] += list [ x - 1 ] - y list [ x - 1 ] = 0   for i in list : print ( i ) NEW_LINE


def insertion_sort ( l ) : for i in range ( len ( l ) ) : for j in ( range ( i ) ) : k = i - j if l [ k ] >= l [ k - 1 ] : l [ k - 1 ] , l [ k ] = l [ k ] , l [ k - 1 ] else : break return l       def selection_sort ( l ) : for i in range ( len ( l ) ) : min_ind = i min_val = l [ i ] for j in range ( i , len ( l ) ) : if min_val > l [ j ] : min_val = l [ j ] min_ind = j l [ i ] , l [ min_ind ] = l [ min_ind ] , l [ i ] return l     def bubble_sort ( l ) : for i in range ( len ( l ) - 1 ) : for j in range ( len ( l ) - 1 - i ) : if l [ j ] > l [ j + 1 ] : l [ j ] , l [ j + 1 ] = l [ j + 1 ] , l [ j ] return l     NEW_LINE


import java . util . Scanner ;   public class CodeForces {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int totalLine = sc . nextInt ( ) ; int [ ] birdsPerLine = new int [ totalLine + 1 ] ; birdsPerLine [ 0 ] = 0 ; for ( int i = 1 ; i <= totalLine ; i ++ ) { birdsPerLine [ i ] = sc . nextInt ( ) ; } int totalShoot = sc . nextInt ( ) ; for ( int i = 0 ; i < totalShoot ; i ++ ) { int shootedLine = sc . nextInt ( ) ; int shootedBirdPosition = sc . nextInt ( ) ; if ( totalLine == 1 ) { birdsPerLine [ 1 ] = 0 ; break ; } if ( shootedLine == 1 ) { birdsPerLine [ shootedLine + 1 ] += ( birdsPerLine [ shootedLine ] - shootedBirdPosition ) ; } else if ( shootedLine == totalLine ) { birdsPerLine [ shootedLine - 1 ] += ( shootedBirdPosition - 1 ) ; } else { birdsPerLine [ shootedLine - 1 ] += ( shootedBirdPosition - 1 ) ; birdsPerLine [ shootedLine + 1 ] += ( birdsPerLine [ shootedLine ] - shootedBirdPosition ) ; } birdsPerLine [ shootedLine ] = 0 ; } for ( int i = 1 ; i <= totalLine ; i ++ ) { System . out . println ( birdsPerLine [ i ] ) ; } } }


import java . util . * ;   public class Runner { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int nw = sc . nextInt ( ) ; sc . nextLine ( ) ; int [ ] birds = stringToIntArray ( sc . nextLine ( ) ) ; int shots = sc . nextInt ( ) ; for ( int i = 0 ; i < shots ; i ++ ) { int wireNum = sc . nextInt ( ) - 1 ; int wirePosition = sc . nextInt ( ) ; if ( wireNum != 0 ) { birds [ wireNum - 1 ] += wirePosition - 1 ; } if ( wireNum != nw - 1 ) { birds [ wireNum + 1 ] += birds [ wireNum ] - wirePosition ; } birds [ wireNum ] = 0 ; } for ( int birdCount : birds ) { System . out . println ( birdCount ) ; } } private static int [ ] stringToIntArray ( String str ) { String [ ] strs = str . trim ( ) . split ( " ▁ " ) ; int [ ] intArr = new int [ strs . length ] ; for ( int i = 0 ; i < strs . length ; i ++ ) { intArr [ i ] = Integer . parseInt ( strs [ i ] ) ; } return intArr ; }   }


import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int arr [ ] = new int [ x ] ; for ( int i = 0 ; i < x ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } int n = sc . nextInt ( ) ; while ( n -- > 0 ) { int wire = sc . nextInt ( ) ; int bird = sc . nextInt ( ) ; if ( wire != 1 ) { arr [ wire - 2 ] += bird - 1 ; } if ( wire != arr . length ) { arr [ wire ] += ( arr [ wire - 1 ] - bird ) ; } arr [ wire - 1 ] = 0 ; } for ( int i = 0 ; i < arr . length ; i ++ ) { System . out . println ( arr [ i ] ) ; } } }


import java . util . * ;    public class Practise {

import sysfrom collections import defaultdict   def getInts ( ) : return int ( input ( ) )   def getListOfInts ( ) : return list ( map ( int , input ( ) . split ( ' ▁ ' ) ) )   NEW_LINE


m = 0 n = int ( input ( ) ) for _ in range ( n ) : m = max ( m , sum ( map ( int , input ( ) . split ( ) ) ) ) print ( m ) NEW_LINE


T_ON = 0 DEBUG_ON = 0 MOD = 998244353     def solve ( ) : n = read_int ( ) MAX = 0 for _ in range ( n ) : x , y = read_ints ( ) MAX = max ( MAX , x + y ) print ( MAX )     def main ( ) : T = read_int ( ) if T_ON else 1 for i in range ( T ) : solve ( )     def debug ( * xargs ) : if DEBUG_ON : print ( * xargs )     from collections import * import math     NEW_LINE


maxi = 0 for i in range ( int ( input ( ) ) ) : x , y = map ( int , input ( ) . split ( ' ▁ ' ) ) maxi = max ( x + y , maxi ) print ( maxi ) NEW_LINE


import java . util . * ;   public class coverpoints { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int sum = scan . nextInt ( ) + scan . nextInt ( ) ; if ( sum > max ) max = sum ; } System . out . println ( max ) ; } }


import java . io . * ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws IOException {

MOD = 10 ** 9 + 7 s , t = input ( ) , input ( )   p = t + ' # ' + sz = [ 0 ] * len ( p ) l = r = 0 for i in range ( 1 , len ( p ) ) : if i <= r : z [ i ] = min ( r - i + 1 , z [ i - l ] ) while i + z [ i ] < len ( p ) and p [ z [ i ] ] == p [ i + z [ i ] ] : z [ i ] += 1 if i + z [ i ] - 1 > r : l , r = i , i + z [ i ] - 1   f = [ 0 ] * ( len ( p ) + 1 ) fsum = [ 0 ] * ( len ( p ) + 1 ) fsum2 = [ 0 ] * ( len ( p ) + 1 ) for i in range ( len ( p ) - 1 , len ( t ) , - 1 ) : if z [ i ] == len ( t ) : f [ i ] = fsum2 [ i + z [ i ] ] + len ( p ) - i - z [ i ] + 1 else : f [ i ] = f [ i + 1 ] fsum [ i ] = ( fsum [ i + 1 ] + f [ i ] ) % MOD fsum2 [ i ] = ( fsum2 [ i + 1 ] + fsum [ i ] ) % MODprint ( fsum [ len ( t ) + 1 ] ) NEW_LINE


s , t = input ( ) , input ( ) n , m = len ( t ) , len ( s ) + 1   d = 1000000007 g = [ 1 ] * m   f = k = 0 for i in range ( 1 , m ) : if s [ i - n : i ] == t : k = i if k : f = ( f + g [ k - n ] ) % d g [ i ] += ( g [ i - 1 ] + f ) % d   print ( f ) NEW_LINE


s , t = input ( ) , input ( )   n , m = len ( t ) , len ( s ) + 1       d = 1000000007   g = [ 1 ] * m       f = k = 0   for i in range ( 1 , m ) :   if s [ i - n : i ] == t : k = i   if k : f = ( f + g [ k - n ] ) % d   g [ i ] += ( g [ i - 1 ] + f ) % d       print ( f )         NEW_LINE


s , t = input ( ) , input ( ) n , m = len ( t ) , len ( s ) + 1 d = 1000000007 g = [ 1 ] * mf = k = 0 for i in range ( 1 , m ) : if s [ i - n : i ] == t : k = i if k : f = ( f + g [ k - n ] ) % d g [ i ] += ( g [ i - 1 ] + f ) % dprint ( f ) NEW_LINE


import java . util . Scanner ;   public class Main { public static String s , t ; public static int N , M ; public static int [ ] next ; public static final long MOD = ( long ) ( ( 1e9 ) + 7 ) ; public static long [ ] dp , s1 , s2 ;   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; s = sc . next ( ) ; t = sc . next ( ) ; N = s . length ( ) ; M = t . length ( ) ; next = new int [ M ] ; for ( int i = 1 , j = 0 ; i < M ; i ++ ) { while ( j > 0 && t . charAt ( i ) != t . charAt ( j ) ) j = next [ j - 1 ] ; if ( t . charAt ( i ) == t . charAt ( j ) ) j ++ ; next [ i ] = j ; } boolean [ ] flag = new boolean [ N + 1 ] ; for ( int i = 0 , j = 0 ; i < N ; i ++ ) { while ( j > 0 && ( j == M || s . charAt ( i ) != t . charAt ( j ) ) ) j = next [ j - 1 ] ; if ( s . charAt ( i ) == t . charAt ( j ) ) j ++ ; if ( j == M ) { flag [ i + 1 ] = true ; } } dp = new long [ N + 1 ] ; s1 = new long [ N + 1 ] ; s2 = new long [ N + 1 ] ; for ( int i = 1 ; i <= N ; i ++ ) { if ( ! flag [ i ] ) { dp [ i ] = dp [ i - 1 ] ; } else { dp [ i ] = ( ( i - M + 1 ) + s2 [ i - M ] ) % MOD ; } s1 [ i ] = ( s1 [ i - 1 ] + dp [ i ] ) % MOD ; s2 [ i ] = ( s2 [ i - 1 ] + s1 [ i ] ) % MOD ; } System . out . println ( s1 [ N ] ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Main {   public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( bf . readLine ( ) ) ; for ( int tc = 0 ; tc < t ; tc ++ ) { StringTokenizer st = new StringTokenizer ( bf . readLine ( ) ) ; int [ ] arr = new int [ 5 ] ; for ( int i = 0 ; i < arr . length ; i ++ ) arr [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; int x = 0 ; int y = 0 ; x = arr [ 0 ] / arr [ 2 ] ;

n = int ( input ( ) ) import math as mfor i in range ( n ) : a , b , c , d , k = map ( int , input ( ) . split ( ) ) e = m . ceil ( a / c ) f = m . ceil ( b / d ) if e + f <= k : print ( e , f ) else : print ( - 1 ) NEW_LINE


from math import ceiln = int ( input ( ) ) for i in range ( n ) : a , b , c , d , k = map ( int , input ( ) . split ( ) ) pens = ceil ( a / c ) pencils = ceil ( b / d )   if pens + pencils <= k : print ( str ( pens ) + " ▁ " + str ( pencils ) ) else : print ( " - 1" ) NEW_LINE


from math import ceil   n_sets = int ( input ( ) ) for _ in range ( n_sets ) : a , b , c , d , k = map ( int , input ( ) . split ( ) ) n_pen = ceil ( a / c ) n_pencil = ceil ( b / d ) if n_pen + n_pencil <= k : print ( n_pen , n_pencil ) else : print ( - 1 ) NEW_LINE


for _ in [ 0 ] * int ( input ( ) ) : a , b , c , d , k = map ( int , input ( ) . split ( ) ) ; r = 0 - - a // c , 0 - - b // d ; print ( * ( r , [ - 1 ] ) [ sum ( r ) > k ] ) NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; double a , b ; int c , d , e ; while ( t -- != 0 ) { a = sc . nextDouble ( ) ; b = sc . nextDouble ( ) ; c = sc . nextInt ( ) ; d = sc . nextInt ( ) ; e = sc . nextInt ( ) ; int pen = ( int ) Math . ceil ( a / c ) ; int pencil = ( int ) Math . ceil ( b / d ) ; if ( pen + pencil <= e ) { System . out . println ( pen + " ▁ " + pencil ) ; } else { System . out . println ( - 1 ) ; } } } }


import java . util . * ;    public class l700 {   public static void main ( String [ ] args ) {


import java . sql . ClientInfoStatus ; import java . util . * ;    public class Practise {

n , k = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   given = 0 ans = - 1 save = 0 for i , candy in enumerate ( arr , start = 1 ) : if candy >= 8 : k -= 8 save += candy - 8 else : need = 8 - candy available = min ( need , save ) k -= ( available + candy ) save -= available if k <= 0 : ans = i break   print ( ans ) NEW_LINE


n , k = input ( ) . split ( ' ▁ ' ) a = input ( ) . split ( ' ▁ ' ) k = int ( k ) count = 0 storage = 0 total = 0 for ai in a : total += int ( ai )   df = min ( 8 , total ) k -= df total -= df count += 1 if k <= 0 : break   if k > 0 : print ( - 1 ) else : print ( count ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) h = 0 for e , i in enumerate ( input ( ) . split ( ) ) : h += int ( i ) k -= min ( 8 , h ) h -= min ( 8 , h ) if k <= 0 : print ( e + 1 ) ; breakelse : print ( - 1 ) NEW_LINE


n , k = [ int ( i ) for i in input ( ) . split ( ) ] a = [ int ( i ) for i in input ( ) . split ( ) ] b = 0 c = 0 for i in range ( n ) : b += a [ i ] if b >= 8 : b -= 8 c += 8 else : c += b b = 0 if c >= k : print ( i + 1 ) breakelse : print ( - 1 ) NEW_LINE


n , k = ( int ( x ) for x in input ( ) . split ( ) ) n_lst = [ int ( x ) for x in input ( ) . split ( ) ] t = 0 counter = 0 for day in n_lst : t += day counter += 1 k -= ( min ( 8 , t ) ) t -= ( min ( 8 , t ) ) if k <= 0 : print ( counter ) breakelse : print ( ' - 1' ) NEW_LINE


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class Problem428A { public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter writer = new PrintWriter ( System . out ) ;   StringTokenizer info = new StringTokenizer ( reader . readLine ( ) ) ; int n = Integer . parseInt ( info . nextToken ( ) ) ; int k = Integer . parseInt ( info . nextToken ( ) ) ;    int sum = 0 ; StringTokenizer aT = new StringTokenizer ( reader . readLine ( ) ) ; int [ ] a = new int [ n ] ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( aT . nextToken ( ) ) ; sum += a [ i ] ; int out = Math . min ( sum , 8 ) ; k -= out ; sum -= out ; count ++ ; if ( k <= 0 ) { break ; } } if ( k > 0 ) { writer . println ( " - 1" ) ; } else { writer . println ( count ) ; }    reader . close ( ) ; writer . close ( ) ; } }


import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;


import java . util . * ; import java . io . * ;   public class cf {   public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long x1 = sc . nextInt ( ) , x2 = sc . nextInt ( ) ; pair [ ] arr = new pair [ n ] ; for ( int i = 0 ; i < arr . length ; i ++ ) { long a = sc . nextInt ( ) , b = sc . nextInt ( ) ; arr [ i ] = new pair ( a * x1 + b , a * x2 + b ) ; } Arrays . sort ( arr ) ; long x = arr [ 0 ] . x , y = arr [ 0 ] . y ; boolean f = false ; for ( int i = 1 ; i < arr . length ; i ++ ) { if ( arr [ i ] . x > x && arr [ i ] . y < y ) { f = true ; break ; } if ( arr [ i ] . y > y ) { y = arr [ i ] . y ; x = arr [ i ] . x ; } }

n = int ( input ( ) ) x1 , x2 = map ( int , input ( ) . split ( ) ) arr = [ ] for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) arr . append ( [ a * x1 + b , a * x2 + b ] ) arr . sort ( ) x = [ i [ 1 ] for i in arr ] if ( sorted ( x ) == x ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


import sysinput = sys . stdin . readlinen = int ( input ( ) ) x1 , x2 = map ( int , input ( ) . split ( ) ) s = [ ] for _ in range ( n ) : k , b = map ( int , input ( ) . split ( ) ) s . append ( [ x1 * k + b , x2 * k + b ] ) s . sort ( ) ans = ' NO ' for i in range ( 1 , n ) : x1 , x2 = s [ i - 1 ] x3 , x4 = s [ i ] if x1 < x3 and x2 > x4 or x1 > x3 and x2 < x4 : ans = ' YES ' ; breakprint ( ans ) NEW_LINE


n = int ( input ( ) ) x1 , x2 = map ( int , input ( ) . split ( " ▁ " ) )   liste = [ ] for test in range ( n ) : k , b = map ( int , input ( ) . split ( " ▁ " ) ) liste . append ( ( k * x1 + b , k * x2 + b ) ) liste . sort ( )     flag = 0 i = 1 while i < n : if liste [ i ] [ 1 ] < liste [ i - 1 ] [ 1 ] : flag = 1 break   i += 1   print ( [ ' NO ' , ' YES ' ] [ flag ] ) NEW_LINE


ertekek = [ ] n = int ( input ( ) ) x1 , x2 = [ int ( i ) for i in input ( ) . split ( ) ] for i in range ( n ) : k , b = [ int ( i ) for i in input ( ) . split ( ) ] bal = k * x1 + b jobb = k * x2 + b ertekek . append ( [ bal , jobb ] ) ertekek . sort ( ) szamlalo = 0 for i in range ( len ( ertekek ) - 1 ) : if ertekek [ i ] [ 0 ] < ertekek [ i + 1 ] [ 0 ] and ertekek [ i ] [ 1 ] > ertekek [ i + 1 ] [ 1 ] : szamlalo += 1 if szamlalo > 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


from sys import stdin   n = int ( stdin . readline ( ) ) x1 , x2 = map ( int , stdin . readline ( ) . split ( ) ) ys = [ ]   for i in range ( n ) : m , b = map ( int , stdin . readline ( ) . split ( ) ) ys . append ( [ x1 * m + b , x2 * m + b ] )   ys . sort ( )   intersect = Falsefor i in range ( 1 , n ) : if ys [ i - 1 ] [ 1 ] > ys [ i ] [ 1 ] : intersect = Trueif intersect : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . PriorityQueue ; import java . util . StringTokenizer ;   public class AntonAndLines { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int x1 = Integer . parseInt ( st . nextToken ( ) ) ; int x2 = Integer . parseInt ( st . nextToken ( ) ) ; PriorityQueue < Line > pq = new PriorityQueue < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { st = new StringTokenizer ( br . readLine ( ) ) ; long k = Integer . parseInt ( st . nextToken ( ) ) ; long b = Integer . parseInt ( st . nextToken ( ) ) ; long y1 = k * x1 + b ; long y2 = k * x2 + b ; pq . add ( new Line ( y1 , y2 ) ) ; }   Line x = new Line ( 1 , 2 ) ; Line y = new Line ( 1 , 1 ) ; Line prev = pq . poll ( ) ; while ( ! pq . isEmpty ( ) ) { Line cur = pq . poll ( ) ; if ( prev . y2 > cur . y2 ) { System . out . println ( " YES " ) ; return ; } prev = cur ; } System . out . println ( " NO " ) ; }   static class Line implements Comparable < Line > { long y1 , y2 ;   public Line ( long Y1 , long Y2 ) { y1 = Y1 ; y2 = Y2 ; }   @ Override public int compareTo ( Line o ) { if ( this . y1 == o . y1 ) { return Long . compare ( this . y2 , o . y2 ) ; } return Long . compare ( this . y1 , o . y1 ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class AntonandLines { static final double EPS = ( 1e-15 ) ;   public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; double x1 = sc . nextDouble ( ) + EPS ; double x2 = sc . nextDouble ( ) - EPS ; pair [ ] wX1 = new pair [ n ] ;   for ( int i = 0 ; i < n ; ++ i ) { int k = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; wX1 [ i ] = new pair ( i , k * x1 + b , k * x2 + b ) ; } Arrays . sort ( wX1 ) ; boolean can = true ; for ( int i = 0 ; i < n - 1 ; ++ i ) { if ( wX1 [ i ] . y2 >= wX1 [ i + 1 ] . y2 ) { can = false ; break ; } }


import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; BigInteger x1 = BigInteger . valueOf ( scanner . nextLong ( ) ) ; BigInteger x2 = BigInteger . valueOf ( scanner . nextLong ( ) ) ;   ArrayList < Intersection > intersections = new ArrayList < Intersection > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { BigInteger k = BigInteger . valueOf ( scanner . nextLong ( ) ) ; BigInteger b = BigInteger . valueOf ( scanner . nextLong ( ) ) ; BigInteger y1 = k . multiply ( x1 ) . add ( b ) ; BigInteger y2 = k . multiply ( x2 ) . add ( b ) ; intersections . add ( new Intersection ( y1 , y2 ) ) ; } Collections . sort ( intersections ) ;   for ( int i = 1 ; i < intersections . size ( ) ; i ++ ) { if ( ( intersections . get ( i ) . y1 . subtract ( intersections . get ( i - 1 ) . y1 ) ) . signum ( ) * ( intersections . get ( i ) . y2 . subtract ( intersections . get ( i - 1 ) . y2 ) ) . signum ( ) < 0 ) { System . out . println ( " YES " ) ; return ; } } System . out . println ( " NO " ) ; }   private static class Intersection implements Comparable < Intersection > { BigInteger y1 ; BigInteger y2 ;   public Intersection ( BigInteger y1 , BigInteger y2 ) { this . y1 = y1 ; this . y2 = y2 ; }   @ Override public int compareTo ( Intersection intersection ) { if ( this . y1 . compareTo ( intersection . y1 ) == 0 ) { return this . y2 . compareTo ( intersection . y2 ) ; } else { return this . y1 . compareTo ( intersection . y1 ) ; } } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class B_Maria_Breaks_the_Self_isolation {   static int testCases , n ; static Scanner scanner = new Scanner ( ) ; static void merge ( long a [ ] , int left , int right , int mid ) { int n1 = mid - left + 1 , n2 = right - mid ; long L [ ] = new long [ n1 ] ; long R [ ] = new long [ n2 ] ; for ( int i = 0 ; i < n1 ; i ++ ) { L [ i ] = a [ left + i ] ; } for ( int i = 0 ; i < n2 ; i ++ ) { R [ i ] = a [ mid + 1 + i ] ; } int i = 0 , j = 0 , k = left ; while ( i < n1 && j < n2 ) { if ( L [ i ] <= R [ j ] ) { a [ k ] = L [ i ] ; i ++ ; } else { a [ k ] = R [ j ] ; j ++ ; } k ++ ; } while ( i < n1 ) { a [ k ] = L [ i ] ; k ++ ; i ++ ; } while ( j < n2 ) { a [ k ] = R [ j ] ; j ++ ; k ++ ; } } static void mergeSort ( long a [ ] , int left , int right ) { if ( left >= right ) { return ; } int mid = ( left + right ) / 2 ; mergeSort ( a , left , mid ) ; mergeSort ( a , mid + 1 , right ) ; merge ( a , left , right , mid ) ; } static void solve ( ) throws IOException { n = scanner . nextInt ( ) ; long a [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scanner . nextLong ( ) ; } mergeSort ( a , 0 , a . length - 1 ) ;

from collections import defaultdict   t = int ( input ( ) )   while t != 0 : balance = 0 seen = 1 a = defaultdict ( int ) n = int ( input ( ) ) for i in map ( int , input ( ) . split ( ) ) : a [ i ] += 1 a = dict ( sorted ( a . items ( ) , key = lambda x : x [ 0 ] ) ) for key , value in a . items ( ) : if balance + value + seen - 1 >= key : seen += ( balance + value ) balance = 0 else : balance += value print ( seen ) t -= 1 NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) s = 1 arr . sort ( ) NEW_LINE


t = int ( input ( ) ) for a in range ( t ) : n = int ( input ( ) ) bt = list ( map ( int , input ( ) . split ( ) ) ) bt . sort ( ) NEW_LINE


import matht = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) ans = n + 1 k = n - 1 for j in range ( n ) : if ( a [ k ] < ans ) : break ans = ans - 1 k = k - 1 print ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . File ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;   public class Main {   static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) throws IOException {   FastScanner input = new FastScanner ( ) ; int tc = input . nextInt ( ) ; work : while ( tc -- > 0 ) { int n = input . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; } sort ( a ) ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( a [ i ] <= ( i + 1 ) ) { System . out . println ( i + 2 ) ; continue work ; } } System . out . println ( "1" ) ; }   }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; import java . util . stream . Collectors ; public class test { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tests = sc . nextInt ( ) ; for ( int t = 0 ; t < tests ; t ++ ) { int n = sc . nextInt ( ) ; int [ ] tab = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { tab [ i ] = sc . nextInt ( ) ; } Arrays . sort ( tab ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( tab [ i ] <= i + 1 ) { count = i + 1 ; } } System . out . println ( count + 1 ) ; } } }


import java . util . * ;   public class Practise {   static int [ ] [ ] dp ;   static long sum = 0 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) {   int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ;   } Arrays . sort ( arr ) ; int incourt = n ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( incourt >= arr [ i ] ) { break ; } else incourt -- ;   } System . out . println ( incourt + 1 ) ;


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ;   public class FarewellParty { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] input = br . readLine ( ) . split ( " ▁ " ) ; int [ ] peopleWearingSame = new int [ n ] ; int [ ] freq = new int [ n + 1 ] ; int [ ] answer = new int [ n ] ; int counter = 1 ; for ( int i = 0 ; i < n ; i ++ ) { peopleWearingSame [ i ] = n - Integer . parseInt ( input [ i ] ) ; freq [ peopleWearingSame [ i ] ] ++ ; if ( peopleWearingSame [ i ] == 1 ) { answer [ i ] = counter ; counter ++ ; } } for ( int i = 2 ; i <= n ; i ++ ) { if ( freq [ i ] % i != 0 ) { System . out . println ( " Impossible " ) ; System . exit ( 0 ) ; } else { if ( freq [ i ] != 0 ) { int counter2 = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( peopleWearingSame [ j ] == i ) { counter2 ++ ; answer [ j ] = counter ; if ( counter2 == i ) { counter ++ ; counter2 = 0 ; } } } } } } System . out . println ( " Possible " ) ; for ( int i = 0 ; i < n ; i ++ ) { System . out . print ( answer [ i ] + " ▁ " ) ; } System . out . println ( ) ; } }

from collections import defaultdictn = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) d = defaultdict ( list ) for j in range ( n ) : d [ a [ j ] ] . append ( j ) f = 0 m = 1 for v in d : p = n - v if len ( d [ v ] ) % p != 0 : f = 1 break else : while d [ v ] != [ ] : for j in range ( p ) : q = d [ v ] . pop ( ) a [ q ] = m m = m + 1 if f == 0 : print ( ' Possible ' ) print ( ' ▁ ' . join ( map ( str , a ) ) ) else : print ( ' Impossible ' ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) )   c = 1 res = [ ] d = { } v = { } ok = Truefor item in a : if d . get ( item , 0 ) == 0 : d [ item ] = n - item - 1 v [ item ] = c c += 1 else : d [ item ] -= 1 res . append ( v [ item ] )   for k , v in d . items ( ) : if v != 0 : ok = False breakif ok : print ( ' Possible ' ) print ( ' ▁ ' . join ( map ( str , res ) ) ) else : print ( ' Impossible ' )     NEW_LINE


n = int ( input ( ) ) k = 0 d = { } i = 0 for x in map ( int , input ( ) . split ( ) ) : d . setdefault ( n - x , [ ] ) . append ( i ) ; i += 1 b = [ 0 ] * ng = 0 for x in d : l = d [ x ] ; g += 1 ; j = 0 if len ( l ) % x : print ( ' Impossible ' ) ; break for i in l : if j == x : j = 0 ; g += 1 b [ i ] = g ; j += 1 else : print ( ' Possible ' , * b ) NEW_LINE


import java . io . * ; import java . util . * ;   public class FarewellParty {   public static void main ( String [ ] args ) { FastScanner in = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) ; int a [ ] = in . readArray ( n ) ; int b [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) b [ i ] = n - a [ i ] ; int vis [ ] = new int [ n ] ; int ans [ ] = new int [ n ] ; int k = 1 ; boolean verdict = true ; for ( int i = 0 ; i < n ; i ++ ) { int cnt = 0 ; if ( vis [ i ] != 1 ) { for ( int j = i ; j < n ; j ++ ) { if ( b [ j ] == b [ i ] && vis [ j ] != 1 ) { cnt ++ ; ans [ j ] = k ; vis [ j ] = 1 ;


import java . util . * ; import java . lang . Math ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] hats = new int [ n ] ; int [ ] [ ] myArr = new int [ 3 ] [ n ] ; int available = 1 ; for ( int i = 0 ; i < n ; i ++ ) { int temp = scan . nextInt ( ) ; myArr [ 0 ] [ temp ] ++ ; hats [ i ] = temp ; } for ( int i = 0 ; i < n ; i ++ ) { if ( myArr [ 0 ] [ i ] % ( n - i ) != 0 ) { System . out . println ( " Impossible " ) ; return ; } } for ( int i = 0 ; i < n ; i ++ ) { int hatNum = hats [ i ] ; if ( myArr [ 2 ] [ hatNum ] == 0 ) { myArr [ 1 ] [ hatNum ] = available ++ ; } hats [ i ] = myArr [ 1 ] [ hatNum ] ; myArr [ 2 ] [ hatNum ] ++ ; myArr [ 2 ] [ hatNum ] %= n - hatNum ; } if ( available > n + 1 ) { System . out . println ( " Impossible " ) ; } System . out . println ( " Possible " ) ; for ( int x : hats ) System . out . print ( x + " ▁ " ) ; } }


import java . util . * ;   public class Maximal_Continuous_Rest { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long [ ] arr = new long [ ( int ) ( 2 * n ) ] ; List < Long > l = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; }

from itertools import groupbyn = int ( input ( ) ) A = list ( map ( int , input ( ) . split ( ) ) ) B = A * 2 g = groupby ( B ) ans = max ( len ( list ( v ) ) if k == 1 else 0 for k , v in g ) print ( ans ) NEW_LINE


n = int ( input ( ) ) hours = [ int ( i ) for i in input ( ) . split ( ) ] hours += hourscounter = 0 max_rest = 0 for hour in hours : if hour == 1 : counter += 1 if counter > max_rest : max_rest = counter else : counter = 0 print ( max_rest ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 consecutive = 0 for i in range ( n ) : if a [ i ] == 1 : consecutive += 1 else : consecutive = 0 ans = max ( ans , consecutive ) L = 0 for i in range ( n ) : if a [ i ] == 1 : L += 1 else : breakR = 0 for i in range ( n - 1 , - 1 , - 1 ) : if a [ i ] == 1 : R += 1 else : breakprint ( max ( ans , min ( n , L + R ) ) ) NEW_LINE


n = int ( input ( ) ) a = list ( input ( ) . split ( ) ) b = a * 2 bb = ' ' . join ( b ) c = bb . split ( '0' ) ans = 0 for i in c : ans = max ( ans , len ( i ) ) print ( ans ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) p = [ ] ; c = 0 for i in range ( len ( a ) ) : a . append ( a [ i ] ) i = 0 while i < len ( a ) : if a [ i ] == 1 : c += 1 else : p . append ( c ) c = 0 i += 1 print ( max ( p ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; public class B {   public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int n = fs . nextInt ( ) ; ArrayList < Integer > a = new ArrayList < > ( ) ; int len = 0 ; int curr = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int b = fs . nextInt ( ) ; a . add ( b ) ; if ( b == 0 ) { len = Math . max ( len , curr ) ; curr = 0 ; } else { curr ++ ; } } for ( int b : a ) { if ( b == 0 ) { len = Math . max ( len , curr ) ; curr = 0 ; } else { curr ++ ; } } System . out . println ( len ) ; } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }


import java . util . Scanner ;   public class Apple {   public static void main ( String args [ ] ) {   try {   Scanner sc = new Scanner ( System . in ) ;   int T = sc . nextInt ( ) ; System . out . println ( ) ;   while ( T > 0 ) {   int A [ ] = new int [ T ] ;   for ( int i = 0 ; i < T ; i ++ ) {   A [ i ] = sc . nextInt ( ) ;   }   int B [ ] = new int [ 2 * T ] ;   for ( int i = 0 ; i < T ; i ++ ) {   B [ i ] = A [ i ] ;   }   for ( int i = T ; i < 2 * T ; i ++ ) {   B [ i ] = A [ i - T ] ;   }   int count = 0 ; int result = 0 ;   for ( int i = 0 ; i < 2 * T ; i ++ ) {   if ( B [ i ] == 0 ) { count = 0 ; } else {   count ++ ; result = Math . max ( result , count ) ; } }   System . out . println ( result ) ;   T -- ; }   } catch (   Exception e ) { return ;   } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashMap ; import java . util . Map ; import java . util . StringTokenizer ;   public class B_Maximal_Continuous_Rest {   static Scanner scanner = new Scanner ( ) ; static long n ; static Map < Long , Long > map = new HashMap < > ( ) ; public static void main ( String [ ] args ) throws IOException { n = scanner . nextLong ( ) ; long index = 1 ; while ( index <= n ) { map . put ( index , scanner . nextLong ( ) ) ; index ++ ; }


import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } int a = 0 , b = 0 , temp = 0 , c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 1 ) a ++ ; else break ; } for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( arr [ i ] == 1 ) b ++ ; else break ; } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 1 ) c ++ ; else c = 0 ; temp = Math . max ( temp , c ) ; } System . out . println ( Math . max ( temp , a + b ) ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class FastIO { BufferedReader br ; StringTokenizer st ; public FastIO ( ) {

def func ( n , m , x , y ) : t = max ( x ) a = min ( x ) * 2 t = max ( t , a ) for i in y : if i <= t : return - 1 return t   n , m = map ( int , input ( ) . split ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) y = list ( map ( int , input ( ) . split ( ) ) ) print ( func ( x , m , x , y ) ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) cor = list ( map ( int , input ( ) . split ( ) ) ) wro = list ( map ( int , input ( ) . split ( ) ) ) maxx = max ( cor ) minn = min ( wro ) extra = min ( cor ) if maxx >= minn : print ( - 1 ) exit ( ) while True : if ( extra * 2 ) <= maxx : print ( maxx ) exit ( ) maxx += 1 if maxx >= minn : print ( - 1 ) exit ( )                         NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) l1 = list ( map ( int , input ( ) . split ( ) ) ) l2 = list ( map ( int , input ( ) . split ( ) ) ) x = min ( l1 ) y = max ( l1 ) res = max ( 2 * x , y ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) w = list ( map ( int , input ( ) . split ( ) ) ) a = min ( c ) tl = 2 * afor i in range ( len ( c ) ) : if tl >= c [ i ] : pass else : tl = c [ i ] for i in range ( len ( w ) ) : if tl < w [ i ] : pass else : print ( - 1 ) exit ( ) print ( tl ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) right = list ( map ( int , input ( ) . split ( ) ) ) wrong = list ( map ( int , input ( ) . split ( ) ) ) ans = max ( 2 * min ( right ) , max ( right ) ) print ( - 1 ) if min ( wrong ) <= ans else print ( ans ) NEW_LINE


import java . util . * ; public class TL { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean flag = true ;   int [ ] correct = new int [ n ] ;   int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { correct [ i ] = sc . nextInt ( ) ; if ( correct [ i ] > max ) { max = correct [ i ] ; } }   for ( int i = 0 ; i < n ; i ++ ) { if ( correct [ i ] * 2 <= max ) { break ; } if ( i == n - 1 ) { flag = false ; } }   int min = Integer . MAX_VALUE ; if ( flag == false ) { for ( int i = 0 ; i < n ; i ++ ) { if ( correct [ i ] * 2 > max ) { if ( correct [ i ] * 2 < min ) min = correct [ i ] * 2 ; } } }   if ( flag == false ) { max = min ; flag = true ; }   for ( int i = 0 ; i < m ; i ++ ) { if ( sc . nextInt ( ) <= max ) { flag = false ; break ; } } sc . close ( ) ;


import java . util . Scanner ; import java . util . Arrays ; public class Tl { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int correct = sc . nextInt ( ) ; int wrong = sc . nextInt ( ) ;   int arr1 [ ] = new int [ correct ] ; int arr2 [ ] = new int [ wrong ] ;   for ( int i = 0 ; i < correct ; i ++ ) { arr1 [ i ] = sc . nextInt ( ) ;   } for ( int i = 0 ; i < wrong ; i ++ ) { arr2 [ i ] = sc . nextInt ( ) ; }   Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ;


import java . util . Scanner ; import java . util . Arrays ; public class Solution { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int arr1 [ ] = new int [ n ] ; int arr2 [ ] = new int [ m ] ; for ( int i1 = 0 ; i1 < n ; i1 ++ ) { arr1 [ i1 ] = sc . nextInt ( ) ; } for ( int i2 = 0 ; i2 < m ; i2 ++ ) { arr2 [ i2 ] = sc . nextInt ( ) ; } Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ; if ( arr1 [ n - 1 ] < arr2 [ 0 ] ) { if ( arr1 [ 0 ] <= ( arr1 [ n - 1 ] / 2 ) ) { System . out . println ( arr1 [ n - 1 ] ) ; } else { if ( ( 2 * arr1 [ 0 ] < arr2 [ 0 ] ) ) { System . out . println ( 2 * arr1 [ 0 ] ) ; } else { System . out . println ( " - 1" ) ; } } } else { System . out . println ( " - 1" ) ; } } }


import java . util . Scanner ;   public class A350 { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int minCorrect = 100 ; int maxCorrect = 0 ; int wrong = 100 ; for ( int i = 0 ; i < n ; i ++ ) { int a = s . nextInt ( ) ; if ( a < minCorrect ) { minCorrect = a ; } if ( a > maxCorrect ) { maxCorrect = a ; } } for ( int i = 0 ; i < m ; i ++ ) { int a = s . nextInt ( ) ; if ( a < wrong ) { wrong = a ; } } int correct = Math . max ( minCorrect * 2 , maxCorrect ) ; int answer ; if ( correct >= wrong ) { answer = - 1 ; } else { answer = correct ; } System . out . println ( answer ) ; } }


import java . util . * ; import java . io . * ;   public class Solution { public static void main ( String [ ] args ) { FastReader sc = new FastReader ( ) ; int n = sc . nextInt ( ) ;   int [ ] pattern = new int [ n ] ; String [ ] text = new String [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) pattern [ i ] = sc . nextInt ( ) ;   for ( int i = 0 ; i < n ; i ++ ) text [ i ] = sc . nextLine ( ) ;   int f = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String curr = text [ i ] ;

if __name__ == ' _ _ main _ _ ' : cin = input n = int ( cin ( ) ) a = [ int ( i ) for i in input ( ) . split ( ) ] d = { ' a ' : 0 , ' e ' : 0 , ' i ' : 0 , ' o ' : 0 , ' u ' : 0 , ' y ' : 0 }   for i in range ( n ) : for c in cin ( ) : if c in d . keys ( ) : d [ c ] += 1 if sum ( d . values ( ) ) != a [ i ] : print ( " NO " ) break d = d . fromkeys ( d , 0 ) else : print ( " YES " ) NEW_LINE


n = int ( input ( ) )     t = list ( map ( int , input ( ) . split ( ) ) ) x = ' aeiouy ' r = 0 for j in range ( n ) :   f = input ( ) p = 0 for i in f : if i in x : p += 1 NEW_LINE


vow = set ( [ ' a ' , ' e ' , ' i ' , ' o ' , ' u ' , ' y ' ] ) def f ( x ) : q = 0 for y in x : q += int ( y in vow ) return qn = int ( input ( ) ) p = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] fl = 1 for i in range ( n ) : s = [ f ( x ) for x in input ( ) . split ( ' ▁ ' ) ] if ( sum ( s ) != p [ i ] ) : fl = 0 print ( " YES " if ( fl ) else ( " NO " ) ) NEW_LINE


''' import ▁ syssys . stdin = open ( " input . txt " , " r " ) sys . stdout = open ( " output . txt " , " w " ) '''   n = int ( input ( ) ) p = [ int ( i ) for i in input ( ) . split ( ) ] flag = Truefor i in range ( n ) : s = input ( ) if ( s . count ( ' a ' ) + s . count ( ' e ' ) + s . count ( ' i ' ) + s . count ( ' o ' ) + s . count ( ' u ' ) + s . count ( ' y ' ) ) != p [ i ] and flag : flag = Falseif flag : print ( " YES " ) else : print ( " NO " ) NEW_LINE


def solve ( ) : n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) : s = input ( ) tot = 0 tot += s . count ( ' a ' ) tot += s . count ( ' e ' ) tot += s . count ( ' i ' ) tot += s . count ( ' o ' ) tot += s . count ( ' u ' ) tot += s . count ( ' y ' ) if tot != p [ i ] : print ( ' NO ' ) return print ( ' YES ' ) solve ( ) NEW_LINE


import java . util . Scanner ;   public class Verse_Pattern { static Scanner scanner = new Scanner ( System . in ) ; static int n ; static boolean valid ( String s , int n ) { int count = 0 ;


import java . io . * ; import java . util . * ;   public class Main { static BufferedReader br ; static StringTokenizer st ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static class AL < T > extends ArrayList < T > { } ; public static class HM < T , Integer > extends HashMap < T , T > { } ; public static class HS < T > extends HashSet < T > { } ; static final List < Character > lst = Arrays . asList ( ' a ' , ' e ' , ' i ' , ' o ' , ' u ' , ' y ' ) ; public static void main ( String [ ] args ) throws IOException { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; st = new StringTokenizer ( br . readLine ( ) ) ; int n = nxtInt ( ) , a [ ] = new int [ n ] ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nxtInt ( ) ; HashSet < Character > vowel = new HashSet < > ( lst ) ; boolean flg = true ; for ( int i = 0 ; i < n ; i ++ ) { char [ ] s = nxtLn ( ) . toCharArray ( ) ; int v = 0 ; for ( int j = 0 ; j < s . length ; j ++ ) if ( vowel . contains ( s [ j ] ) ) v ++ ; if ( v != a [ i ] ) { flg = false ; break ; } } pr . print ( flg ? " YES " : " NO " ) ; pr . flush ( ) ; pr . close ( ) ; } static int nxtInt ( ) { return Integer . parseInt ( nxt ( ) ) ; } static long nxtLong ( ) { return Long . parseLong ( nxt ( ) ) ; } static double nxtDoub ( ) { return Double . parseDouble ( nxt ( ) ) ; } static String nxt ( ) { return st . nextToken ( ) ; } static String nxtLn ( ) throws IOException { return br . readLine ( ) ; } }


import java . io . * ; import java . util . * ;    public class Main {   public static void main ( String args [ ] ) {   Read input = new Read ( ) ; int n = input . nextInt ( ) , num [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) num [ i ] = input . nextInt ( ) ;   boolean ok = true ;   for ( int i = 0 ; i < n ; i ++ ) { String lin = input . line ( ) ; int cur = 0 ; for ( int j = 0 ; j < lin . length ( ) ; j ++ ) { char x = lin . charAt ( j ) ; if ( x == ' a ' || x == ' e ' || x == ' i ' || x == ' o ' || x == ' u ' || x == ' y ' ) cur ++ ; }   if ( cur != num [ i ] ) { ok = false ; break ; } }   if ( ok ) System . out . print ( " YES " ) ; else System . out . print ( " NO " ) ;   }   private static class Read { BufferedReader br ; StringTokenizer tk ;   public Read ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( tk == null || ! tk . hasMoreElements ( ) ) { try { tk = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return tk . nextToken ( ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } String line ( ) { String ans = " " ; try { ans = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return ans ; }   }     }


import java . util . * ; import java . io . * ; import java . lang . * ; import java . math . BigInteger ;   public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; boolean x = false ; String temp = br . readLine ( ) ; String a [ ] = temp . split ( " ▁ " ) ; for ( int j = 0 ; j < n ; j ++ ) { String s = br . readLine ( ) ;


import java . util . * ;   public class SuffixStructure_B { public static boolean automaton ( String s , String t ) { boolean check = true ; int temp = 0 ; for ( char c : t . toCharArray ( ) ) { boolean found = false ; for ( int i = temp ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == c ) { found = true ; temp = i + 1 ; break ; } } if ( found == false ) { return false ; } } return true ; } public static boolean isAnagram ( String s , String t ) { int arr [ ] = new int [ 26 ] ; for ( char c : s . toCharArray ( ) ) { int x = ( int ) c - 97 ; arr [ x ] ++ ; } for ( char c : t . toCharArray ( ) ) { int x = ( int ) c - 97 ; arr [ x ] -- ; } boolean check = true ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( arr [ i ] != 0 ) { check = false ; break ; } } return check ; } public static boolean containsDifferent ( String s , String t ) { int arr [ ] = new int [ 26 ] ; for ( char c : s . toCharArray ( ) ) {

s = input ( ) t = input ( ) def issubstring ( a , b ) : cnt = 0 for i in b : if i in a : a = list ( a ) a . remove ( i ) p = " " for i in a : p += i a = p cnt += 1 if cnt == len ( b ) : return True else : return False   NEW_LINE


def issubset ( a , b ) : i = 0 for c in a : if i < len ( b ) and c == b [ i ] : i += 1 return i == len ( b )   x = input ( ) y = input ( ) sx , sy = sorted ( x ) , sorted ( y ) if sx == sy : print ( " array " ) elif issubset ( x , y ) : print ( " automaton " ) elif issubset ( sx , sy ) : print ( " both " ) else : print ( " need ▁ tree " ) NEW_LINE


import sys     def ints_input ( ) : return [ int ( i ) for i in sys . stdin . readline ( ) . strip ( " \n " ) . split ( " ▁ " ) ]     def print_list ( arr ) : sys . stdout . writelines ( str ( x ) + " ▁ " for x in arr ) sys . stdout . write ( " \n " )     def fast_input ( type = str ) : return type ( sys . stdin . readline ( ) . strip ( " \n " ) )     s = fast_input ( ) t = fast_input ( )   fs = { } ft = { }     for i in s : if i in fs : fs [ i ] += 1 else : fs [ i ] = 1   for i in t : if i in ft : ft [ i ] += 1 else : ft [ i ] = 1   NEW_LINE


import java . util . * ;   public class run {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String w = s . next ( ) ; String r = s . next ( ) ; cf_448B ( w , r ) ; } static void cf_448B ( String s , String t ) { int [ ] arr = new int [ 26 ] ; int [ ] arr1 = new int [ 26 ] ;   for ( int i = 0 ; i < s . length ( ) ; i ++ ) { arr [ s . charAt ( i ) - ' a ' ] ++ ; } for ( int j = 0 ; j < t . length ( ) ; j ++ ) { arr1 [ t . charAt ( j ) - ' a ' ] ++ ; } for ( int i = 0 ; i < t . length ( ) ; i ++ ) { if ( arr [ t . charAt ( i ) - ' a ' ] < arr1 [ t . charAt ( i ) - ' a ' ] ) { System . out . println ( " need ▁ tree " ) ; return ; } } for ( int i = 0 ; ( i + t . length ( ) ) <= s . length ( ) ; i ++ ) { if ( ( s . substring ( i , i + t . length ( ) ) ) . equals ( t ) ) { System . out . println ( " automaton " ) ; return ; } } int p1 = 0 ; int p2 = 0 ; while ( p1 < s . length ( ) && p2 < t . length ( ) ) { if ( s . charAt ( p1 ) == t . charAt ( p2 ) ) { p2 ++ ; } p1 ++ ; } if ( p2 == t . length ( ) ) { System . out . println ( " automaton " ) ; return ; } if ( s . length ( ) == t . length ( ) ) { System . out . println ( " array " ) ; return ; } System . out . println ( " both " ) ; } }


import java . io . BufferedWriter ; import java . io . ByteArrayInputStream ; import java . io . FileInputStream ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . InputMismatchException ;   public class Main { private static final long MOD = ( long ) 1e9 + 7 ; static InputStream is ; static PrintWriter out ; static String INPUT = " " ; static int lenbuf = 0 , ptrbuf = 0 ; static boolean readFile = false ;


n , a , b = map ( int , input ( ) . split ( ) ) lis = list ( map ( int , input ( ) . split ( ) ) ) for i in lis : x = ( i * a ) % b print ( int ( x / a ) , end = ' ▁ ' ) NEW_LINE


n , a , b = map ( int , input ( ) . split ( ) ) x = [ int ( i ) for i in input ( ) . split ( ) ]   def find_index ( n ) : l = 0 ; r = n while l < r : mid = ( l + r ) // 2 if ( mid * a ) // b == ( r * a ) // b : r = mid else : l = mid + 1 return r   for i in range ( n ) : print ( x [ i ] - find_index ( x [ i ] ) , end = " ▁ " )   print ( ) NEW_LINE


import mathn , a , b = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) for e in l : z = ( e * a ) // b s = e - math . ceil ( z * b / a ) print ( s , end = " ▁ " ) print ( ) NEW_LINE


n , a , b = map ( int , input ( ) . split ( ) ) lis = list ( map ( int , input ( ) . split ( ) ) ) for i in lis : x = ( i * a ) % b print ( int ( x / a ) )   NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ; public class Euler { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; long a = in . nextLong ( ) ; long b = in . nextLong ( ) ; long [ ] x = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) x [ i ] = in . nextLong ( ) ; for ( int i = 0 ; i < n ; i ++ ) { long mod = ( x [ i ] * a ) % b ; long ans = mod / a ; System . out . print ( ans + " ▁ " ) ; } } }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class TaskB { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int N = in . nextInt ( ) ; int A = in . nextInt ( ) , B = in . nextInt ( ) ; int nums [ ] = CPUtils . readIntArray ( N , in ) ; int answer [ ] = new int [ N ] ;   for ( int i = 0 ; i < N ; i ++ ) { int ai = ( int ) ( ( ( long ) nums [ i ] * A ) % B ) ; answer [ i ] = ai / A ; } CPUtils . printIntArray ( answer , out ) ;   }   }   static class CPUtils { public static int [ ] readIntArray ( int size , Scanner in ) { int [ ] array = new int [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { array [ i ] = in . nextInt ( ) ; } return array ; }   public static void printIntArray ( int [ ] array , PrintWriter out ) { StringBuilder stringBuilder = new StringBuilder ( ) ; for ( int i = 0 ; i < array . length ; i ++ ) { stringBuilder . append ( array [ i ] + " ▁ " ) ; } out . print ( stringBuilder . toString ( ) ) ; }   } }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class TaskB { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int N = in . nextInt ( ) ; double A = in . nextInt ( ) , B = in . nextInt ( ) ; int nums [ ] = CPUtils . readIntArray ( N , in ) ; int answer [ ] = new int [ N ] ;   for ( int i = 0 ; i < N ; i ++ ) { int ai = ( int ) ( ( nums [ i ] * ( A * 1L ) ) % B ) ; answer [ i ] = ( int ) ( ai / A ) ; } CPUtils . printIntArray ( answer , out ) ;   }   }   static class CPUtils { public static int [ ] readIntArray ( int size , Scanner in ) { int [ ] array = new int [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { array [ i ] = in . nextInt ( ) ; } return array ; }   public static void printIntArray ( int [ ] array , PrintWriter out ) { StringBuilder stringBuilder = new StringBuilder ( ) ; for ( int i = 0 ; i < array . length ; i ++ ) { stringBuilder . append ( array [ i ] + " ▁ " ) ; } out . print ( stringBuilder . toString ( ) ) ; }   } }


import javax . annotation . processing . SupportedSourceVersion ; import java . io . * ; import java . util . * ; import java . util . regex . Matcher ;   public class Main {   public static void main ( String [ ] args ) throws IOException { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( new FileReader ( " input . txt " ) ) ;

import sys sys . stdin = open ( ' input . txt ' ) sys . stdout = open ( ' output . txt ' , ' w ' ) [ row_num , col_num , query_num ] = list ( map ( int , input ( ) . split ( ) ) ) rows = [ ] for r in range ( row_num + 1 ) : rows . append ( ( col_num + 1 ) * [ None ] ) location = { } for query_index in range ( query_num ) : tokens = input ( ) . split ( ) id = tokens . pop ( ) integers = list ( map ( int , tokens ) ) if integers [ 0 ] == - 1 : if id in location : r , c = location [ id ] del location [ id ] rows [ r ] [ c ] = None print ( " % d ▁ % d " % ( r , c ) ) else : print ( " - 1 ▁ - 1" ) else : r , c = integers [ 1 : 3 ] while rows [ r ] [ c ] : c += 1 if c > col_num : c = 1 r += 1 if r > row_num : break if r <= row_num : location [ id ] = [ r , c ] rows [ r ] [ c ] = id NEW_LINE


import sysdef add ( x , y , id_t , shelves , track ) : element = ( ( x - 1 ) % n ) * m + y - 1 ; if shelves [ element ] : element += 1 NEW_LINE


f1 = open ( " input . txt " , " r " ) f2 = open ( " output . txt " , " w " ) n , m , k = map ( int , f1 . readline ( ) . split ( ) ) a = [ 0 ] * n * mb = { } for i in range ( k ) : s = f1 . readline ( ) . split ( ) if s [ 0 ] == " + 1" : y , x , nm = int ( s [ 1 ] ) - 1 , int ( s [ 2 ] ) - 1 , s [ 3 ] ind = y * m + x while ind < n * m : if a [ ind ] == 0 : a [ ind ] = 1 b [ nm ] = ind break else : ind += 1 else : if s [ 1 ] in b : ind = b [ s [ 1 ] ] f2 . write ( str ( ind // m + 1 ) + " ▁ " + str ( ind % m + 1 ) + " \n " ) a [ ind ] = 0 del ( b [ s [ 1 ] ] ) else : f2 . write ( " - 1 ▁ - 1 \n " ) f1 . close ( ) f2 . close ( ) NEW_LINE


import java . io . BufferedReader ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class A {   public static void main ( String [ ] args ) throws IOException {   Scanner sc = new Scanner ( " input . txt " ) ; PrintWriter out = new PrintWriter ( new FileWriter ( " output . txt " ) ) ;


import java . io . * ; import java . util . * ;   public class B_Koala_and_Lights { public static void main ( String [ ] args ) throws Exception { int n = in . readInt ( ) ; char [ ] init = in . readLine ( ) . toCharArray ( ) ; int [ ] time = new int [ 1000 ] ; int [ ] [ ] bulb = new int [ n ] [ ] ; int ans = 0 , mxt = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { bulb [ i ] = in . readA ( ) ; boolean state = init [ i ] == '1' ? true : false ; for ( int t = 0 ; t < time . length ; t ++ ) { if ( t >= bulb [ i ] [ 1 ] && ( t - bulb [ i ] [ 1 ] ) % bulb [ i ] [ 0 ] == 0 ) state = ! state ; if ( state ) time [ t ] ++ ; if ( time [ t ] > ans ) { mxt = t ; ans = time [ t ] ; } } }

def STR ( ) : return list ( input ( ) ) def INT ( ) : return int ( input ( ) ) def MAP ( ) : return map ( int , input ( ) . split ( ) ) def MAP2 ( ) : return map ( float , input ( ) . split ( ) ) def LIST ( ) : return list ( map ( int , input ( ) . split ( ) ) ) def STRING ( ) : return input ( ) import stringimport sysfrom heapq import heappop , heappushfrom bisect import * from collections import deque , Counter , defaultdictfrom math import * from itertools import permutations , accumulatedx = [ - 1 , 1 , 0 , 0 ] dy = [ 0 , 0 , 1 , - 1 ] NEW_LINE


n = int ( input ( ) ) s = input ( ) lights = [ 0 for i in range ( 500 ) ] for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) if s [ i ] == '1' : counter = 0 off = 1 for j in range ( b ) : lights [ j ] += 1 counter = b + a NEW_LINE


from collections import *     n = int ( input ( ) ) s = input ( ) d = defaultdict ( int )   for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) dd = defaultdict ( int ) if s [ i ] == "1" : f = 0 ind = 0 ai = 0 for j in range ( 1000 ) : if f == 0 : for k in range ( ind + 1 , b + ( ai * a ) + 1 ) : d [ k ] += 1 dd [ k ] += 1 f = 1 ind = b + ( ai * a ) ai += 1 else : f = 0 ind = b + ( ai * a ) ai += 1 else : f = 1 ind = 0 ai = 0 for j in range ( 1000 ) : if f == 0 : for k in range ( ind + 1 , b + ( ai * a ) + 1 ) : d [ k ] += 1 dd [ k ] += 1 f = 1 ind = b + ( ai * a ) ai += 1 else : f = 0 ind = b + ( ai * a ) ai += 1 print ( max ( d . values ( ) ) ) NEW_LINE


n = int ( input ( ) ) s = input ( ) ss = ' ▁ ' . join ( s ) ss = ss . split ( ) ab = [ ] ans = 0 test = Falseloop = Trueii = 0 for i in range ( n ) : l = list ( map ( int , input ( ) . split ( ) ) ) ab . append ( l ) times = [ ] for i in range ( n ) : times . append ( ab [ i ] [ 1 ] ) for i in range ( 1000 ) : for j in range ( n ) : if times [ j ] == ii : times [ j ] += ab [ j ] [ 0 ] ss [ j ] = str ( ( int ( ss [ j ] ) + 1 ) % 2 ) ans = max ( ss . count ( '1' ) , ans ) ii += 1 print ( ans ) NEW_LINE


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String [ ] args ) throws Exception { FastReader fr = new FastReader ( ) ; int n = fr . nextInt ( ) ; String lights = fr . next ( ) ; char ch [ ] = lights . toCharArray ( ) ; int maxons = Integer . MIN_VALUE ; int period [ ] = new int [ n ] ; int glow [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { period [ i ] = fr . nextInt ( ) ; glow [ i ] = fr . nextInt ( ) ; } for ( int i = 1 ; i <= 1000 ; i ++ ) { int ons = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( ch [ j ] == '1' ) ons ++ ; if ( i == glow [ j ] ) { if ( ch [ j ] == '1' ) ch [ j ] = '0' ; else ch [ j ] = '1' ; glow [ j ] += period [ j ] ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class D {   public static void main ( String [ ] args ) throws IOException {   Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ;   int n = sc . nextInt ( ) , m = sc . nextInt ( ) , k = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; ++ i ) a [ i ] = sc . nextInt ( ) ; if ( n % 2 == 0 ) out . println ( 0 ) ; else { int b = a [ 0 ] ; for ( int i = 2 ; i < n ; i += 2 ) b = Math . min ( a [ i ] , b ) ; out . println ( Math . min ( b , 1l * m / ( ( n + 1 ) / 2 ) * k ) ) ; } out . close ( ) ; }   static class Scanner { StringTokenizer st ; BufferedReader br ;   public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; }   public String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; }   public int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   public long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   public String nextLine ( ) throws IOException { return br . readLine ( ) ; }   public boolean ready ( ) throws IOException { return br . ready ( ) ; }    } }

from sys import stdin   n , m , k = [ int ( x ) for x in stdin . readline ( ) . split ( ) ]   d = [ int ( x ) for x in stdin . readline ( ) . split ( ) ] NEW_LINE splitD = [ x for x in d [ : : 2 ] ]   if n == 1 : print ( min ( d [ 0 ] , k * m ) )   elif n == 2 : print ( 0 ) elif d [ 0 ] == 0 or d [ - 1 ] == 0 : print ( 0 ) elif n % 2 == 0 : print ( 0 ) else : if m >= n // 2 + 1 : times = m // ( n // 2 + 1 ) NEW_LINE print ( min ( times * k , min ( splitD ) ) ) else : print ( 0 ) NEW_LINE