import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int t = scn . nextInt ( ) ; while ( t -- > 0 ) { int n = scn . nextInt ( ) ; String str = scn . next ( ) ; if ( str . equals ( "2020" ) ) { System . out . println ( " YES " ) ; continue ; } if ( str . substring ( 0 , 4 ) . equals ( "2020" ) || str . substring ( n - 4 , n ) . equals ( "2020" ) ) { System . out . println ( " YES " ) ; continue ; } if ( ( str . substring ( 0 , 3 ) + str . substring ( n - 1 , n ) ) . equals ( "2020" ) || ( str . substring ( 0 , 2 ) + str . substring ( n - 2 , n ) ) . equals ( "2020" ) || ( str . subSequence ( 0 , 1 ) + str . substring ( n - 3 , n ) ) . equals ( "2020" ) ) { System . out . println ( " YES " ) ; continue ; } System . out . println ( " NO " ) ; } } }

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE t = [ ] NEW_LINE a = s [ : 4 ] NEW_LINE t . append ( a ) NEW_LINE b = s [ - 4 ] + s [ - 3 ] + s [ - 2 ] + s [ - 1 ] NEW_LINE t . append ( b ) NEW_LINE c = s [ 0 ] + s [ - 3 ] + s [ - 2 ] + s [ - 1 ] NEW_LINE t . append ( c ) NEW_LINE d = s [ : 2 ] + s [ - 2 ] + s [ - 1 ] NEW_LINE t . append ( d ) NEW_LINE e = s [ : 3 ] + s [ - 1 ] NEW_LINE t . append ( e ) NEW_LINE if '2020' in t : NEW_LINE INDENT print ( ' YES ' ) else : NEW_LINE print ( ' NO ' ) NEW_LINE DEDENT


t = int ( input ( ) )   for i in range ( t ) : n = list ( map ( int , input ( ) . split ( ) ) )   s = input ( )     l = len ( s ) NEW_LINE


t = int ( input ( ) ) NEW_LINE for x in range ( t ) : n = int ( input ( ) ) NEW_LINE s = input ( )   if ( s [ : 1 ] == "2" and s [ n - 3 : ] == "020" ) : print ( " YES " )   elif ( s [ : 2 ] == "20" and s [ n - 2 : ] == "20" ) : print ( " YES " ) elif ( s [ : 3 ] == "202" and s [ n - 1 : ] == "0" ) : print ( " YES " )   elif ( s [ : 4 ] == "2020" or s [ n - 4 : ] == "2020" ) : print ( " YES " )   else : print ( " NO " )   NEW_LINE


t = int ( input ( ) )   NEW_LINE def testcase ( s ) : temp = "2020" NEW_LINE if s == " " : print ( " NO " ) NEW_LINE return n = len ( s ) - 4 NEW_LINE for i in range ( 5 ) : curr = s [ : i ] + s [ i + n : ] NEW_LINE if curr == temp : print ( " YES " ) NEW_LINE return print ( " NO " )   for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE testcase ( s ) NEW_LINE


t = int ( input ( ) ) NEW_LINE while t : t -= 1 NEW_LINE n = int ( input ( ) ) NEW_LINE st = input ( ) NEW_LINE if st [ 0 : 1 ] == "2" and st [ n - 3 : ] == "020" or st [ 0 : 2 ] == "20" and st [ n - 2 : ] == "20" or st [ 0 : 3 ] == "202" and st [ n - 1 : ] == "0" or st [ 0 : 4 ] == "2020" or st [ n - 4 : ] == "2020" : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " ) NEW_LINE DEDENT


import java . util . * ; public class lastyear { public static void main ( String [ ] args ) { int t , n , i ;   String s = " " ;   Scanner sc = new Scanner ( System . in ) ;   t = sc . nextInt ( ) ;   while ( t -- > 0 ) { n = sc . nextInt ( ) ; s = sc . next ( ) ;   if ( s . startsWith ( "2020" ) || s . endsWith ( "2020" ) || ( s . startsWith ( "2" ) && s . endsWith ( "020" ) ) || ( s . startsWith ( "20" ) && s . endsWith ( "20" ) ) || ( s . startsWith ( "202" ) && s . endsWith ( "0" ) ) ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } }   }   }


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


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = in . nextInt ( ) ; char [ ] s = in . next ( ) . toCharArray ( ) ; if ( s [ 0 ] == '2' && s [ 1 ] == '0' && s [ n - 2 ] == '2' && s [ n - 1 ] == '0' ) { System . out . println ( " YES " ) ; } else if ( s [ 0 ] == '2' && s [ n - 3 ] == '0' && s [ n - 2 ] == '2' && s [ n - 1 ] == '0' ) { System . out . println ( " YES " ) ; } else if ( s [ 0 ] == '2' && s [ 1 ] == '0' && s [ 2 ] == '2' && s [ n - 1 ] == '0' ) { System . out . println ( " YES " ) ; } else if ( s [ 0 ] == '2' && s [ 1 ] == '0' && s [ 2 ] == '2' && s [ 3 ] == '0' ) { System . out . println ( " YES " ) ; } else if ( s [ n - 4 ] == '2' && s [ n - 3 ] == '0' && s [ n - 2 ] == '2' && s [ n - 1 ] == '0' ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { long i , t ; Scanner sc = new Scanner ( System . in ) ; t = sc . nextLong ( ) ; for ( i = 1 ; i <= t ; i ++ ) { int n ; String s ; n = sc . nextInt ( ) ; s = sc . next ( ) ; if ( s . charAt ( 0 ) == '2' && s . charAt ( 1 ) == '0' && s . charAt ( 2 ) == '2' && s . charAt ( 3 ) == '0' ) { System . out . println ( " yes " ) ; } else if ( s . charAt ( n - 4 ) == '2' && s . charAt ( n - 3 ) == '0' && s . charAt ( n - 2 ) == '2' && s . charAt ( n - 1 ) == '0' ) { System . out . println ( " yes " ) ; } else if ( s . charAt ( 0 ) == '2' && s . charAt ( 1 ) == '0' && s . charAt ( 2 ) == '2' && s . charAt ( n - 1 ) == '0' ) { System . out . println ( " yes " ) ; } else if ( s . charAt ( 0 ) == '2' && s . charAt ( 1 ) == '0' && s . charAt ( n - 2 ) == '2' && s . charAt ( n - 1 ) == '0' ) { System . out . println ( " yes " ) ; } else if ( s . charAt ( 0 ) == '2' && s . charAt ( n - 3 ) == '0' && s . charAt ( n - 2 ) == '2' && s . charAt ( n - 1 ) == '0' ) { System . out . println ( " yes " ) ; } else { System . out . println ( " no " ) ; } } } }


import java . util . Scanner ;   public class SystemofEquations { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; int a = ( int ) Math . max ( Math . sqrt ( n ) , Math . sqrt ( m ) ) ; int b = Math . max ( m , n ) - ( int ) Math . pow ( a , 2 ) ;

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


n , m = map ( int , input ( ) . split ( ) ) i = 0 c = 0 while i ** 2 <= n : if i + ( n - i ** 2 ) ** 2 == m : c += 1 i += 1 print ( c ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) count = 0 a = 0 while a ** 2 <= n : b = n - a ** 2 if b >= 0 and a + b ** 2 == m : count += 1 a += 1 print ( count ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) a = 0 b = 0 pair = 0   while a <= n : while b <= m : if ( a ** 2 ) + b == n and a + ( b ** 2 ) == m : pair += 1 b += 1 a += 1 b = 0 print ( pair ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class experiment { static int M = 1_000_000_007 ; static int INF = Integer . MAX_VALUE ; static final FastScanner fs = new FastScanner ( ) ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class NewClass {   public static void main ( String [ ] args ) throws IOException {   BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer tok = new StringTokenizer ( reader . readLine ( ) ) ; int n = Integer . parseInt ( tok . nextToken ( ) ) , m = Integer . parseInt ( tok . nextToken ( ) ) , min = Math . min ( n , m ) , count = 0 , x , y ;   for ( int i = 0 ; i <= min ; i ++ ) { for ( int j = 0 ; j <= min ; j ++ ) { x = ( int ) Math . pow ( i , 2 ) + j ; y = ( int ) Math . pow ( j , 2 ) + i ; if ( m == y && x == n ) { count ++ ; } } } System . out . println ( count ) ; } }


import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int ans = 0 ; for ( int a = 0 ; a * a <= n && a <= m ; a ++ ) { int b = n - a * a ; if ( a + ( b * b ) == m ) { ans ++ ; } } System . out . print ( ans ) ; } }


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

a = int ( input ( ) ) b = int ( input ( ) ) c = int ( input ( ) )   print ( a / ( b + c ) * b ) NEW_LINE


l = int ( input ( ) ) p = int ( input ( ) ) q = int ( input ( ) ) c = p / ( p + q ) print ( c * l ) NEW_LINE


l = int ( input ( ) ) p = int ( input ( ) ) q = int ( input ( ) )   time = l / ( p + q ) print ( p * time ) NEW_LINE


s = int ( input ( ) ) p = int ( input ( ) ) q = int ( input ( ) ) print ( s * p / ( p + q ) ) NEW_LINE


l , p , q = [ int ( input ( ) ) for _ in [ 1 , 2 , 3 ] ] print ( l * p / ( p + q ) ) NEW_LINE


import java . util . * ;   public class Test { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; double n = input . nextDouble ( ) ; double p = input . nextDouble ( ) ; double q = input . nextDouble ( ) ; System . out . printf ( Locale . UK , " % .4f \n " , p * n / ( p + q ) ) ; } }


import java . util . * ;   public class Test { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; double n = input . nextDouble ( ) ; double p = input . nextDouble ( ) ; double q = input . nextDouble ( ) ; double res = p * n / ( p + q ) ; if ( res % 1 != 0 ) System . out . printf ( Locale . UK , " % .4f \n " , res ) ; else System . out . printf ( " % d \n " , ( int ) res ) ; } }


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner S = new Scanner ( System . in ) ; int i = S . nextInt ( ) ; int v1 = S . nextInt ( ) ; int v2 = S . nextInt ( ) ;   System . out . println ( i / ( Float . parseFloat ( String . valueOf ( v2 ) ) / v1 + 1 ) ) ; } }


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


import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int j = 0 ; j < n ; j ++ ) { int k = sc . nextInt ( ) ; int temp = 0 , res = 0 ; String students = sc . next ( ) ; char [ ] a = new char [ k ] ; a = students . toCharArray ( ) ; for ( int x = 0 ; x < k ; x ++ ) { a [ x ] = students . charAt ( x ) ; } for ( int i = k - 1 ; i >= 0 ; i -- ) { if ( a [ i ] == ' A ' ) { res = Math . max ( res , temp ) ; temp = 0 ; } else { temp ++ ; } } System . out . println ( res ) ; } } }

t = int ( input ( ) ) for q in range ( t ) : n = int ( input ( ) ) s = input ( ) c = 0 while " AP " in s : s = s . replace ( " AP " , " AA " ) c += 1 print ( c ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = input ( ) . split ( ' A ' ) max1 = 0 for i in range ( 1 , len ( a ) ) : max1 = max ( max1 , len ( a [ i ] ) ) print ( max1 )     NEW_LINE


I = inputexec ( int ( I ( ) ) * " I ( ) ; print ( max ( 0,0 , * map ( len , I ( ) . split ( ' A ' ) [ 1 : ] ) ) ) ; " ) NEW_LINE


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


x = int ( input ( ) ) for i in range ( x ) : n = int ( input ( ) ) s = input ( ) b = [ ] for j in range ( n ) : if ( s [ j ] == " A " ) : b . append ( j ) d = 0 if ( len ( b ) > 0 ) : for k in range ( 0 , len ( b ) - 1 ) : t = b [ k + 1 ] - b [ k ] - 1 d = max ( d , t ) if ( b [ - 1 ] != n - 1 ) : t = n - 1 - b [ - 1 ] d = max ( t , d ) print ( d ) else : print ( 0 ) NEW_LINE


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int count = 0 , count1 = 0 ; int n = s . nextInt ( ) ; s . nextLine ( ) ; String s1 = s . nextLine ( ) ; boolean jt = false ; for ( int j = 0 ; j < s1 . length ( ) ; j ++ ) { if ( s1 . charAt ( j ) == ' A ' ) jt = true ; if ( s1 . charAt ( j ) == ' P ' && jt == true ) { count ++ ; } else { count = 0 ; } if ( count > count1 ) count1 = count ; } System . out . println ( count1 ) ; } } }


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


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

