import java . util . * ; public class Main { static void preProcess ( ArrayList < String > str ) { for ( int i = 0 ; i < str . size ( ) ; i ++ ) { String s = str . get ( i ) ; s = s . indexOf ( ' _ ' ) != - 1 ? s . replace ( " _ " , " " ) : s ; s = s . indexOf ( ' ; ' ) != - 1 ? s . replace ( " ; " , " " ) : s ; s = s . indexOf ( ' - ' ) != - 1 ? s . replace ( " - " , " " ) : s ; str . set ( i , s . toLowerCase ( ) ) ; }

from collections import Counter     NEW_LINE def SomRas ( s ) : return " " . join ( [ item . lower ( ) for item in s if item . isalpha ( ) ] ) NEW_LINE                                 naradmuni = SomRas ( input ( ) ) NEW_LINE vedvyas = SomRas ( input ( ) ) NEW_LINE RishiMuni = SomRas ( input ( ) )   n = int ( input ( ) ) NEW_LINE for test in range ( n ) : koi_dikkat = SomRas ( input ( ) )   was_a_thing = Counter ( koi_dikkat ) NEW_LINE maybe_a_thing = Counter ( naradmuni + vedvyas + RishiMuni )   if was_a_thing != maybe_a_thing : print ( " WA " ) NEW_LINE continue   sort_kiya_hua_cheez = sorted ( [ naradmuni , vedvyas , RishiMuni ] , key = len )   if sort_kiya_hua_cheez [ 2 ] in koi_dikkat : NEW_LINE INDENT koi_dikkat = koi_dikkat . split ( sort_kiya_hua_cheez [ 2 ] ) else : NEW_LINE print ( " WA " ) NEW_LINE DEDENT continue   if sort_kiya_hua_cheez [ 1 ] in koi_dikkat [ 0 ] : koi_dikkat += koi_dikkat [ 0 ] . split ( sort_kiya_hua_cheez [ 1 ] ) NEW_LINE koi_dikkat = koi_dikkat [ 1 : ]   elif sort_kiya_hua_cheez [ 1 ] in koi_dikkat [ 1 ] : last = koi_dikkat . pop ( ) NEW_LINE koi_dikkat += last . split ( sort_kiya_hua_cheez [ 1 ] )   else : print ( " WA " ) NEW_LINE continue   if sort_kiya_hua_cheez [ 0 ] in koi_dikkat : NEW_LINE INDENT print ( " ACC " ) else : NEW_LINE print ( " WA " ) NEW_LINE DEDENT


import sysinput = sys . stdin . readline     NEW_LINE def insr ( ) : s = input ( ) NEW_LINE return list ( s [ : len ( s ) - 1 ] )     NEW_LINE def fixStr ( s ) : s = list ( s ) NEW_LINE signs = [ ' - ' , ' ; ' , ' _ ' ] NEW_LINE i = 0 NEW_LINE while i < len ( s ) : if NEW_LINE s [ i ] in signs : s . pop ( i ) else : s [ i ] = s [ i ] . lower ( ) NEW_LINE i += 1 NEW_LINE return ' ' . join ( s )     words = [ fixStr ( insr ( ) ) , fixStr ( insr ( ) ) , fixStr ( insr ( ) ) ] NEW_LINE for i in range ( int ( input ( ) ) ) : sts = fixStr ( insr ( ) ) if sts == words [ 0 ] + words [ 1 ] + words [ 2 ] or sts == words [ 0 ] + NEW_LINE INDENT words [ 2 ] + words [ 1 ] or sts == words [ 1 ] + words [ 0 ] + words [ 2 ] or   \ sts == words [ 1 ] + words [ 2 ] + words [ 0 ] or sts == words [ 2 ] + words [ 0 ] + words [ 1 ] or   \ sts == words [ 2 ] + words [ 1 ] + words [ 0 ] : print ( " ACC " ) else : print ( " WA " ) NEW_LINE DEDENT


from collections import Counter NEW_LINE def cleanup ( s ) : return " " . join ( [ item . lower ( ) for item in s if item . isalpha ( ) ] ) NEW_LINE s1 = cleanup ( input ( ) ) NEW_LINE s2 = cleanup ( input ( ) ) NEW_LINE s3 = cleanup ( input ( ) ) NEW_LINE n = int ( input ( ) ) NEW_LINE for test in range ( n ) : st = cleanup ( input ( ) ) NEW_LINE c1 = Counter ( st ) NEW_LINE c2 = Counter ( s1 + s2 + s3 ) NEW_LINE if c1 != c2 : print ( " WA " ) NEW_LINE continue NEW_LINE sorted_strings = sorted ( [ s1 , s2 , s3 ] , key = len ) NEW_LINE if sorted_strings [ 2 ] in st : NEW_LINE INDENT st = st . split ( sorted_strings [ 2 ] ) else : NEW_LINE print ( " WA " ) NEW_LINE DEDENT continue NEW_LINE if sorted_strings [ 1 ] in st [ 0 ] : st += st [ 0 ] . split ( sorted_strings [ 1 ] ) NEW_LINE st = st [ 1 : ] elif sorted_strings [ 1 ] in st [ 1 ] : last = st . pop ( ) NEW_LINE st += last . split ( sorted_strings [ 1 ] ) else : print ( " WA " ) NEW_LINE continue NEW_LINE if sorted_strings [ 0 ] in st : NEW_LINE INDENT print ( " ACC " ) else : NEW_LINE print ( " WA " ) NEW_LINE DEDENT


def removeSigns ( s ) : news = " " NEW_LINE for i in s : if NEW_LINE i in " _ - ; " : NEW_LINE continue NEW_LINE if i >= ' A ' and i <= ' Z ' : NEW_LINE INDENT news += chr ( ord ( i ) + 32 ) else : NEW_LINE news += i NEW_LINE DEDENT return news   a = removeSigns ( input ( ) ) ; NEW_LINE aa = len ( a ) NEW_LINE b = removeSigns ( input ( ) ) ; NEW_LINE bb = len ( b ) NEW_LINE c = removeSigns ( input ( ) ) ; NEW_LINE cc = len ( c ) NEW_LINE concats = [ a + b + c , a + c + b , b + a + c , b + c + a , c + a + b , c + b + a ] NEW_LINE T = int ( input ( ) ) NEW_LINE ans = [ ] NEW_LINE for _ in range ( T ) : t = removeSigns ( input ( ) ) NEW_LINE if t in concats : NEW_LINE INDENT ans . append ( " ACC " ) else : NEW_LINE ans . append ( " WA " )   for i in ans : print ( i ) NEW_LINE DEDENT


import java . util . * ; import java . util . regex . * ; import java . io . * ;   public class shapur_corrections { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String s1 = ( scan . next ( ) ) . replaceAll ( " [ ; \\ - _ ] * " , " " ) . toLowerCase ( ) ; String s2 = ( scan . next ( ) ) . replaceAll ( " [ ; \\ - _ ] * " , " " ) . toLowerCase ( ) ; String s3 = ( scan . next ( ) ) . replaceAll ( " [ ; \\ - _ ] * " , " " ) . toLowerCase ( ) ; Pattern pat1 = Pattern . compile ( s1 ) ; Pattern pat2 = Pattern . compile ( s2 ) ; Pattern pat3 = Pattern . compile ( s3 ) ; String s4 = s1 + s2 + s3 ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s1 = br . readLine ( ) ; String s2 = br . readLine ( ) ; String s3 = br . readLine ( ) ; s1 = s1 . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; s2 = s2 . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; s3 = s3 . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; String [ ] ss = new String [ 7 ] ; ss [ 0 ] = s1 + s2 + s3 ; ss [ 1 ] = s1 + s3 + s2 ; ss [ 2 ] = s2 + s1 + s3 ; ss [ 3 ] = s2 + s3 + s1 ; ss [ 4 ] = s3 + s1 + s2 ; ss [ 5 ] = s3 + s2 + s1 ;   int n = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String str = br . readLine ( ) ; str = str . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; int j ; for ( j = 0 ; j < 6 ; j ++ ) { if ( str . equals ( ss [ j ] ) ) { System . out . println ( " ACC " ) ; break ; } } if ( j < 6 ) { continue ; } System . out . println ( " WA " ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s1 = br . readLine ( ) ; String s2 = br . readLine ( ) ; String s3 = br . readLine ( ) ; s1 = s1 . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; s2 = s2 . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; s3 = s3 . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; String [ ] ss = new String [ 6 ] ; ss [ 0 ] = s1 + s2 + s3 ; ss [ 1 ] = s1 + s3 + s2 ; ss [ 2 ] = s2 + s1 + s3 ; ss [ 3 ] = s2 + s3 + s1 ; ss [ 4 ] = s3 + s1 + s2 ; ss [ 5 ] = s3 + s2 + s1 ;   int n = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { String str = br . readLine ( ) ; str = str . replaceAll ( " - | ; | _ " , " " ) . toLowerCase ( ) ; int j ; for ( j = 0 ; j < 6 ; j ++ ) { if ( str . equals ( ss [ j ] ) ) { System . out . println ( " ACC " ) ; break ; } } if ( j < 6 ) { continue ; } System . out . println ( " WA " ) ; } } }


import java . util . * ;    public class dummycodes {   public static int solve ( int arr [ ] , int k ) { Arrays . parallelSort ( arr ) ; int sum = 0 ; int cnt = 0 ; int i = 11 ; while ( sum < k && i >= 0 ) { sum += arr [ i ] ; cnt ++ ; i -- ; } return sum < k ? - 1 : cnt ; } public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int arr [ ] = new int [ 12 ] ; for ( int i = 0 ; i < 12 ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } System . out . println ( solve ( arr , k ) ) ;   } }

k = int ( input ( ) ) lst = list ( map ( int , input ( ) . split ( ) ) )   if k <= 0 : print ( 0 ) else : lst . sort ( reverse = True ) for idx , growth in enumerate ( lst ) : k -= growth if k <= 0 : print ( idx + 1 ) break else : print ( - 1 ) NEW_LINE


k = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) )   l . sort ( ) l . reverse ( )     s = 0   if k == 0 : print ( 0 ) else : for i in range ( 12 ) : s += l [ i ] if ( s >= k ) : print ( i + 1 ) break else : print ( - 1 ) NEW_LINE


k = int ( input ( ) )   list = ( input ( ) . split ( ' ▁ ' ) ) for i in range ( 12 ) : list [ i ] = int ( list [ i ] )   c = 0 g = 0 max = 0   while True : if len ( list ) == 0 or g >= k or all ( i < 1 for i in list ) : break i = ( 0 , 0 ) for i in enumerate ( list ) : if i [ 1 ] > max : max = i [ 1 ] list . remove ( max ) NEW_LINE


k = int ( input ( ) ) length = [ int ( i ) for i in input ( ) . split ( ) ] length . sort ( reverse = True ) tot = 0 count = 0 if sum ( length ) < k : print ( - 1 ) else : for i in length : if tot < k : tot = i + tot count = count + 1 NEW_LINE


import java . util . * ;   public class Starting { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int k = sc . nextInt ( ) ; int [ ] arr = new int [ 12 ] ; for ( int i = 0 ; i < 12 ; i ++ ) arr [ i ] = sc . nextInt ( ) ;   Arrays . sort ( arr ) ;   int sum = 0 , ans = 0 ; for ( int i = 11 ; i >= 0 ; i -- ) { sum += arr [ i ] ; ++ ans ; if ( sum >= k ) break ; }   if ( k == 0 ) System . out . println ( "0" ) ; else if ( sum < k ) System . out . println ( " - 1" ) ; else System . out . println ( ans ) ;   sc . close ( ) ; } }


import java . io . IOException ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( System . in ) ; int k = in . nextInt ( ) ;   if ( k == 0 ) { System . out . println ( 0 ) ; System . exit ( 0 ) ; }   int [ ] inputs = new int [ 12 ] ; int i , sum = 0 , cnt = 0 ;   for ( i = 0 ; i < 12 ; i ++ ) { inputs [ i ] = in . nextInt ( ) ; }   Arrays . sort ( inputs ) ; int flag = 0 ;   for ( i = inputs . length - 1 ; i >= 0 ; i -- ) { sum += inputs [ i ] ; cnt ++ ; if ( sum >= k ) { flag = 1 ; break ; } }   if ( flag == 0 ) { System . out . println ( - 1 ) ; } else { System . out . println ( cnt ) ; }   } }


