import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String a [ ] = new String [ 8 ] ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; if ( k == 0 || k == n ) System . out . println ( 0 + " ▁ " + 0 ) ; else { System . out . print ( 1 + " ▁ " ) ; int sale = n - k ; System . out . println ( Math . min ( sale , k * 2 ) ) ; } } }


n , k = map ( int , input ( ) . split ( ) ) if n == k or k == 0 : print ( 0 , 0 ) else : print ( 1 , min ( n - k , 2 * k ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) if k == n or k == 0 : print ( 0 , 0 ) elif k <= ( n ) // 3 : print ( 1 , k * 2 ) else : print ( 1 , n - k ) NEW_LINE


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


n , k = input ( ) . split ( ) n = int ( n ) k = int ( k ) if ( k >= n or k == 0 ) : min1 = 0 max1 = 0 else : min1 = 1 if ( k * 3 <= n ) : max1 = k * 2 else : x = k * 3 - n max1 = k * 2 - xprint ( min1 , end = " ▁ " ) print ( max1 ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; if ( k == 0 || k == n ) System . out . print ( "0 ▁ " ) ; else System . out . print ( "1 ▁ " ) ; if ( n - ( 3 * k ) >= 0 ) System . out . print ( 2 * k ) ; else System . out . print ( n - k ) ; } }

import mathinp = input ( ) n , k = inp . split ( ) n = int ( n ) k = int ( k ) minn = 1 if ( n - k == 0 ) or ( k == 0 ) : minn = 0 maxx = 0   maxx = k * 2 if ( n - maxx - k < 0 ) : maxx = n - k     print ( minn , end = " ▁ " ) print ( maxx ) NEW_LINE


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String args [ ] ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = Integer . parseInt ( reader . readLine ( ) ) ; String s = reader . readLine ( ) ; int arr [ ] = new int [ n ] , arr_1 [ ] = new int [ n ] , arr_2 [ ] = new int [ n ] ; arr_1 [ 0 ] = 1 ; arr_2 [ n - 1 ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( s . charAt ( i - 1 ) == ' R ' ) arr_1 [ i ] = arr_1 [ i - 1 ] + 1 ; else if ( s . charAt ( i - 1 ) == ' = ' ) arr_1 [ i ] = arr_1 [ i - 1 ] ; else arr_1 [ i ] = 1 ; } for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( s . charAt ( i ) == ' L ' ) arr_2 [ i ] = arr_2 [ i + 1 ] + 1 ; else if ( s . charAt ( i ) == ' = ' ) arr_2 [ i ] = arr_2 [ i + 1 ] ; else arr_2 [ i ] = 1 ; } for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = Math . max ( arr_1 [ i ] , arr_2 [ i ] ) ; pw . print ( + arr [ i ] + " ▁ " ) ; } pw . flush ( ) ; pw . close ( ) ;

n = int ( input ( ) ) NEW_LINE s = input ( )   ans = [ 0 for i in range ( n ) ]   for i in range ( n ) : min_val = 1 NEW_LINE if i > 0 : if NEW_LINE s [ i - 1 ] == ' = ' : ans [ i ] = ans [ i - 1 ] NEW_LINE continue NEW_LINE if s [ i - 1 ] == ' R ' : min_val = ans [ i - 1 ] + 1 NEW_LINE cnt_low = 0 NEW_LINE for j in range ( i , n - 1 ) : if NEW_LINE s [ j ] == ' = ' : NEW_LINE continue NEW_LINE if s [ j ] == ' L ' : cnt_low += 1 NEW_LINE if s [ j ] == ' R ' : break NEW_LINE min_val = max ( min_val , cnt_low + 1 ) NEW_LINE ans [ i ] = min_val   print ( * ans ) NEW_LINE


import mathfrom NEW_LINE collections NEW_LINE import Counter , defaultdictfrom NEW_LINE itertools NEW_LINE import accumulate   R = lambda : map ( int , input ( ) . split ( ) ) NEW_LINE n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE dp = [ [ 0 ] * 1005 for i in range ( n + 1 ) ] NEW_LINE for i in range ( 1 , 1001 ) : dp [ 0 ] [ i ] = idp [ 0 ] [ 1001 ] = math . inffor NEW_LINE i in range ( n ) : dp [ i ] [ 0 ] = math . inffor NEW_LINE i in range ( 1 , n ) : NEW_LINE if s [ i - 1 ] == ' L ' : rmin = math . inf NEW_LINE for j in range ( 1000 , 0 , - 1 ) : dp [ i ] [ j ] = rmin + j NEW_LINE rmin = min ( rmin , dp [ i - 1 ] [ j ] ) elif s [ i - 1 ] == ' R ' : rmin = math . inf NEW_LINE for j in range ( 1 , 1001 ) : dp [ i ] [ j ] = rmin + j NEW_LINE rmin = min ( rmin , dp [ i - 1 ] [ j ] ) else : for j in range ( 1 , 1001 ) : dp [ i ] [ j ] = dp [ i - 1 ] [ j ] + jrem = NEW_LINE min ( ( dp [ n - 1 ] [ j ] , j ) for j in range ( 1 , 1001 ) ) [ 0 ] NEW_LINE res = [ - 1 ] * nfor NEW_LINE i in range ( n - 1 , - 1 , - 1 ) : NEW_LINE for j in range ( 1 , 1001 ) : if NEW_LINE rem == dp [ i ] [ j ] : res [ i ] = j NEW_LINE rem -= j NEW_LINE continueprint ( ' ▁ ' . join ( map ( str , res ) ) ) NEW_LINE


import sysfrom NEW_LINE math NEW_LINE import log2 , floor , ceil , sqrt , gcdimport NEW_LINE bisect NEW_LINE


from collections import deque   n = int ( input ( ) ) NEW_LINE s = input ( ) NEW_LINE ans = [ 1 ] * n   for i in range ( 1 , n ) : if NEW_LINE s [ i - 1 ] == ' R ' : ans [ i ] = ans [ i - 1 ] + 1 elif s [ i - 1 ] == ' = ' : ans [ i ] = ans [ i - 1 ]   for i in range ( n - 2 , - 1 , - 1 ) : if NEW_LINE s [ i ] == ' L ' : ans [ i ] = max ( ans [ i + 1 ] + 1 , ans [ i ] ) elif s [ i ] == ' = ' : ans [ i ] = max ( ans [ i ] , ans [ i + 1 ] )     print ( * ans ) NEW_LINE


n = int ( input ( ) ) NEW_LINE r = [ 1 ] * ns = input ( ) NEW_LINE y = 1 NEW_LINE while y : y = 0 NEW_LINE for i in range ( n - 1 ) : if NEW_LINE s [ i ] == ' = ' and r [ i ] != r [ i + 1 ] : r [ i ] = r [ i + 1 ] = max ( r [ i : i + 2 ] ) ; NEW_LINE y = 1 NEW_LINE if s [ i ] == ' L ' and r [ i ] <= r [ i + 1 ] : r [ i ] = r [ i + 1 ] + 1 ; y = 1 NEW_LINE if s [ i ] == ' R ' and r [ i ] >= r [ i + 1 ] : r [ i + 1 ] = r [ i ] + 1 ; y = 1 NEW_LINE print ( * r ) 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 ;   int oo = 5000 ;   void run ( FastScanner in , PrintWriter out ) {


import java . util . Scanner ;   public class Nauuo_and_Votes { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a , b , c ; a = sc . nextInt ( ) ; b = sc . nextInt ( ) ; c = sc . nextInt ( ) ; if ( a + c < b ) { System . out . println ( " - " ) ; } else if ( a > b + c ) { System . out . println ( " + " ) ; } else if ( a == b && c == 0 ) { System . out . println ( "0" ) ; } else if ( c != 0 ) { System . out . println ( " ? " ) ; } } }

def main ( ) : up , down , dont = map ( int , input ( ) . split ( ) ) if up == down : print ( 0 if dont == 0 else " ? " ) elif up > down and down + dont < up : print ( " + " ) elif up < down and dont + up < down : print ( " - " ) else : print ( " ? " )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


a = [ int ( i ) for i in input ( ) . split ( ) ] x = a [ 0 ] y = a [ 1 ] z = a [ 2 ] if y == x and z == 0 : print ( '0' ) elif x > y + z : print ( ' + ' ) elif y > x + z : print ( ' - ' ) else : print ( ' ? ' ) NEW_LINE


a , b , c = map ( int , input ( ) . split ( ) ) if a > b + c : print ( ' + ' ) elif a + c < b : print ( ' - ' ) elif a <= b and c != 0 : t = a a = b b = t if a <= ( b + c ) or c >= ( a - b ) or a == b : print ( ' ? ' )   elif a > b and c != 0 : if c >= ( a - b ) : print ( ' ? ' )   elif a == b and c == 0 : print ( 0 )   NEW_LINE


x , y , z = map ( int , input ( ) . split ( ) ) if x > y : if z >= abs ( x - y ) : print ( " ? " ) else : print ( " + " ) elif y > x : if z >= abs ( x - y ) : print ( " ? " ) else : print ( " - " ) else : if z == 0 : print ( "0" ) else : print ( " ? " ) NEW_LINE


def main_function ( ) : x , y , z = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] if x - y > z : return " + " elif y - x > z : return " - " elif z == 0 : return 0 else : return " ? "     print ( main_function ( ) )   NEW_LINE


import java . util . * ; import static java . lang . Math . abs ;   public class Test { public static void main ( String [ ] args ) {   Scanner input = new Scanner ( System . in ) ; int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; int z = input . nextInt ( ) ;   if ( x - y > z ) { System . out . println ( " + " ) ; } else if ( y - x > z ) { System . out . println ( " - " ) ; } else if ( x - y == 0 && z == 0 ) { System . out . println ( 0 ) ; } else { System . out . println ( " ? " ) ; } } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   while ( sc . hasNext ( ) ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int z = sc . nextInt ( ) ; if ( x > y ) { if ( x <= y + z ) { System . out . println ( " ? " ) ; } else { System . out . println ( " + " ) ; } } else if ( x < y ) { if ( y <= x + z ) { System . out . println ( " ? " ) ; } else { System . out . println ( " - " ) ; } } else { if ( z == 0 ) { System . out . println ( "0" ) ; } else { System . out . println ( " ? " ) ; } } } } }


import java . util . Scanner ;   public class Nk { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; int z = input . nextInt ( ) ; int a = x - y ;   if ( a + z < 0 ) { System . out . println ( " - " ) ; }   if ( a == 0 && z == 0 ) { System . out . println ( "0" ) ; }   if ( a == 0 && z > 0 ) { System . out . println ( " ? " ) ; }   if ( a != 0 && a > 0 ) {   if ( a > z ) { System . out . println ( " + " ) ; }   if ( a < z || a == z ) { System . out . println ( " ? " ) ; }   if ( a < 0 && a + z == 0 ) { System . out . println ( " ? " ) ; }   if ( a < 0 && a + z > 0 ) { System . out . println ( " ? " ) ; } }   if ( a < 0 ) {   if ( a + z == 0 ) { System . out . println ( " ? " ) ; }   if ( ( a + z ) > 0 ) { System . out . println ( " ? " ) ; } }   if ( a == 0 && z < 0 ) { System . out . println ( " ? " ) ; } } }


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; char a [ ] = input . next ( ) . toCharArray ( ) ;   int m = input . nextInt ( ) ; int store [ ] = new int [ a . length ] ;   for ( int i = 0 ; i < m ; i ++ ) { int start = input . nextInt ( ) - 1 ; store [ start ] ++ ; } for ( int i = 1 ; i < a . length / 2 ; i ++ ) { store [ i ] += store [ i - 1 ] ; }