n , m = map ( int , input ( ) . split ( ) ) mat = [ ] ans = - 1 for i in range ( n ) : mat . append ( input ( ) )   s , d = - 1 , - 1 for i in range ( n ) : for j in range ( m ) : if mat [ i ] [ j ] == ' S ' : s = ( i , j ) if mat [ i ] [ j ] == ' T ' : d = ( i , j )   q = [ ( s [ 0 ] , s [ 1 ] , - 1 , - 1 ) ] vis = [ 0 ] * ( n * m ) pos = 0 found = False   tmp = [ ( 0 , 1 , 1 ) , ( 0 , - 1 , 1 ) , ( 1 , 0 , 0 ) , ( - 1 , 0 , 0 ) ] for a , b , c in tmp : x , y = d while x < n and x >= 0 and y < m and y >= 0 and not mat [ x ] [ y ] == ' * ' : vis [ x * m + y ] = - 1 x += a y += b NEW_LINE


from typing import List , Set , Dictdef map2home ( n : int , m : int , map_in : List [ List [ str ] ] , turns : int ) -> List [ list ] : def validate ( i , j ) : return True if 0 <= i < n and 0 <= j < m and map_in [ i ] [ j ] != - 1 else False     def check ( i , j , count ) : if end == ( i , j ) : return 1 if count <= turns else - 1 else : return 0 NEW_LINE


import sysinput = sys . stdin . readline   def q ( sx , sy , gx , gy ) : for i in range ( sx , gx + 1 ) : for j in range ( sy , gy + 1 ) : if S [ i ] [ j ] == ' * ' : return False return True   n , m = map ( int , input ( ) . split ( ) ) S = [ input ( ) [ : - 1 ] for _ in range ( n ) ]   for i in range ( n ) : for j in range ( m ) : if S [ i ] [ j ] == ' S ' : Sx , Sy = i , j if S [ i ] [ j ] == ' T ' : Tx , Ty = i , j   for i in range ( n ) : if q ( min ( i , Sx ) , Sy , max ( i , Sx ) , Sy ) and q ( i , min ( Sy , Ty ) , i , max ( Sy , Ty ) ) and q ( min ( i , Tx ) , Ty , max ( i , Tx ) , Ty ) : print ( ' YES ' ) exit ( )   for i in range ( m ) : if q ( Sx , min ( i , Sy ) , Sx , max ( i , Sy ) ) and q ( min ( Sx , Tx ) , i , max ( Sx , Tx ) , i ) and q ( Tx , min ( i , Ty ) , Tx , max ( i , Ty ) ) : print ( ' YES ' ) exit ( )   print ( ' NO ' ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) a = [ ] x , y = 0 , 0     def f ( c , x , y ) : for i in range ( x + 1 , n ) : if a [ i ] [ y ] == ' T ' : print ( ' YES ' ) exit ( ) if a [ i ] [ y ] == ' . ' : a [ i ] [ y ] = c elif a [ i ] [ y ] != c : break for i in range ( x - 1 , - 1 , - 1 ) : if a [ i ] [ y ] == ' T ' : print ( ' YES ' ) exit ( ) if a [ i ] [ y ] == ' . ' : a [ i ] [ y ] = c elif a [ i ] [ y ] != c : break for j in range ( y + 1 , m ) : if a [ x ] [ j ] == ' T ' : print ( ' YES ' ) exit ( ) if a [ x ] [ j ] == ' . ' : a [ x ] [ j ] = c elif a [ x ] [ j ] != c : break for j in range ( y - 1 , - 1 , - 1 ) : if a [ x ] [ j ] == ' T ' : print ( ' YES ' ) exit ( ) if a [ x ] [ j ] == ' . ' : a [ x ] [ j ] = c elif a [ x ] [ j ] != c : break     for i in range ( n ) : s = input ( ) for j in range ( m ) : if s [ j ] == ' S ' : x , y = i , j a . append ( list ( s ) ) f ( '1' , x , y ) for i in range ( n ) : for j in range ( m ) : if a [ i ] [ j ] == '1' : f ( '2' , i , j ) for i in range ( n ) : for j in range ( m ) : if a [ i ] [ j ] == '2' : f ( '3' , i , j ) print ( ' NO ' )     NEW_LINE


import java . util . * ;   import javafx . util . Pair ;   import java . io . * ;   public class Main { static int [ ] dx = { 0 , 1 , 0 , - 1 } ;


import java . io . * ; import java . util . * ; public class Main { public static IO in ; public static PrintWriter out ; static void init_io ( String filename ) throws Exception { if ( filename . equals ( " " ) ) { in = new IO ( System . in ) ; out = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) , true ) ; } else { in = new IO ( new FileInputStream ( filename + " . in " ) ) ; out = new PrintWriter ( new BufferedWriter ( new FileWriter ( filename + " . out " ) ) , true ) ; } } final static long mod = 1000000007 ; static int n , m ; static int pack ( int r , int c , int dir , int nturns ) { return r * m * 12 + c * 12 + dir * 3 + nturns ; } static int pack2 ( int pos , int dir , int nturns ) { return pos * 12 + dir * 3 + nturns ; } static int dr [ ] = new int [ ] { 0 , 0 , - 1 , 1 } ; static int dc [ ] = new int [ ] { 1 , - 1 , 0 , 0 } ; static boolean valid ( int r , int c ) { return r >= 0 && r < n && c >= 0 && c < m ; } static void solve ( int tc ) throws Exception { n = in . nint ( ) ; m = in . nint ( ) ; boolean [ ] [ ] grid = new boolean [ n ] [ m ] ; boolean [ ] vis = new boolean [ n * m * 12 ] ; int spos = 0 , tpos = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String s = in . nstr ( ) ; for ( int j = 0 ; j < m ; j ++ ) { if ( s . charAt ( j ) == ' S ' ) spos = i * m + j ; if ( s . charAt ( j ) == ' T ' ) tpos = i * m + j ; grid [ i ] [ j ] = ( s . charAt ( j ) != ' * ' ) ; } } int [ ] queue = new int [ 15000000 ] ;


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; StringBuilder s = new StringBuilder ( input . next ( ) ) ; StringBuilder ans = new StringBuilder ( ) ; int x = 0 ; int y = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' x ' ) x ++ ; else y ++ ; } int max = Math . max ( x , y ) ; int min = Math . min ( x , y ) ; if ( max == x ) for ( int i = 0 ; i < ( max - min ) ; i ++ ) { ans . append ( " x " ) ; } else for ( int i = 0 ; i < ( max - min ) ; i ++ ) { ans . append ( " y " ) ; } System . out . println ( ans ) ; } }

L = input ( )     s1 = L . count ( " x " ) s2 = L . count ( " y " ) x = max ( s1 , s2 ) v = abs ( s1 - s2 ) if x == L . count ( " x " ) : print ( " x " * v ) else : print ( " y " * v ) NEW_LINE


n = input ( ) stack = [ ] for i in n : if stack == [ ] : stack . append ( i ) else : s = stack . pop ( ) if s == ' y ' and i == ' x ' : pass elif s == ' x ' and i == ' y ' : pass else : stack . append ( s ) stack . append ( i ) for i in stack : print ( i , end = ' ' ) NEW_LINE


from sys import stdin , stdoutimport bisect as bsnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) for _ in range ( 1 ) : NEW_LINE


s = input ( ) xs = s . count ( " x " ) ys = s . count ( " y " )   if xs > ys : print ( " x " * ( xs - ys ) ) else : print ( " y " * ( ys - xs ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class CodeParsing {   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 s = sc . next ( ) ; int x = 0 ; int y = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' x ' ) { x ++ ; } else { y ++ ; } } int m = Math . abs ( x - y ) ; char a ; StringBuilder sb = new StringBuilder ( ) ; if ( x > y ) { a = ' x ' ; } else { a = ' y ' ; } for ( int i = 0 ; i < m ; i ++ ) { sb . append ( a ) ; } System . out . println ( sb . toString ( ) ) ; }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; public class codeParsing { 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 s = sc . next ( ) ; int count_x = 0 ; int count_y = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' x ' ) { count_x ++ ; } else { count_y ++ ; } }   StringBuilder ans = new StringBuilder ( ) ; int k = 0 ; char c ; if ( count_x > count_y ) { c = ' x ' ; k = count_x - count_y ; } else { c = ' y ' ; k = count_y - count_x ; } while ( k -- > 0 ) { ans . append ( c ) ; } System . out . println ( ans ) ; } }


import java . util . Arrays ; import java . util . Scanner ;   public class B255 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int x = 0 ; int y = 0 ; for ( char c : in . next ( ) . toCharArray ( ) ) { if ( c == ' x ' ) { x ++ ; } else { y ++ ; } } char [ ] array ; if ( x >= y ) { x -= y ; array = new char [ x ] ; Arrays . fill ( array , ' x ' ) ; } else { y -= x ; array = new char [ y ] ; Arrays . fill ( array , ' y ' ) ; } System . out . println ( new String ( array ) ) ; }   }


import java . util . Scanner ;   public class CodeParsing {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] c = sc . next ( ) . toCharArray ( ) ; int x = 0 , y = 0 ; for ( char ch : c ) { if ( ch == ' x ' ) x ++ ; else y ++ ; } StringBuilder ans = new StringBuilder ( ) ; int left ; left = Math . abs ( x - y ) ; char ansChar = x > y ? ' x ' : ' y ' ; while ( left -- > 0 ) ans . append ( ansChar ) ; System . out . println ( ans . toString ( ) ) ; sc . close ( ) ; } }


import java . io . * ; import java . util . * ; public class Main { public static void main ( String args [ ] ) { FastReader input = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int T = 1 ; while ( T -- > 0 ) { long k = input . nextLong ( ) ; long v = 9 ; long s = 0 ; int x = 1 ; while ( true ) { if ( s + v * x > k ) { break ; } s += v * x ; v *= 10 ; x ++ ; } if ( s == k ) { out . println ( 9 ) ; } else { long d = k - s ; long u = d / x ; long rem = d % x ; long nu = ( long ) Math . pow ( 10 , x - 1 ) ; nu += u ; if ( rem == 0 ) { nu -- ; out . println ( nu % 10 ) ; } else { String str = String . valueOf ( nu ) ; out . println ( str . charAt ( ( int ) ( rem - 1 ) ) ) ; } } } out . close ( ) ; } 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 ; } } }