import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ;   public class Bai7 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; Integer month [ ] = new Integer [ 12 ] ;   for ( int i = 0 ; i < 12 ; i ++ ) { month [ i ] = sc . nextInt ( ) ; }   Arrays . sort ( month , Collections . reverseOrder ( ) ) ; int current_grow = 0 ; int count = 0 ; for ( int i = 0 ; i < 12 ; i ++ ) { if ( current_grow >= k ) { break ; } else if ( i == 11 && ( current_grow += month [ i ] ) < k ) { count = - 1 ; break ; } current_grow += month [ i ] ; count ++ ; } System . out . println ( count ) ; } }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ;   public class CodeForces { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; int [ ] arr = new int [ 12 ] ; for ( int i = 0 ; i < 12 ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; int count = 1 ; if ( t != 0 ) { int sum = arr [ 11 ] ; for ( int i = 10 ; i >= 0 ; i -- ) { if ( sum < t ) { count ++ ; sum += arr [ i ] ; } else { break ; } } System . out . println ( sum >= t ? count : - 1 ) ; } else { System . out . println ( 0 ) ; } } }


import java . util . * ;   public class cf183 { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ar [ ] = new int [ n ] ; int br [ ] = new int [ n ] ; int i = 0 ; long s1 = 0 ; long s2 = 0 ; for ( i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } for ( i = 0 ; i < n ; i ++ ) { br [ i ] = sc . nextInt ( ) ; } for ( i = 0 ; i < n ; i ++ ) { s1 += ar [ i ] ; s2 += br [ i ] ; } if ( s1 >= s2 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }

x = int ( input ( ) ) ar = list ( map ( int , input ( ) . split ( ) ) ) [ : x ] b = list ( map ( int , input ( ) . split ( ) ) ) [ : x ] ars = sum ( ar ) brs = sum ( b ) if ( brs <= ars ) : print ( " Yes " ) else : print ( " No " ) NEW_LINE


size = int ( input ( ) ) num1 = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) nums2 = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) sum1 = sum ( num1 ) sum2 = sum ( nums2 ) if sum2 <= sum1 : print ( ' Yes ' ) else : print ( ' No ' ) NEW_LINE


n = int ( input ( ) ) print ( ' YES ' if sum ( [ int ( i ) for i in input ( ) . split ( ) ] ) >= sum ( [ int ( i ) for i in input ( ) . split ( ) ] ) else ' NO ' ) NEW_LINE


n = int ( input ( ) ) x = [ int ( x ) for x in input ( ) . split ( ) ] y = [ int ( x ) for x in input ( ) . split ( ) ] if sum ( x ) >= sum ( y ) : print ( " Yes " ) else : print ( ' No ' ) NEW_LINE


import java . util . * ;   public class CodeForces1013A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = input . nextInt ( ) ; sum += x ; } for ( int i = 0 ; i < n ; i ++ ) { sum -= input . nextInt ( ) ; } if ( sum < 0 ) { System . out . println ( " No " ) ; } else { System . out . println ( " Yes " ) ; } } }


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