s = [ i for i in input ( ) ] m = int ( input ( ) ) ; n = len ( s ) arr = list ( map ( int , input ( ) . split ( ) ) ) ; dp = [ 0 ] * nfor i in arr : dp [ i - 1 ] += 1 ; dp [ n - i ] += 1 for i in range ( 1 , n ) : dp [ i ] += dp [ i - 1 ] for i in range ( ( n + 1 ) // 2 ) : if dp [ i ] & 1 == 1 : s [ i ] , s [ n - i - 1 ] = s [ n - i - 1 ] , s [ i ] print ( " " . join ( s ) ) NEW_LINE


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


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


from sys import * inp = lambda : stdin . readline ( )   def main ( ) : s = inp ( ) [ : - 1 ] n = int ( inp ( ) ) a = [ 0 for i in range ( len ( s ) + 5 ) ] l = map ( int , inp ( ) . split ( ) ) for b in l :   a [ b - 1 ] = ( a [ b - 1 ] + 1 ) % 2 temp = [ c for c in s ] yet = 0 for i in range ( len ( s ) // 2 ) : yet = ( yet + a [ i ] ) % 2 if yet == 1 : temp [ i ] , temp [ len ( s ) - i - 1 ] = temp [ len ( s ) - i - 1 ] , temp [ i ] print ( " " . join ( temp ) )     if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class CF525_D2_B { public static void main ( String [ ] args ) { FastReader scanner = new FastReader ( ) ; String s = scanner . next ( ) ; int n = scanner . nextInt ( ) ; int [ ] changes = new int [ s . length ( ) + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { int l = scanner . nextInt ( ) - 1 ; int r = s . length ( ) - l ; changes [ l ] ++ ; changes [ r ] -- ;   } char [ ] arr = s . toCharArray ( ) ; int sum = 0 ; for ( int i = 0 ; i < changes . length / 2 ; i ++ ) { sum += changes [ i ] ; if ( sum % 2 == 1 ) { int j = s . length ( ) - i - 1 ; char temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; } } System . out . println ( String . valueOf ( arr ) ) ; }   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 ; } } }


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


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 Coach { static boolean [ ] v = new boolean [ 100 ] ; static ArrayList < ArrayList < Integer > > adj = new ArrayList < ArrayList < Integer > > ( 100 ) ; public static ArrayList < Integer > dfs ( ArrayList < ArrayList < Integer > > adj , int j , ArrayList < Integer > list ) { list . add ( j ) ;

n , m = map ( int , input ( ) . split ( ) ) d = { i : [ ] for i in range ( 1 , n // 3 + 1 ) } idx = [ - 1 for i in range ( n + 1 ) ] arr = [ ] key = 1 for i in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) if idx [ a ] == idx [ b ] and idx [ a ] != - 1 : continue elif idx [ a ] == - 1 and idx [ b ] == - 1 : idx [ a ] = key idx [ b ] = key if key > n // 3 : print ( - 1 ) exit ( ) d [ key ] . append ( a ) d [ key ] . append ( b ) key += 1 elif idx [ a ] != - 1 and idx [ b ] == - 1 : idx [ b ] = idx [ a ] if len ( d [ idx [ a ] ] ) < 3 : d [ idx [ a ] ] . append ( b ) else : print ( - 1 ) exit ( ) elif idx [ a ] == - 1 and idx [ b ] != - 1 : idx [ a ] = idx [ b ] if len ( d [ idx [ b ] ] ) < 3 : d [ idx [ b ] ] . append ( a ) else : print ( - 1 ) exit ( ) else : print ( - 1 ) exit ( ) remain = [ ] for i in range ( 1 , n + 1 ) : if idx [ i ] == - 1 : remain . append ( i ) ptr = 0 for i in d : if len ( d [ i ] ) < 3 : for j in range ( 3 - len ( d [ i ] ) ) : d [ i ] . append ( remain [ ptr ] ) ptr += 1 print ( * d [ i ] ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) a = list ( range ( n ) ) visited = [ - 1 ] * ngraph = [ [ ] for _ in ' ▁ ' * n ] for _ in range ( m ) : i , j = map ( int , input ( ) . split ( ) ) visited [ i - 1 ] = 0 visited [ j - 1 ] = 0 graph [ i - 1 ] . append ( j - 1 ) graph [ j - 1 ] . append ( i - 1 ) def dfs ( v , c , s ) : visited [ v ] = 1 c [ 0 ] += 1 a . remove ( v ) s . append ( ( v + 1 ) ) if c [ 0 ] > 3 : print ( - 1 ) exit ( 0 ) for i in graph [ v ] : if visited [ i ] == 0 : dfs ( i , c , s ) ans = [ ] for i in range ( n ) : if visited [ i ] == 1 or visited [ i ] == - 1 : continue c = [ 0 ] s = [ ] if visited [ i ] == 0 : dfs ( i , c , s ) ans . append ( s ) ans_ = [ ] for _ in range ( n // 3 ) : if ans : x = ans . pop ( 0 ) while len ( x ) < 3 : if a : x . append ( a . pop ( 0 ) + 1 ) else : print ( - 1 ) exit ( 0 ) ans_ . append ( x ) else : if len ( a ) >= 3 : h = [ ] for i in range ( 3 ) : h . append ( a . pop ( 0 ) + 1 ) ans_ . append ( h ) else : print ( - 1 ) exit ( 0 ) for i in ans_ : print ( * i ) NEW_LINE


import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ;   public class absolute { static List < Integer > [ ] adj ; static List < List < Integer > > groups ; public static void dfs ( int u , boolean [ ] visited , List < Integer > temp ) { visited [ u ] = true ; temp . add ( u ) ; Iterator itr = adj [ u ] . listIterator ( ) ; while ( itr . hasNext ( ) ) { int v = ( int ) itr . next ( ) ; if ( ! visited [ v ] ) dfs ( v , visited , temp ) ; } } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; adj = new LinkedList [ n + 1 ] ; groups = new ArrayList < List < Integer > > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) adj [ i ] = new LinkedList ( ) ; for ( int i = 0 ; i < m ; i ++ ) { int u = sc . nextInt ( ) ; int v = sc . nextInt ( ) ; adj [ u ] . add ( v ) ; adj [ v ] . add ( u ) ; } boolean [ ] visited = new boolean [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { if ( ! visited [ i ] ) { List < Integer > temp = new ArrayList < Integer > ( ) ; if ( adj [ i ] . size ( ) > 0 ) dfs ( i , visited , temp ) ;


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

if __name__ == ' _ _ main _ _ ' : aa = [ ] res = 0 n = int ( input ( ) ) for _ in range ( n ) : aa . append ( list ( map ( { ' X ' : 1 , ' . ' : 0 } . get , input ( ) ) ) )   def check ( i , j ) : sm = aa [ i ] [ j ] for di in [ - 1 , 1 ] : for dj in [ - 1 , 1 ] : sm += aa [ i + di ] [ j + dj ] return sm == 5   for i in range ( 1 , n - 1 ) : for j in range ( 1 , n - 1 ) : res += check ( i , j ) print ( res ) NEW_LINE


n = int ( input ( ) ) l = [ ] for z in range ( n ) : p = input ( ) p = list ( p ) l . append ( p ) c = 0 for i in range ( 1 , n - 1 ) : for j in range ( 1 , n - 1 ) : if l [ i ] [ j ] == ' X ' and l [ i - 1 ] [ j - 1 ] == ' X ' and l [ i - 1 ] [ j + 1 ] == ' X ' and l [ i + 1 ] [ j - 1 ] == ' X ' and l [ i + 1 ] [ j + 1 ] == ' X ' : c += 1 if n < 3 : print ( 0 ) else : print ( c ) NEW_LINE


cases = int ( input ( ) ) M = [ ] while cases : cases -= 1 s = input ( ) M . append ( s ) ct = 0 for i , row in enumerate ( M [ 1 : - 1 ] , start = 1 ) : for j , col in enumerate ( row [ 1 : - 1 ] , start = 1 ) : if M [ i ] [ j ] == M [ i - 1 ] [ j - 1 ] == M [ i - 1 ] [ j + 1 ] == M [ i + 1 ] [ j - 1 ] == M [ i + 1 ] [ j + 1 ] == ' X ' : ct += 1   print ( ct )           NEW_LINE


p = list ( map ( int , input ( ) . split ( ) ) ) k = p [ 0 ] a = [ ] for i in range ( k ) : s = input ( ) a . append ( s ) ans = int ( 0 ) for i in range ( 1 , k - 1 ) : for j in range ( 1 , k - 1 ) : if a [ i - 1 ] [ j - 1 ] == ' X ' and a [ i - 1 ] [ j + 1 ] == ' X ' and a [ i + 1 ] [ j - 1 ] == ' X ' and a [ i + 1 ] [ j + 1 ] == ' X ' and a [ i ] [ j ] == ' X ' : ans = ans + 1 print ( ans ) NEW_LINE


import sys   def main ( ) : n , * s = sys . stdin . read ( ) . strip ( ) . split ( ' \n ' ) c , t = 0 , [ ( - 1 , 1 ) , ( - 1 , - 1 ) , ( 1 , 1 ) , ( 1 , - 1 ) , ( 0 , 0 ) ] for i in range ( 1 , int ( n ) - 1 ) : for j in range ( 1 , int ( n ) - 1 ) : c += all ( s [ i + m ] [ j + n ] == ' X ' for m , n in t ) return c print ( main ( ) ) NEW_LINE


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


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . io . BufferedWriter ; import java . io . Writer ; import java . io . OutputStreamWriter ; import java . util . InputMismatchException ; import java . io . IOException ; import java . io . InputStream ;     public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastReader in = new FastReader ( inputStream ) ; OutputWriter out = new OutputWriter ( outputStream ) ; ALunarNewYearAndCrossCounting solver = new ALunarNewYearAndCrossCounting ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } static class ALunarNewYearAndCrossCounting { public void solve ( int testNumber , FastReader r , OutputWriter out ) { int n = r . nextInt ( ) ; char mat [ ] [ ] = new char [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { mat [ i ] = r . next ( ) . toCharArray ( ) ; }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { int n , x = 0 ; Scanner reader = new Scanner ( System . in ) ; n = reader . nextInt ( ) ; String [ ] s = new String [ n ] ; int i , j , t = 0 ; for ( i = 0 ; i < n ; ++ i ) s [ i ] = reader . next ( ) ; for ( i = 1 ; i < n - 1 ; ++ i ) { for ( j = 1 ; j < n - 1 ; ++ j ) { if ( s [ i ] . charAt ( j ) == ' X ' && s [ i ] . charAt ( j ) == s [ i - 1 ] . charAt ( j - 1 ) && s [ i ] . charAt ( j ) == s [ i - 1 ] . charAt ( j + 1 ) && s [ i ] . charAt ( j ) == s [ i + 1 ] . charAt ( j + 1 ) && s [ i + 1 ] . charAt ( j - 1 ) == s [ i ] . charAt ( j ) ) ++ t ; } } System . out . println ( t ) ; } }


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . util . ArrayList ; import java . util . HashSet ; import java . util . Random ; import java . util . StringTokenizer ;   public class HilbertsHotel { static final int MAXN = 1000_006 ; static final long MOD = ( long ) 1e9 + 7 ; public static void main ( String [ ] args ) throws IOException { MyScanner s = new MyScanner ( ) ; Print p = new Print ( ) ;

import sysinput = sys . stdin . readlinet = int ( input ( ) ) for you in range ( t ) : n = int ( input ( ) ) l = input ( ) . split ( ) li = [ int ( i ) for i in l ] hashi = dict ( ) for i in range ( n ) : z = i + li [ i ] if z % n in hashi : hashi [ z % n ] += 1 else : hashi [ z % n ] = 1 poss = 1 for i in hashi : if ( hashi [ i ] > 1 ) : poss = 0 break if ( poss ) : print ( " Yes " ) else : print ( " No " ) NEW_LINE


""" ▁ import ▁ syssys . stdin ▁ = ▁ open ( ' input . txt ' , ▁ ' r ' ) sys . stdout ▁ = ▁ open ( ' output . txt ' , ▁ ' w ' ) ▁ """ def sol ( ) : x = int ( input ( ) ) s = list ( map ( int , input ( ) . split ( ) ) ) st = set ( ) for n in range ( x ) : u = ( s [ n ] + n ) % x st . add ( u )   print ( ' YES ' if len ( list ( st ) ) == x else ' NO ' )     for n in range ( int ( input ( ) ) ) : sol ( ) NEW_LINE


import sysinput = sys . stdin . readline   def read ( ) : return list ( map ( int , input ( ) . split ( ) ) )   for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = read ( ) for i in range ( n ) : a [ i ] = ( a [ i ] + i ) % n if len ( set ( a ) ) == n : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) arr = [ ( int ( i ) + n ) % n for i in input ( ) . split ( ) ] occ = [ 0 for i in range ( n ) ] no = 0 for i in range ( n ) : if occ [ ( i + arr [ i ] ) % n ] != 1 : occ [ ( i + arr [ i ] ) % n ] = 1 else : print ( " NO " ) no = 1 break if not no : print ( " YES " ) NEW_LINE


import os , 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 java . io . * ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws IOException {


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; Set < Integer > ns = new HashSet < > ( n , 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { ns . add ( ( ( i + sc . nextInt ( ) ) % n + n ) % n ) ; } System . out . println ( ns . size ( ) == n && ns . contains ( 0 ) && ns . contains ( n - 1 ) ? " YES " : " NO " ) ; } } }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; import java . io . BufferedReader ; import java . io . InputStreamReader ;   public class First {   public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ;


I = lambda : int ( input ( ) ) n , a , b , c = I ( ) , I ( ) , I ( ) , I ( ) d , l = b - c , max ( n - c , 0 ) print ( max ( l // d + ( l % d + c * ( n >= b ) ) // a , n // a + max ( 0 , n % a - c ) // d ) ) NEW_LINE


def solve ( n , a , b , c ) :   if b - c >= a : return n // a if n < b : return n // a g = ( ( n - b ) // ( b - c ) ) + 1 p = ( n - g * ( b - c ) ) // a return g + p     if __name__ == ' _ _ main _ _ ' : N = int ( input ( ) ) A = int ( input ( ) ) B = int ( input ( ) ) C = int ( input ( ) )   result = solve ( N , A , B , C ) print ( result ) NEW_LINE


import sys , os , iofrom sys import stdinfrom math import log , gcd , ceilfrom collections import defaultdict , deque , Counterfrom heapq import heappush , heappopfrom bisect import bisect_left , bisect_rightimport math       alphabets = list ( ' abcdefghijklmnopqrstuvwxyz ' )     def isPrime ( x ) : for i in range ( 2 , x ) : if i * i > x : break if ( x % i == 0 ) : return False return Truedef ncr ( n , r , p ) : num = den = 1 for i in range ( r ) : num = ( num * ( n - i ) ) % p den = ( den * ( i + 1 ) ) % p return ( num * pow ( den , p - 2 , p ) ) % pdef primeFactors ( n ) : l = [ ] while n % 2 == 0 : l . append ( 2 ) n = n / 2 for i in range ( 3 , int ( math . sqrt ( n ) ) + 1 , 2 ) : while n % i == 0 : l . append ( int ( i ) ) n = n / i if n > 2 : l . append ( n ) return list ( set ( l ) ) def power ( x , y , p ) : res = 1 x = x % p if ( x == 0 ) : return 0 while ( y > 0 ) : if ( ( y & 1 ) == 1 ) : res = ( res * x ) % p y = y >> 1 NEW_LINE


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


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


import java . io . * ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws Exception { long n = nl ( ) , a = nl ( ) , b = nl ( ) , c = nl ( ) ; if ( n < a && n < b ) { pln ( 0 ) ; } else if ( n >= a && n < b ) { pln ( n / a ) ; } else if ( a <= ( b - c ) ) { pln ( n / a ) ; } else { long rem = ( n - b ) % ( b - c ) + c ; pln ( ( n - b ) / ( b - c ) + 1 + rem / a ) ;   } flush ( ) ; }   static Reader in = new Reader ( ) ; static StringBuilder output = new StringBuilder ( ) ; static final int imod = 1000_000_007 ; static final long mod = 1000_000_007 ; static final int imax = 1000_000_000 ; static final int imin = - 1000_000_000 ; static final long lmax = 1000_000_000_000_000_000L ; static final long lmin = - 1000_000_000_000_000_000L ;


import java . io . * ; import java . math . BigInteger ; import java . util . * ;   public class Main { static int MOD = 1000000007 ;


import java . util . Scanner ;   public class BottleBuyer { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   long n = scanner . nextLong ( ) ; long a = scanner . nextLong ( ) ; long b = scanner . nextLong ( ) ; long c = scanner . nextLong ( ) ; long bc = b - c ; long ans = 0 ;   if ( a <= bc || b > n ) ans = n / a ; else { ans = ( n - b ) / bc + 1 + ( ( n - b ) % bc + c ) / a ; }   System . out . println ( ans ) ; } }


import java . io . * ; import java . util . * ;     public class Main { static int [ ] a = new int [ 200020 ] ; static int [ ] b = new int [ 200020 ] ; static Integer [ ] ia = new Integer [ 200020 ] ; static Integer [ ] ib = new Integer [ 200020 ] ; static int [ ] answer = new int [ 200020 ] ; public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; try { in = new Scanner ( new FileInputStream ( " in . in " ) ) ; out = new PrintStream ( " out . out " ) ; } catch ( FileNotFoundException e ) { } int n = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; ia [ i ] = i ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = in . nextInt ( ) ; ib [ i ] = i ; } Arrays . sort ( ia , 0 , n , new MyCom ( ) ) ; Arrays . sort ( ib , 0 , n , new YourCom ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { answer [ ib [ i ] ] = a [ ia [ i ] ] ; } for ( int i = 0 ; i < n ; i ++ ) { out . print ( answer [ i ] ) ; if ( i + 1 < n ) out . print ( ' ▁ ' ) ; else out . println ( ) ; } } static class MyCom implements Comparator < Integer > { public int compare ( Integer i1 , Integer i2 ) { return a [ i2 ] - a [ i1 ] ; } } static class YourCom implements Comparator < Integer > { public int compare ( Integer i1 , Integer i2 ) { return b [ i1 ] - b [ i2 ] ; } } }

m = int ( input ( ) ) a = sorted ( map ( int , input ( ) . split ( ) ) , reverse = True ) b = sorted ( ( bi , i ) for i , bi in enumerate ( map ( int , input ( ) . split ( ) ) ) ) v = [ None ] * mfor i in range ( m ) : v [ b [ i ] [ 1 ] ] = str ( a [ i ] ) print ( ' ▁ ' . join ( v ) ) NEW_LINE


m = int ( input ( ) ) a = [ int ( i ) for i in input ( ) . split ( ) ] b = [ int ( i ) for i in input ( ) . split ( ) ]   a_streak = a . copy ( ) b_streak = b . copy ( )   a_streak . sort ( reverse = True ) b_streak . sort ( )   mapping = { }   for ind , b_i in enumerate ( b_streak ) : if b_i not in mapping : mapping [ b_i ] = [ a_streak [ ind ] ] else : mapping [ b_i ] . append ( a_streak [ ind ] )   NEW_LINE


import java . io . * ; import java . util . * ;     public class Main { static int [ ] a = new int [ 200020 ] ; static int [ ] b = new int [ 200020 ] ; static Integer [ ] ia = new Integer [ 200020 ] ; static Integer [ ] ib = new Integer [ 200020 ] ; static int [ ] answer = new int [ 200020 ] ; public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; try { in = new Scanner ( new FileInputStream ( " in . in " ) ) ; out = new PrintStream ( " out . out " ) ; } catch ( FileNotFoundException e ) { } int n = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; ia [ i ] = i ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = in . nextInt ( ) ; ib [ i ] = i ; } Arrays . sort ( ia , 0 , n , new MyCom ( ) ) ; Arrays . sort ( ib , 0 , n , new YourCom ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { answer [ ib [ i ] ] = a [ ia [ i ] ] ; } for ( int i = 0 ; i < n ; i ++ ) { out . print ( answer [ i ] ) ; if ( i + 1 < n ) out . print ( ' ▁ ' ) ; else out . println ( ) ; } } static class MyCom implements Comparator < Integer > { @ Override public int compare ( Integer i1 , Integer i2 ) { return a [ i2 ] - a [ i1 ] ; } } static class YourCom implements Comparator < Integer > { @ Override public int compare ( Integer i1 , Integer i2 ) { return b [ i1 ] - b [ i2 ] ; } } }


import java . io . * ; import java . util . * ;     public class Main { static int [ ] a = new int [ 200020 ] ; static int [ ] b = new int [ 200020 ] ; static Integer [ ] ia = new Integer [ 200020 ] ; static Integer [ ] ib = new Integer [ 200020 ] ; static int [ ] answer = new int [ 200020 ] ; public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; try { in = new Scanner ( new FileInputStream ( " in . in " ) ) ; out = new PrintStream ( " out . out " ) ; } catch ( FileNotFoundException e ) { in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; } int n = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = in . nextInt ( ) ; ia [ i ] = i ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = in . nextInt ( ) ; ib [ i ] = i ; } Arrays . sort ( ia , 0 , n , new MyCom ( ) ) ; Arrays . sort ( ib , 0 , n , new YourCom ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { answer [ ib [ i ] ] = a [ ia [ i ] ] ; } for ( int i = 0 ; i < n ; i ++ ) { out . print ( answer [ i ] ) ; if ( i + 1 < n ) out . print ( ' ▁ ' ) ; else out . println ( ) ; } } static class MyCom implements Comparator < Integer > { @ Override public int compare ( Integer i1 , Integer i2 ) { return a [ i2 ] - a [ i1 ] ; } } static class YourCom implements Comparator < Integer > { @ Override public int compare ( Integer i1 , Integer i2 ) { return b [ i1 ] - b [ i2 ] ; } } }


import java . io . * ; import java . util . * ;     public class Main { static int [ ] a = new int [ 200020 ] ; static int [ ] b = new int [ 200020 ] ; static Integer [ ] ia = new Integer [ 200020 ] ; static Integer [ ] ib = new Integer [ 200020 ] ; static int [ ] answer = new int [ 200020 ] ; public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ;


# include < bits / stdc ++ . h > using namespace std ; # define lli long long int # define pb push_back # define mem0 ( a ) memset ( a , 0 , sizeof ( a ) ) # define mem_1 ( a ) memset ( a , - 1 , sizeof ( a ) ) # define mem1 ( a ) memset ( a , 1 , sizeof ( a ) ) # define memf ( a ) memset ( a , false , sizeof ( a ) ) # define all ( v ) v . begin ( ) , v . end ( ) # define ff first # define ss second # define PI 3.1415926536 # define INF 10000000000000 # define mod1 1000000007 # define endl " \n " # define PI 3.1415926536


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; char [ ] arr = reader . readLine ( ) . toCharArray ( ) ; int n = arr . length ; boolean [ ] [ ] forward = new boolean [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int cur = 0 ; boolean mark = true ; for ( int j = i ; j < n ; j ++ ) { if ( arr [ j ] == ' ) ' ) cur -- ; else cur ++ ; if ( cur < 0 ) mark = false ; forward [ i ] [ j ] = mark ; } } boolean [ ] [ ] backward = new boolean [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int cur = 0 ; boolean mark = true ; for ( int j = i ; j > - 1 ; j -- ) { if ( arr [ j ] == ' ( ' ) cur -- ; else cur ++ ; if ( cur < 0 ) mark = false ; backward [ j ] [ i ] = mark ; } } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i ; j < n ; j ++ ) { if ( forward [ i ] [ j ] && backward [ i ] [ j ] && ( j - i + 1 ) % 2 == 0 ) { ans ++ ; } } } System . out . println ( ans ) ; } }

s = input ( ) ans = 0 for i in range ( 0 , len ( s ) - 1 ) : addQ = 0 subQ = 0 cur = 0 for j in range ( i , len ( s ) ) : if s [ j ] == ' ( ' : cur += 1 elif s [ j ] == ' ) ' : cur -= 1 if cur < 0 and subQ > 0 : cur += 2 subQ -= 1 addQ += 1 else : if cur > 0 : subQ += 1 cur -= 1 else : addQ += 1 cur += 1 if cur < 0 : break if cur == 0 : ans += 1 print ( ans ) NEW_LINE


s = input ( ) res , n = 0 , len ( s ) for i in range ( n - 1 ) : j , c , q = i , 0 , 0 while j < n and c + q >= 0 : if ( s [ j ] == ' ( ' ) : c += 1 elif ( s [ j ] == ' ) ' ) : c -= 1 else : q += 1   if ( c < q ) : c , q = q , c res += ( c == q ) j += 1 print ( res ) 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 ) {   char [ ] ca = in . next ( ) . toCharArray ( ) ; int n = ca . length ;   int cnt = 0 ; for ( int l = 0 ; l < n ; l ++ ) {   int score = 0 ; int qmarks = 0 ; for ( int r = l ; r < n ; r ++ ) { char c = ca [ r ] ; if ( c == ' ) ' ) score -- ; if ( c == ' ( ' ) score ++ ; if ( c == ' ? ' ) qmarks ++ ;   if ( qmarks > 0 && qmarks > score ) {


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ;   public class Div1_459A {   public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter printer = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; String str = reader . readLine ( ) ; int ans = 0 ;   for ( int i = 0 ; i < str . length ( ) ; i ++ ) { int nO = 0 ; int nC = 0 ; loop2 : for ( int j = i ; j < str . length ( ) ; j ++ ) { if ( str . charAt ( j ) == ' ( ' ) { nO ++ ; } else if ( str . charAt ( j ) == ' ? ' ) { if ( nO > 0 ) { nO -- ; nC ++ ; } else { nO ++ ; } } else { if ( nO > 0 ) { nO -- ; } else if ( nC > 0 ) { nC -- ; nO ++ ; } else { break loop2 ; } } if ( nO == 0 ) { ans ++ ; } } } printer . println ( ans ) ; printer . close ( ) ; } }


import java . util . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ;   int n = s . nextInt ( ) ; boolean [ ] b = new boolean [ n + 1 ] ; int res = 0 ; for ( int i = 2 ; i <= n ; i ++ ) b [ i ] = isPrime ( i ) ;   for ( int i = 3 ; i <= n ; i ++ ) { int c = 0 ; for ( int j = 2 ; j <= i ; j ++ ) { if ( b [ j ] && i % j == 0 ) c ++ ; } if ( c == 2 ) res ++ ; }   System . out . println ( res ) ; s . close ( ) ; }   public static boolean isPrime ( int n ) { for ( int i = 2 ; i < n ; i ++ ) { if ( n % i == 0 ) return false ; }   return true ; } }

a = int ( input ( ) ) prime = [ True ] * 3001 prime [ 0 ] = prime [ 1 ] = 0 for i in range ( 2 , 3001 ) : if prime [ i ] : for j in range ( i * i , 3001 , i ) : prime [ j ] = Falseallprime = [ ] for i in range ( 2 , 3001 ) : if prime [ i ] : allprime . append ( i ) def check_devisor ( n ) : ans = 0 for p in allprime : if n % p == 0 : ans += 1 if p > n : break return ans == 2 print ( sum ( [ check_devisor ( i ) for i in range ( 2 , a + 1 ) ] ) ) NEW_LINE


def almostprime ( val ) : a = 0 l = 0 b = [ ] d = [ ] for i in range ( 2 , val ) : a = 0 for j in range ( 2 , i ) : if ( i % j != 0 ) : pass else : a += 1 if a == 0 : b . append ( i ) for i in range ( 2 , val ) : c = 0 for j in range ( 0 , len ( b ) ) : if ( i % b [ j ] == 0 ) : c += 1 if c == 2 : d . append ( i ) print ( len ( d ) )                           almostprime ( int ( input ( ) ) + 1 ) NEW_LINE


n = int ( input ( ) ) ans = 0 for i in range ( 2 , n + 1 ) : j = 2 k = i cnt = 0 while ( j * j <= k ) : if ( k % j == 0 ) : cnt += 1 while ( k % j == 0 ) : k = k // j j += 1 if ( k != 1 ) : cnt += 1 if ( cnt == 2 ) : ans += 1 print ( ans ) NEW_LINE


seive = [ ] def precalc ( n ) : i = 2 while ( i * i <= n ) : if ( seive [ i ] ) : j = i * i while ( j <= n ) : seive [ j ] = False j += i i += 1 def main ( ) : global seive n = int ( input ( ) ) seive = [ True ] * ( n + 1 ) precalc ( n ) res , cnt = [ ] , 0 for i in range ( 2 , n + 1 ) : if ( seive [ i ] ) : res . append ( i ) for i in range ( 2 , n + 1 ) : temp = 0 for j in range ( 2 , n + 1 ) : if ( seive [ j ] and i % j == 0 ) : temp += 1 if ( temp == 2 ) : cnt += 1 print ( cnt ) main ( ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class AlmostPrime {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; System . out . println ( func ( n ) ) ; }   public static int func ( int n ) { int prime [ ] = new int [ n + 1 ] ; int pf [ ] = new int [ n + 1 ] ; Arrays . fill ( prime , 1 ) ; Arrays . fill ( pf , 0 ) ; int ct = 0 ;   for ( int i = 2 ; i <= n ; i ++ ) { if ( prime [ i ] == 1 ) { for ( int j = i + i ; j <= n ; j = j + i ) { prime [ j ] = 0 ; pf [ j ] += 1 ; } }   if ( pf [ i ] == 2 ) ct ++ ; } return ct ;   } }


import java . util . * ; public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int ans = 0 ; for ( int k = 6 ; k <= N ; k ++ ) { int n = k , cnt = 0 ; for ( int i = 2 ; i * i < n && cnt < 3 ; i ++ ) { if ( n % i == 0 ) cnt ++ ; while ( n % i == 0 && cnt < 3 ) { n = n / i ; } } if ( n != 1 ) cnt ++ ; if ( cnt == 2 ) { ans ++ ;


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int final_count = 0 ; for ( int i = 4 ; i <= n ; i ++ ) { int num = i ; int count = 0 ; int [ ] arr_count = new int [ i + 1 ] ; for ( int j = 2 ; j <= Math . sqrt ( i ) ; j ++ ) { if ( num % j == 0 ) { while ( num % j == 0 ) { arr_count [ j ] ++ ; num = num / j ; } } } if ( num != 1 ) arr_count [ num ] ++ ; for ( int k = 2 ; k < arr_count . length ; k ++ ) if ( arr_count [ k ] > 0 ) count ++ ; if ( count == 2 ) final_count = final_count + 1 ; } System . out . println ( final_count ) ; } }


import java . util . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ;   int n = s . nextInt ( ) ; int [ ] primes = new int [ n + 1 ] ; int res = 0 ;


import java . io . * ; import java . util . * ;   public class Main {    public static void main ( String [ ] args ) throws IOException , InterruptedException { int n = sc . nextInt ( ) ; Pair [ ] time = new Pair [ n ] ; for ( int i = 0 ; i < n ; i ++ ) time [ i ] = new Pair ( sc . nextInt ( ) , sc . nextInt ( ) ) ; pairSort ( time ) ;

def second ( x ) : return x [ 1 ] n = int ( input ( ) ) arr = [ ] for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) arr . append ( [ a , b ] ) arr . sort ( key = second )   ans = 1 till = arr [ 0 ] [ 1 ] for i in range ( n ) : if ( arr [ i ] [ 0 ] > till ) : ans += 1 till = arr [ i ] [ 1 ] print ( ans ) NEW_LINE


n = int ( input ( ) )   main = [ ] for i in range ( n ) : s , e = map ( int , input ( ) . split ( ) ) main . append ( ( s , e ) )   main . sort ( key = lambda x : x [ 1 ] )   cs , ce = main [ 0 ] [ 0 ] , main [ 0 ] [ 1 ] count = 1 for s , e in main [ 1 : ] : if ce < s : count += 1 cs = s ce = e   print ( count ) NEW_LINE


import sys     n = int ( sys . stdin . readline ( ) ) orders = [ tuple ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) for _ in range ( n ) ]   orders . sort ( key = lambda x : x [ 1 ] ) prev_r = Nonecount = 0 for l , r in orders : if not prev_r or prev_r < l : count += 1 prev_r = r   print ( count ) NEW_LINE


n = int ( input ( ) ) a = [ ] for i in range ( n ) : l , r = map ( int , input ( ) . split ( ) ) a . append ( ( r , l ) ) a . sort ( ) L = - 1 ans = 0 for x in a : if x [ 1 ] > L : L = x [ 0 ] ans += 1 print ( ans ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main {   public static final int mod = 1000000007 ; static long [ ] [ ] dp ; public static void main ( String [ ] args ) throws IOException {


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


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

def maxOfSegmentMins ( array , len , k ) : if k == 1 : return min ( array ) if k == 2 : return max ( array [ 0 ] , array [ n - 1 ] ) return max ( array )     if __name__ == ' _ _ main _ _ ' : n , k = map ( int , input ( ) . split ( ) ) array = [ int ( x ) for x in input ( ) . split ( ) ]   print ( maxOfSegmentMins ( array , len ( array ) , k ) ) NEW_LINE


def maxMaxMin ( nums , k ) : if k == 1 : return min ( nums ) else : maximum = max ( nums ) if k != 2 : return maximum if nums [ 0 ] == maximum or nums [ - 1 ] == maximum : return maximum return max ( nums [ 0 ] , nums [ - 1 ] )       n , k = map ( int , input ( ) . split ( ) ) nums = list ( map ( int , input ( ) . split ( ) ) ) print ( maxMaxMin ( nums , k ) ) NEW_LINE


n , k = map ( int , input ( ) . split ( " ▁ " ) ) arr = list ( map ( int , input ( ) . split ( " ▁ " ) ) )   if k > 2 : print ( max ( arr ) ) elif k == 2 : print ( max ( arr [ 0 ] , arr [ - 1 ] ) ) else : print ( min ( arr ) ) NEW_LINE


[ N , K ] = map ( int , input ( ) . split ( " ▁ " ) ) nums = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) if K == 1 : print ( min ( nums ) ) elif K == 2 : print ( max ( nums [ 0 ] , nums [ - 1 ] ) ) else : print ( max ( nums ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main { public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; int a [ ] = new int [ n ] ; int min = Integer . MAX_VALUE ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; min = Math . min ( a [ i ] , min ) ; max = Math . max ( max , a [ i ] ) ; } if ( k == 1 ) { System . out . println ( min ) ; } else if ( k == 2 ) { System . out . println ( Math . max ( a [ 0 ] , a [ n - 1 ] ) ) ; } else { System . out . println ( max ) ; } }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }


import java . util . Scanner ;   public class MaximumMinimum {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int min = Integer . MAX_VALUE ; int max = Integer . MIN_VALUE ; int ans = - 1 ; if ( k == 1 ) { for ( int x = 0 ; x < n ; x ++ ) { int num = sc . nextInt ( ) ; if ( num < min ) { min = num ; } } ans = min ; } else if ( k >= 3 ) { for ( int x = 0 ; x < n ; x ++ ) { int num = sc . nextInt ( ) ; if ( num > max ) { max = num ; } } ans = max ; } else { int a = 0 ; int b = 0 ; for ( int x = 0 ; x < n ; x ++ ) { int num = sc . nextInt ( ) ; if ( x == 0 ) { a = num ; } else if ( x == n - 1 ) { b = num ; } } ans = Math . max ( a , b ) ; } System . out . println ( ans ) ; }   }


# include < bits / stdc ++ . h > using namespace std ; typedef long long int ll ; typedef long double ld ; # define PI 3.14159265358979323846264338327950288419716939937510 ll mind ( ll x , ll y ) { if ( x > y ) { return y ; } else { return x ; } } ll maxd ( ll x , ll y ) { if ( x > y ) { return x ; } else { return y ; } }   int main ( ) { ios_base :: sync_with_stdio ( false ) ; cin . tie ( NULL ) ; ll n , k ; cin >> n >> k ; vector < ll > v ; for ( ll i = 0 ; i < n ; i ++ ) { ll t ; cin >> t ; v . push_back ( t ) ; } if ( k == 1 ) { sort ( v . begin ( ) , v . end ( ) ) ; cout << v [ 0 ] ; } else if ( k >= 3 ) { sort ( v . rbegin ( ) , v . rend ( ) ) ; cout << v [ 0 ] ; } else { ll d = max ( v [ 0 ] , v [ n - 1 ] ) ; cout << d ; } return 0 ; }


import java . util . * ; import java . io . * ; public class CF663A { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; StringTokenizer st ; st = new StringTokenizer ( br . readLine ( ) ) ; int plus = 0 ; int neg = 0 ; PriorityQueue < Integer > stack = new PriorityQueue < Integer > ( ) ; PriorityQueue < Integer > stack1 = new PriorityQueue < Integer > ( ) ; int a [ ] = new int [ 105 ] ;

s = input ( ) a = s . split ( )   tot = 0 b = [ 1 if x == ' ? ' else x for x in a ] for i , x in enumerate ( b ) : if x == 1 : if i == 0 or b [ i - 1 ] == ' + ' : tot += 1 elif b [ i - 1 ] == ' - ' : tot -= 1   goal = int ( b [ - 1 ] ) if tot < goal : for i , x in enumerate ( b ) : if x == 1 and i == 0 or b [ i - 1 ] == ' + ' and tot < goal : a = min ( goal - 1 , goal - tot ) tot += a b [ i ] += a   elif tot > goal : for i , x in enumerate ( b ) : if x == 1 and b [ i - 1 ] == ' - ' and tot > goal : a = min ( goal - 1 , tot - goal ) tot -= a b [ i ] += a if tot != goal : print ( " Impossible " ) else : print ( " Possible " ) print ( ' ▁ ' . join ( [ str ( x ) for x in b ] ) )     NEW_LINE


sgn , a , b = 1 , 0 , 0 sol = " " ok = 0 for ch in input ( ) . split ( ) : if ch == ' ? ' : if sgn == 1 : a += 1 ch = ' P ' else : b += 1 ch = ' M ' elif ch == ' + ' : sgn = 1 elif ch == ' - ' : sgn = - 1 elif ch != ' = ' : n = int ( ch ) ok = 1 if not ok : sol += chpl , mn = [ n ] * a , [ 1 ] * bs = n * a - bi , j = 0 , 0 while s > n and ( i < a or j < b ) : if i < a : amt = min ( s - n , n - 1 ) pl [ i ] -= amt s -= amt i += 1 else : amt = min ( s - n , n - 1 ) mn [ j ] += amt s -= amt j += 1 if s != n : print ( " Impossible " ) else : print ( " Possible " ) for ch in sol : if ch != ' P ' and ch != ' M ' : print ( ch , end = ' ▁ ' ) elif ch == ' P ' : print ( pl [ - 1 ] , end = ' ▁ ' ) pl . pop ( ) else : print ( mn [ - 1 ] , end = ' ▁ ' ) mn . pop ( ) print ( n ) NEW_LINE


l = [ i for i in input ( ) . split ( ' ▁ ' ) ] n , make = int ( l [ - 1 ] ) , int ( l [ - 1 ] ) positives = 1 negatives = 0 for i in l : if i == ' - ' : make += 1 negatives += 1 elif i == ' + ' : positives += 1 if make > n * positives or ( make < positives and negatives == 0 ) : print ( ' Impossible ' ) exit ( 0 ) ans = [ ] for i in range ( n , 0 , - 1 ) : while make >= i : ans . append ( i ) make -= i if make == 0 : break     idx = 0 while len ( ans ) > 0 and len ( ans ) < positives : if ans [ idx ] == 1 : idx += 1 if idx > len ( ans ) or ans [ idx ] == 1 : break ans [ idx ] -= 1 ans . append ( 1 )   idx = 0 negs = [ 0 ] * negativeswhile len ( ans ) < positives : ans . append ( 1 ) negs [ idx ] += 1 if negs [ idx ] == n : print ( ' Impossible ' ) exit ( 0 ) idx = ( idx + 1 ) % negatives print ( ' Possible ' ) print ( ans [ 0 ] , end = ' ▁ ' ) j , k = 0 , 1 for i in l : if i == ' - ' : print ( i , 1 + negs [ j ] , end = ' ▁ ' ) j += 1 elif i == ' + ' : print ( i , ans [ k ] , end = ' ▁ ' ) k += 1 elif i != ' ? ' : print ( i , end = ' ▁ ' ) print ( ) NEW_LINE


import sysr = input ( ) r , n = r . split ( ' = ' ) z = ' ' for i in r : z = z + i * ( i in [ ' + ' , ' - ' ] ) r = zn = int ( n ) p , v = r . count ( ' + ' ) + 1 , r . count ( ' - ' ) if not ( p - n * v <= n <= p * n - v ) : print ( ' Impossible ' ) sys . exit ( ) print ( ' Possible ' ) s = 0 ans = ' ' for i in range ( len ( r ) ) : zn = 1 if i > 0 and r [ i - 1 ] == ' - ' : zn = - 1 if zn == 1 : p -= 1 else : v -= 1 for x in range ( 1 , n + 1 ) : if s + x * zn + p - n * v <= n <= s + x * zn + p * n - v : s += x * zn zn = ' + ' if zn == 1 else ' - ' ans = ans + str ( x ) + ' ▁ ' + str ( r [ i ] ) + ' ▁ ' breakans = ans + str ( abs ( n - s ) ) + ' ▁ ' print ( ans + ' = ▁ ' + str ( n ) ) NEW_LINE


import java . util . * ;   public class Rebus { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String line = scan . nextLine ( ) ; String [ ] S = line . split ( " = " ) ; int N = Integer . parseInt ( S [ 1 ] . trim ( ) ) ; int max = N , min = 1 , nplus = 0 , nminus = 0 ;


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

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE red_digits_str = input ( ) NEW_LINE blue_digits_str = input ( ) NEW_LINE greater_red_digit_count = 0 NEW_LINE greater_blue_digit_count = 0 NEW_LINE for digit_i in range ( n ) : r_digit = int ( red_digits_str [ digit_i ] ) NEW_LINE b_digit = int ( blue_digits_str [ digit_i ] ) NEW_LINE if r_digit > b_digit : NEW_LINE INDENT greater_red_digit_count += 1 elif b_digit > r_digit : NEW_LINE greater_blue_digit_count += 1 NEW_LINE DEDENT if greater_red_digit_count > greater_blue_digit_count : NEW_LINE INDENT print ( ' RED ' ) elif greater_blue_digit_count > greater_red_digit_count : NEW_LINE print ( ' BLUE ' ) else : NEW_LINE print ( ' EQUAL ' ) NEW_LINE DEDENT


import sys   NEW_LINE def main ( ) : inp = sys . stdin . read ( ) . strip ( ) . split ( ) NEW_LINE out = [ ] NEW_LINE for i in range ( 2 , len ( inp ) , 3 ) : s = sum ( ( - 1 ) ** ( x < y ) for x , y in zip ( inp [ i ] , inp [ i + 1 ] ) if x != y ) NEW_LINE out . append ( s and ( ' BLUE ' , ' RED ' ) [ s > 0 ] or ' EQUAL ' ) NEW_LINE return out NEW_LINE print ( * main ( ) , sep = ' \n ' ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = input ( ) NEW_LINE c = input ( ) NEW_LINE r = b = 0 NEW_LINE for i in range ( n ) : if NEW_LINE a [ i ] == c [ i ] : NEW_LINE continue elif a [ i ] > c [ i ] : r += 1 else : b += 1 NEW_LINE if r > b : NEW_LINE INDENT print ( " RED " ) elif b > r : NEW_LINE print ( " BLUE " ) else : NEW_LINE print ( " EQUAL " ) NEW_LINE DEDENT


def rec ( n , z , l , x , y ) : if NEW_LINE n > z : NEW_LINE return l elif n == z : l . append ( n ) NEW_LINE return l else : if n not in l : l . append ( n ) NEW_LINE rec ( n * x , z , l , x , y ) NEW_LINE rec ( n * y , z , l , x , y )     NEW_LINE def gcd ( x , y ) : if NEW_LINE x < y : x , y = y , x NEW_LINE if y == 0 : return x NEW_LINE return gcd ( y , x % y )     NEW_LINE def lcm ( x , y ) : if NEW_LINE x < y : x , y = y , x NEW_LINE gcd_ = gcd ( x , y ) NEW_LINE return x * y // gcd_     NEW_LINE def main_func ( ) : output_list = [ ] NEW_LINE t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n = int ( input ( ) ) NEW_LINE r = input ( ) NEW_LINE b = input ( ) NEW_LINE count_r = 0 NEW_LINE ountb = 0 NEW_LINE for i in range ( len ( r ) ) : if NEW_LINE int ( r [ i ] ) > int ( b [ i ] ) : count_r += 1 NEW_LINE if int ( r [ i ] ) < int ( b [ i ] ) : NEW_LINE INDENT ountb += 1 else : NEW_LINE ountb += 1 NEW_LINE DEDENT count_r += 1 NEW_LINE if count_r > ountb : NEW_LINE INDENT output_list . append ( " RED " ) elif count_r < ountb : NEW_LINE output_list . append ( " BLUE " ) else : NEW_LINE output_list . append ( " EQUAL " ) NEW_LINE DEDENT return " \n " . join ( output_list )     print ( main_func ( ) )       NEW_LINE


import java . util . * ;   public class Solution {    public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int testCases = in . nextInt ( ) ; in . nextLine ( ) ; for ( int i = 0 ; i < testCases ; i ++ ) { int len = in . nextInt ( ) ; in . nextLine ( ) ; String red = in . nextLine ( ) ; String blue = in . nextLine ( ) ; int rp = 0 , bp = 0 ; for ( int j = 0 ; j < len ; j ++ ) { int r = ( int ) ( red . charAt ( j ) ) - 48 ; int b = ( int ) ( blue . charAt ( j ) ) - 48 ; if ( r > b ) rp ++ ; else if ( r < b ) bp ++ ; } if ( rp > bp ) { System . out . println ( " RED " ) ; } else if ( rp == bp ) { System . out . println ( " EQUAL " ) ; } else { System . out . println ( " BLUE " ) ; } } } }


import java . util . * ; public class redcards { public static void main ( String [ ] args ) { int t , n , i , s1 , s2 ; char r [ ] ; char b [ ] ;   Scanner sc = new Scanner ( System . in ) ;   t = sc . nextInt ( ) ;   while ( t -- > 0 ) { n = sc . nextInt ( ) ;   r = sc . next ( ) . toCharArray ( ) ; b = sc . next ( ) . toCharArray ( ) ;   s1 = 0 ; s2 = 0 ;   for ( i = 0 ; i < n ; i ++ ) { if ( r [ i ] > b [ i ] ) { s1 ++ ; } else if ( r [ i ] < b [ i ] ) { s2 ++ ; } } if ( s1 > s2 ) System . out . println ( " RED " ) ; if ( s1 < s2 ) System . out . println ( " BLUE " ) ; if ( s1 == s2 ) System . out . println ( " EQUAL " ) ; }   }   }


import java . io . * ; import java . util . * ; public class Main { static BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static PrintWriter out = new PrintWriter ( new OutputStreamWriter ( System . out ) ) ; public static void main ( String [ ] args ) throws Exception { int t = Integer . parseInt ( in . readLine ( ) ) ; while ( t -- != 0 ) { int len = Integer . parseInt ( in . readLine ( ) ) ; String s1 = in . readLine ( ) ; String s2 = in . readLine ( ) ; if ( s1 . equals ( s2 ) ) out . println ( " EQUAL " ) ; else deal ( s1 , s2 ) ; } out . flush ( ) ; } static void deal ( String s1 , String s2 ) { int n1 = 0 , n2 = 0 ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { if ( s1 . charAt ( i ) > s2 . charAt ( i ) ) n1 ++ ; if ( s1 . charAt ( i ) < s2 . charAt ( i ) ) n2 ++ ; } if ( n1 > n2 ) out . println ( " RED " ) ; else if ( n1 < n2 ) out . println ( " BLUE " ) ; else out . println ( " EQUAL " ) ; } }


import java . util . Scanner ; public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; int p = 0 , q = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a . charAt ( i ) > b . charAt ( i ) ) p ++ ; else if ( b . charAt ( i ) > a . charAt ( i ) ) q ++ ; } if ( p > q ) System . out . println ( " RED " ) ; else if ( q > p ) System . out . println ( " BLUE " ) ; elseSystem . out . println ( " EQUAL " ) ; } }   }


import java . util . * ; import java . io . * ; import static java . lang . Math . * ;   public class PracticeProblem { public static FastReader in = new FastReader ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ;   public static void main ( String [ ] args ) { solve ( ) ; out . close ( ) ; }   public static void solve ( ) { int n = in . nextInt ( ) ; double [ ] arr = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = in . nextDouble ( ) ;   Arrays . sort ( arr ) ;   if ( arr [ n - 1 ] == 1 ) { out . println ( 1. ) ; return ; }   double p = 1 - arr [ n - 1 ] ; double s = arr [ n - 1 ] / ( 1 - arr [ n - 1 ] ) ;   for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( s > 1 ) break ; p *= 1 - arr [ i ] ; s += arr [ i ] / ( 1 - arr [ i ] ) ; }   out . println ( p * s ) ;   }   public 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 ; } } }

import bisectn = int ( input ( ) ) ls = list ( map ( float , input ( ) . split ( ) ) ) ls . sort ( ) mx = ls [ - 1 ] idx = bisect . bisect_left ( ls , 0.5 ) if idx < n and ls [ idx ] < 0.5 : idx += 1   res = 0 st = 0 while ( st < idx - 1 ) : temp = 0 for i in range ( st , idx ) : t = 1 for j in range ( st , idx ) : if i != j : t = t * ( 1 - ls [ j ] ) temp += t * ls [ i ] res = max ( res , temp ) st += 1 res = max ( res , mx ) print ( " % .12f " % res ) NEW_LINE


n = int ( input ( ) ) from itertools import combinations   a = sorted ( list ( map ( float , input ( ) . split ( ) ) ) , reverse = True ) NEW_LINE


n = int ( input ( ) ) pr = list ( map ( float , input ( ) . split ( ) ) ) pr . sort ( reverse = True ) pr . insert ( 0 , 0 )   mx = 0 for k in range ( 1 , len ( pr ) ) : cur = 0 for j in range ( 1 , k + 1 ) : jth = 1 for i in range ( 1 , j ) : jth *= ( 1 - pr [ i ] ) jth *= pr [ j ] for i in range ( j + 1 , k + 1 ) : jth *= ( 1 - pr [ i ] ) cur += jth mx = max ( mx , cur ) NEW_LINE


import java . io . * ; import java . util . * ; public class Abc { public static void main ( String [ ] args ) throws Exception { FastReader sc = new FastReader ( ) ; int n = sc . nextInt ( ) ; double p [ ] = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { p [ i ] = sc . nextDouble ( ) ; if ( p [ i ] == 1 ) { System . out . println ( 1 ) ; return ; } } Arrays . sort ( p ) ; double max = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { double pr = 1 ; double sum = 0 ; for ( int j = i ; j < n ; j ++ ) { pr *= ( 1D - p [ j ] ) ; } for ( int j = i ; j < n ; j ++ ) { sum += ( pr / ( 1 - p [ j ] ) ) * ( p [ j ] ) ; } max = Math . max ( max , sum ) ; } System . out . println ( max ) ; } 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 ; } } }