def main ( ) : k = int ( input ( ) ) n , tenPow , s = 1 , 1 , 0 while ( ( s + 9 * tenPow * n ) < k ) : s += 9 * tenPow * n n += 1 tenPow *= 10 num = str ( tenPow - 1 + ( k - s + n - 1 ) // n ) print ( num [ ( k - s - 1 ) % n ] )   if __name__ == " _ _ main _ _ " : main ( )   NEW_LINE


pre_cal_sum_dec = { } def sum_dec ( n ) : ''' Sum ▁ of ▁ 10 * * n ▁ + ▁ 10 * * ( n - 1 ) ▁ + ▁ . . . ▁ 10 * * 1 ▁ ▁ ▁ ▁ Parameter : ▁ n : ▁ number ▁ ▁ ▁ ▁ Return : ▁ result ▁ of ▁ the ▁ sum ''' global pre_cal_sum_dec try : return pre_cal_sum_dec [ n ] except : sumer = 0 for i in range ( 1 , n ) : sumer += 10 ** i pre_cal_sum_dec [ n ] = sumer return sumerdef find_head ( digits ) : ''' Find ▁ the ▁ starting ▁ number ▁ of ▁ a ▁ digit ▁ cluster : ▁ ex : ▁ 10 ▁ for ▁ 2 - dig ; ▁ 190 ▁ for ▁ 3 - dig ''' if digits < 1 : return 0 elif digits == 1 : return 1 else : return ( digits - 1 ) * 10 ** ( digits - 1 ) - sum_dec ( digits - 1 )   def cutter ( start , end ) : listo = [ 0 for _ in range ( 10 ) ] part = ( end - start ) // 9 listo [ 0 ] = start for each in range ( 1 , 10 ) : start += part listo [ each ] = start return listodef finder ( number ) : x , i = 0 , 0 if number == 1 : return 1 while x < number : bef = x x = find_head ( i ) i += 1 if x == number : return 1 e = i - 2 number = number - bef interval = e * 10 ** ( e - 1 ) col = number % e NEW_LINE


pre_cal_sum_dec = { } def sum_dec ( n ) : ''' Sum ▁ of ▁ 10 * * n ▁ + ▁ 10 * * ( n - 1 ) ▁ + ▁ . . . ▁ 10 * * 1 ▁ ▁ ▁ ▁ Parameter : ▁ n : ▁ number ▁ ▁ ▁ ▁ Return : ▁ result ▁ of ▁ the ▁ sum ''' global pre_cal_sum_dec try : return pre_cal_sum_dec [ n ] except : sumer = 0 for i in range ( 1 , n ) : sumer += 10 ** i pre_cal_sum_dec [ n ] = sumer return sumerdef find_head ( digits ) : ''' Find ▁ the ▁ starting ▁ number ▁ of ▁ a ▁ digit ▁ cluster : ▁ ex : ▁ 10 ▁ for ▁ 2 - dig ; ▁ 190 ▁ for ▁ 3 - dig ''' if digits < 1 : return 0 elif digits == 1 : return 1 else : return ( digits - 1 ) * 10 ** ( digits - 1 ) - sum_dec ( digits - 1 )   list_of_head = [ find_head ( i ) for i in range ( 18 ) ] def finder ( number ) : x , i = 0 , 1 if number == 1 : return 1 for x in list_of_head [ 1 : ] : if x > number : break bef = x i += 1 if x == number : return 1 e = i - 1 number = number - bef interval = e * 10 ** ( e - 1 ) col = number % e NEW_LINE


import java . util . * ; import java . io . * ; import java . text . * ;   public class Main {


import java . util . Scanner ;   public class B1177 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long N = in . nextLong ( ) ; long answer = solve ( N , 0 , 1 , 1 ) ; System . out . println ( answer ) ; }   static long solve ( long N , long offset , long start , int digits ) { long thisSection = digits * start * 9 ; long fromOffset = N - offset ; if ( fromOffset > thisSection ) { return solve ( N , offset + thisSection , 10 * start , digits + 1 ) ; } long number = start + ( fromOffset - 1 ) / digits ; long posInNumber = digits - 1 - ( fromOffset - 1 ) % digits ; while ( posInNumber > 0 ) { posInNumber -- ; number /= 10 ; } return number % 10 ; }   }


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static long mod = 17352642619633L ;   void run ( FastScanner in , PrintWriter out ) {


import java . util . * ; import java . io . * ;   public class B { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; char [ ] [ ] arr = new char [ 11 ] [ 11 ] ; for ( int i = 0 ; i < 11 ; i ++ ) { arr [ i ] = in . nextLine ( ) . toCharArray ( ) ; } int x = in . nextInt ( ) ; int y = in . nextInt ( ) ; x = ( x - 1 ) % 3 ; y = ( y - 1 ) % 3 ; boolean untouched = true ; for ( int i = 0 ; i < 3 ; i ++ ) { for ( int j = 0 ; j < 3 ; j ++ ) { if ( arr [ i + ( 4 * x ) ] [ j + ( 4 * y ) ] == ' . ' ) { untouched = false ; arr [ i + ( 4 * x ) ] [ j + ( 4 * y ) ] = ' ! ' ; } } } for ( int i = 0 ; i < 11 ; i ++ ) { if ( ! ( i == 3 || i == 7 ) ) { for ( int j = 0 ; j < 11 ; j ++ ) { if ( untouched && arr [ i ] [ j ] == ' . ' ) System . out . print ( ' ! ' ) ; else System . out . print ( arr [ i ] [ j ] ) ; } } System . out . println ( ) ; } } }

board = [ list ( input ( ) ) for i in range ( 11 ) ] ( x , y ) = map ( int , input ( ) . split ( ) )   x = ( x - 1 ) % 3 y = ( y - 1 ) % 3   can = Falsefor i in range ( 3 ) : for j in range ( 3 ) : if board [ x * 4 + i ] [ y * 4 + j ] == ' . ' : board [ x * 4 + i ] [ y * 4 + j ] = ' ! ' can = True if not can : for i in range ( 11 ) : if i % 4 != 3 : for j in range ( 11 ) : if board [ i ] [ j ] == ' . ' : board [ i ] [ j ] = ' ! '   for i in range ( 11 ) : print ( ' ' . join ( board [ i ] ) ) NEW_LINE


X = [ ] count = 0 while ( count < 9 ) : Y = input ( ) Z = [ char for char in Y if char != ' ▁ ' ] if Z != [ ] : X . append ( Z ) count += 1 x , y = map ( int , input ( ) . split ( ) ) u = ( x - 1 ) % 3 v = ( y - 1 ) % 3 ok = False for i in range ( 3 ) : for j in range ( 3 ) : t , s = 3 * u + i , 3 * v + j if X [ t ] [ s ] == ' . ' : X [ t ] [ s ] = ' ! ' ok = True if ok == False : for i in range ( 9 ) : for j in range ( 9 ) : if X [ i ] [ j ] == ' . ' : X [ i ] [ j ] = ' ! ' cnt = 0 for i in X : cnt += 1 [ u1 , u2 , u3 , u4 , u5 , u6 , u7 , u8 , u9 ] = i print ( u1 + u2 + u3 + " ▁ " + u4 + u5 + u6 + " ▁ " + u7 + u8 + u9 ) if cnt == 3 or cnt == 6 : print ( " ▁ " ) NEW_LINE


import java . util . * ;    public class CodeforcesContest { private static long sport ( int [ ] a , char [ ] chars ) { int n = a . length ; long [ ] pa = new long [ n + 1 ] ; long [ ] pb = new long [ n + 1 ] ; for ( int i = 1 ; i < n + 1 ; i ++ ) { if ( chars [ i - 1 ] == ' A ' ) { pa [ i ] += pa [ i - 1 ] + a [ i - 1 ] ; pb [ i ] = pb [ i - 1 ] ; } else { pb [ i ] += pb [ i - 1 ] + a [ i - 1 ] ; pa [ i ] = pa [ i - 1 ] ; } } int from = Integer . MAX_VALUE ; int to = Integer . MAX_VALUE ; long max = 0 ;

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) ; s = input ( ) if n == 1 : print ( arr [ 0 ] ) ; exit ( ) NEW_LINE


n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) s = input ( ) total = 0 for i in range ( n ) : if s [ i ] == ' B ' : total += p [ i ] ans = totalcur = totalfor i in range ( n ) : if s [ i ] == ' A ' : cur += p [ i ] else : cur -= p [ i ] ans = max ( ans , cur )   cur = totalfor i in reversed ( range ( n ) ) : if s [ i ] == ' A ' : cur += p [ i ] else : cur -= p [ i ] ans = max ( ans , cur )   print ( ans ) NEW_LINE


n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) s = input ( ) ogmx = 0 premx = [ 0 ] * ( n + 1 ) sufmx = [ 0 ] * ( n + 1 ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) s = input ( ) def m ( s , a ) : q , w = 0 , 0 for i in range ( n ) : if s [ i ] == " A " : q += a [ i ] else : w += a [ i ] r = w for i in range ( n ) : if s [ i ] == " A " : w += a [ i ] ; q -= a [ i ] else : q += a [ i ] ; w -= a [ i ] r = max ( r , w ) return rprint ( max ( m ( s , a ) , m ( s [ : : - 1 ] , a [ : : - 1 ] ) ) ) NEW_LINE


import java . util . * ; import java . util . Scanner ; import java . io . * ; import javax . lang . model . util . ElementScanner6 ; import static java . lang . System . out ;    public class B632 {   public static void main ( String args [ ] ) {   FastReader in = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; int tc = 1 ;


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 ) { String a = s . next ( ) ; String b = s . next ( ) ; int num = lcm ( a . length ( ) , b . length ( ) ) ;

import mathfor NEW_LINE _ in range ( int ( input ( ) ) ) : s1 = input ( ) NEW_LINE s2 = input ( ) NEW_LINE g = math . gcd ( len ( s1 ) , len ( s2 ) ) NEW_LINE if ( len ( s2 ) // g * s1 == len ( s1 ) // g * s2 ) : NEW_LINE INDENT print ( len ( s2 ) // g * s1 ) else : NEW_LINE print ( - 1 ) NEW_LINE DEDENT


for _ in range ( 0 , int ( input ( ) ) ) : s , t = input ( ) , input ( ) NEW_LINE p , q = len ( s ) , len ( t ) NEW_LINE while p != q : if NEW_LINE p > q : q = q + len ( t ) else : p = p + len ( s ) NEW_LINE f , g = ( int ( q / len ( t ) ) , int ( p / len ( s ) ) ) NEW_LINE if s * g == t * f : NEW_LINE INDENT print ( s * g ) else : NEW_LINE print ( - 1 ) NEW_LINE DEDENT


a = int ( input ( ) ) NEW_LINE for i in range ( a ) : s = input ( ) NEW_LINE t = input ( ) NEW_LINE n1 = len ( t ) NEW_LINE n2 = len ( s ) NEW_LINE x = n1 NEW_LINE while x >= n1 : if NEW_LINE x % n2 == 0 and x % n1 == 0 : alpha = x NEW_LINE break NEW_LINE x += 1 NEW_LINE


import math   testCases = int ( input ( ) )   for i in range ( testCases ) : stringA = input ( ) NEW_LINE stringB = input ( ) NEW_LINE a = len ( stringA ) NEW_LINE b = len ( stringB ) NEW_LINE LCM = a * b // math . gcd ( a , b ) NEW_LINE stringAlcm = stringA * ( LCM // a ) NEW_LINE stringBlcm = stringB * ( LCM // b ) NEW_LINE if stringAlcm == stringBlcm : NEW_LINE INDENT print ( stringAlcm ) else : NEW_LINE print ( - 1 ) NEW_LINE DEDENT


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class B_String_LCM {   static Scanner scanner = new Scanner ( ) ; static int testCases ; static String mul ( String s , int k ) { StringBuilder sb = new StringBuilder ( ) ; while ( k -- >= 1 ) { sb . append ( s ) ; } return sb . toString ( ) ; } static int gcd ( int a , int b ) { if ( a == 0 ) return b ; if ( b == 0 ) return a ; if ( a == b ) return a ; if ( a > b ) return gcd ( a - b , b ) ; return gcd ( a , b - a ) ; } static void solve ( String a , String b ) { int n = a . length ( ) , m = b . length ( ) ; int g = gcd ( n , m ) ; if ( mul ( a , m / g ) . equalsIgnoreCase ( mul ( b , n / g ) ) ) { System . out . println ( mul ( a , m / g ) ) ; } else { System . out . println ( - 1 ) ; } } public static void main ( String [ ] args ) throws IOException { testCases = scanner . nextInt ( ) ; for ( int i = 0 ; i < testCases ; i ++ ) { solve ( scanner . next ( ) , scanner . next ( ) ) ; } } static class Scanner { BufferedReader in ; StringTokenizer st ;   public Scanner ( ) { in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) throws IOException { while ( st == null || ! st . hasMoreElements ( ) ) { st = new StringTokenizer ( in . readLine ( ) ) ; } return st . nextToken ( ) ; } int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } String nextLine ( ) throws IOException { return in . readLine ( ) ; } } }


import java . util . * ; import java . lang . * ; import java . io . * ;    public class Codechef { static int hcf ( int a , int b ) { int hcf = 1 ; for ( int i = 1 ; i <= a || i <= b ; i ++ ) { if ( a % i == 0 && b % i == 0 ) hcf = i ; } return hcf ; } public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int tt = sc . nextInt ( ) ; sc . nextLine ( ) ; while ( tt -- != 0 ) { String s , t ; s = sc . nextLine ( ) ; t = sc . nextLine ( ) ; int x = s . length ( ) ; int y = t . length ( ) ; int lcm = ( x * y ) / hcf ( x , y ) ; int a = lcm / x ; int b = lcm / y ; String s1 = " " , s2 = " " ; for ( int i = 1 ; i <= a ; i ++ ) { s1 += s ; } for ( int i = 1 ; i <= b ; i ++ ) { s2 += t ; } if ( s1 . equals ( s2 ) ) { System . out . println ( s1 ) ; } else System . out . println ( - 1 ) ; } } }


import java . util . Scanner ;   public class B1473 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { String A = in . next ( ) ; String B = in . next ( ) ; int a = A . length ( ) ; int b = B . length ( ) ; int gcd = gcd ( a , b ) ; int aCopies = b / gcd ; int bCopies = a / gcd ; StringBuilder aa = new StringBuilder ( ) ; StringBuilder bb = new StringBuilder ( ) ; for ( int i = 0 ; i < aCopies ; i ++ ) { aa . append ( A ) ; } for ( int i = 0 ; i < bCopies ; i ++ ) { bb . append ( B ) ; } boolean ok = aa . toString ( ) . equals ( bb . toString ( ) ) ; System . out . println ( ok ? aa : " - 1" ) ; } }   static int gcd ( int a , int b ) { return ( b == 0 ) ? a : gcd ( b , a % b ) ; }   }