import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; import java . util . stream . Collectors ; public class _p001013A { static public void main ( final String [ ] args ) throws IOException { p001013A . _main ( args ) ; }


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; int b [ ] = new int [ n ] ; int sum1 = 0 ; int sum2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; sum1 += a [ i ] ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = sc . nextInt ( ) ; sum2 += b [ i ] ; } if ( sum2 <= sum1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Random ; import java . util . StringTokenizer ;   public class Solution { static final int mod = ( int ) 1e9 + 7 ; static final int N = 105 ; static int n ; static int [ ] a ; static int [ ] fact , invfact ; public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { n = fs . nextInt ( ) ; int sum = 0 ; a = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { a [ i ] = fs . nextInt ( ) ; sum += a [ i ] ; } fact = new int [ N ] ; fact [ 0 ] = 1 ; for ( int i = 1 ; i < N ; i ++ ) fact [ i ] = mul ( fact [ i - 1 ] , i ) ; invfact = new int [ N ] ; invfact [ N - 1 ] = inv ( fact [ N - 1 ] ) ; for ( int i = N - 2 ; i >= 0 ; i -- ) invfact [ i ] = mul ( invfact [ i + 1 ] , i + 1 ) ;

from math import factorialdp = [ [ - 1 for i in range ( 101 ) ] for j in range ( 101 ) ] def solve ( n , p , a ) : if dp [ n ] [ p ] is not - 1 : return dp [ n ] [ p ] elif p is 9 : if n >= a [ 9 ] : return 1 else : return 0 elif p is 0 : ans = 0 for i in range ( a [ 0 ] , n ) : z = solve ( n - i , 1 , a ) z *= factorial ( n - 1 ) z //= factorial ( i ) z //= factorial ( n - 1 - i ) ans += z dp [ n ] [ p ] = ans return ans else : ans = 0 for i in range ( a [ p ] , n + 1 ) : z = solve ( n - i , p + 1 , a ) z *= factorial ( n ) z //= factorial ( i ) z //= factorial ( n - i ) ans += z dp [ n ] [ p ] = ans return anshell = 1000000007 n = int ( input ( ) ) a = input ( ) . rstrip ( ) . split ( ' ▁ ' ) ; for i in range ( 0 , len ( a ) ) : a [ i ] = int ( a [ i ] ) ans = 0 for i in range ( 1 , n + 1 ) : ans += solve ( i , 0 , a ) ans %= hellprint ( ans ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static int mod = 1_000_000_007 ;   long [ ] [ ] dp ; int [ ] a ; void run ( FastScanner in , PrintWriter out ) { int N = in . nextInt ( ) ; a = new int [ 10 ] ; int tot = 0 ; for ( int i = 0 ; i < 10 ; i ++ ) { a [ i ] = in . nextInt ( ) ; tot += a [ i ] ; }   if ( tot > N ) { out . println ( 0 ) ; return ; }   f = new long [ 102 ] ; f [ 0 ] = 1 ; for ( int i = 1 ; i < 102 ; i ++ ) { f [ i ] = ( f [ i - 1 ] * i ) % mod ; }   dp = new long [ N + 1 ] [ 10 ] ;   for ( int i = 9 ; i >= 0 && a [ i ] == 0 ; i -- ) { dp [ 0 ] [ i ] = 1 ; }   long sum = 0 ; for ( int len = 1 ; len <= N ; len ++ ) {


import java . io . * ; import java . util . * ; import java . math . * ;   public class Main { public static void main ( String args [ ] ) throws Exception { FastScanner fs = new FastScanner ( ) ;

n , s = map ( int , input ( ) . split ( ) ) go = list ( map ( int , input ( ) . split ( ) ) ) come = list ( map ( int , input ( ) . split ( ) ) ) if go [ 0 ] == 0 : print ( ' NO ' ) exit ( ) if go [ s - 1 ] == 0 and come [ s - 1 ] == 0 : print ( ' NO ' ) exit ( ) if go [ s - 1 ] == 1 : print ( ' YES ' ) exit ( )   for i in range ( s , n ) : if go [ i ] == 1 and come [ i ] == 1 : print ( ' YES ' ) exit ( ) print ( ' NO ' ) NEW_LINE


s , n = map ( int , input ( ) . split ( ) ) l1 = list ( map ( int , input ( ) . split ( ) ) ) l2 = list ( map ( int , input ( ) . split ( ) ) ) f = 0 if l1 [ 0 ] == 1 : if l1 [ n - 1 ] == 1 : print ( " YES " ) else : for i in range ( n , s ) : if l1 [ i ] == 1 and l2 [ n - 1 ] == 1 and l2 [ i ] == 1 : f = 1 break if f == 1 : print ( " YES " ) else : print ( " NO " ) else : print ( " NO " ) NEW_LINE


n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) if a [ 0 ] == 1 : if a [ s - 1 ] == 1 : print ( " YES " ) elif b [ s - 1 ] == 1 : flag = True for i in range ( s , n ) : if a [ i ] == 1 and b [ i ] == 1 : print ( " Yes " ) flag = False break if flag : print ( " NO " ) else : print ( " NO " ) else : print ( " NO " ) NEW_LINE


n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) ans = " NO " if a [ 0 ] == 1 and a [ s - 1 ] == 1 : ans = " YES " elif a [ 0 ] == 1 and b [ s - 1 ] == 1 : for i in range ( s , n ) : if a [ i ] == 1 and b [ i ] == 1 : ans = " YES " breakprint ( ans ) NEW_LINE


def avialable_station ( ) : for i in range ( s , n ) : if ft [ i ] == 1 and st [ i ] == 1 : return True return Falsetry : n , s = map ( int , input ( ) . split ( ) ) ft = list ( map ( int , input ( ) . split ( ) ) ) st = list ( map ( int , input ( ) . split ( ) ) ) if ft [ s - 1 ] == 1 and ft [ 0 ] == 1 : print ( " YES " ) elif ft [ 0 ] == 0 or ( st [ s - 1 ] == 0 and ft [ s - 1 ] == 0 ) or not avialable_station ( ) : print ( " NO " ) else : print ( " YES " ) except : pass NEW_LINE


import java . util . * ; import java . util . Scanner ; import java . io . * ; import javax . lang . model . util . ElementScanner6 ; import static java . lang . System . out ; import java . util . Stack ; import java . util . Queue ; import java . util . LinkedList ;   public class A1055 {   static int mod = ( int ) ( 1e9 + 7 ) ; static long MOD = ( long ) ( 1e9 + 7 ) ; static FastReader in = new FastReader ( ) ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static void main ( String args [ ] ) {   int tc = 1 ;


import javax . sound . midi . Soundbank ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { task ( ) ; }   public static void task ( ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; int [ ] A = new int [ n ] ; int [ ] B = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { A [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { B [ i ] = sc . nextInt ( ) ; }   if ( A [ s - 1 ] == 0 && B [ s - 1 ] == 0 ) { System . out . println ( " NO " ) ; return ; } else if ( A [ 0 ] == 0 ) { System . out . println ( " NO " ) ; return ; } else if ( A [ s - 1 ] == 1 ) { System . out . println ( " YES " ) ; return ; } else { for ( int i = s ; i < n ; i ++ ) { if ( A [ i ] == 1 && B [ i ] == 1 ) { System . out . println ( " YES " ) ; return ; } } } System . out . println ( " NO " ) ; } }


import java . util . * ;   public class Test { public static void main ( String [ ] args ) {   Scanner input = new Scanner ( System . in ) ;   int n = input . nextInt ( ) ; int s = input . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; int [ ] b = new int [ n + 1 ] ;   for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = input . nextInt ( ) ; }   for ( int i = 1 ; i <= n ; i ++ ) { b [ i ] = input . nextInt ( ) ; }   boolean result = false ; if ( a [ 1 ] == 1 ) {   if ( a [ s ] == 1 ) { result = true ; } else { for ( int i = s ; i <= n ; i ++ ) { if ( i != s && a [ i ] == 1 && b [ i ] == 1 && b [ s ] == 1 ) { result = true ; break ; } } } } System . out . println ( ( result ) ? " YES " : " NO " ) ; } }


import java . util . * ; import java . io . * ; import java . util . stream . * ; public class Solution { public static void main ( String [ ] args ) throws Exception { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int s = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = scan . nextInt ( ) ; } boolean result ; if ( a [ 0 ] == 0 ) { result = false ; } else if ( a [ s - 1 ] == 1 ) { result = true ; } else if ( b [ s - 1 ] == 0 ) { result = false ; } else { result = false ; for ( int i = s ; i < n ; i ++ ) { if ( b [ i ] == 1 && a [ i ] == 1 ) { result = true ; break ; } } } System . out . println ( result ? " YES " : " NO " ) ; } }


import java . util . * ; import java . io . * ; import java . math . * ;   public class First {   public static void process ( ) throws IOException { int n = ni ( ) ; long d = nl ( ) ; long a [ ] = new long [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = nl ( ) ; } long count = 0l ;

n , d = list ( map ( int , input ( ) . split ( ) ) ) array = list ( map ( int , input ( ) . split ( ) ) ) start = 0 end = 0 ans = 0   while end < n : while array [ end ] - array [ start ] > d : start += 1 k = end - start ans += k * ( k - 1 ) // 2 end += 1 print ( ans ) NEW_LINE


n , d = map ( int , input ( ) . split ( ) ) ar = list ( map ( int , input ( ) . split ( ) ) ) i , j , s = 0 , 0 , 0 while i < n : while ar [ i ] - ar [ j ] > d : j += 1 N = i - j s += N * ( N - 1 ) // 2 i += 1 print ( s ) NEW_LINE


import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . LinkedHashMap ; import java . util . Map ; import java . util . Scanner ; import java . util . * ; import java . util . stream . Collectors ;   public class absolute { public static void main ( String [ ] args ) {


import java . util . * ; import java . io . * ;


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


import java . util . * ; public class Main { static void sol ( int i , int j , double l , int n , double data [ ] [ ] ) { if ( n == 0 ) return ; data [ i ] [ j ] += l ; if ( data [ i ] [ j ] <= 1.0 ) return ; else { l = data [ i ] [ j ] - 1.0 ; data [ i ] [ j ] = 1.0 ; sol ( i + 1 , j , l / 2 , n - 1 , data ) ; sol ( i + 1 , j + 1 , l / 2 , n - 1 , data ) ; } } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; double L = sc . nextDouble ( ) ; double data [ ] [ ] = new double [ N ] [ N ] ; int c = 0 ; sol ( 0 , 0 , L , N , data ) ; for ( int i = 0 ; i < N ; i ++ ) for ( int j = 0 ; j < N ; j ++ ) { if ( data [ i ] [ j ] == 1.0 ) c ++ ; } System . out . println ( c ) ; } }

n , t = map ( int , input ( ) . split ( ) )   an = [ [ 0 for i in range ( j + 1 ) ] for j in range ( n ) ]     def dfs ( i , j , v ) : if an [ i ] [ j ] + v > 1 : vv = v - ( 1 - an [ i ] [ j ] ) an [ i ] [ j ] = 1 if i == n - 1 : return dfs ( i + 1 , j , vv / 2 ) dfs ( i + 1 , j + 1 , vv / 2 ) return d = 1 if ( j == 0 or j == i ) else 2 an [ i ] [ j ] += v   for i in range ( t ) : dfs ( 0 , 0 , 1 ) ans = 0 for i in range ( n ) : for j in range ( i + 1 ) : ans += an [ i ] [ j ] >= 1   print ( ans ) NEW_LINE


n , t = list ( map ( int , input ( ) . split ( ) ) ) li = [ [ t - 1 ] ] cnt = 1 if t - 1 >= 0 else 0 for i in range ( 2 , n + 1 ) : tr = li [ - 1 ] [ 0 ] / 2 - 1 if tr >= 0 : cnt += 2 li . append ( [ tr ] ) for j in range ( 1 , i - 1 ) : a = li [ - 2 ] [ j - 1 ] b = li [ - 2 ] [ j ] temp = - 1 if a > 0 : temp += a / 2 if b > 0 : temp += b / 2 if temp >= 0 : cnt += 1 li [ - 1 ] . append ( temp ) li [ - 1 ] . append ( tr ) print ( cnt ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) dp = [ [ 0 for i in range ( n ) ] for i in range ( n ) ] dp [ 0 ] [ 0 ] = m NEW_LINE


import java . util . ArrayList ; import java . util . Scanner ;   public class Glass { public static void func ( int i , int j , double l , double [ ] [ ] arr ) { arr [ i ] [ j ] += l ; if ( arr [ i ] [ j ] <= 1.0 || i > arr . length - 2 ) { return ; } l = arr [ i ] [ j ] - 1.0 ; arr [ i ] [ j ] = 1.0 ; func ( i + 1 , j , l / 2 , arr ) ; func ( i + 1 , j + 1 , l / 2 , arr ) ; } public static void main ( String args [ ] ) {   Scanner sc = new Scanner ( System . in ) ; int count = 0 ; int n = sc . nextInt ( ) ; double l = sc . nextDouble ( ) ; double [ ] [ ] arr = new double [ n + 1 ] [ n + 1 ] ; func ( 0 , 0 , l , arr ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( arr [ i ] [ j ] >= 1.0 ) count ++ ; } } System . out . println ( count ) ;   } }


import java . util . * ; import java . io . * ; import static java . lang . Math . * ; public class A { static InputReader in = new InputReader ( System . in ) ; static OutputWriter out = new OutputWriter ( System . out ) ; static StringBuilder sb = new StringBuilder ( ) ; static long MOD = ( long ) ( 998244353 ) ;


import java . util . * ; public class pyramidOfGlass { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; if ( in . hasNextLine ( ) ) { int n = in . nextInt ( ) ;


import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ;   public class A1427 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; Integer [ ] A = new Integer [ N ] ; int sum = 0 ; for ( int n = 0 ; n < N ; n ++ ) { int a = in . nextInt ( ) ; sum += a ; A [ n ] = a ; } if ( sum == 0 ) { System . out . println ( " NO " ) ; } else { Arrays . sort ( A ) ; if ( sum > 0 ) { Collections . reverse ( Arrays . asList ( A ) ) ; } StringBuilder output = new StringBuilder ( ) ; output . append ( " YES \n " ) ; for ( int n = 0 ; n < N ; n ++ ) { output . append ( A [ n ] ) . append ( ' ▁ ' ) ; } System . out . println ( output ) ; } } }   }

cases = int ( input ( ) ) NEW_LINE while cases : cases -= 1 NEW_LINE num = int ( input ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE summ = sum ( arr ) NEW_LINE if summ == 0 : NEW_LINE INDENT print ( " NO " ) elif summ < 0 : NEW_LINE ans = sorted ( arr ) NEW_LINE DEDENT print ( " YES " ) NEW_LINE print ( * ans ) else : ans = sorted ( arr , reverse = True ) NEW_LINE print ( " YES " ) NEW_LINE print ( * ans ) NEW_LINE


test = int ( input ( ) ) NEW_LINE for t in range ( test ) : n = int ( input ( ) ) NEW_LINE lt = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE lst = sorted ( lt ) NEW_LINE if ( sum ( lst ) == 0 ) : NEW_LINE INDENT print ( " NO " ) elif sum ( lst ) < 0 : NEW_LINE print ( " YES " ) NEW_LINE DEDENT print ( * lst ) else : print ( " YES " ) NEW_LINE tmp = [ ] NEW_LINE for i in range ( n - 1 , - 1 , - 1 ) : tmp . append ( lst [ i ] ) NEW_LINE print ( * tmp ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = [ * map ( int , input ( ) . split ( ) ) ] NEW_LINE s = sum ( a ) NEW_LINE if s == 0 : NEW_LINE INDENT print ( " No " ) else : NEW_LINE b = [ ] NEW_LINE DEDENT sun = 0 NEW_LINE sup = 0 NEW_LINE for i in a : if NEW_LINE i < 0 : sun += i else : sup += i NEW_LINE if sup > abs ( sun ) : for NEW_LINE i in a : NEW_LINE if i > 0 : b . append ( i ) NEW_LINE for i in a : if NEW_LINE i <= 0 : b . append ( i ) else : for i in a : if NEW_LINE i < 0 : b . append ( i ) NEW_LINE for i in a : if NEW_LINE i >= 0 : b . append ( i ) NEW_LINE print ( " Yes " ) NEW_LINE print ( * b ) NEW_LINE


cases = int ( input ( ) ) NEW_LINE while cases : cases -= 1 NEW_LINE num = int ( input ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) )   summ = sum ( arr )   if summ == 0 : NEW_LINE INDENT print ( " NO " ) elif summ < 0 : NEW_LINE ans = sorted ( arr ) NEW_LINE DEDENT print ( " YES " ) NEW_LINE print ( * ans ) else : ans = sorted ( arr , reverse = True ) NEW_LINE print ( " YES " ) NEW_LINE print ( * ans ) NEW_LINE


for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if sum ( a ) == 0 : print ( ' NO ' ) NEW_LINE continue NEW_LINE pos , neg , zero = [ ] , [ ] , [ ] NEW_LINE for i in a : if NEW_LINE i > 0 : pos . append ( i ) elif i < 0 : neg . append ( i ) else : zero . append ( i ) NEW_LINE b = [ ] NEW_LINE if sum ( pos ) > abs ( sum ( neg ) ) : NEW_LINE INDENT b = pos + neg + zero else : NEW_LINE b = neg + pos + zero NEW_LINE DEDENT print ( ' YES ' ) NEW_LINE print ( * b ) NEW_LINE


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Comparator ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . StringTokenizer ; import java . util . TreeMap ;   public class Main implements Runnable { int n , m , k ; static boolean use_n_tests = true ;   void solve ( FastScanner in , PrintWriter out , int testNumber ) { n = in . nextInt ( ) ; Integer [ ] a = in . nextArray2 ( n ) ; long sum = Array . sum ( a ) ; if ( sum == 0 ) { out . println ( " NO " ) ; } else { out . println ( " YES " ) ; if ( sum > 0 ) { Arrays . sort ( a , Comparator . comparing ( v -> - v ) ) ; } else Arrays . sort ( a , Comparator . comparing ( v -> v ) ) ; for ( int x : a ) { out . print ( x + " ▁ " ) ; } out . println ( ) ; } }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ;   public class problem82 {   public static void main ( String [ ] args ) {


import java . util . * ; import java . math . * ;   public class gfg { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] a = new int [ k ] ; for ( int i = 0 ; i < k ; i ++ ) a [ i ] = sc . nextInt ( ) ; int [ ] b = Arrays . copyOf ( a , k ) ; Arrays . sort ( b ) ; int total = n * k + 1 ; int [ ] available = new int [ total ] ; int count = 0 ; for ( int i = 1 ; i <= total ; i ++ ) { if ( Arrays . binarySearch ( b , i ) < 0 ) { available [ count ] = i ; count ++ ; } } count = 0 ; for ( int i = 0 ; i < k ; i ++ ) { System . out . print ( a [ i ] + " ▁ " ) ; for ( int j = 0 ; j < n - 1 ; j ++ ) { System . out . print ( available [ count ++ ] + " ▁ " ) ; } System . out . println ( " " ) ; } } }

n , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) l1 = [ ] ans = n * kfor i in range ( 1 , ans + 1 ) : l1 . append ( i ) l2 = [ ] N = n - 1 for i in range ( len ( l1 ) ) : if ( l1 [ i ] in l ) : continue else : l2 . append ( l1 [ i ] ) def divide_chunks ( l , n ) : for i in range ( 0 , len ( l ) , n ) : yield l [ i : i + n ] if ( n == 1 ) : for i in range ( len ( l ) ) : print ( l [ i ] ) else : l3 = list ( divide_chunks ( l2 , N ) ) for i in range ( len ( l3 ) ) : l3 [ i ] . append ( l [ i ] ) print ( * l3 [ i ] ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   r = lambda : list ( map ( int , input ( ) . split ( ) ) ) arr = r ( )   num = 1   for i in arr : print ( i , end = " ▁ " ) lim = n - 1 while lim : if num not in arr : print ( num , end = " ▁ " )   lim -= 1 num += 1     print ( )     NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) ) req = list ( map ( int , input ( ) . split ( ) ) ) req . append ( " fake " ) idx = 0 ans = [ req [ 0 ] ] hashSet = set ( req )   for i in range ( 1 , n * k + 1 ) : if i not in hashSet : ans . append ( i ) if len ( ans ) == n : print ( * ans ) idx += 1 ans = [ req [ idx ] ] NEW_LINE


import mathfrom math import gcd , floor , sqrt , logdef iin ( ) : return int ( input ( ) ) def sin ( ) : return input ( ) . strip ( ) def listin ( ) : return list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) def liststr ( ) : return list ( map ( str , input ( ) . strip ( ) . split ( ) ) ) def ceill ( x ) : return int ( x ) if ( x == int ( x ) ) else int ( x ) + 1 def ceilldiv ( x , d ) : return x // d if ( x % d == 0 ) else x // d + 1 def LCM ( a , b ) : return ( a * b ) // gcd ( a , b )     def solve ( ) : n , k = listin ( ) a = listin ( ) z = [ i for i in range ( 1 , n * k + 1 ) if i not in a ] temp = 0 for j in range ( k ) : print ( a [ j ] , end = " ▁ " ) for i in range ( temp , n + temp - 1 ) : print ( z [ i ] , end = ' ▁ ' ) temp += n - 1 print ( ) t = 1 NEW_LINE


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; int a [ ] = new int [ n * k ] ; for ( int i = 0 ; i < n * k ; i ++ ) { a [ i ] = i + 1 ; } String ans [ ] = new String [ k ] ;


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


import java . util . * ; import java . io . * ; public class Main {   public static void main ( String [ ] args ) { FastScanner scan = new Main ( ) . new FastScanner ( ) ; ; int t = scan . nextInt ( ) ; int k = scan . nextInt ( ) ; boolean bl [ ] = new boolean [ t * k + 1 ] ; ArrayList < Integer > T = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < k ; ++ i ) { T . add ( scan . nextInt ( ) ) ; bl [ T . get ( i ) ] = true ;   } for ( int i = 0 ; i < k ; ++ i ) { System . out . print ( T . get ( i ) + " ▁ " ) ; int count = 0 ; for ( int j = 1 ; j <= t * k + 1 ; ++ j ) { if ( count == t - 1 ) { break ; } if ( bl [ j ] == false ) { ++ count ; System . out . print ( j + " ▁ " ) ; bl [ j ] = true ; }   } System . out . println ( ) ; }   } 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 ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }


import java . io . * ; import java . util . * ; import java . math . * ;   public class StairsElevators {   static class InputReader { BufferedReader reader ; StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   public double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } }   static InputReader r = new InputReader ( System . in ) ; static PrintWriter pw = new PrintWriter ( System . out ) ;   public static void main ( String [ ] args ) { long n = r . nextInt ( ) ;

import sysinput = sys . stdin . readlineimport mathimport bisectn , m , cl , ce , v = map ( int , input ( ) . split ( ) ) l = [ int ( i ) for i in input ( ) . split ( ) if i != ' \n ' ] e = [ int ( i ) for i in input ( ) . split ( ) if i != ' \n ' ] q = int ( input ( ) ) for i in range ( q ) : x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) lft , neareststa , sta , nearestele = 0 , 0 , 0 , 0 if x2 == x1 and y1 == y2 : output = 0 elif x2 == x1 : output = abs ( y2 - y1 ) else : lft = math . ceil ( abs ( ( x2 - x1 ) ) / v ) sta = abs ( x2 - x1 ) if cl > 0 : nearestele = bisect . bisect_left ( l , y1 ) if len ( l ) > nearestele : first = abs ( l [ nearestele ] - y1 ) + abs ( y2 - l [ nearestele ] ) else : first = 1000000000001 if nearestele != 0 : second = abs ( l [ nearestele - 1 ] - y1 ) + abs ( y2 - l [ nearestele - 1 ] ) else : second = 1000000000001 nearestele = min ( first , second ) else : nearestele = 1000000000001 if ce > 0 : neareststa = bisect . bisect_left ( e , y1 ) if len ( e ) > neareststa : first = abs ( e [ neareststa ] - y1 ) + abs ( y2 - e [ neareststa ] ) else : first = 1000000000001 if neareststa != 0 : second = abs ( e [ neareststa - 1 ] - y1 ) + abs ( y2 - e [ neareststa - 1 ] ) else : second = 1000000000001 neareststa = min ( first , second ) else : neareststa = 1000000000001 output = min ( lft + neareststa , sta + nearestele ) sys . stdout . write ( str ( output ) + ' \n ' )   NEW_LINE


def takeClosest ( myList , myNumber ) :   """   ▁ ▁ ▁ ▁ Assumes ▁ myList ▁ is ▁ sorted . ▁ Returns ▁ closest ▁ value ▁ to ▁ myNumber .     ▁ ▁ ▁ ▁ If ▁ two ▁ numbers ▁ are ▁ equally ▁ close , ▁ return ▁ the ▁ smallest ▁ number .   ▁ ▁ ▁ ▁ """   if len ( myList ) == 0 :   return 9e10   pos = bisect_left ( myList , myNumber )   if pos == 0 :   return myList [ 0 ]   if pos == len ( myList ) :   return myList [ - 1 ]   before = myList [ pos - 1 ]   after = myList [ pos ]   if after - myNumber < myNumber - before :   return after   else :   return before       from bisect import bisect_left   from math import ceil       n , m , n_stairs , n_elevators , v = map ( int , input ( ) . split ( " ▁ " ) )       if n_stairs > 0 :   stairs = list ( map ( int , input ( ) . split ( " ▁ " ) ) )   else :   stairs = [ ]   input ( )   if n_elevators > 0 :   elevators = list ( map ( int , input ( ) . split ( " ▁ " ) ) )   else :   elevators = [ ]   input ( )   queries = int ( input ( ) )   res = [ ]   for i in range ( queries ) :   x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( " ▁ " ) )   next_elevator = takeClosest ( elevators , ( y1 + y2 ) / 2 )   next_stairs = takeClosest ( stairs , ( y1 + y2 ) / 2 )   time_elevator = abs ( x1 - x2 ) / v   time_stairs = abs ( x1 - x2 )       mi = min ( y1 , y2 )   ma = max ( y1 , y2 )   if next_elevator < mi :   time_elevator += ( mi - next_elevator ) * 2   elif next_elevator > ma :   time_elevator += ( next_elevator - ma ) * 2       if next_stairs < mi :   time_stairs += ( mi - next_stairs ) * 2   elif next_stairs > ma :   time_stairs += ( next_stairs - ma ) * 2       dis = abs ( y1 - y2 )   if time_elevator < time_stairs :   dis += time_elevator   else :   dis += time_stairs   if x1 == x2 :   res . append ( abs ( y1 - y2 ) )   else :   res . append ( ceil ( dis ) )   print ( * res , sep = " \n " )       NEW_LINE


import sysinput = sys . stdin . readlineimport mathimport bisectn , m , cl , ce , v = map ( int , input ( ) . split ( ) ) l = [ int ( i ) for i in input ( ) . split ( ) if i != ' \n ' ] e = [ int ( i ) for i in input ( ) . split ( ) if i != ' \n ' ] q = int ( input ( ) ) for i in range ( q ) : x1 , y1 , x2 , y2 = map ( int , input ( ) . split ( ) ) lft , neareststa , sta , nearestele = 0 , 0 , 0 , 0 if x2 == x1 and y1 == y2 : output = 0 elif x2 == x1 : output = abs ( y2 - y1 ) else : lft = math . ceil ( abs ( ( x2 - x1 ) ) / v ) NEW_LINE


import java . io . * ; import java . util . * ; import java . util . concurrent . TimeUnit ;   public class b implements Runnable { public static void main ( String [ ] args ) { try { new Thread ( null , new b ( ) , " process " , 1 << 26 ) . start ( ) ; } catch ( Exception e ) { System . out . println ( e ) ; } } public void run ( ) { FastReader scan = new FastReader ( ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ;


import java . util . Scanner ;   public class Love_A {   public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ;   String s = in . nextLine ( ) ; int sa = s . replaceAll ( " [ ^ a ] " , " " ) . length ( ) ;   if ( sa <= s . length ( ) / 2 ) { System . out . println ( 2 * sa - 1 ) ; } else { System . out . println ( s . length ( ) ) ; } }   }

s = input ( ) d = s . count ( ' a ' ) e = len ( s ) - dprint ( min ( len ( s ) , 2 * d - 1 ) ) NEW_LINE


s = input ( ) print ( min ( 2 * s . count ( ' a ' ) - 1 , len ( s ) ) ) NEW_LINE


stringa = input ( ) if stringa . count ( ' a ' ) <= 1 / 2 * len ( stringa ) : stringa . count ( ' a ' ) print ( stringa . count ( ' a ' ) * 2 - 1 ) else : print ( len ( stringa ) ) NEW_LINE


s = [ i for i in input ( ) ] i = 0 a = 0 x = 0 while i < len ( s ) : if s [ i ] == ' a ' : a = a + 1 else : x = x + 1 i = i + 1 if a > x : print ( a + x ) else : print ( a + a - 1 ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String str = s . next ( ) ; int n = str . length ( ) , ca = 0 , co = 0 ; char [ ] a = str . toCharArray ( ) ; for ( int i = 0 ; i < n ; i ++ ) if ( a [ i ] == ' a ' ) ca ++ ; else co ++ ; while ( co >= ca ) co -- ; System . out . println ( co + ca ) ; } }


import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; int a = 0 , len = s . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = s . charAt ( i ) ; if ( c == ' a ' ) a ++ ; } if ( a > len / 2 ) System . out . println ( len ) ; else { System . out . println ( ( 2 * a ) - 1 ) ; }   } }


import java . util . * ;    public class Practise {

n = int ( input ( ) ) a = list ( input ( ) . split ( ) ) k = n // 2 for i in range ( 0 , k , 2 ) : a [ i ] , a [ n - i - 1 ] = a [ n - i - 1 ] , a [ i ] print ( * a ) NEW_LINE


x = int ( input ( ' ' ) ) ar = list ( map ( int , input ( ' ' ) . split ( ) ) )   for i in range ( 0 , x // 2 , 2 ) : ar [ i ] , ar [ - i - 1 ] = ar [ - i - 1 ] , ar [ i ]   print ( * ar ) NEW_LINE


import sysimport mathdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) n = iinput ( ) l = listinput ( ) temp = 0 for i in range ( 0 , int ( n / 2 ) ) : if i % 2 == 0 : temp = l [ i ] l [ i ] = l [ n - i - 1 ] l [ n - i - 1 ] = tempprint ( * l ) NEW_LINE


if __name__ == " _ _ main _ _ " : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) l = l [ : : - 1 ] if n <= 2 : print ( * l ) else : i = 1 till = n // 2 - 1 while i < n // 2 : l [ i ] , l [ n - i - 1 ] = l [ n - i - 1 ] , l [ i ] i = i + 2 print ( * l ) NEW_LINE


import sysdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) n = iinput ( ) l = listinput ( ) if n % 2 == 1 : for i in range ( n // 2 + 1 ) : if i % 2 == 0 : l [ i ] , l [ n - i - 1 ] = l [ n - i - 1 ] , l [ i ] else : for i in range ( n // 2 ) : if i % 2 == 0 : l [ i ] , l [ n - i - 1 ] = l [ n - i - 1 ] , l [ i ] print ( * l ) NEW_LINE


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


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out ; FastReader sc ; long mod = ( long ) ( 1e9 + 7 ) ; long maxlong = Long . MAX_VALUE ; long minlong = Long . MIN_VALUE ; boolean find ( int n ) { HashSet < Integer > h = new HashSet < > ( ) ; while ( n > 0 ) { int p = n % 10 ; n /= 10 ; if ( h . contains ( p ) ) return false ; h . add ( p ) ; } return true ; } public void sol ( ) { int l = ni ( ) , r = ni ( ) ; for ( int i = l ; i <= r ; i ++ ) { if ( find ( i ) ) { pl ( i ) ; return ; } } pl ( " - 1" ) ; } public static void main ( String [ ] args ) { Main g = new Main ( ) ; g . out = new PrintWriter ( System . out ) ; g . sc = new FastReader ( ) ; int t = 1 ;

l , r = map ( int , input ( ) . split ( ) ) while ( l <= r ) & ( len ( set ( str ( l ) ) ) < len ( str ( l ) ) ) : l += 1 print ( ( l , - 1 ) [ l > r ] ) NEW_LINE


import sysinput = sys . stdin . readline   '''   '''   def distinct_digits ( num ) : snum = str ( num ) return len ( snum ) == len ( set ( snum ) )   l , r = map ( int , input ( ) . split ( ) ) x = l   while x <= r and not distinct_digits ( x ) : x += 1   print ( x if x <= r else - 1 )   NEW_LINE


import reimport sysexit = sys . exitfrom bisect import bisect_left as bsl , bisect_right as bsrfrom collections import Counter , defaultdict as ddict , dequefrom functools import lru_cachecache = lru_cache ( None ) from heapq import * from itertools import * from math import inffrom pprint import pprint as ppenum = enumerateri = lambda : int ( rln ( ) ) ris = lambda : list ( map ( int , rfs ( ) ) ) rln = sys . stdin . readlinerl = lambda : rln ( ) . rstrip ( ' \n ' ) rfs = lambda : rln ( ) . split ( ) mod = 1000000007 d4 = [ ( 0 , - 1 ) , ( 1 , 0 ) , ( 0 , 1 ) , ( - 1 , 0 ) ] d8 = [ ( - 1 , - 1 ) , ( 0 , - 1 ) , ( 1 , - 1 ) , ( - 1 , 0 ) , ( 1 , 0 ) , ( - 1 , 1 ) , ( 0 , 1 ) , ( 1 , 1 ) ] NEW_LINE


import java . util . Scanner ;   public class Main { public static boolean check ( int n ) { boolean arr [ ] = new boolean [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { arr [ i ] = false ; } while ( n > 0 ) { int digit = n % 10 ; if ( arr [ digit ] ) { return false ; } arr [ digit ] = true ; n = n / 10 ; } return true ; }   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int f = 0 ; int a = input . nextInt ( ) ; int b = input . nextInt ( ) ; for ( int i = a ; i <= b ; i ++ ) { if ( check ( i ) ) { System . out . print ( i ) ; f = 1 ; break ; } }   if ( f == 0 ) { System . out . print ( - 1 ) ; } } }


import java . io . * ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   import java . util . StringTokenizer ; public class digitosDistintos { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { 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 ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } public static void main ( String [ ] args ) { FastReader entrada = new FastReader ( ) ; int larg = entrada . nextInt ( ) ; int rad = entrada . nextInt ( ) ; int fork = 0 ; for ( int i = larg ; i <= rad ; i ++ ) { int numero = i ; boolean visitou [ ] = new boolean [ 100 ] ; while ( numero != 0 ) { if ( visitou [ numero % 10 ] ) break ; visitou [ numero % 10 ] = true ; numero = numero / 10 ; } if ( numero == 0 ) { fork = 1 ; System . out . print ( i ) ; break ; } } if ( fork == 0 ) { System . out . println ( - 1 ) ; } } }


import java . io . IOException ; import java . util . HashSet ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( System . in ) ; int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; boolean b = false ; for ( int i = l ; i <= r ; i ++ ) { int x = i ; int count = 0 ; HashSet < Integer > set = new HashSet < Integer > ( ) ; while ( x != 0 ) { set . add ( x % 10 ) ; x /= 10 ; count ++ ; } if ( set . size ( ) == count ) { System . out . println ( i ) ; b = true ; break ; } } if ( ! b ) { System . out . println ( - 1 ) ; } } }


