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


def constructTiles ( arr , n , m ) : if NEW_LINE m & 1 != 1 : NEW_LINE for i in range ( n ) : if NEW_LINE ( arr [ i ] [ 0 ] [ 1 ] == arr [ i ] [ 1 ] [ 0 ] ) : print ( " Yes " ) NEW_LINE return print ( " No " ) NEW_LINE return       tc = int ( input ( ) ) NEW_LINE for _ in range ( 0 , tc ) : n , m = input ( ) . split ( ) NEW_LINE n = int ( n ) NEW_LINE m = int ( m ) NEW_LINE arr = [ ] NEW_LINE for i in range ( n ) : childArr = [ ] NEW_LINE for i in range ( 0 , 2 ) : a , b = input ( ) . split ( ) NEW_LINE a = int ( a ) NEW_LINE b = int ( b ) NEW_LINE childArr . append ( [ a , b ] ) NEW_LINE arr . append ( childArr ) NEW_LINE constructTiles ( arr , n , m ) NEW_LINE


c = int ( input ( ) ) NEW_LINE while c : c -= 1 NEW_LINE n , m = map ( int , input ( ) . split ( ) ) NEW_LINE cases = n NEW_LINE pair_one = False NEW_LINE pair_two = False NEW_LINE while cases : cases -= 1 NEW_LINE a , b = map ( int , input ( ) . split ( ) ) NEW_LINE b2 , a2 = map ( int , input ( ) . split ( ) ) NEW_LINE if a == a2 : pair_one = True NEW_LINE if b2 == b : pair_two = True   if pair_two and m % 2 == 0 : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " ) NEW_LINE DEDENT


p = lambda : list ( map ( int , input ( ) . split ( ) ) )   T = int ( input ( ) ) NEW_LINE for _ in range ( T ) : N , M = p ( ) NEW_LINE tiles = [ [ p ( ) , p ( ) ] for _ in range ( N ) ] NEW_LINE if M & 1 : print ( " NO " ) ; continue   NEW_LINE


import sysfrom NEW_LINE os NEW_LINE import pathif NEW_LINE ( path . exists ( ' input . txt ' ) and path . exists ( ' output . txt ' ) ) : sys . stdout = open ( ' output . txt ' , ' w ' ) NEW_LINE sys . stdin = open ( ' input . txt ' , ' r ' )   NEW_LINE


import java . util . * ; public class USBvsPS1400 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; PriorityQueue < Long > mUSB = new PriorityQueue < Long > ( ) ; PriorityQueue < Long > mPS = new PriorityQueue < Long > ( ) ; for ( int i = 0 ; i < m ; i ++ ) { long mouse = sc . nextInt ( ) ; String t = sc . next ( ) ; if ( t . contentEquals ( " USB " ) ) { mUSB . add ( mouse ) ; } else { mPS . add ( mouse ) ; } } long price = 0 ; int i = 0 ; for ( ; i < a && ! mUSB . isEmpty ( ) ; i ++ ) { price += mUSB . poll ( ) ; } int j = 0 ; for ( ; j < b && ! mPS . isEmpty ( ) ; j ++ ) { price += mPS . poll ( ) ; } int k = 0 ; for ( ; k < c ; k ++ ) { if ( ! mUSB . isEmpty ( ) && ! mPS . isEmpty ( ) ) { if ( mUSB . peek ( ) <= mPS . peek ( ) ) { price += mUSB . poll ( ) ; } else { price += mPS . poll ( ) ; } } else if ( ! mUSB . isEmpty ( ) ) { price += mUSB . poll ( ) ; } else if ( ! mPS . isEmpty ( ) ) { price += mPS . poll ( ) ; } else { break ; } } System . out . println ( ( i + j + k ) + " ▁ " + price ) ;   }   }

import sysinput = sys . stdin . readline   '''   '''   num_usb , num_ps , num_both = map ( int , input ( ) . split ( ) ) m = int ( input ( ) )   usb = [ ] ps = [ ]   for _ in range ( m ) : c , con = input ( ) . rstrip ( ) . split ( ) c = int ( c ) if con == " USB " : usb . append ( c ) else : ps . append ( c )   usb . sort ( reverse = True ) ps . sort ( reverse = True )   cost = 0 count = 0   while num_usb and usb : num_usb -= 1 cost += usb . pop ( ) count += 1   while num_ps and ps : num_ps -= 1 cost += ps . pop ( ) count += 1   usb . extend ( ps ) both = usbboth . sort ( reverse = True )   while num_both and usb : num_both -= 1 cost += both . pop ( ) count += 1   print ( count , cost )   NEW_LINE


usb = [ ] ps = [ ] nc = 0 pr = 0 s = input ( ) s = s . split ( ) u = int ( s [ 0 ] ) p = int ( s [ 1 ] ) up = int ( s [ 2 ] ) m = int ( input ( ) ) for i in range ( m ) : b = input ( ) b = b . split ( ) pri = int ( b [ 0 ] ) ty = b [ 1 ] if ty == ' USB ' : usb . append ( pri ) else : ps . append ( pri ) usb . sort ( ) ps . sort ( ) if len ( usb ) <= u : pr += sum ( usb ) nc += len ( usb ) k1 = [ ] else : pr += sum ( usb [ 0 : u ] ) NEW_LINE


c = list ( map ( int , input ( ) . split ( ) ) ) m = int ( input ( ) ) a = [ ] for i in range ( m ) : n , t = input ( ) . split ( ) a . append ( ( int ( n ) , int ( t == " PS / 2" ) ) ) a . sort ( ) res = 0 b = [ 0 ] * 3 for n , t in a : if c [ t ] - b [ t ] > 0 : b [ t ] += 1 res += n elif c [ 2 ] - b [ 2 ] > 0 : b [ 2 ] += 1 res += nprint ( sum ( b ) , res ) NEW_LINE


import java . util . * ; import java . io . * ;   public class USB { public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; int a = fr . nextInt ( ) , b = fr . nextInt ( ) , c = fr . nextInt ( ) ; int m = fr . nextInt ( ) ; long cost = 0 ; long count = 0 ;   PriorityQueue < Integer > usb = new PriorityQueue < > ( ) ; PriorityQueue < Integer > ps2 = new PriorityQueue < > ( ) ;   for ( int i = 0 ; i < m ; i ++ ) { String [ ] in = fr . nextLine ( ) . split ( " ▁ " ) ; if ( in [ 1 ] . equals ( " USB " ) ) { usb . offer ( Integer . parseInt ( in [ 0 ] ) ) ; } else ps2 . offer ( Integer . parseInt ( in [ 0 ] ) ) ; }   while ( ! usb . isEmpty ( ) || ! ps2 . isEmpty ( ) && a > 0 || b > 0 ) { boolean flag = false ;


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 ) ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; String m = input . next ( ) ; String s = input . next ( ) ; int count = ( m . split ( s , - 1 ) . length ) - 1 ; if ( count == 0 ) { System . out . println ( "0" ) ; } else { System . out . println ( count ) ; }   }   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 ( ) ; } }   }

st = input ( ) l = len ( st ) st1 = input ( ) l1 = len ( st1 ) i = 0 c = 0 while ( i <= l - l1 ) : st2 = st [ i : i + l1 ] if ( st1 == st2 ) : c = c + 1 i = i + l1 else : i = i + 1 print ( c ) NEW_LINE


s = input ( ) a = input ( ) m = len ( a ) n = len ( s ) c = 0 i = 0 while ( i <= n - m ) : if ( s [ i : i + m ] == a ) : c += 1 i = i + m else : i += 1 print ( c ) NEW_LINE


s = input ( ) t = input ( ) print ( s . count ( t ) ) NEW_LINE


s1 = input ( ) s1 = s1 . lower ( ) s2 = input ( ) s2 = s2 . lower ( )   count = 0   if ( len ( s1 ) <= 100000 and len ( s2 ) <= 30 ) and ( len ( s1 ) and len ( s2 ) ) >= 1 : count = s1 . count ( s2 ) print ( count )   NEW_LINE


print ( input ( ) . count ( input ( ) ) )   NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ;   public class codeforces { 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 sc = new FastReader ( ) ; String g = sc . next ( ) ; String a = sc . next ( ) ; int index = g . indexOf ( a ) ; int count = 0 ; int len = g . length ( ) ;   while ( index < len && index > - 1 ) { index = g . indexOf ( a , index + a . length ( ) ) ; count ++ ; } System . out . println ( count ) ;   } }


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


import java . util . * ;   public class WarOfTheCorporations { public static void main ( String [ ] args ) { int i , j , k ; String g , a ; Scanner sc = new Scanner ( System . in ) ; g = sc . nextLine ( ) ; a = sc . nextLine ( ) ; int index = g . indexOf ( a ) ; int count = 0 ; int len = g . length ( ) ; while ( index < len && index > - 1 ) { index = g . indexOf ( a , index + a . length ( ) ) ; count ++ ; } System . out . print ( count ) ; } }


import java . lang . * ; import java . util . * ; import java . io . * ;   public class XXXXX { static List < Integer > ans ; public static boolean isWin ( int n , int m , List < Integer > temp ) { if ( m < n ) return false ; if ( n == m ) { ans = new ArrayList < Integer > ( temp ) ; return true ; } boolean ans = false ; if ( m % 2 == 0 ) { temp . add ( m / 2 ) ; ans |= isWin ( n , m / 2 , temp ) ; temp . remove ( temp . size ( ) - 1 ) ; } else if ( m % 10 == 1 ) { temp . add ( ( m - 1 ) / 10 ) ; ans |= isWin ( n , ( m - 1 ) / 10 , temp ) ; temp . remove ( temp . size ( ) - 1 ) ; } return ans ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; ans = new ArrayList < Integer > ( ) ; List < Integer > temp = new ArrayList < Integer > ( ) ; temp . add ( m ) ; boolean win = isWin ( n , m , temp ) ; if ( win ) { System . out . println ( " YES " ) ; System . out . println ( ans . size ( ) ) ; for ( int i = ans . size ( ) - 1 ; i >= 0 ; i -- ) System . out . print ( ans . get ( i ) + " ▁ " ) ; } else { System . out . println ( " NO " ) ; } } }

def transform ( a , b , transformations = [ ] ) : current_transformations = transformations + [ a ] if a == b : return current_transformations if a > b : return False t1 = transform ( 2 * a , b , current_transformations ) t2 = transform ( 10 * a + 1 , b , current_transformations ) if t1 : return t1 else : return t2 a , b = map ( int , input ( ) . split ( ) ) t = transform ( a , b ) if t : print ( ' YES ' ) print ( len ( t ) ) print ( * t ) else : print ( ' NO ' ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) )   def transformation ( x , y , sequence ) : new_list = sequence [ : ] if ( x == y ) : new_list . append ( x ) return new_list elif ( x > y ) : return False else : new_list . append ( x ) return transformation ( 2 * x , y , new_list ) or transformation ( 10 * x + 1 , y , new_list )   result = transformation ( a , b , [ ] ) if ( result == False ) : print ( " NO " ) else : print ( " YES " ) print ( len ( result ) ) response = " " for i in result : response += str ( i ) + " ▁ " print ( response ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) )   def transformation ( x , y , sequence ) : new_list = sequence [ : ] if ( x == y ) : new_list . append ( x ) return new_list elif ( x > y ) : return False else : new_list . append ( x ) return transformation ( 2 * x , y , new_list ) or transformation ( 10 * x + 1 , y , new_list )   result = transformation ( a , b , [ ] ) if ( result == False ) : print ( " NO " ) else : print ( " YES " ) print ( len ( result ) ) response = " " for i in result : response += str ( i ) + " ▁ " print ( response )   NEW_LINE