import java . util . Arrays ; import java . util . Scanner ;   public class _26_Andrey_and_Problem {   public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; double [ ] arr = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = scn . nextDouble ( ) ;   } Arrays . sort ( arr ) ; double res = 1 ; double add = 0 ; double max = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { double b = arr [ i ] ; res = res * ( ( double ) 1 - b ) ; if ( ! ( arr [ i ] < 1.0 ) ) { max = 1.0 ; break ; } double bs = arr [ i ] / ( 1 - arr [ i ] ) ; add = add + bs ; if ( res * ( add ) > max ) { max = res * add ; } } System . out . printf ( " % .10f \n " , max ) ; } }


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

s = input ( )   dp = [ 0 , 0 , 0 ]   for i in s : if i == " a " : dp [ 2 ] = max ( dp ) + 1 dp [ 0 ] += 1 else : dp [ 1 ] = max ( dp [ 0 ] , dp [ 1 ] ) + 1 print ( max ( dp ) ) NEW_LINE


s = input ( ) a , ab , aba = 0 , 0 , 0 for i in s : if i == ' a ' : a += 1 aba = max ( ab , aba ) + 1 else : ab = max ( a , ab ) + 1 print ( max ( aba , ab , a ) ) NEW_LINE


import java . io . * ; import java . lang . * ; import java . util . * ;   public class B877 { public static void main ( String [ ] args ) throws IOException { StringTokenizer st ; BufferedReader f = new BufferedReader ( new InputStreamReader ( System . in ) ) ; st = new StringTokenizer ( f . readLine ( ) ) ; String curr = st . nextToken ( ) ; int op = 0 ; int n = curr . length ( ) ; int [ ] psums = new int [ n + 1 ] ; int [ ] psums1 = new int [ n + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( curr . charAt ( i ) == ' a ' ) { psums [ i + 1 ] = psums [ i ] + 1 ; psums1 [ i + 1 ] = psums1 [ i ] ; } else { psums1 [ i + 1 ] = psums1 [ i ] + 1 ; psums [ i + 1 ] = psums [ i ] ; } } f . close ( ) ; for ( int i = 0 ; i < n + 1 ; i ++ ) { for ( int x = i ; x < n + 1 ; x ++ ) { int p1 = psums [ i ] ; int p2 = psums1 [ x ] - psums1 [ i ] ; int p3 = psums [ n ] - psums [ x ] ; op = Math . max ( p1 + p2 + p3 , op ) ; } }    System . out . println ( op ) ; }   }


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . FileNotFoundException ; import java . util . StringTokenizer ; import java . io . BufferedReader ; import java . io . FileReader ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Reader in = new Reader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class TaskA { public void solve ( int testNumber , Reader in , PrintWriter out ) {   long x = in . nextLong ( ) ; long y = in . nextLong ( ) ; long m = in . nextLong ( ) ; if ( x >= m || y >= m ) { out . println ( 0 ) ; out . flush ( ) ; return ; } if ( x >= 0 && y >= 0 && m < Math . min ( x , y ) ) { out . println ( - 1 ) ; out . flush ( ) ; return ; } if ( x <= 0 && y <= 0 && m > Math . max ( x , y ) ) { out . println ( - 1 ) ; out . flush ( ) ; return ; } if ( m < 0 ) { m = - m ; x = - x ; y = - y ; } long c = 0 ; while ( x < m && y < m ) {   if ( x > y ) { long z = x ; x = y ; y = z ; }

x , y , m = map ( int , input ( ) . split ( ) ) x , y = min ( x , y ) , max ( x , y ) if y >= m : s = 0 elif x + y <= x : s = - 1 else : s = ( y - x + y - 1 ) // y x += y * s while max ( x , y ) < m : if x < y : x += y else : y += x s += 1 print ( s ) NEW_LINE


from sys import stdin , stdoutfrom math import ceilnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) def fn ( a , b ) : op = 0 while max ( a , b ) < m : a1 = max ( a , b ) + min ( a , b ) b1 = max ( a , b ) a , b = a1 , b1 op += 1 return opfor _ in range ( 1 ) : NEW_LINE


import osimport sysfrom io import BytesIO , IOBaseimport mathimport itertoolsimport bisectimport heapq NEW_LINE


import java . util . * ; import java . io . * ; import java . lang . * ;   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 a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; System . out . println ( Math . max ( ( a + b ) , ( c + d ) ) ) ; } }

