import java . io . * ; import java . util . * ; import java . lang . * ;   public class B {   public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int n = in . nextInt ( ) , k = in . nextInt ( ) ; int [ ] arr = in . readArray ( n ) ; long [ ] pre = new long [ n - k + 1 ] ; Pair [ ] dp = new Pair [ n - k + 1 ] ; long ans = 0 ; for ( int i = 0 ; i < k ; i ++ ) { ans += arr [ i ] ; } pre [ 0 ] = ans ; for ( int i = 1 ; i <= n - k ; i ++ ) { ans -= arr [ i - 1 ] ; ans += arr [ i + k - 1 ] ; pre [ i ] = ans ; } dp [ dp . length - 1 ] = new Pair ( pre [ n - k ] , n - k + 1 ) ; for ( int i = pre . length - 2 ; i >= 0 ; i -- ) { if ( pre [ i ] >= dp [ i + 1 ] . a ) dp [ i ] = new Pair ( pre [ i ] , i + 1 ) ; else dp [ i ] = dp [ i + 1 ] ; } ans = 0 ; int first = - 1 , second = - 1 ; for ( int i = 0 ; i <= n - 2 * k ; i ++ ) { if ( ans < pre [ i ] + dp [ i + k ] . a ) { ans = pre [ i ] + dp [ i + k ] . a ; first = i + 1 ; second = ( int ) dp [ i + k ] . b ; } } System . out . println ( first + " ▁ " + second ) ; }   static final Random random = new Random ( ) ;


import mathimport timefrom collections import defaultdict , deque , Counterfrom sys import stdin , stdoutfrom bisect import bisect_left , bisect_rightimport sysfrom heapq import heapify , heappush , heappop n , k = map ( int , stdin . readline ( ) . split ( ) ) a = list ( map ( int , stdin . readline ( ) . split ( ) ) ) sarr = [ sum ( a [ : k ] ) ] for i in range ( 1 , n - k + 1 ) : sarr . append ( sarr [ - 1 ] - a [ i - 1 ] + a [ i + k - 1 ] ) l = len ( sarr ) m = [ 0 ] * l m [ l - 1 ] = sarr [ l - 1 ] for i in range ( l - 2 , - 1 , - 1 ) : m [ i ] = max ( m [ i + 1 ] , sarr [ i ] ) ans = 0 for i in range ( l - k ) : if ( sarr [ i ] + m [ i + k ] ) > ans : ans = sarr [ i ] + m [ i + k ] top = isec = sarr [ top + k : ] . index ( max ( sarr [ top + k : ] ) ) + top + kprint ( top + 1 , sec + 1 )   NEW_LINE


def main ( ) : wynik = 0 para = ( 0 , 0 ) n , k = input ( ) . split ( ) n , k = int ( n ) , int ( k ) odl = [ ] tab = list ( map ( int , input ( ) . split ( ) ) ) pocz = tab [ 0 ] odl = [ pocz ] for i in range ( 1 , n ) : if i < k : odl . append ( odl [ i - 1 ] + tab [ i ] ) else : odl . append ( odl [ i - 1 ] + tab [ i ] - tab [ i - k ] ) odl = odl [ k - 1 : ] maks = odl [ - 1 ] maksy = [ ] b = n - k + 1 for i in range ( len ( odl ) - 1 , - 1 , - 1 ) : if odl [ i ] >= maks : maks = odl [ i ] b = i + 1 maksy . append ( ( maks , b ) ) maksy . reverse ( ) for i in range ( 0 , len ( odl ) - k ) : if odl [ i ] + maksy [ i + k ] [ 0 ] > wynik : wynik = odl [ i ] + maksy [ i + k ] [ 0 ] para = ( i + 1 , maksy [ i + k ] [ 1 ] ) return f ' { para [ 0 ] } ▁ { para [ 1 ] } '     print ( main ( ) ) NEW_LINE


import java . io . * ;   import java . util . * ;   public class CodeForce { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] str = br . readLine ( ) . split ( " " ) ; String [ ] s = br . readLine ( ) . split ( " " ) ; int [ ] arr = new int [ 10 ] ; int k = 0 ; HashMap < Integer , Integer > set = new HashMap < > ( ) ; for ( int i = 0 ; i < str . length ; i ++ ) { k = Integer . parseInt ( str [ i ] ) ; if ( k == 5 ) k = 2 ; if ( k == 9 ) k = 6 ; set . put ( k , set . getOrDefault ( k , 0 ) + 1 ) ; } for ( int j = 0 ; j < s . length ; j ++ ) { if ( s [ j ] . equals ( "5" ) || s [ j ] . equals ( "2" ) ) { arr [ 5 ] ++ ; arr [ 2 ] ++ ; } else if ( s [ j ] . equals ( "6" ) || s [ j ] . equals ( "9" ) ) { arr [ 6 ] ++ ; arr [ 9 ] ++ ; } else arr [ Integer . parseInt ( s [ j ] ) ] ++ ; } Set < Integer > map = set . keySet ( ) ; int min = Integer . MAX_VALUE ; for ( int a : map ) { min = Math . min ( min , arr [ a ] / set . get ( a ) ) ; } System . out . println ( min ) ; }   }