import java . util . Scanner ;   public class Stairways { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a [ ] = new int [ n + 1 ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 1 ) { ++ ans ; } } System . out . println ( ans ) ; int c = 0 ; a [ n ] = 1 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { if ( a [ i ] != 1 ) { ++ c ; } else { System . out . print ( ( c + 1 ) + " ▁ " ) ; c = 0 ; } } } }

n = int ( input ( ) )   arr = [ int ( i ) for i in input ( ) . split ( ) ] arr = arr [ 1 : : ] + [ arr [ 0 ] ] x = 1 ans = [ ]   for i in arr : if i == 1 : ans . append ( x ) x = 1 else : x += 1   print ( len ( ans ) ) print ( * ans )   NEW_LINE


input ( ) a = input ( ) . split ( ) l = [ x for x , y in zip ( a , a [ 1 : ] + [ '1' ] ) if '1' == y ] print ( len ( l ) ) print ( * l ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) c = 0 s = [ ] d = 1 for i in l : if ( i == d ) : d += 1 else : s . append ( d - 1 ) d = 2 c += 1 s . append ( d - 1 ) c += 1 print ( c ) for i in s : print ( i , end = ' ▁ ' ) NEW_LINE


import java . util . ArrayList ; import java . util . Scanner ;   public class JavaApplication4 { public static void main ( String [ ] args ) { int sum , x , counter = 0 ; ArrayList < Integer > max = new ArrayList < > ( ) ; Scanner scan = new Scanner ( System . in ) ; int i = 0 ; x = scan . nextInt ( ) ; int n [ ] = new int [ x ] ; if ( x == 1 ) { n [ 0 ] = scan . nextInt ( ) ; counter = 1 ; max . add ( 1 ) ; } else { for ( i = 0 ; i < x ; i ++ ) { n [ i ] = scan . nextInt ( ) ; if ( n [ i ] == 1 ) counter ++ ; if ( i != 0 & n [ i ] == 1 ) max . add ( n [ i - 1 ] ) ; } max . add ( n [ i - 1 ] ) ; } System . out . println ( counter ) ; max . forEach ( ( t ) -> { System . out . print ( t + " ▁ " ) ; } ) ;  	  }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;   public class Test {   public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . call ( in , out ) ; out . close ( ) ; }   static class TaskA { public void call ( InputReader in , PrintWriter out ) { int n , a , b = 1 ; n = in . nextInt ( ) ; a = ( n / 2 ) + 1 ; out . println ( a ) ; for ( int i = 1 , j = 1 ; i <= a && j <= a ; i ++ ) { if ( b > n ) break ; if ( b % 2 == 0 ) { out . println ( j + " ▁ " + i ) ; j ++ ; i -- ; } else { out . println ( j + " ▁ " + i ) ; } b ++ ;   }       } }   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 ( ) ) ; } public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   } }

import mathimport sysfrom collections import * import itertools def cint ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def cstr ( ) : return list ( map ( str , input ( ) . split ( ' ▁ ' ) ) )     def gcd ( a , b ) : if ( b == 0 ) : return a return gcd ( b , a % b )     def solve ( t ) : n = int ( input ( ) ) r = ( n + 1 ) // 2   if ( n + 1 ) / 2 != ( n + 1 ) // 2 : r += 1   print ( r ) indx = 1 for i in range ( n ) : if i < r : print ( 0 + 1 , i + 1 ) else : print ( indx + 1 , r ) indx += 1 	 	 	       if __name__ == " _ _ main _ _ " : NEW_LINE


import matha = int ( input ( ) ) m = math . ceil ( ( a + 1 ) / 2 ) print ( m ) for i in range ( 1 , min ( a + 1 , m + 1 ) ) : print ( 1 , i ) a = a - 1 for i in range ( m - a + 1 , m + 1 ) : if ( a <= 0 ) : break print ( m , i ) a = a - 1 NEW_LINE


n = int ( input ( ) ) m = n // 2 + 1 print ( m ) for i in range ( n ) : print ( i // 2 + 1 , i // 2 + 1 + i % 2 ) NEW_LINE


n = int ( input ( ) ) if ( ( n - 1 ) % 2 == 1 ) : c = ( ( n - 1 ) // 2 ) + 1 else : c = ( n - 1 ) // 2 c += 1 r = 1 print ( c ) for i in range ( 1 , n + 1 ) : if ( i <= n - c ) : print ( "1" , end = " ▁ " ) print ( i ) else : print ( c , end = " ▁ " ) print ( r ) r += 1 NEW_LINE


import java . io . * ; import java . util . * ; public class Mohammad { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , c = n / 2 ; System . out . println ( ++ c ) ; for ( int i = 1 ; i <= c ; i ++ ) System . out . println ( 1 + " ▁ " + i ) ; for ( int i = 2 ; i <= n - c + 1 ; i ++ ) System . out . println ( c + " ▁ " + i ) ; } }


import java . util . * ; public class B_564 { public static void main ( String [ ] args ) { Scanner omkar = new Scanner ( System . in ) ; int n = omkar . nextInt ( ) ; int m = n / 2 + 1 ; System . out . println ( " " + m ) ; for ( int i = 1 ; i <= m ; i ++ ) { System . out . println ( "1 ▁ " + i ) ; } for ( int i = 1 ; i <= n - m ; i ++ ) { System . out . println ( ( i + 1 ) + " ▁ " + m ) ; } }   }


import java . util . * ; import java . io . * ; import java . lang . * ;   public class MainClass { private static BufferedReader br = null ; private static StringTokenizer st = null ; static { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } private static String str ( ) throws IOException { return br . readLine ( ) ; } private static int ints ( ) throws IOException { return Integer . parseInt ( br . readLine ( ) ) ; } private static int [ ] ints ( int N ) throws IOException { st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] nums = new int [ N ] ; for ( int i = 0 ; i < N ; i += 1 ) { nums [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; } return nums ; } public static void main ( String [ ] args ) throws IOException { String [ ] str = br . readLine ( ) . split ( " ▁ " ) ; long N = Long . parseLong ( str [ 0 ] ) ; long K = Long . parseLong ( str [ 1 ] ) ; Solution obj = new Solution ( ) ; long [ ] ans = obj . dipCertiNotWinners ( N , K ) ; System . out . println ( ans [ 0 ] + " ▁ " + ans [ 1 ] + " ▁ " + ans [ 2 ] ) ; br . close ( ) ; } }   class Solution { public long [ ] dipCertiNotWinners ( long N , long K ) {

n , k = map ( int , input ( ) . split ( ) )   certificate = n // 2 // ( k + 1 ) * kdiplomas = n // 2 // ( k + 1 ) non_winners = n - diplomas - certificate   print ( diplomas , certificate , non_winners ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) c = a // 2 d = c // ( b + 1 ) e = b * dprint ( d , e , a - d - e ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) d = n // ( 2 * ( k + 1 ) ) c = k * dnw = n - ( c + d ) print ( d , c , nw ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) d = ( n // 2 ) // ( k + 1 ) print ( d , k * d , n - ( k + 1 ) * d ) NEW_LINE


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


import java . io . * ; import java . util . * ;   public class Training { public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; long n = input . nextLong ( ) , k = input . nextLong ( ) ; long a = n / 2 / ( k + 1 ) ; long b = a * k ; System . out . println ( a + " ▁ " + b + " ▁ " + ( n - a - b ) ) ;   }


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 final long INF = ( long ) Math . pow ( 10 , 16 ) ; 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 = 300005 ; private static final int MAXA = 1000007 ; 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 . util . * ;   public class P1 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; if ( n <= k ) { System . out . println ( 0 + " ▁ " + 0 + " ▁ " + n ) ;   } else { long a = ( n / 2 ) / ( k + 1 ) ;   long b = k * a ; long N = n - ( a + a * k ) ; System . out . println ( a + " ▁ " + b + " ▁ " + N ) ; }   } }


import java . io . * ; import java . util . * ;   public class b { static class Reader { final private int BUFFER_SIZE = 1 << 20 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ; public Reader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; } public Reader ( String file_name ) throws IOException { din = new DataInputStream ( new FileInputStream ( file_name ) ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; } public String next ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;

n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) m = min ( x ) l = mc = 0 a = x [ 0 ] b = x [ - 1 ] flag = 0 while True : m = 2 ** 20 for i in range ( 1 , n - 1 ) : x [ i ] -= l if x [ i ] <= 0 and x [ i - 1 ] <= 0 : flag = 1 break if x [ i ] > 0 : m = min ( m , x [ i ] ) c += l if c > a or c > b : break if flag == 1 : break l = mprint ( min ( c , a , b ) ) NEW_LINE


if __name__ == ' _ _ main _ _ ' : n = int ( input ( ) ) a = [ 0 ] + [ int ( i ) for i in input ( ) . split ( ) ] + [ 0 ] mx = 10 ** 6 + 1   for i in range ( n + 1 ) : mx = min ( mx , max ( a [ i ] , a [ i + 1 ] ) )   print ( mx ) NEW_LINE


n , a = int ( input ( ) ) , [ 0 ] + list ( map ( int , input ( ) . split ( ) ) ) + [ 0 ] x = [ ] for i in range ( n + 1 ) : x . append ( max ( a [ i ] , a [ i + 1 ] ) ) print ( min ( x ) ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class RainDestroyer { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ;   int n = scan . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] sort = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; sort [ i ] = a [ i ] ; }   Arrays . sort ( sort ) ;   int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( sort [ i ] == a [ j ] ) { if ( j == 0 || j == n - 1 || a [ j - 1 ] <= a [ j ] || a [ j + 1 ] <= a [ j ] ) { ans = sort [ i ] ; } } } if ( ans > 0 ) { System . out . println ( ans ) ; break ; } } } }