def op1 ( x ) : return 2 * x   def op2 ( x ) : return 10 * x + 1   def transform ( a , b , transformations = [ ] ) : current_transformations = transformations + [ a ]   if a == b : return current_transformations if a > b : return False   t1 = transform ( op1 ( a ) , b , current_transformations ) t2 = transform ( op2 ( a ) , b , current_transformations )   if t1 : return t1 else : return t2   a , b = map ( int , input ( ) . split ( ) ) t = transform ( a , b ) if t : print ( ' YES ' ) print ( len ( t ) ) print ( * t ) else : print ( ' NO ' ) NEW_LINE


import javax . swing . table . AbstractTableModel ; import java . io . * ; import java . net . Inet4Address ; import java . util . * ; import java . util . concurrent . atomic . AtomicReferenceFieldUpdater ;


import java . math . BigInteger ; import java . util . * ; import java . lang . * ; import java . util . Arrays ;     public class geek { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; try {       StringBuffer sb = new StringBuffer ( ) ;   StringBuffer sbb = new StringBuffer ( ) ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; int m = 1 ; boolean flag = true ; List < Integer > l = new ArrayList < > ( ) ; l . add ( y ) ; while ( x < y ) { if ( y % 2 == 0 ) { y /= 2 ; l . add ( y ) ; } else if ( y % 10 == 1 ) { y /= 10 ; l . add ( y ) ; } else { flag = false ; break ; } } for ( int i = l . size ( ) - 1 ; i >= 0 ; i -- ) { sbb . append ( l . get ( i ) + " ▁ " ) ; } if ( flag && x == y ) { sb . append ( " YES \n " + l . size ( ) + " \n " + sbb + " \n " ) ; } else sb . append ( " NO \n " ) ;   System . out . println ( sb ) ;


import java . util . * ; import java . io . * ; import java . math . * ; public class Main { static void solve ( ) {

from collections import defaultdict , deque   q = deque ( ) idx , total = 0 , 0 vis = defaultdict ( deque ) not_valid = set ( ) max_x = - 1 ans = [ ]   N , Q = map ( int , input ( ) . split ( ) ) for _ in range ( Q ) : t , x = map ( int , input ( ) . split ( ) )   if t == 1 : q . append ( ( idx , x ) ) vis [ x ] . append ( idx ) idx += 1 total += 1   elif t == 2 : while vis [ x ] : NEW_LINE


import osimport ioinput = io . BytesIO ( os . read ( 0 , os . fstat ( 0 ) . st_size ) ) . readline   n , q = map ( int , input ( ) . split ( ) )   last_2 = [ - 1 ] * nunread_count = [ 0 ] * ntotal_unread = 0 ev = [ ] max_3 = 0   ans = [ ]   for i in range ( q ) : t , x = map ( int , input ( ) . split ( ) ) x -= 1 if t == 1 : ev . append ( x ) unread_count [ x ] += 1 total_unread += 1 elif t == 2 : total_unread -= unread_count [ x ] unread_count [ x ] = 0 last_2 [ x ] = len ( ev ) - 1 else : for j in range ( max_3 , x + 1 ) : el = ev [ j ] if last_2 [ el ] < j : total_unread -= 1 unread_count [ el ] -= 1   max_3 = max ( max_3 , x + 1 ) ans . append ( total_unread ) for a in ans : print ( a ) NEW_LINE


from heapq import * from collections import defaultdict , deque   total = 0 N , Q = map ( int , input ( ) . split ( ) ) q = deque ( ) idx = 0 total = 0 A = [ 0 ] * NB = [ 0 ] * Nans = [ ] for _ in range ( Q ) : t , x = map ( int , input ( ) . split ( ) ) x -= 1   if t == 1 : q . append ( x ) A [ x ] += 1 B [ x ] += 1 total += 1   elif t == 2 : total -= A [ x ] A [ x ] = 0   else : while idx <= x : idx += 1 y = q . popleft ( ) B [ y ] -= 1   if B [ y ] < A [ y ] : total -= 1 A [ y ] = B [ y ]   ans . append ( str ( total ) )   print ( ' \n ' . join ( ans ) )   NEW_LINE


from heapq import * from collections import defaultdict , deque   total = 0 N , Q = map ( int , input ( ) . split ( ) ) q = deque ( ) idx = 0 vis = defaultdict ( deque ) total = 0 not_valid = set ( ) max_d = - 1 ans = [ ] for _ in range ( Q ) : t , x = map ( int , input ( ) . split ( ) )   if t == 1 : q . append ( ( idx , x ) ) vis [ x ] . append ( idx ) idx += 1 total += 1   elif t == 2 : while vis [ x ] : i = vis [ x ] . pop ( ) not_valid . add ( i ) if i <= max_d : continue total -= 1   else : while q and ( q [ 0 ] [ 0 ] <= x - 1 or q [ 0 ] [ 0 ] in not_valid ) : j , y = q . popleft ( ) if j not in not_valid : total -= 1   if len ( vis [ y ] ) : vis [ y ] . popleft ( )   max_d = max ( max_d , x - 1 )   ans . append ( str ( total ) ) print ( " \n " . join ( ans ) ) NEW_LINE


import java . io . * ; import java . util . StringTokenizer ;   public class _121B implements Runnable { private BufferedReader in ; private StringTokenizer tok ;   private Object solve ( ) throws IOException { int n = nextInt ( ) , k = nextInt ( ) ; char [ ] s = nextToken ( ) . toCharArray ( ) ; for ( int i = 0 , cnt = 0 , lim = n - 1 ; i < lim && cnt < k ; i ++ ) { if ( s [ i ] == '4' && s [ i + 1 ] == '7' ) { if ( ( i & 1 ) == 0 ) { s [ i + 1 ] = '4' ; } else { s [ i ] = '7' ; if ( s [ i - 1 ] == '4' ) { if ( ( ( k - cnt ) & 1 ) == 0 ) { s [ i ] = '4' ; } break ; } } cnt ++ ; } } return new String ( s ) ; }

n , m = map ( int , input ( ) . split ( ) ) luckstring = list ( input ( ) )   start = 0 idx = 0 while m : idx = start while idx < len ( luckstring ) - 1 : if luckstring [ idx ] == '4' and luckstring [ idx + 1 ] == '7' : break idx += 1 if idx == len ( luckstring ) - 1 : break if ( idx & 1 ) == 0 : if ( idx + 2 < len ( luckstring ) and luckstring [ idx + 2 ] == '7' ) : if ( m & 1 ) == 1 : luckstring [ idx + 1 ] = '4' m = 0 break luckstring [ idx + 1 ] = '4' start = idx + 1 else : if ( idx - 1 >= 0 and luckstring [ idx - 1 ] == '4' ) : if ( m & 1 ) == 1 : luckstring [ idx ] = '7' m = 0 break luckstring [ idx ] = '7' if idx > 0 : start = idx - 1 else : start = idx + 2 m -= 1   print ( " " . join ( luckstring ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   t = list ( input ( ) )   i = 0   while k and i < n - 1 :   if t [ i ] == '4' and t [ i + 1 ] == '7' :   k -= 1   if i & 1 == 0 : t [ i + 1 ] = '4'   else :   if i > 0 and t [ i - 1 ] == '4' :   if k & 1 == 0 : t [ i ] = '7'   break   t [ i ] = '7'   i -= 2   i += 1   print ( ' ' . join ( t ) )       NEW_LINE


# 447 or 477 start with odd    n , k = map ( int , input ( ) . split ( ) ) s = input ( ) s = list ( s )   for i in range ( n - 1 ) : if not k : break if s [ i ] != '4' : continue tt = ' ' . join ( s [ i : i ▁ + ▁ 3 ] ) ▁ ▁ ▁ ▁ if ▁ tt ▁ in ▁ ( ' 447 ' , ▁ ' 477 ' ) ▁ and ▁ i ▁ % ▁ 2 ▁ = = ▁ 0 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ k ▁ % ▁ 2 ▁ = = ▁ 1 ▁ and ▁ tt ▁ = = ▁ ' 447 ' : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s [ i ▁ + ▁ 1 ] ▁ = ▁ ' 7 ' ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ k ▁ % ▁ 2 ▁ = = ▁ 1 ▁ and ▁ tt ▁ = = ▁ ' 477 ' : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s [ i ▁ + ▁ 1 ] ▁ = ▁ ' 4 ' ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ break ▁ ▁ ▁ ▁ if ▁ s [ i ] ▁ = = ▁ ' 4 ' ▁ and ▁ s [ i ▁ + ▁ 1 ] ▁ = = ▁ ' 7 ' : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ i ▁ % ▁ 2 ▁ = = ▁ 0 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s [ i ▁ + ▁ 1 ] ▁ = ▁ ' 4 ' ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ else : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s [ i ] ▁ = ▁ ' 7 ' ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ k ▁ - = ▁ 1 print ( ' '.join(s))


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ;   public class CF1294A { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { int [ ] a = Arrays . stream ( br . readLine ( ) . split ( " \\ s + " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; int maxValue = Math . max ( a [ 0 ] , a [ 1 ] ) ; maxValue = Math . max ( maxValue , a [ 2 ] ) ; int desiredValue = a [ 0 ] + a [ 1 ] + a [ 2 ] + a [ 3 ] ; System . out . println ( ( desiredValue % 3 == 0 && ( desiredValue / 3 ) >= maxValue ) ? " YES " : " NO " ) ; } } }

for x in range ( int ( input ( ) ) ) : l = list ( map ( int , input ( ) . split ( ) ) ) ma = max ( l [ : 3 ] ) di = 0 for x in l [ : 3 ] : if x != ma : di += ma - x if ( ( l [ - 1 ] - di ) % 3 ) == 0 and ( l [ - 1 ] - di ) >= 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


for i in range ( int ( input ( ) ) ) : a , b , c , n = map ( int , input ( ) . split ( ) ) y = max ( a , b , c ) if y == a : n -= ( a - b ) + ( a - c ) elif y == b : n -= ( b - a ) + ( b - c ) else : n -= ( c - a ) + ( c - b ) if n % 3 == 0 and n >= 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


res1 : int = 0 res2 : int = 0 num = int ( input ( ) ) for i in range ( num ) : a , b , c , d = map ( int , input ( ) . split ( ) ) mx = max ( a , b , c ) if a == mx : res1 = a - b d = d - res1 res2 = a - c d = d - res2 if d >= 0 and d % 3 == 0 : print ( " YES " ) else : print ( " NO " ) elif b == mx : res1 = b - a d = d - res1 res2 = b - c d = d - res2 if d >= 0 and d % 3 == 0 : print ( " YES " ) else : print ( " NO " ) elif c == mx : res1 = c - a d = d - res1 res2 = c - b d = d - res2 if d >= 0 and d % 3 == 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : l = list ( map ( int , input ( ) . split ( ) ) ) if sum ( l ) % 3 == 0 : for x in l [ : - 1 ] : if x > sum ( l ) // 3 : NEW_LINE


def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : * arr , n = map ( int , input ( ) . split ( ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Set ;   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 sc = new FastReader ( ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int q = Math . max ( a , Math . max ( b , c ) ) ; if ( ( n - ( ( q - a ) + ( q - b ) + ( q - c ) ) ) % 3 == 0 && ( n - ( ( q - a ) + ( q - b ) + ( q - c ) ) ) >= 0 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }   }   }


import java . util . Scanner ;   public class A1294 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int a = scanner . nextInt ( ) , max = 0 , diff = 0 , b = scanner . nextInt ( ) , c = scanner . nextInt ( ) , n = scanner . nextInt ( ) ; max = Math . max ( max , a ) ; max = Math . max ( max , b ) ; max = Math . max ( max , c ) ; diff = 3 * max - a - b - c ; if ( n >= diff && ( n - diff ) % 3 == 0 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }


import java . io . * ; import java . util . * ; public class A { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- > 0 ) { int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; int c = s . nextInt ( ) ; int n = s . nextInt ( ) ; int sum = a + b + c + n ; if ( sum % 3 == 0 ) { int z = sum / 3 ; int p = Math . abs ( z - a ) + Math . abs ( z - b ) + Math . abs ( z - c ) ; if ( p == n ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } else { System . out . println ( " No " ) ; } } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ;   public class E { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; while ( t -- > 0 ) { int a = fs . nextInt ( ) ; int b = fs . nextInt ( ) ; int c = fs . nextInt ( ) ; int n = fs . nextInt ( ) ;


import java . math . BigInteger ; import java . util . * ;    public class dummycodes {     public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += sc . nextInt ( ) ; if ( sum % n == 0 ) System . out . println ( n ) ; else System . out . println ( n - 1 ) ;     } }

def solution ( ) : n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) if sum ( arr ) % n : print ( n - 1 ) else : print ( n )   	           return 	 	 	       solution ( ) NEW_LINE


n = int ( input ( ) ) print ( n - ( sum ( map ( int , input ( ) . split ( ) ) ) % n != 0 ) )   NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) if sum ( arr ) % n == 0 : print ( n ) else : print ( n - 1 ) NEW_LINE


n = int ( input ( ) ) a = sum ( map ( int , input ( ) . split ( ) ) ) if a % n == 0 : print ( n ) else : print ( n - 1 ) NEW_LINE


import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int s = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; s += arr [ i ] ; } if ( s % n == 0 ) System . out . println ( n ) ; else System . out . println ( n - 1 ) ; } }


import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;     public class Multasking {   public static void main ( String [ ] args ) {   InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader sc = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Solver solver = new Solver ( ) ;

from collections import * import sys input = sys . stdin . readline   NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) for i in range ( n ) : li = list ( map ( int , input ( ) . split ( ) ) ) ans = [ ] for i in range ( 1 , m + 1 ) : for j in range ( i + 1 , m + 1 ) : ans . append ( [ i , j ] ) if k == 0 : print ( len ( ans ) ) for i in ans : print ( * i ) else : print ( len ( ans ) ) for i in ans [ : : - 1 ] : print ( * i [ : : - 1 ] )     NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) print ( m * ( m - 1 ) // 2 ) for i in range ( m ) : for j in range ( i + 1 , m ) : print ( j + 1 , i + 1 ) if k else print ( i + 1 , j + 1 )   NEW_LINE


import java . io . * ; import java . util . * ; import java . lang . * ; import java . math . * ; import java . text . DecimalFormat ; import java . lang . reflect . Array ; import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigDecimal ; import java . security . cert . TrustAnchor ;   public class B { public static PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ; static long MOD = ( long ) ( 1e9 + 7 ) ;


import java . util . * ; import java . io . * ; import java . math . * ; public class Euler { public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; PrintWriter o = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int k = in . nextInt ( ) ; int [ ] [ ] arr = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < m ; j ++ ) arr [ i ] [ j ] = in . nextInt ( ) ; if ( k == 0 ) { long total = ( m * ( m - 1 ) ) / 2 ; o . println ( total ) ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = i + 1 ; j < m ; j ++ ) { o . println ( ( i + 1 ) + " ▁ " + ( j + 1 ) ) ; } } } else { long total = ( m * ( m - 1 ) ) / 2 ; o . println ( total ) ; for ( int i = m - 1 ; i >= 0 ; i -- ) { for ( int j = i - 1 ; j >= 0 ; j -- ) { o . println ( ( i + 1 ) + " ▁ " + ( j + 1 ) ) ; } } } o . close ( ) ; o . flush ( ) ; return ; } static final Random random = new Random ( ) ; static void ruffleSort ( int [ ] a ) { int n = a . length ;


import java . util . Scanner ; public class p1485A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; for ( int t = sc . nextInt ( ) ; t -- > 0 ; ) { int a = sc . nextInt ( ) , b = sc . nextInt ( ) , c = 1 << 30 ; for ( int i = 0 ; i < 69 ; i ++ ) c = Math . min ( c , i + calc ( a , b + i ) ) ; System . out . println ( c ) ; } } static int calc ( int a , int b ) { int c = 0 ; if ( b == 1 ) { b ++ ; c ++ ; } while ( a > 0 ) { a /= b ; c ++ ; } return c ; } }

for s in [ * open ( 0 ) ] [ 1 : ] : NEW_LINE INDENT a , b = map ( int , s . split ( ) ) ; NEW_LINE n = b ; NEW_LINE r = 99 NEW_LINE while n - b < r : NEW_LINE INDENT m = a ; NEW_LINE i = 0 NEW_LINE if n > 1 : NEW_LINE INDENT while m : i += 1 ; m //= n NEW_LINE r = min ( r , n - b + i ) NEW_LINE DEDENT n += 1 NEW_LINE DEDENT print ( r ) NEW_LINE DEDENT


def calc ( a , b ) : NEW_LINE INDENT if ( a == 1 ) : return 1e10 NEW_LINE i = 0 NEW_LINE while ( b > 0 ) : b = b // a ; i += 1 NEW_LINE return i NEW_LINE DEDENT for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT a , b = map ( int , input ( ) . split ( ) ) ; NEW_LINE ans = 0 NEW_LINE while ( ( calc ( b , a ) - calc ( b + 1 , a ) ) >= 1 ) : b += 1 ; ans += 1 NEW_LINE print ( ans + calc ( b , a ) ) NEW_LINE DEDENT


T = int ( input ( ) ) NEW_LINE for _ in range ( T ) : NEW_LINE INDENT A , B = map ( int , input ( ) . split ( ) ) NEW_LINE C = 0 NEW_LINE if B == 1 : NEW_LINE INDENT B += 1 NEW_LINE C += 1 NEW_LINE DEDENT M = 2e9 NEW_LINE for i in range ( 99 ) : NEW_LINE INDENT m = 1 NEW_LINE L = 0 NEW_LINE while m <= A : NEW_LINE INDENT m *= B NEW_LINE L += 1 NEW_LINE DEDENT M = min ( M , L + C ) NEW_LINE B += 1 NEW_LINE C += 1 NEW_LINE DEDENT print ( M ) NEW_LINE DEDENT


def f ( n , i ) : NEW_LINE INDENT c = 0 NEW_LINE while n : NEW_LINE INDENT c += 1 NEW_LINE n //= i NEW_LINE DEDENT return c NEW_LINE DEDENT for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT a , b = map ( int , input ( ) . split ( ) ) NEW_LINE ops = 0 if b > 1 else 1 NEW_LINE print ( min ( [ i + f ( a , b + i ) for i in range ( ops , 20 ) ] ) ) NEW_LINE DEDENT


T = int ( input ( ) ) NEW_LINE for _ in range ( T ) : NEW_LINE INDENT A , B = map ( int , input ( ) . split ( ) ) ; NEW_LINE C = 0 ; NEW_LINE M = 2e9 NEW_LINE if B == 1 : B += 1 ; C += 1 NEW_LINE for i in range ( 9 ) : NEW_LINE INDENT m = 1 ; NEW_LINE L = 0 NEW_LINE while m <= A : m *= B ; L += 1 NEW_LINE M = min ( M , L + C ) ; NEW_LINE B += 1 ; NEW_LINE C += 1 NEW_LINE DEDENT print ( M ) NEW_LINE DEDENT


import java . util . * ; public class A { public static void main ( String [ ] args ) { Scanner fs = new Scanner ( System . in ) ; int T = fs . nextInt ( ) ; for ( int tt = 0 ; tt < T ; tt ++ ) { int a = fs . nextInt ( ) , b = fs . nextInt ( ) ; int best = Integer . MAX_VALUE ; for ( int times = 0 ; times < 30 ; times ++ ) { best = Math . min ( best , times + count ( a , b + times ) ) ; } System . out . println ( best ) ; } } static int count ( int a , int b ) { if ( b == 1 ) return 1_000_000_000 ; int c = 0 ; while ( a != 0 ) { a /= b ; c ++ ; } return c ; } }


import java . util . Scanner ; public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int a = sc . nextInt ( ) , b = sc . nextInt ( ) ; int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i * i <= a ; i ++ ) { if ( b == 1 && i == 0 ) continue ; int count = i ; int c = a ; while ( c > 0 ) { c = c / ( b + i ) ; count ++ ; } ans = Math . min ( ans , count ) ; } System . out . println ( ans ) ; } sc . close ( ) ; } }