def c ( a , b ) : a = a . replace ( '6' , '9' ) a = a . replace ( '2' , '5' ) b = b . replace ( '6' , '9' ) b = b . replace ( '2' , '5' ) n = 10000 for i in '01345789' : t = a . count ( i ) if t != 0 : n = min ( n , b . count ( i ) // t ) return na = input ( ) b = input ( ) print ( c ( a , b ) ) NEW_LINE


from collections import defaultdictimport matht = input ( ) s = input ( ) tomake = defaultdict ( lambda : 0 ) for i in t : if ( i == '5' ) : tomake [ '2' ] += 1 elif ( i == '9' ) : tomake [ '6' ] += 1 else : tomake [ i ] += 1 fro = defaultdict ( lambda : 0 ) for i in s : if ( i == '5' ) : fro [ '2' ] += 1 elif ( i == '9' ) : fro [ '6' ] += 1 else : fro [ i ] += 1 ans = math . inffor i in tomake . keys ( ) : ans = min ( ans , fro [ i ] // tomake [ i ] ) print ( ans ) NEW_LINE


def convert_string ( string_list , len_string_list ) : change_dict = { } change_dict [ '9' ] = '6' change_dict [ '5' ] = '2' for i in range ( len_string_list ) : if string_list [ i ] in change_dict : string_list [ i ] = change_dict [ string_list [ i ] ] NEW_LINE


def re ( s ) : t = " " for i in s : if ( i == "2" or i == "5" ) : t += " a " elif ( i == "6" or i == "9" ) : t += " b " else : t += i return tfrom collections import defaultdict as dddef main ( ) : t = re ( input ( ) ) s = re ( input ( ) ) req = dd ( int ) hv = dd ( int ) ans = 10 ** 9 for i in t : req [ i ] += 1 for j in s : hv [ j ] += 1 for i in t : ans = min ( ans , hv [ i ] // req [ i ] ) print ( ans ) main ( ) NEW_LINE


import java . io . * ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Sheldon { public static void main ( String [ ] args ) {   FastReader in = new FastReader ( ) ; OutputStream outputStream = System . out ; PrintWriter out = new PrintWriter ( outputStream ) ; int i , j , a , b , c , n , k , l , m , l1 ; String s , s1 , s2 ; boolean is1 = false , is = false , was = false ; long sum = 0 ; int [ ] brr = new int [ 10 ] ; int [ ] arr = new int [ 10 ] ; int [ ] crr = new int [ 10 ] ;


import java . lang . reflect . Array ; import java . util . * ; import java . util . function . Function ; import java . util . stream . Collectors ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Random ; import java . util . StringTokenizer ; import java . io . * ; import java . math . * ;   public class CC { static class pair implements Comparable < pair > { int x ; long y ; pair ( int x , long y ) { this . x = x ; this . y = y ; } public int compareTo ( pair o ) { return ( int ) ( y - o . y ) ; }   } static ArrayList < Long > num = new ArrayList < > ( ) ; static void printPermutn ( String str , String ans ) {

from sys import stdinn = int ( stdin . readline ( ) ) s = stdin . readline ( ) [ : - 1 ] ans = 10000 t = ' ACTG ' for i in range ( n - 3 ) : r = s [ i : i + 4 ] c = 0 for j in range ( 4 ) : x = ( ( ord ( r [ j ] ) - ord ( t [ j ] ) + 26 ) % 26 ) y = ( ( ord ( t [ j ] ) - ord ( r [ j ] ) + 26 ) % 26 ) c = c + min ( x , y ) ans = min ( ans , c ) print ( ans ) NEW_LINE


n = int ( input ( ) ) string = input ( ) gnome = [ ord ( ' A ' ) , ord ( ' C ' ) , ord ( ' T ' ) , ord ( ' G ' ) ] result = [ ] for i in range ( len ( string ) - 3 ) : gnome_new = [ ord ( string [ i ] ) , ord ( string [ i + 1 ] ) , ord ( string [ i + 2 ] ) , ord ( string [ i + 3 ] ) ] a = list ( map ( lambda x : ( 26 - abs ( x [ 0 ] - x [ 1 ] ) ) if abs ( x [ 0 ] - x [ 1 ] ) > 13 else abs ( x [ 0 ] - x [ 1 ] ) , zip ( gnome_new , gnome ) ) ) result . append ( sum ( [ 1 if x == 25 else x for x in a ] ) ) print ( min ( result ) ) NEW_LINE


import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class a { static long [ ] count , count1 ; static long [ ] arr ; static char [ ] ch , ch1 ; static long [ ] darr ; static long [ ] [ ] mat , mat1 ; static int x , h ; static long maxl ; static double dec ; static String s ; static long minl ; static int mx = ( int ) 1e6 ; static long mod = 998244353l ;


import java . util . Scanner ;   public class _0732MaximandBiology { static int countSteps ( String s ) { String check = " ACTG " ; int steps = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int val = Math . abs ( check . charAt ( i ) - s . charAt ( i ) ) ; steps += Math . min ( val , 26 - val ) ; } return steps ; }   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int minSteps = Integer . MAX_VALUE ; for ( int i = 0 ; i < s . length ( ) - 3 ; i ++ ) { minSteps = Math . min ( minSteps , countSteps ( s . substring ( i , i + 4 ) ) ) ; } System . out . println ( minSteps ) ; }   }


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

n , k = map ( int , input ( ) . split ( ) ) l = 2 * k + 1 stack = [ ] if 0 < n % l < ( k + 1 ) : for i in range ( 1 , n + 1 , l ) : stack . append ( i ) else : for i in range ( k + 1 , n + 1 , l ) : stack . append ( i ) print ( len ( stack ) ) print ( * stack ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   if n == 1 : print ( 1 ) print ( 1 ) exit ( )   if k >= n // 2 : print ( 1 ) print ( ( n + 1 ) // 2 ) else : m = 1001 temp = - 1 for r1 in range ( 0 , k + 1 ) : for r2 in range ( 0 , k + 1 ) : t = n - ( r1 + 1 + k ) - ( r2 + 1 + k ) if t < 0 : continue if t % ( 2 * k + 1 ) == 0 : x = t // ( 2 * k + 1 ) if x + 2 <= m : m = x + 2 temp = [ r1 , r2 , x ] print ( m ) r1 , r2 , x = temp ans = [ r1 + 1 ] for i in range ( x ) : cur = ans [ - 1 ] ans . append ( cur + 2 * k + 1 ) ans . append ( n - r2 ) print ( * ans ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) c = k + 1 if n % ( 2 * k + 1 ) >= k + 1 or n % ( 2 * k + 1 ) == 0 else 1 ans = [ ] while c <= n : ans . append ( c ) c += 2 * k + 1 if ans [ - 1 ] + k < n : ans . append ( min ( n , ans [ - 1 ] + k * 2 + 1 ) ) print ( len ( ans ) ) print ( * ans ) NEW_LINE


from sys import stdin as ulazinput = ulaz . readlinen , k = map ( int , input ( ) . split ( ) ) naj = float ( " inf " ) koje = [ ] for i in range ( k + 1 ) : ostale = n - k - 1 - i velicina = 1 + ( 2 * k ) if ostale <= 0 : naj = 1 koje = [ i + 1 ] break if ostale % velicina < k + 1 and ostale % velicina != 0 : continue ponavljanja = ( ostale // velicina ) + 2 if ostale % velicina == 0 : ponavljanja -= 1 if ponavljanja < naj : naj = ponavljanja koje = [ ] koje . append ( i + 1 ) for e in range ( ostale // velicina ) : koje . append ( ( i + 1 ) + ( ( e + 1 ) * ( ( 2 * k ) + 1 ) ) ) if ostale % velicina != 0 : koje . append ( n - ( ( ostale % velicina ) - ( k + 1 ) ) ) print ( naj ) print ( * koje ) NEW_LINE


from sys import stdin as ulazinput = ulaz . readlinedef sol ( ) : n , k = map ( int , input ( ) . split ( ) ) naj = float ( " inf " ) koje = [ ] for i in range ( k + 1 ) : ostale = n - k - 1 - i velicina = 1 + ( 2 * k ) if ostale <= 0 : naj = 1 koje = [ i + 1 ] break if ostale % velicina < k + 1 and ostale % velicina != 0 : continue ponavljanja = ( ostale // velicina ) + 2 if ostale % velicina == 0 : ponavljanja -= 1 if ponavljanja < naj : naj = ponavljanja koje = [ ] koje . append ( i + 1 ) for e in range ( ostale // velicina ) : koje . append ( ( i + 1 ) + ( ( e + 1 ) * ( ( 2 * k ) + 1 ) ) ) if ostale % velicina != 0 : koje . append ( n - ( ( ostale % velicina ) - ( k + 1 ) ) ) print ( naj ) print ( * koje ) sol ( ) NEW_LINE


import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ;   public class pblm3 { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int st = 1 , i = st ; int c = 0 ; List < Integer > al = new ArrayList < Integer > ( ) ; while ( i <= N ) { al . add ( i ) ; c ++ ;


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 ;   import static java . lang . Math . log ; import static java . lang . Math . min ;   public class First {   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 ( ) ; int t ;


import java . util . * ; import java . io . * ; import java . math . * ;   public class First {   public static ArrayList < Integer > getAns ( int m , int in , int shift , int y , int n ) { ArrayList < Integer > list = new ArrayList < Integer > ( ) ; in -= shift ; for ( int i = 0 ; i < m ; i ++ ) { list . add ( in ) ; in += y ; } return list ; } public static void process ( ) throws IOException { int n = ni ( ) ; int k = ni ( ) ; int y = ( 2 * k ) + 1 ; int count = 0 ; ArrayList < Integer > list = new ArrayList < Integer > ( ) ; if ( k >= ( ( n + 1 ) / 2 ) ) { count = 1 ; list . add ( ( n + 1 ) / 2 ) ; } else { int m = n / y ; int in = ( y + 1 ) / 2 ; int left = n % y ; ; if ( left == 0 ) { list = getAns ( m , in , 0 , y , n ) ; } else { if ( left <= k + 1 ) { list = getAns ( m , in , k + 1 - left , y , n ) ; list . add ( n ) ; } else { list = getAns ( m , in , 0 , y , n ) ; int h = list . get ( list . size ( ) - 1 ) ; list . add ( h + ( 2 * k ) + 1 ) ; } } count = list . size ( ) ; } pn ( count ) ; StringBuilder sb = new StringBuilder ( " " ) ; for ( Integer i : list ) { sb . append ( i ) . append ( " ▁ " ) ; } pn ( sb . toString ( ) ) ; }    static AnotherReader sc ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { out = new PrintWriter ( System . out ) ; sc = new AnotherReader ( ) ; boolean oj = true ;


import java . util . Scanner ; import java . util . Arrays ; import java . util . Vector ; import java . util . Collections ; import java . io . PrintWriter ;    public class Solving {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; long n ; int q ; n = input . nextLong ( ) ; q = input . nextInt ( ) ; long x , y , res ; for ( int i = 0 ; i < q ; i ++ ) { x = input . nextInt ( ) ; y = input . nextInt ( ) ; long k = ( ( x - 1 ) * n + y + 1 ) / 2 ; long z = ( n * n + 1 ) / 2 ; if ( ( x + y ) % 2 != 0 ) { k += z ; } pw . println ( k ) ; } pw . flush ( ) ; } }


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


import sys   lst = sys . stdin . readlines ( ) n , q = map ( int , lst [ 0 ] . split ( ) )   for i in range ( q ) : x , y = map ( int , lst [ i + 1 ] . split ( ) ) cnt = ( x - 1 ) * n + y ans = ( cnt + 1 ) // 2 if ( ( x + y ) % 2 == 1 ) : ans += ( n * n + 1 ) // 2 sys . stdout . write ( str ( ans ) + ' \n ' ) NEW_LINE


import sys   inp = sys . stdin . readlines ( ) ii = 0   n , q = map ( int , inp [ ii ] . split ( ) ) ii += 1   for qu in range ( q ) : x , y = map ( int , inp [ ii ] . split ( ) ) ii += 1 c = ( x - 1 ) * n + y a = ( c + 1 ) // 2 if ( x + y ) % 2 == 1 : a += ( n ** 2 + 1 ) // 2 print ( a )     NEW_LINE


import java . util . Scanner ; import java . util . Arrays ; import java . util . Vector ; import java . util . Collections ; import java . io . PrintWriter ;    public class Solving {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; long n ; int q ; n = input . nextLong ( ) ; q = input . nextInt ( ) ; long x , y , res ; for ( int i = 0 ; i < q ; i ++ ) { x = input . nextInt ( ) ; y = input . nextInt ( ) ; if ( ( x + y ) % 2 == 0 ) { res = ( ( ( x - 1 ) * n ) + y + 1 ) / 2 ; pw . println ( res ) ; } else { res = ( ( ( x - 1 ) * n ) + y + 1 ) / 2 + ( n * n + 1 ) / 2 ; pw . println ( res ) ; } } pw . flush ( ) ; } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class B { public static void main ( String args [ ] ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int q = Integer . parseInt ( st . nextToken ( ) ) ; for ( int i = 0 ; i < q ; i ++ ) { st = new StringTokenizer ( br . readLine ( ) ) ; int x = Integer . parseInt ( st . nextToken ( ) ) ; int y = Integer . parseInt ( st . nextToken ( ) ) ; long sum = ( long ) x + y ; if ( sum % 2 == 0 ) {


import java . util . * ; import java . io . * ; public class Main { static PrintWriter w = new PrintWriter ( System . out ) ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextInt ( ) , q = sc . nextInt ( ) ; while ( q -- > 0 ) { long x = sc . nextInt ( ) , y = sc . nextInt ( ) ; long ans = ( ( x - 1 ) * n + y + 1 ) / 2 ; if ( ( x + y ) % 2 == 0 ) w . println ( ans ) ; else w . println ( ( ( n * n + 1 ) / 2 ) + ans ) ; } w . close ( ) ; } }


import java . util . Scanner ;   public class B { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long half = k / 2 ; if ( n < half ) { System . out . println ( "0" ) ; } else System . out . println ( ( Math . min ( n , k - 1 ) ) - half ) ; } }

import mathn , k = map ( int , input ( ) . split ( ) ) if k % 2 == 1 : mink = ( k + 1 ) // 2 else : mink = k // 2 + 1 print ( max ( 0 , min ( k - 1 , n ) - mink + 1 ) ) NEW_LINE


import sysimport mathfrom collections import OrderedDictdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) n , k = minput ( ) if n == k : print ( math . ceil ( n / 2 ) - 1 ) elif k > 2 * n : print ( 0 ) else : print ( min ( n , k - 1 ) - k // 2 ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) print ( max ( min ( n , k - 1 ) - k // 2 , 0 ) ) NEW_LINE


import java . util . Scanner ;   public class maxstack { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long m = sc . nextLong ( ) ; long c = 0 ; if ( m <= n ) { c = ( m - 1 ) / 2 ; } else c = n - m / 2 ; System . out . println ( c < 0 ? 0 : c ) ; }   }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; long s1 = scanner . nextLong ( ) ; long s2 = scanner . nextLong ( ) ; if ( s2 == 1 || s2 == 2 ) { System . out . println ( 0 ) ; System . exit ( 0 ) ; } if ( s1 * 2 >= s2 + 1 ) { if ( s2 > s1 + 1 ) { double t1 = s2 - s1 ; double t2 = s1 ; double mx = Math . ceil ( ( t2 - t1 ) / 2 ) ; System . out . printf ( " % .0f " , mx ) ;


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ;   public class Singleton_Pattern { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; b /= 2 ; c /= 4 ; int res = 7 * ( Integer . min ( Integer . min ( a , b ) , Integer . min ( b , c ) ) ) ; System . out . println ( res ) ;   } }

a = int ( input ( ) ) b = int ( input ( ) ) c = int ( input ( ) ) print ( 7 * min ( a , b // 2 , c // 4 ) ) NEW_LINE


a = int ( input ( ) ) b = int ( input ( ) ) c = int ( input ( ) )       compotes = c // 4 compotes = min ( compotes , b // 2 ) compotes = min ( compotes , a )   NEW_LINE


a = int ( input ( ) ) b = int ( input ( ) ) c = int ( input ( ) ) d = c // 4 d = min ( d , b // 2 ) d = min ( d , a ) print ( 1 * d + 2 * d + 4 * d ) NEW_LINE


a = int ( input ( ) ) b = int ( input ( ) ) c = int ( input ( ) ) x = 0 while ( 1 ) : if ( a < 1 or b < 2 or c < 4 ) : break x += 1 a -= 1 b -= 2 c -= 4 print ( 7 * x ) NEW_LINE


a = int ( input ( ) ) b = int ( input ( ) ) c = int ( input ( ) ) d = min ( a , b // 2 , c // 4 ) print ( 7 * d ) NEW_LINE


import java . io . * ; import java . util . * ; import javax . print . attribute . standard . Finishings ;   import java . math . * ;   public class Compote { static final Random random = new Random ( ) ; static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Reader sc = new Reader ( ) ;   public static void main ( String args [ ] ) throws IOException { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; boolean flag = true ; if ( b < 2 || c < 4 ) { flag = false ; System . out . println ( 0 ) ; } else if ( flag ) { int res = Math . min ( a , Math . min ( b / 2 , c / 4 ) ) ; System . out . println ( res * 7 ) ; }   }


import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int temp = 0 ; while ( a >= 1 && b >= 2 && c >= 4 ) { temp = temp + 7 ; a = a - 1 ; b = b - 2 ; c = c - 4 ; } System . out . println ( temp ) ; } }


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


import java . io . * ; import java . math . * ; import java . util . * ;    public class Main { static final int MAX_N = 100100 ; static final int mod = 1000000007 ; static final int INF = 0x3f3f3f3f ;    public static void main ( String [ ] args ) throws Exception { initReader ( System . in ) ;   solve ( ) ;   printWriter . flush ( ) ; }      public static void solve ( ) throws IOException { int a = nextInt ( ) ; int b = nextInt ( ) ; int c = nextInt ( ) ;   a /= 1 ; b /= 2 ; c /= 4 ;   printWriter . println ( Math . min ( a , Math . min ( b , c ) ) * 7 ) ;   }        static BufferedReader reader ; static StringTokenizer tokenizer ; static PrintWriter printWriter ;    static void initReader ( InputStream input ) { reader = new BufferedReader ( new InputStreamReader ( input ) ) ; tokenizer = new StringTokenizer ( " " ) ; printWriter = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; }   static boolean hasNext ( ) { try { while ( ! tokenizer . hasMoreTokens ( ) ) { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } } catch ( Exception e ) { return false ; } return true ; }   static String next ( ) throws IOException { while ( ! tokenizer . hasMoreTokens ( ) ) { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } return tokenizer . nextToken ( ) ; }   static String nextLine ( ) { try { return reader . readLine ( ) ; } catch ( Exception e ) { return null ; } }   static int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   static long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   static double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; }   static char nextChar ( ) throws IOException { return next ( ) . charAt ( 0 ) ; } }


import java . util . * ; public class stringgeneration { public static void main ( String [ ] args ) { int t , n , k , i ;   Scanner sc = new Scanner ( System . in ) ;   t = sc . nextInt ( ) ;   while ( t -- > 0 ) { n = sc . nextInt ( ) ; k = sc . nextInt ( ) ;   for ( i = 0 ; i < n ; i ++ ) { System . out . print ( ( char ) ( ' a ' + ( i % 3 ) ) ) ; }   System . out . println ( ) ;   } } }

for _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) NEW_LINE p = n NEW_LINE t = " a " * k NEW_LINE n -= k NEW_LINE while n > 0 : t += " bca " NEW_LINE n -= 3 NEW_LINE print ( t [ : p ] ) NEW_LINE


for t in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( " ▁ " ) ) NEW_LINE print ( ( " abc " * n ) [ : n ] ) NEW_LINE


for s in [ * open ( 0 ) ] [ 1 : ] : n = int ( s . split ( ) [ 0 ] ) ; print ( ( ' abc ' * n ) [ : n ] ) NEW_LINE


import java . util . Scanner ;   public class A1461 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; in . nextInt ( ) ;


import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 3 == 0 ) System . out . print ( ' a ' ) ; else if ( i % 3 == 1 ) System . out . print ( ' b ' ) ; else System . out . print ( ' c ' ) ; }   System . out . println ( ) ; } } }


import java . util . Scanner ; public class vivek { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 3 == 0 ) System . out . print ( " a " ) ; else if ( i % 3 == 1 ) System . out . print ( " b " ) ; else System . out . print ( " c " ) ; } System . out . println ( ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashSet ; import java . util . StringTokenizer ;   public class N1242A { static ArrayList < Integer > primes ; static HashSet < Integer > primesH ; public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; primes = new ArrayList ( ) ; primesH = new HashSet ( ) ; sieveOfEratosthenes ( 1000000 ) ; long n = sc . nextLong ( ) ; if ( n == 1 ) out . println ( 1 ) ; else if ( n % 2 == 0 ) { while ( n % 2 == 0 ) { n /= 2 ; } out . println ( n == 1 ? 2 : 1 ) ; } else { if ( isPrime ( n ) ) { out . println ( n ) ; } else { int needed = 1 ; for ( int i = 3 ; i * i * 1l <= n ; i += 2 ) { if ( n % i == 0 ) { if ( needed == - 1 ) { needed = i ; } while ( n % i == 0 ) { n /= i ; } if ( n == 1 ) { needed = i ; } break ; } }

import sys , os , ioimport math , bisect , operatorinf , mod = float ( ' inf ' ) , 10 ** 9 + 7 NEW_LINE


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


import sysfrom math import sqrtinput = lambda : sys . stdin . readline ( ) . rstrip ( " \n " )   n = int ( input ( ) ) t = ns = set ( ) i = 2 while i * i <= n : if n % i == 0 : s . add ( i ) while n % i == 0 : n = n // i i += 1 if n != 1 : s . add ( n ) if len ( s ) >= 2 or t == 1 : print ( 1 ) else : print ( s . pop ( ) )   NEW_LINE


n = int ( input ( ) ) count = 1 divisor = nfor i in range ( 2 , n + 1 ) : if i * i > n : break if n % i == 0 : while n % i == 0 : n //= i if n == 1 : print ( i ) else : print ( 1 ) exit ( 0 ) print ( n ) NEW_LINE


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


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


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

n , k = [ int ( y ) for y in input ( ) . split ( ) ] if k / n >= 3 : print ( 0 ) else : n = n * 3 print ( n - k ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) print ( max ( 3 * a - b , 0 ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) print ( max ( 0 , 3 * n - k ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) )   if k / n >= 3 : print ( 0 ) else : print ( n - ( k % n ) ) NEW_LINE


import sysimport mathfrom collections import Counter   n , k = list ( map ( int , input ( ) . split ( ) ) )   near = k / nif near . is_integer ( ) : print ( n ) if near == 2 else print ( 0 ) sys . exit ( )   possibles = list ( map ( int , ( n * f ' { math . floor ( near ) } ▁ ' ) . split ( ) ) )   for i , number in enumerate ( possibles ) : possibles [ i ] = possibles [ i ] + 1 if sum ( possibles ) > k : possibles [ i ] = possibles [ i ] - 1 break   r = dict ( Counter ( possibles ) ) print ( r . get ( 2 , 0 ) ) NEW_LINE


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


import com . sun . org . apache . bcel . internal . generic . AALOAD ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ;   public class Main { static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; } Arrays . sort ( a ) ; } public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int one = 0 , two = 0 ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int value = input . nextInt ( ) ; sum += value ; if ( value == 100 ) one ++ ; else two ++ ; } for ( int i = 0 ; i <= one ; i ++ ) { for ( int j = 0 ; j <= two ; j ++ ) { if ( ( ( i * 100 ) + ( j * 200 ) ) * 2 == sum ) { System . out . println ( " YES " ) ; return ; } } } System . out . println ( " NO " ) ; } }

def solution ( ) : n = int ( input ( ) )   arr = list ( map ( int , input ( ) . split ( ) ) ) hun = 0 two = 0 tot = 0 for i in arr : tot += i if i == 100 : hun += 1 else : two += 1 if tot % 2 != 0 : print ( ' NO ' ) return dp = [ [ False for i in range ( tot // 2 + 1 ) ] for j in range ( n + 1 ) ]   for i in range ( n + 1 ) : dp [ i ] [ 0 ] = True   for i in range ( 1 , n + 1 ) : for j in range ( 1 , tot // 2 + 1 ) : if arr [ i - 1 ] <= j : dp [ i ] [ j ] = dp [ i - 1 ] [ j ] or dp [ i ] [ j - arr [ i - 1 ] ] else : dp [ i ] [ j ] = dp [ i - 1 ] [ j ] if dp [ - 1 ] [ - 1 ] : print ( ' YES ' ) else : print ( ' NO ' )       solution ( ) NEW_LINE


n = int ( input ( ) )   l = list ( map ( int , input ( ) . split ( ) ) )   oh = l . count ( 100 ) th = n - oh   if oh % 2 == 1 : print ( " NO " ) elif oh == 0 and th % 2 == 1 : print ( " NO " ) else : print ( " YES " ) NEW_LINE


def Appel ( arr ) : cont = 0 cont1 = 0 for i in arr : if i == 200 : cont += 1 else : cont1 += 1   if cont1 % 2 != 0 : return " NO " if cont % 2 != 0 and cont1 == 0 : return " NO " return " YES "   aux1 = input ( ) a = int ( aux1 ) arr = [ ] arr = list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) print ( Appel ( arr ) ) NEW_LINE


def Appel ( arr ) : count1 = 0 count2 = 0 for i in arr : if i == 100 : count1 += 1 else : count2 += 1 if ( count1 % 2 != 0 ) : return " NO " elif ( count2 % 2 != 0 and count1 == 0 ) : return " NO " else : return " YES "   aux1 = input ( ) a = int ( aux1 ) arr = [ ] arr = list ( map ( int , input ( ) . strip ( ) . split ( ) ) )   print ( Appel ( arr ) ) NEW_LINE


import java . io . * ;   public class FairDivison { public static void main ( String [ ] args ) throws IOException {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] x = br . readLine ( ) . split ( " ▁ " ) ;   int [ ] a = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) a [ i ] = Integer . parseInt ( x [ i ] ) / 100 ;   System . out . println ( solve ( n , a ) ? " YES " : " NO " ) ; }   static boolean solve ( int n , int [ ] a ) {   int sum = 0 ; int oddCnt = 0 ; int evenCnt = 0 ;   for ( int i = 0 ; i < n ; i ++ ) {   sum += a [ i ] ;   if ( ( a [ i ] & 1 ) == 0 ) evenCnt ++ ;   else oddCnt ++ ; }   if ( ( sum & 1 ) != 0 ) return false ;   if ( ( n & 1 ) == 0 ) { return true ; }   else {   if ( oddCnt == 0 ) return false ; if ( ( evenCnt & 1 ) == 0 ) return false ;   return true ; } } }


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


import java . io . * ; import java . util . * ;   public class round248A { public static void main ( String s [ ] ) throws Exception { Reader r = new Reader ( ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = r . nextInt ( ) ; int h = 0 , t = 0 , arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = r . nextInt ( ) ; if ( arr [ i ] == 100 ) h ++ ; else t ++ ; } if ( ( t % 2 == 0 && h % 2 == 0 ) || ( t % 2 == 1 && h % 2 == 0 && h >= 2 ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }   static class Reader { final private int BUFFER_SIZE = 1 << 16 ; 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 readLine ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;


import java . util . * ; public class HelloWorld {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; int cnt1 = 0 ; int cnt2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x == 100 ) cnt1 ++ ; else cnt2 ++ ; } if ( cnt1 % 2 > 0 || ( cnt2 % 2 > 0 && cnt1 == 0 ) ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;    public class Autocomplete {   public static void main ( String [ ] args ) throws IOException , InterruptedException { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; String s = sc . next ( ) ; int n = sc . nextInt ( ) ; String o = " " ; for ( int i = 0 ; i < 100 ; i ++ ) o += " z " ; for ( int i = 0 ; i < n ; i ++ ) { String sm = sc . next ( ) ; if ( sm . length ( ) < s . length ( ) ) continue ; else if ( sm . substring ( 0 , s . length ( ) ) . equals ( s ) ) { o = ( sm . compareTo ( o ) < 0 ) ? sm : o ; } } boolean v = o . length ( ) == 100 ; for ( int i = 0 ; v && i < 100 ; i ++ ) { if ( o . charAt ( i ) != ' z ' ) v = false ; } if ( v ) out . println ( s ) ; else out . println ( o ) ; out . close ( ) ; } static class Scanner { StringTokenizer st ; BufferedReader br ;   public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; }   public String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; }   public int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   public String nextLine ( ) throws IOException { return br . readLine ( ) ; } public boolean ready ( ) throws IOException { return br . ready ( ) ; }    } }

s = input ( ) NEW_LINE res = " z " * 1000 NEW_LINE n = int ( input ( ) ) NEW_LINE for i in range ( n ) : t = input ( ) NEW_LINE if ( t [ : len ( s ) ] == s ) : res = min ( res , t ) NEW_LINE print ( s if res == " z " * 1000 else res ) NEW_LINE


s = str ( input ( ) ) NEW_LINE n = int ( input ( ) )   asd = [ ]   for i in range ( n ) : d = str ( input ( ) ) NEW_LINE asd . append ( d ) NEW_LINE flag = 0 NEW_LINE bal = [ ]   for i in asd : if NEW_LINE s not in i [ 0 : len ( s ) ] : flag += 1 else : bal . append ( i ) NEW_LINE if flag == n : print ( s )   else : bal . sort ( ) NEW_LINE print ( bal [ 0 ] ) NEW_LINE


string = input ( ) NEW_LINE n = int ( input ( ) ) NEW_LINE a = [ ] NEW_LINE while n != 0 : a . append ( input ( ) ) NEW_LINE n -= 1 NEW_LINE a . sort ( ) NEW_LINE for x in a : if NEW_LINE x . find ( string ) == 0 : print ( x ) NEW_LINE exit ( ) NEW_LINE print ( string ) NEW_LINE


a = input ( ) . strip ( ) NEW_LINE n = int ( input ( ) ) NEW_LINE k = [ input ( ) for i in range ( n ) ] NEW_LINE p = [ ] NEW_LINE for i in k : if NEW_LINE a in i and i . index ( a ) == 0 : p . append ( i ) NEW_LINE if p : NEW_LINE INDENT print ( min ( p ) ) else : NEW_LINE print ( a ) NEW_LINE DEDENT


import java . io . * ; import java . util . * ;   import static java . lang . Integer . parseInt ;   public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader read = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter prnt = new PrintWriter ( System . out ) ; String str = read . readLine ( ) ; int n = parseInt ( read . readLine ( ) ) ; ArrayList < String > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s = read . readLine ( ) ; int ind = s . indexOf ( str ) ; if ( ind == 0 ) { list . add ( s ) ; } } Collections . sort ( list ) ; if ( list . isEmpty ( ) ) { prnt . println ( str ) ; } else { prnt . println ( list . get ( 0 ) ) ; } prnt . close ( ) ; } }


import java . io . * ; import java . util . * ; public class S { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int t = in . nextInt ( ) ; String k = s ; int temp = 0 ; while ( t -- != 0 ) { String str = in . next ( ) ; if ( str . indexOf ( s ) == 0 ) { if ( temp == 0 ) { k = str ; temp = 1 ; } else { if ( k . compareTo ( str ) > 0 ) k = str ; } } } System . out . print ( k ) ; } }


import java . io . * ; import java . util . * ; import java . util . stream . IntStream ;   public class CodeForces { public static void main ( String [ ] args ) { FastIO io = FastIO . create ( ) ;   String prefix = io . nextLine ( ) ;   String bestMatch = null ;   int n = io . nextInt ( ) ;   for ( int i = 0 ; i < n ; i ++ ) { String candidate = io . nextLine ( ) ; if ( candidate . startsWith ( prefix ) ) { if ( bestMatch == null || candidate . compareTo ( bestMatch ) < 1 ) { bestMatch = candidate ; } } }   if ( bestMatch == null ) { bestMatch = prefix ; }   io . println ( bestMatch ) ;   io . close ( ) ; }   static class FastIO extends PrintWriter { BufferedReader br ; StringTokenizer st ;   public FastIO ( InputStream is , OutputStream os ) { super ( new BufferedOutputStream ( os ) ) ; br = new BufferedReader ( new InputStreamReader ( is ) ) ; }   public static FastIO create ( ) { return new FastIO ( System . in , System . out ) ; }   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 nextToken ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   String nextLine ( ) { try { return br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return " " ; } } }


import java . io . PrintWriter ; import java . util . Scanner ;   public class test {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; String s = sc . nextLine ( ) ; int n = sc . nextInt ( ) ;   String res = null ;   for ( int i = 0 ; i < n ; i ++ ) { String word = sc . next ( ) ; if ( word . startsWith ( s ) ) { if ( res == null || res . compareTo ( word ) > 0 ) { res = word ; } } } if ( res == null ) { res = s ; } System . out . println ( res ) ; } }


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

container = [ 2 ] d = 26000 for i in range ( 1 , d + 1 ) : h = i + 1 container . append ( h * 2 + h - 1 + container [ i - 1 ] )   cases = int ( input ( ) ) for t in range ( cases ) : n = int ( input ( ) ) count = 0 while n > 1 : for i in range ( len ( container ) ) : if n < container [ i ] : n -= container [ i - 1 ] count += 1 break   print ( count ) NEW_LINE


t = int ( input ( ) )   for i in range ( t ) : n = int ( input ( ) ) count = 0 while n >= 2 : k = ( - 1 + ( 1 + 24 * n ) ** 0.5 ) // 6 count += 1 n -= ( 3 * k ** 2 + k ) // 2 print ( count ) NEW_LINE


def F ( P ) : i = 1 while i > 0 : if ( 3 * i * i + i ) // 2 < P : i += 1 elif ( 3 * i * i + i ) // 2 == P : return ( 3 * i * i + i ) // 2 else : return ( 3 * ( i - 1 ) * ( i - 1 ) + i - 1 ) // 2 for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) count = 0 while n >= 0 : if n < 2 : break else : count += 1 n = n - F ( n ) print ( count ) NEW_LINE


tests = [ ] maxh = 0 for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) if n > maxh : maxh = n tests . append ( n ) cards = 2 h = [ 2 ] x = 0 while cards <= maxh : x += 1 cards += 3 * x + 2 h . append ( cards ) for t in tests : ans = 0 while t >= h [ 0 ] : for b in h [ : : - 1 ] : if b <= t : ans += 1 t -= b break print ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Scanner ;   public class Codeforces {   private static final Scanner sc = new Scanner ( System . in ) ; private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static final long MOD = ( long ) ( 1e9 + 7 ) ; private static PrintWriter out = new PrintWriter ( System . out ) ;   public static void solve ( int T ) throws IOException { long n = sc . nextLong ( ) ; int ans = 0 ; for ( int i = 26000 ; i >= 1 && n > 0 ; i -- ) { long x = i - 1 ; long val = ( 3 * x * ( x + 1 ) / 2 ) + 2 * ( x + 1 ) ; if ( val <= n ) { ans += n / val ; n %= val ; } } System . out . println ( ans ) ; }   public static void main ( String [ ] args ) throws IOException { int t ; t = sc . nextInt ( ) ;


import java . util . * ; import java . lang . * ; import java . io . * ;   public class codeforces { static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } static int lbound ( int [ ] arr , int target , int end ) { int start = 0 ;   int ans = 0 ; while ( start <= end ) { int mid = ( start + end ) / 2 ; if ( arr [ mid ] == target ) return arr [ mid ] ;   if ( arr [ mid ] > target ) { end = mid - 1 ; }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ; while ( t > 0 ) { int n = scan . nextInt ( ) ; t -- ; int size = ( int ) Math . pow ( 10 , 5 ) ; int big = ( int ) Math . pow ( 10 , 9 ) ; long cards [ ] = new long [ size ] ; cards [ 0 ] = 0 ; cards [ 1 ] = 2 ; for ( int i = 2 ; i < size ; i ++ ) { cards [ i ] = cards [ i - 1 ] + 3 * i - 1 ; if ( cards [ i ] > big ) { break ; } } int count = 0 ; while ( n >= cards [ 1 ] ) { int l = 0 , r = 25820 ; int mid = 0 ; while ( l <= r ) { mid = ( l + r ) / 2 ; if ( cards [ mid ] > n ) { r = mid - 1 ; } else { l = mid + 1 ; } } n -= cards [ l - 1 ] ; count ++ ; } System . out . println ( count ) ; } } }


import java . util . Scanner ; import java . util . Arrays ; import java . util . Vector ; import java . util . Collections ;    public class Problem_Solving1 { public static int sumdigits ( long n ) { int sm = 0 ; while ( n > 0 ) { sm += n % 10 ; n /= 10 ; } return sm ; } public static void main ( String [ ] args ) {

n = int ( input ( ) ) output = [ ] for i in range ( max ( n - 80 , 0 ) , n ) : listi = list ( map ( int , str ( i ) ) ) if ( i + sum ( listi ) == n ) : output . append ( i ) print ( len ( output ) ) for i in range ( len ( output ) ) : print ( output [ i ] ) NEW_LINE


n , a , y = int ( input ( ) ) , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] , [ ] x = n - 99 if n > 99 else 1 for i in range ( x , n ) : sum = 0 for j in str ( i ) : sum += int ( j ) if sum + i == n : y . append ( i ) print ( len ( y ) ) print ( * y ) NEW_LINE


n = int ( input ( ) ) output = [ ] for i in range ( max ( n - 100 , 0 ) , n ) : listi = list ( map ( int , str ( i ) ) ) if ( i + sum ( listi ) == n ) : output . append ( i ) print ( len ( output ) ) for i in range ( len ( output ) ) : print ( output [ i ] ) NEW_LINE


n = int ( input ( ) ) output = [ ] for i in range ( max ( n - 82 , 0 ) , n ) : listi = list ( map ( int , str ( i ) ) ) if ( i + sum ( listi ) == n ) : output . append ( i ) print ( len ( output ) ) for i in range ( len ( output ) ) : print ( output [ i ] ) NEW_LINE


n = int ( input ( ) ) output = [ ] for i in range ( max ( n - 81 , 0 ) , n ) : listi = list ( map ( int , str ( i ) ) ) if ( i + sum ( listi ) == n ) : output . append ( i ) print ( len ( output ) ) for i in range ( len ( output ) ) : print ( output [ i ] ) NEW_LINE


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


import java . util . * ; import java . awt . Point ; import java . lang . Math ; import java . util . Arrays ; import java . util . Scanner ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . io . OutputStream ; import java . util . Comparator ; import java . math . BigInteger ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . stream . IntStream ; import java . io . IOException ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) { FastScanner in = new FastScanner ( ) ; OutputStream outputStream = System . out ; PrintWriter out = new PrintWriter ( outputStream ) ; int N = in . ni ( ) ; List < Integer > list = new ArrayList < > ( ) ; for ( int sum = 100 ; sum > 0 ; sum -- ) { if ( sumOfDigits ( N - sum ) == sum ) { list . add ( N - sum ) ; } } System . out . println ( list . size ( ) ) ; for ( Integer value : list ) { System . out . println ( value ) ; } } private static int sumOfDigits ( int number ) { if ( number <= 0 ) return 0 ; int sum = 0 ; while ( number > 0 ) { sum += number % 10 ; number /= 10 ; } return sum ; } static void ruffle_sort ( int [ ] a ) {


# include < cstdio > # define re registerusing namespace std ; int n , ans [ 100002 ] , k ; inline void check ( re int x ) { if ( x < 0 ) return ; re int sum = x , xx = x ; while ( x ) sum += x % 10 , x /= 10 ; if ( sum == n ) ans [ ++ k ] = xx ; } int main ( ) { scanf ( " % d " , & n ) ; for ( re int i = n - 100 ; i <= n ; ++ i ) check ( i ) ; printf ( " % d \n " , k ) ; for ( re int i = 1 ; i <= k ; ++ i ) printf ( " % d ▁ " , ans [ i ] ) ; }


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

import sys     def main ( ) : n = int ( sys . stdin . readline ( ) ) arr = [ 0 ] * ( n + 1 ) cnt = [ 0 ] * ( n + 1 ) curr_len = 1 curr_sum = 0 for _ in range ( n ) : t = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) if t [ 0 ] == 1 : curr_sum += t [ 1 ] * t [ 2 ] cnt [ t [ 1 ] - 1 ] += t [ 2 ] elif t [ 0 ] == 2 : curr_sum += t [ 1 ] arr [ curr_len ] = t [ 1 ] curr_len += 1 else : curr_len -= 1 curr_sum -= arr [ curr_len ] + cnt [ curr_len ] cnt [ curr_len - 1 ] += cnt [ curr_len ] cnt [ curr_len ] = 0 print ( curr_sum / curr_len )     main ( ) NEW_LINE


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


import sys , os , ioimport math , bisect , operatorinf , mod = float ( ' inf ' ) , 10 ** 9 + 7 NEW_LINE


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static long mod = 17352642619633L ;   void run ( FastScanner in , PrintWriter out ) {   long [ ] a = new long [ 200_004 ] ; long [ ] d = new long [ 200_004 ] ;   int N = in . nextInt ( ) ;   int ele = 1 ; double sum = 0 ;   while ( N -- > 0 ) {   int t = in . nextInt ( ) ; if ( t == 1 ) { int ai = in . nextInt ( ) ; int x = in . nextInt ( ) ; d [ ai - 1 ] += x ; sum += ai * x ; } else if ( t == 2 ) { int x = in . nextInt ( ) ; a [ ele ] = x ; sum += x ; ele ++ ; } else {   long v = a [ ele - 1 ] + d [ ele - 1 ] ; d [ ele - 2 ] += d [ ele - 1 ] ; d [ ele - 1 ] = 0 ; a [ ele - 1 ] = 0 ; sum -= v ; ele -- ; } out . println ( String . format ( " % .8f " , sum / ele ) ) ; }    }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( InputStream in ) { br = new BufferedReader ( new InputStreamReader ( in ) ) ; st = null ; }   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 ( ) ) ; } } }


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


import java . util . Scanner ;   public class TuringTape {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; char [ ] arr = sc . nextLine ( ) . toCharArray ( ) ; int prev = 0 ; for ( char c : arr ) { StringBuilder s = new StringBuilder ( Integer . toString ( ( int ) c , 2 ) ) ; while ( s . length ( ) < 8 ) s . insert ( 0 , '0' ) ; s . reverse ( ) ; int x = Integer . parseInt ( s . toString ( ) , 2 ) ; System . out . println ( ( prev - x + 256 ) % 256 ) ; prev = x ; } sc . close ( ) ; } }

s = input ( ) e = 0 for i in s : a = ord ( i ) b = format ( a , '08b ' ) c = str ( b ) [ : : - 1 ] d = int ( c , 2 ) print ( ( e - d ) % 256 ) e = d NEW_LINE


t = input ( )     f = [ 0 ]     for j in range ( len ( t ) ) :   a = bin ( ord ( t [ j ] ) ) [ 2 : ]   if len ( a ) < 8 : a = '0' * ( 8 - len ( a ) ) + a   b = int ( a [ : : - 1 ] , 2 )     x = ( f [ - 1 ] - b ) % 256 print ( x ) f . append ( b )   NEW_LINE


# include < cstdio > # include < cstring > # include < algorithm > using namespace std ; int main ( ) { char a [ 105 ] ; int i , n , j , m , c [ 105 ] [ 8 ] , ans [ 105 ] , len ; for ( i = 0 ; i < 105 ; i ++ ) for ( j = 0 ; j < 8 ; j ++ ) c [ i ] [ j ] = 0 ; memset ( ans , 0 , sizeof ( ans ) ) ; gets ( a ) ; len = strlen ( a ) ; for ( i = 0 ; i < len ; i ++ ) { m = 1 ; n = 0 + a [ i ] ; for ( j = 0 ; j < 8 && n != 0 ; j ++ ) { c [ i ] [ j ] = n % 2 ; n = n / 2 ; } for ( j = 7 ; j >= 0 ; j -- ) { ans [ i ] = ans [ i ] + c [ i ] [ j ] * m ; m = m * 2 ; } } printf ( " % d \n " , 256 - ans [ 0 ] ) ; for ( i = 1 ; i < len ; i ++ ) { if ( ans [ i - 1 ] - ans [ i ] >= 0 ) printf ( " % d \n " , ans [ i - 1 ] - ans [ i ] ) ; else printf ( " % d \n " , 256 + ans [ i - 1 ] - ans [ i ] ) ; } }


import java . util . Scanner ; public class Ishu { public static String reverse ( String s ) { char [ ] ch = new char [ 10 ] ; char [ ] ch1 = new char [ 10 ] ; ch = s . toCharArray ( ) ; for ( int i = 0 ; i < s . length ( ) ; ++ i ) ch1 [ i ] = ch [ s . length ( ) - 1 - i ] ; s = new String ( ch1 ) ; return s ; } public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int i , temp , temp1 , n ; String text , str ; char [ ] ch = new char [ 100 ] ; text = scan . nextLine ( ) ; ch = text . toCharArray ( ) ; for ( i = 0 ; i < text . length ( ) ; ++ i ) { temp = ( int ) ch [ i ] ; str = Integer . toBinaryString ( temp ) ; while ( str . length ( ) < 8 ) str = "0" + str ; n = str . length ( ) ; str = reverse ( str ) ; temp = Integer . parseInt ( str . substring ( 0 , n ) , 2 ) ; if ( i == 0 ) temp1 = 0 ; else { temp1 = ( int ) ch [ i - 1 ] ; str = Integer . toBinaryString ( temp1 ) ; while ( str . length ( ) < 8 ) str = "0" + str ; n = str . length ( ) ; str = reverse ( str ) ; temp1 = Integer . parseInt ( str . substring ( 0 , n ) , 2 ) ; } temp = temp1 - temp ; if ( temp < 0 ) { temp *= ( - 1 ) ; temp = 256 - ( temp % 256 ) ; } else temp = temp % 256 ; System . out . println ( temp ) ; } } }


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

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) p = sorted ( arr ) if ( p == arr ) : print ( ' yes ' ) print ( 1 , 1 ) else : flag = 1 flag1 = 0 i = 0 while ( i < n - 1 and arr [ i ] < arr [ i + 1 ] ) : i += 1 continue j = n - 1 while ( j > 0 and arr [ j ] > arr [ j - 1 ] ) : j -= 1 continue f = [ ] for k in range ( i ) : f . append ( arr [ k ] ) for k in range ( j , i - 1 , - 1 ) : f . append ( arr [ k ] ) for k in range ( j + 1 , len ( arr ) ) : f . append ( arr [ k ] ) arr . sort ( ) if ( f == arr ) : print ( " yes " ) print ( i + 1 , j + 1 ) else : print ( " no " ) NEW_LINE


def last_smaller ( xs , i ) : val = xs [ i ] res = i - 1 while res >= 0 and xs [ res ] == xs [ res + 1 ] : res -= 1 assert xs [ res ] <= xs [ i ] return res   def solve ( xs , n ) : xs = [ - float ( ' inf ' ) ] + xs + [ float ( ' inf ' ) ] increasing = 1 decreasing = 0 i0 , i1 , i2 = None , None , None for i in range ( n + 1 ) : if xs [ i ] > xs [ i + 1 ] : if increasing == 2 : print ( ' no ' ) return if decreasing == 0 : i0 = last_smaller ( xs , i ) i1 = i decreasing += 1 if xs [ i0 ] > xs [ i + 1 ] : print ( ' no ' ) return elif xs [ i ] < xs [ i + 1 ] : if decreasing == 1 and increasing == 1 : increasing += 1 if xs [ i + 1 ] < xs [ i1 ] : print ( ' no ' ) return i2 = i if i1 is None : i1 = i if i2 is None : i2 = i print ( ' yes \n { } ▁ { } ' . format ( i1 , i2 ) )   def main ( ) : n = int ( input ( ) ) xs = list ( map ( int , input ( ) . split ( ) ) ) solve ( xs , n )   if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


a = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) turn = Falsep = [ ] for i in range ( a - 1 ) : if turn : if l [ i + 1 ] > l [ i ] : p . append ( i ) break else : if l [ i ] > l [ i + 1 ] : p . append ( i ) turn = Trueif len ( p ) == 0 : print ( " yes " ) print ( 1 , 1 ) else : t1 = sorted ( l ) if len ( p ) == 1 : p . append ( a - 1 ) l [ p [ 0 ] : p [ 1 ] + 1 ] = l [ p [ 0 ] : p [ 1 ] + 1 ] [ : : - 1 ] if t1 == l : print ( " yes " ) print ( p [ 0 ] + 1 , p [ 1 ] + 1 ) else : print ( " no " ) NEW_LINE