import java . util . * ;   public class TCS1 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = sc . nextLine ( ) ; String str = sc . nextLine ( ) ; String a = str . split ( " ▁ " ) [ 0 ] ; String b = str . split ( " ▁ " ) [ 1 ] ; String temp = "6789TJQKA " ; if ( a . charAt ( 1 ) == b . charAt ( 1 ) ) { if ( temp . indexOf ( a . charAt ( 0 ) ) > temp . indexOf ( b . charAt ( 0 ) ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } else { if ( a . charAt ( 1 ) == s . charAt ( 0 ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }

c = [ '6' , '7' , '8' , '9' , ' T ' , ' J ' , ' Q ' , ' K ' , ' A ' ] t = input ( ) f , s = input ( ) . split ( ) if f [ 1 ] == t and s [ 1 ] != t : print ( ' YES ' ) exit ( ) elif s [ 1 ] == t and f [ 1 ] != t : print ( ' NO ' ) exit ( ) if f [ 1 ] != s [ 1 ] : print ( ' NO ' ) elif c . index ( f [ 0 ] ) > c . index ( s [ 0 ] ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


s = input ( ) a , b = map ( str , input ( ) . split ( ) ) NEW_LINE


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 , Counterfrom math import * from itertools import permutations , accumulatedx = [ - 1 , 1 , 0 , 0 ] dy = [ 0 , 0 , 1 , - 1 ] NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int first = 0 , second = 0 ; String wrong = input . next ( ) ; String First = input . next ( ) ; String Second = input . next ( ) ; if ( First . charAt ( 0 ) == ' T ' ) first = 10 ; else if ( First . charAt ( 0 ) == ' J ' ) first = 11 ; else if ( First . charAt ( 0 ) == ' Q ' ) first = 12 ; else if ( First . charAt ( 0 ) == ' K ' ) first = 13 ; else if ( First . charAt ( 0 ) == ' A ' ) first = 14 ; else first = First . charAt ( 0 ) - '0' ; if ( Second . charAt ( 0 ) == ' T ' ) second = 10 ; else if ( Second . charAt ( 0 ) == ' J ' ) second = 11 ; else if ( Second . charAt ( 0 ) == ' Q ' ) second = 12 ; else if ( Second . charAt ( 0 ) == ' K ' ) second = 13 ; else if ( Second . charAt ( 0 ) == ' A ' ) second = 14 ; else second = Second . charAt ( 0 ) - '0' ; if ( First . charAt ( 1 ) == wrong . charAt ( 0 ) && ( Second . charAt ( 1 ) != wrong . charAt ( 0 ) ) ) System . out . println ( " YES " ) ; else if ( First . charAt ( 1 ) == Second . charAt ( 1 ) && first > second ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }         }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( newInputStreamReader ( 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 fs = new FastReader ( ) ;


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . time . LocalTime ; import java . util . * ; import java . util . concurrent . * ; import java . util . regex . * ;    public class Main {    public static void main ( String [ ] args ) { FastScanner scan = new FastScanner ( ) ; int n = scan . nextInt ( ) ; double ans = 0 ; while ( n > 0 ) { double temp = ( double ) 1 / n ; ans += temp ; n -- ; } System . out . println ( ans ) ; } public static long divisor ( long n ) { for ( long i = 3 ; i < n ; i ++ ) { if ( n % i == 0 ) return i ; } return n ; } public static void sort ( int [ ] a ) { ArrayList < Integer > b = new ArrayList < > ( ) ; for ( int i : a ) b . add ( i ) ; Collections . sort ( b ) ; for ( int i = 0 ; i < a . length ; i ++ ) a [ i ] = b . get ( i ) ; } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }

n = int ( input ( ) ) i = 1 ans = 0 while ( i <= n ) : ans += 1 / i i += 1 print ( ans ) NEW_LINE


import matht = int ( input ( ) ) ans = 0 for i in range ( t ) : ans = ans + 1 / t t -= 1 print ( ans )   NEW_LINE


import sys   n = int ( sys . stdin . readline ( ) )   sigma = 0 total = n   while total : sigma += ( 1 / total ) total -= 1 print ( sigma ) NEW_LINE


import sys   input = sys . stdin . readline   def main ( ) : n = int ( input ( ) )   ans = 0 for i in range ( 1 , n + 1 ) : ans += 1 / n n -= 1   print ( ans )   main ( ) NEW_LINE


import java . util . Scanner ;   public class JOEisOnTV { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n == 1 ) { System . out . println ( "1" ) ; return ; } double d = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { d = d + ( float ) 1 / i ; } System . out . println ( d ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Solution { public static void main ( String [ ] args ) throws java . lang . Exception { java . io . BufferedReader br = new java . io . BufferedReader ( new java . io . InputStreamReader ( System . in ) ) ; OutputStream outputStream = System . out ; PrintWriter out = new PrintWriter ( outputStream ) ; int n = Integer . parseInt ( br . readLine ( ) . trim ( ) ) ; double ans = 0.0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += 1.0 / i ; out . println ( ans ) ; out . close ( ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . Comparator ; import java . util . StringTokenizer ;   public class Lala_Land { 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 ( ) ) ) ; } }   public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int n = in . nextInt ( ) ; Apple a [ ] = new Apple [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int pos = in . nextInt ( ) ; int app = in . nextInt ( ) ; a [ i ] = new Apple ( pos , app ) ; } Arrays . sort ( a , new Sort ( ) ) ; int mid = - 1 ; int neg = 0 ; int pos = 0 ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] . pos < 0 ) { neg ++ ; } else { if ( mid == - 1 ) mid = i ; pos ++ ; } sum += a [ i ] . tot ; } int min = Math . min ( neg , pos ) ; if ( pos != neg ) { sum = 0 ;

t = [ ] w = [ ]     n = int ( input ( ) )   p = 0 for i in range ( n ) : v = list ( map ( int , input ( ) . split ( ) ) )   if v [ 0 ] == 0 : p += v [ 1 ] elif v [ 0 ] < 0 : w . append ( v ) else : t . append ( v )   t . sort ( ) w . sort ( ) t = t [ : : - 1 ]   if len ( w ) > len ( t ) : o = 1 else : o = 0 while True : if o == 0 : if len ( t ) > 0 : p += t [ - 1 ] [ 1 ] t . pop ( ) o = 1 else : break elif o == 1 : if len ( w ) > 0 : p += w [ - 1 ] [ 1 ] w . pop ( ) o = 0 else : break   print ( p )       NEW_LINE


n = int ( input ( ) ) pos = [ ] neg = [ ] for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) if x < 0 : neg . append ( [ x , y ] ) else : pos . append ( [ x , y ] ) pos . sort ( ) neg . sort ( reverse = True ) l1 = len ( pos ) l2 = len ( neg ) m = min ( l1 , l2 ) tot = 0 for i in range ( m ) : tot += neg [ i ] [ 1 ] + pos [ i ] [ 1 ] if l1 > l2 : tot += pos [ m ] [ 1 ] elif l2 > l1 : tot += neg [ m ] [ 1 ] else : passprint ( tot ) NEW_LINE


def solve ( num , neg , pos , nseq , pseq ) : app = 0 if neg == pos : for x , y in nseq : app += y for x , y in pseq : app += y elif neg > pos : times = pos index = 0 while index < pos : app += pseq [ index ] [ 1 ] index += 1 index = 0 while index < pos + 1 : app += nseq [ index ] [ 1 ] index += 1 else : times = neg index = 0 while index < neg : app += nseq [ index ] [ 1 ] index += 1 index = 0 while index < neg + 1 : app += pseq [ index ] [ 1 ] index += 1 return app num = int ( input ( ) ) p = 0 n = 0 pseq = [ ] nseq = [ ] for x in range ( num ) : i , j = list ( map ( int , input ( ) . split ( ) ) ) if i < 0 : n += 1 nseq . append ( [ i , j ] ) else : p += 1 pseq . append ( [ i , j ] ) pseq . sort ( key = lambda i : i [ 0 ] ) nseq . sort ( key = lambda i : i [ 0 ] , reverse = True )   print ( solve ( num , n , p , nseq , pseq ) ) NEW_LINE


import sys , mathsys . setrecursionlimit ( 10 ** 8 ) ''' def ▁ fun ( ) : ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( 16 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( 4 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ i & (1 < < j ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( j , end = ' ' ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( ) import ▁ binarytreefrom ▁ collections ▁ import ▁ dequebst ▁ = ▁ binarytree . tree ( height = 4 , is _ perfect = True ) print ( bst ) def ▁ s ( bst ) : ▁ ▁ ▁ ▁ if ▁ bst : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ bst . left , bst . right ▁ = ▁ bst . right , bst . left ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . right ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ s ( bst . left ) s ( bst ) print ( bst ) ''' t = int ( input ( ) ) pos = [ None ] * ( pow ( 10 , 5 ) + 1 ) neg = [ None ] * ( pow ( 10 , 5 ) + 1 ) pp , nn = 0 , 0 for _ in range ( t ) : x , a = map ( int , input ( ) . split ( ) ) if x < 0 : neg [ abs ( x ) ] = a nn += 1 else : pos [ x ] = a pp += 1 if nn < pp : pp = nn + 1 i = 0 s1 , s2 = 0 , 0 while nn != 0 : if neg [ i ] != None : s1 += neg [ i ] nn -= 1 i += 1 i = 0 while pp != 0 : if pos [ i ] != None : s2 += pos [ i ] pp -= 1 i += 1 print ( s1 + s2 ) elif nn > pp : nn = pp + 1 i = 0 s1 , s2 = 0 , 0 while nn != 0 : if neg [ i ] != None : s1 += neg [ i ] nn -= 1 i += 1 i = 0 while pp != 0 : if pos [ i ] != None : s2 += pos [ i ] pp -= 1 i += 1 print ( s1 + s2 ) else : nn = pp i = 0 s1 , s2 = 0 , 0 while nn != 0 : if neg [ i ] != None : s1 += neg [ i ] nn -= 1 i += 1 i = 0 while pp != 0 : if pos [ i ] != None : s2 += pos [ i ] pp -= 1 i += 1 print ( s1 + s2 )   NEW_LINE


import java . util . Scanner ;   public class LalaLandAppleTrees { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i , a [ ] = new int [ n ] , b [ ] = new int [ n ] , c = 0 , l = 0 ; long s = 0 ;   for ( i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; b [ i ] = in . nextInt ( ) ; s += b [ i ] ; } in . close ( ) ;   while ( c < s ) { int x = Integer . MAX_VALUE , y = Integer . MIN_VALUE , xi = 0 , yi = 0 , xn = 0 , yn = 0 ; for ( i = 0 ; i < n ; i ++ ) {   if ( a [ i ] > 0 ) { if ( a [ i ] < x ) { x = a [ i ] ; xi = i ; } xn ++ ; } else if ( a [ i ] < 0 ) { if ( a [ i ] > y ) { y = a [ i ] ; yi = i ; } yn ++ ; } } if ( xn == 0 && yn == 0 ) break ; if ( l == 0 && xn >= yn || l < 0 && xn > 0 ) { c += b [ xi ] ; l = x ; a [ xi ] = 0 ;   } else if ( l == 0 && xn < yn || l > 0 && yn > 0 ) { c += b [ yi ] ; l = y ; a [ yi ] = 0 ; } else { break ; } } System . out . println ( c ) ; } }


import static java . lang . Math . abs ; import static java . lang . System . out ; import java . util . Scanner ;

n , c1 , c2 = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] s = input ( )   cnt = s . count ( '1' )   def price ( x ) : return c1 + c2 * ( x - 1 ) ** 2   prices = [ ]   for i in range ( 1 , cnt + 1 ) : bigGroupsPeople = n // i + 1 numBigGroups = n % i smallGroupsPeople = n // i numSmallGroups = i - n % i totalPrice = numBigGroups * price ( bigGroupsPeople ) + numSmallGroups * price ( smallGroupsPeople ) prices . append ( totalPrice )   print ( min ( prices ) ) NEW_LINE


t = input ( )   t = t . split ( )   n = int ( t [ 0 ] )   c1 = int ( t [ 1 ] )   c2 = int ( t [ 2 ] )   t = input ( )   d = 0   for i in t :   if ( i == "1" ) :   d = d + 1       min = 10 ** 1488   for i in range ( 1 , d + 1 ) :   t = c1 * i + i * c2 * ( ( ( n // i ) - 1 ) ** 2 ) + c2 * ( n % i ) * ( 2 * ( n // i ) - 1 )   if t < min :   min = t       print ( min )       NEW_LINE


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


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tc = sc . nextInt ( ) ; while ( tc -- > 0 ) { long n = sc . nextLong ( ) ; while ( n % 2 == 0 ) { n /= 2 ; } if ( n == 1 ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } sc . close ( ) ; } }

import math   NEW_LINE def solve ( ) : n = int ( input ( ) ) NEW_LINE if bin ( n ) [ 2 : ] . count ( '1' ) == 1 : NEW_LINE INDENT return False else : NEW_LINE return True   for t in range ( int ( input ( ) ) ) : if NEW_LINE DEDENT solve ( ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


def solve ( n ) : if NEW_LINE INDENT ( n <= 2 ) : NEW_LINE DEDENT return " NO " elif ( n & ( n - 1 ) == 0 ) : NEW_LINE return " NO " else : return " YES " NEW_LINE for i in range ( int ( input ( ) ) ) : print ( solve ( int ( input ( ) ) ) ) NEW_LINE


for _ in ' . ' * int ( input ( ) ) : n = int ( input ( ) ) ; print ( " YNEOS " [ n & - n == n : : 2 ] ) NEW_LINE


t = input ( ) NEW_LINE t = int ( t ) NEW_LINE while t > 0 : n = input ( ) NEW_LINE n = int ( n ) NEW_LINE if ( n & ( n - 1 ) == 0 ) : NEW_LINE INDENT print ( " NO " ) else : NEW_LINE print ( " YES " ) NEW_LINE DEDENT t -= 1   NEW_LINE


for _ in range ( int ( input ( ) ) ) :     NEW_LINE n = bin ( int ( input ( ) ) ) [ 1 : ]   if n != "1" and n . count ( "1" ) == 1 : NEW_LINE INDENT print ( ' NO ' ) else : NEW_LINE print ( ' YES ' ) NEW_LINE DEDENT


import java . io . * ; import java . util . * ; import java . math . * ; import java . awt . Point ; public class Main { static final long MOD = 1000000007L ;


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


import java . io . * ; import java . util . * ;   public class A { public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; PrintWriter pr = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; int t = fr . nextInt ( ) ;   while ( t -- > 0 ) { long n = fr . nextLong ( ) ; while ( ( n & 1 ) != 1 ) n >>= 1 ;   if ( n == 1 ) { pr . println ( " NO " ) ; } else { pr . println ( " YES " ) ; } }   pr . close ( ) ; }   static class Pair { int x , y ;   public Pair ( int x , int y ) { this . x = x ; this . y = y ; } }   static int toInt ( String s ) { return Integer . parseInt ( s ) ; }   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) throws FileNotFoundException { 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 ; } } }


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; long n ; for ( int i = 0 ; i < t ; i ++ ) { n = sc . nextLong ( ) ; if ( ( n & n - 1 ) == 0 ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } } }


import java . util . * ; public class Codeforces { private static void sport ( int [ ] a , int h ) { boolean f = true ; for ( int i = 1 ; i < a . length ; i ++ ) { if ( a [ i - 1 ] > 1 && a [ i ] > 1 ) { f = false ; break ; } } if ( f ) { System . out . println ( " perfect " ) ; return ; } System . out . println ( " ambiguous " ) ; System . out . print ( "0 ▁ " ) ; LinkedList < Integer > queue = new LinkedList < > ( ) ; queue . add ( 1 ) ; for ( int i = 1 ; i < a . length ; i ++ ) { LinkedList < Integer > q = new LinkedList < > ( ) ; Integer poll = queue . removeLast ( ) ; for ( int j = 0 ; j < a [ i ] ; j ++ ) { System . out . print ( poll + " ▁ " ) ; q . addLast ( poll + j + 1 ) ; } queue . clear ( ) ; queue . addAll ( q ) ; } System . out . println ( ) ;

n = int ( input ( ) ) n += 1 l = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 for i in range ( n - 1 ) : if ( l [ i ] > 1 and l [ i + 1 ] > 1 ) : ans = i + 1 breakelse : print ( " perfect " ) exit ( 0 ) print ( " ambiguous " ) prev = 0 now = 0 for i in range ( n ) : for j in range ( l [ i ] ) : print ( prev , end = " ▁ " ) now += 1 prev = nowprint ( ) prev = 0 now = 0 for i in range ( n ) : for j in range ( l [ i ] ) : if ( ans == i ) : print ( prev - 1 , end = " ▁ " ) ans = - 1 else : print ( prev , end = " ▁ " ) now += 1 prev = now NEW_LINE


I = lambda : list ( map ( int , input ( ) . split ( ) ) ) n , = I ( ) l = I ( ) ans = " perfect " f = 0 temp = - 1 node = 1 for i in range ( n ) : if min ( l [ i ] , l [ i + 1 ] ) > 1 : ans = " ambiguous " temp = i + 1 f = 1 breakif not f : print ( ans ) else : a = '0' b = '0' for i in range ( 1 , n + 1 ) : a += ( " ▁ " + str ( node ) ) * l [ i ] if i != temp : b += ( " ▁ " + str ( node ) ) * l [ i ] else : b += ( " ▁ " + str ( node - 1 ) ) + ( ( " ▁ " + str ( node ) ) * ( l [ i ] - 1 ) ) node += l [ i ] print ( ans ) print ( a ) print ( b )       NEW_LINE


import java . io . * ; import java . util . * ; import java . text . DecimalFormat ;   public class Main { static long mod = ( long ) 1e9 + 7 ; static long mod1 = 998244353 ;   public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ;    int t = in . nextInt ( ) ; while ( t -- > 0 ) {   int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int k = in . nextInt ( ) ; int z = n / k ; if ( z >= m ) out . println ( m ) ; else { int rem = m - z ; int i = 1 ; while ( i * ( k - 1 ) < rem ) { i ++ ; } if ( i < z ) out . println ( z - i ) ; else out . println ( 0 ) ; }   } out . close ( ) ; }      static final Random random = new Random ( ) ;   static void ruffleSort ( int [ ] a ) { int n = a . length ;

import matht = int ( input ( ) ) for i in range ( t ) : n , m , k = map ( int , input ( ) . split ( ) ) if m == 0 : print ( 0 ) elif n // k >= m : print ( m ) else : if ( m - n // k ) % ( k - 1 ) == 0 : print ( ( n // k ) - ( ( m - n // k ) // ( k - 1 ) ) ) else : print ( ( n // k ) - ( ( ( m - n // k ) - ( m - n // k ) % ( k - 1 ) ) // ( k - 1 ) + 1 ) ) NEW_LINE


t = int ( input ( ) )   def poker ( n , m , k ) : hands = n // k winning_hand = min ( hands , m ) m -= winning_hand sub = 0 if m // ( k - 1 ) > 0 : sub += m // ( k - 1 ) if m % ( k - 1 ) > 0 : sub += 1 elif m % ( k - 1 ) > 0 : sub += 1   print ( winning_hand - sub )         for i in range ( t ) : n , m , k = map ( int , input ( ) . split ( ) ) poker ( n , m , k )                     NEW_LINE


for i in range ( int ( input ( ) ) ) : a , b , c = list ( map ( int , input ( ) . split ( ) ) ) print ( ( a // c ) + ( - ( b - ( a // c ) ) // ( c - 1 ) ) if a // c < b else b ) NEW_LINE


t = int ( input ( ) )   for i in range ( t ) : n , m , k = map ( int , input ( ) . split ( ) ) d = n // k a1 = min ( m , d ) a2 = ( m - a1 + k - 2 ) // ( k - 1 ) print ( a1 - a2 ) NEW_LINE


t = int ( input ( ) )   for i in range ( t ) : n , m , k = map ( int , input ( ) . split ( ) ) ans = 0 d = n // k for a1 in range ( m + 1 ) : for a2 in range ( a1 + 1 ) : if ( a1 > d ) : continue if ( a1 + a2 > m ) : continue if ( a1 + ( k - 1 ) * a2 < m ) : continue ans = max ( ans , a1 - a2 ) print ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; public class A { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; while ( t -- > 0 ) { int n = fs . nextInt ( ) ; int m = fs . nextInt ( ) ; int k = fs . nextInt ( ) ; int ans = 0 ; int r = n / k ; if ( r >= m ) { ans = m ; } else if ( k > 1 ) ans = r - ( int ) ( Math . ceil ( ( float ) ( m - r ) / ( k - 1 ) ) ) ; System . out . println ( ans ) ; } } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }


import java . util . Scanner ;   public class _0607BerlandPoker { static int BerlandPoker ( int n , int m , int k ) { int single = n / k ; int jokers = Math . min ( single , m ) ; int remainingJokers = m - jokers ; int ans = 0 ; if ( remainingJokers < ( k - 1 ) ) { if ( remainingJokers != 0 ) { ans += 1 ; } } else { ans += remainingJokers / ( k - 1 ) ; if ( remainingJokers % ( k - 1 ) != 0 ) { ans ++ ; } } return jokers - ans ; }   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; System . out . println ( BerlandPoker ( n , m , k ) ) ; cases -- ; } }   }


import java . util . * ;   public class Solve {   static Scanner scan = new Scanner ( System . in ) ;   public static int ceil ( int x , int y ) { return ( x + y - 1 ) / y ; }   public static void solve ( int n , int m , int k ) {   if ( m == 0 ) { System . out . println ( 0 ) ; } else if ( m < ( n / k ) ) { System . out . println ( m ) ; } else { int val = m - ( n / k ) ; m -= ( n / k ) ; int left = ceil ( m , ( k - 1 ) ) ; System . out . println ( ( n / k ) - left ) ; } }   public static void main ( String [ ] args ) {   int t = scan . nextInt ( ) ; while ( t -- > 0 ) { int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int k = scan . nextInt ( ) ;   solve ( n , m , k ) ; } } }


import java . util . * ; public class AntonPoly { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int out = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String str = s . next ( ) ; if ( str . equals ( " Tetrahedron " ) ) { out = out + 4 ; } else if ( str . equals ( " Cube " ) ) { out = out + 6 ; } else if ( str . equals ( " Octahedron " ) ) { out = out + 8 ; } else if ( str . equals ( " Dodecahedron " ) ) { out = out + 12 ; } else if ( str . equals ( " Icosahedron " ) ) { out = out + 20 ; } } System . out . println ( out ) ; } }

n = int ( input ( ) )   mapping = { " Icosahedron " : 20 , " Dodecahedron " : 12 , " Cube " : 6 , " Octahedron " : 8 , " Tetrahedron " : 4 , }   sum = 0 for i in range ( n ) : string = input ( ) sum += mapping [ string ]   print ( sum ) NEW_LINE


num_of_hed = int ( input ( ) ) faces = 0   for i in range ( 0 , num_of_hed ) : str1 = input ( ) if str1 [ 0 ] == " T " : faces += 4 elif str1 [ 0 ] == " C " : faces += 6 elif str1 [ 0 ] == " O " : faces += 8 elif str1 [ 0 ] == " D " : faces += 12 else : faces += 20   print ( faces ) NEW_LINE


n = int ( input ( ) ) c = 0 for i in range ( n ) : s = input ( ) if s [ 0 ] == ' T ' : c += 4 elif s [ 0 ] == ' C ' : c += 6 elif s [ 0 ] == ' O ' : c += 8 elif s [ 0 ] == ' D ' : c += 12 elif s [ 0 ] == ' I ' : c += 20 print ( c ) NEW_LINE


n = int ( input ( ) ) c = 0 for i in range ( n ) : s = input ( ) if ( s == " Tetrahedron " ) : c += 4 if ( s == " Cube " ) : c += 6 if ( s == " Octahedron " ) : c += 8 if ( s == " Dodecahedron " ) : c += 12 if ( s == " Icosahedron " ) : c += 20 print ( c ) NEW_LINE


a = int ( input ( ) ) x = 0 for i in range ( a ) : b = input ( ) if b == " Tetrahedron " : x += 4 elif b == " Cube " : x += 6 elif b == " Octahedron " : x += 8 elif b == " Dodecahedron " : x += 12 else : x += 20 print ( x ) NEW_LINE


import java . util . * ; public class Anton { 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 ++ ) { String s = sc . next ( ) ; if ( s . contains ( " Tetrahedron " ) ) sum = sum + 4 ; else if ( s . contains ( " Cube " ) ) sum = sum + 6 ; else if ( s . contains ( " Octahedron " ) ) sum = sum + 8 ; else if ( s . contains ( " Dodecahedron " ) ) sum = sum + 12 ; else if ( s . contains ( " Icosahedron " ) ) sum = sum + 20 ; } System . out . println ( sum ) ; } }


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; HashMap < String , Integer > hm = new HashMap < String , Integer > ( ) ; hm . put ( " Tetrahedron " , 4 ) ; hm . put ( " Cube " , 6 ) ; hm . put ( " Octahedron " , 8 ) ; hm . put ( " Dodecahedron " , 12 ) ; hm . put ( " Icosahedron " , 20 ) ; String str ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { str = sc . next ( ) ; sum = sum + hm . get ( str ) ; } System . out . println ( sum ) ;   } }


