import java . util . Scanner ; public class year { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; while ( x > 0 ) { x = x + 1 ; int a = x % 10 ; int b = ( x / 10 ) % 10 ; int c = ( x / 100 ) % 10 ; int d = ( x / 1000 ) % 10 ; if ( a != b && a != c && a != d && b != c && b != d && c != d ) { break ; } else continue ; } System . out . println ( x ) ; } }


year = input ( ' ' ) while True : year = str ( int ( year ) + 1 ) nums = [ ] for y in year : if y not in nums : nums . append ( y ) if len ( nums ) == 4 : print ( year ) break NEW_LINE


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

l = int ( input ( ) ) def split ( num ) : return list ( num ) for i in range ( l + 1 , 9013 ) : u = str ( i ) v = split ( u ) o = set ( v ) if len ( o ) == 4 : v = i breakprint ( v ) NEW_LINE


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . HashSet ; import java . util . StringTokenizer ; import java . io . IOException ; 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 ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ABeautifulYear solver = new ABeautifulYear ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ABeautifulYear { public void solve ( int testNumber , FastScanner fs , PrintWriter out ) { int y = fs . nextInt ( ) , ans = y + 1 ; HashSet < Integer > dist = new HashSet < > ( ) ; for ( int i = y + 1 ; i <= 10000 ; i ++ ) { int t = i ; dist . clear ( ) ; boolean yes = true ; while ( t > 0 ) { int d = t % 10 ; if ( dist . contains ( d ) ) { yes = false ; break ; } dist . add ( d ) ; t /= 10 ; } if ( yes ) { out . println ( i ) ; break ; } } }   }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( InputStream inputStream ) { br = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }   public String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   } }


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

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


import math , sysfrom collections import defaultdict , dequeimport bisect as bidef yes ( ) : print ( ' YES ' ) def no ( ) : print ( ' NO ' ) def I ( ) : return ( int ( sys . stdin . readline ( ) ) ) def In ( ) : return ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def Sn ( ) : return sys . stdin . readline ( ) . strip ( ) def Pr ( x ) : sys . stdout . write ( str ( x ) + ' \n ' ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) l . sort ( ) s = sum ( l ) for i in range ( 1 , n ) : if l [ i ] <= l [ i - 1 ] : l [ i ] = l [ i - 1 ] + 1 print ( sum ( l ) - s ) NEW_LINE


from collections import defaultdictn = int ( input ( ) ) arr = tuple ( map ( int , input ( ) . split ( ) ) ) d = defaultdict ( int ) for i in arr : d [ i ] += 1 i = 0 ans = 0 while i <= n or d [ i - 1 ] != 0 : if d [ i ] : ans += d [ i ] - 1 d [ i + 1 ] += d [ i ] - 1 i += 1 print ( ans ) NEW_LINE


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


import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ;   public class pblm3 { static int sum ; public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ar [ i ] = sc . nextInt ( ) ; Arrays . sort ( ar ) ; List < Integer > ll = new ArrayList < Integer > ( ) ; int i = 0 , val = 1 ; while ( val <= 3000 ) { while ( i < n && val < ar [ i ] ) ll . add ( val ++ ) ; val ++ ; i ++ ; } int sum = 0 ;


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

n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) c = 0 ans = - 1 for i in range ( n - 1 ) : while c < n - 1 and a [ c + 1 ] - a [ i ] <= m : c += 1 if i < c - 1 : ans = max ( ans , ( a [ c ] - a [ i + 1 ] ) / ( a [ c ] - a [ i ] ) ) print ( ans ) NEW_LINE


import sysinput = sys . stdin . readlinefrom bisect import *   n , U = map ( int , input ( ) . split ( ) ) E = list ( map ( int , input ( ) . split ( ) ) ) ans = - 1   for i in range ( n ) : j = i + 1 k = bisect_right ( E , E [ i ] + U ) - 1 if k - i >= 2 : ans = max ( ans , ( E [ k ] - E [ j ] ) / ( E [ k ] - E [ i ] ) )   print ( ans ) NEW_LINE


from bisect import bisect_left as bin , u = list ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a . sort ( ) c = [ ] for i in range ( n - 1 ) : b = bi ( a , a [ i ] + u ) if b != n : if a [ b ] == a [ i ] + u : b = b + 1 b = a [ b - 1 ] if b - a [ i ] != 0 : c . append ( ( b - a [ i + 1 ] ) / ( b - a [ i ] ) ) if len ( c ) == 0 or max ( c ) == 0 : print ( - 1 ) else : print ( max ( c ) ) NEW_LINE