t = int ( input ( ) )   arr = list ( map ( int , input ( ) . split ( ) ) )   sarr = sorted ( arr )   def binary ( sarr , target ) : start = 0 end = len ( sarr ) - 1   while start <= end : mid = ( start + end ) // 2   if sarr [ mid ] == target : return mid elif sarr [ mid ] > target : end = mid - 1 else : start = mid + 1   return - 1         if arr == sarr : print ( " yes " ) print ( 1 , 1 ) else : for i in range ( len ( sarr ) - 1 ) : if arr [ i ] > arr [ i + 1 ] :       a = binary ( sarr , arr [ i ] )   newarr = arr [ : i ] + arr [ i : a + 1 ] [ : : - 1 ] + arr [ a + 1 : ]     if newarr == sarr : print ( " yes " ) print ( i + 1 , a + 1 ) break else : print ( " no " ) break           NEW_LINE


n = int ( input ( ) ) arr = [ int ( x ) for x in input ( ) . split ( ) ] srted = Truecansort = Falsedescending = Falseidx1 = 0 idx2 = 0   for i , val in enumerate ( arr [ : - 1 ] ) : if val > arr [ i + 1 ] and not descending : if srted and not cansort : cansort = True else : cansort = False break srted = False descending = True idx1 = i + 1 elif val < arr [ i + 1 ] and descending : descending = False idx2 = i + 1   if ( not descending and n >= idx2 + 1 and arr [ idx1 - 1 ] > arr [ idx2 ] ) or ( idx1 >= 2 and arr [ idx2 - 1 ] < arr [ idx1 - 2 ] ) : cansort = False   if not cansort and not srted : print ( ' no ' ) else : print ( ' yes ' ) if srted : print ( '1 ▁ 1' ) elif descending : print ( f ' { idx1 } ▁ { n } ' ) else : print ( f ' { idx1 } ▁ { idx2 } ' ) NEW_LINE