for t in range ( int ( input ( ) ) ) : a , b , c , d = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE print ( max ( a + b , c + d ) ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : a , b , c , d = map ( int , input ( ) . split ( ) ) NEW_LINE print ( max ( ( a + b ) , ( c + d ) ) ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : a , b , c , d = [ int ( j ) for j in input ( ) . split ( ) ] NEW_LINE e = a + b NEW_LINE f = c + d NEW_LINE if e > f : NEW_LINE INDENT print ( e ) else : NEW_LINE print ( f ) NEW_LINE DEDENT


for i in range ( int ( input ( ) ) ) : a = [ int ( j ) for j in input ( ) . split ( ) ] NEW_LINE print ( max ( a [ 0 ] + a [ 1 ] , a [ 2 ] + a [ 3 ] ) ) NEW_LINE


import java . util . Scanner ;   public class B1445 {   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 = in . nextInt ( ) ; int B = in . nextInt ( ) ; int C = in . nextInt ( ) ; int D = in . nextInt ( ) ; int answer = Math . max ( A + B , C + D ) ; System . out . println ( answer ) ; } }   }


import java . util . * ; public class HelloWorld {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; System . out . println ( Math . max ( ( a + b ) , ( c + d ) ) ) ; } } }


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


import java . io . * ; import java . util . * ; import javax . print . attribute . standard . Finishings ;   import java . math . * ;   public class Cat { static final Random random = new Random ( ) ; static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Reader sc = new Reader ( ) ;   public static void main ( String args [ ] ) throws IOException { String str = sc . next ( ) ; if ( ! str . contains ( " Danil " ) && ! str . contains ( " Olya " ) && ! str . contains ( " Slava " ) && ! str . contains ( " Ann " ) && ! str . contains ( " Nikita " ) ) System . out . println ( " No " ) ; else { HashSet < String > hs = new HashSet < String > ( ) ; hs . add ( " Danil " ) ; hs . add ( " Olya " ) ; hs . add ( " Slava " ) ; hs . add ( " Ann " ) ; hs . add ( " Nikita " ) ; boolean flag = true ; int count = 0 ; for ( String i : hs ) { int index = 0 ; while ( true ) { index = str . indexOf ( i , index ) ; if ( index != - 1 ) { count ++ ; if ( count == 2 ) { System . out . println ( " No " ) ; flag = false ; break ; } index += i . length ( ) ; } else { break ; } } if ( ! flag ) break ; } if ( flag ) System . out . println ( " Yes " ) ; } }

import sys   inp = sys . stdin . readlines ( ) ; ii = 0   out = [ ]   name = inp [ ii ] ii += 1   lst = [ ' Danil ' , ' Olya ' , ' Slava ' , ' Ann ' , ' Nikita ' ]   cnt = 0   for x in lst : cnt += name . count ( x )   if cnt == 1 : sys . stdout . write ( " YES " ) else : sys . stdout . write ( " NO " )     NEW_LINE


import re   str = ' Danil | Olya | Slava | Ann | Nikita ' if ( len ( re . findall ( str , input ( ) ) ) == 1 ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


s = input ( ) a = " Danil " b = " Olya " c = " Slava " d = " Ann " e = " Nikita " cnt = s . count ( a ) cnt += s . count ( b ) cnt += s . count ( c ) cnt += s . count ( d ) cnt += s . count ( e ) if cnt == 1 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


def solve ( ) : m = 0 n , x = [ int ( j ) for j in input ( ) . split ( ) ] a = [ int ( мурк ) for мурк in input ( ) . split ( ) ] b = [ int ( k ) for k in input ( ) . split ( ) ] b . reverse ( ) for j in range ( n ) : if a [ j ] + b [ j ] <= x : m = m + 1 else : m = - 9999999999999999999 if m > 0 : print ( " YES " ) else : print ( " NO " ) def cmp ( key ) : return key [ 0 ] from math import floor , ceil NEW_LINE


s = str ( input ( ) ) l = [ ' Danil ' , ' Olya ' , ' Slava ' , ' Ann ' , ' Nikita ' ] c , c1 = 0 , 0 for i in l : if i in s : c = s . count ( i ) c1 += 1   if c == 1 and c1 == 1 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . util . Scanner ;   public class AlexBrokenContest { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int c = 0 , i ; in . close ( ) ;   for ( i = 0 ; i < s . length ( ) ; i ++ ) { if ( i < s . length ( ) - 2 && s . substring ( i , i + 3 ) . equals ( " Ann " ) ) c ++ ; if ( i < s . length ( ) - 3 && s . substring ( i , i + 4 ) . equals ( " Olya " ) ) c ++ ; if ( i < s . length ( ) - 4 && s . substring ( i , i + 5 ) . equals ( " Danil " ) ) c ++ ; if ( i < s . length ( ) - 4 && s . substring ( i , i + 5 ) . equals ( " Slava " ) ) c ++ ; if ( i < s . length ( ) - 5 && s . substring ( i , i + 6 ) . equals ( " Nikita " ) ) c ++ ; } System . out . println ( c == 1 ? " YES " : " NO " ) ; } }


import java . util . * ; import java . util . Scanner ; import java . io . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ;   import javax . lang . model . util . ElementScanner6 ;   public class B592 { static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static void main ( String args [ ] ) { FastReader in = new FastReader ( ) ; int t = 1 ;

n = int ( input ( ) ) print ( pow ( ( n - 2 ) , 2 ) ) NEW_LINE


n = int ( input ( ) ) print ( ( n - 2 ) * ( n - 2 ) ) NEW_LINE


n = int ( input ( ) ) if n == 3 : print ( 1 ) else : print ( ( n * ( n - 2 ) - ( n - 4 ) - n ) ) NEW_LINE


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


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


import java . io . BufferedReader ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class monster {   public static void main ( String [ ] args ) {


import java . math . BigDecimal ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; String str = input . nextLine ( ) ; System . out . println ( new BigDecimal ( str ) . stripTrailingZeros ( ) . toPlainString ( ) + " " ) ; } }


from decimal import *   a = input ( ) b = Decimal ( a )   if ( int ( b ) == b ) : print ( " % d " % b ) else : print ( b ) NEW_LINE


from decimal import *   a = input ( ) b = Decimal ( a )   if ( round ( b ) == b ) : print ( " % d " % b ) else : print ( b ) NEW_LINE


s = input ( ) l , r = s . split ( ' e ' ) a , d = l . split ( ' . ' ) a = int ( a ) b = int ( r ) if int ( b ) : d = int ( str ( d ) [ - 1 : : - 1 ] ) for i in range ( b ) : a = a * 10 + d % 10 d //= 10 d = str ( d ) [ - 1 : : - 1 ] print ( a , end = ' ' ) if int ( d ) : print ( ' . ' , end = ' ' ) print ( d ) NEW_LINE


import java . math . BigDecimal ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; BigDecimal a = input . nextBigDecimal ( ) ; long b = a . longValue ( ) ; if ( b == a . doubleValue ( ) ) System . out . println ( a . toBigInteger ( ) ) ; else System . out . println ( a . toPlainString ( ) ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ;   String s = input . next ( ) ;   int point = s . indexOf ( " . " ) ;   int power = Integer . parseInt ( s . substring ( s . indexOf ( " e " ) + 1 ) ) ; s = s . substring ( 0 , s . indexOf ( " e " ) ) ;   point += power ; point ++ ; StringBuilder ans = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) != ' . ' ) { if ( i == point ) { ans . append ( " . " ) ; } ans . append ( s . charAt ( i ) ) ; } }   point -= s . length ( ) ; while ( point -- > 0 ) { ans . append ( "0" ) ; }


import java . util . Scanner ;   public class BuildContest { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , m = in . nextInt ( ) , a [ ] = new int [ n ] , i , j , z = n ;   for ( i = 0 ; i < m ; i ++ ) { int x = in . nextInt ( ) - 1 ; a [ x ] ++ ;   if ( a [ x ] == 1 ) z -- ; if ( z < 1 ) { for ( j = 0 ; j < n ; j ++ ) { a [ j ] -- ;   if ( a [ j ] < 1 ) z ++ ; } System . out . print ( 1 ) ; } else { System . out . print ( 0 ) ; } } in . close ( ) ; } }

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