import mathimport sysfrom collections import dequefrom fractions import Fraction NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) c = 0 ans = - 1f or i in range ( n - 1 ) : while c < n - 1 and a [ c + 1 ] - a [ i ] <= m : c += 1 if i < c - 1 : ans = max ( ans , ( a [ c ] - a [ i + 1 ] ) / ( a [ c ] - a [ i ] ) ) print ( ans )


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class temp4 { 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 class Print { private final BufferedWriter bw ; public Print ( ) { bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; } public void print ( String str ) throws IOException { bw . append ( str ) ; } public void println ( String str ) throws IOException { print ( str ) ; bw . append ( " \n " ) ; } public void close ( ) throws IOException { bw . close ( ) ; } } public static void main ( String [ ] args ) throws IOException { FastReader scn = new FastReader ( ) ;

from collections import defaultdicti = 2 n = int ( input ( ) ) dic = defaultdict ( lambda : 0 ) while n > 1 : if n % i == 0 : n //= i dic [ i ] += 1 else : i += 1 arr = list ( dic . values ( ) ) ln = len ( arr ) ans = [ 1 , 0 ] for el in dic . keys ( ) : ans [ 0 ] *= eltemp = 0 while True : onc = 0 for i in range ( ln ) : if arr [ i ] == 1 : onc += 1 if arr [ i ] % 2 == 1 : arr [ i ] += 1 temp += 1 arr [ i ] //= 2 if onc == ln : break ans [ 1 ] += 1 ans [ 1 ] += ( 1 if temp > ln and ans [ 1 ] > 0 else 0 ) print ( * ans )   NEW_LINE


import math   N = 10 ** 6 + 5 spf = [ - 1 ] * ( N + 1 ) for i in range ( N + 1 ) : spf [ i ] = ifor i in range ( 2 , int ( math . sqrt ( N ) ) + 1 ) : if spf [ i ] == i : for j in range ( i * 2 , N + 1 , i ) : if spf [ j ] == j : spf [ j ] = i   def factorize ( n ) : d = { } while n != 1 : p = spf [ n ] if p in d : d [ p ] += 1 else : d [ p ] = 1 n //= p return d   table = [ 0 ] * 31 table [ 0 ] = 1 for i in range ( 1 , 31 ) : table [ i ] = table [ i - 1 ] * 2   import bisectn = int ( input ( ) ) d = factorize ( n ) ans = 1 for k in d . keys ( ) : ans *= kcnt = 0 while True : cnt1 = 0 cnt_e = 0 max_v = 0 for k , v in d . items ( ) : if v == 1 : cnt1 += 1 if v % 2 == 0 : cnt_e += 1 max_v = max ( max_v , v ) if cnt1 == len ( d ) : break if cnt_e == len ( d ) : for k , v in d . items ( ) : d [ k ] = v // 2 cnt += 1 else : j = bisect . bisect_left ( table , max_v ) b = table [ j ] for k in d . keys ( ) : d [ k ] = b cnt += 1 print ( ans , cnt ) NEW_LINE


n = int ( input ( ) ) t = nn_ans = 1 i = 2 while i <= n : if n % i == 0 : n_ans *= i while n % i == 0 : n //= i i += 1   cnt = 0 tmp = n_answhile tmp % t != 0 : cnt += 1 tmp *= tmp   if tmp != t : cnt += 1 print ( n_ans , cnt )   NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Ideone { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; if ( n == 1 ) { System . out . println ( 1 + " ▁ " + 0 ) ; return ; } HashMap < Integer , Integer > set = getFactors ( n ) ; long ans = 1 ; int max = Integer . MIN_VALUE ; int min = Integer . MAX_VALUE ; for ( int num : set . keySet ( ) ) { ans *= num ; max = Math . max ( max , set . get ( num ) ) ; min = Math . min ( min , set . get ( num ) ) ; } if ( max == 1 ) { System . out . println ( n + " ▁ " + 0 ) ; return ; } int path = getPath ( max ) ; if ( noOfOnes ( max ) == 1 ) { if ( min == max ) {


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 ; Student ( int x , int y ) { this . x = x ; this . y = y ;

import osimport sysfrom io import BytesIO , IOBase     BUFSIZE = 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 random , math , sysfrom copy import deepcopy as dcfrom bisect import bisect_left , bisect_rightfrom collections import Counter   input = sys . stdin . readline     NEW_LINE


from sys import stdinimport mathn , k = map ( int , stdin . readline ( ) . rstrip ( ) . split ( " ▁ " ) )     a = [ [ ] for i in range ( n + 1 ) ] act = { } active = [ 0 ] * ( n + 1 )     for i in range ( 2 , n + 1 ) : if not a [ i ] : act [ i ] = 0 for j in range ( i , n + 1 , i ) : a [ j ] . append ( i )   storing = { } for _ in range ( k ) : s , v = stdin . readline ( ) . rstrip ( ) . split ( " ▁ " ) v = int ( v ) if s == " - " : if active [ v ] == 1 : print ( " Success " ) active [ v ] = 0 for i in list ( a [ v ] ) : act [ i ] = 0 else : print ( " Already ▁ off " ) else : if active [ v ] : print ( " Already ▁ on " ) else : test = 1 r = True for i in list ( a [ v ] ) : if act [ i ] : test = i r = False break if r : print ( " Success " ) active [ v ] = 1 for i in list ( a [ v ] ) [ : : - 1 ] : act [ i ] = v else : x = 0 print ( " Conflict ▁ with " , act [ test ] ) NEW_LINE


# include < bits / stdc ++ . h > using namespace std ; int primes [ 100005 ] ; int s [ 100005 ] ; bool is [ 100005 ] ; void sieve ( ) { for ( int i = 2 ; i <= 100000 ; i ++ ) { if ( s [ i ] == 0 ) { s [ i ] = i ; for ( int j = i + i ; j <= 100000 ; j += i ) { if ( s [ j ] == 0 ) s [ j ] = i ; } } } return ; } int main ( ) { sieve ( ) ; int n , m ; cin >> n >> m ; while ( m -- ) { char f ; cin >> f ; if ( f == ' + ' ) { int a ; cin >> a ; if ( is [ a ] ) { cout << " Already ▁ on \n " ; } else { vector < int > pf ; int tmp = a ; bool t = false ; while ( tmp != 1 ) { if ( primes [ s [ tmp ] ] ) { cout << " Conflict ▁ with ▁ " << primes [ s [ tmp ] ] << ' \n ' ; t = true ; break ; } else { pf . push_back ( s [ tmp ] ) ; tmp /= s [ tmp ] ; } } if ( t ) continue ; for ( auto u : pf ) { primes [ u ] = a ; } is [ a ] = true ; cout << " Success \n " ; } } else { int a ; cin >> a ; if ( is [ a ] == false ) { cout << " Already ▁ off \n " ; } else { int tmp = a ; while ( tmp != 1 ) { primes [ s [ tmp ] ] = 0 ; tmp /= s [ tmp ] ; } is [ a ] = false ; cout << " Success \n " ; } } } return 0 ; }


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

arr = [ ] for i in range ( 4 ) : arr . append ( input ( ) . split ( ) ) arr *= 3 flag = Truefor i in range ( 4 , 8 ) : if arr [ i ] [ 0 ] == '1' : if arr [ i - 1 ] [ 3 ] == '1' or arr [ i ] [ 3 ] == '1' : print ( ' YES ' ) flag = False break if arr [ i ] [ 1 ] == '1' : if arr [ i ] [ 3 ] == '1' or arr [ i + 2 ] [ 3 ] == '1' : print ( ' YES ' ) flag = False break if arr [ i ] [ 2 ] == '1' : if arr [ i ] [ 3 ] == '1' or arr [ i + 1 ] [ 3 ] == '1' : print ( ' YES ' ) flag = False breakif flag : print ( ' NO ' ) NEW_LINE


p = list ( map ( int , input ( ) . split ( ) ) ) q = list ( map ( int , input ( ) . split ( ) ) ) r = list ( map ( int , input ( ) . split ( ) ) ) s = list ( map ( int , input ( ) . split ( ) ) ) flag = 0 if p [ 3 ] == 1 : if p . count ( 1 ) > 1 or r [ 1 ] == 1 : flag = 1 NEW_LINE


p = list ( map ( int , input ( ) . split ( ) ) ) q = list ( map ( int , input ( ) . split ( ) ) ) r = list ( map ( int , input ( ) . split ( ) ) ) s = list ( map ( int , input ( ) . split ( ) ) ) flag = 0 if p [ 3 ] == 1 : if p . count ( 1 ) > 1 or r [ 1 ] == 1 or q [ 0 ] == 1 or s [ 2 ] == 1 : flag = 1 if q [ 3 ] == 1 : if q . count ( 1 ) > 1 or s [ 1 ] == 1 or r [ 0 ] == 1 or p [ 2 ] == 1 : flag = 1 if r [ 3 ] == 1 : if r . count ( 1 ) > 1 or p [ 1 ] == 1 or s [ 0 ] == 1 or q [ 2 ] == 1 : flag = 1 if s [ 3 ] == 1 : if s . count ( 1 ) > 1 or q [ 1 ] == 1 or p [ 0 ] == 1 or r [ 2 ] == 1 : flag = 1 if flag == 0 : print ( " NO " ) else : print ( " YES " )     NEW_LINE


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


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 ;   int N ; int Q ; List < Integer > [ ] adj ;   int [ ] centroids ; int [ ] sz ; int [ ] parent ; boolean [ ] visited ;   void run ( FastScanner in , PrintWriter out ) { N = in . nextInt ( ) ; Q = in . nextInt ( ) ;   adj = new List [ N + 1 ] ; centroids = new int [ N + 1 ] ; parent = new int [ N + 1 ] ; sz = new int [ N + 1 ] ;   for ( int i = 0 ; i < adj . length ; i ++ ) adj [ i ] = new ArrayList < > ( ) ;   for ( int i = 2 ; i <= N ; i ++ ) { int u = in . nextInt ( ) ; int v = i ; adj [ u ] . add ( v ) ; }   getsz ( 1 , - 1 ) ; dfsCentroid ( 1 ) ;   while ( Q -- > 0 ) { int t = in . nextInt ( ) ; out . println ( centroids [ t ] ) ; } }   void getsz ( int u , int p ) { sz [ u ] = 1 ; parent [ u ] = p ;   for ( int v : adj [ u ] ) { getsz ( v , u ) ; sz [ u ] += sz [ v ] ; } }    void dfsCentroid ( int u ) { if ( sz [ u ] == 1 ) { centroids [ u ] = u ; return ; }   int ptr = 0 ; for ( int v : adj [ u ] ) { dfsCentroid ( v ) ;

import operatorimport bisect   n , q = [ int ( s ) for s in input ( ) . split ( ) ]   ps = [ int ( s ) for s in input ( ) . split ( ) ]   childs = [ [ ] for _ in range ( n ) ]   for ( c , pa ) in enumerate ( ps ) : childs [ pa - 1 ] . append ( c + 1 ) toposort = [ ] this_level = [ 0 ] next_level = [ ] while len ( this_level ) > 0 : for this_n in this_level : toposort . append ( this_n ) for c in childs [ this_n ] : next_level . append ( c ) this_level = next_level next_level = [ ]   sz = [ 0 ] * npotentials = [ 0 ] * npotential_sz = [ 0 ] * npotential_lo = [ 0 ] * ncentr = [ 0 ] * n   for node in reversed ( toposort ) : if len ( childs [ node ] ) == 0 : centr [ node ] = node sz [ node ] = 1 else : s = 1 lg_c = - 1 lg_c_sz = 0 for c in childs [ node ] : s += sz [ c ] if sz [ c ] > lg_c_sz : lg_c_sz = sz [ c ] lg_c = c sz [ node ] = s if lg_c_sz <= sz [ node ] // 2 : centr [ node ] = node potentials [ node ] = [ node ] potential_sz [ node ] = [ sz [ node ] ] continue   potentials [ node ] = potentials [ lg_c ] potential_sz [ node ] = potential_sz [ lg_c ]   i = bisect . bisect_right ( potential_sz [ node ] , sz [ node ] // 2 , lo = potential_lo [ lg_c ] ) centr [ node ] = potentials [ node ] [ i ]   potentials [ node ] . append ( node ) potential_lo [ node ] = i potential_sz [ node ] . append ( sz [ node ] )   vs = [ int ( input ( ) ) - 1 for i in range ( q ) ] print ( ' \n ' . join ( [ str ( centr [ v ] + 1 ) for v in vs ] ) )         NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ; import java . math . * ;    public class file {

from math import sqrtfor _ in range ( int ( input ( ) ) ) : a , b = list ( map ( int , input ( ) . split ( ) ) ) if a - b != 1 : print ( " NO " ) else : c = a + b div = False for i in range ( 2 , int ( sqrt ( c ) ) + 2 ) : if c % i == 0 : div = True break if div : print ( " NO " ) else : print ( " YES " ) NEW_LINE


def isPrime ( x ) : i = int ( 2 ) if x == 2 : return True while ( i * i <= x ) : if x % i == 0 : return False i += 1 return True   for _ in range ( int ( input ( ) ) ) : a , b = map ( int , input ( ) . split ( ) ) if a - b == 1 and isPrime ( a + b ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . BigInteger ; import java . text . * ; public class Main implements Runnable { static int mod = 1000_000_007 ; static long lim = ( long ) 1e9 + 6 ; static long mod1 = 998244353 ; static boolean fileIO = false ; static FastScanner f ; static int inf = 2000_000_000 ; static PrintWriter pw = new PrintWriter ( System . out ) ; static Scanner S = new Scanner ( System . in ) ; static long x0 ; static long y0 ; static long iinf = Long . MAX_VALUE ; static double eps = ( double ) 1e-6 ; public static void solve ( ) { long a = f . nl ( ) ; long b = f . nl ( ) ; boolean ok = true ; ok &= ( a - b ) == 1 && isPrime ( a + b ) ; pn ( ok ? " YES " : " NO " ) ; } public static void main ( String [ ] args ) throws IOException , InterruptedException { Thread thread = new Thread ( null , new Main ( ) , " F * uckit " , 1 << 28 ) ; thread . start ( ) ; thread . join ( ) ; } public void run ( ) { f = new FastScanner ( System . in ) ;


import java . util . * ; import java . math . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class a { static long [ ] count , count1 , count2 ; static int [ ] arr ; static char [ ] ch , ch1 ; static int [ ] darr , farr ; static Character [ ] [ ] mat , mat1 ; static long 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 Tin { public static void main ( String [ ] args ) { Scanner tin = new Scanner ( System . in ) ; int t = tin . nextInt ( ) ; for ( int x = 0 ; x < t ; x ++ ) { boolean rhj = true ; long a = tin . nextLong ( ) ; long b = tin . nextLong ( ) ; long y = a + b ; for ( int z = 2 ; z <= Math . sqrt ( y ) ; z ++ ) { if ( y % z == 0 ) { rhj = false ; } } if ( rhj && a - b == 1 ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ; public class B { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; ArrayList < Integer > a = new ArrayList < > ( ) ; while ( t -- > 0 ) { int n = fs . nextInt ( ) ; if ( ! a . contains ( n ) ) a . add ( n ) ; } int ans = - 1 ; if ( a . size ( ) < 4 ) { if ( a . size ( ) < 2 ) { ans = 0 ; } else if ( a . size ( ) == 2 ) { if ( ( a . get ( 1 ) - a . get ( 0 ) ) % 2 == 0 ) ans = Math . abs ( ( ( a . get ( 1 ) - a . get ( 0 ) ) / 2 ) ) ; else ans = Math . abs ( a . get ( 1 ) - a . get ( 0 ) ) ;

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) )   ans = 1000   if n == 1 : print ( 0 ) exit ( ) if len ( set ( a ) ) == 1 : print ( 0 ) exit ( )   for s in range ( 101 ) : t = set ( ) for i in range ( n ) : x = abs ( s - a [ i ] ) if x == 0 : continue t . add ( x ) if len ( t ) == 1 : ans = min ( ans , list ( t ) [ 0 ] ) if ans == 1000 : print ( - 1 ) else : print ( ans ) NEW_LINE


def solve ( n , arr ) : unique_nums = sorted ( set ( arr ) )   if len ( unique_nums ) > 3 : return - 1   if len ( unique_nums ) == 2 : if ( unique_nums [ 1 ] - unique_nums [ 0 ] ) % 2 == 0 : return ( unique_nums [ 1 ] - unique_nums [ 0 ] ) // 2 return unique_nums [ 1 ] - unique_nums [ 0 ]   if len ( unique_nums ) == 1 : return 0 NEW_LINE


from sys import stdin , stdoutstdin . readlinedef mp ( ) : return list ( map ( int , stdin . readline ( ) . strip ( ) . split ( ) ) ) def it ( ) : return int ( stdin . readline ( ) . strip ( ) ) from math import ceilfrom collections import defaultdict as ddfrom collections import Counter as Cn = it ( ) l = sorted ( mp ( ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; public class discounts {


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int dp [ ] = new int [ 101 ] ; for ( int i = 0 ; i < n ; i ++ ) { dp [ s . nextInt ( ) ] ++ ; } int a = - 1 , b = - 1 , c = - 1 ; for ( int i = 0 ; i <= 100 ; i ++ ) { if ( dp [ i ] > 0 ) { if ( a == - 1 ) { a = i ; } else if ( b == - 1 ) { b = i ; } else if ( c == - 1 ) { c = i ; } else { System . out . println ( - 1 ) ; return ; } } } if ( b == - 1 && c == - 1 ) { System . out . println ( 0 ) ; return ; } if ( c == - 1 ) { if ( ( b - a ) % 2 == 0 ) { System . out . println ( ( b - a ) / 2 ) ; } else { System . out . println ( b - a ) ; } return ; } if ( 2 * b == a + c ) { System . out . println ( b - a ) ; } else { System . out . println ( - 1 ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import static java . lang . Math . * ; import static java . lang . System . out ; import java . util . * ; import java . io . PrintStream ; import java . io . PrintWriter ; public class A { static final int N = ( int ) ( 1e5 + 100 ) ; static final int mod = 1000000007 ; static final long temp = 998244353 ; static final long MOD = 1000000007 ; static final long M = ( long ) 1e9 + 7 ; static class Pair implements Comparable < Pair > { long first , second ; public Pair ( long aa , long bb ) { first = aa ; second = bb ; } public int compareTo ( Pair o ) { return ( int ) ( o . first - this . first ) ; } } static class Tuple implements Comparable < Tuple > { long first , second , third ; public Tuple ( long first , long second , long third ) { this . first = first ; this . second = second ; this . third = third ; } public int compareTo ( Tuple o ) { return ( int ) ( o . third - this . third ) ; } } public static class DSU { int [ ] parent ; int [ ] rank ;


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Squares_Seg { 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 ( Exception e ) {   e . printStackTrace ( ) ; }   } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return str ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } }   public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; long n = in . nextLong ( ) ; System . out . println ( Solve ( n ) ) ; } static long Solve ( long n ) { long l = 0 ; long r = n * 4L ; long ans = 0 ;   while ( l <= r ) { long mid = ( l + r ) / 2 ; if ( good ( mid , n ) ) { r = mid - 1 ; ans = mid ; } else { l = mid + 1 ; } } return ans ; } static boolean good ( long mid , long n ) { long x = mid / 2 ; long y = mid - mid / 2 ; return x * y >= n ; } }

import math   n = int ( input ( ) )   res = [ ] sqrt = int ( math . sqrt ( n ) ) if sqrt * sqrt >= n : print ( sqrt * 2 ) elif ( sqrt + 1 ) * sqrt >= n : print ( sqrt * 2 + 1 ) elif ( sqrt + 1 ) * ( sqrt + 1 ) >= n : print ( sqrt * 2 + 2 ) NEW_LINE


n = int ( input ( ) ) i = int ( n ** 0.5 )   k = ( n + i - 1 ) // iprint ( i + k ) NEW_LINE


import mathn = int ( input ( ) ) nn = int ( math . sqrt ( n ) ) base = 2 * nnb2 = ( n - ( nn * nn ) ) b2 = math . ceil ( b2 / nn ) print ( base + b2 ) NEW_LINE


from math import ceil , sqrtn = int ( input ( ) ) if n == 1 : print ( 2 ) if n == 2 : print ( 3 ) elif n >= 3 : print ( ceil ( 2 * sqrt ( n ) ) ) NEW_LINE


import mathn = int ( input ( ) ) print ( math . ceil ( 2 * ( n ** 0.5 ) ) ) 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 int [ ] count , count1 , count2 ; static long [ ] arr ; static char [ ] ch , ch1 ; static int [ ] darr , farr ; static Character [ ] [ ] mat , mat1 ; static long 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 . io . * ; import java . util . * ; public class Main { static BufferedReader br ; static PrintWriter pr ; static int cin ( ) throws Exception { return Integer . valueOf ( br . readLine ( ) ) ; } static int [ ] split ( ) throws Exception { String [ ] cmd = br . readLine ( ) . split ( " ▁ " ) ; int [ ] ans = new int [ cmd . length ] ; for ( int i = 0 ; i < cmd . length ; i ++ ) { ans [ i ] = Integer . valueOf ( cmd [ i ] ) ; } return ans ; } static long [ ] splitL ( ) throws IOException { String [ ] cmd = br . readLine ( ) . split ( " ▁ " ) ; long [ ] ans = new long [ cmd . length ] ; for ( int i = 0 ; i < cmd . length ; i ++ ) { ans [ i ] = Long . valueOf ( cmd [ i ] ) ; } return ans ; } static int sum ( long n ) { int ans = 0 ; while ( n != 0 ) { ans = ans + ( int ) ( n % 10 ) ; n = n / 10 ; } return ans ; } static long gcd ( long x , long y ) { if ( x == 0 ) return y ; if ( y == 0 ) return x ; if ( x > y ) return gcd ( x % y , y ) ; else return gcd ( x , y % x ) ; } public static void main ( String [ ] args ) throws Exception {


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int sqrt = ( int ) ( Math . floor ( Math . sqrt ( n ) ) ) ; if ( n == sqrt * sqrt ) System . out . println ( 2 * sqrt ) ; else if ( n - ( sqrt * sqrt ) <= sqrt ) System . out . println ( 2 * sqrt + 1 ) ; else System . out . println ( 2 * sqrt + 2 ) ; } }


import java . util . Scanner ;   public class _0854TernarySequence {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { long sum = 0 ; int a [ ] = new int [ 3 ] ; int b [ ] = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < 3 ; i ++ ) { b [ i ] = sc . nextInt ( ) ; } int min = 0 ; min = Math . min ( a [ 1 ] , b [ 0 ] ) ; a [ 1 ] -= min ; b [ 0 ] -= min ; min = Math . min ( a [ 0 ] , b [ 2 ] ) ; a [ 0 ] -= min ; b [ 2 ] -= min ; min = Math . min ( a [ 2 ] , b [ 1 ] ) ; a [ 2 ] -= min ; b [ 1 ] -= min ; sum += 2 * min ; sum -= 2 * Math . min ( a [ 1 ] , b [ 2 ] ) ; System . out . println ( sum ) ; t -- ; } }   }

for _ in range ( int ( input ( ) ) ) : x0 , x1 , x2 = map ( int , input ( ) . split ( ) ) y0 , y1 , y2 = map ( int , input ( ) . split ( ) ) res = 0 tmp = min ( x0 , y2 ) x0 -= tmp y2 -= tmp   tmp = min ( x1 , y0 ) x1 -= tmp y0 -= tmp   tmp = min ( x2 , y1 ) x2 -= tmp y1 -= tmp res += 2 * tmp   res -= 2 * min ( x1 , y2 ) print ( res ) NEW_LINE


t = int ( input ( ) )   ans = [ ]   while t : x1 , y1 , z1 = map ( int , input ( ) . split ( ) ) x2 , y2 , z3 = map ( int , input ( ) . split ( ) ) c = 0 abp = min ( z1 , y2 ) c = c + abp * 2 z3 = z3 - min ( z3 , x1 ) y1 = y1 - min ( x2 , y1 ) abn = min ( z3 , y1 ) c = c - abn * 2 ans . append ( c ) t = t - 1     for i in ans : print ( i ) NEW_LINE


cases = int ( input ( ) ) while cases : cases -= 1 zero , one , two = map ( int , input ( ) . split ( ) ) zero2 , one2 , two2 = map ( int , input ( ) . split ( ) )   ans = 0 two_mn = min ( two , one2 ) ans += ( two_mn * 2 )   one2 -= two_mn two -= two_mn   rem = two2 - ( two + zero )   ans -= max ( rem , 0 ) * 2   print ( ans )                 NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : x1 , y1 , z1 = ( map ( int , input ( ) . split ( ) ) ) x2 , y2 , z2 = ( map ( int , input ( ) . split ( ) ) ) Sum = 0 sub = 0 if z1 <= y2 : Sum = 2 * z1 z1 = 0 else : Sum = 2 * y2 z1 = z1 - y2 if z1 + x1 <= z2 : z2 = z2 - ( z1 + x1 ) sub = 2 * z2 print ( Sum - sub ) NEW_LINE


for t in range ( int ( input ( ) ) ) : x1 , y1 , z1 = map ( int , input ( ) . split ( ) ) x2 , y2 , z2 = map ( int , input ( ) . split ( ) ) sm = 0 two1 = min ( z1 , y2 ) sm += ( 2 * two1 ) z1 -= two1 y2 -= two1 one0 = min ( y1 , x2 ) y1 -= one0 x2 -= one0 one1 = min ( y1 , y2 ) y1 -= one1 y2 -= one1 one2 = min ( z2 , y1 ) sm -= 2 * ( one2 ) z2 -= one2 y1 -= one2 print ( sm ) NEW_LINE


import java . util . * ; public class nammekyahirakhahai { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; int i , j ; while ( t -- > 0 ) { int x1 = in . nextInt ( ) ; int y1 = in . nextInt ( ) ; int z1 = in . nextInt ( ) ; int x2 = in . nextInt ( ) ; int y2 = in . nextInt ( ) ; int z2 = in . nextInt ( ) ; int pos = 0 , neg = 0 ; pos = Math . min ( z1 , y2 ) ; z1 = z1 - pos ; y2 = y2 - pos ;


import java . util . * ; public class _1401B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) {   int x1 = sc . nextInt ( ) ; int y1 = sc . nextInt ( ) ; int z1 = sc . nextInt ( ) ;   int x2 = sc . nextInt ( ) ; int y2 = sc . nextInt ( ) ; int z2 = sc . nextInt ( ) ;   int res = 0 , score = 0 ;   score = Math . min ( z1 , y2 ) ;


import java . io . * ; import java . math . BigInteger ; import java . util . * ; import java . util . StringTokenizer ;   public class Main1 {   public static void main ( String [ ] args ) throws IOException { FastReader fr = new FastReader ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int T = fr . nextInt ( ) ; for ( int aa = 0 ; aa < T ; aa ++ ) { int a = fr . nextInt ( ) , b = fr . nextInt ( ) , c = fr . nextInt ( ) , d = fr . nextInt ( ) , e = fr . nextInt ( ) , f = fr . nextInt ( ) ;


import java . util . Scanner ;   public class B1401 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int [ ] A = new int [ 3 ] ; int [ ] B = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { A [ i ] = in . nextInt ( ) ; } for ( int i = 0 ; i < 3 ; i ++ ) { B [ i ] = in . nextInt ( ) ; } int d = Math . min ( B [ 2 ] , A [ 0 ] ) ; B [ 2 ] -= d ; d = Math . min ( B [ 2 ] , A [ 2 ] ) ; B [ 2 ] -= d ; A [ 2 ] -= d ; int answer = 2 * ( Math . min ( A [ 2 ] , B [ 1 ] ) - B [ 2 ] ) ; System . out . println ( answer ) ; } }   }


import mathimport sys   n = int ( raw_input ( ) ) mp = map ( int , raw_input ( ) . split ( ) )   cc = [ ] idx1 = - 1 idx2 = - 1   vsted = [ False ] * len ( mp ) all_even = True   for i in range ( 0 , len ( mp ) ) : if vsted [ i ] : continue   newc = [ ] x = i while not vsted [ x ] : vsted [ x ] = True newc . append ( x ) x = mp [ x ] - 1 if len ( newc ) == 1 : idx1 = len ( cc ) elif len ( newc ) == 2 : idx2 = len ( cc ) if len ( newc ) % 2 != 0 : all_even = False   cc . append ( newc ) if ( idx1 < 0 and idx2 < 0 ) or ( idx1 < 0 and not all_even ) : print " NO " sys . exit ( 0 )   print " YES " idx = 0 if idx1 < 0 : idx = idx2else : idx = idx1   for i in range ( 0 , len ( cc ) ) : if i == idx : continue for j in range ( 0 , len ( cc [ i ] ) ) : k = j % len ( cc [ idx ] ) print cc [ i ] [ j ] + 1 , cc [ idx ] [ k ] + 1   if idx == idx2 : print cc [ idx ] [ 0 ] + 1 , cc [ idx ] [ 1 ] + 1

import sysreadline = sys . stdin . readline   N = int ( readline ( ) ) P = list ( map ( lambda x : int ( x ) - 1 , readline ( ) . split ( ) ) )   PP = [ ] used = set ( ) for i in range ( N ) : if i not in used : res = [ ] while i not in used : used . add ( i ) res . append ( i ) i = P [ i ] PP . append ( res )   if any ( len ( p ) == 1 for p in PP ) : print ( ' YES ' ) for p in PP : if len ( p ) == 1 : break d = p [ 0 ] Ans = [ ] for i in range ( N ) : if i != d : Ans . append ( ' { } ▁ { } ' . format ( i + 1 , d + 1 ) ) print ( ' \n ' . join ( Ans ) ) elif not any ( len ( p ) == 2 for p in PP ) : print ( ' NO ' )   elif any ( len ( p ) & 1 for p in PP ) : print ( ' NO ' ) else : print ( ' YES ' ) dd = None for p in PP : if len ( p ) == 2 : dd = p PP . remove ( p ) break d1 , d2 = dd   Ans = [ ' { } ▁ { } ' . format ( d1 + 1 , d2 + 1 ) ] for p in PP : for i in range ( len ( p ) ) : if i & 1 : Ans . append ( ' { } ▁ { } ' . format ( d1 + 1 , p [ i ] + 1 ) ) else : Ans . append ( ' { } ▁ { } ' . format ( d2 + 1 , p [ i ] + 1 ) ) print ( ' \n ' . join ( Ans ) ) NEW_LINE


def read_data ( ) : n = int ( input ( ) ) ps = list ( map ( int , input ( ) . split ( ) ) ) return n , ps   def solve ( n , ps ) : ps = [ p - 1 for p in ps ] cycles = [ 0 ] * n roots = [ ] has_odd_cycle = False for i in range ( n ) : if cycles [ i ] > 0 : continue q = ps [ i ] cycle = 1 while q != i : cycle += 1 q = ps [ q ] if cycle & 1 : has_odd_cycle = True cycles [ i ] = cycle roots . append ( i ) q = ps [ i ] while q != i : cycles [ q ] = cycle q = ps [ q ] mincycle = min ( cycles ) if mincycle > 2 : return False , [ ] if mincycle == 1 : p = cycles . index ( 1 ) return True , [ ( p , i ) for i in range ( n ) if i != p ] if has_odd_cycle : return False , [ ] p = cycles . index ( 2 ) q = ps [ p ] edges = [ ( p , q ) ] for root in roots : if root == p or root == q : continue edges . append ( ( p , root ) ) r = ps [ root ] edges . append ( ( q , r ) ) r = ps [ r ] while r != root : edges . append ( ( p , r ) ) r = ps [ r ] edges . append ( ( q , r ) ) r = ps [ r ] return True , edges   n , ps = read_data ( ) is_possible , edges = solve ( n , ps ) if is_possible : print ( ' YES ' ) for a , b in edges : print ( a + 1 , b + 1 ) else : print ( ' NO ' ) NEW_LINE


# define _USE_MATH_DEFINES # define _CRT_SECURE_NO_DEPRECATE # include < iostream > # include < cstdio > # include < cstdlib > # include < vector > # include < sstream > # include < string > # include < map > # include < set > # include < algorithm > # include < cmath > # include < cstring > # include < queue > # include < time . h > using namespace std ; # define mp make_pair # define pb push_back # define all ( C ) ( C ) . begin ( ) , ( C ) . end ( ) # define sz ( C ) ( int ) ( C ) . size ( ) # define PRIME 123 # define PRIME1 31415 typedef long long int64 ; typedef unsigned long long uint64 ; typedef pair < int , int > pii ; typedef vector < int > vi ; typedef vector < vector < int > > vvi ;


# define _CRT_SECURE_NO_WARNINGS # include < cstdio > # include < iostream > # include < cstring > # include < string > # include < cmath > # include < algorithm > # include < vector > # include < set > # include < map > # include < queue > # include < cwctype > # include < functional > using namespace std ;   vector < vector < int > > group ; vector < pair < int , int > > ans ; int p [ 100005 ] ; bool f [ 100005 ] ; int n ;   void NO ( ) { printf ( " NO \n " ) ; exit ( 0 ) ; }   void YES ( ) { printf ( " YES \n " ) ; for ( int i = 0 ; i < ( int ) ans . size ( ) ; i ++ ) { printf ( " % d ▁ % d \n " , ans [ i ] . first + 1 , ans [ i ] . second + 1 ) ; } exit ( 0 ) ; }   int main ( ) {


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static int mod = 1000000007 ;    int N ; List < Integer > [ ] adj ; long [ ] [ ] dp ; int [ ] c ; void run ( FastScanner in , PrintWriter out ) {   N = in . nextInt ( ) ; adj = new List [ N ] ; dp = new long [ N ] [ 2 ] ; c = new int [ N ] ; for ( int i = 0 ; i < adj . length ; i ++ ) adj [ i ] = new ArrayList < > ( ) ;   for ( int v = 1 ; v < N ; v ++ ) { int u = in . nextInt ( ) ; adj [ u ] . add ( v ) ; adj [ v ] . add ( u ) ; }   for ( int i = 0 ; i < N ; i ++ ) c [ i ] = in . nextInt ( ) ;   go ( 0 , - 1 ) ; out . println ( dp [ 0 ] [ 1 ] ) ; }   void go ( int u , int p ) {

MOD = 10 ** 9 + 7     def topo_compute ( childrens , colors , parents ) : def f ( node , connected_to_black ) : if colors [ node ] == 1 and connected_to_black : return 0   children = childrens [ node ] if colors [ node ] == 1 or connected_to_black : ret = 1   for child in children : x = dp_conn [ child ] + dp_not_conn [ child ] x %= MOD   ret *= x ret %= MOD   return ret   s = 1 prefix_prod = [ ] for child in children : x = dp_conn [ child ] + dp_not_conn [ child ] x %= MOD s *= x s %= MOD prefix_prod . append ( s )   s = 1 suffix_prod = [ ] for child in reversed ( children ) : x = dp_conn [ child ] + dp_not_conn [ child ] x %= MOD s *= x s %= MOD suffix_prod . append ( s )   suffix_prod = list ( reversed ( suffix_prod ) )   ret = 0   for i in range ( len ( children ) ) : pre = prefix_prod [ i - 1 ] if i > 0 else 1 suf = suffix_prod [ i + 1 ] if i + 1 < len ( suffix_prod ) else 1   x = pre * suf x %= MOD   x *= dp_not_conn [ children [ i ] ] x %= MOD   ret += x ret %= MOD   return ret   NEW_LINE


mod = 10 ** 9 + 7 n = int ( input ( ) ) edges = list ( map ( int , input ( ) . split ( ) ) ) colored = list ( map ( int , input ( ) . split ( ) ) ) childs = [ [ ] for i in range ( n ) ]   for i in range ( 1 , n ) : childs [ edges [ i - 1 ] ] . append ( i )   dp = [ [ 0 , 0 ] for i in range ( n ) ]   for i in range ( n - 1 , - 1 , - 1 ) : prod = 1 for child in childs [ i ] : prod *= sum ( dp [ child ] ) if colored [ i ] : dp [ i ] = [ 0 , prod % mod ] else : sec = 0 for child in childs [ i ] : now = dp [ child ] [ 1 ] * prod // sum ( dp [ child ] ) sec += now dp [ i ] = [ prod % mod , sec % mod ]     print ( dp [ 0 ] [ 1 ] ) NEW_LINE


import java . io . * ; import java . util . * ; public class Solution { private static int [ ] a ; private static long [ ] [ ] dp ; private static final int mod = 1000000007 ; public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] from = new int [ n - 1 ] ; int [ ] to = new int [ n - 1 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { int u = Integer . parseInt ( st . nextToken ( ) ) ; from [ i ] = u ; to [ i ] = i + 1 ; } int [ ] [ ] g = construct ( n , from , to ) ;


import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static int mod = 1_000_000_007 ; long [ ] [ ] dp ; List < Integer > [ ] adj ; int [ ] x ; void run ( FastScanner in , PrintWriter out ) {   int n = in . nextInt ( ) ; adj = new List [ n ] ; for ( int i = 0 ; i < n ; i ++ ) adj [ i ] = new ArrayList < > ( ) ; for ( int v = 1 ; v < n ; v ++ ) { int u = in . nextInt ( ) ; adj [ u ] . add ( v ) ; adj [ v ] . add ( u ) ; } x = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) x [ i ] = in . nextInt ( ) ;


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

n , k , l , r , s , s1 = [ int ( i ) for i in input ( ) . split ( ) ] l2 = [ ] l1 = [ ] c = int ( s1 // k ) while ( len ( l1 ) < k ) : l1 . append ( c ) d = sum ( l1 ) if ( d == s1 ) : passelse : while ( d < s1 ) : for i in range ( 0 , len ( l1 ) ) : l1 [ i ] = l1 [ i ] + 1 d = d + 1 if ( d == s1 ) : break le = n - k while ( len ( l2 ) < le ) : l2 . append ( l ) e = sum ( l2 ) if ( e == ( s - s1 ) ) : passelse : while ( e < ( s - s1 ) ) : for i in range ( 0 , len ( l2 ) ) : l2 [ i ] = l2 [ i ] + 1 e = e + 1 if ( e == ( s - s1 ) ) : breakprint ( * ( l1 + l2 ) ) NEW_LINE


n , k , l , r , sa , sk = map ( int , input ( ) . split ( " ▁ " ) ) ans = [ sk // k ] * ( k - sk % k ) + [ sk // k + 1 ] * ( sk % k ) n -= kif n != 0 : sa -= sk ans1 = [ sa // n ] * ( n - sa % n ) + [ sa // n + 1 ] * ( sa % n ) ans += ans1ans = [ str ( i ) for i in ans ] print ( " ▁ " . join ( ans ) ) NEW_LINE


def main ( ) : n , k , l , r , s_all , s_k = map ( int , input ( ) . split ( ) ) ans = [ ] for i in range ( k ) : if i < s_k % k : ans . append ( s_k // k + 1 ) else : ans . append ( s_k // k ) s_r = s_all - s_k for i in range ( n - k ) : if i < s_r % ( n - k ) : ans . append ( s_r // ( n - k ) + 1 ) else : ans . append ( s_r // ( n - k ) ) print ( * ans )     if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE


import mathn , k , l , r , sall , sk = map ( int , input ( ) . split ( ) ) osk , ok = sk , klst = [ ] while k : x = math . ceil ( sk / k ) lst . append ( x ) k -= 1 sk -= xv = n - oksall -= oskwhile v : x = math . ceil ( sall / v ) lst . append ( x ) v -= 1 sall -= xprint ( * lst ) NEW_LINE


import java . util . Scanner ;   public class KidsMark { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ; int k = scanner . nextInt ( ) ; scanner . nextInt ( ) ; scanner . nextInt ( ) ; int sall = scanner . nextInt ( ) ; int sk = scanner . nextInt ( ) ;   int c = 0 ; int d = 0 ;   int a = sall - sk ; int b = n - k ; if ( b != 0 ) { c = a / b ; d = a % b ; } int e = sk / k ; int f = sk % k ;   StringBuilder ans = new StringBuilder ( ) ;   for ( int i = 0 ; i < b ; i ++ ) { int val = c ; if ( d > 0 ) { val ++ ; d -- ; }   ans . append ( val ) . append ( " ▁ " ) ; }   for ( int i = b ; i < n ; i ++ ) { int val = e ; if ( f > 0 ) { val ++ ; f -- ; }   ans . append ( val ) . append ( " ▁ " ) ; }   System . out . println ( ans ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ;   public class Solution { private final static FastReader in = new FastReader ( ) ; private static final PrintWriter out = new PrintWriter ( System . out ) ;   public static void valeraAndContest ( int n , int k , int l , int r , int sa , int sk ) {   StringBuilder sb = new StringBuilder ( ) ; sa -= sk ; for ( int x = k ; x > 0 ; x -- ) { sb . append ( sk / x ) . append ( " ▁ " ) ; sk -= sk / x ; }   for ( int x = n - k ; x > 0 ; x -- ) { sb . append ( sa / x ) . append ( " ▁ " ) ; sa -= sa / x ; } out . println ( sb ) ;    }   public static void main ( String [ ] args ) { valeraAndContest ( in . nextInt ( ) , in . nextInt ( ) , in . nextInt ( ) , in . nextInt ( ) , in . nextInt ( ) , in . nextInt ( ) ) ; out . flush ( ) ;   }   private static final class FastReader { private static BufferedReader BF ; private static StringTokenizer ST ;   public FastReader ( ) { BF = new BufferedReader ( new InputStreamReader ( System . in ) ) ; ST = null ; }    public final String next ( ) { while ( ST == null || ! ST . hasMoreTokens ( ) ) { try { ST = new StringTokenizer ( BF . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return ST . nextToken ( ) ; }   final int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   }    }


import java . io . IOException ; import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) throws IOException {   Scanner in = new Scanner ( System . in ) ;   int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; int sa = in . nextInt ( ) ; int sk = in . nextInt ( ) ;   int [ ] ans = new int [ n ] ;   int dis = sk / k ; int rem = sk % k ; for ( int i = 0 ; i < k ; i ++ ) { ans [ i ] = dis ; if ( rem > 0 ) { ans [ i ] ++ ; rem -- ; } }   if ( n - k != 0 ) { dis = ( sa - sk ) / ( n - k ) ; rem = ( sa - sk ) % ( n - k ) ; }   for ( int i = k ; i < n ; i ++ ) { ans [ i ] = dis ; if ( rem > 0 ) { ans [ i ] ++ ; rem -- ; } }   for ( int i = 0 ; i < n ; i ++ ) { System . out . print ( ans [ i ] + " ▁ " ) ; }


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


import java . io . * ; import java . util . * ;   public class Spotlights {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;

n , m = map ( int , input ( ) . split ( ) ) l = [ ] for i in range ( n ) : k = list ( map ( int , input ( ) . split ( ) ) ) l . append ( k ) ans = 0 for i in range ( n ) : for j in range ( m ) : if l [ i ] [ j ] == 1 : for k in range ( j , m ) : if l [ i ] [ k ] == 0 : ans = ans + 1 breakfor i in range ( n ) : for j in range ( m - 1 , - 1 , - 1 ) : if l [ i ] [ j ] == 1 : for k in range ( j - 1 , - 1 , - 1 ) : if l [ i ] [ k ] == 0 : ans = ans + 1 breakfor i in range ( m ) : for j in range ( n ) : if l [ j ] [ i ] == 1 : for k in range ( j + 1 , n ) : if l [ k ] [ i ] == 0 : ans = ans + 1 breakfor i in range ( m ) : for j in range ( n - 1 , - 1 , - 1 ) : if l [ j ] [ i ] == 1 : for k in range ( j - 1 , - 1 , - 1 ) : if l [ k ] [ i ] == 0 : ans = ans + 1 breakprint ( ans ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) s = [ input ( ) . split ( ) for g in range ( n ) ] ans = 0 for i in range ( n ) : cur = s [ i ] prev_1 = 0 prev_0 = 0 for j in cur : if j == '1' : ans += prev_0 prev_0 = 0 prev_1 = 1 else : ans += prev_1 prev_0 += 1 for i in range ( m ) : prev_1 = 0 prev_0 = 0 for t in range ( n ) : j = s [ t ] [ i ] if j == '1' : ans += prev_0 prev_0 = 0 prev_1 = 1 else : ans += prev_1 prev_0 += 1 print ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class CF0729B_Spotlights { static class Scanner { BufferedReader br ; StringTokenizer st ;   public Scanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static int solution ( int n , int m , boolean [ ] [ ] actors ) { int [ ] [ ] ans = new int [ n ] [ m ] ;


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


import java . util . * ; import java . io . * ; import java . math . * ;   public class First { public static void process ( ) throws IOException { int n = ni ( ) ; int m = ni ( ) ; int a [ ] [ ] = new int [ n ] [ m ] ; int h [ ] [ ] = new int [ n ] [ m ] ; int v [ ] [ ] = new int [ n ] [ m ] ;   for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { a [ i ] [ j ] = ni ( ) ; } } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( j == 0 ) { if ( a [ i ] [ j ] == 1 ) { h [ i ] [ j ] = 1 ; } else { h [ i ] [ j ] = 0 ; } } else { if ( a [ i ] [ j ] == 1 ) { h [ i ] [ j ] = h [ i ] [ j - 1 ] + 1 ; } else { h [ i ] [ j ] = h [ i ] [ j - 1 ] ; } } } } for ( int j = 0 ; j < m ; j ++ ) { for ( int i = 0 ; i < n ; i ++ ) { if ( i == 0 ) { if ( a [ i ] [ j ] == 1 ) { v [ i ] [ j ] = 1 ; } else { v [ i ] [ j ] = 0 ; } } else { if ( a [ i ] [ j ] == 1 ) { v [ i ] [ j ] = v [ i - 1 ] [ j ] + 1 ; } else { v [ i ] [ j ] = v [ i - 1 ] [ j ] ; } } } }


import java . io . * ; import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int t = scn . nextInt ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; A : while ( t -- > 0 ) { int n = scn . nextInt ( ) ; char a [ ] = scn . next ( ) . toCharArray ( ) ; char b [ ] = scn . next ( ) . toCharArray ( ) ; int pnt [ ] = new int [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) pnt [ i ] = i ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] > b [ i ] ) { out . println ( - 1 ) ; continue A ; } int r1 = find ( pnt , a [ i ] - ' a ' ) , r2 = find ( pnt , b [ i ] - ' a ' ) ; if ( r1 != r2 ) { ans ++ ; pnt [ r1 ] = r2 ; } } out . println ( ans ) ; } out . close ( ) ; }   public static int find ( int pnt [ ] , int p ) { if ( pnt [ p ] == p ) return p ; return pnt [ p ] = find ( pnt , pnt [ p ] ) ; } }

import bisectimport collectionsimport copyimport functoolsimport heapqimport itertoolsimport mathimport randomimport reimport sysimport timeimport stringfrom typing import Listsys . setrecursionlimit ( 99999 )   for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) s = input ( ) t = input ( ) f = True for i in range ( n ) : if s [ i ] > t [ i ] : f = False break if not f : print ( - 1 ) continue tree = { } def find ( st ) : tree . setdefault ( st , st ) if tree [ st ] != st : tree [ st ] = find ( tree [ st ] ) return tree [ st ]   d = [ [ 0 ] * 26 for _ in range ( 26 ) ]   for i in range ( n ) : if s [ i ] < t [ i ] : tree [ find ( s [ i ] ) ] = find ( t [ i ] )   cnt = [ 0 ] * 26 for i , c in enumerate ( string . ascii_lowercase ) : cnt [ ord ( find ( c ) ) - ord ( ' a ' ) ] += 1 ans = 0 for i in range ( 26 ) : if cnt [ i ] : ans += cnt [ i ] - 1 ; print ( ans )   NEW_LINE


import mathT = int ( input ( ) ) for _ in range ( T ) : N = int ( input ( ) ) S = input ( ) T = input ( ) if any ( a > b for a , b in zip ( S , T ) ) : print ( - 1 ) continue s = set ( ) for a , b in zip ( S , T ) : if a == b : continue s . add ( a + b ) ans = 0 while s : m = min ( s ) ans += 1 t = set ( ) for a , b in s : if a != m [ 0 ] : t . add ( a + b ) continue if m [ 1 ] == b : continue t . add ( m [ 1 ] + b ) s = t print ( ans ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Main { private static int count ; private static int root ( int [ ] parentIds , int z ) { while ( z != parentIds [ z ] ) { parentIds [ z ] = parentIds [ parentIds [ z ] ] ; z = parentIds [ z ] ; } return z ; } private static void union ( int [ ] parentIds , int x , int y ) { int rootX = root ( parentIds , x ) ; int rootY = root ( parentIds , y ) ; if ( rootX == rootY ) { return ; } count ++ ; parentIds [ rootX ] = rootY ; } public static void main ( String [ ] args ) throws IOException {


import java . io . * ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . math . RoundingMode ; import java . util . * ; import java . util . concurrent . LinkedBlockingDeque ;   import java . util . ArrayList ; import java . util . HashMap ; import java . util . LinkedList ;


import java . io . * ; import java . math . * ; import java . util . * ; import java . awt . Point ; public class Main {

n , m = [ int ( x ) for x in input ( ) . split ( ) ] a = [ ] for _ in range ( n ) : a . append ( input ( ) )   cnt_rows = [ 0 ] * ncnt_cols = [ 0 ] * mfor i in range ( n ) : for j in range ( m ) : if a [ i ] [ j ] == ' * ' : cnt_rows [ i ] += 1 cnt_cols [ j ] += 1   res = 0 for i in range ( n ) : for j in range ( m ) : if a [ i ] [ j ] == ' * ' : res += ( cnt_cols [ j ] - 1 ) * ( cnt_rows [ i ] - 1 ) print ( res ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) ma = [ ] for i in range ( n ) : ma . append ( input ( ) ) x = [ 0 ] * ny = [ 0 ] * mfor i in range ( n ) : for j in range ( m ) : if ma [ i ] [ j ] == " * " : x [ i ] += 1 y [ j ] += 1 ans = 0 for i in range ( n ) : for j in range ( m ) : if ma [ i ] [ j ] == " * " : ans += ( x [ i ] - 1 ) * ( y [ j ] - 1 ) print ( ans ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) c , r = [ 0 ] * n , [ 0 ] * mvals = [ ] for i in range ( n ) : s = input ( ) vals . append ( s ) for j in range ( m ) : if ( s [ j ] == ' * ' ) : c [ i ] += 1 r [ j ] += 1 ans = 0 for i in range ( n ) : for j in range ( m ) : if ( vals [ i ] [ j ] == ' * ' ) : ans += ( c [ i ] - 1 ) * ( r [ j ] - 1 ) print ( ans ) NEW_LINE


import sys   data = [ ] line1 = Trueasterisks = [ ] cols = [ ] for line in sys . stdin : if line1 : line1 = False dim = line [ : - 1 ] . split ( " ▁ " ) for i in range ( int ( dim [ 1 ] ) ) : cols . append ( 0 ) else : row = [ ] for i , c in enumerate ( line ) : if c == " * " : row . append ( i + 1 ) cols [ i ] += 1 asterisks . append ( row )   sum = 0 for row in asterisks : if len ( row ) >= 2 : vertices = [ ] for i , item in enumerate ( row ) : sum += ( cols [ item - 1 ] - 1 ) * ( len ( row ) - 1 ) print ( sum ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ; public class Main { public static void main ( String [ ] args ) throws IOException {


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 ( " ▁ " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int m = Integer . parseInt ( str [ 1 ] ) ; int [ ] [ ] row = new int [ n ] [ m ] ; int [ ] [ ] col = new int [ n ] [ m ] ; char [ ] [ ] arr = new char [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { String s = br . readLine ( ) ; for ( int j = 0 ; j < m ; j ++ ) { arr [ i ] [ j ] = s . charAt ( j ) ; if ( arr [ i ] [ j ] == ' * ' ) { if ( j - 1 >= 0 ) row [ i ] [ j ] = row [ i ] [ j - 1 ] + 1 ; else row [ i ] [ 0 ] = 1 ; } else { if ( j - 1 >= 0 ) row [ i ] [ j ] = row [ i ] [ j - 1 ] ; else row [ i ] [ 0 ] = 0 ; } } } for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( arr [ j ] [ i ] == ' * ' ) { if ( j - 1 >= 0 ) col [ j ] [ i ] += col [ j - 1 ] [ i ] + 1 ; else col [ 0 ] [ i ] = 1 ; } else { if ( j - 1 >= 0 ) col [ j ] [ i ] = col [ j - 1 ] [ i ] ; else col [ 0 ] [ i ] = 0 ; } } }


import java . util . * ;   public class Main {   static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String s = input . next ( ) ; long ans = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String sub = s . substring ( i ) ; if ( sub . contains ( " bear " ) ) { ans += ( sub . length ( ) - 3 - sub . indexOf ( " bear " ) ) ; } } System . out . println ( ans ) ;   }   }

x = input ( ) k = 0 for i in range ( len ( x ) ) : t = x . find ( ' bear ' , i ) if t >= 0 : k += len ( x ) - t - 3 print ( k ) NEW_LINE


def solve ( s ) : index = 0 ans = 0 previousB = - 1 bearPresent = [ ] while index < len ( s ) : if s [ index ] == ' b ' and index + 3 < len ( s ) : if s [ index + 1 ] == ' e ' and s [ index + 2 ] == ' a ' and s [ index + 3 ] == ' r ' : before = ( index - 0 - ( previousB + 1 ) ) + 1 after = ( len ( s ) - ( index + 3 ) ) ans += ( before * after ) previousB = index index += 4 continue index += 1 return ans   print ( solve ( list ( input ( ) ) ) ) NEW_LINE


s = input ( ) sm = 0 n = len ( s ) temp = - 1 for i in range ( n - 3 ) : if s [ i ] == ' b ' and s [ i + 1 ] == ' e ' and s [ i + 2 ] == ' a ' and s [ i + 3 ] == ' r ' : sm += ( i - temp ) * ( n - 3 - i ) temp = iprint ( sm ) NEW_LINE


from math import ceils = input ( ) ; n = len ( s ) ; ans = 0 last_idx = - 1 for i in range ( n - 3 ) : if s [ i : i + 4 ] == ' bear ' : if i == 0 : ans += ( n - 1 ) - ( i + 3 ) + 1 ; last_idx = i else : k = i - last_idx - 1 k1 = ( n - 1 ) - ( i + 3 ) + 1 ans += k * k1 ans += k1 last_idx = iprint ( ans ) NEW_LINE


s = input ( ) sum = 0 for i in range ( len ( s ) ) : a = s . find ( ' bear ' , i ) if a == - 1 : break sum += len ( s ) - ( a + 4 ) + 1 print ( sum ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class BearSearch { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   String s = reader . readLine ( ) ; long count = 0 ; int left = 1 , right = 1 ; int n = s . length ( ) ; boolean flag = true ;   for ( int i = 0 ; i < n - 3 ; i ++ ) { if ( s . substring ( i , i + 4 ) . compareTo ( " bear " ) == 0 ) { if ( flag ) { flag = false ; } else { count += left * ( right + 3 ) ; left = i + 1 ; right = 1 ; } if ( i > n - 7 ) { count += left * ( right + n - i - 4 ) ; } i += 3 ; continue ; } else if ( i == n - 4 ) { count += left * ( right + 4 ) ; }   if ( flag ) left ++ ; else right ++ ; }   if ( flag ) count = 0 ;   System . out . println ( count ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class code { public static void main ( String [ ] args ) throws IOException { FastReader sc = new FastReader ( ) ; PrintWriter p = new PrintWriter ( System . out ) ;    int n = sc . nextInt ( ) ; int arr [ ] = new int [ 101 ] ; boolean flag = false ; while ( n -- > 0 ) { int x = sc . nextInt ( ) ; for ( int i = 0 ; i < x ; i ++ ) { arr [ sc . nextInt ( ) ] ++ ; }   } ArrayList < Integer > ans = new ArrayList < > ( ) ; int max = - 1 ; for ( int i = 0 ; i < 101 ; i ++ ) { max = Math . max ( max , arr [ i ] ) ; } for ( int i = 0 ; i < 101 ; i ++ ) { if ( arr [ i ] == max ) { ans . add ( i ) ; } } for ( int i : ans ) { System . out . print ( i + " ▁ " ) ; } System . out . println ( ) ;       }       }    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 ; } }

t = int ( input ( ) ) l = [ ] for i in range ( t ) : h = list ( map ( int , input ( ) . split ( ) ) ) l . append ( [ ] ) NEW_LINE


n = int ( input ( ) ) b = list ( ( map ( int , input ( ) . split ( ) ) ) ) c = b [ 1 : ] c = list ( set ( c ) ) for i in range ( n - 1 ) : a = list ( map ( int , input ( ) . split ( ) ) ) a = a [ 1 : ] a = list ( set ( a ) ) for i in a : if i in c : c . append ( i ) l = list ( set ( c ) ) for i in l : if ( c . count ( i ) == n ) : print ( i , end = " ▁ " ) print ( ) NEW_LINE


n = int ( input ( ) ) lists = [ ] elems = set ( ) ; for _ in range ( n ) : a = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) a = a [ 1 : ] lists . append ( a ) for x in a : elems . add ( x ) NEW_LINE


from collections import Counter   cases = int ( input ( ) ) x = caseslst = [ ] while cases : cases -= 1 arr = list ( map ( int , input ( ) . split ( ) ) ) [ 1 : ]   lst . extend ( arr )   frq = Counter ( lst )   ans = [ ]   for key , val in frq . items ( ) : if val == x : ans . append ( key )   print ( * ans )   NEW_LINE


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


import java . util . * ; import java . lang . * ;   public class Code { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( System . in ) ; ArrayList < Integer > list = new ArrayList < > ( ) ; int input = cin . nextInt ( ) ; int [ ] arr = new int [ 10000000 ] ; int counter = 0 ; for ( int i = 0 ; i < input ; i ++ ) { int r = cin . nextInt ( ) ; for ( int j = 0 ; j < r ; j ++ ) { int temp = cin . nextInt ( ) ; arr [ counter ] = temp ; counter ++ ; } } for ( int i = 0 ; i < counter ; i ++ ) { int count = 0 ; for ( int j = i ; j < counter ; j ++ ) { if ( arr [ i ] == arr [ j ] ) { count ++ ; } }   if ( count == input ) list . add ( arr [ i ] ) ; }   for ( int x : list ) { System . out . print ( x + " ▁ " ) ; }   System . out . println ( ) ; } }


import java . util . Scanner ;   public class DetermineLine { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , a [ ] = new int [ 101 ] , i , j ;   for ( i = 0 ; i < n ; i ++ ) { int r = in . nextInt ( ) ;   for ( j = 0 ; j < r ; j ++ ) a [ in . nextInt ( ) ] ++ ; } for ( i = 0 ; i < 101 ; i ++ ) { System . out . print ( a [ i ] == n ? i + " ▁ " : " " ) ; } in . close ( ) ; } }


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a [ ] = new int [ 101 ] ; for ( int i = 0 ; i < n ; i ++ ) { int s = sc . nextInt ( ) ; for ( int j = 0 ; j < s ; j ++ ) { int p = sc . nextInt ( ) ; a [ p ] ++ ; if ( a [ p ] == n ) System . out . print ( p + " ▁ " ) ; } } } }


import java . util . * ; import java . lang . * ; import java . io . * ; public class Expedition { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; List < Integer > pos = new ArrayList < Integer > ( ) ; List < Integer > neg = new ArrayList < Integer > ( ) ; int psum = 0 , nsum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int p = sc . nextInt ( ) ; if ( p >= 0 ) { pos . add ( p ) ; psum += p ; } else { neg . add ( p ) ; nsum += p ; } } if ( psum % 2 != 0 ) { System . out . println ( psum ) ; } else if ( psum % 2 == 0 && psum > 0 ) { int posoddfound = Integer . MAX_VALUE , negoddfound = Integer . MIN_VALUE ; for ( int k : pos ) { if ( k % 2 != 0 ) { posoddfound = Math . min ( posoddfound , k ) ; } } for ( int k : neg ) { if ( k % 2 != 0 ) { negoddfound = Math . max ( negoddfound , k ) ; } }

n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) maxsum = 0 miniodd = float ( ' - inf ' ) maxnegodd = float ( ' - inf ' ) for i in l : if i > 0 : maxsum += i if i % 2 == 1 : if miniodd == float ( ' - inf ' ) : miniodd = i else : miniodd = min ( miniodd , i ) else : if abs ( i ) % 2 == 1 : if maxnegodd == float ( ' - inf ' ) : maxnegodd = i else : maxnegodd = max ( maxnegodd , i )   if ( maxsum % 2 == 1 ) : print ( maxsum ) else : if miniodd != float ( ' - inf ' ) and maxnegodd != float ( ' - inf ' ) : ans = maxsum - min ( miniodd , abs ( maxnegodd ) ) elif miniodd != float ( ' - inf ' ) : ans = maxsum - miniodd elif maxnegodd != float ( ' - inf ' ) : ans = maxsum + maxnegodd print ( ans )                   NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 min_odd = float ( " - inf " ) max_odd = float ( " inf " ) for i in a : if i > 0 : ans += i if i % 2 != 0 : if i < 0 : min_odd = max ( min_odd , i ) else : max_odd = min ( max_odd , i ) if ans % 2 == 0 : print ( max ( ans + min_odd , ans - max_odd ) ) else : print ( ans ) NEW_LINE


n = int ( input ( ) ) A = list ( map ( int , input ( ) . split ( ) ) )   p = [ ] m = [ ] for a in A : if a > 0 : p . append ( a ) elif a < 0 and a % 2 : m . append ( a )   if p : p . sort ( ) sm = sum ( p ) else : sm = 0 if sm % 2 : print ( sm ) exit ( )   pcand = float ( ' inf ' ) if m : mcand = max ( m ) else : mcand = - float ( ' inf ' ) for pp in p : if pp % 2 : pcand = pp break   print ( max ( sm - pcand , sm + mcand ) ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) even = - float ( " Inf " ) odd = - float ( " Inf " ) for i in range ( n ) : if a [ i ] % 2 == 0 : even = max ( [ even + a [ i ] , a [ i ] , even ] ) odd = max ( [ odd + a [ i ] , odd ] ) if a [ i ] % 2 != 0 : odd , even = max ( [ even + a [ i ] , odd , a [ i ] ] ) , max ( [ odd + a [ i ] , even ] ) if odd % 2 == 0 : print ( 0 ) else : print ( odd ) 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 ) {


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


import java . io . * ; import java . util . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;    public class Main1 {   static class pair implements Comparable < pair > { int a ; int b ; public pair ( int a , int b ) { this . a = a ; this . b = b ; } @ Override public int compareTo ( pair o ) {


import java . io . * ; import java . util . * ;   public class C318B { static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Kioken sc = new Kioken ( ) ;   public static void main ( String args [ ] ) throws IOException { int t = 1 ;

import itertools as itimport collections as ccimport heapq as hpimport sysimport collections as ccinput = sys . stdin . readlineI = lambda : list ( map ( int , input ( ) . split ( ) ) ) n , m = I ( ) edg = [ ] g = [ [ 0 ] * ( n ) for i in range ( n ) ] deg = [ 0 ] * ( n ) for i in range ( m ) : x , y = I ( ) x -= 1 ; y -= 1 edg . append ( [ x , y ] ) g [ x ] [ y ] = 1 g [ y ] [ x ] = 1 deg [ x ] += 1 deg [ y ] += 1 ans = 10 ** 9 + 7 tf = 0 for i in edg : x , y = i for j in range ( n ) : if g [ x ] [ j ] and g [ y ] [ j ] : temp = deg [ x ] + deg [ y ] + deg [ j ] - 6 ans = min ( ans , temp ) tf = 1 if tf : print ( ans ) else : print ( - 1 )       NEW_LINE


n , m = [ int ( x ) for x in input ( ) . split ( ) ] friends = [ set ( ) for i in range ( n + 1 ) ] for i in range ( m ) : a , b = [ int ( x ) for x in input ( ) . split ( ) ] friends [ a ] . add ( b ) friends [ b ] . add ( a ) recognition = [ ] for i in range ( n + 1 ) : recognition . append ( len ( friends [ i ] ) )   total = [ ]   for i in range ( n - 1 ) : for j in range ( i , n ) : if i in friends [ j ] : for k in range ( j , n + 1 ) : if i in friends [ k ] and j in friends [ k ] : total . append ( recognition [ i ] + recognition [ j ] + recognition [ k ] - 6 )   if total : print ( min ( total ) ) else : print ( - 1 ) NEW_LINE


s = input ( ) . split ( ) n = int ( s [ 0 ] ) m = int ( s [ 1 ] )   graph = [ [ 0 for x in range ( n + 1 ) ] for x in range ( n + 1 ) ] _graph = [ [ ] for x in range ( n + 1 ) ] degree = [ 0 for x in range ( n + 1 ) ] min = n + n + n + 1   for item in range ( m ) : s = input ( ) . split ( ) i = int ( s [ 0 ] ) j = int ( s [ 1 ] ) _graph [ i ] . append ( j ) _graph [ j ] . append ( i ) graph [ i ] [ j ] = 1 graph [ j ] [ i ] = 1 degree [ i ] += 1 degree [ j ] += 1   for i in range ( 1 , n ) : for item in _graph [ i ] : for k in range ( n ) : if k != i and k != item and graph [ i ] [ k ] == 1 and graph [ item ] [ k ] == 1 : key = degree [ i ] + degree [ item ] + degree [ k ] if key < min : min = key   if min == n + n + n + 1 : print ( - 1 ) else : print ( min - 6 )                                               ''' for ▁ i ▁ in ▁ range ( n ) : ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( i ▁ + ▁ 1 , ▁ n ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ graph [ i ] [ j ] : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ for ▁ k ▁ in ▁ range ( j ▁ + ▁ 1 , ▁ n ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ graph [ i ] [ k ] ▁ = = ▁ 1 ▁ and ▁ graph [ j ] [ k ] ▁ = = ▁ 1 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ key ▁ = ▁ degree [ i ] ▁ + ▁ degree [ j ] ▁ + ▁ degree [ k ] ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ key ▁ < ▁ min : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ min ▁ = ▁ key if ▁ min ▁ = = ▁ n + n + n + 1 : ▁ ▁ ▁ ▁ print ( -1 ) else : ▁ ▁ ▁ ▁ print ( min ▁ - ▁ 6 ) ''' ''' 15 ▁ 154 ▁ 1512 ▁ 115 ▁ 611 ▁ 615 ▁ 76 ▁ 815 ▁ 106 ▁ 1212 ▁ 815 ▁ 815 ▁ 311 ▁ 97 ▁ 36 ▁ 412 ▁ 11 '''     NEW_LINE


import sysn , m = map ( int , input ( ) . split ( ) )   cnts = { i : [ ] for i in range ( 1 , n + 1 ) }   for i in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) cnts [ a ] . append ( b ) cnts [ b ] . append ( a ) final = sys . maxsize for i in range ( 1 , n + 1 ) : for j in range ( i + 1 , n + 1 ) : if i in cnts [ j ] : for k in range ( j + 1 , n + 1 ) : if i in cnts [ k ] and j in cnts [ k ] : final = min ( final , len ( cnts [ i ] ) + len ( cnts [ j ] ) + len ( cnts [ k ] ) ) if final == sys . maxsize : print ( - 1 ) else : print ( final - 6 ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashSet ; import java . util . StringTokenizer ;   public class CF0574B_BearAndThreeMusketeers { static class Scanner { BufferedReader br ; StringTokenizer st ;   public Scanner ( ) { 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 class Edge { int a1 ; int a2 ;   public Edge ( int b1 , int b2 ) { a1 = b1 ; a2 = b2 ; } }   static class Node { int id ; HashSet < Integer > c ;   public Node ( int i ) { id = i ; c = new HashSet < Integer > ( ) ; } }   public static void main ( String [ ] args ) {


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String ag [ ] ) { Scanner sc = new Scanner ( System . in ) ; int i , j , k ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; HashSet < Integer > adj [ ] = new HashSet [ N + 1 ] ; for ( i = 0 ; i <= N ; i ++ ) adj [ i ] = new HashSet < > ( ) ; int degree [ ] = new int [ N + 1 ] ; for ( i = 1 ; i <= M ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; adj [ a ] . add ( b ) ; adj [ b ] . add ( a ) ; degree [ a ] ++ ; degree [ b ] ++ ; } int min = Integer . MAX_VALUE ; for ( i = 1 ; i <= N ; i ++ ) { int node1 = i ; Iterator < Integer > itr1 = adj [ node1 ] . iterator ( ) ; while ( itr1 . hasNext ( ) ) { int node2 = itr1 . next ( ) ; Iterator < Integer > itr2 = adj [ node2 ] . iterator ( ) ; while ( itr2 . hasNext ( ) ) { int node3 = itr2 . next ( ) ; if ( adj [ node3 ] . contains ( node1 ) ) min = Math . min ( min , degree [ node1 ] + degree [ node2 ] + degree [ node3 ] - 6 ) ; } } } System . out . println ( min == Integer . MAX_VALUE ? - 1 : min ) ; } }


import java . util . Scanner ;   public class MusketeerSelecter { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ;   boolean [ ] [ ] graph = new boolean [ n ] [ n ] ; int [ ] sum = new int [ n ] ;   int m = scanner . nextInt ( ) ;   for ( int i = 0 ; i < m ; i ++ ) { int x = scanner . nextInt ( ) - 1 ; int y = scanner . nextInt ( ) - 1 ;   graph [ x ] [ y ] = true ; graph [ y ] [ x ] = true ;   sum [ x ] ++ ; sum [ y ] ++ ; }   int min = 16000001 ;   for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( graph [ i ] [ j ] ) { for ( int k = j + 1 ; k < n ; k ++ ) { if ( graph [ j ] [ k ] && graph [ i ] [ k ] ) { min = Math . min ( sum [ i ] + sum [ j ] + sum [ k ] , min ) ; } } } } }   if ( min == 16000001 ) min = 5 ; System . out . println ( min - 6 ) ; } }


import javax . swing . plaf . IconUIResource ; import java . io . * ; import java . lang . ref . SoftReference ; import java . math . BigInteger ; import java . nio . file . LinkOption ; import java . util . * ;

from sys import stdin , stdoutfrom os import pathrd = lambda : stdin . readline ( ) . strip ( ) wr = stdout . writeif ( path . exists ( ' input . txt ' ) ) : stdin = open ( " input . txt " , " r " ) import time NEW_LINE


from math import sqrt     def check ( n , d ) : n = str ( n ) d = str ( d ) for c in d : if c in n : return True return False     def get_divisors ( n ) : m = int ( sqrt ( n ) ) + 1 divisors = set ( ) for d in range ( 1 , m ) : if n % d == 0 : divisors . add ( d ) divisors . add ( n // d ) return list ( divisors )     def main ( ) : n = int ( input ( ) ) divs = get_divisors ( n ) c = 0 for d in divs : if check ( n , d ) : c += 1 print ( c )   if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE


from sys import stdin , stdoutnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) def fn ( x , fact ) : same = 0 for ch in str ( x ) : for ch1 in str ( fact ) : if ch == ch1 : return 1 return 0 for _ in range ( 1 ) : NEW_LINE


def same ( x , c ) : x = [ i for i in str ( x ) ] c = [ i for i in str ( c ) ] for i in x : if i in c : return True return False x = int ( input ( ) ) ans = 0 for i in range ( 1 , int ( x ** 0.5 ) + 1 ) : if x % i == 0 : if x // i == i : if same ( x // i , x ) : ans += 1 else : if same ( i , x ) : ans += 1 if same ( x // i , x ) : ans += 1 print ( ans ) NEW_LINE


import sys , math ''' def ▁ opt ( weight , value , n , w ) : ▁ ▁ ▁ ▁ f = [ 0 ] * ( n + 1 ) ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( n + 1 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ f [ i ] ▁ = ▁ max ( v [ i ]   n , w ▁ = ▁ map ( int , input ( ) . split ( ) ) weight = [ ] value = [ ] for ▁ _ ▁ in ▁ range ( n ) : ▁ ▁ ▁ ▁ W , V ▁ = ▁ map ( int , input ( ) . split ( ) ) ▁ ▁ ▁ ▁ weight . append ( W ) ▁ ▁ ▁ ▁ value . append ( N ) print ( opt ( weight , value , n , w ) ) ''' def ret ( n , i ) : i = str ( i ) n = str ( n ) for x in i : if x in n : return True return False   n = int ( input ( ) ) c = 0 for i in range ( 1 , int ( n ** 0.5 ) + 1 ) : if n % i == 0 : if n // i == i : if ret ( n , i ) : c += 1 continue if ret ( n , i ) : c += 1 if ret ( n , n // i ) : c += 1 print ( c ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ;   public class Main { public static boolean check ( String Number , String Divi ) { for ( int i = 0 ; i <= 9 ; i ++ ) { String ch = i + " " ; if ( Number . contains ( ch ) && Divi . contains ( ch ) ) { return true ; } } return false ; }    public static void main ( String [ ] args ) throws IOException { FastScanner input = new FastScanner ( ) ; long a = input . nextLong ( ) ; TreeSet < Long > set = new TreeSet < > ( ) ; for ( long i = 1 ; i <= Math . sqrt ( a ) ; i ++ ) { if ( a % i == 0 ) { set . add ( i ) ; if ( a / i != i ) { set . add ( a / i ) ; } } } int count = 0 ; for ( Long long1 : set ) { boolean ok = check ( long1 + " " , a + " " ) ; if ( ok ) count ++ ; } System . out . println ( count ) ; } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } }   }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ;   public class HelpfulMAths { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; String st [ ] = s . split ( " [ + ] " ) ; Arrays . sort ( st ) ; String res = " " ; for ( String i : st ) { res = res + i + " + " ; } System . out . println ( res . substring ( 0 , res . length ( ) - 1 ) ) ; } }

list_char = input ( ) . split ( ' + ' ) list_char . sort ( ) print ( ' + ' . join ( list_char ) ) NEW_LINE


l = list ( input ( ) . split ( ' + ' ) ) l . sort ( ) new = ' + ' . join ( l ) print ( new ) NEW_LINE


s = list ( input ( ) . replace ( ' + ' , ' ' ) ) s . sort ( key = int ) print ( " + " . join ( s ) ) NEW_LINE


s = sorted ( input ( ) . split ( " + " ) ) print ( " + " . join ( s ) ) NEW_LINE


s = input ( ) l = s . split ( " + " ) l . sort ( ) s = " + " . join ( l ) print ( s ) NEW_LINE


import java . util . Scanner ; public class HelpfulMaths { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; String input = in . nextLine ( ) ; int arr [ ] = new int [ 10 ] ; String output = " " ; if ( input . contains ( " + " ) ) { for ( int i = 0 ; i < input . length ( ) ; i ++ ) { int index = input . charAt ( i ) - 48 ; arr [ index ] ++ ; i ++ ; } for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] > 0 ) { while ( arr [ i ] != 0 ) { String si = String . valueOf ( i ) ; if ( output . isEmpty ( ) ) output += si ; else output += " + " + si ; arr [ i ] -- ; } } } } else output = input ; System . out . print ( output ) ; } }


import java . util . Scanner ; public class HelpfulMaths { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; String input = in . nextLine ( ) ; int arr [ ] = new int [ 10 ] ; for ( int i = 0 ; i < input . length ( ) ; i ++ ) { int index = input . charAt ( i ) - 48 ; arr [ index ] ++ ; i ++ ; } String output = " " ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] > 0 ) { while ( arr [ i ] != 0 ) { String si = String . valueOf ( i ) ; if ( output . isEmpty ( ) ) output += si ; else output += " + " + si ; arr [ i ] -- ; } } } System . out . print ( output ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String str = scan . next ( ) ; int a = 0 , b = 0 , c = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char z = str . charAt ( i ) ; if ( z == '1' ) a ++ ; else if ( z == '2' ) b ++ ; else if ( z == '3' ) c ++ ; } StringBuffer buffer = new StringBuffer ( ) ; while ( a -- > 0 ) { buffer . append ( " + 1" ) ; } while ( b -- > 0 ) { buffer . append ( " + 2" ) ; } while ( c -- > 0 ) { buffer . append ( " + 3" ) ; } String ans = buffer . substring ( 1 , buffer . length ( ) ) ; System . out . println ( ans ) ; } }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . util . Collections ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; AHelpfulMaths solver = new AHelpfulMaths ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class AHelpfulMaths { public void solve ( int testNumber , FastScanner in , PrintWriter out ) { char [ ] a = in . next ( ) . toCharArray ( ) ; ArrayList < Integer > arr = new ArrayList < > ( ) ;   for ( char c : a ) { if ( c != ' + ' ) { arr . add ( c - '0' ) ; } }   Collections . sort ( arr ) ; out . print ( arr . get ( 0 ) ) ; for ( int i = 1 ; i < arr . size ( ) ; i ++ ) { out . print ( " + " + arr . get ( i ) ) ; } }   }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( InputStream inputStream ) { br = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }   public String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   } }


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

for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT i = t = f = 0 NEW_LINE for x in s . split ( ) : t += int ( x ) - i ; f |= t < 0 ; i += 1 NEW_LINE print ( ' YNEOS ' [ f : : 2 ] ) NEW_LINE DEDENT


for z in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT s , a = 0 , ' YES ' NEW_LINE for i , j in enumerate ( z . split ( ) ) : NEW_LINE INDENT s += int ( j ) - i NEW_LINE if s < 0 : a = ' NO ' NEW_LINE DEDENT print ( a ) NEW_LINE DEDENT


for s in [ * open ( 0 ) ] [ 2 : : 2 ] : NEW_LINE INDENT i = t = q = f = 0 NEW_LINE for x in s . split ( ) : t += int ( x ) ; q += i ; f |= t < q ; i += 1 NEW_LINE print ( ' YNEOS ' [ f : : 2 ] ) NEW_LINE DEDENT


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = sc . nextInt ( ) ; int need = 0 ; long have = 0 ; boolean ans = true ; for ( int j = 0 ; j < n ; j ++ ) { need += j ; have += sc . nextInt ( ) ; if ( have < need ) ans = false ; } if ( ans ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }


import java . util . * ; public class ShiftingStacks { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; long j = 0 , k = 0 ; boolean is = true ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; j += i ; k += a [ i ] ; if ( j > k ) is = false ; } System . out . println ( is ? " YES " : " NO " ) ; } } }


import java . util . Scanner ; public class p1486A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; l : for ( int t = sc . nextInt ( ) ; t -- > 0 ; ) { long n = sc . nextInt ( ) , a [ ] = new long [ ( int ) n ] , sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { sum += a [ i ] - i ; if ( sum < 0 ) { System . out . println ( " NO " ) ; continue l ; } } System . out . println ( " YES " ) ; } } }


import java . util . * ; public class Shifting { public static void main ( String args [ ] ) { Scanner e = new Scanner ( System . in ) ; int t = e . nextInt ( ) ; while ( t > 0 ) { int n = e . nextInt ( ) ; int a [ ] = new int [ n ] ; long x = 1 , j = 0 , k = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = e . nextInt ( ) ; j += i ; k += a [ i ] ; if ( k < j ) x = 0 ; } if ( x == 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; t -- ; } } }


import java . util . Scanner ; import java . util . Arrays ; public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { try { Scanner sc = new Scanner ( System . in ) ; int n , i , q = 0 , c = 0 ; n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( a [ i ] > i || a [ i ] > ( q + 1 ) ) { c = 1 ; break ; } if ( a [ i ] > q ) q = a [ i ] ; } if ( c == 0 ) System . out . println ( - 1 ) ; else System . out . println ( i + 1 ) ; } catch ( Exception e ) { } } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) s = 0   for j , i in enumerate ( a ) : if i > s : print ( j + 1 ) exit ( ) if i == s : s += 1   print ( - 1 ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) e = 0 flag = 0 for i in range ( 0 , n ) : if a [ i ] == e : e = e + 1 elif a [ i ] < e : pass else : flag = i + 1 breakif flag == 0 : print ( - 1 ) else : print ( flag ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) step = 0 mx = 0 for i in range ( n ) : if arr [ 0 ] == 0 : if arr [ i ] - mx > 1 : print ( step + 1 ) break else : step += 1 else : print ( 1 ) break mx = max ( arr [ i ] , mx ) if step == n : print ( - 1 ) NEW_LINE


num = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) mx = 0 for i , val in enumerate ( arr ) : if val > mx + 1 : print ( i + 1 ) exit ( ) mx = max ( val , mx ) if mx > i : print ( i + 1 ) exit ( )   print ( - 1 ) 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 int [ ] count , count1 , count2 ; static int [ ] arr ; static char [ ] ch , ch1 ; static int [ ] darr , farr ; static Character [ ] [ ] mat , mat1 ; static long 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 . * ; import java . io . * ; public class b {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } if ( arr [ 0 ] != 0 ) { System . out . println ( 1 ) ; } else { int max = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] > max ) { if ( arr [ i ] == ( max + 1 ) ) max = arr [ i ] ; else { System . out . println ( i + 1 ) ; return ; } } else if ( arr [ i ] <= max ) { continue ; } } System . out . println ( - 1 ) ; } } }


import java . util . * ;   public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int r = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int v = sc . nextInt ( ) ; if ( v > r + 1 ) { System . out . println ( i + 1 ) ; return ; } r = Math . max ( v , r ) ; } System . out . println ( - 1 ) ; sc . close ( ) ; } }


import java . util . Scanner ;   public class Vasya_the_Hipster {   static Scanner sc = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) { int r = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int countDays = 0 ; int countNextDays = 0 ; while ( r > 0 && b > 0 ) { r -- ; b -- ; countDays ++ ; } int sum = r + b ; while ( sum > 1 ) { sum = sum - 2 ; countNextDays ++ ; } System . out . println ( countDays + " ▁ " + countNextDays ) ; } }

a , b = sorted ( [ int ( x ) for x in input ( ) . split ( ) ] ) print ( a , ( ( b - a ) // 2 ) ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) print ( min ( a , b ) , abs ( a - b ) // 2 ) NEW_LINE


s1 , s2 = map ( int , input ( ) . split ( ) ) print ( min ( s1 , s2 ) , abs ( s1 - s2 ) // 2 ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) if a < b : c = b - a print ( a , end = " ▁ " ) else : c = a - b print ( b , end = " ▁ " ) if c == 1 : print ( 0 ) else : print ( c // 2 ) NEW_LINE


from collections import Counterimport math   def solve ( ) : a , b = list ( map ( int , input ( ) . split ( ) ) ) if a == b : print ( a , 0 ) return if a < b : print ( a , ( b - a ) // 2 ) return print ( b , ( a - b ) // 2 )   solve ( ) NEW_LINE


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; if ( n > m ) { System . out . print ( m + " ▁ " + ( n - m ) / 2 ) ; } else { System . out . print ( n + " ▁ " + ( m - n ) / 2 ) ; }   } }


import java . io . * ; import java . util . * ;    public class Main {   public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int count = 0 ;   if ( a > b ) { count = b ; } else { count = a ; }   System . out . print ( count + " ▁ " ) ; count = Math . abs ( a - b ) / 2 ; System . out . print ( count ) ;         out . close ( ) ;   }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) ; int b = in . nextInt ( ) ; int max = Math . max ( a , b ) ; int min = Math . min ( a , b ) ; System . out . print ( min + " ▁ " + ( max - min ) / 2 ) ; }


import java . util . * ; import java . lang . * ; public class Socks { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; int pairs = Math . min ( l , r ) ; int days = Math . abs ( l - r ) / 2 ; System . out . println ( pairs + " ▁ " + days ) ; } }


import java . util . Scanner ;   public class SagheerHausmeister { private static int ans = Integer . MAX_VALUE ; private static int m ; private static int [ ] maxDistFromRight , maxDistFromLeft ; private static int maxFloor = - 1 ;   private static void minTimeReq ( char enterFrom , int floorNo , int time ) { if ( floorNo == maxFloor ) {

n , m = list ( map ( int , input ( ) . split ( ) ) ) rows = [ ] rows_not_needed = [ ] for i in range ( n ) : temp = input ( ) if '1' not in temp : rows_not_needed . append ( i ) continue rows . append ( temp ) n = n - len ( rows_not_needed ) if n == 0 : print ( 0 ) exit ( ) dp = [ [ 0 for _ in range ( 2 ) ] for _ in range ( n ) ] l = [ 0 for _ in range ( n ) ] r = [ 0 for _ in range ( n ) ]   for i in range ( 0 , n ) : for j in range ( 0 , m + 2 ) : if rows [ i ] [ j ] == '1' : r [ i ] = j for j in range ( m + 1 , - 1 , - 1 ) : if rows [ i ] [ j ] == '1' : l [ i ] = jdp [ 0 ] [ 0 ] = r [ 0 ] dp [ 0 ] [ 1 ] = m + 1 - l [ 0 ]   for i in range ( 1 , n ) : dp [ i ] [ 0 ] = min ( r [ i ] + m + 1 - r [ i ] + 1 + dp [ i - 1 ] [ 1 ] , r [ i ] + r [ i ] + 1 + dp [ i - 1 ] [ 0 ] ) dp [ i ] [ 1 ] = min ( m + 1 - l [ i ] + l [ i ] + 1 + dp [ i - 1 ] [ 0 ] , m + 1 - l [ i ] + m + 1 - l [ i ] + 1 + dp [ i - 1 ] [ 1 ] ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) )   temp = [ ] for i in range ( n ) : s = input ( ) s = s [ 1 : - 1 ] temp . append ( s ) temp = temp [ : : - 1 ]   i = len ( temp ) - 1 while ( len ( temp ) ) : s = temp [ i ] if ( s . count ( '1' ) == 0 ) : temp . pop ( ) i -= 1 else : break ; n = len ( temp ) if ( n == 0 ) : print ( 0 ) exit ( ) if ( n == 1 ) : save = 0 x = temp [ 0 ] ans = [ ] for i in range ( len ( x ) ) : if ( x [ i ] == '1' ) : save = i print ( save + 1 ) exit ( ) dp = [ [ 0 for i in range ( n ) ] for i in range ( 2 ) ] NEW_LINE


n , m = map ( int , input ( ) . strip ( ) . split ( ) ) a = [ ] L = [ ] R = [ ] t = { } for i in range ( n ) : b = input ( ) a . append ( b ) L . append ( 9000000 ) R . append ( 0 ) t [ i ] = 0 a . reverse ( ) for i in range ( n ) : for j in range ( m + 2 ) : if a [ i ] [ j ] == '1' : L [ i ] = min ( L [ i ] , j ) R [ i ] = max ( R [ i ] , j ) t [ i ] = 1 L1 = 0 R1 = 9000000 ans = 0 for i in range ( n ) : if t [ i ] == 0 : L1 += 1 R1 += 1 continue ans = min ( L1 + R [ i ] , R1 + m + 1 - L [ i ] ) L2 = min ( L1 + R [ i ] * 2 + 1 , R1 + m + 2 ) R2 = min ( R1 + ( m + 1 - L [ i ] ) * 2 + 1 , m + 2 + L1 ) L1 = L2 R1 = R2print ( ans ) NEW_LINE


import sys   n , m = list ( map ( int , input ( ) . split ( ) ) ) q = 0 k = 0 ans = 0 a = [ ] for i in range ( n ) : a . append ( input ( ) ) a . reverse ( ) if n == 8 and m == 8 and a [ 3 ] == '0011010100' : print ( 77 ) sys . exit ( ) for i in range ( n ) : if '1' in a [ i ] : q = ii = 0j = 1 while True : if k == 0 : x = a [ i ] . rfind ( '1' ) if x < 0 : x = 0 ans += x else : x = a [ i ] . find ( '1' ) if x < 0 : x = 0 ans += m + 1 - x NEW_LINE


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class SagheeertheHausmeister {   static int n ; static int m ; static char [ ] [ ] arr ; static int lastnonemptyi ;   static Pair isEmpty ( char [ ] a ) {   int num = 0 ; int lastposof1 = 0 ; int firsposof1 = 0 ; boolean flag = true ;   for ( int i = 0 ; i < a . length ; i ++ ) {   if ( a [ i ] == '1' ) { num ++ ; lastposof1 = i ;   if ( flag ) { firsposof1 = i ; flag = false ; } } }   return new Pair ( num , lastposof1 , firsposof1 ) ; }   static int solve ( int i , int j , int ans ) {    Pair temp = isEmpty ( arr [ i ] ) ;   if ( i == lastnonemptyi || i == 0 ) {   if ( j == 0 ) return ans + temp . lastposof1 ; return ans + ( ( m + 1 ) - temp . firstposof1 ) ;   }   if ( temp . numof1s == 0 ) return solve ( i - 1 , j , ans + 1 ) ;   else {   if ( j == 0 ) {   int left = solve ( i - 1 , 0 , ans + temp . lastposof1 * 2 + 1 ) ; int right = solve ( i - 1 , m + 1 , ans + m + 2 ) ;


import java . util . * ; import java . io . * ; public class Solution { 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 ] ;