import java . util . Scanner ; public class _0672AddandDivide { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; long ans = Long . MAX_VALUE ; long count = 0 ; for ( long i = 0 ; i * i <= a ; i ++ ) { if ( b == 1 && i == 0 ) { continue ; } count = i ; long c = a ; while ( c > 0 ) { c = c / ( b + i ) ; count ++ ; } ans = Math . min ( ans , count ) ; } System . out . println ( ans ) ; t -- ; } } }


import java . util . Scanner ; public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tt = sc . nextInt ( ) ; while ( tt -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i <= 30 ; i ++ ) { min = Math . min ( min , count ( a , i + b ) + i ) ; } System . out . println ( min ) ; } } public static int count ( int a , int b ) { if ( b == 1 ) return Integer . MAX_VALUE ; int count = 0 ; while ( a > 0 ) { a /= b ; count ++ ; } return count ; } }


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 sc = new FastReader ( ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; while ( x > ( 10 * m ) && ( n > 0 ) ) { x = ( x / 2 ) + 10 ; n -- ; } if ( x > ( 10 * m ) ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } } }

from math import floort = int ( input ( ) )   for i in range ( t ) : hp , va , ls = map ( int , input ( ) . split ( ) )   if hp > 20 : for j in range ( va ) : hp = floor ( hp / 2 ) + 10 if hp <= 20 : break hp -= 10 * ls   if hp <= 0 : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : x , n , m = map ( int , input ( ) . split ( ) ) ans = " NO " i = 1 if x <= 10 * m : ans = " YES " else : while i <= n : k = x // 2 + 10 x = k i += 1 if x <= 10 * m : ans = " YES " print ( ans ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : h , a , l = map ( int , input ( ) . split ( ) ) while a != 0 and h > 0 and h > ( h // 2 + 10 ) : h = h // 2 + 10 a = a - 1 h = h - 10 * l if h <= 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


for i in range ( int ( input ( ) ) ) : x , n , m = map ( int , input ( ) . split ( ) )   while x > 0 and ( x // 2 ) + 10 < x and n : x = ( x // 2 ) + 10 n -= 1   if x <= m * 10 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


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 ) { int x = in . nextInt ( ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; while ( n > 0 && x / 2 + 10 < x ) { n -- ; x = x / 2 + 10 ; } while ( m > 0 ) { m -- ; x -= 10 ; } out . println ( x <= 0 ? " YES " : " NO " ) ; }


import java . util . Scanner ;   public class KDG { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; while ( ( m -- > 0 ) && ( n >= 21 ) ) { n /= 2 ; n += 10 ; } while ( k -- > 0 ) n -= 10 ;   if ( n <= 0 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } sc . close ( ) ; } }