import java . util . * ; import java . math . * ; public class SortTheArray { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int dexA = - 1 ; int dexB = - 1 ; int count = 0 ; boolean hit = false ; int temp = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; arr [ 0 ] = temp ; for ( int i = 1 ; i < n ; i ++ ) { int num = sc . nextInt ( ) ; arr [ i ] = num ; if ( temp >= num ) { if ( ! hit ) { count ++ ; dexA = i - 1 ; hit = true ; } } else { if ( hit ) { hit = false ; dexB = i - 1 ; } }   temp = num ;   } if ( dexB == - 1 ) dexB = n - 1 ; if ( count == 0 ) { System . out . println ( " yes " ) ; System . out . println ( 1 + " ▁ " + 1 ) ; } else { if ( count > 1 ) { System . out . println ( " no " ) ; } else { Arrays . sort ( arr , dexA , dexB + 1 ) ; boolean k = false ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( arr [ i ] > arr [ i + 1 ] ) { System . out . println ( " no " ) ; k = true ; break ; } } if ( ! k ) { System . out . println ( " yes " ) ; dexA ++ ; dexB ++ ; System . out . println ( dexA + " ▁ " + dexB ) ; } } } } }


import java . util . Scanner ;   public class sortt {   public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = scn . nextInt ( ) ; } sortt ( arr , n ) ;   } public static void sortt ( int arr [ ] , int n ) { int prefix [ ] = new int [ n ] ; prefix [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { prefix [ i ] = Math . max ( prefix [ i - 1 ] , arr [ i ] ) ; } int q = 1 ; int count = 1 ; int l = 1 , r = 1 ; while ( q < n ) { if ( prefix [ q ] == prefix [ q - 1 ] ) { l = q ; count -- ; while ( q < n && prefix [ q ] == prefix [ q - 1 ] ) { if ( arr [ q ] > arr [ q - 1 ] ) { System . out . println ( " no " ) ; return ; } else { q ++ ; } } r = q ; } else { q ++ ; } } if ( count >= 0 ) { if ( ( l - 2 ) >= 0 && arr [ r - 1 ] < arr [ l - 2 ] ) { System . out . println ( " no " ) ; } else { System . out . println ( " yes " ) ; System . out . println ( l + " ▁ " + r ) ; } } else { System . out . println ( " no " ) ; } }   }