import collectionsn , m = map ( int , input ( ) . split ( ) ) d = collections . defaultdict ( set ) cnt = collections . defaultdict ( int ) for k in map ( int , input ( ) . split ( ) ) : cnt [ k ] += 1 d [ cnt [ k ] ] . add ( k ) if len ( d [ cnt [ k ] ] ) == n : print ( 1 , end = " " ) else : print ( 0 , end = " " ) NEW_LINE


def ints ( ) : return list ( map ( int , input ( ) . split ( ) ) ) n , le = ints ( ) l = ints ( ) d = [ 0 ] * nres = ' ' dis = 0 def chk ( n ) : global d global dis for i in range ( n ) : d [ i - 1 ] -= 1 if d [ i - 1 ] == 0 : dis -= 1 for i in range ( le ) : d [ l [ i ] - 1 ] += 1 if d [ l [ i ] - 1 ] == 1 : dis += 1 if dis == n : chk ( n ) print ( 1 , end = ' ' ) else : print ( 0 , end = ' ' )   NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) l1 = list ( map ( int , input ( ) . split ( ) ) )   freq = { } diff = 0 ans = " "   def update ( ) : global diff for i in range ( 1 , n + 1 ) : freq [ i ] -= 1 if ( freq [ i ] == 0 ) : diff -= 1 return     for i in range ( m ) : atual = l1 [ i ] if ( ( atual not in freq ) or freq [ atual ] == 0 ) : diff += 1 freq [ atual ] = 1 else : freq [ atual ] += 1   if ( diff == n ) : ans += "1" update ( ) else : ans += "0" print ( ans ) NEW_LINE


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . Map ; import java . util . Scanner ; import java . util . HashMap ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; Scanner in = new Scanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; BBuildAContest solver = new BBuildAContest ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class BBuildAContest { public void solve ( int testNumber , Scanner in , PrintWriter out ) { int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int [ ] problemCounter = new int [ n ] ; Map < Integer , Integer > quantityCount = new HashMap < > ( ) ; int contests = 0 ; for ( int i = 0 ; i < m ; i ++ ) { int p = in . nextInt ( ) - 1 ; problemCounter [ p ] ++ ; int curCount = problemCounter [ p ] ; quantityCount . put ( curCount , quantityCount . getOrDefault ( curCount , 0 ) + 1 ) ; if ( quantityCount . get ( contests + 1 ) == n ) { contests ++ ; out . print ( 1 ) ; } else { out . print ( 0 ) ; } } out . println ( ) ; }   } }


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