import java . util . Scanner ;   public class CodeForces { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int x = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; while ( n -- > 0 && x != 20 ) { x = Math . min ( x / 2 + 10 , x ) ; } if ( x > 10 * m ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } } }


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


import java . util . ArrayList ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ; import java . util . Set ; import java . util . stream . Collectors ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < a . length ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } List < Integer > eventNums = new ArrayList < > ( ) ; Set < Integer > left = new HashSet < > ( ) ; Set < Integer > entered = new HashSet < > ( ) ; int eventNum = 0 ; for ( int ai : a ) { if ( ai > 0 ) { if ( left . contains ( ai ) || entered . contains ( ai ) ) { System . out . println ( " - 1" ) ; return ; }   entered . add ( ai ) ; } else { if ( ! entered . contains ( - ai ) ) { System . out . println ( " - 1" ) ; return ; }   entered . remove ( - ai ) ; left . add ( - ai ) ; }   eventNum ++ ;   if ( entered . isEmpty ( ) ) { eventNums . add ( eventNum ) ; left . clear ( ) ; entered . clear ( ) ; eventNum = 0 ; } }   if ( eventNum != 0 ) { System . out . println ( " - 1" ) ; return ; }   System . out . println ( eventNums . size ( ) ) ; for ( int i = 0 ; i < eventNums . size ( ) ; i ++ ) System . out . print ( eventNums . get ( i ) + " ▁ " ) ; } }

def modulo ( x ) : if ( x >= 0 ) : return x else : return - xdef verificar_dicionario ( dicionario ) : for valor in dicionario . values ( ) : if ( valor == 0 ) : return False NEW_LINE


def posso_fechar_dia ( d ) : for i in d : if d [ i ] != 0 : return False return True       n = int ( input ( ) ) events = [ int ( i ) for i in input ( ) . split ( ) ]   d = { } errado = Falsecont = 0 cont_dia = 0 eventos_dia = [ ]   for event in events :   cont_dia += 1   if abs ( event ) in d : if d [ abs ( event ) ] == 0 : errado = True break d [ abs ( event ) ] += event if d [ abs ( event ) ] == 0 : if posso_fechar_dia ( d ) : cont += 1 eventos_dia . append ( cont_dia ) cont_dia = 0 d = { } else : errado = True break else : if event < 0 : errado = True break d [ abs ( event ) ] = event if d != { } or errado : print ( - 1 ) else : print ( cont ) for dia in eventos_dia [ : - 1 ] : print ( dia , end = ' ▁ ' ) print ( eventos_dia [ - 1 ] ) NEW_LINE


def resolve ( arr ) : res = [ ] entrou = set ( ) dentro = set ( ) count = 0 for c in arr : if c > 0 : NEW_LINE