import java . util . Scanner ;   public class AntonAndPoly { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ; scanner . nextLine ( ) ;   int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { String poly = scanner . nextLine ( ) . trim ( ) ; switch ( poly ) { case " Tetrahedron " : res += 4 ; break ; case " Cube " : res += 6 ; break ; case " Octahedron " : res += 8 ; break ; case " Dodecahedron " : res += 12 ; break ; case " Icosahedron " : res += 20 ; break ; } } System . out . println ( res ) ; } }


import java . awt . * ; import java . io . * ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . * ; import java . util . List ; import java . util . Queue ;   import static java . lang . Math . max ; import static java . lang . Math . min ;    public class B implements Runnable {

n , k = map ( int , input ( ) . split ( ) ) NEW_LINE b = list ( map ( int , input ( ) . split ( ) ) )   taken = [ False for i in range ( n + 2 ) ] NEW_LINE a = [ ]   for i in range ( n ) : has = - 1 NEW_LINE for j in range ( 1 , n + 1 ) : if NEW_LINE not taken [ j ] and b [ j - 1 ] == 0 : has = j NEW_LINE break NEW_LINE a . append ( has ) NEW_LINE taken [ has ] = True NEW_LINE for j in range ( 1 , has - k + 1 ) : b [ j - 1 ] -= 1   print ( * a ) NEW_LINE


s = input ( ) NEW_LINE l = s . split ( )   n = int ( l [ 0 ] ) NEW_LINE k = int ( l [ 1 ] )   s = input ( ) NEW_LINE l = s . split ( )   b = [ - 1 ]   for i in range ( 1 , n + 1 ) : b . append ( int ( l [ i - 1 ] ) )   for i in range ( 1 , n + 1 ) :     NEW_LINE j = 1 NEW_LINE while b [ j ] != 0 : j += 1   b [ j ] -= 1 NEW_LINE print ( j , end = ' ▁ ' )   for t in range ( 1 , n + 1 ) : if NEW_LINE j - k >= t : b [ t ] -= 1   NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ; public class FastIO { BufferedReader br ; StringTokenizer st ; public FastIO ( ) { 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 ) throws IOException { FastIO io = new FastIO ( ) ; long n = io . nextInt ( ) ; System . out . println ( findSuperLucky ( n , 0 , 0 , 0 ) ) ; } static long findSuperLucky ( long n , int f , int s , long formed ) { if ( formed >= n && f == s ) { return formed ; } if ( formed > n * 100 ) { return Long . MAX_VALUE ; } return Math . min ( findSuperLucky ( n , f + 1 , s , formed * 10 + 4 ) , findSuperLucky ( n , f , s + 1 , formed * 10 + 7 ) ) ; } }

n = int ( input ( ) ) NEW_LINE l = [ 0 ] NEW_LINE i = 0 NEW_LINE while True : NEW_LINE INDENT t = l [ i ] NEW_LINE if t >= n : NEW_LINE INDENT if str ( t ) . count ( '7' ) == str ( t ) . count ( '4' ) : NEW_LINE INDENT print ( t ) ; NEW_LINE break NEW_LINE DEDENT DEDENT l += [ t * 10 + 4 , t * 10 + 7 ] NEW_LINE i += 1 NEW_LINE DEDENT


def luckynumwithequalnumberoffourandseven ( x , n , a ) : NEW_LINE INDENT if x >= n and str ( x ) . count ( "4" ) == str ( x ) . count ( "7" ) : NEW_LINE INDENT a . append ( x ) NEW_LINE DEDENT else : NEW_LINE INDENT if x < 1e12 : NEW_LINE INDENT luckynumwithequalnumberoffourandseven ( x * 10 + 4 , n , a ) NEW_LINE luckynumwithequalnumberoffourandseven ( x * 10 + 7 , n , a ) NEW_LINE DEDENT DEDENT return a NEW_LINE DEDENT def main ( ) : NEW_LINE INDENT n = int ( input ( ) ) NEW_LINE s = [ ] NEW_LINE luckynumwithequalnumberoffourandseven ( 0 , n , s ) NEW_LINE s = sorted ( s ) NEW_LINE print ( s [ 0 ] ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT main ( ) NEW_LINE DEDENT


a = [ ] NEW_LINE def f ( n , x ) : NEW_LINE INDENT if x <= 1e11 : NEW_LINE INDENT if x >= n and str ( x ) . count ( '4' ) == str ( x ) . count ( '7' ) : NEW_LINE INDENT a . append ( x ) NEW_LINE DEDENT f ( n , 10 * x + 4 ) NEW_LINE f ( n , 10 * x + 7 ) NEW_LINE DEDENT DEDENT f ( int ( input ( ) ) , 0 ) NEW_LINE a . sort ( ) NEW_LINE print ( a [ 0 ] ) NEW_LINE


slucky = [ 4 , 7 ] NEW_LINE i = 0 NEW_LINE while slucky [ - 1 ] < 10 ** 9 : NEW_LINE INDENT slucky . append ( slucky [ i ] * 10 + 4 ) NEW_LINE slucky . append ( slucky [ i ] * 10 + 7 ) NEW_LINE i += 1 NEW_LINE DEDENT def superlucky ( n ) : NEW_LINE INDENT four = 0 NEW_LINE seven = 0 NEW_LINE while n > 0 : NEW_LINE INDENT if n % 10 == 4 : NEW_LINE INDENT four += 1 NEW_LINE DEDENT else : NEW_LINE INDENT seven += 1 NEW_LINE DEDENT n = n // 10 NEW_LINE DEDENT if four == seven : NEW_LINE INDENT return True NEW_LINE DEDENT return False NEW_LINE DEDENT lucky = [ ] NEW_LINE for item in slucky : NEW_LINE INDENT if superlucky ( item ) : NEW_LINE INDENT lucky . append ( item ) NEW_LINE DEDENT DEDENT lucky = [ 0 ] + lucky + [ 4444477777 ] NEW_LINE def binarySearch ( n ) : NEW_LINE INDENT left = 0 NEW_LINE right = len ( lucky ) - 1 NEW_LINE mid = ( left + right ) // 2 NEW_LINE while left <= right : NEW_LINE INDENT mid = ( left + right ) // 2 NEW_LINE if lucky [ mid - 1 ] < n <= lucky [ mid ] : NEW_LINE INDENT print ( lucky [ mid ] ) NEW_LINE break NEW_LINE DEDENT elif n > lucky [ mid ] : NEW_LINE INDENT left = mid + 1 NEW_LINE DEDENT else : NEW_LINE INDENT right = mid - 1 NEW_LINE DEDENT DEDENT DEDENT n = int ( input ( ) ) NEW_LINE binarySearch ( n ) NEW_LINE


import java . io . IOException ; import java . util . * ; import java . util . Arrays ; import java . util . Scanner ; public class Bit_year { static Set < String > set ; public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; set = new TreeSet < String > ( ) ; System . out . println ( ( long ) permute ( n ) ) ; } public static long permute ( int n ) { int pow = 2 ; while ( pow <= 10 ) { char [ ] ar = new char [ pow ] ; for ( int i = 0 ; i < pow / 2 ; i ++ ) ar [ i ] = '4' ; for ( int i = pow / 2 ; i < pow ; i ++ ) ar [ i ] = '7' ; permuteHelper ( ar , 0 ) ; for ( String s : set ) { if ( Long . parseLong ( s ) >= n ) { return Long . parseLong ( s ) ; } } pow += 2 ; } return 0 ; } private static void permuteHelper ( char [ ] arr , int index ) { if ( index >= arr . length - 1 ) { set . add ( new String ( arr ) ) ; return ; } for ( int i = index ; i < arr . length ; i ++ ) { char t = arr [ index ] ; arr [ index ] = arr [ i ] ; arr [ i ] = t ; permuteHelper ( arr , index + 1 ) ; t = arr [ index ] ; arr [ index ] = arr [ i ] ; arr [ i ] = t ; } } }


import java . util . * ; public class LuckyNumbersEasy { static ArrayList < Long > arr = new ArrayList < > ( ) ; static double cons = Math . pow ( 10 , 12 ) ; static long n ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; StringBuilder sb = new StringBuilder ( ) ; n = sc . nextLong ( ) ; calc ( 0 ) ; Collections . sort ( arr ) ; System . out . println ( arr . get ( 0 ) ) ; } public static void calc ( long i ) { if ( i > cons ) { return ; } String [ ] temp = Long . toString ( i ) . split ( " " ) ; long s = 0 ; long f = 0 ; for ( String x : temp ) { if ( x . equals ( "4" ) ) { f ++ ; } else { s ++ ; } } if ( i >= n && s == f ) { arr . add ( i ) ; } calc ( ( i * 10 ) + 4 ) ; calc ( ( i * 10 ) + 7 ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main {    public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int s = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] arrx = new int [ n ] ; int [ ] arry = new int [ n ] ; int [ ] sortedx = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arrx [ i ] = sc . nextInt ( ) ; sortedx [ i ] = arrx [ i ] ; arry [ i ] = sc . nextInt ( ) ; } Arrays . sort ( sortedx ) ; boolean ans = true ; for ( int i = 0 ; i < n ; i ++ ) { if ( sortedx [ i ] < s ) { int idx = find ( sortedx [ i ] , arrx ) ; s += arry [ idx ] ; } else { ans = false ; break ; } } if ( ans ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } public static int find ( int x , int [ ] arr ) { int ans = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] == x ) { ans = i ; arr [ i ] = - 1 ; break ; } } return ans ; } }