import java . util . * ; import java . io . * ; import java . lang . * ;    public class febchal { static int mod = 10000_00007 ;

n , m = map ( int , input ( ) . split ( ) ) a = input ( ) b = input ( ) t = a [ 0 ] + b [ 0 ] + a [ - 1 ] + b [ - 1 ] if t == ' < v > ^ ' or t == ' > ^ < v ' : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import math , sys , bisect , heapqfrom collections import defaultdict , Counter , dequefrom itertools import groupby , accumulate NEW_LINE


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


import com . sun . org . apache . bcel . internal . generic . AALOAD ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ;   public class Main {   static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) throws IOException {   Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; String row = input . next ( ) ; String col = input . next ( ) ; String ans = " " + row . charAt ( 0 ) + row . charAt ( row . length ( ) - 1 ) + col . charAt ( 0 ) + col . charAt ( col . length ( ) - 1 ) ;


import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . Scanner ; import java . util . Stack ;   public class StronglyConnectedCity {   private static List < List < Integer > > adjList , adjList1 ; private static boolean [ ] vis ; private static Stack < Integer > stack ; private static int n , m ;   private static void dfs1 ( int u ) { vis [ u ] = true ; for ( int i : adjList . get ( u ) ) { if ( ! vis [ i ] ) dfs1 ( i ) ; } stack . add ( u ) ; }   private static void dfs2 ( int u ) { vis [ u ] = true ;


import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int n , k ; n = sc . nextInt ( ) ; k = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; int b [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a ) ; Arrays . sort ( b ) ; int i = 0 , j = n - 1 , sum = 0 ; while ( k > 0 && b [ j ] > a [ i ] ) { sum += b [ j -- ] ; k -- ; i ++ ; } while ( i < n ) { sum += a [ i ++ ] ; } System . out . println ( sum ) ; t -- ; } } }

if __name__ == ' _ _ main _ _ ' : t = int ( input ( ) ) while t > 0 : t -= 1 n , k = map ( int , input ( ) . split ( ) ) alist = input ( " " ) alist = [ int ( n ) for n in alist . split ( ) ] blist = input ( " " ) blist = [ int ( n ) for n in blist . split ( ) ] res = sum ( alist ) while k > 0 : k -= 1 alist . sort ( ) blist . sort ( ) if alist [ 0 ] < blist [ n - 1 ] : res += blist [ n - 1 ] - alist [ 0 ] tmp = alist [ 0 ] alist [ 0 ] = blist [ n - 1 ] blist [ n - 1 ] = tmp else : break print ( res )   NEW_LINE


test = int ( input ( ) ) while test > 0 : test -= 1 arr = [ int ( x ) for x in input ( ) . split ( ) ] n = arr [ 0 ] ; k = arr [ 1 ] a = [ int ( x ) for x in input ( ) . split ( ) ] b = [ int ( x ) for x in input ( ) . split ( ) ] a . sort ( ) ; b . sort ( ) a_index = 0 ; b_index = len ( b ) - 1 while a_index < n and b_index >= 0 and k > 0 : if a [ a_index ] < b [ b_index ] : NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) x = min ( a ) ; y = max ( b ) xi = a . index ( x ) ; yi = b . index ( y ) if x >= y : print ( sum ( a ) ) else : i = 1 while ( x < y ) and ( i <= k ) : a [ xi ] , b [ yi ] = b [ yi ] , a [ xi ] x = min ( a ) y = max ( b ) xi = a . index ( x ) yi = b . index ( y ) i += 1 print ( sum ( a ) ) NEW_LINE