import os , sysdef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . split ( ) ) n = int ( input ( ) ) arr = list ( get_ints ( ) ) d = { } ; ans = [ ] ; freq = { } ; ss = set ( ) for i in range ( n ) : e = arr [ i ] if e > 0 : ss . add ( e ) elif - e in ss : ss . remove ( - e ) d [ abs ( e ) ] = d . get ( abs ( e ) , 0 ) + e ; freq [ abs ( e ) ] = freq . get ( abs ( e ) , 0 ) + 1 if d [ abs ( e ) ] < 0 or d [ abs ( e ) ] >= 2 * abs ( e ) or freq [ abs ( e ) ] > 2 : print ( - 1 ) ; exit ( ) if i % 2 == 1 : if len ( ss ) == 0 : ans . append ( 2 * len ( d ) ) ; d = { } ; freq = { } ; ss = set ( ) if d != { } : print ( - 1 ) else : print ( len ( ans ) ) ; print ( * ans )                                     NEW_LINE


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 ;   public void sol ( ) { int n = ni ( ) ; int [ ] ar = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ar [ i ] = ni ( ) ; StringBuilder sb = new StringBuilder ( ) ; int a = 0 , ans = 0 ; ; while ( a < n ) { HashSet < Integer > h = new HashSet < > ( ) , has = new HashSet < > ( ) ; if ( ar [ a ] < 0 ) { pl ( " - 1" ) ; return ; } h . add ( - ar [ a ] ) ; has . add ( ar [ a ] ) ; a ++ ; int p = 1 ; while ( a < n ) { if ( ar [ a ] > 0 ) { h . add ( - ar [ a ] ) ; if ( has . contains ( ar [ a ] ) ) { pl ( " - 1" ) ; return ; } has . add ( ar [ a ] ) ; } else { if ( h . contains ( ar [ a ] ) ) { h . remove ( ar [ a ] ) ; } else { pl ( " - 1" ) ; return ; } } a ++ ; p ++ ; if ( h . size ( ) == 0 ) break ; } sb . append ( p + " ▁ " ) ; ans ++ ; if ( a == n && h . size ( ) != 0 ) { pl ( " - 1" ) ; return ; } } pl ( ans ) ; pl ( sb ) ; }   public static void main ( String [ ] args ) { Main g = new Main ( ) ; g . out = new PrintWriter ( System . out ) ; g . sc = new FastReader ( ) ; int t = 1 ;


import java . io . * ; import java . util . * ; public class Asd { static PrintWriter w = new PrintWriter ( System . out ) ; static FastScanner s = new FastScanner ( ) ; static HashSet < Long > list = new HashSet < > ( ) ; public static void main ( String [ ] args ) {

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


import sys     n , k = map ( int , input ( ) . split ( ) )   if k == 1 : print ( n ) sys . exit ( 0 )   NEW_LINE


import sys n , k = map ( int , input ( ) . split ( ) ) if k == 1 : print ( n ) sys . exit ( 0 ) NEW_LINE


import math   prime = [ 2 , 3 , 5 , 7 , 11 ] ; d = { }   def GeneratePrimes ( ) : for i in range ( 12 , 1010 ) : for j in prime : if i % j == 0 : break if j * j > i : prime . append ( i ) break else : prime . append ( i ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) l = len ( bin ( n ) ) - 2 if k == 1 : print ( n ) else : print ( 2 ** l - 1 )   NEW_LINE


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


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

n = int ( input ( ) ) X = [ ] Y = [ ] for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) X . append ( x ) Y . append ( y ) point = 0 for i in range ( n ) : l = 0 r = 0 u = 0 d = 0 x = X [ i ] y = Y [ i ] for j in range ( n ) : if X [ j ] == x : if Y [ j ] > y : u += 1 if Y [ j ] < y : d += 1 if Y [ j ] == y : if X [ j ] > x : r += 1 if X [ j ] < x : l += 1 if l > 0 and r > 0 and d > 0 and u > 0 : point += 1 print ( point ) NEW_LINE


lst = [ [ * map ( int , input ( ) . split ( ) ) , set ( ) ] for _ in range ( int ( input ( ) ) ) ]   centers = 0 for idx , ( x1 , y1 , s1 ) in enumerate ( lst ) : for idy , ( x2 , y2 , s2 ) in enumerate ( lst ) : if y1 == y2 : if x2 > x1 : s1 . add ( " r " ) s2 . add ( " l " ) elif x2 < x1 : s1 . add ( " l " ) s2 . add ( " r " ) elif x1 == x2 : if y2 < y1 : s1 . add ( " lo " ) s2 . add ( " u " ) elif y2 > y1 : s1 . add ( " u " ) s2 . add ( " lo " ) if len ( s1 ) == 4 : centers += 1 breakprint ( centers ) NEW_LINE


lst = [ [ * map ( int , input ( ) . split ( ) ) ] for _ in range ( int ( input ( ) ) ) ]   centers = 0 for idx , ( x1 , y1 ) in enumerate ( lst ) : s1 = set ( ) for idy , ( x2 , y2 ) in enumerate ( lst ) : if y1 == y2 : if x2 > x1 : s1 . add ( " r " ) elif x2 < x1 : s1 . add ( " l " ) elif x1 == x2 : if y2 < y1 : s1 . add ( " lo " ) elif y2 > y1 : s1 . add ( " u " ) if len ( s1 ) == 4 : centers += 1 breakprint ( centers ) NEW_LINE


n = int ( input ( ) ) list1 = [ ] counter = 0 up = Falsedown = Falseright = Falseleft = Falsefor i in range ( n ) : x = [ int ( x ) for x in input ( ) . split ( ) ] list1 . append ( [ x [ 0 ] , x [ 1 ] ] ) for i in range ( n ) : for e in range ( n ) : if list1 [ i ] [ 0 ] > list1 [ e ] [ 0 ] and list1 [ i ] [ 1 ] == list1 [ e ] [ 1 ] : right = True if list1 [ i ] [ 0 ] < list1 [ e ] [ 0 ] and list1 [ i ] [ 1 ] == list1 [ e ] [ 1 ] : left = True if list1 [ i ] [ 0 ] == list1 [ e ] [ 0 ] and list1 [ i ] [ 1 ] > list1 [ e ] [ 1 ] : up = True if list1 [ i ] [ 0 ] == list1 [ e ] [ 0 ] and list1 [ i ] [ 1 ] < list1 [ e ] [ 1 ] : down = True if up and right and left and down : counter += 1 up = False down = False right = False left = Falseprint ( counter ) NEW_LINE


import java . util . * ; public class SuperCentral { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int xx [ ] = new int [ n ] ; int yy [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { xx [ i ] = in . nextInt ( ) ; yy [ i ] = in . nextInt ( ) ; } int number = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int xc = xx [ i ] ; int yc = yy [ i ] ; boolean left = false , right = false , upper = false , lower = false ; for ( int j = 0 ; j < n ; j ++ ) { if ( xx [ j ] > xc && yy [ j ] == yc )


import java . util . ArrayList ; import java . util . Scanner ;   public class supercentralpoint { public static void main ( String [ ] args ) { ArrayList < coordinates > al = new ArrayList < > ( ) ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ans = 0 ; for ( int k = 0 ; k < n ; k ++ ) { int xcor = sc . nextInt ( ) ; int ycor = sc . nextInt ( ) ;   coordinates c = new coordinates ( xcor , ycor ) ; al . add ( c ) ;   }   for ( int i = 0 ; i < n ; i ++ ) { int c1 = 0 ; int c2 = 0 ; int c3 = 0 ; int c4 = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( al . get ( i ) . getxcordinate ( ) > al . get ( j ) . getxcordinate ( ) && al . get ( i ) . getycoordinate ( ) == al . get ( j ) . getycoordinate ( ) ) { c1 ++ ; } else if ( al . get ( i ) . getxcordinate ( ) < al . get ( j ) . getxcordinate ( ) && al . get ( i ) . getycoordinate ( ) == al . get ( j ) . getycoordinate ( ) ) { c2 ++ ; } else if ( al . get ( i ) . getxcordinate ( ) == al . get ( j ) . getxcordinate ( ) && al . get ( i ) . getycoordinate ( ) > al . get ( j ) . getycoordinate ( ) ) { c3 ++ ; } else if ( al . get ( i ) . getxcordinate ( ) == al . get ( j ) . getxcordinate ( ) && al . get ( i ) . getycoordinate ( ) < al . get ( j ) . getycoordinate ( ) ) { c4 ++ ; }   }


import java . io . * ; import java . util . * ;   public class _temp2 { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] x = new int [ n ] ; int [ ] y = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { String [ ] st = br . readLine ( ) . split ( " ▁ " ) ; x [ i ] = Integer . parseInt ( st [ 0 ] ) ; y [ i ] = Integer . parseInt ( st [ 1 ] ) ; } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int p = 0 , q = 0 , r = 0 , s = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( i == j ) continue ; if ( x [ j ] > x [ i ] && y [ j ] == y [ i ] ) p = 1 ; if ( x [ j ] < x [ i ] && y [ j ] == y [ i ] ) q = 1 ; if ( y [ j ] < y [ i ] && x [ i ] == x [ j ] ) r = 1 ; if ( y [ j ] > y [ i ] && x [ i ] == x [ j ] ) s = 1 ; } if ( p + q + r + s == 4 ) count ++ ; } System . out . println ( count ) ; } }


import java . io . * ; import java . util . * ;   public class Main { static ArrayList < Integer > factors = new ArrayList < Integer > ( ) ; static ArrayList < Integer > factors2 = new ArrayList < Integer > ( ) ; public static void main ( String [ ] args ) throws Exception { Scanner scan = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; factorization ( scan . nextInt ( ) ) ;

n = int ( input ( ) )   i = 0 while 1 : base = ( '1' * ( i + 1 ) ) + ( '0' * i ) x = int ( base , 2 ) if x > n : break if n % x == 0 : ans = x   i += 1     print ( ans ) NEW_LINE


import mathn = int ( input ( ) ) s = math . log ( n ) / math . log ( 2 ) s = math . ceil ( s ) if n == 1 : print ( 1 ) else : for i in range ( math . ceil ( s / 2 ) , 0 , - 1 ) : k = ( ( 2 ** i ) - 1 ) * ( 2 ** ( i - 1 ) ) if n % k == 0 : print ( k ) break NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main { public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ;   int store [ ] = new int [ 100001 ] ; long i = 1 ; long value = 0 ; while ( value < 100001 ) { value = ( long ) ( ( Math . pow ( 2 , i ) - 1 ) * ( Math . pow ( 2 , i - 1 ) ) ) ; if ( value < 100001 ) store [ ( int ) value ] = 1 ; i ++ ; } TreeSet < Integer > set = new TreeSet < > ( Collections . reverseOrder ( ) ) ; int n = input . nextInt ( ) ; for ( int j = 1 ; j <= Math . sqrt ( n ) ; j ++ ) { if ( n % j == 0 ) { set . add ( j ) ; if ( n / j != j ) { set . add ( n / j ) ; } } } for ( Integer integer : set ) { if ( store [ integer ] == 1 ) { System . out . println ( integer ) ; return ; } } }   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 . Scanner ; import java . util . Arrays ; import java . util . Vector ; import java . util . Collections ;   public class Welcomejava { public static Vector < Integer > divisors ( int n ) { Vector < Integer > v = new Vector < > ( ) ; int i = 1 ; while ( i * i <= n ) { if ( n % i == 0 ) { if ( n / i == i ) { v . add ( i ) ; } else { v . add ( i ) ; v . add ( n / i ) ; } } i ++ ; } return v ; }   public static void main ( String [ ] args ) {


import java . util . * ;   public class CodeForces893B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int count = 0 ; int m = n ; while ( m > 0 ) { m /= 2 ; count ++ ; } count = ( count + 1 ) / 2 ; while ( count >= 0 ) { int c = ( ( int ) Math . pow ( 2 , count ) - 1 ) * ( int ) Math . pow ( 2 , count - 1 ) ; if ( n % c == 0 ) { System . out . println ( c ) ; return ; } count -- ; } } }


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 B893 {   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 java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . LinkedList ; import java . util . Queue ; import java . util . Set ; import java . util . StringTokenizer ; import java . util . TreeMap ; import java . util . TreeSet ;   public class Main { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; TreeMap < Character , Integer > mp = new TreeMap < > ( ) ; Set < Integer > set = new TreeSet < Integer > ( ) ; int n = fs . nextInt ( ) ; String s = fs . next ( ) ; boolean possible = true ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ' ( ' ) cnt ++ ; else cnt -- ; } if ( cnt != 0 ) possible = false ; if ( possible == false ) System . out . println ( - 1 ) ; else { int cnt2 = 0 , len = 0 , ans = 0 ;

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


import bisectimport collectionsimport copyimport functoolsimport heapqimport itertoolsimport mathimport randomimport reimport sysimport timeimport stringfrom typing import * import operatorsys . setrecursionlimit ( 99999 )     def check ( s ) : k = 0 for i in range ( len ( s ) ) : if s [ i ] == " ( " : k += 1 else : k -= 1 if k < 0 : return False return True     def solve ( s ) : if check ( s ) : return 0 if s [ 0 ] == " ( " and s [ - 1 ] == " ) " : return solve ( s [ 1 : len ( s ) - 1 ] ) return len ( s )     n = int ( input ( ) ) s = input ( ) if n & 1 or s . count ( " ( " ) != n // 2 : print ( " - 1" ) else : k = 0 st = 0 ans = 0 for i in range ( len ( s ) ) : if s [ i ] == " ( " : k += 1 else : k -= 1 if k == 0 : ans += solve ( s [ st : i + 1 ] ) st = i + 1 print ( ans ) NEW_LINE


from collections import Counter n = int ( input ( ) ) s = input ( ) a = list ( Counter ( s ) . values ( ) ) if len ( a ) != 2 or len ( set ( a ) ) != 1 : print ( - 1 ) else : NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- != 0 ) { int n = s . nextInt ( ) ; long k = s . nextLong ( ) ; long arr [ ] = new long [ n + 1 ] ; long prefix [ ] = new long [ n + 1 ] ; long sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { arr [ i ] = s . nextLong ( ) ; prefix [ i ] = prefix [ i - 1 ] + arr [ i ] ; sum += arr [ i ] ; } if ( sum <= k ) { System . out . println ( 0 ) ; continue ; } int ans = 0 , total = - 1 ; for ( int i = 1 ; i <= n && prefix [ i - 1 ] <= k ; i ++ ) { int start = i + 1 , end = n ; int as = start ; while ( start <= end ) { int mid = ( start + end ) / 2 ; if ( prefix [ mid ] - arr [ i ] <= k ) { as = mid ; start = mid + 1 ; } else { end = mid - 1 ; } }

t = int ( input ( ) ) for i in range ( t ) : n , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) q = sum ( l ) if ( q <= k ) : print ( 0 ) else : s = 0 j = 0 while ( s <= k ) : s = s + l [ j ] j = j + 1 print ( l . index ( max ( l [ : j ] ) ) + 1 ) NEW_LINE


for t in range ( int ( input ( ) ) ) : n , t = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) id = 0 for i in range ( n ) : if a [ i ] > a [ id ] : id = i t -= a [ i ] if t < 0 : break   if t >= 0 : id = - 1 print ( id + 1 ) NEW_LINE


def solve ( ) : n , s = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) k = 0 i = 0 lis = [ ] while 1 : NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n , T = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if sum ( a ) <= T : print ( 0 ) else : mx = - 1 idx = - 1 s = 0 for i in range ( n ) : s += a [ i ] if mx < a [ i ] : mx = a [ i ] if s - mx <= T : idx = i + 1 else : break print ( idx )                                                                                NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n , s = map ( int , input ( ) . split ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] summa = 0 largest = - 1 largest_i = 0 for i in range ( len ( a ) ) : summa += a [ i ] if largest < a [ i ] : largest = a [ i ] largest_i = i   if summa > s : break   if summa <= s : print ( 0 ) else : print ( largest_i + 1 ) NEW_LINE


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 . * ; import java . util . * ;   public class B { static class Reader { BufferedReader in ;   Reader ( ) throws IOException { in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   Reader ( String name ) throws IOException { in = new BufferedReader ( new FileReader ( name ) ) ; }   StringTokenizer tokin = new StringTokenizer ( " " ) ;   String next ( ) throws IOException { while ( ! tokin . hasMoreTokens ( ) ) { tokin = new StringTokenizer ( in . readLine ( ) ) ; } return tokin . nextToken ( ) ; }   int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } }   static class Writer { PrintWriter cout ;   Writer ( ) throws IOException { cout = new PrintWriter ( System . out ) ; }   Writer ( String name ) throws IOException { cout = new PrintWriter ( new FileWriter ( name ) ) ; }   StringBuilder out = new StringBuilder ( ) ;   void print ( Object a ) { out . append ( a ) ; }   void close ( ) { cout . print ( out . toString ( ) ) ; cout . close ( ) ; } }   public static void main ( String args [ ] ) throws IOException { Reader in = new Reader ( ) ; Writer out = new Writer ( ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int a [ ] [ ] = new int [ n ] [ 3 ] ; int b [ ] [ ] = new int [ n ] [ 4 ] ; int c [ ] [ ] = new int [ n ] [ 3 ] ;

n , k = map ( int , input ( ) . split ( ) ) a = [ 0 ] * ncnt = [ 0 ] * 3 ans = 0 for i in range ( n ) : a [ i ] = list ( input ( ) ) + [ 0 ] for j in range ( 12 ) : if a [ i ] [ j ] == ' . ' : a [ i ] [ j ] = 0 if a [ i ] [ j - 1 ] == ' S ' : a [ i ] [ j ] += 1 if a [ i ] [ j + 1 ] == ' S ' : a [ i ] [ j ] += 1 cnt [ a [ i ] [ j ] ] += 1 elif a [ i ] [ j ] == ' S ' : if a [ i ] [ j - 1 ] == ' P ' or a [ i ] [ j - 1 ] == ' S ' : ans += 1 if a [ i ] [ j + 1 ] == ' P ' or a [ i ] [ j + 1 ] == ' S ' : ans += 1 for i in range ( 3 ) : c = min ( cnt [ i ] , k ) k -= c ans += i * c cnt [ i ] = cprint ( ans ) for i in range ( n ) : for j in range ( 12 ) : if type ( a [ i ] [ j ] ) == int : if cnt [ a [ i ] [ j ] ] > 0 : cnt [ a [ i ] [ j ] ] -= 1 a [ i ] [ j ] = ' x ' else : a [ i ] [ j ] = ' . ' print ( ' ' . join ( a [ i ] [ : - 1 ] ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) passe = [ input ( ) . replace ( ' . ' , '0' ) for i in range ( n ) ]   for i in range ( n ) : for j in range ( 12 ) : if passe [ i ] [ j ] == '0' : if ( j - 1 >= 0 ) and ( passe [ i ] [ j - 1 ] == ' S ' ) : passe [ i ] = passe [ i ] [ : j ] + str ( int ( passe [ i ] [ j ] ) + 1 ) + passe [ i ] [ j + 1 : ] if ( j + 1 <= 11 ) and ( passe [ i ] [ j + 1 ] == ' S ' ) : passe [ i ] = passe [ i ] [ : j ] + str ( int ( passe [ i ] [ j ] ) + 1 ) + passe [ i ] [ j + 1 : ]   count = 0   for p in range ( 3 ) : for i in range ( n ) : for j in range ( 12 ) : if passe [ i ] [ j ] == str ( p ) and count < k : passe [ i ] = passe [ i ] [ : j ] + ' x ' + passe [ i ] [ j + 1 : ] count += 1 count = 0   passe = [ passe [ i ] . replace ( '1' , ' . ' ) . replace ( '2' , ' . ' ) . replace ( '0' , ' . ' ) for i in range ( n ) ]   for i in range ( n ) : for j in range ( 12 ) : if passe [ i ] [ j ] == ' S ' : if j - 1 >= 0 : if passe [ i ] [ j - 1 ] not in ' . - ' : count += 1 if j + 1 <= 11 : if passe [ i ] [ j + 1 ] not in ' . - ' : count += 1   print ( count ) [ print ( passe [ i ] ) for i in range ( n ) ] NEW_LINE


def Neigh ( g , i , typ ) : neigh = 0 if ( i > 0 and X [ g ] [ i - 1 ] == typ ) : neigh += 1 if ( i < 11 and X [ g ] [ i + 1 ] == typ ) : neigh += 1 return neighn , pas = map ( int , input ( ) . split ( ) ) X = [ ] for i in range ( n ) : X . append ( list ( input ( ) ) ) for i in range ( n ) : for g in range ( 12 ) : if ( X [ i ] [ g ] == ' . ' ) : X [ i ] [ g ] = Neigh ( i , g , ' S ' ) m = 0 while ( pas > 0 ) : for i in range ( n ) : for g in range ( 12 ) : if ( X [ i ] [ g ] == m ) : X [ i ] [ g ] = ' x ' pas -= 1 if ( pas == 0 ) : break if ( pas == 0 ) : break if ( pas == 0 ) : break m += 1 sosedy = 0 for i in range ( n ) : for g in range ( 12 ) : if ( X [ i ] [ g ] == ' S ' ) : sosedy += Neigh ( i , g , ' S ' ) sosedy += Neigh ( i , g , ' P ' ) sosedy += Neigh ( i , g , ' x ' ) if ( type ( X [ i ] [ g ] ) == type ( 1 ) ) : X [ i ] [ g ] = ' . ' print ( sosedy ) for i in range ( len ( X ) ) : print ( ' ' . join ( X [ i ] ) )                         NEW_LINE


import java . util . Scanner ; import java . util . Stack ;   public class Main { private static final char STATUS_PASSENGER = ' S ' ; private static final char PASSENGER = ' P ' ; private static final char EMPTY_SEAT = ' . ' ; private static final char SEATED_PASSENGER = ' x ' ;   private static final int SYMBOLS_IN_A_ROW = 12 ;   public static void main ( final String [ ] args ) { final Scanner scanner = new Scanner ( System . in ) ; final int rowsInPlane = scanner . nextInt ( ) ; int passengersToSeat = scanner . nextInt ( ) ;   int statusPassengersNeighbours = 0 ;


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


import java . util . Scanner ;   public class _0844InitialBet {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int c1 = sc . nextInt ( ) ; int c2 = sc . nextInt ( ) ; int c3 = sc . nextInt ( ) ; int c4 = sc . nextInt ( ) ; int c5 = sc . nextInt ( ) ; int sum = c1 + c2 + c3 + c4 + c5 ; if ( sum % 5 == 0 && sum != 0 ) { System . out . println ( sum / 5 ) ; } else { System . out . println ( - 1 ) ; } }   }

inp = input ( ) nums = [ int ( i ) for i in inp . split ( ) ] temp = sum ( nums ) if temp == 0 : print ( ' - 1' ) elif temp % len ( nums ) == 0 : print ( int ( temp / len ( nums ) ) ) else : print ( ' - 1' )       NEW_LINE


L = [ int ( X ) for X in input ( ) . split ( ) ] S = sum ( L ) if S == 0 : print ( - 1 ) else : if S % 5 == 0 : print ( S // 5 ) else : print ( - 1 ) NEW_LINE


x = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( x ) if s % 5 == 0 and s / 5 != 0 : print ( int ( s / 5 ) ) else : print ( - 1 ) NEW_LINE


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int c [ ] = new int [ 5 ] ; for ( int i = 0 ; i < 5 ; i ++ ) { c [ i ] = sc . nextInt ( ) ; } int sum = 0 ; for ( int x : c ) { sum += x ; } if ( sum % 5 != 0 || sum == 0 ) { System . out . println ( - 1 ) ; } else { System . out . println ( sum / 5 ) ; } }   }


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


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


# include < bits / stdc ++ . h > using namespace std ; const int N = 1e6 + 100 ; typedef long long LL ; # define debug ( x ) cout << " debug ▁ : ▁ " << x << endl ;

n , m = [ int ( j ) for j in input ( ) . split ( ) ] adj = [ set ( ) for i in range ( n ) ] for i in range ( m ) : l , r = [ int ( j ) - 1 for j in input ( ) . split ( ) ] adj [ l ] . add ( r ) adj [ r ] . add ( l ) if n < 7 : print ( m ) else : deg = 1e12 for i in range ( n ) : for j in range ( i + 1 , n ) : l = adj [ i ] . intersection ( adj [ j ] ) NEW_LINE


n , m = [ int ( j ) for j in input ( ) . split ( ) ] adj = [ set ( ) for i in range ( n ) ] for i in range ( m ) : l , r = [ int ( j ) - 1 for j in input ( ) . split ( ) ] adj [ l ] . add ( r ) adj [ r ] . add ( l ) if n < 7 : print ( m ) else : deg = 10 ** 12 for i in range ( n ) : for j in range ( i + 1 , n ) : l = adj [ i ] . intersection ( adj [ j ] ) tmp = len ( l ) if tmp < deg : deg = tmp print ( m - deg ) NEW_LINE


import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; import java . io . * ; import java . math . * ; public class Main { InputStream is ; PrintWriter out ; String INPUT = " " ;


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . util . ArrayList ; import java . util . Random ; import java . util . StringTokenizer ;   public class DifferentRules { static final int MAXN = 1000_006 ; static final long MOD = ( long ) 1e9 + 7 ; public static void main ( String [ ] args ) throws IOException { MyScanner s = new MyScanner ( ) ; Print p = new Print ( ) ; int t = s . nextInt ( ) ; while ( t -- > 0 ) { int n = s . nextInt ( ) ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; int max = Math . max ( 1 , Math . min ( n , x + y - n + 1 ) ) ; int min = Math . min ( n , x + y - 1 ) ; p . println ( ( max ) + " ▁ " + min ) ; } p . close ( ) ; } public static class Pair implements Comparable < Pair > { int first ; int second ; public Pair ( int a , int b ) { this . first = a ; this . second = b ; } @ Override public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = prime * result + first ; result = prime * result + second ; return result ; } @ Override public boolean equals ( Object obj ) { if ( this == obj ) return true ; if ( obj == null ) return false ; if ( getClass ( ) != obj . getClass ( ) ) return false ; Pair other = ( Pair ) obj ; if ( first != other . first ) return false ; if ( second != other . second ) return false ; return true ; } @ Override public int compareTo ( Pair o ) {

for _ in range ( int ( input ( ) ) ) : n , x , y = map ( int , input ( ) . split ( ) )   print ( max ( 1 , min ( n , x + y - n + 1 ) ) , min ( n , x + y - 1 ) ) NEW_LINE


import sys , os , iodef rs ( ) : return sys . stdin . readline ( ) . rstrip ( ) def ri ( ) : return int ( sys . stdin . readline ( ) ) def ria ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def ws ( s ) : sys . stdout . write ( s + ' \n ' ) def wi ( n ) : sys . stdout . write ( str ( n ) + ' \n ' ) def wia ( a ) : sys . stdout . write ( ' ▁ ' . join ( [ str ( x ) for x in a ] ) + ' \n ' ) import math , datetime , functools , itertools , operator , bisect , fractions , statisticsfrom collections import deque , defaultdict , OrderedDict , Counterfrom fractions import Fractionfrom decimal import Decimalfrom sys import stdoutfrom heapq import heappush , heappop , heapify , _heapify_max , _heappop_max , nsmallest , nlargest     def main ( ) : NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , x , y = map ( int , input ( ) . split ( ) ) print ( max ( 1 , min ( n , x + y - n + 1 ) ) , min ( n , x + y - 1 ) ) NEW_LINE


t = int ( input ( ) ) arr_1 = [ ] arr_2 = [ ] for x in range ( t ) : n , x , y = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) arr_1 . append ( max ( 1 , min ( n , x + y - n + 1 ) ) ) arr_2 . append ( min ( n , x + y - 1 ) ) for x in range ( t ) : print ( arr_1 [ x ] , arr_2 [ x ] ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;     public class C {   private static long INF = 2000000000000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   long n = sc . nextLong ( ) , x = sc . nextLong ( ) , y = sc . nextLong ( ) ; long val = ( x + y ) - n ; long max = - 1 ; if ( val <= 0 ) max = 1 ; else max = min ( n , val + 1 ) ; long min = - 1 ; val = min ( n - x , y - 1 ) ; min = val ; min += x ; System . out . println ( max + " ▁ " + min ) ;   }


import java . io . * ; import java . lang . Math ; import java . util . * ;   public class Main {   public BufferedReader in ; public PrintStream out ;   public boolean log_enabled = false ; public boolean multiply_tests = true ;   public static boolean do_gen_test = false ; public void gen_test ( ) { } private class TestCase {   public Object solve ( ) { int n = readInt ( ) , x = readInt ( ) , y = readInt ( ) ; int i , j , max = 0 ; if ( x + y < n + 1 ) { max = 1 ; } else if ( x + y >= 2 * n - 1 ) { max = n ; } else { max = x + y - ( n - 1 ) ; } int min = 0 ; if ( x + y == 2 ) { min = 1 ; } else if ( x + y == 3 ) { min = 2 ; } else if ( x + y >= n + 1 ) { min = n ; } else { min = x + y - 1 ; } return strf ( " % d ▁ % d " , max , min ) ;


import java . util . * ; import java . io . * ; public class Main { static int [ ] A ;


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; int neg = 0 ; int pos = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] == - 1 ) { neg ++ ; } else { pos ++ ; } } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; int k = r - l + 1 ; sb . append ( ( r - l + 1 ) % 2 == 0 && ( r - l + 1 ) / 2 <= neg && ( r - l + 1 ) / 2 <= pos ? 1 : 0 ) ; sb . append ( ' \n ' ) ;

I = lambda : map ( int , input ( ) . split ( ) ) n , m = I ( ) arr = I ( ) one , m_one = 0 , 0 for i in arr : if i == - 1 : m_one += 1 else : one += 1 arr = [ ] for i in range ( m ) : l , r = I ( ) temp = r - l + 1 if temp % 2 == 0 and one >= temp // 2 and m_one >= temp // 2 : arr . append ( 1 ) else : arr . append ( 0 ) print ( * arr ) NEW_LINE


from sys import stdin   n , m = map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) arr = list ( map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) ) a , b = arr . count ( - 1 ) , arr . count ( 1 )   for i in range ( m ) : l , r = map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) d = r - l + 1 if d % 2 == 0 : print ( 1 if min ( a , b ) >= d // 2 else 0 ) else : print ( 0 ) NEW_LINE


from collections import Counter   num , cases = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) count = Counter ( arr ) minus = count [ - 1 ] plus = count [ 1 ] mn = min ( plus , minus ) ans = [ ] while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) )   if ( b - a + 1 ) % 2 != 0 : ans . append ( 0 ) elif ( b - a + 1 ) // 2 <= mn : ans . append ( 1 ) else : ans . append ( 0 )   print ( * ans )     NEW_LINE


from collections import Counter   num , cases = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) count = Counter ( arr ) minus = count [ - 1 ] plus = count [ 1 ] mn = min ( plus , minus ) ans = [ ] mat = [ ] while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) ) mat . append ( ( a , b ) ) for a , b in mat : if ( b - a + 1 ) % 2 != 0 : ans . append ( 0 ) elif ( b - a + 1 ) // 2 <= mn : ans . append ( 1 ) else : ans . append ( 0 )   print ( * ans )   NEW_LINE


from collections import Counter   num , cases = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) count = Counter ( arr ) minus = count [ - 1 ] plus = count [ 1 ] mn = min ( plus , minus ) ans = [ ] mat = [ ] while cases : cases -= 1 a , b = map ( int , input ( ) . split ( ) ) mat . append ( ( a , b ) ) for a , b in mat : if ( b - a + 1 ) % 2 != 0 : print ( 0 ) elif ( b - a + 1 ) // 2 <= mn : print ( 1 ) else : print ( 0 )     NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; ArrayList < Integer > pos = new ArrayList < Integer > ( ) ; ArrayList < Integer > neg = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x == 1 ) pos . add ( x ) ; else neg . add ( x ) ; } StringBuilder sb = new StringBuilder ( ) ; while ( m -- > 0 ) { int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; if ( ( r - l + 1 ) % 2 == 0 && pos . size ( ) >= ( r - l + 1 ) / 2 && neg . size ( ) >= ( r - l + 1 ) / 2 ) sb . append ( 1 + " \n " ) ; else sb . append ( 0 + " \n " ) ; } System . out . println ( sb ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int c1 = 0 , c0 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x == 1 ) c1 ++ ; else c0 ++ ; } StringBuilder sb = new StringBuilder ( ) ; while ( m -- > 0 ) { int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; if ( ( r - l + 1 ) % 2 == 0 && c1 >= ( r - l + 1 ) / 2 && c0 >= ( r - l + 1 ) / 2 ) sb . append ( 1 + " \n " ) ; else sb . append ( 0 + " \n " ) ; } System . out . println ( sb ) ; } }


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


def main ( ) : from bisect import bisect n , A , cf , cm , m = map ( int , input ( ) . split ( ) ) skills = list ( map ( int , input ( ) . split ( ) ) ) xlat = sorted ( range ( n ) , key = skills . __getitem__ ) sorted_skills = [ skills [ _ ] for _ in xlat ] bottom_lift , a , c = [ ] , 0 , 0 for i , b in enumerate ( sorted_skills ) : c += i * ( b - a ) bottom_lift . append ( c ) a = b root_lift , a = [ 0 ] , 0 for b in reversed ( sorted_skills ) : a += A - b root_lift . append ( a ) max_level = - 1 for A_width , a in enumerate ( root_lift ) : if m < a : break money_left = m - a floor_width = bisect ( bottom_lift , money_left ) if floor_width > n - A_width : floor_width = n - A_width money_left -= bottom_lift [ floor_width - 1 ] if floor_width > 0 : floor = sorted_skills [ floor_width - 1 ] + money_left

n , A , cf , cm , mN = map ( int , input ( ) . split ( ) )   a = list ( map ( int , input ( ) . split ( ) ) ) aCOPY = [ ] for elem in a : aCOPY . append ( elem ) a . sort ( )   aPartialSum = [ 0 ]   for elem in a : aPartialSum . append ( aPartialSum [ - 1 ] + elem )   maxScore = 0 ansMAXIBound = 0 ansMAXI = 0 ansMIN = 0 for MAXI in range ( n + 1 ) : currentScore = cf * MAXI if MAXI >= 1 : mN -= ( A - a [ - MAXI ] ) if mN < 0 : break if MAXI == n : maxScore = currentScore + A * cm ansMAXIBound = 0 ansMAXI = 10 ** 10 ansMIN = 0 NEW_LINE


f = lambda : map ( int , input ( ) . split ( ) ) g = lambda : m - l * p [ l - 1 ] + s [ l ]   n , A , x , y , m = f ( ) t = sorted ( ( q , i ) for i , q in enumerate ( f ( ) ) ) p = [ q for q , i in t ] s = [ 0 ] * ( n + 1 ) for j in range ( n ) : s [ j + 1 ] = p [ j ] + s [ j ]   l = r = nF = L = R = B = - 1 while 1 : if p : while l > r or g ( ) < 0 : l -= 1 b = min ( p [ l - 1 ] + g ( ) // l , A ) else : b , l = A , 0   f = x * ( n - r ) + y * b if F < f : F , L , R , B = f , l , r , b   if not p : break m += p . pop ( ) - A r -= 1 if m < 0 : break   print ( F )   p = [ ( i , B if j < L else q if j < R else A ) for j , ( q , i ) in enumerate ( t ) ] for i , q in sorted ( p ) : print ( q ) NEW_LINE


def main ( ) : from bisect import bisect n , A , cf , cm , m = map ( int , input ( ) . split ( ) ) skills = list ( map ( int , input ( ) . split ( ) ) ) xlat = sorted ( range ( n ) , key = skills . __getitem__ ) sorted_skills = [ skills [ _ ] for _ in xlat ] bottom_lift , a , c = [ ] , 0 , 0 for i , b in enumerate ( sorted_skills ) : c += i * ( b - a ) bottom_lift . append ( c ) a = b root_lift , a = [ 0 ] , 0 for b in reversed ( sorted_skills ) : a += A - b root_lift . append ( a ) max_level = - 1 for A_width , a in enumerate ( root_lift ) : if m < a : break money_left = m - a floor_width = bisect ( bottom_lift , money_left ) if floor_width > n - A_width : floor_width = n - A_width money_left -= bottom_lift [ floor_width - 1 ] if floor_width > 0 : floor = sorted_skills [ floor_width - 1 ] + money_left // floor_width if floor > A : floor = A else : floor = A level = cf * A_width + cm * floor if max_level < level : max_level , save = level , ( A_width , floor , floor_width ) A_width , floor , floor_width = save for id in xlat [ : floor_width ] : skills [ id ] = floor for id in xlat [ n - A_width : ] : skills [ id ] = A print ( max_level ) print ( ' ▁ ' . join ( map ( str , skills ) ) )     if __name__ == ' _ _ main _ _ ' : main ( )         NEW_LINE


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

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE arr = [ 1 , 1 ] + [ 0 ] * ( n - 2 ) NEW_LINE arr = arr + arr NEW_LINE for i in range ( n ) : for NEW_LINE j in range ( i , n + i ) : print ( arr [ j ] , end = ' ▁ ' ) NEW_LINE print ( ) NEW_LINE


def isPrime ( n ) :     NEW_LINE if n <= 1 : return False NEW_LINE if n <= 3 : return True   if n % 2 == 0 or n % 3 == 0 : return False   i = 5 NEW_LINE while i * i <= n : if NEW_LINE n % i == 0 or n % ( i + 2 ) == 0 : NEW_LINE return False NEW_LINE i = i + 6 NEW_LINE return True     t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE lst = [ ] NEW_LINE


for i in range ( int ( input ( ) ) ) : num = int ( input ( ) ) NEW_LINE a = [ 0 for j in range ( num - 2 ) ] NEW_LINE a . append ( 1 ) NEW_LINE a . append ( 4 ) NEW_LINE for k in range ( num ) : print ( * a ) NEW_LINE a . append ( a [ 0 ] ) NEW_LINE a . pop ( 0 ) NEW_LINE


import mathfor NEW_LINE _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE if n % 2 == 0 : for NEW_LINE i in range ( n ) : NEW_LINE for j in range ( n ) : if NEW_LINE i == j or i + j == n - 1 : print ( 1 , end = " ▁ " ) else : print ( 0 , end = " ▁ " ) NEW_LINE print ( ) else : for i in range ( n ) : for NEW_LINE j in range ( n ) : NEW_LINE if i == j or i + j == n - 1 : NEW_LINE INDENT print ( 1 , end = " ▁ " ) elif i == 0 and j == n // 2 or j == n - 1 and i == n // 2 : NEW_LINE print ( 1 , end = " ▁ " ) else : NEW_LINE print ( 0 , end = " ▁ " ) NEW_LINE DEDENT print ( ) NEW_LINE


cases = int ( input ( ) ) NEW_LINE while cases : cases -= 1 NEW_LINE num = int ( input ( ) )   matrix = [ [ 0 for i in range ( num ) ] for j in range ( num ) ] NEW_LINE matrix [ 0 ] [ 0 ] = 1 NEW_LINE for i in range ( 1 , num ) : matrix [ i ] [ i ] = 1 NEW_LINE matrix [ i - 1 ] [ i ] = 1 NEW_LINE matrix [ i ] [ i - 1 ] = 1   for i in matrix : print ( * i )   NEW_LINE


import java . util . Scanner ;   public class B1436 {   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 ( ) ;


import java . util . Scanner ; public class Task6 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int tt ; tt = Integer . parseInt ( scanner . nextLine ( ) ) ; while ( ( tt -- ) != 0 ) { int n ; n = Integer . parseInt ( scanner . nextLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( i == j || j == ( i + 1 ) % n ) { System . out . print ( 1 ) ; System . out . print ( " ▁ " ) ; } else { System . out . print ( 0 ) ; System . out . print ( " ▁ " ) ; } } System . out . print ( " \n " ) ; } } } }


import java . util . Scanner ;   public class Vsa {   public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ;   int n , m , k ; n = in . nextInt ( ) ; m = in . nextInt ( ) ; k = in . nextInt ( ) ;   boolean b = m >= n && k >= n ; System . out . println ( ( b ) ? " YES " : " NO " ) ;   } }


n , m , k = ( int ( i ) for i in input ( ) . split ( ) ) if ( m >= n and k >= n ) : print ( " Yes " ) else : print ( " No " ) NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) if m >= n and k >= n : print ( ' Yes ' ) else : print ( ' No ' ) NEW_LINE