import java . io . IOException ; import java . util . * ; import java . util . Arrays ; import java . util . Scanner ;   public class Bit_year { static List < Integer > ans ; public static void process ( int [ ] ar ) { } public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; String t = sc . next ( ) ; int [ ] ar = new int [ 10 ] ; int [ ] br = new int [ 10 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { ar [ Character . getNumericValue ( s . charAt ( i ) ) ] ++ ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { br [ Character . getNumericValue ( t . charAt ( i ) ) ] ++ ; } System . out . println ( less ( ar . clone ( ) , br . clone ( ) ) ) ;

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 ) : n = ri ( ) sher , mor = list ( rs ( ) ) , list ( rs ( ) ) sher = list ( map ( int , sher ) ) mor = list ( map ( int , mor ) ) sher . sort ( ) mor . sort ( ) i , j = 0 , 0 while i < n and j < n : if sher [ i ] > mor [ j ] : j += 1 else : i += 1 j += 1 minFlicks = n - i i , j = 0 , 0 while i < n and j < n : if sher [ i ] >= mor [ j ] : j += 1 else : i += 1 j += 1 maxFlicks = i print ( minFlicks ) print ( maxFlicks )   for _ in range ( ri ( ) if 0 else 1 ) : solve ( _ + 1 ) NEW_LINE


n = int ( input ( ) ) s1 = input ( ) s2 = input ( ) dp1 = [ 0 ] * 10 ; dp2 = [ 0 ] * 10 for i in s1 : dp1 [ int ( i ) ] += 1 for i in s2 : dp2 [ int ( i ) ] += 1 NEW_LINE


n = int ( input ( ) ) str_sher = str ( input ( ) ) str_mor = str ( input ( ) )   num_sher = [ 0 ] * 10 num_mor = [ 0 ] * 10 num_sher . append ( - 1 ) num_mor . append ( - 1 )   for s in str_sher : num_sher [ ord ( s ) - ord ( '0' ) ] += 1   for s in str_mor : num_mor [ ord ( s ) - ord ( '0' ) ] += 1   def next_value ( nums , p ) : if ( p > 10 ) : return p while ( nums [ p ] == 0 ) : p += 1 nums [ p ] -= 1 return p   def calc_hits ( num_sher , num_mor , is_min_strategy ) : shift = 0 if ( not is_min_strategy ) : shift = 1 p_sher = 0 num = 0 p_sher = next_value ( num_sher , p_sher ) p_mor = next_value ( num_mor , p_sher + shift )   while ( p_sher < 10 and p_mor < 10 ) : num += ( p_sher <= p_mor ) p_sher = next_value ( num_sher , p_sher ) p_mor = next_value ( num_mor , p_sher + shift )   if ( is_min_strategy ) : return n - num else : return num   print ( calc_hits ( num_sher . copy ( ) , num_mor . copy ( ) , True ) ) print ( calc_hits ( num_sher . copy ( ) , num_mor . copy ( ) , False ) ) NEW_LINE


n = int ( input ( ) ) s = list ( input ( ) ) t = list ( input ( ) ) for i in range ( n ) : s [ i ] = int ( s [ i ] ) t [ i ] = int ( t [ i ] ) s . sort ( ) t . sort ( ) c1 = 0 idx = 0 for i in range ( n ) : while idx < n and s [ i ] > t [ idx ] : idx += 1 if idx < n : c1 += 1 idx += 1 ans1 = n - c1c2 = 0 idx = 0 for i in range ( n ) : while idx < n and s [ i ] >= t [ idx ] : idx += 1 if idx < n : c2 += 1 idx += 1 ans2 = c2print ( ans1 ) print ( ans2 ) NEW_LINE


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


import java . util . * ; import java . io . * ; import java . math . * ;   public class First {   public static void process ( ) throws IOException { int n = ni ( ) ; String s1 = nln ( ) ; String s2 = nln ( ) ; int s [ ] = new int [ n ] ; int m [ ] = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = Integer . parseInt ( String . valueOf ( s1 . charAt ( i ) ) ) ; m [ i ] = Integer . parseInt ( String . valueOf ( s2 . charAt ( i ) ) ) ; } Arrays . sort ( s ) ; Arrays . sort ( m ) ; int min = 0 , max = n ;   int i = 0 ; int j = 0 ; while ( i < n && j < n ) { if ( s [ i ] <= m [ j ] ) { i ++ ; } j ++ ; } if ( i < n ) { min = ( n - i ) ; } i = 0 ; j = 0 ; while ( i < n && j < n ) { if ( s [ i ] < m [ j ] ) { i ++ ; } j ++ ; } if ( i < n ) { max = i ; } pn ( min ) ; pn ( max ) ; }     static AnotherReader sc ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { out = new PrintWriter ( System . out ) ; sc = new AnotherReader ( ) ; boolean oj = true ;


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int r = scan . nextInt ( ) ; int g = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; int time = 0 ; while ( r > 0 || g > 0 || b > 0 ) { if ( time % 3 == 0 ) r -= 2 ; else if ( time % 3 == 1 ) g -= 2 ; else if ( time % 3 == 2 ) b -= 2 ; time ++ ; } time += 30 - 1 ; System . out . println ( time ) ; } }

r = lambda : list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE arr = r ( ) NEW_LINE c = 0 NEW_LINE i = 0 NEW_LINE while arr . count ( 0 ) != 3 : arr [ i % 3 ] = max ( 0 , arr [ i % 3 ] - 2 ) NEW_LINE c += 1 NEW_LINE i += 1   print ( 29 + c ) NEW_LINE


rgb = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE ans = 0 NEW_LINE for i in range ( 3 ) : temp = ( rgb [ i ] - 1 ) // 2 * 3 + 30 + i NEW_LINE ans = max ( temp , ans ) NEW_LINE print ( ans ) NEW_LINE


r , g , b = map ( int , input ( ) . split ( ) ) NEW_LINE x = 0 NEW_LINE while True : if NEW_LINE r > 0 : r -= 2 NEW_LINE r = max ( 0 , r ) NEW_LINE if r == g and g == b and g == 0 : break NEW_LINE x += 1 else : x += 1 NEW_LINE if g > 0 : g -= 2 NEW_LINE g = max ( 0 , g ) NEW_LINE if r == g and g == b and g == 0 : break NEW_LINE x += 1 else : x += 1 NEW_LINE if b > 0 : b -= 2 NEW_LINE b = max ( 0 , b ) NEW_LINE if r == g and g == b and g == 0 : break NEW_LINE x += 1 else : x += 1 NEW_LINE print ( x + 30 ) NEW_LINE


from math import ceilr , g , b = map ( int , input ( ) . split ( ) ) NEW_LINE r1 = 30 + ( ceil ( r / 2 ) - 1 ) * 3 NEW_LINE g1 = ( ceil ( g / 2 ) - 1 ) * 3 + 1 + 30 NEW_LINE b1 = ( ceil ( b / 2 ) - 1 ) * 3 + 2 + 30 NEW_LINE print ( max ( r1 , g1 , b1 ) ) NEW_LINE


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int r = sc . nextInt ( ) ; int g = sc . nextInt ( ) ; int b = sc . nextInt ( ) ;   System . out . println ( Math . max ( calculateTime ( r ) , Math . max ( 1 + calculateTime ( g ) , 2 + calculateTime ( b ) ) ) ) ; }   private static int calculateTime ( int x ) { if ( x == 0 ) { return 0 ; }   return 30 + ( ( x - 1 ) / 2 ) * 3 ; } }