import java . util . HashSet ; import java . util . Scanner ;   public class A1228 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int l = scanner . nextInt ( ) , r = scanner . nextInt ( ) ; boolean flag = false ; for ( int i = l ; i <= r ; i ++ ) { int a = i , t = 0 ; HashSet < Integer > set = new HashSet < > ( ) ; while ( a > 0 ) { set . add ( a % 10 ) ; a /= 10 ; t ++ ; } if ( set . size ( ) == t ) { System . out . println ( i ) ; flag = false ; break ; } else { flag = true ; } } if ( flag ) System . out . println ( - 1 ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out ; FastReader sc ; int mod = ( int ) ( 1e9 + 7 ) ; public void sol ( ) { int n = ni ( ) , k = ni ( ) ; String [ ] s = new String [ n ] ; HashMap < String , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String a = rl1 ( ) ; s [ i ] = a ; map . put ( a , map . getOrDefault ( a , 0 ) + 1 ) ; } long ans = 0 ; for ( int i = 0 ; i < n - 2 ; i ++ ) { int v = map . get ( s [ i ] ) ; map . put ( s [ i ] , v - 1 ) ; HashMap < String , Integer > has = new HashMap < > ( map ) ;

from collections import defaultdictdef get ( x , y ) : a = [ " S " , " E " , ' T ' ] a . remove ( x ) a . remove ( y ) return a [ 0 ] def solve ( ) : n , x = [ int ( f ) for f in input ( ) . split ( ) ] a = [ ] d = defaultdict ( int ) for i in range ( n ) : s = input ( ) a += [ s ] d [ s ] += 1 ans = 0 for i in range ( n - 1 ) : for j in range ( i + 1 , n ) : s = " " for k in range ( x ) : if a [ i ] [ k ] == a [ j ] [ k ] : s += str ( a [ j ] [ k ] ) else : s += get ( a [ i ] [ k ] , a [ j ] [ k ] ) ans += d [ s ] print ( ans // 3 ) for _ in range ( 1 ) : solve ( ) NEW_LINE


from sys import stdinn , k = map ( int , input ( ) . split ( ) ) cards = [ input ( ) for i in range ( n ) ] chk = set ( cards ) ans = 0 for i in range ( n - 1 ) : for y in range ( i + 1 , n ) : build = " " for l in range ( k ) : a , b = cards [ i ] [ l ] , cards [ y ] [ l ] if a == b : build += a else : if " S " not in a + b : build += " S " elif " T " not in a + b : build += " T " else : build += " E " if build in chk : ans += 1 print ( ans // 3 ) NEW_LINE


N , K = list ( map ( int , input ( ) . split ( ) ) )   C = [ ] ; S = set ( ) for i in range ( N ) : C . append ( input ( ) . strip ( ) ) S . add ( C [ - 1 ] )   ans = 0 for i in range ( N ) : for j in range ( i + 1 , N ) : aux = " " for k in range ( K ) : if C [ i ] [ k ] == C [ j ] [ k ] : aux += C [ i ] [ k ] if ( C [ i ] [ k ] == ' S ' and C [ j ] [ k ] == ' E ' ) or ( C [ i ] [ k ] == ' E ' and C [ j ] [ k ] == ' S ' ) : aux += ' T ' if ( C [ i ] [ k ] == ' S ' and C [ j ] [ k ] == ' T ' ) or ( C [ i ] [ k ] == ' T ' and C [ j ] [ k ] == ' S ' ) : aux += ' E ' if ( C [ i ] [ k ] == ' T ' and C [ j ] [ k ] == ' E ' ) or ( C [ i ] [ k ] == ' E ' and C [ j ] [ k ] == ' T ' ) : aux += ' S '   if aux in S : ans += 1   print ( ans // 3 ) NEW_LINE


def strneed ( s1 , s2 , n ) : setstr = [ ' S ' , ' E ' , ' T ' ] sn = " " for i in range ( n ) : if s1 [ i ] == s2 [ i ] : sn += s1 [ i ] else : for j in setstr : if j != s1 [ i ] and j != s2 [ i ] : sn += j break return sn   def found ( s , arr , l , r ) : NEW_LINE


from sys import stdin , stdoutimport math , bisectfrom collections import Counter , deque , defaultdictL = lambda : list ( map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) ) M = lambda : map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) I = lambda : int ( stdin . readline ( ) . strip ( ) ) S = lambda : stdin . readline ( ) . strip ( ) C = lambda : stdin . readline ( ) . strip ( ) . split ( ) def pr ( a ) : return ( " ▁ " . join ( list ( map ( str , a ) ) ) ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Main {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; String [ ] str = br . readLine ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( str [ 0 ] ) , k = Integer . parseInt ( str [ 1 ] ) ; String [ ] data = new String [ n ] ; char [ ] vals = new char [ ] { ' S ' , ' E ' , ' T ' } ; HashMap < String , Integer > hm = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { data [ i ] = br . readLine ( ) ; hm . computeIfPresent ( data [ i ] , ( key , val ) -> val += 1 ) ; hm . putIfAbsent ( data [ i ] , 1 ) ; } int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String s1 = data [ i ] ; for ( int j = i + 1 ; j < n ; j ++ ) { String s2 = data [ j ] ; String toFind ; char [ ] c1 = new char [ k ] ; for ( int z = 0 ; z < k ; z ++ ) { char s1c = s1 . charAt ( z ) , s2c = s2 . charAt ( z ) ; if ( s1c == s2c ) c1 [ z ] = s1c ; else { for ( int z1 = 0 ; z1 < 3 ; z1 ++ ) { if ( s1c != vals [ z1 ] && s2c != vals [ z1 ] ) { c1 [ z ] = vals [ z1 ] ; } } } } toFind = String . valueOf ( c1 ) ; if ( hm . containsKey ( toFind ) ) { cnt += hm . get ( toFind ) ; if ( toFind . equals ( data [ i ] ) ) cnt -= 2 ; } } } System . out . println ( cnt / 3 ) ; } }


import java . util . * ; import java . io . * ; public class Main2 { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { 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 ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } static int mod = ( int ) ( 1e9 + 7 ) ; static FastReader sc = new FastReader ( ) ; static PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String [ ] args ) { int t = 1 ;


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

import sys     def read_input ( input_path = None ) : if input_path is None : f = sys . stdin else : f = open ( input_path , ' r ' )   n , k = map ( int , f . readline ( ) . split ( ) ) field = list ( ) for _ in range ( n ) : field . append ( f . readline ( ) . rstrip ( ) )   return n , k , field     NEW_LINE


def battleship ( arr , k ) : pts = [ [ 0 ] * len ( arr ) for i in range ( len ( arr ) ) ] ans = [ 0 , 0 ] maxi = 0 for i in range ( len ( arr ) ) : for j in range ( len ( arr ) ) : if arr [ i ] [ j ] == " . " : good = 0 count = 0 flag = True s = i temp = [ ] while s >= 0 : if arr [ s ] [ j ] == " . " : temp . append ( [ s , j ] ) count += 1 s -= 1 if count == k : for x , y in temp : pts [ x ] [ y ] += 1 if pts [ x ] [ y ] > maxi : maxi = pts [ x ] [ y ] ans = [ x + 1 , y + 1 ] good += 1 break else : break count = 0 s = j temp = [ ] while s >= 0 : if arr [ i ] [ s ] == " . " : temp . append ( [ i , s ] ) count += 1 s -= 1 if count == k : for x , y in temp : pts [ x ] [ y ] += 1 if pts [ x ] [ y ] > maxi : maxi = pts [ x ] [ y ] ans = [ x + 1 , y + 1 ] good += 1 break else : break   if ans == [ 0 , 0 ] : ans = [ 1 , 1 ] print ( * ans ) return " "         a , b = map ( int , input ( ) . strip ( ) . split ( ) ) blanck = [ ] for i in range ( a ) : blanck . append ( input ( ) ) print ( battleship ( blanck , b ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) f = [ list ( input ( ) ) for _ in range ( n ) ] ans = ( 1 , 1 ) r = [ [ 0 for _ in range ( n ) ] for _ in range ( n ) ] for i in range ( n ) : for j in range ( n ) : if f [ i ] [ j ] == ' # ' : r [ i ] [ j ] = 0 elif i == 0 : r [ i ] [ j ] = 1 else : r [ i ] [ j ] = r [ i - 1 ] [ j ] + 1 c = [ [ 0 for _ in range ( n ) ] for _ in range ( n ) ] for i in range ( n ) : for j in range ( n ) : if f [ i ] [ j ] == ' # ' : c [ i ] [ j ] = 0 elif j == 0 : c [ i ] [ j ] = 1 else : c [ i ] [ j ] = c [ i ] [ j - 1 ] + 1 s = [ [ 0 for _ in range ( n ) ] for _ in range ( n ) ] for i in range ( n ) : for j in range ( n ) : for l in range ( k ) : if i + l < n and k <= r [ i + l ] [ j ] : s [ i ] [ j ] += 1 if j + l < n and k <= c [ i ] [ j + l ] : s [ i ] [ j ] += 1 if s [ ans [ 0 ] - 1 ] [ ans [ 1 ] - 1 ] < s [ i ] [ j ] : ans = ( i + 1 , j + 1 ) print ( ' ▁ ' . join ( map ( str , ans ) ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) S = [ input ( ) for i in range ( n ) ]   C = [ [ 0 ] * n for i in range ( n ) ] for i in range ( n ) : for j in range ( n ) : if S [ i ] [ j ] == ' # ' : continue if i + k - 1 < n : for di in range ( k ) : ni = i + di if S [ ni ] [ j ] == ' # ' : break else : for di in range ( k ) : ni = i + di C [ ni ] [ j ] += 1 if j + k - 1 < n : for dj in range ( k ) : nj = j + dj if S [ i ] [ nj ] == ' # ' : break else : for dj in range ( k ) : nj = j + dj C [ i ] [ nj ] += 1 NEW_LINE


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


import java . io . * ; import java . util . * ;   public class B_Battleship { public static void main ( String [ ] args ) throws Exception { int [ ] nk = in . readA ( ) ; int n = nk [ 0 ] , k = nk [ 1 ] ; int [ ] [ ] mat = new int [ n ] [ n ] ; char [ ] [ ] inpMat = new char [ n ] [ ] ; for ( int i = 0 ; i < n ; i ++ ) { inpMat [ i ] = in . readLine ( ) . toCharArray ( ) ; }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = s . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { arr [ j ] = s . nextInt ( ) ; } int max = - 1 ; int index = - 1 ; int value = - 1 ; for ( int j = 1 ; j < n - 1 ; j ++ ) { int mid = ( arr [ j - 1 ] + arr [ j + 1 ] ) / 2 ; int profit = Math . abs ( arr [ j - 1 ] - arr [ j ] ) + Math . abs ( arr [ j + 1 ] - arr [ j ] ) - Math . abs ( arr [ j - 1 ] - mid ) - Math . abs ( arr [ j + 1 ] - mid ) ; if ( profit > max ) { max = profit ; index = j ; value = mid ; } } if ( Math . abs ( arr [ 0 ] - arr [ 1 ] ) > max ) { max = Math . abs ( arr [ 0 ] - arr [ 1 ] ) ; index = 0 ; value = arr [ 1 ] ; } if ( Math . abs ( arr [ n - 2 ] - arr [ n - 1 ] ) > max ) { max = Math . abs ( arr [ n - 2 ] - arr [ n - 1 ] ) ; index = n - 1 ; value = arr [ n - 2 ] ; } arr [ index ] = value ; long count = 0 ; for ( int j = n - 1 ; j > 0 ; j -- ) { count = count + Math . abs ( arr [ j - 1 ] - arr [ j ] ) ; } System . out . println ( count ) ; } } }

def solve ( ) : n = int ( input ( ) ) NEW_LINE a = [ 0 ] + list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE ans = 0 NEW_LINE for i in range ( 2 , n + 1 ) : ans += abs ( a [ i ] - a [ i - 1 ] ) NEW_LINE mx = max ( abs ( a [ 2 ] - a [ 1 ] ) , abs ( a [ n ] - a [ n - 1 ] ) ) NEW_LINE for i in range ( 2 , n ) : mx = max ( mx , abs ( a [ i ] - a [ i - 1 ] ) + abs ( a [ i + 1 ] - a [ i ] ) - abs ( a [ i + 1 ] - a [ i - 1 ] ) ) NEW_LINE print ( ans - mx ) NEW_LINE t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : solve ( ) NEW_LINE


import math , sys , bisect , heapq , osfrom NEW_LINE collections NEW_LINE import defaultdict , Counter , dequefrom NEW_LINE itertools NEW_LINE import groupby , accumulatefrom NEW_LINE functools NEW_LINE import lru_cache NEW_LINE


import sysimport NEW_LINE mathfrom NEW_LINE collections NEW_LINE import deque NEW_LINE


def main ( ) : from sys import stdin NEW_LINE


t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE a = [ int ( s ) for s in input ( ) . split ( " ▁ " ) ] NEW_LINE ans = 0 NEW_LINE for i in range ( 1 , n ) : ans += abs ( a [ i ] - a [ i - 1 ] ) NEW_LINE mx = max ( abs ( a [ 0 ] - a [ 1 ] ) , abs ( a [ n - 1 ] - a [ n - 2 ] ) ) NEW_LINE for i in range ( 1 , n - 1 ) : mx = max ( mx , abs ( a [ i ] - a [ i - 1 ] ) + abs ( a [ i + 1 ] - a [ i ] ) - abs ( a [ i + 1 ] - a [ i - 1 ] ) ) NEW_LINE print ( ans - mx ) NEW_LINE


import java . io . * ; import java . util . * ;   public class test {


import java . awt . Desktop ;    import java . io . BufferedReader ;    import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . net . URI ; import java . net . URISyntaxException ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . LinkedHashMap ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . util . StringTokenizer ; import java . util . TreeSet ; import java . util . Vector ;     public class codechef3 { static class comp implements Comparator < Integer > {   @ Override public int compare ( Integer o1 , Integer o2 ) { if ( Math . abs ( o1 ) > Math . abs ( o2 ) ) return - 1 ; else return 1 ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class B_745 {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   String [ ] nm = br . readLine ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( nm [ 0 ] ) ; int m = Integer . parseInt ( nm [ 1 ] ) ; int count = 0 , min_x = m + 1 , max_x = - 1 , min_y = n + 1 , max_y = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { String [ ] row = br . readLine ( ) . split ( " " ) ; for ( int j = 0 ; j < m ; j ++ ) { if ( row [ j ] . contentEquals ( " X " ) ) { min_x = Math . min ( min_x , j ) ; max_x = Math . max ( max_x , j ) ; min_y = Math . min ( min_y , i ) ; max_y = Math . max ( max_y , i ) ; count ++ ; } } } System . out . println ( ( ( max_x - min_x + 1 ) * ( max_y - min_y + 1 ) == count ) ? " YES " : " NO " ) ; }   }

n , m = map ( int , input ( ) . split ( ) ) puz = [ ] for x in range ( n ) : puz . append ( input ( ) ) mix = 502 miy = 502 mx = - 1 my = - 1 numx = 0 for i in range ( n ) : for j in range ( m ) : if ( puz [ i ] [ j ] == " X " ) : miy = min ( miy , i ) my = max ( my , i ) mix = min ( mix , j ) mx = max ( mx , j ) numx = numx + 1 if ( ( mx - mix + 1 ) * ( my - miy + 1 ) == numx ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


def read ( ) : return [ int ( v ) for v in input ( ) . split ( ) ]     def main ( ) : n , m = read ( )   s = [ ] for i in range ( n ) : s . append ( input ( ) )   up , left , down , right = n , m , - 1 , - 1 for i in range ( n ) : for j in range ( m ) : if s [ i ] [ j ] == ' X ' : if i < up : up = i if j < left : left = j if i > down : down = i if j > right : right = j   for i in range ( up , down + 1 ) : for j in range ( left , right + 1 ) : if s [ i ] [ j ] != ' X ' : print ( ' NO ' ) return print ( ' YES ' )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) cnt , l , r , u , d = 0 , n , 0 , m , 0 for i in range ( n ) : s = input ( ) for j in range ( m ) : if s [ j ] == ' X ' : cnt += 1 l = min ( l , i ) ; u = min ( u , j ) r = max ( r , i ) ; d = max ( d , j ) print ( ' YES ' if cnt == ( r - l + 1 ) * ( d - u + 1 ) else ' NO ' ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) a = [ ] for i in range ( n ) : a . append ( list ( input ( ) ) ) k = 0 min_r = n - 1 max_r = 0 min_c = m - 1 max_c = 0 for i in range ( n ) : for j in range ( m ) : if a [ i ] [ j ] == ' X ' : k += 1 min_r = min ( min_r , i ) max_r = max ( max_r , i ) min_c = min ( min_c , j ) max_c = max ( max_c , j ) if ( max_r - min_r + 1 ) * ( max_c - min_c + 1 ) == k : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int m = Integer . parseInt ( st . nextToken ( ) ) ; String [ ] str = new String [ n ] ; int top , bot , l , r ; top = l = 1000 ; r = bot = 0 ; for ( int i = 0 ; i < n ; i ++ ) { str [ i ] = br . readLine ( ) ; if ( str [ i ] . contains ( " X " ) ) { top = Math . min ( top , i ) ; bot = Math . max ( bot , i ) ; } int x = str [ i ] . indexOf ( " X " ) ; if ( x != - 1 ) l = Math . min ( l , x ) ; int y = str [ i ] . lastIndexOf ( " X " ) ; if ( y != - 1 ) ; r = Math . max ( r , y ) ; } for ( int i = top ; i <= bot ; i ++ ) { if ( str [ i ] . substring ( l , r + 1 ) . contains ( " . " ) ) { System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; } }


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 {   public static void main ( String [ ] args ) throws IOException { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; TreeSet < String > set = new TreeSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s = input . next ( ) ; if ( s . contains ( " X " ) ) set . add ( s ) ; } if ( set . size ( ) == 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }   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 . * ; import java . io . * ;   public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { 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 ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static void main ( String [ ] args ) { FastReader fr = new FastReader ( ) ; Scanner sc = new Scanner ( System . in ) ; int n = fr . nextInt ( ) ; int [ ] ar = new int [ n ] ; int total = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = fr . nextInt ( ) ; total += ar [ i ] ; } int alice = ar [ 0 ] ; ArrayList < Integer > ans = new ArrayList < > ( ) ; ans . add ( 1 ) ; for ( int i = 1 ; i < n ; i ++ ) { if ( alice > total / 2 ) break ; if ( 2 * ar [ i ] <= ar [ 0 ] ) { alice += ar [ i ] ; ans . add ( i + 1 ) ; } } if ( alice > total / 2 ) { System . out . println ( ans . size ( ) ) ; for ( Integer i : ans ) System . out . print ( i + " ▁ " ) ; } else System . out . println ( 0 ) ; } }

n = int ( input ( ) ) lst = list ( map ( int , input ( ) . split ( ) ) ) ans = [ 1 ] summ2 = lst [ 0 ] for i in range ( 1 , n ) : if lst [ 0 ] >= ( 2 * lst [ i ] ) : ans . append ( i + 1 ) summ2 += lst [ i ] summ = sum ( lst ) NEW_LINE


for _ in range ( 1 ) : n = int ( input ( ) ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) count = 1 ref = a [ 0 ] arr = [ 0 ] s = reffor i in range ( n ) : if 2 * a [ i ] <= ref : arr . append ( i ) s += a [ i ] count += 1 if s <= sum ( a ) / 2 : print ( 0 ) else : print ( count ) for item in arr : print ( item + 1 , end = " ▁ " ) NEW_LINE


n , = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) su = sum ( arr )   ans = [ 1 ] sa = arr [ 0 ] for i in range ( 1 , n ) : if arr [ i ] * 2 <= arr [ 0 ] : ans . append ( i + 1 ) sa += arr [ i ] if sa > su // 2 : print ( len ( ans ) ) print ( * ans ) else : print ( 0 ) NEW_LINE


n = int ( input ( ) ) s = [ int ( i ) for i in input ( ) . split ( ) ] a = s [ 0 ] s1 = [ ] s1 += ss1 . pop ( 0 ) s1 . sort ( ) s2 = sum ( s ) s3 = s2 // 2 s4 = as5 = a // 2 s6 = 1 for i in range ( n - 1 ) : if s1 [ i ] > s5 : break else : s4 += s1 [ i ] s6 += 1 if s4 > s3 : print ( s6 ) print ( 1 , end = ' ▁ ' ) s6 -= 1 for i in range ( 1 , n ) : if s6 == 0 : break elif s [ i ] <= s5 : s6 -= 1 print ( i + 1 , end = ' ▁ ' ) print ( ) else : print ( 0 ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;     public class A {   private static long INF = 2000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   int n = sc . nextInt ( ) ; int my = sc . nextInt ( ) ; PriorityQueue < Pair > lis = new PriorityQueue < A . Pair > ( ) ; int sum = my ; for ( int i = 1 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; lis . add ( new Pair ( a , i + 1 ) ) ; sum += a ; } int extra = 0 ; ArrayList < Integer > ans = new ArrayList < Integer > ( ) ; ans . add ( 1 ) ; while ( lis . size ( ) > 1 && lis . peek ( ) . x * 2 <= my ) { Pair e = lis . poll ( ) ; ans . add ( e . y ) ; extra += e . x ; } my += extra ; if ( my * 2 <= sum ) { System . out . println ( 0 ) ; return ; } System . out . println ( ans . size ( ) ) ; for ( int e : ans ) System . out . print ( e + " ▁ " ) ;   }


import java . lang . * ; import java . util . * ; import java . io . * ; public class test {   Scanner sc = new Scanner ( System . in ) ; PrintWriter pr = new PrintWriter ( System . out , true ) ; public static void main ( String ... args ) { test c = new test ( ) ; c . prop ( ) ; } public void prop ( ) { int n , count = 0 , sumt = 0 , sumc = 0 , b ; ArrayList < Integer > al = new ArrayList < Integer > ( ) ; n = sc . nextInt ( ) ; b = sc . nextInt ( ) ; sumt += b ; for ( int i = 1 ; i < n ; ++ i ) { int a = sc . nextInt ( ) ; sumt += a ; if ( b >= 2 * a ) { ++ count ; sumc += a ; al . add ( i + 1 ) ; } } sumt = ( sumt / 2 ) + 1 ; if ( b >= sumt ) pr . println ( 1 + " ▁ " + 1 ) ; else if ( ( b + sumc ) >= sumt ) { pr . println ( count + 1 ) ; pr . println ( 1 ) ; for ( int i = 0 ; i < count ; ++ i ) { pr . println ( al . get ( i ) ) ; } } else pr . println ( 0 ) ; } }


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ;


import java . util . ArrayList ; import java . util . Scanner ;   public class problem53 {   public static void main ( String [ ] args ) {


import java . util . * ; import java . lang . String ; import java . lang . Math ; import java . util . Arrays ;   public class Capitalization2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t ; t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n , d ; n = sc . nextInt ( ) ; d = sc . nextInt ( ) ; int netres = 0 ; int [ ] a = new int [ n ] ; int [ ] res = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { a [ j ] = sc . nextInt ( ) ; if ( a [ j ] <= d ) { res [ netres ] = a [ j ] ; netres ++ ; } } if ( netres == 0 || netres == 1 ) System . out . println ( " NO " ) ; else if ( netres == n ) System . out . println ( " YES " ) ; else { Arrays . sort ( res , 0 , netres ) ; if ( ( res [ 0 ] + res [ 1 ] ) <= d ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } } }

tests = int ( input ( ) )   for test in range ( tests ) : n , d = map ( int , input ( ) . split ( ) ) NEW_LINE a = [ int ( x ) for x in input ( ) . split ( ) ] NEW_LINE a . sort ( )   if max ( a ) <= d : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE b = [ a [ 0 ] + a [ 1 ] if x >= d else x for x in a ] NEW_LINE DEDENT if max ( b ) <= d : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " ) NEW_LINE DEDENT


for t in range ( int ( input ( ) ) ) : n , d = map ( int , input ( ) . split ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE a . sort ( ) NEW_LINE if a [ 0 ] + a [ 1 ] <= d or max ( a ) <= d : NEW_LINE INDENT print ( ' YES ' ) else : NEW_LINE print ( ' NO ' ) NEW_LINE DEDENT


t = int ( input ( ) ) NEW_LINE res = [ ]   for i in range ( 0 , t ) : n , d = ( int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ) NEW_LINE a1 = [ int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ]   a = sorted ( a1 ) NEW_LINE if a [ n - 1 ] <= d : NEW_LINE INDENT res . append ( " YES " ) else : NEW_LINE if NEW_LINE DEDENT a [ 1 ] + a [ 0 ] <= d : res . append ( " YES " ) else : res . append ( " NO " ) NEW_LINE a . clear ( ) NEW_LINE for i in range ( 0 , t ) : print ( res [ i ] )   res . clear ( )   NEW_LINE


t = int ( input ( ) ) NEW_LINE res = [ ]   for i in range ( 0 , t ) : n , d = ( int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ) NEW_LINE a1 = [ int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ]   a = sorted ( a1 ) NEW_LINE if a [ n - 1 ] <= d : NEW_LINE INDENT res . append ( " YES " ) else : NEW_LINE if NEW_LINE DEDENT a [ 1 ] + a [ 0 ] <= d : res . append ( " YES " ) else : res . append ( " NO " ) NEW_LINE for i in range ( 0 , t ) : print ( res [ i ] ) NEW_LINE


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


import java . io . * ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . StringTokenizer ; import java . util . List ; import java . util . * ; public class realfast implements Runnable { private static final int INF = ( int ) 1e9 ; long in = 1000000007 ; long fac [ ] = new long [ 1000001 ] ; long inv [ ] = new long [ 1000001 ] ; public void solve ( ) throws IOException {

import bisect as bsfor NEW_LINE _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE if n <= 2 : print ( n ) NEW_LINE continue NEW_LINE stack , m , p = [ a [ 0 ] ] , [ ] , [ ( 1000000 , 0 ) ] NEW_LINE for v in a [ 1 : ] : k = bs . bisect_right ( m , v ) NEW_LINE if k == len ( m ) : stack . append ( v ) NEW_LINE m . append ( min ( stack [ - 1 ] , stack [ - 2 ] ) ) else : stack [ k + 1 ] = m [ k ] = v NEW_LINE while p [ - 1 ] [ 0 ] <= v : vv , kk = p . pop ( ) NEW_LINE m [ kk ] = min ( m [ kk ] , vv ) NEW_LINE if k + 1 < len ( m ) : p . append ( ( v , k + 1 ) ) NEW_LINE print ( len ( stack ) ) NEW_LINE


import bisect as bsfor NEW_LINE _ in range ( int ( input ( ) ) ) : n , a = int ( input ( ) ) , list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE stack , m , p = [ a [ 0 ] ] , [ ] , [ ( 1000000 , 0 ) ] NEW_LINE for v in a [ 1 : ] : k = bs . bisect_right ( m , v ) NEW_LINE if k == len ( m ) : stack . append ( v ) NEW_LINE m . append ( min ( stack [ - 1 ] , stack [ - 2 ] ) ) else : stack [ k + 1 ] = m [ k ] = v NEW_LINE while p [ - 1 ] [ 0 ] <= v : vv , kk = p . pop ( ) NEW_LINE m [ kk ] = min ( m [ kk ] , vv ) NEW_LINE if k + 1 < len ( m ) : p . append ( ( v , k + 1 ) ) NEW_LINE print ( len ( stack ) ) NEW_LINE


import osimport NEW_LINE sysfrom NEW_LINE io NEW_LINE import BytesIO , IOBase NEW_LINE


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String args [ ] ) { new Main ( ) . run ( ) ; }   FastReader in = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; void run ( ) { for ( int q = ni ( ) ; q > 0 ; q -- ) { work ( ) ; } out . flush ( ) ; } long mod = 998244353 ; long gcd ( long a , long b ) { return a == 0 ? b : gcd ( b % a , a ) ; } int [ ] S1 ;


import java . util . * ; import java . io . * ;

def gcd ( a , b ) : if ( a % b == 0 ) : return b else : return gcd ( b , a % b )   [ t1 , t2 , x1 , x2 , t0 ] = input ( ) . split ( ' ▁ ' ) NEW_LINE


import mathdef gcd ( a , b ) : if ( b == 0 ) : return a return gcd ( b , a % b ) l = input ( ) . split ( ) t1 = int ( l [ 0 ] ) t2 = int ( l [ 1 ] ) x1 = int ( l [ 2 ] ) x2 = int ( l [ 3 ] ) t0 = int ( l [ 4 ] ) num1 = t2 - t0num2 = t0 - t1if ( t1 == t2 ) : print ( x1 , x2 ) quit ( ) if ( num1 == 0 ) : print ( 0 , x2 ) quit ( ) if ( num2 == 0 ) : print ( x1 , 0 ) quit ( ) z = num2 / num1maxa = 10 ** 18 ans = ( 0 , 0 ) for i in range ( 1 , x1 + 1 ) : ok = z * i if ( ok > x2 ) : break num1 = i num2 = math . ceil ( ok ) if ( maxa == ( ( num2 / num1 ) - z ) and num2 + num1 > ans [ 0 ] + ans [ 1 ] ) : ans = ( num1 , num2 ) elif ( maxa > ( ( num2 / num1 ) - z ) ) : ans = ( num1 , num2 ) maxa = ( ( num2 / num1 - z ) ) if ( ans == ( 0 , 0 ) ) : ans = ( 0 , x2 ) print ( ans [ 0 ] , ans [ 1 ] ) NEW_LINE


import java . util . * ; import java . awt . List ; import java . io . * ; import java . lang . * ; import java . lang . reflect . Array ; public class c1 {   public static int mod = ( int ) Math . pow ( 10 , 9 ) + 7 ; public static void main ( String [ ] args ) { InputReader in = new InputReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ;


import java . util . Scanner ;   public class Hot_Bath { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; double t1 , t2 , y1 = 0 , y2 = 0 , x1 , x2 , t0 , div , sum ; boolean is , is1 ; while ( input . hasNext ( ) ) { div = 1000000000 ; t1 = input . nextDouble ( ) ; t2 = input . nextDouble ( ) ; x1 = input . nextDouble ( ) ; x2 = input . nextDouble ( ) ; t0 = input . nextDouble ( ) ; while ( x1 >= 0 && x2 >= 0 ) { if ( x1 + x2 == 0 ) break ; sum = ( ( t1 * x1 ) + ( t2 * x2 ) ) / ( x1 + x2 ) ; if ( sum < t0 ) { x1 -- ; continue ; } if ( sum < div ) { div = sum ; y1 = x1 ; y2 = x2 ; } x2 -- ; } System . out . println ( ( int ) y1 + " ▁ " + ( int ) y2 ) ; } } }


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

task = int ( input ( ) ) while ( task > 0 ) : n = int ( input ( ) ) cnt , flag = 0 , 0 while ( n != 1 ) : if ( n % 2 == 0 ) : n = n // 2 cnt += 1 elif ( n % 3 == 0 ) : n = ( 2 * n ) // 3 cnt += 1 elif ( n % 5 == 0 ) : n = ( 4 * n ) // 5 cnt += 1 else : flag = 1 break if ( flag == 1 ) : print ( - 1 ) else : print ( cnt ) task -= 1 NEW_LINE


test = int ( input ( ) ) while test != 0 : num = int ( input ( ) ) cnt = 0 while num > 1 : if num % 2 == 0 : num //= 2 elif num % 3 == 0 : num = ( num * 2 ) // 3 elif num % 5 == 0 : num = ( num * 4 ) // 5 else : break cnt += 1 if num == 1 : print ( cnt ) else : print ( - 1 ) test -= 1 NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) f = 1 ans = 0 while n != 1 : if n % 5 == 0 : n = ( n * 4 ) // 5 ans += 1 elif n % 3 == 0 : n = ( n * 2 ) // 3 ans += 1 elif n % 2 == 0 : n = n // 2 ans += 1 else : f = 0 break if f : print ( ans ) else : print ( - 1 ) NEW_LINE


import java . io . * ; import java . util . * ;   public class thirty_days_100 { public static void main ( String args [ ] ) { FScanner in = new FScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { long n = in . nextLong ( ) ; int c = 0 ; while ( n % 5 == 0 ) { n = ( n / 5 ) * 4 ; c ++ ; } while ( n % 3 == 0 ) { n = ( n / 3 ) * 2 ; c ++ ; } while ( n % 2 == 0 ) { n = ( n / 2 ) ; c ++ ; } if ( n != 1 ) out . println ( " - 1" ) ; else out . println ( c ) ; } out . close ( ) ; }   static class FScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer sb = new StringTokenizer ( " " ) ; String next ( ) { while ( ! sb . hasMoreTokens ( ) ) { try { sb = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { } } return sb . nextToken ( ) ; } String nextLine ( ) { try { return br . readLine ( ) ; } catch ( IOException e ) { } return " " ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } int [ ] readArray ( int n ) { int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } float nextFloat ( ) { return Float . parseFloat ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } } }


import java . util . Scanner ; import java . util . Arrays ; public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { try { Scanner sc = new Scanner ( System . in ) ; int n , c , x , y , i ; String s ; n = sc . nextInt ( ) ; sc . nextLine ( ) ; s = sc . nextLine ( ) ; x = y = c = 0 ; for ( i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ' U ' ) y ++ ; if ( s . charAt ( i ) == ' R ' ) x ++ ; if ( x == y ) { if ( i < n - 1 && s . charAt ( i ) == s . charAt ( i + 1 ) ) c ++ ; } } System . out . println ( c ) ; } catch ( Exception e ) { } } }

n = int ( input ( ) ) s = input ( )   x = 0 y = 0 prev_kingdom = Nonecoin = 0 for step in s : if step == ' U ' : y += 1 else : x += 1 if y > x : curr_kingdom = 2 elif x > y : curr_kingdom = 1 if prev_kingdom and curr_kingdom != prev_kingdom : coin += 1 prev_kingdom = curr_kingdomprint ( coin ) NEW_LINE


n = int ( input ( ) ) s = input ( ) x , y = 0 , 0 f = 0 ans = 0 for c in s : if c == ' U ' : y += 1 else : x += 1 if x == y : continue else : f1 = 1 if x > y : f1 = 1 else : f1 = - 1 if f1 * f < 0 : ans += 1 f = f1print ( ans ) NEW_LINE


n = int ( input ( ) ) S = str ( input ( ) ) cur_y , cur_x = 0 , 0 C = [ ( cur_x , cur_y ) ] for c in S : if c == ' U ' : cur_y += 1 else : cur_x += 1 C . append ( ( cur_y , cur_x ) ) ans = 0 for i , ( cur_x , cur_y ) in enumerate ( C ) : if i == 0 or i == len ( C ) - 1 : continue if cur_x == cur_y : pre_x , pre_y = C [ i - 1 ] pos_x , pos_y = C [ i + 1 ] if pre_x > pre_y and pos_x < pos_y : ans += 1 elif pre_x < pre_y and pos_x > pos_y : ans += 1 print ( ans ) NEW_LINE


n = int ( input ( ) ) s = input ( ) x , y = 0 , 0 count = 0 for i in range ( len ( s ) - 1 ) : if ( s [ i ] == " U " ) : y = y + 1 if ( x == y and s [ i + 1 ] == " U " ) : count = count + 1 if ( s [ i ] == " R " ) : x = x + 1 if ( x == y and s [ i + 1 ] == " R " ) : count = count + 1 print ( count ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Main {   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 ( ) ) ; } }   public static void main ( String args [ ] ) { FastScanner f = new FastScanner ( ) ; int n = f . nextInt ( ) ; String str = f . next ( ) ; int x = 0 , y = 0 ; int count = 0 ; int prevX , prevY ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { prevX = x ; prevY = y ; if ( str . charAt ( i ) == ' U ' ) { y ++ ; } else { x ++ ; } if ( x == y && i + 1 < str . length ( ) ) { char next = str . charAt ( i + 1 ) ; int nextX = x , nextY = y ; if ( next == ' U ' ) { nextY ++ ; } else { nextX ++ ; } if ( ( prevX == x - 1 && nextX == x + 1 ) || ( prevY == y - 1 && nextY == y + 1 ) ) { count ++ ; } } } System . out . println ( count ) ; }   }


import java . util . Arrays ; import java . util . Scanner ;   public class main { public static void main ( String [ ] args ) { Scanner k = new Scanner ( System . in ) ; String n = k . next ( ) ; String input = k . next ( ) ; int ans = 0 ; int c = input . charAt ( 0 ) == ' R ' ? 1 : - 1 ; boolean pos = input . charAt ( 0 ) == ' R ' ; for ( int i = 1 ; i < input . length ( ) ; i ++ ) { if ( input . charAt ( i ) == ' R ' ) { c += 1 ; if ( c == 1 && pos == false ) { pos = true ; ans += 1 ; } } else if ( input . charAt ( i ) == ' U ' ) { c -= 1 ; if ( c == - 1 && pos == true ) { pos = false ; ans += 1 ; } } } System . out . println ( ans ) ; } }


import java . util . * ; import java . util . stream . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; scan . nextLine ( ) ; String s = scan . nextLine ( ) ; int result = 0 ; int numU = 0 ; int numR = 0 ; boolean tS = true ; for ( int i = 0 ; i < n ; i ++ ) { char ch = s . charAt ( i ) ; boolean v = ( numU == numR ) ; if ( ch == ' U ' ) { numU ++ ; } else if ( ch == ' R ' ) { numR ++ ; } if ( i == 0 ) { tS = ( numU > 0 ) ; } if ( v && tS && numR > numU ) { tS = false ; result ++ ; } if ( v && ! tS && numR < numU ) { tS = true ; result ++ ; } } System . out . println ( result ) ; } }


import java . io . * ; import java . math . * ; import java . util . * ; public class Main { private static int dx [ ] = { 1 , 0 , - 1 , 0 } ; private static int dy [ ] = { 0 , - 1 , 0 , 1 } ; private static int dx1 [ ] = { 1 , 1 , 0 , - 1 , - 1 , - 1 , 0 , 1 } ; private static int dy1 [ ] = { 0 , - 1 , - 1 , - 1 , 0 , 1 , 1 , 1 } ; private static final long INF = Long . MAX_VALUE ; private static final int INT_INF = Integer . MAX_VALUE ; private static final long NEG_INF = Long . MIN_VALUE ; private static final int NEG_INT_INF = Integer . MIN_VALUE ; private static final double EPSILON = 1e-10 ; private static final long MAX = ( long ) 1e12 ; private static final long MOD = 100000007 ; private static final int MAXN = 5000077 ; private static final int MAXA = 6000 ; private static final int MAXLOG = 22 ; private static final double PI = Math . acos ( - 1 ) ; public static void main ( String [ ] args ) throws IOException { InputReader in = new InputReader ( System . in ) ;

n , k = map ( int , ( input ( ) . split ( ) ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   nums = list ( range ( 1 , n + 1 ) ) leader = 0 elims = [ ] for i in range ( k ) : elim = ( leader + arr [ i ] ) % n elims . append ( nums . pop ( elim ) ) n -= 1 leader = elimprint ( * elims )       NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) k = list ( map ( int , input ( ) . split ( ) ) ) l , ans = [ ] , [ ] for i in range ( n ) : l . append ( i ) leader = 0 for i in k : ans . append ( l [ ( ( leader + i ) % ( len ( l ) ) ) ] + 1 ) leader = ( ( leader + i ) % ( len ( l ) ) ) ; l . remove ( ans [ - 1 ] - 1 ) leader = leader % len ( l )   print ( * ans , sep = " ▁ " )   NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) lead = 0 lst = [ ] for i in range ( 1 , n + 1 ) : lst . append ( i ) for i in range ( k ) : ind = ( lead + a [ i ] ) % len ( lst ) print ( lst [ ind ] , end = " ▁ " ) lead = ind lst [ ind ] = - 1 llst = [ ] for j in range ( len ( lst ) ) : if lst [ j ] != - 1 : llst . append ( lst [ j ] ) lst = list ( llst ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) a = [ x + 1 for x in range ( n ) ] for m in map ( int , input ( ) . split ( ) ) : m %= len ( a ) print ( a [ m ] , end = " ▁ " ) a = a [ m + 1 : ] + a [ : m ] print ( ) NEW_LINE


import java . util . LinkedList ; import java . util . List ; import java . util . Scanner ;   public class B792 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; int [ ] A = new int [ K ] ; for ( int k = 0 ; k < K ; k ++ ) { A [ k ] = in . nextInt ( ) ; } List < Integer > list = new LinkedList < > ( ) ; for ( int n = 1 ; n <= N ; n ++ ) { list . add ( n ) ; } StringBuilder output = new StringBuilder ( ) ; int pos = 0 ; for ( int k = 0 ; k < K ; k ++ ) { pos += A [ k ] ; pos %= list . size ( ) ; output . append ( list . get ( pos ) ) . append ( ' ▁ ' ) ; list . remove ( pos ) ; } System . out . println ( output ) ; }   }


import java . util . * ; import java . math . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long A = s . nextLong ( ) , B = s . nextLong ( ) , C = s . nextLong ( ) ;   if ( A == 0 && B == 0 ) { System . out . println ( C == 0 ? - 1 : 0 ) ; } else if ( A == 0 ) { System . out . println ( 1 ) ; System . out . println ( 1.0 * - C / B ) ; } else { long discriminant = B * B - 4 * A * C ; if ( discriminant < 0 ) System . out . println ( 0 ) ; else if ( discriminant == 0 ) { System . out . println ( 1 ) ; System . out . println ( 1.0 * - B / ( 2.0 * A ) ) ; } else { System . out . println ( 2 ) ; double num1 = ( - B - Math . sqrt ( discriminant ) ) / ( 2.0 * A ) ; double num2 = ( - B + Math . sqrt ( discriminant ) ) / ( 2.0 * A ) ;   if ( num1 < num2 ) { System . out . println ( num1 ) ; System . out . println ( num2 ) ; } else { System . out . println ( num2 ) ; System . out . println ( num1 ) ; } } }   s . close ( ) ; } }


from math import sqrt   a , b , c = map ( int , input ( ) . split ( ) ) if a == b == c == 0 : print ( - 1 ) elif a == b == 0 :   print ( 0 ) elif a == 0 : print ( 1 ) print ( - c / b ) else : if b ** 2 == ( 4 * a * c ) :   print ( 1 ) print ( ( - b ) / ( 2 * a ) ) elif ( 4 * a * c ) > b ** 2 : print ( 0 ) else : print ( 2 ) x = ( ( - b + sqrt ( b ** 2 - ( 4 * a * c ) ) ) / ( 2 * a ) ) y = ( - b - sqrt ( b ** 2 - ( 4 * a * c ) ) ) / ( 2 * a ) print ( ' { 0 : . 16f } ' . format ( min ( x , y ) ) ) print ( ' { 0 : . 16f } ' . format ( max ( x , y ) ) ) NEW_LINE


a , b , c = map ( int , input ( ) . split ( ) )   def quadroot ( a , b , c ) : roots = [ ] negb = - 1 * b discriminant = ( b ** 2 - 4 * a * c ) ** ( 1 / 2 ) bottom = 2 * a roots . append ( format ( ( negb - discriminant ) / ( bottom ) , " . 6f " ) ) roots . append ( format ( ( negb + discriminant ) / ( bottom ) , " . 6f " ) ) return roots   if a == 0 and b == 0 and c == 0 : print ( - 1 ) exit ( ) if a == b and b == 0 and c != 0 or ( b ** 2 - 4 * a * c ) < 0 : print ( 0 ) exit ( ) ans = [ ] if a == 0 : ans . append ( ( - 1 * c ) / b ) else : ans = quadroot ( a , b , c )   for root in range ( len ( ans ) ) : ans [ root ] = float ( ans [ root ] )   ans1 = list ( set ( sorted ( ans ) ) ) print ( len ( ans1 ) ) for i in ans1 : print ( ( f ' { i : .6f } ' ) )     NEW_LINE


from math import sqrt   a , b , c = map ( int , input ( ) . split ( ) ) det = b * b - 4 * a * cif a == 0 : if b == 0 and c == 0 : print ( - 1 ) elif b == 0 : print ( 0 ) else : print ( 1 ) p = round ( - c / b , 5 ) print ( p ) elif det < 0 : print ( 0 ) elif det == 0 : print ( 1 ) p = round ( - b / ( a * 2 ) , 5 ) print ( p ) else : print ( 2 ) neu = - b + sqrt ( det ) p = round ( neu / ( 2 * a ) , 5 ) neu = - b - sqrt ( det ) q = round ( neu / ( 2 * a ) , 5 ) if p > q : p , q = q , p print ( p ) print ( q )   ''' And ▁ the ▁ shadow ▁ of ▁ the ▁ dayWill ▁ embrace ▁ the ▁ word ▁ in ▁ greyAnd ▁ the ▁ sun ▁ will ▁ set ▁ for ▁ you ''' NEW_LINE


import java . io . * ; import java . util . * ;   public class ProbA { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( in , out ) ; out . close ( ) ; }


import java . io . * ; import java . util . * ; import java . lang . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; double a = sc . nextDouble ( ) ; double b = sc . nextDouble ( ) ; double c = sc . nextDouble ( ) ; if ( a == 0 && b != 0 ) { double ans = - ( c / b ) ; System . out . format ( "1 \n % .5f " , ans ) ; } else if ( a == 0 && b == 0 && c == 0 ) { System . out . println ( " - 1" ) ; } else if ( a == 0 && b == 0 && c != 0 ) { System . out . println ( "0" ) ; } else { double r1 , r2 ; double det = b * b - 4 * a * c ; if ( det > 0 ) { System . out . println ( "2" ) ; r1 = ( - b + Math . sqrt ( det ) ) / ( 2 * a ) ; r2 = ( - b - Math . sqrt ( det ) ) / ( 2 * a ) ; double x = ( r1 < r2 ) ? r1 : r2 ; double y = ( r1 > r2 ) ? r1 : r2 ; System . out . format ( " % .5f \n % .5f \n " , x , y ) ; } else if ( det == 0 ) { r1 = ( - b + Math . sqrt ( det ) ) / ( 2 * a ) ; System . out . format ( "1 \n % .5f " , r1 ) ; } else System . out . println ( "0" ) ; } } }