x , y , z = map ( int , input ( ) . split ( ) ) if y >= x and z >= x : print ( " YES " ) else : print ( " NO " ) NEW_LINE


x , y , z = map ( int , input ( ) . split ( ) ) if y >= x and z >= x : print ( " Yes " ) else : print ( " No " ) NEW_LINE


import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; if ( m >= n & k >= n ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }


import java . util . Scanner ;   public class VusTheCossackAndContest {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; if ( x > y || x > z ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } }


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , m , k ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ; k = sc . nextInt ( ) ; if ( ( n <= m ) && ( n <= k ) ) { System . out . println ( " yes " ) ; } else System . out . println ( " No " ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int k = s . nextInt ( ) ; String ans = Math . min ( m , k ) >= n ? " YES " : " NO " ; System . out . println ( ans ) ; } }


import javax . swing . plaf . basic . BasicInternalFrameTitlePane ; import java . nio . file . LinkOption ; import java . util . * ; public class Example { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) i = a . index ( max ( a ) ) if a [ : i ] == sorted ( a [ : i ] ) and a [ i : ] == sorted ( a [ i : ] , reverse = True ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) q = 0 for i in range ( 1 , n - 1 ) : if a [ i ] < a [ i - 1 ] and a [ i ] < a [ i + 1 ] : q = 1 print ( ' NO ' ) breakif q == 0 : print ( ' YES ' ) NEW_LINE