def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : n , k = map ( int , input ( ) . split ( ) ) a = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) b = sorted ( list ( map ( int , input ( ) . split ( ) ) ) , reverse = True ) for i in range ( k ) : if a [ i ] >= b [ i ] : break a [ i ] = b [ i ] print ( sum ( a ) )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import heapqfor _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) a = [ int ( i ) for i in input ( ) . split ( ) ] b = [ int ( i ) for i in input ( ) . split ( ) ] heapq . heapify ( a ) heapq . heapify ( b ) c = heapq . nsmallest ( k , a ) d = heapq . nlargest ( k , b ) print ( sum ( a ) - sum ( c ) + sum ( heapq . nlargest ( k , c + d ) ) ) NEW_LINE


import java . io . InputStream ; import java . io . PrintWriter ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ; import java . util . * ; public class B1353 { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int tc = sc . nextInt ( ) ; int n = 0 ; int x [ ] = new int [ 1000 ] ; int z = 0 ; int cap = 0 ; for ( int i = 0 ; i < tc ; i ++ ) { n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int arr [ ] = new int [ n ] ; int rr [ ] = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { arr [ j ] = sc . nextInt ( ) ; } for ( int y = 0 ; y < n ; y ++ ) { rr [ y ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; Arrays . sort ( rr ) ; int t = n - 1 ; for ( int b = 0 ; b < k ; b ++ ) { if ( rr [ t ] > arr [ b ] ) { arr [ b ] = rr [ t ] ; } t -- ; } int ans = 0 ; for ( int p = 0 ; p < n ; p ++ ) { ans = ans + arr [ p ] ; } x [ z ] = ans ; z ++ ;


import java . util . * ; import java . io . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int a = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int arra [ ] = new int [ a ] ; int arrb [ ] = new int [ a ] ; for ( int i = 0 ; i < a ; i ++ ) { arra [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < a ; i ++ ) { arrb [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arra ) ; Arrays . sort ( arrb ) ; int sum = 0 ; int pointb = a - 1 ; for ( int i = 0 ; i < a ; i ++ ) { if ( k > 0 & arra [ i ] < arrb [ pointb ] ) { k -- ; sum += arrb [ pointb ] ; pointb -- ; } else { sum += arra [ i ] ; } } System . out . println ( sum ) ; } } } ;


import java . util . * ; import java . io . * ; public class A { public static void main ( String ar [ ] ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { String nk [ ] = br . readLine ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( nk [ 0 ] ) ; int k = Integer . parseInt ( nk [ 1 ] ) ; int a [ ] = new int [ n ] ; int b [ ] = new int [ n ] ; String str1 [ ] = br . readLine ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = Integer . parseInt ( str1 [ i ] ) ; String str2 [ ] = br . readLine ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) b [ i ] = Integer . parseInt ( str2 [ i ] ) ; System . out . println ( getMaxSum ( a , b , n , k ) ) ; } } public static int getMaxSum ( int a [ ] , int b [ ] , int n , int k ) { Arrays . sort ( a ) ; Arrays . sort ( b ) ; int count = 0 ; int curr = n - 1 ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] < b [ curr ] && count < k ) { sum += b [ curr ] ; count ++ ; curr -- ; } else { sum += a [ i ] ; } } return sum ; } }