import java . io . * ; import java . util . * ;   public class Cableway { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int r = Integer . parseInt ( st . nextToken ( ) ) ; int g = Integer . parseInt ( st . nextToken ( ) ) ; int b = Integer . parseInt ( st . nextToken ( ) ) ; int max1 = Math . max ( ( r + 1 ) / 2 * 3 + 27 , ( g + 1 ) / 2 * 3 + 28 ) ; int max2 = Math . max ( ( g + 1 ) / 2 * 3 + 28 , ( b + 1 ) / 2 * 3 + 29 ) ; int max3 = Math . max ( ( r + 1 ) / 2 * 3 + 27 , ( b + 1 ) / 2 * 3 + 29 ) ; int time = Math . max ( max1 , Math . max ( max2 , max3 ) ) ; System . out . println ( time ) ; } }


import java . util . * ; import java . lang . Math ; public class test4 { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int r = s . nextInt ( ) ; int g = s . nextInt ( ) ; int b = s . nextInt ( ) ; int t = 29 ; int check = 0 ; while ( check == 0 ) { if ( r <= 0 && g <= 0 && b <= 0 ) { check = 1 ; } if ( check == 0 ) { r -= 2 ; t ++ ; } if ( r <= 0 && g <= 0 && b <= 0 ) { check = 1 ; } if ( check == 0 ) { g -= 2 ; t ++ ; } if ( r <= 0 && g <= 0 && b <= 0 ) { check = 1 ; } if ( check == 0 ) { b -= 2 ; t ++ ; } } System . out . println ( t ) ; } }


import java . util . * ;   public class CodeForces90A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int r = input . nextInt ( ) ; int g = input . nextInt ( ) ; int b = input . nextInt ( ) ;   int [ ] a = new int [ 3 ] ; a [ 0 ] = ( r + 1 ) / 2 ; a [ 1 ] = ( g + 1 ) / 2 ; a [ 2 ] = ( b + 1 ) / 2 ; int max = 0 ; int index = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( max <= a [ i ] ) { max = a [ i ] ; index = i ; } }   System . out . println ( ( ( max - 1 ) * 3 ) + index + 1 + 29 ) ; } }


import java . util . * ; import java . io . * ; public class A { static FastReader in = new FastReader ( ) ; static final Random random = new Random ( ) ; static long mod = 1000000007L ;   public static void main ( String args [ ] ) throws IOException { int t = 1 ;

import mathn = int ( input ( ) ) cnt = 0 for i in range ( 1 , n ) : for j in range ( 1 , i + 1 ) : c2 = int ( ( i * i ) + ( j * j ) ) NEW_LINE


from math import gcd , sqrtn = int ( input ( ) ) ; ans = 0 for i in range ( 5 , n + 1 ) : for j in range ( 1 , i ) : k = i ** 2 - j ** 2 if int ( sqrt ( k ) ) == sqrt ( k ) : ans += 1 print ( ans // 2 ) NEW_LINE


from math import gcd , sqrtn = int ( input ( ) ) ; ans = 0 ; sett = set ( ) for i in range ( 3 , n + 1 ) : for j in range ( i , n + 1 ) : k = i ** 2 + j ** 2 if int ( sqrt ( k ) ) == sqrt ( k ) and sqrt ( k ) <= n : ans += 1 print ( ans ) NEW_LINE


from math import sqrtn = int ( input ( ) ) count = 0 for i in range ( 1 , n + 1 ) : for j in range ( i , n + 1 ) : c = i ** 2 + j ** 2 if sqrt ( c ) == int ( sqrt ( c ) ) and sqrt ( c ) <= n : count += 1 print ( count ) NEW_LINE


import java . util . * ;   public class CodeForces304A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int a = 0 ; int b = 0 ; int c = 0 ; int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { a = i ; for ( int j = i ; j <= n ; j ++ ) { b = j ; c = ( int ) Math . sqrt ( ( a * a ) + ( b * b ) ) ; if ( a * a + b * b == c * c && c <= n ) { count ++ ; } } } System . out . println ( count ) ; } }


import java . util . Scanner ;   public class PythogoreanTriplets { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ;   int n = scan . nextInt ( ) ; int count = 0 ;   for ( int a = 2 ; a < n ; a ++ ) { for ( int b = 1 ; b < a ; b ++ ) { double c = Math . sqrt ( a * a + b * b ) ; if ( c - ( int ) c == 0.0 && c <= n ) count ++ ; } } System . out . println ( count ) ; } }


import java . util . * ;      public class geek {    public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; try { StringBuffer sb = new StringBuffer ( ) ; int n = s . nextInt ( ) ; int ans = 0 ;   for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = i ; j <= n ; j ++ ) {   double sqrt = Math . sqrt ( ( i * i ) + ( j * j ) ) ; if ( sqrt % 1 == 0 && sqrt <= n ) { ans ++ ; } } } sb . append ( ans + " \n " ) ;         System . out . println ( sb ) ;