from math import ceil , floorfrom collections import defaultdict for _ in range ( 1 ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) arr = [ [ a [ i ] , i ] for i in range ( n ) ] arr . sort ( ) flag = True x = arr [ - 1 ] [ 1 ] l = 0 r = 0 if n > 1 and abs ( x - arr [ - 2 ] [ 1 ] ) > 1 : flag = False print ( ' NO ' ) else : for i in range ( n - 2 , - 1 , - 1 ) : if arr [ i ] [ 1 ] > x and abs ( x - ( arr [ i ] [ 1 ] - r ) ) > 1 : print ( ' NO ' ) flag = False break elif arr [ i ] [ 1 ] < x and abs ( x - ( arr [ i ] [ 1 ] + l ) ) > 1 : print ( ' NO ' ) flag = False break elif arr [ i ] [ 1 ] > x : r += 1 elif arr [ i ] [ 1 ] < x : l += 1 if flag : print ( ' YES ' ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if len ( set ( a ) ) == n : idx = a . index ( max ( a ) ) test = 0 for i in range ( 0 , idx ) : if i == 0 : continue else : if a [ i ] < a [ i - 1 ] : test = 1 break for i in range ( idx + 1 , n ) : if i == idx + 1 : continue else : if a [ i ] > a [ i - 1 ] : test = 1 break if test : print ( ' NO ' ) else : print ( ' YES ' )                                                                                else : print ( ' NO ' ) NEW_LINE


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; int index = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; if ( ar [ i ] == n ) { index = i ; } }