import java . util . Scanner ;   public class AlgoDesign {   public static void main ( String args [ ] ) { int n , m , max = 0 ; Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] > max ) { max = a [ i ] ; } } int seatsToFill = m ; for ( int i = 0 ; i < n ; i ++ ) { if ( seatsToFill <= 0 ) { seatsToFill = 0 ; break ; } if ( a [ i ] < max ) { seatsToFill = seatsToFill - ( max - a [ i ] ) ; } } int min = 0 ; if ( seatsToFill > 0 ) { min = ( seatsToFill / n ) ; min = seatsToFill % n > 0 ? min + 1 : min ; } System . out . print ( ( max + min ) + " ▁ " + ( max + m ) ) ; } }

n = int ( input ( ) ) m = int ( input ( ) ) a = [ ] for i in range ( n ) : a . append ( int ( input ( ) ) ) k1 = max ( a ) kmax = k1 + m     aa = m / nk2 = sum ( a ) + m + n - 1 kmin = k2 // n     print ( max ( kmin , k1 ) , kmax ) NEW_LINE


n = int ( input ( ) ) m = int ( input ( ) ) A = [ ] for _ in range ( 0 , n ) : A . append ( int ( input ( ) ) ) print ( max ( max ( A ) , ( sum ( A ) + m + n - 1 ) // n ) , max ( A ) + m ) NEW_LINE


from collections import defaultdict , deque , Counterfrom sys import stdin , stdoutfrom heapq import heappush , heappopimport mathimport ioimport osimport mathimport bisect   NEW_LINE


n = int ( input ( ) ) m = int ( input ( ) ) NEW_LINE


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . InputMismatchException ; import java . io . IOException ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastReader in = new FastReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ABenches solver = new ABenches ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ABenches { public void solve ( int testNumber , FastReader in , PrintWriter out ) { int n = in . nextInt ( ) , m = in . nextInt ( ) ; int a [ ] = in . readArray ( n ) ; func . sort ( a ) ; int sum = 0 ; for ( int i = 0 ; i < n ; ++ i ) { sum += a [ n - 1 ] - a [ i ] ; } if ( m <= sum ) { out . println ( a [ n - 1 ] + " ▁ " + ( a [ n - 1 ] + m ) ) ; return ; } int max = a [ n - 1 ] + m ; m -= sum ; m = ( m + n - 1 ) / n ; out . println ( ( a [ n - 1 ] + m ) + " ▁ " + ( max ) ) ; }   }   static class func { public static void sort ( int [ ] arr ) {


import java . io . * ;   import java . util . * ; public class Solution {


import java . util . * ;    public class Practise {

def ans ( n , k , s ) : if k == 0 : return ' ' . join ( s ) elif k != 0 and n == 1 : return '0' for i in range ( n ) : if k == 0 : break   if i == 0 and s [ i ] != '1' : s [ i ] = '1' k -= 1 elif i != 0 and s [ i ] != '0' : s [ i ] = '0' k -= 1 return ' ' . join ( s )     n , k = map ( int , input ( ) . split ( ' ▁ ' ) ) s = list ( input ( ) )   print ( ans ( n , k , s ) ) NEW_LINE


def tostring ( s ) : str1 = ' ' return str1 . join ( s )   vet = input ( ) . split ( ) s = list ( input ( ) ) n = int ( vet [ 0 ] ) k = int ( vet [ 1 ] )   if ( n == 1 and k ) : print ( 0 )   else : if ( s [ 0 ] > '1' and k ) : s [ 0 ] = '1' k -= 1 for i in range ( 1 , len ( s ) ) : if ( s [ i ] > '0' and k > 0 ) : s [ i ] = '0' k -= 1 print ( tostring ( s ) ) NEW_LINE


n_size , k = map ( int , input ( ) . split ( ) ) number = input ( )   if n_size == 1 : if number == '0' : print ( '0' ) else : if k >= 1 : print ( '0' ) else : print ( number ) else : for i in range ( len ( number ) ) : if ( k > 0 ) : if ( i == 0 and number [ i ] == '1' ) : print ( '1' , end = ' ' ) continue elif ( i == 0 ) : print ( '1' , end = ' ' ) k -= 1 continue elif ( number [ i ] == '0' ) : print ( number [ i ] , end = ' ' ) continue else : print ( '0' , end = ' ' ) k -= 1 continue print ( number [ i ] , end = ' ' ) NEW_LINE


try : n , k = map ( int , input ( ) . split ( ) ) s = input ( ) j = 0 z = " " if k == 0 : print ( s ) elif n == 1 and not k == 0 : print ( 0 ) else : for i in range ( n ) : if i == 0 : if not s [ i ] == "1" : print ( 1 , end = " " ) j += 1 else : print ( 1 , end = " " ) elif j >= k : print ( s [ i ] , end = " " ) else : if not s [ i ] == "0" : print ( 0 , end = " " ) j += 1 else : print ( 0 , end = " " ) NEW_LINE