import java . util . * ;   public class TwoArraysAndSwap { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; List < Integer > l1 = new ArrayList < > ( ) ; List < Integer > l2 = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) l1 . add ( sc . nextInt ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) l2 . add ( sc . nextInt ( ) ) ; for ( int i = 0 ; i < k ; i ++ ) { int minIndex = l1 . indexOf ( Collections . min ( l1 ) ) ; int maxIndex = l2 . indexOf ( Collections . max ( l2 ) ) ; int min = l1 . get ( minIndex ) ; int max = Collections . max ( l2 ) ; if ( max > min ) { l1 . remove ( minIndex ) ; l1 . add ( max ) ; l2 . remove ( maxIndex ) ; } } int sum = 0 ; for ( int i = 0 ; i < l1 . size ( ) ; i ++ ) sum = sum + l1 . get ( i ) ; System . out . println ( sum ) ; } } }


import java . util . * ;   public class Test { public static void main ( String [ ] args ) {   Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ; while ( t -- > 0 ) {   int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; int [ ] a = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = input . nextInt ( ) ; }   for ( int i = 1 ; i < n ; i ++ ) { while ( a [ 0 ] < m && a [ i ] > 0 ) { a [ i ] -- ; a [ 0 ] ++ ; } if ( a [ 0 ] == m ) { break ; } } System . out . println ( a [ 0 ] ) ; } } }

t = int ( input ( ) ) for u in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) a = [ int ( i ) for i in input ( ) . split ( ) ] add = 0 for i in range ( 1 , n ) : add += a [ i ] print ( min ( m , a [ 0 ] + add ) ) NEW_LINE


t = int ( input ( ) )   for i in range ( t ) : n , m = tuple ( map ( int , input ( ) . split ( ) ) ) a = list ( map ( int , input ( ) . split ( ) ) )   s = sum ( a ) print ( min ( m , s ) )   NEW_LINE


for e in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) first = l [ 0 ] l . sort ( ) if ( sum ( l ) >= m ) : print ( m ) else : print ( sum ( l ) ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) ali = list ( map ( int , input ( ) . split ( ) ) ) q = sum ( ali [ 1 : ] ) NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = Integer . parseInt ( scanner . nextLine ( ) ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; scanner . nextLine ( ) ; int sum = 0 ; String [ ] s = scanner . nextLine ( ) . split ( " ▁ " ) ; for ( int j = 0 ; j < n ; j ++ ) { sum += Integer . parseInt ( s [ j ] ) ; }   System . out . println ( sum >= m ? m : sum ) ;   }    } }


import java . util . * ; import java . io . * ; import java . math . * ;   public class Main   { static FastReader sc = new FastReader ( ) ; public static void main ( String [ ] args ) { StringBuffer sb = new StringBuffer ( " " ) ; int ttt = 1 ; ttt = i ( ) ; outer : while ( ttt -- > 0 ) { int n = i ( ) ; int k = i ( ) ; int A [ ] = input ( n ) ; int s = 0 ; for ( int i : A ) s += i ; System . out . println ( Math . min ( k , s ) ) ; }


import static java . lang . Integer . min ; import java . util . Scanner ;   public class Testing {   public static void main ( String [ ] args ) { Scanner x = new Scanner ( System . in ) ; short t = x . nextShort ( ) ; int [ ] finalanswer = new int [ t ] ; int counter = 0 ; for ( short i = 0 ; i < t ; i ++ ) { short n = x . nextShort ( ) ; int m = x . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( short j = 0 ; j < n ; j ++ ) a [ j ] = x . nextInt ( ) ; finalanswer [ counter ] = method1 ( a , m , n ) ; counter ++ ; } for ( int i = 0 ; i < t ; i ++ ) System . out . println ( finalanswer [ i ] ) ; } public static int method1 ( int [ ] a , int m , short n ) { int finalanswer ; int summation = 0 ; for ( short j = 0 ; j < n ; j ++ ) summation += a [ j ] ; finalanswer = min ( m , summation ) ; return finalanswer ; } }


import java . util . Scanner ; public class A { static int val = 10000 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String s = " " ; int n = sc . nextInt ( ) ; for ( int i = 1 ; i <= val ; i ++ ) { s += i ; } System . out . println ( s . charAt ( n - 1 ) ) ;   } }

c = 1   x = int ( input ( ) ) string = " " while len ( string ) < x : string += str ( c ) c += 1   print ( string [ x - 1 ] ) NEW_LINE


if __name__ == ' _ _ main _ _ ' : k = int ( input ( ) ) s = list ( range ( 1 , 10001 ) ) s = ' ' . join ( str ( c ) for c in s ) print ( s [ k - 1 ] ) NEW_LINE


k = int ( input ( ) ) lis = ' ' . join ( [ str ( i ) for i in range ( 1 , k + 1 ) ] ) print ( lis [ k - 1 ] ) NEW_LINE


n = int ( input ( ) ) s = " " i = 1 while len ( s ) < 10000 : s += str ( i ) i += 1   print ( s [ n - 1 ] ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Digit_Seq { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } } public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int k = in . nextInt ( ) ; long n = 1 ; int i = 0 ; String s = " " ; while ( s . length ( ) < k ) { s += n ; n ++ ; } System . out . println ( s . charAt ( k - 1 ) ) ; } }


import javax . swing . plaf . IconUIResource ; import javax . xml . crypto . dsig . spec . HMACParameterSpec ; import java . awt . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; import java . util . List ;   import static java . lang . Math . * ; public class Main {   public static void main ( String [ ] args ) { FastScanner sc = new FastScanner ( ) ;


import java . util . * ;   public class questionCF { public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 1 ; i <= n ; i ++ ) sb . append ( i ) ; System . out . println ( sb . charAt ( n - 1 ) ) ; } }


import java . util . Scanner ;   public class Beautiful_Year {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int i = n + 1 ; ; i ++ ) { boolean check = true ; int arr [ ] = new int [ 10 ] ; int temp = i ; while ( temp > 0 ) { int ld = temp % 10 ; arr [ ld ] ++ ; temp = temp / 10 ; } for ( int j = 0 ; j < 10 ; j ++ ) { if ( arr [ j ] > 1 ) { check = false ; } } if ( check ) { System . out . println ( i ) ; break ; } } } }

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


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 . io . * ;   import java . lang . * ;    import java . util . * ;   public class TestA { static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static void main ( String [ ] args ) {   try { System . setIn ( new FileInputStream ( " input . txt " ) ) ; System . setOut ( new PrintStream ( new FileOutputStream ( " output . txt " ) ) ) ; } catch ( Exception e ) { System . err . println ( " Error " ) ; }   FastReader objScanner = new FastReader ( ) ;   int n = objScanner . nextInt ( ) ;   int i = n + 1 ;   while ( true ) { if ( distinct ( i ) ) { System . out . println ( i ) ; break ; } i ++ ; }   }     static boolean distinct ( int n ) { String str = Integer . toString ( n ) ;   HashSet < Character > objSet = new HashSet < Character > ( ) ; int l = str . length ( ) ;   for ( int i = 0 ; i < l ; i ++ ) { objSet . add ( str . charAt ( i ) ) ; }   if ( objSet . size ( ) == l ) { return true ; } else { return false ; } } }