import java . util . Scanner ;   public class _0694Pillars {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int pos = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; if ( arr [ i ] == n ) pos = i ; } int left = pos - 1 ; int right = pos + 1 ; boolean flag = true ; int val = n - 1 ; while ( ( left >= 0 || right < n ) && n >= 1 ) {


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int maxi = 0 , max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] > max ) { maxi = i ; max = a [ i ] ; } } boolean f = true ; for ( int i = maxi - 1 , j = maxi + 1 ; i >= 0 || j < n ; i -- , j ++ ) { if ( i >= 0 && a [ i ] > a [ i + 1 ] ) { f = false ; break ; } if ( j < n && a [ j ] > a [ j - 1 ] ) { f = false ; break ; } } if ( f ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } }


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int arr [ ] = new int [ n ] ; int max = - 1 , index = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = s . nextInt ( ) ; if ( arr [ i ] > max ) { max = arr [ i ] ; index = i ; } } for ( int i = 0 ; i < index ; i ++ ) { if ( arr [ i ] >= arr [ i + 1 ] ) { System . out . println ( " NO " ) ; return ; } } for ( int i = index + 1 ; i < n ; i ++ ) { if ( arr [ i ] >= arr [ i - 1 ] ) { System . out . println ( " NO " ) ; return ; } } System . out . println ( " YES " ) ; } }


import java . util . * ; import java . io . * ; import java . math . BigInteger ; public class cf1 { static long mod = ( long ) 1e9 + 7 ; static long mod1 = 998244353 ; static FastScanner f ; static PrintWriter pw = new PrintWriter ( System . out ) ; static Scanner S = new Scanner ( System . in ) ; static long x0 ; static long y0 ; static int inf = ( int ) ( 1e9 ) + 5 ; static long oo = Long . MAX_VALUE ; static double eps = ( double ) 1e-4 ;   public static class Query { int l , r ; long d ; public Query ( int l , int r , long d ) { this . l = l ; this . r = r ; this . d = d ; } }   public static void solve ( ) { int n = f . ni ( ) ; int m = f . ni ( ) ; int k = f . ni ( ) ;   long arr [ ] = new long [ n ] ; long dp [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { arr [ i ] = f . nl ( ) ;

import sys   n , m , k = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] arr = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ]   delta = [ ] delta . append ( arr [ 0 ] ) for i in range ( 1 , n ) : delta . append ( arr [ i ] - arr [ i - 1 ] )   ops = [ ]   for i in range ( m ) : l , r , d = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] op = ( l , r , d ) ops . append ( op )   num_calls = [ 0 ] * mfor i in range ( k ) : x , y = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] num_calls [ x - 1 ] += 1 if y < len ( num_calls ) : num_calls [ y ] -= 1     calls = 0 for o in range ( m ) : calls += num_calls [ o ] op = ops [ o ] l = op [ 0 ] r = op [ 1 ] d = op [ 2 ] c = calls * d delta [ l - 1 ] += c if r < len ( delta ) : delta [ r ] -= c o += 1   arr [ 0 ] = delta [ 0 ] for i in range ( 1 , n ) : arr [ i ] = delta [ i ] + arr [ i - 1 ] print ( ' ▁ ' . join ( str ( x ) for x in arr ) ) NEW_LINE


maxn = 1e5 n , m , k = input ( ) . split ( ' ▁ ' ) ; n = int ( n ) ; m = int ( m ) ; k = int ( k ) NEW_LINE


// Motto : - Fail early , Fail Often , Fail Forward . // while ( true ) // { // if ( AC ) // { // break ; // } // else if ( Contest Over ) // { // Try . // Check out Editorial . // Understand . // Find out your Mistake . // Learn the topic ( if new ) . // Solve Problems on that topic ( if new ) . // Upsolve that problem . // break ; // } // else // { // Try . // Use Pen - Paper . // Find errors , edge cases , etc . // continue ; // } // } NEW_LINE


import sys   n , m , k = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] arr = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ]   delta = [ ] delta . append ( arr [ 0 ] ) for i in range ( 1 , n ) : delta . append ( arr [ i ] - arr [ i - 1 ] )   ops = [ ]   for i in range ( m ) : l , r , d = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] op = ( l , r , d ) ops . append ( op )   num_calls = [ 0 ] * mfor i in range ( k ) : x , y = [ int ( x ) for x in sys . stdin . readline ( ) . strip ( ) . split ( " ▁ " ) ] num_calls [ x - 1 ] += 1 if y < len ( num_calls ) : num_calls [ y ] -= 1     NEW_LINE


import java . io . * ; import java . util . * ;   import static java . lang . Math . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastReader in = new FastReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = in . nextInt ( ) , m = in . nextInt ( ) , k = in . nextInt ( ) ; long [ ] arr = new long [ n + 5 ] ; tuple [ ] update = new tuple [ m + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { arr [ i ] = in . nextLong ( ) ; } for ( int i = 1 ; i <= m ; i ++ ) { update [ i ] = new tuple ( in . nextInt ( ) , in . nextInt ( ) , in . nextLong ( ) ) ; } int [ ] mark = new int [ m + 5 ] ; for ( int i = 1 ; i <= k ; i ++ ) { int x = in . nextInt ( ) , y = in . nextInt ( ) ; mark [ x ] ++ ; mark [ y + 1 ] -- ; } for ( int i = 1 ; i <= m ; i ++ ) mark [ i ] += mark [ i - 1 ] ; for ( int i = 1 ; i <= m ; i ++ ) { update [ i ] = new tuple ( update [ i ] . l , update [ i ] . r , update [ i ] . d * mark [ i ] ) ; } long [ ] res = solve ( arr , n , m , update ) ; for ( int i = 0 ; i < n ; i ++ ) pw . print ( res [ i ] + " ▁ " ) ; pw . println ( ) ;


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

a , = map ( int , input ( ) . split ( ) ) if a == 2 : print ( 2 ) else : print ( 1 ) NEW_LINE


print ( 1 if int ( input ( ) ) != 2 else 2 ) NEW_LINE


v = int ( input ( ) ) if v == 2 : print ( "2" ) else : print ( "1" ) NEW_LINE


num = int ( input ( ) ) if num == 2 : print ( "2" ) else : print ( "1" ) NEW_LINE


T_ON = 0 DEBUG_ON = 1 MOD = 998244353     def solve ( ) : n = read_int ( ) if n <= 2 : print ( n ) else : print ( 1 )     def main ( ) : T = read_int ( ) if T_ON else 1 for i in range ( T ) : solve ( )     def debug ( * xargs ) : if DEBUG_ON : print ( * xargs )     from collections import * import math     NEW_LINE


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 t , n ; t = sc . nextInt ( ) ; if ( t < 3 ) System . out . println ( t ) ; else System . out . println ( 1 ) ; } catch ( Exception e ) { } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class DefiniteGame { 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 ( 1 , in , out ) ; out . close ( ) ; }   static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int n = in . nextInt ( ) ; if ( n != 2 ) n = 1 ; out . println ( n ) ; } }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public 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 ( ) ) ; }   } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class DefiniteGame { 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 ( 1 , in , out ) ; out . close ( ) ; }   static class Task { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int n = in . nextInt ( ) ; boolean pos = true ; while ( pos ) { pos = false ; for ( int i = n - 1 ; i >= 2 ; i -- ) { if ( n % i != 0 ) { n -= i ; pos = true ; break ; } } } out . println ( n ) ; } }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public 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 ( ) ) ; }   } }


import java . util . * ; import java . io . * ; import java . math . * ; public class Practice { static FastReader sc = new FastReader ( ) ; static int mod = ( int ) Math . pow ( 10 , 9 ) + 7 ; public static void main ( String [ ] args ) { int ttt = 1 ;


import java . util . * ; import java . io . * ; import java . math . BigInteger ; import java . text . * ; public class Main { static long mod = 1000_000_007 ; static long mod1 = 998244353 ; static boolean fileIO = false ; static boolean memory = true ; static FastScanner f ; static FileWriter fw ; static PrintWriter pw ; static double eps = ( double ) 1e-6 ; static long oo = Long . MAX_VALUE ;

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if sum ( a ) % 2 : print ( ' NO ' ) exit ( ) k = sum ( a ) for i in range ( n ) : if a [ i ] * 2 > k : print ( ' NO ' ) exit ( ) print ( ' YES ' ) NEW_LINE


import heapqn = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) arr . sort ( ) largest = arr [ - 1 ] total = sum ( arr ) others = total - arr [ - 1 ] if total % 2 == 0 and largest <= others : print ( " YES " ) else : print ( " NO " ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) maxi = max ( a ) s = sum ( a ) if maxi * 2 > s or s % 2 == 1 : print ( " NO " ) else : print ( " YES " ) NEW_LINE


n = int ( input ( ) ) arr = [ int ( i ) for i in input ( ) . split ( ) ] s = sum ( arr ) if s % 2 or max ( arr ) > s - max ( arr ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


import sysinput = sys . stdin . readline   '''   '''   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) pf_sum = [ a [ 0 ] ] for i in range ( 1 , n ) : pf_sum . append ( pf_sum [ - 1 ] + a [ i ] )   if pf_sum [ - 1 ] % 2 : print ( " NO " ) sys . exit ( ) elif pf_sum [ - 1 ] > 2 * pf_sum [ - 2 ] : print ( " NO " ) sys . exit ( ) else : print ( " YES " ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;   public class Main {   private static int MAX = Integer . MAX_VALUE ; private static int MIN = Integer . MIN_VALUE ; private static int MOD = 1000000007 ; static FastScanner sc = new FastScanner ( ) ;   public static void main ( String [ ] args ) throws IOException {


import java . util . * ;   public class CodeForces1201B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; long sum = 0 ; int max = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int a = input . nextInt ( ) ; sum += a ; max = Math . max ( max , a ) ; } if ( sum % 2 == 0 && max * 2 <= sum ) { 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 . math . BigInteger ; import java . util . Scanner ; import java . util . StringTokenizer ;    public class Main {  	   public static void main ( String [ ] args ) {

def solve ( s ) : o = 0 l = 0 for i in s : if i == ' - ' : l += 1 else : o += 1 max_val = max ( l , o ) min_val = min ( l , o ) if o == 0 or l == 0 : return ' YES ' if l < o : return ' NO ' if max_val % min_val == 0 : return ' YES ' return ' NO '             def main ( ) : NEW_LINE