import java . io . BufferedReader ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . io . * ; public class codeforces { static class Student { int x , y ;

import sysfrom math import * from fractions import gcdreadints = lambda : map ( int , input ( ) . strip ( ' \n ' ) . split ( ) ) def ispal ( s ) : n = len ( s ) for i in range ( n // 2 ) : if s [ i ] != s [ n - i - 1 ] : return False return True s = input ( ) n = len ( s ) for i in range ( 1 , n ) : a , b = s [ : i ] , s [ i : ] t = b + a if t != s and ispal ( t ) : print ( 1 ) sys . exit ( 0 ) k = n / 2 if n % 2 == 1 : k = ceil ( k ) k = int ( k ) for i in range ( 1 , k ) : a , b , c = s [ : i ] , s [ i : - i ] , s [ - i : ] t = c + b + a if t != s and ispal ( t ) : print ( 2 ) sys . exit ( 0 ) print ( " Impossible " ) NEW_LINE


import java . util . HashSet ; import java . util . Scanner ;   public class Sasha_and_One_More_Name {   public static void main ( String [ ] args ) {   Scanner scn = new Scanner ( System . in ) ; String s = scn . next ( ) ; long [ ] hash = new long [ s . length ( ) ] ; long p = 1 ; long mod = 1000000007 ; long [ ] pp = new long [ s . length ( ) ] ; long [ ] hashs = new long [ s . length ( ) ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { long val = ( ( i > 0 ? hash [ i - 1 ] : 0 ) + ( ( s . charAt ( i ) - ' a ' + 1 ) * p ) % mod ) % mod ; long pre = ( ( i > 0 ? hashs [ i - 1 ] : 0 ) * 7919 ) % mod ; long sv = ( pre + ( s . charAt ( i ) - ' a ' + 1 ) ) % mod ; hash [ i ] = val ; hashs [ i ] = sv ; pp [ i ] = p ; p = ( p * 7919 ) % mod ;   } int n = s . length ( ) ; if ( hashs [ n - 1 ] != hash [ n - 1 ] ) { System . out . println ( " Impossible " ) ; } else {   if ( n % 2 == 0 ) { if ( s . chars ( ) . distinct ( ) . count ( ) == 1 ) { System . out . println ( " Impossible " ) ; } else { boolean got = false ; while ( n > 1 ) { if ( n % 2 == 1 ) { System . out . println ( 2 ) ; return ; } else { if ( hash [ n / 2 - 1 ] != hashs [ n / 2 - 1 ] ) { System . out . println ( 1 ) ; return ; } } n /= 2 ; } System . out . println ( 2 ) ; } return ; }


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


import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int r = ( int ) Math . sqrt ( n ) ; for ( int i = r ; i >= 1 ; i -- ) { if ( n % i == 0 ) { System . out . println ( i + " ▁ " + n / i ) ; break ; } } } }

def factors ( n ) : return [ ( i , int ( n / i ) ) for i in range ( 1 , int ( n ** 0.5 ) + 1 ) if n % i == 0 ] NEW_LINE


n = int ( input ( ) ) a = int ( n ** .5 ) while n % a : a -= 1 print ( a , n // a ) NEW_LINE


n = int ( input ( ) ) a = int ( n ** 0.5 ) while n % a : a -= 1 print ( a , n // a ) NEW_LINE


c = [ ] import mathn = int ( input ( ) ) for i in range ( 1 , n + 1 ) : if n % i == 0 : c . append ( i ) min = 9999999 a = b = int ( math . sqrt ( n ) ) for i in range ( 1 , len ( c ) ) : m = c [ i ] - c [ i - 1 ] if m < min and c [ i ] * c [ i - 1 ] == n : a = c [ i ] b = c [ i - 1 ] min = mprint ( b , a ) NEW_LINE


import mathn = int ( input ( ) ) a = int ( math . sqrt ( n ) ) while ( n % a != 0 ) : a = a - 1 print ( a , n // a ) NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int a = input . nextInt ( ) ; int ans1 = 0 , ans2 = 0 , minn = Integer . MAX_VALUE ; for ( int i = 1 ; i <= a ; i ++ ) { if ( a % i == 0 ) { int temp1 = i , temp2 = a / i ; if ( Math . abs ( temp2 - temp1 ) < minn ) { minn = Math . abs ( temp2 - temp1 ) ; ans1 = Math . min ( temp1 , temp2 ) ; ans2 = Math . max ( temp1 , temp2 ) ; } } } System . out . println ( ans1 + " ▁ " + ans2 ) ; }   public static int minCost ( int [ ] array ) { int len = array . length ; if ( len == 0 || len == 1 ) { return 0 ; } int sum = 0 ; LinkedList < Integer > queue = new LinkedList < > ( ) ; Arrays . sort ( array ) ; queue . offer ( array [ 0 ] ) ; for ( int i = 1 ; i < len ; i ++ ) { int temp = queue . getLast ( ) ; if ( array [ i ] <= temp ) { sum += temp - array [ i ] + 1 ; queue . addLast ( temp + 1 ) ; } else { queue . addLast ( temp ) ; } } return sum ; }   public static int mixx ( int a , int b , int c ) { return Math . min ( Math . min ( a , b ) , c ) ; } }


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Main main = new Main ( ) ; Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int num1 = 0 ; int num2 = 0 ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { num1 = i ; num2 = n / i ; } } System . out . println ( num1 + " ▁ " + num2 ) ; } }


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int m = n ; int z = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( n % i == 0 ) if ( Math . abs ( n / i - i ) < Math . abs ( m - z ) ) { m = i ; z = n / i ; } } if ( z > m ) { int temp = z ; z = m ; m = temp ; } System . out . println ( z + " ▁ " + m ) ;


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ADisplaySize solver = new ADisplaySize ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ADisplaySize { int n ;   public void readInput ( Scanner sc ) { n = sc . nextInt ( ) ; }   public void solve ( int testNumber , Scanner sc , PrintWriter pw ) { int q = 1 ; while ( q -- > 0 ) { readInput ( sc ) ; String ans = "1 ▁ " + n ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { ans = i + " ▁ " + n / i ; } } pw . println ( ans ) ; } }   }   static class Scanner { StringTokenizer st ; BufferedReader br ;   public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; }   public String next ( ) { try { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   } }


import java . io . * ; import java . util . * ; import java . math . * ; import java . math . BigInteger ;    public final class A { static StringBuilder ans = new StringBuilder ( ) ; static FastReader in = new FastReader ( ) ; static ArrayList < ArrayList < Integer > > g , tg ; static long mod = 998244353 ; static boolean set [ ] , nodes [ ] ; static int par [ ] , col [ ] ; static char G [ ] [ ] ; static int dp [ ] [ ] ;

import java . util . * ; public class CF { private static void sport ( String [ ] a ) { int [ ] [ ] dp = new int [ 26 ] [ 26 ] ; boolean [ ] [ ] can = new boolean [ 26 ] [ 26 ] ; int ans = 0 ; for ( String s : a ) { int l = s . charAt ( 0 ) - ' a ' ; int r = s . charAt ( s . length ( ) - 1 ) - ' a ' ; for ( int i = 0 ; i < 26 ; i + + ) { if ( can [ i ] [ l ] ) { can [ i ] [ r ] = true ; dp [ i ] [ r ] = Math . max ( dp [ i ] [ r ] , dp [ i ] [ l ] + s . length ( ) ) ; } } can [ l ] [ r ] = true ; dp [ l ] [ r ] = Math . max ( dp [ l ] [ r ] , s . length ( ) ) ; } for ( int i = 0 ; i < 26 ; i + + ) { ans = Math . max ( ans , dp [ i ] [ i ] ) ; } System . out . println ( ans ) ; }   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] a = new String [ n ] ; for ( int i = 0 ; i < n ; i + + ) { a [ i ] = sc . next ( ) ; } sport ( a ) ; } } NEW_LINE


from sys import stdinn = int ( stdin . readline ( ) . strip ( ) ) l = [ stdin . readline ( ) . strip ( ) for i in range ( n ) ] dp = [ ] for i in range ( 26 ) : dp . append ( [ - 999999999 ] * 26 ) ans = 0 for i in range ( 26 ) : dp [ i ] [ i ] = 0 for j in range ( n ) : first = ord ( l [ j ] [ 0 ] ) - 97 ln = len ( l [ j ] ) last = ord ( l [ j ] [ ln - 1 ] ) - 97 dp [ i ] [ last ] = max ( dp [ i ] [ last ] , dp [ i ] [ first ] + ln ) ans = max ( ans , dp [ i ] [ i ] ) print ( ans ) NEW_LINE


from sys import stdinn = int ( stdin . readline ( ) ) l = [ [ 0 for i in range ( 26 ) ] for i in range ( 26 ) ] for i in range ( n ) : s = stdin . readline ( ) . strip ( ) NEW_LINE


from sys import stdininput = stdin . readlinen = int ( input ( ) ) s = list ( input ( ) . strip ( ) for _ in range ( n ) ) dp = [ [ 0 for i in range ( 28 ) ] for j in range ( 28 ) ] for i in range ( n ) : a , b = ord ( s [ i ] [ 0 ] ) - ord ( ' a ' ) , ord ( s [ i ] [ - 1 ] ) - ord ( ' a ' ) for j in range ( 26 ) : if dp [ j ] [ a ] > 0 : dp [ j ] [ b ] = max ( dp [ j ] [ b ] , dp [ j ] [ a ] + len ( s [ i ] ) ) dp [ a ] [ b ] = max ( dp [ a ] [ b ] , len ( s [ i ] ) ) res = 0 for i in range ( 26 ) : res = max ( res , dp [ i ] [ i ] ) print ( res ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Dynasty_Puzzles { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int t = 1 ;   while ( t -- > 0 ) { int n = Integer . parseInt ( br . readLine ( ) ) ;   long dp [ ] [ ] = new long [ 26 ] [ 26 ] ; for ( int i = 0 ; i < n ; i ++ ) { String x = br . readLine ( ) . trim ( ) ; int a = x . charAt ( 0 ) - ' a ' ; int b = x . charAt ( x . length ( ) - 1 ) - ' a ' ;   for ( int j = 0 ; j < 26 ; j ++ ) { if ( dp [ j ] [ a ] == 0 ) continue ; dp [ j ] [ b ] = Math . max ( dp [ j ] [ b ] , dp [ j ] [ a ] + x . length ( ) ) ; }   dp [ a ] [ b ] = Math . max ( dp [ a ] [ b ] , x . length ( ) ) ; } long ans = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { ans = Math . max ( ans , dp [ i ] [ i ] ) ; }   pw . println ( ans ) ; } pw . flush ( ) ; }   }


import java . io . * ; import java . util . * ;   public class Main { private static InputReader in ; private static PrintWriter out ;   public static void main ( String [ ] args ) { in = new InputReader ( ) ; out = new PrintWriter ( System . out ) ; int t = 1 ;


import java . util . * ; public class CF { private static void sport ( String [ ] a ) { int [ ] [ ] dp = new int [ 26 ] [ 26 ] ; boolean [ ] [ ] can = new boolean [ 26 ] [ 26 ] ; int ans = 0 ; for ( String s : a ) { int l = s . charAt ( 0 ) - ' a ' ; int r = s . charAt ( s . length ( ) - 1 ) - ' a ' ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( can [ i ] [ l ] ) { can [ i ] [ r ] = true ; dp [ i ] [ r ] = Math . max ( dp [ i ] [ r ] , dp [ i ] [ l ] + s . length ( ) ) ; } } can [ l ] [ r ] = true ; dp [ l ] [ r ] = Math . max ( dp [ l ] [ r ] , s . length ( ) ) ; } for ( int i = 0 ; i < 26 ; i ++ ) { ans = Math . max ( ans , dp [ i ] [ i ] ) ; } System . out . println ( ans ) ; }   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] a = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } sport ( a ) ; } }


import java . util . Scanner ;   public class MaximumInTable { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ;   int [ ] [ ] arr = new int [ n ] [ n ] ;    for ( int i = 0 ; i < n ; i ++ ) { arr [ 0 ] [ i ] = 1 ; }   for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] [ 0 ] = 1 ; }   int res = calculateValue ( n - 1 , n - 1 , arr ) ; System . out . println ( res ) ;   }   private static int calculateValue ( int i , int j , int [ ] [ ] arr ) { if ( arr [ i ] [ j ] != 0 ) { return arr [ i ] [ j ] ; }   int result = calculateValue ( i - 1 , j , arr ) + calculateValue ( i , j - 1 , arr ) ;   arr [ i ] [ j ] = result ; return result ; } }

size_of_table = int ( input ( ) ) mat = [ [ 1 for x in range ( size_of_table ) ] for y in range ( size_of_table ) ] for i in range ( 1 , size_of_table ) : for j in range ( 1 , size_of_table ) : mat [ i ] [ j ] = mat [ i - 1 ] [ j ] + mat [ i ] [ j - 1 ] print ( mat [ size_of_table - 1 ] [ size_of_table - 1 ] ) NEW_LINE


n = int ( input ( ) ) matrix = [ [ 1 for i in range ( n ) ] for j in range ( n ) ] for i in range ( 1 , n ) : for j in range ( 1 , n ) : matrix [ i ] [ j ] = matrix [ i - 1 ] [ j ] + matrix [ i ] [ j - 1 ] print ( matrix [ n - 1 ] [ n - 1 ] ) NEW_LINE