f = lambda : map ( int , input ( ) . split ( ) ) s , n = f ( ) for a , b in sorted ( list ( f ( ) ) for i in ' ▁ ' * n ) : s = ( s + b ) * ( s > a ) print ( ' YNEOS ' [ s < 1 : : 2 ] ) NEW_LINE


s , n = [ int ( i ) for i in input ( ) . split ( ) ] dr = [ ]   for i in range ( n ) : dr . append ( [ int ( j ) for j in input ( ) . split ( ) ] )   dr . sort ( )   for i in range ( n ) : if s > dr [ i ] [ 0 ] : s += dr [ i ] [ 1 ] else : print ( " NO " ) exit ( 0 ) print ( " YES " )       NEW_LINE


import sysimport itertoolsimport collections     def rs ( x = ' ' ) : return sys . stdin . readline ( ) . strip ( ) if len ( x ) == 0 else input ( x ) . strip ( ) def ri ( x = ' ' ) : return int ( rs ( x ) ) def rm ( x = ' ' ) : return map ( str , rs ( x ) . split ( ) ) def rl ( x = ' ' ) : return rs ( x ) . split ( ) def rmi ( x = ' ' ) : return map ( int , rs ( x ) . split ( ) ) def rli ( x = ' ' ) : return [ int ( x ) for x in rs ( x ) . split ( ) ] def println ( val ) : sys . stdout . write ( str ( val ) + ' \n ' )     def solve ( testCase ) : s , n = rmi ( ) A = [ tuple ( rmi ( ) ) for _ in range ( n ) ] A . sort ( ) for x , y in A : if x < s : s += y else : print ( ' NO ' ) return print ( ' YES ' )     for _ in range ( ri ( ) if 0 else 1 ) : solve ( _ + 1 ) NEW_LINE


a = lambda : map ( int , input ( ) . split ( ) ) s , n = a ( ) g = 0 l = [ ] for i in ' ▁ ' * n : l . append ( ( list ( a ( ) ) ) ) l . sort ( ) for i in range ( n ) : if l [ i ] [ 0 ] < s : s += l [ i ] [ 1 ] else : g = 1 print ( [ ' YES ' , ' NO ' ] [ g == 1 ] ) NEW_LINE


s , n = map ( int , input ( ) . split ( ) ) dragons = [ ] for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) dragons += [ [ x , y ] ] dragons . sort ( ) ans = ' YES ' for i in range ( n ) : if s > dragons [ i ] [ 0 ] : s += dragons [ i ] [ 1 ] else : ans = ' NO ' breakprint ( ans ) NEW_LINE


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


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


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


import java . util . * ; import java . math . * ; public class ConnerAndMarkland { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int runs = sc . nextInt ( ) ; while ( runs -- > 0 ) { int n = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; ArrayList < Integer > arr = new ArrayList < > ( ) ; for ( int i = 0 ; i < k ; i ++ ) arr . add ( sc . nextInt ( ) ) ;   for ( int i = 0 ; i <= k ; i ++ ) { if ( s - i >= 1 && ! arr . contains ( s - i ) ) { System . out . println ( i ) ; break ; } if ( s + i <= n && ! arr . contains ( s + i ) ) { System . out . println ( i ) ; break ; } } } } }

for _ in range ( int ( input ( ) ) ) : n , s , k = [ int ( x ) for x in input ( ) . split ( ) ] fl = { int ( x ) for x in input ( ) . split ( ) } i = 0 while 1 : if max ( s - i , 1 ) not in fl or min ( n , s + i ) not in fl : print ( i ) ; break i += 1 NEW_LINE


for _ in range ( int ( input ( ) ) ) :   n , k , s = map ( int , input ( ) . split ( ) ) t = list ( map ( int , input ( ) . split ( ) ) )   if k not in t : print ( 0 ) else : dist = 1 while k + dist <= n or k - dist >= 1 : if k + dist > n : if k - dist not in t : break elif k - dist <= 0 : if k + dist not in t : break elif k + dist not in t or k - dist not in t : break dist += 1 print ( dist ) NEW_LINE


adet = int ( input ( ' ' ) ) liste = [ ] for _ in range ( adet ) : p1 = input ( ' ' ) p2 = input ( ' ' ) liste . append ( ( p1 , p2 ) ) for __ in liste : occ = __ [ 1 ] . split ( ) mevcut_konum = int ( __ [ 0 ] . split ( ) [ 1 ] ) finder1 = mevcut_konum finder2 = mevcut_konum while True : if str ( finder1 ) not in occ : print ( abs ( finder1 - mevcut_konum ) ) break elif str ( finder2 ) not in occ : print ( abs ( finder2 - mevcut_konum ) ) break if finder1 < int ( __ [ 0 ] . split ( ) [ 0 ] ) : finder1 += 1 if finder2 > 1 : finder2 -= 1 NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;     public class A {   private static long INF = 2000000000000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   long n = sc . nextLong ( ) , s = sc . nextLong ( ) ; int k = sc . nextInt ( ) ; HashSet < Long > set = new HashSet < Long > ( ) ; long i = s , j = s ; for ( int ii = 0 ; ii < k ; ii ++ ) { long a = sc . nextLong ( ) ; set . add ( a ) ; while ( set . contains ( j ) ) j ++ ; while ( set . contains ( i ) ) i -- ; } long min = INF ; if ( i > 0 ) min = min ( min , s - i ) ; if ( j <= n ) min = min ( min , j - s ) ; System . out . println ( min ) ;   }


import java . util . * ; import java . io . * ;   public class CFA { BufferedReader br ; PrintWriter out ; StringTokenizer st ; boolean eof ;


import java . io . IOException ; import java . util . * ; import java . util . Arrays ; import java . util . Scanner ;   public class Bit_year {   public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; String s = sc . next ( ) ; char [ ] ch = s . toCharArray ( ) ; List < Integer > heavy = new ArrayList < Integer > ( ) ; List < Integer > metal = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < ch . length ; i ++ ) { if ( i + 5 > s . length ( ) ) break ; String t = s . substring ( i , i + 5 ) ;

import sys   text = sys . stdin . readline ( ) . strip ( )   i = 0 heavys = 0 result = 0 while ( i + 5 ) <= len ( text ) : if text [ i : i + 5 ] == " heavy " : heavys += 1 i += 5 elif text [ i : i + 5 ] == " metal " : result += heavys i += 5 else : i += 1 print ( result )   NEW_LINE


string = input ( ' ' ) heavy = list ( ) metal = list ( ) start = 0 while ( string . find ( " heavy " , start ) != - 1 ) : heavy . append ( string . find ( " heavy " , start ) ) start = string . find ( " heavy " , start ) + 5 start = 0 while ( string . find ( " metal " , start ) != - 1 ) : metal . append ( string . find ( " metal " , start ) ) start = string . find ( " metal " , start ) + 5 start = 0 output = 0 for i in range ( len ( heavy ) ) : for j in range ( start , len ( metal ) ) : if heavy [ i ] > metal [ j ] : continue else : output = output + ( len ( metal ) - j ) start = j break   print ( output ) NEW_LINE


s = input ( ) l = len ( s ) i = length = sub = 0 while 1 : if i <= l - 5 : if s [ i : i + 5 ] == ' heavy ' : length += 1 i += 5 elif s [ i : i + 5 ] == ' metal ' : sub += length i += 5 else : i += 1 else : breakprint ( sub ) NEW_LINE


aisa = input ( ) kyu = 0 channa = 0 for i in range ( len ( aisa ) - 4 ) : if aisa [ i : i + 5 ] == ' heavy ' : kyu += 1 if aisa [ i : i + 5 ] == ' metal ' : channa += kyuprint ( channa )   NEW_LINE


import java . util . * ; import java . io . * ; import java . lang . * ; public class Codeforces { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { if ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( Exception e ) {   } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } public static void main ( String [ ] args ) { new Codeforces ( ) . solve ( ) ; } void solve ( ) { String str = next ( ) ; long cnt = 0 , res = 0 ; for ( int i = 0 ; i < str . length ( ) - 4 ; i ++ ) { if ( str . substring ( i , i + 5 ) . equals ( " heavy " ) ) cnt ++ ; else if ( str . substring ( i , i + 5 ) . equals ( " metal " ) ) res += cnt ; } out . println ( res ) ; out . close ( ) ; } }


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import javafx . util . Pair ;   public class CodeForce { static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringBuilder sb = new StringBuilder ( ) ;   static boolean flag = false ; static int next ( String [ ] sr , int ind ) { return Integer . parseInt ( sr [ ind ] ) ; }   public static void main ( String [ ] args ) throws IOException { String sr = br . readLine ( ) ; long count = 0 ; long total = 0 ; if ( sr . length ( ) < 10 ) System . out . println ( "0" ) ; else { for ( int i = sr . length ( ) - 5 ; i >= 0 ; i -- ) { if ( sr . charAt ( i ) == ' m ' ) { if ( sr . substring ( i , i + 5 ) . equals ( " metal " ) ) count ++ ; } if ( sr . charAt ( i ) == ' h ' ) { if ( sr . substring ( i , i + 5 ) . equals ( " heavy " ) ) total += count ; } } System . out . println ( total ) ;      }       }    }


import java . io . * ; import java . util . * ;   public class Main { static BufferedReader reader ; static StringTokenizer tokenizer ; static PrintWriter writer ;   static int nextInt ( ) throws IOException { return Integer . parseInt ( nextToken ( ) ) ; }   static long nextLong ( ) throws IOException { return Long . parseLong ( nextToken ( ) ) ; }   static double nextDouble ( ) throws IOException { return Double . parseDouble ( nextToken ( ) ) ; }   static String nextToken ( ) throws IOException { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } return tokenizer . nextToken ( ) ; } static String nexts ( ) throws IOException { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; String s = " " ; while ( tokenizer . hasMoreTokens ( ) ) { s += tokenizer . nextElement ( ) + " ▁ " ; } return s ; }


import java . util . * ; import java . io . * ; public class a { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- > 0 ) { int n = s . nextInt ( ) ; int [ ] arr = new int [ n + 1 ] ; for ( int i = 1 ; i < arr . length ; i ++ ) { arr [ i ] = s . nextInt ( ) ; } if ( n == 1 && arr [ 1 ] % 2 != 0 ) { System . out . println ( " - 1" ) ; } else if ( arr [ 1 ] % 2 == 0 ) { System . out . println ( "1" ) ; System . out . println ( "1" ) ; } else if ( arr [ 2 ] % 2 == 0 ) { System . out . println ( "1" ) ; System . out . println ( "2" ) ; } else { System . out . println ( "2" ) ; System . out . println ( "1 ▁ 2" ) ; } } } }

for _ in [ 0 ] * int ( input ( ) ) : n = input ( ) a = [ * map ( int , input ( ) . split ( ) ) ] if a [ 0 ] % 2 == 0 : print ( '1 \n 1' ) elif n == '1' : print ( - 1 ) elif a [ 1 ] % 2 == 0 : print ( '1 \n 2' ) else : print ( '2 \n 1 ▁ 2' ) NEW_LINE


T = int ( input ( ) ) while T > 0 : T -= 1 n = int ( input ( ) ) lst = [ int ( x ) for x in input ( ) . strip ( ) . split ( ) ] if len ( lst ) == 0 : print ( - 1 ) continue if len ( lst ) == 1 and lst [ 0 ] % 2 : print ( - 1 ) continue d = lst [ 0 ] if not d % 2 : print ( "1 \n 1" ) continue if lst [ 1 ] % 2 : print ( "2 \n 1 ▁ 2" ) else : print ( "1 \n 2" ) NEW_LINE


from sys import stdininput = stdin . readline   t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] if n == 1 and a [ 0 ] % 2 > 0 : print ( - 1 ) continue odd = [ ] for i in range ( n ) : if a [ i ] % 2 == 0 : print ( 1 ) print ( i + 1 ) break else : odd . append ( i + 1 ) if len ( odd ) == 2 : print ( 2 ) print ( * odd ) break NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) c = 0 for i in range ( n ) : if a [ i ] % 2 == 0 : print ( 1 ) print ( i + 1 ) c += 1 break if c == 0 : for j in range ( n ) : if n == 1 : print ( - 1 ) c += 1 break elif a [ j ] % 2 != 0 and a [ j + 1 ] % 2 != 0 : print ( 2 ) print ( j + 1 , j + 2 ) c += 1 break if c == 0 : print ( - 1 ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = tuple ( map ( int , input ( ) . split ( ) ) ) if n == 1 : if not a [ 0 ] % 2 : print ( 1 ) print ( 1 ) else : print ( - 1 ) else : if not a [ 0 ] % 2 : print ( 1 ) print ( 1 ) elif not a [ 1 ] % 2 : print ( 1 ) print ( 2 ) else : print ( 2 ) print ( 1 , 2 ) NEW_LINE


import java . util . * ; public class Practi {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int arr [ ] = new int [ 105 ] ; for ( int i = 1 ; i <= n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } if ( n == 1 && arr [ 1 ] % 2 == 1 ) System . out . println ( " - 1" ) ; else { if ( arr [ 1 ] % 2 == 0 ) System . out . println ( "1 \n 1" ) ; else if ( arr [ 2 ] % 2 == 0 ) System . out . println ( "1 \n 2" ) ; else System . out . println ( "2 \n 1 ▁ 2" ) ; } } }   }


import java . util . * ; import java . io . * ; import java . lang . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int id = - 1 ; ArrayList < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; if ( arr [ i ] % 2 == 1 ) a . add ( i + 1 ) ; else if ( id == - 1 ) id = i + 1 ; } if ( id != - 1 ) { System . out . print ( 1 + " \n " + id ) ; System . out . println ( ) ; } else { if ( a . size ( ) >= 2 ) { System . out . print ( 2 + " \n " + a . get ( 0 ) + " ▁ " + a . get ( 1 ) ) ; System . out . println ( ) ; } else System . out . println ( - 1 ) ; } } } }


import java . util . * ; import java . io . * ; import java . math . * ;   public class x190B { public static void main ( String omkar [ ] ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; long x1 = Long . parseLong ( st . nextToken ( ) ) ; long y1 = Long . parseLong ( st . nextToken ( ) ) ; long r1 = Long . parseLong ( st . nextToken ( ) ) ; st = new StringTokenizer ( infile . readLine ( ) ) ; long x2 = Long . parseLong ( st . nextToken ( ) ) ; long y2 = Long . parseLong ( st . nextToken ( ) ) ; long r2 = Long . parseLong ( st . nextToken ( ) ) ; double dist = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ; dist = Math . sqrt ( dist ) ; dist -= r1 + r2 ; if ( dist > 0 ) System . out . println ( dist / 2 ) ; else {

import mathx1 , y1 , r1 = map ( int , input ( ) . split ( ) ) x2 , y2 , r2 = map ( int , input ( ) . split ( ) ) d = math . sqrt ( ( x1 - x2 ) ** 2 + ( y1 - y2 ) ** 2 ) R = max ( r1 , r2 ) r = min ( r1 , r2 ) NEW_LINE