n = int ( input ( ) ) l = [ [ 0 for i in range ( n ) ] for i in range ( n ) ] s = [ ] for i in range ( n ) : for j in range ( n ) : if ( i == 0 or j == 0 ) : l [ i ] [ j ] = 1 s . append ( l [ i ] [ j ] ) else : l [ i ] [ j ] = l [ i - 1 ] [ j ] + l [ i ] [ j - 1 ] s . append ( l [ i ] [ j ] ) print ( max ( s ) ) NEW_LINE


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


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


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int t [ ] [ ] = new int [ n + 1 ] [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { t [ i ] [ 1 ] = 1 ; } for ( int i = 1 ; i <= n ; i ++ ) { t [ 1 ] [ i ] = 1 ; } for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n ; j ++ ) { if ( i <= 1 || j <= 1 ) { continue ; } t [ i ] [ j ] = t [ i - 1 ] [ j ] + t [ i ] [ j - 1 ] ; } } int max = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n ; j ++ ) { max = Math . max ( max , t [ i ] [ j ] ) ; } } System . out . println ( max ) ; }   }


import java . util . Scanner ;   public class Codeforces {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int size = sc . nextInt ( ) ; int [ ] ans = new int [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { for ( int j = 0 ; j < size ; j ++ ) { if ( j == 0 ) { ans [ j ] = 1 ; } else { ans [ j ] += ans [ j - 1 ] ; } } } System . out . println ( ans [ size - 1 ] ) ; } }


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; int d [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) d [ i ] = s . nextInt ( ) ; int min = Math . min ( a , b ) ; int j = 0 , k = n - 1 , ans = 0 ; while ( j <= k ) { boolean v = check ( d , j , k ) ; boolean v1 = check1 ( d , j , k ) ; if ( v == false ) { ans = - 1 ; break ; } else if ( v1 == true ) { if ( d [ j ] == d [ k ] && d [ k ] == 2 ) { if ( j == k ) ans = ans + min ; else if ( j < k ) ans = ans + min * 2 ; } else { if ( d [ j ] == 0 || d [ k ] == 0 ) ans = ans + a ; else if ( d [ j ] == 1 || d [ k ] == 1 ) ans = ans + b ; } } j ++ ; k -- ; } System . out . println ( ans ) ; } public static boolean check ( int [ ] d , int j , int k ) { boolean v = true ; if ( ( d [ j ] == 0 && d [ k ] == 1 ) || ( d [ j ] == 1 && d [ k ] == 0 ) ) { v = false ; } return v ; } public static boolean check1 ( int [ ] d , int j , int k ) { boolean v = true ; if ( ( d [ j ] == 0 && d [ k ] == 0 ) || ( d [ j ] == 1 && d [ k ] == 1 ) ) { v = false ; } return v ; } }

def solve ( ) : n , a , b = map ( int , input ( ) . split ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) i , j = 0 , n - 1 prices = [ a , b ] ans = 0 while i < j : if c [ i ] == c [ j ] : if c [ i ] == 2 : ans += 2 * min ( prices ) else : cc = sorted ( [ c [ i ] , c [ j ] ] ) if cc [ 1 ] == 2 : ans += prices [ cc [ 0 ] ] else : return - 1 i += 1 j -= 1 if n % 2 == 1 and c [ n // 2 ] == 2 : ans += min ( prices ) return ans   print ( solve ( ) ) NEW_LINE


n , a , b = list ( map ( int , input ( ) . split ( ) ) ) s = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 for i in range ( n ) : if s [ i ] == 2 : if s [ n - 1 - i ] == 2 : ans = ans + min ( a , b ) elif s [ n - 1 - i ] == 0 : ans = ans + a else : ans = ans + b else : if s [ n - 1 - i ] != 2 and s [ n - 1 - i ] != s [ i ] : print ( " - 1" ) exit ( ) print ( ans ) NEW_LINE


n , a , b = list ( map ( int , input ( ) . split ( ) ) ) s = list ( map ( int , input ( ) . split ( ) ) ) c = 0 possible = Trueif s . count ( 2 ) == 0 : if s == s [ : : - 1 ] : c = 0 else : possible = Falseelse : if s == s [ : : - 1 ] : c = min ( a , b ) * ( s . count ( 2 ) ) else : for i in range ( 0 , n // 2 ) : if s [ i ] == s [ ( i * ( - 1 ) ) - 1 ] : if s [ i ] == 2 : c += min ( a , b ) * 2 continue else : if s [ i ] != 2 and s [ ( i * ( - 1 ) ) - 1 ] != 2 : possible = False break else : if s [ i ] == 0 or s [ ( i * ( - 1 ) ) - 1 ] == 0 : c += a else : c += b if n % 2 != 0 and s [ n // 2 ] == 2 : c += min ( a , b ) print ( c if possible else - 1 ) NEW_LINE


import mathno_of_dancers , cost_of_white , cost_of_black = map ( int , input ( ) . split ( ) ) costume = list ( map ( int , input ( ) . split ( ) ) )   cost = 0 flag = 1   for i in range ( 0 , math . ceil ( no_of_dancers / 2 ) ) : flag = 0 if ( costume [ i ] == 2 or costume [ - i - 1 ] == 2 ) : flag = 1 if ( costume [ i ] == 2 and costume [ - i - 1 ] == 2 ) : cost += 2 * min ( cost_of_black , cost_of_white ) if ( i == math . floor ( no_of_dancers / 2 ) ) : cost -= min ( cost_of_black , cost_of_white ) elif ( costume [ i ] == 2 and costume [ - i - 1 ] != 2 ) : if ( costume [ - i - 1 ] == 1 ) : cost += cost_of_black else : cost += cost_of_white elif ( costume [ i ] != 2 and costume [ - i - 1 ] == 2 ) : if ( costume [ i ] == 1 ) : cost += cost_of_black else : cost += cost_of_white elif ( costume [ i ] == costume [ - i - 1 ] ) : flag = 1 pass else : break                       if ( flag == 0 ) : print ( - 1 ) else : print ( cost )     NEW_LINE


def solve ( ) : n , a , b = map ( int , input ( ) . split ( ) ) c = list ( map ( int , input ( ) . split ( ) ) ) i , j = 0 , n - 1 prices = [ a , b ] ans = 0 while i < j : if c [ i ] == c [ j ] : if c [ i ] == 2 : ans += 2 * min ( prices ) else : if c [ i ] == 2 : ans += prices [ c [ j ] ] elif c [ j ] == 2 : ans += prices [ c [ i ] ] else : return - 1 i += 1 j -= 1 if n % 2 == 1 and c [ n // 2 ] == 2 : ans += min ( prices ) return ans   print ( solve ( ) ) NEW_LINE


import java . util . * ;     public class geek {   public static int gcd ( int a , int b ) { if ( b == 0 ) { return a ; } return gcd ( b , a % b ) ; }    public static void main ( String [ ] args ) { try { Scanner s = new Scanner ( System . in ) ;   int n = s . nextInt ( ) ; int x = s . nextInt ( ) ; int y = s . nextInt ( ) ; int min = Math . min ( x , y ) ; int a [ ] = new int [ n ] ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class World_Cup { 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 ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } }   public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int n = in . nextInt ( ) ; int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = in . nextInt ( ) ; } int brr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { brr [ i ] += arr [ i ] / n ; if ( i >= ( arr [ i ] % n ) ) { brr [ i ] += 1 ; } else { brr [ i ] += 2 ; } } int ans = brr [ 0 ] ; int ind = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( ans > brr [ i ] ) { ans = brr [ i ] ; ind = i ; } } ind ++ ; System . out . println ( ind ) ; } }

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


import mathn = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) k = [ ] mn = 10000000000 for i in range ( n ) : sm = math . ceil ( ( a [ i ] - i ) / n ) if sm < mn : mn = sm ind = iprint ( ind + 1 ) NEW_LINE


from math import ceil   for u in range ( 1 ) : n = int ( input ( ) ) x = [ int ( w ) for w in input ( ) . split ( ) ] ans = [ ] for i in range ( n ) : if ( i + 1 >= x [ i ] + 1 ) : ans . append ( i + 1 ) else : t = ceil ( ( x [ i ] + 1 - ( i + 1 ) ) / n ) ans . append ( i + 1 + t * n ) a = min ( ans ) print ( ans . index ( a ) + 1 ) NEW_LINE


import java . util . Scanner ; public class BREAK { public static void main ( String [ ] args ) { Scanner obj = new Scanner ( System . in ) ; int n = obj . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = obj . nextInt ( ) ; } int k = 0 ; for ( int i = 0 ; ; i ++ ) { if ( i == n ) i = 0 ; if ( arr [ i ] - k <= 0 ) { System . out . println ( i + 1 ) ; break ; } k ++ ; } } }


import java . io . * ; import java . util . * ;   public class B { public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ; int t = 1 ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Solution { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( reader . readLine ( ) ) ; int [ ] arr = new int [ 1000001 ] ; StringTokenizer sToken = new StringTokenizer ( reader . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ Integer . parseInt ( sToken . nextToken ( ) ) ] ++ ; } int rest = 0 ; int res = 0 ; for ( int i = 0 ; i <= 1000000 ; i ++ ) { res += ( ( rest + arr [ i ] ) % 2 ) ; rest = ( rest + arr [ i ] ) / 2 ; } for ( int i = 0 ; i < 40 ; i ++ ) { res += ( rest % 2 ) ; rest = rest / 2 ; } System . out . println ( res ) ; } }

n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) cnt = [ 0 ] * ( 10 ** 6 + 100 ) for i in l : cnt [ i ] += 1 s = 0 ans = 0 for i in cnt : s += i ans += s % 2 s //= 2 print ( ans ) NEW_LINE


import sysreadline = sys . stdin . readline   N = int ( readline ( ) ) A = list ( map ( int , readline ( ) . split ( ) ) ) K = 100 + max ( A ) L = [ 0 ] * Kfor a in A : L [ a ] += 1   for i in range ( K ) : if L [ i ] > 1 : L [ i + 1 ] += L [ i ] // 2 L [ i ] = L [ i ] % 2 print ( sum ( L ) ) NEW_LINE


import osimport sysfrom io import BytesIO , IOBaseBUFSIZE = 8192 class FastIO ( IOBase ) : newlines = 0 def __init__ ( self , file ) : self . _fd = file . fileno ( ) self . buffer = BytesIO ( ) self . writable = " x " in file . mode or " r " not in file . mode self . write = self . buffer . write if self . writable else None def read ( self ) : while True : b = os . read ( self . _fd , max ( os . fstat ( self . _fd ) . st_size , BUFSIZE ) ) if not b : break ptr = self . buffer . tell ( ) self . buffer . seek ( 0 , 2 ) , self . buffer . write ( b ) , self . buffer . seek ( ptr ) self . newlines = 0 return self . buffer . read ( ) def readline ( self ) : while self . newlines == 0 : b = os . read ( self . _fd , max ( os . fstat ( self . _fd ) . st_size , BUFSIZE ) ) self . newlines = b . count ( b " \n " ) + ( not b ) ptr = self . buffer . tell ( ) self . buffer . seek ( 0 , 2 ) , self . buffer . write ( b ) , self . buffer . seek ( ptr ) self . newlines -= 1 return self . buffer . readline ( ) def flush ( self ) : if self . writable : os . write ( self . _fd , self . buffer . getvalue ( ) ) self . buffer . truncate ( 0 ) , self . buffer . seek ( 0 ) class IOWrapper ( IOBase ) : def __init__ ( self , file ) : self . buffer = FastIO ( file ) self . flush = self . buffer . flush self . writable = self . buffer . writable self . write = lambda s : self . buffer . write ( s . encode ( " ascii " ) ) self . read = lambda : self . buffer . read ( ) . decode ( " ascii " ) self . readline = lambda : self . buffer . readline ( ) . decode ( " ascii " )     sys . stdin , sys . stdout = IOWrapper ( sys . stdin ) , IOWrapper ( sys . stdout ) input = lambda : sys . stdin . readline ( ) . rstrip ( " \n " ) NEW_LINE


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 = 1000000007 ;   private static final int MAXN = 200001 ; 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 ) ;