import com . sun . org . apache . bcel . internal . generic . AALOAD ; import com . sun . org . apache . bcel . internal . generic . GOTO ; 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 ; import static jdk . nashorn . internal . runtime . regexp . joni . Syntax . Java ;   public class Main {   public static void main ( String [ ] args ) throws IOException {   Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; String a [ ] = { " vaporeon " , " jolteon " , " flareon " , " espeon " , " umbreon " , " leafeon " , " glaceon " , " sylveon " } ; String s = input . next ( ) ; int count = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) >= ' a ' && s . charAt ( i ) <= ' z ' ) { count ++ ; } } for ( String string : a ) { if ( string . length ( ) == n ) { int now = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( string . charAt ( i ) == s . charAt ( i ) ) { now ++ ; } } if ( now == count ) { System . out . println ( string ) ; return ; } } } }   }

evolucion = [ ' vaporeon ' , ' jolteon ' , ' flareon ' , ' espeon ' , ' umbreon ' , ' leafeon ' , ' glaceon ' , ' sylveon ' ]   longitud = int ( input ( ) ) palabra = input ( )   if longitud == 8 : print ( ' vaporeon ' ) elif longitud == 6 : print ( ' espeon ' ) else : indices = [ ] for i in range ( longitud ) : if palabra [ i ] != ' . ' : indices . append ( i )   respuesta = None i = 0 while i < 8 and respuesta is None : es_la_palabra = True for j in range ( len ( indices ) ) : es_la_palabra = es_la_palabra and ( palabra [ indices [ j ] ] == evolucion [ i ] [ indices [ j ] ] ) if es_la_palabra : respuesta = evolucion [ i ] i = i + 1 print ( respuesta ) NEW_LINE


import sysa = \ [ ' vaporeon ' , ' jolteon ' , ' flareon ' , ' espeon ' , ' umbreon ' , ' leafeon ' , ' glaceon ' , ' sylveon ' ] n = int ( input ( ) ) s = input ( ) for i in a : if len ( i ) == n : ss = 0 for x in range ( n ) : if s [ x ] == i [ x ] : ss += 1 if ss == n - s . count ( ' . ' ) : print ( i )   NEW_LINE


n = int ( input ( ) ) s = str ( input ( ) ) l = [ " vaporeon " , " jolteon " , " flareon " , " espeon " , " umbreon " , " leafeon " , " glaceon " , " sylveon " ] for e in l : if len ( e ) == len ( s ) and all ( s [ i ] == ' . ' or s [ i ] == e [ i ] for i in range ( n ) ) : print ( e ) exit ( ) NEW_LINE


import re   arr = " Vaporeon , ▁ Jolteon , ▁ Flareon , ▁ Espeon , ▁ Umbreon , ▁ Leafeon , ▁ Glaceon , ▁ Sylveon " . split ( " , ▁ " )   n = int ( input ( ) ) s = input ( ) s = s . replace ( ' . ' , ' ( . * ) ' ) for i in range ( len ( arr ) ) : arr [ i ] = arr [ i ] . lower ( )   for i in arr : if re . match ( s , i ) and len ( i ) == n : print ( i ) break   NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { String [ ] data = { " vaporeon " , " jolteon " , " flareon " , " espeon " , " umbreon " , " leafeon " , " glaceon " , " sylveon " } ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String str = sc . next ( ) ; char [ ] c = str . toCharArray ( ) ; for ( int i = 0 ; i < data . length ; i ++ ) { if ( n != data [ i ] . length ( ) ) { continue ; } int count = 0 ; for ( int j = 0 ; j < c . length ; j ++ ) { if ( c [ j ] == data [ i ] . charAt ( j ) || c [ j ] == ' . ' ) { count ++ ; } else { break ; } } if ( count == n ) { System . out . println ( data [ i ] ) ; } } sc . close ( ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { String [ ] data = { " vaporeon " , " jolteon " , " flareon " , " espeon " , " umbreon " , " leafeon " , " glaceon " , " sylveon " } ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String str = sc . next ( ) ; char [ ] c = str . toCharArray ( ) ; for ( int i = 0 ; i < data . length ; i ++ ) { if ( n != data [ i ] . length ( ) ) { continue ; } int count = 0 ; char [ ] ch = data [ i ] . toCharArray ( ) ; for ( int j = 0 ; j < c . length ; j ++ ) { if ( c [ j ] == data [ i ] . charAt ( j ) || c [ j ] == ' . ' ) { count ++ ; } else { break ; } } if ( count == n ) { System . out . println ( data [ i ] ) ; } } } }


import java . util . Scanner ;   public class Eevee { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; in . nextLine ( ) ; String inputString = in . nextLine ( ) ; String strings [ ] = { " vaporeon " , " jolteon " , " flareon " , " espeon " , " umbreon " , " leafeon " , " glaceon " , " sylveon " } ; for ( int i = 0 ; i < 8 ; i ++ ) { if ( strings [ i ] . matches ( inputString ) ) System . out . println ( strings [ i ] ) ; } } }


import java . io . * ; import java . util . * ;   public class C {   static ArrayList < Integer > adj [ ] ;   static int dist , b , max , q ;   static void dfs ( int u , int p , int h ) {   if ( max <= h ) { max = h ; q = u ; } for ( int v : adj [ u ] ) { if ( v != p ) { dfs ( v , u , h + 1 ) ; if ( v == b ) dist = h + 1 ; } } }   public static void main ( String args [ ] ) throws Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) - 1 ; b = sc . nextInt ( ) - 1 ; int da = sc . nextInt ( ) ; int db = sc . nextInt ( ) ; adj = new ArrayList [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { adj [ i ] = new ArrayList < > ( ) ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { int u = sc . nextInt ( ) - 1 ; int v = sc . nextInt ( ) - 1 ; adj [ u ] . add ( v ) ; adj [ v ] . add ( u ) ; } max = 0 ; q = 0 ; dist = 0 ; dfs ( a , - 1 , 0 ) ; int y = dist ; dfs ( q , - 1 , 0 ) ; dist = y ; if ( dist <= da ) { pw . println ( " Alice " ) ; } else if ( 2 * da >= max ) { pw . println ( " Alice " ) ;   } else { if ( db > 2 * da ) { pw . println ( " Bob " ) ;   } else { pw . println ( " Alice " ) ;   } } } pw . flush ( ) ; }

from _collections import deque NEW_LINE def dist ( G , n , s ) : D = [ None ] * n NEW_LINE D [ s ] = 0 NEW_LINE Q = deque ( ) NEW_LINE Q . append ( s ) NEW_LINE while Q : f = Q . popleft ( ) NEW_LINE for t in G [ f ] : if NEW_LINE D [ t ] is None : D [ t ] = D [ f ] + 1 ; NEW_LINE Q . append ( t ) NEW_LINE return D NEW_LINE for _ in range ( int ( input ( ) ) ) : n , a , b , da , db = map ( int , input ( ) . split ( ) ) NEW_LINE a -= 1 ; NEW_LINE b -= 1 ; NEW_LINE G = [ [ ] for _ in range ( n ) ] NEW_LINE for _ in range ( n - 1 ) : u , v = map ( int , input ( ) . split ( ) ) NEW_LINE G [ u - 1 ] . append ( v - 1 ) NEW_LINE G [ v - 1 ] . append ( u - 1 ) NEW_LINE D = dist ( G , n , a ) NEW_LINE me = max ( enumerate ( D ) , key = lambda x : x [ 1 ] ) [ 0 ] NEW_LINE print ( ' Alice ' ) if D [ b ] <= da or db <= 2 * da or max ( dist ( G , n , me ) ) <= 2 * da else print ( ' Bob ' ) NEW_LINE


from sys import stdin NEW_LINE for _ in range ( int ( input ( ) ) ) : n , a , b , da , db = map ( int , input ( ) . split ( ) ) NEW_LINE a -= 1 NEW_LINE b -= 1 NEW_LINE go = [ [ ] for _ in range ( n ) ] NEW_LINE for _ in range ( n - 1 ) : x , y = map ( int , stdin . readline ( ) . split ( ) ) NEW_LINE x -= 1 NEW_LINE y -= 1 NEW_LINE go [ x ] . append ( y ) NEW_LINE go [ y ] . append ( x ) NEW_LINE MAX = 0 NEW_LINE def f ( pre , node , level ) : global MAX , dis NEW_LINE re = [ 0 , 0 ] NEW_LINE if node == b : dis = level NEW_LINE for x in go [ node ] : if NEW_LINE pre != x : re . append ( f ( node , x , level + 1 ) ) NEW_LINE re . sort ( ) NEW_LINE MAX = max ( MAX , re [ - 1 ] + re [ - 2 ] ) NEW_LINE return re [ - 1 ] + 1 NEW_LINE f ( - 1 , a , 0 ) NEW_LINE if dis <= da or da * 2 >= db or da * 2 >= MAX : NEW_LINE INDENT print ( ' Alice ' ) else : NEW_LINE print ( ' Bob ' ) NEW_LINE DEDENT


import java . util . * ;   import javax . swing . plaf . basic . BasicScrollPaneUI . HSBChangeListener ;   import java . io . * ;   public class A { static BufferedReader br ; static PrintWriter pw ; static int inf = ( int ) 1e9 ; static long mod = ( long ) 1e9 + 7 ;   static ArrayList < Integer > [ ] g ; static int n ; static char [ ] [ ] a ; static boolean [ ] [ ] vis ;   public static void main ( String [ ] args ) throws NumberFormatException , IOException , InterruptedException {


from sys import stdin for _ in range ( int ( input ( ) ) ) : n , a , b , da , db = map ( int , input ( ) . split ( ) ) a -= 1 b -= 1 go = [ [ ] for _ in range ( n ) ] for _ in range ( n - 1 ) : x , y = map ( int , stdin . readline ( ) . split ( ) ) x -= 1 y -= 1 go [ x ] . append ( y ) go [ y ] . append ( x ) MAX = 0 def f ( pre , node , level ) : global MAX , dis re = [ 0 , 0 ] if node == b : dis = level for x in go [ node ] : if pre != x : re . append ( f ( node , x , level + 1 ) ) re . sort ( ) MAX = max ( MAX , re [ - 1 ] + re [ - 2 ] ) return re [ - 1 ] + 1 f ( - 1 , a , 0 ) if dis <= da or da * 2 >= db or da * 2 >= MAX : print ( ' Alice ' ) else : print ( ' Bob ' )


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class CF1370A { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { System . out . println ( Integer . parseInt ( br . readLine ( ) ) / 2 ) ; } } }

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) print ( n // 2 ) NEW_LINE


for ti in range ( int ( input ( ) ) ) : print ( int ( input ( ) ) // 2 ) NEW_LINE


t = int ( input ( ) )   for _ in range ( t ) : n = int ( input ( ) ) print ( n // 2 )   NEW_LINE


for _ in range ( int ( input ( ) ) ) : print ( int ( input ( ) ) // 2 ) NEW_LINE


import math     def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) print ( n // 2 )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import java . util . * ; public class f { public static void main ( String [ ] a ) { Scanner sc = new Scanner ( System . in ) ; if ( sc . hasNext ( ) ) { int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; System . out . println ( n / 2 ) ;    }   } } }


import java . util . Scanner ;   public class MaximumGCD { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int test = sc . nextInt ( ) ; for ( int i = 0 ; i < test ; i ++ ) { int num = sc . nextInt ( ) ; System . out . println ( num / 2 ) ; } } }


import java . util . Scanner ; import java . lang . Math ; import java . util . Arrays ;   public class pa { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String args [ ] ) { int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = sc . nextInt ( ) ; System . out . println ( n / 2 ) ; } } }


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; while ( t -- > 0 ) { int n = scanner . nextInt ( ) ; System . out . println ( n % 2 == 0 ? n / 2 : ( n - 1 ) / 2 ) ; } } }


import java . util . * ; public class practice { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; long k = scn . nextLong ( ) , b = scn . nextLong ( ) , n = scn . nextLong ( ) , t = scn . nextLong ( ) ; long z = 1 , time = 0 ; ; while ( z <= t ) { z = z * k + b ; time ++ ; } long ans = n - time + 1 ; if ( ans < 0 ) { ans = 0 ; } System . out . println ( ans ) ; } }

k , b , n , t = [ int ( x ) for x in input ( ) . split ( " ▁ " ) ] z = 1 while k * z + b <= t : z = k * z + b n -= 1 print ( max ( n , 0 ) ) NEW_LINE


import mathk , b , n , t = list ( map ( int , input ( ) . split ( ) ) ) if k > 1 : ans = math . ceil ( n - math . log ( ( t + b / ( k - 1 ) ) / ( 1 + b / ( k - 1 ) ) ) / math . log ( k ) ) print ( max ( 0 , ans ) ) else : z = 1 + n * b f = 1 ans = 0 while f : if t + ans * b >= z : f = 0 break else : ans = ans + 1 print ( ans ) NEW_LINE


import java . util . * ;   public class practice { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; long k = scn . nextLong ( ) , b = scn . nextLong ( ) , n = scn . nextLong ( ) , t = scn . nextLong ( ) ; long z = 1 , time = 0 ; ; while ( z <= t ) { z = z * k + b ; time ++ ; } long ans = n - time + 1 ; if ( ans < 0 ) { ans = 0 ; } System . out . println ( ans ) ; } }


import java . util . * ; import java . io . * ; import java . math . * ;   public class x223B { public static void main ( String hi [ ] ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; char [ ] arr = infile . readLine ( ) . toCharArray ( ) ; char [ ] brr = infile . readLine ( ) . toCharArray ( ) ; int N = arr . length ; int M = brr . length ; if ( N < M || bad ( arr , brr ) ) System . out . println ( " No " ) ; else { int [ ] left = new int [ N ] ; int [ ] right = new int [ N ] ; int [ ] place = new int [ 26 ] ; Arrays . fill ( place , N + M + M + N ) ; int dex = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( dex < M && arr [ i ] == brr [ dex ] ) { left [ i ] = place [ arr [ i ] - ' a ' ] = dex ; dex ++ ; } else left [ i ] = place [ arr [ i ] - ' a ' ] ; } dex = M - 1 ; place = new int [ 26 ] ; Arrays . fill ( place , N + M + M + N ) ; for ( int i = N - 1 ; i >= 0 ; i -- ) { if ( dex >= 0 && arr [ i ] == brr [ dex ] ) { right [ i ] = place [ arr [ i ] - ' a ' ] = dex ; dex -- ; } else right [ i ] = place [ arr [ i ] - ' a ' ] ; } String res = " Yes " ; for ( int i = 0 ; i < N ; i ++ ) if ( right [ i ] > left [ i ] ) res = " No " ; System . out . println ( res ) ; } } public static boolean bad ( char [ ] a , char [ ] b ) { HashSet < Character > set = new HashSet < Character > ( ) ; for ( char c : b ) set . add ( c ) ; for ( char c : a ) if ( ! set . contains ( c ) ) return true ; return false ; } }

import bisectimport string   s = input ( ) t = input ( )   max_match = [ 0 for i in range ( len ( s ) ) ] min_match = [ 0 for i in range ( len ( s ) ) ] char_idx = [ 0 for i in range ( 30 ) ] char_occur = [ [ ] for i in range ( 30 ) ]   for ( i , ch ) in enumerate ( t ) : idx = ord ( ch ) - ord ( ' a ' ) char_occur [ idx ] . append ( i )   for ch in string . ascii_lowercase : idx = ord ( ch ) - ord ( ' a ' ) char_occur [ idx ] . append ( len ( t ) + 1 )   matched = - 1 for ( i , ch ) in enumerate ( s ) : if matched == len ( t ) - 1 : max_match [ i ] = matched else : if ch == t [ matched + 1 ] : matched += 1 max_match [ i ] = matched   matched = len ( t ) for ( i , ch ) in enumerate ( s [ : : - 1 ] ) : i = len ( s ) - i - 1 if matched == 0 : min_match [ i ] = matched else : if ch == t [ matched - 1 ] : matched -= 1 min_match [ i ] = matched   for ( i , ch ) in enumerate ( s ) : low = min_match [ i ] high = max_match [ i ] ch = ord ( ch ) - ord ( ' a ' ) idx = char_idx [ ch ] while idx < len ( char_occur [ ch ] ) and char_occur [ ch ] [ idx ] < low : idx += 1 char_idx [ ch ] = idx if idx == len ( char_occur [ ch ] ) : print ( " No " ) exit ( ) if char_occur [ ch ] [ idx ] > high : print ( " No " ) exit ( )   print ( " Yes " ) NEW_LINE


import java . io . * ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . * ;   public class Task2 {   public static void main ( String [ ] args ) throws IOException {   new Task2 ( ) . solve ( ) ;   }   int mod = 1000000007 ;   PrintWriter out ;   int n ; int m ;   ArrayList < Integer > [ ] g ;   void solve ( ) throws IOException {


import java . util . Scanner ;   public class _0613LittleArtem {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; boolean flag = true ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( n % 2 == 0 || m % 2 == 0 ) { if ( i == n - 1 && j == m - 2 || i == n - 1 && j == m - 1 ) { System . out . print ( " B " ) ; continue ; } } if ( flag ) { System . out . print ( " B " ) ; flag = ! flag ; } else { System . out . print ( " W " ) ; flag = ! flag ; } } if ( m % 2 == 0 ) { flag = ! flag ; } System . out . println ( ) ; } cases -- ; } }   }

for _ in range ( int ( input ( ) ) ) : c , r = map ( int , input ( ) . split ( ) ) grid = [ [ ] for _ in range ( c ) ] grid [ 0 ] . append ( ' W ' ) for i in grid : for _ in range ( r ) : i . append ( ' B ' ) grid [ 0 ] . remove ( grid [ 0 ] [ - 1 ] ) for i in grid : print ( ' ' . join ( i ) ) NEW_LINE


t = int ( input ( ' ' ) ) for i in range ( t ) : n , m = map ( int , input ( ' ' ) . split ( ' ▁ ' ) ) table = [ ] vmi = False black = 0 hossz = 0 for j in range ( n ) : tmp = [ ] if ( vmi == False ) : vmi = True else : vmi = False for k in range ( m ) : if ( vmi ) : if ( k % 2 == 0 ) : tmp . append ( ' B ' ) else : tmp . append ( ' W ' ) else : if ( k % 2 == 0 ) : tmp . append ( ' W ' ) else : tmp . append ( ' B ' ) table . append ( tmp ) black = tmp . count ( ' B ' ) if ( m * n % 2 == 0 ) : if ( m * n - black + 1 != black ) : vmi = False for j in range ( len ( table ) - 1 , - 1 , - 1 ) : if ( vmi ) : break for k in range ( len ( table [ j ] ) - 1 , - 1 , - 1 ) : if ( table [ j ] [ k ] == ' W ' ) : table [ j ] [ k ] = ' B ' vmi = True break for j in table : print ( ' ' . join ( j ) ) NEW_LINE


t = int ( input ( ) )   for tc in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) print ( ' W ' + ' B ' * ( m - 1 ) ) for x in range ( n - 1 ) : print ( ' B ' * m )       NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) for i in range ( n ) : for j in range ( m ) : if i == 0 and j == 0 : print ( ' W ' , end = ' ' ) else : print ( ' B ' , end = ' ' ) print ( ) NEW_LINE


import java . util . * ; public class file { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int test = scan . nextInt ( ) ; for ( int i = 0 ; i < test ; i ++ ) { int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ; for ( int k = 0 ; k < a ; k ++ ) { for ( int j = 0 ; j < b ; j ++ ) { if ( k == 0 && j == 0 ) { System . out . print ( " W " ) ; } else { System . out . print ( " B " ) ; } } System . out . println ( " " ) ; } } } }


import java . io . BufferedReader ; import java . util . Collections ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class Main { public static void main ( String [ ] args ) throws IOException { PrintWriter pw = new PrintWriter ( System . out ) ; Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int y = 0 ; y < t ; y ++ ) { int r = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; for ( int i = 0 ; i < r ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) { if ( i == 0 && j == 0 ) { pw . print ( " W " ) ; } else pw . print ( " B " ) ; } pw . println ( ) ; } } pw . close ( ) ; } static class Scanner { StringTokenizer st ; BufferedReader br ; public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; } public Scanner ( String file ) throws FileNotFoundException { br = new BufferedReader ( new FileReader ( file ) ) ; } public String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; } public int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } public String nextLine ( ) throws IOException { return br . readLine ( ) ; } public double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; } public boolean ready ( ) throws IOException { return br . ready ( ) ; } } }


import java . util . * ;   public class LittleArtern {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String s = " B " ; for ( int j = 0 ; j < m - 1 ; j ++ ) { if ( i == n - 1 ) { s += ' B ' ; } else s += ' W ' ; } System . out . println ( s ) ; } }   }   }


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

def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) if n % 4 == 0 : print ( " YES " ) else : print ( " NO " )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : a = int ( input ( ) ) if a % 4 == 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : print ( " YES " if int ( input ( ) ) % 4 == 0 else " NO " ) NEW_LINE


from collections import Counter   def solve ( ) : n = int ( input ( ) )   if n % 4 : return " NO "   return " YES "     for i in range ( int ( input ( ) ) ) : print ( solve ( ) ) NEW_LINE


for i in range ( int ( input ( ) ) ) : if int ( input ( ) ) % 4 == 0 : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . util . Scanner ;   public class FashionableLee { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int test = sc . nextInt ( ) ; for ( int i = 0 ; i < test ; i ++ ) { long side = sc . nextInt ( ) ; if ( side % 4 == 0 ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . Set ;   public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static void main ( String [ ] args ) { FastReader sc = new FastReader ( ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int a = sc . nextInt ( ) ; if ( ( a - 4 ) % 4 == 0 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }   }   }


import java . util . Scanner ;   public class A1369 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = scanner . nextInt ( ) ; if ( n % 4 == 0 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class CF1369A { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { System . out . println ( ( Integer . parseInt ( br . readLine ( ) ) % 4 ) == 0 ? " YES " : " NO " ) ; } } }


import java . util . * ;   public class solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int res = - 1 ; for ( int i = 0 ; i <= n / a ; i ++ ) { for ( int j = 0 ; j * b + i * a <= n ; j ++ ) { if ( ( n - ( j * b + i * a ) ) % c == 0 ) { res = Math . max ( res , ( i + j + ( n - ( j * b + i * a ) ) / c ) ) ; } } } System . out . println ( res ) ; } }

import syssys . setrecursionlimit ( 5000 )     def max_ribbon_cuts ( target_sum , numbers ) : memo = { }   def helper ( target_sum , numbers ) : if target_sum in memo : return memo [ target_sum ]   if target_sum == 0 : return [ ]   if target_sum < 0 : return None   shortest_combination = None for num in numbers : remainder = target_sum - num remiander_combination = helper ( remainder , numbers )   if remiander_combination != None : combination = remiander_combination + [ num ]   if ( shortest_combination == None or len ( shortest_combination ) < len ( combination ) ) : shortest_combination = combination   memo [ target_sum ] = shortest_combination return memo [ target_sum ]   return helper ( target_sum , numbers )     user_inputs = list ( map ( eval , input ( ) . split ( " ▁ " ) ) )   print ( len ( max_ribbon_cuts ( user_inputs [ 0 ] , user_inputs [ 1 : ] ) ) ) NEW_LINE


n , a , b , c = map ( int , input ( ) . split ( ) ) memory = [ False ] * ( n + 1 )   memory [ 0 ] = 0 t = min ( a , b , c )   for i in range ( 1 , t ) : memory [ i ] = - 9999999999       for i in range ( t , n + 1 ) : maks = 0 if i - a >= 0 : maks = max ( maks , memory [ i - a ] + 1 ) if i - b >= 0 : maks = max ( maks , memory [ i - b ] + 1 ) if i - c >= 0 : maks = max ( maks , memory [ i - c ] + 1 )   maks = maks if maks != 0 else - 9999999999 memory [ i ] = maksprint ( memory [ n ] )     NEW_LINE


n , a , b , c = map ( int , input ( ) . split ( ) ) dp = [ float ( " - inf " ) for i in range ( n + 1 ) ] if a <= n : dp [ a ] = 1 if b <= n : dp [ b ] = 1 if c <= n : dp [ c ] = 1 for i in range ( 1 , n + 1 ) : if i - a >= 0 : dp [ i ] = max ( dp [ i ] , 1 + dp [ i - a ] ) if i - b >= 0 : dp [ i ] = max ( dp [ i ] , 1 + dp [ i - b ] ) if i - c >= 0 : dp [ i ] = max ( dp [ i ] , 1 + dp [ i - c ] ) print ( dp [ - 1 ] ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int ans = 1 ; for ( int i = 0 ; i <= n ; i ++ ) { int g = n - i * a ;


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


import javax . print . DocFlavor ; import javax . swing . * ; import java . awt . image . BandedSampleModel ; import java . util . * ;   public class Example { static int [ ] dp ;


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; int flag = 0 ; ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { flag = 0 ; for ( int j = 0 ; j <= a [ i ] / 3 ; j ++ ) { if ( ( a [ i ] - 3 * j ) % 7 == 0 ) { flag = 1 ; break ; } } if ( flag == 0 ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; }   }   }

cases = int ( input ( ) )   pool = { 1 , 2 , 4 , 5 , 8 , 11 }   while cases : cases -= 1 num = int ( input ( ) )   if num < 3 : print ( " NO " ) else : step = 0 found = False while 3 * step <= num : if ( num - 3 * step ) % 7 == 0 : print ( " YES " ) found = True break step += 1 if not found : print ( " NO " ) NEW_LINE


n = int ( input ( ) ) for i in range ( n ) : a = int ( input ( ) ) a -= ( a % 3 ) * 7 if a < 0 : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE


n = int ( input ( " " ) ) A = [ ] for i in range ( n ) : x = int ( input ( " " ) ) A . append ( x ) for i in A : if ( i % 3 == 0 or i % 7 == 0 or i % 10 == 0 ) : print ( ' YES ' ) else : if ( i > 12 ) : print ( ' YES ' ) else : print ( " NO " ) NEW_LINE


li = [ 1 , 2 , 4 , 5 , 8 , 11 ] n = int ( input ( ) ) for i in range ( n ) : a = int ( input ( ) ) if a in li : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE


cases = int ( input ( ) )   pool = { 1 , 2 , 4 , 5 , 8 , 11 }   while cases : cases -= 1 num = int ( input ( ) ) if num not in pool : print ( " YES " ) else : print ( " NO " ) NEW_LINE


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


import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int num = scanner . nextInt ( ) ; List < Integer > list1 = new ArrayList < > ( ) ; List < Integer > list2 = new ArrayList < > ( ) ; List < Integer > list3 = new ArrayList < > ( ) ; for ( int i = 0 ; i < num ; i ++ ) { int n = scanner . nextInt ( ) ; list1 . add ( n ) ; } for ( int j = 0 ; j < num - 1 ; j ++ ) { int n = scanner . nextInt ( ) ; list2 . add ( n ) ; } for ( int j = 0 ; j < num - 2 ; j ++ ) { int n = scanner . nextInt ( ) ; list3 . add ( n ) ; } System . out . println ( compareList ( list1 , list2 ) ) ; System . out . println ( compareList ( list2 , list3 ) ) ; }   private static int compareList ( List < Integer > list1 , List < Integer > list2 ) { int result = 0 ; for ( int i = 0 ; i < list1 . size ( ) ; i ++ ) { result = result ^ list1 . get ( i ) ; } for ( int j = 0 ; j < list2 . size ( ) ; j ++ ) { result = result ^ list2 . get ( j ) ; } return result ; }   }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) c = list ( map ( int , input ( ) . split ( ) ) ) print ( sum ( a ) - sum ( b ) ) print ( sum ( b ) - sum ( c ) ) NEW_LINE


n = input ( ) a = sum ( map ( int , input ( ) . split ( ) ) ) b = sum ( map ( int , input ( ) . split ( ) ) ) c = sum ( map ( int , input ( ) . split ( ) ) ) print ( a - b , b - c ) NEW_LINE


from collections import Counter_ = input ( ) a = Counter ( [ int ( i ) for i in input ( ) . split ( ) ] ) b = Counter ( [ int ( i ) for i in input ( ) . split ( ) ] ) c = Counter ( [ int ( i ) for i in input ( ) . split ( ) ] ) for k in a . keys ( ) : if a . get ( k , 0 ) != b . get ( k , 0 ) : print ( k ) for k in b . keys ( ) : if b . get ( k , 0 ) != c . get ( k , 0 ) : print ( k ) NEW_LINE


n = int ( input ( ) ) first = [ int ( x ) for x in input ( ) . split ( ) ] second = [ int ( x ) for x in input ( ) . split ( ) ] third = [ int ( x ) for x in input ( ) . split ( ) ] first . sort ( ) , second . sort ( ) , third . sort ( ) for i in range ( n - 1 ) : if first [ i ] != second [ i ] : print ( first [ i ] ) count = 1 break else : count = 0 if count == 0 and i == n - 2 : print ( first [ n - 1 ] ) for j in range ( n - 2 ) : if second [ j ] != third [ j ] : print ( second [ j ] ) count = 1 break else : count = 0 if count == 0 and j == n - 3 : print ( second [ n - 2 ] ) NEW_LINE


input ( ) l = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] a = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] b = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] print ( sum ( l ) - sum ( a ) ) print ( sum ( a ) - sum ( b ) ) NEW_LINE


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


import java . io . * ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . math . MathContext ; import java . util . * ;   public class CodeForces { public static void main ( String [ ] args ) throws IOException { Scanner scan = new Scanner ( System . in ) ;   int n = scan . nextInt ( ) ;   int a [ ] = new int [ n ] ; int b [ ] = new int [ n - 1 ] ; int c [ ] = new int [ n - 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { b [ i ] = scan . nextInt ( ) ; } for ( int i = 0 ; i < n - 2 ; i ++ ) { c [ i ] = scan . nextInt ( ) ; } Arrays . sort ( a ) ; Arrays . sort ( b ) ; Arrays . sort ( c ) ; int flag [ ] = new int [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) {


import java . io . * ; import java . util . * ; public class ACM { public static void main ( String args [ ] ) throws FileNotFoundException , IOException { Scanner x = new Scanner ( System . in ) ; int n = x . nextInt ( ) ; int [ ] arr = new int [ n ] ; int [ ] arr2 = new int [ n - 1 ] ; int [ ] arr3 = new int [ n - 2 ] ; int First = 0 ; int Sec = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { arr [ i ] = x . nextInt ( ) ; } for ( int i = 0 ; i < arr2 . length ; i ++ ) { arr2 [ i ] = x . nextInt ( ) ; } for ( int i = 0 ; i < arr3 . length ; i ++ ) { arr3 [ i ] = x . nextInt ( ) ; } Arrays . sort ( arr ) ; Arrays . sort ( arr2 ) ; Arrays . sort ( arr3 ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( arr [ i ] != arr2 [ i ] ) { First = arr [ i ] ; break ; } else { if ( i == n - 2 ) { First = arr [ n - 1 ] ; } } } for ( int i = 0 ; i < n - 2 ; i ++ ) { if ( arr2 [ i ] != arr3 [ i ] ) { Sec = arr2 [ i ] ; break ; } else { if ( i == n - 3 ) { Sec = arr2 [ n - 2 ] ; } } } System . out . println ( First ) ; System . out . println ( Sec ) ; } }


import java . util . Comparator ; import java . util . LinkedList ; import java . util . Scanner ;   public class AAndBAndCompilationErrors { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int testCase = scanner . nextInt ( ) ; LinkedList < Integer > list = new LinkedList < > ( ) ; LinkedList < Integer > list1 = new LinkedList < > ( ) ; LinkedList < Integer > list2 = new LinkedList < > ( ) ;   for ( int i = 0 ; i < testCase ; i ++ ) { list . add ( scanner . nextInt ( ) ) ; } for ( int i = 0 ; i < testCase - 1 ; i ++ ) { list1 . add ( scanner . nextInt ( ) ) ; } for ( int i = 0 ; i < testCase - 2 ; i ++ ) { list2 . add ( scanner . nextInt ( ) ) ; } list . sort ( Comparator . comparingInt ( o -> o ) ) ; list1 . sort ( Comparator . comparingInt ( o -> o ) ) ; list2 . sort ( Comparator . comparingInt ( o -> o ) ) ; helper ( list , list1 ) ; helper ( list1 , list2 ) ; }   public static void helper ( LinkedList < Integer > list , LinkedList < Integer > list1 ) { for ( Integer integer : list1 ) { list . remove ( integer ) ; } System . out . println ( list . get ( 0 ) ) ; } }


import java . util . * ;   public class JavaApplication6 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = new String ( ) ; int m ; m = in . nextInt ( ) ; s = in . next ( ) ; System . out . println ( ( int ) ( s . length ( ) + 1 ) ) ; } }

n = int ( input ( ) ) s = input ( ) print ( n + 1 ) NEW_LINE


n = int ( input ( ) ) s = input ( ) x = s . count ( " L " ) y = s . count ( " R " ) print ( y + x + 1 ) NEW_LINE


import ren = int ( input ( ) ) x = input ( ) a = len ( re . findall ( ' L ' , x ) ) b = len ( re . findall ( ' R ' , x ) ) d = - 1 * ac = b - aprint ( b - d + 1 ) NEW_LINE


import redef post ( n , x ) : a = len ( re . findall ( ' L ' , x ) ) b = len ( re . findall ( ' R ' , x ) ) return a + b + 1 t = int ( input ( ) ) y = input ( ) r = post ( t , y ) print ( r ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String n = sc . nextLine ( ) ; String s = sc . nextLine ( ) ; System . out . println ( s . length ( ) + 1 ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String n = sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int Lout = 0 , Rout = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == 76 ) { Lout ++ ; } else { Rout ++ ; } } System . out . println ( Rout + Lout + 1 ) ; } }


import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = Integer . valueOf ( scanner . nextLine ( ) ) ; scanner . nextLine ( ) ; System . out . println ( n + 1 ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s = sc . next ( ) ; System . out . println ( n + 1 ) ; } }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Code { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int q = sc . nextInt ( ) ; while ( q > 0 ) { q -- ; long n = sc . nextLong ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; long cost = 0 ; if ( n % 2 == 0 ) { if ( a * 2 <= b ) { cost = a * n ; } else { cost = ( b * n ) / 2 ; } } else { cost = a ; if ( a * 2 <= b ) { cost = cost + a * ( n - 1 ) ; } else { cost = cost + ( b * ( n - 1 ) ) / 2 ; } } System . out . println ( cost ) ; } } }

import sysimport re   def main ( ) : inp = sys . stdin . read ( ) . strip ( ) . split ( ' \n ' ) [ 1 : ] out = [ ] for s in inp : n , a , b = map ( int , s . split ( ) ) out . append ( min ( a * n , n // 2 * b + n % 2 * a ) ) return out   print ( * main ( ) , sep = ' \n ' ) NEW_LINE


t = int ( input ( ) ) while ( t ) :   n , a , b = map ( int , input ( ) . split ( ) ) al = 1 bl = 2 cost = 0 if ( ( a // al ) > ( b // bl ) ) : NEW_LINE


q = int ( input ( ) )   for i in range ( q ) : n , a , b = map ( int , input ( ) . split ( " ▁ " ) )   print ( min ( a * n , b * ( n // 2 ) + a * ( n % 2 ) ) ) NEW_LINE


import java . util . Scanner ;   public class eularian { public static long solve ( long n , long a , long b ) { if ( n % 2 == 0 ) { long ans1 = n * a ; long ans2 = ( n / 2 ) * b ; return Math . min ( ans2 , ans1 ) ; } else { long ans1 = ( n - 1 ) * a ; long ans2 = ( ( n - 1 ) / 2 ) * b ; return Math . min ( ans2 , ans1 ) + a ; } } public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; System . out . println ( solve ( n , a , b ) ) ; } } }


import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int q = sc . nextInt ( ) ; while ( q -- > 0 ) { long n = sc . nextLong ( ) , a = sc . nextLong ( ) , b = sc . nextLong ( ) ; System . out . println ( Math . min ( b * ( n / 2 ) + a * ( n % 2 ) , a * n ) ) ; }   } }


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 ) {   long n = input . nextLong ( ) ; int a = input . nextInt ( ) ; int b = input . nextInt ( ) ;   long result ; if ( ( n & 1 ) == 0 ) { result = Math . min ( ( n / 2 ) * b , n * a ) ; } else { result = Math . min ( ( n - 1 ) / 2 * b + a , n * a ) ; } System . out . println ( result ) ; } } }


import java . util . * ; public class waterbuying { public static void main ( String [ ] args ) { long q , n , a , b , cost ;   Scanner sc = new Scanner ( System . in ) ;   q = sc . nextLong ( ) ;   while ( q -- > 0 ) { n = sc . nextLong ( ) ; a = sc . nextLong ( ) ; b = sc . nextLong ( ) ;   cost = ( long ) ( Math . ceil ( n / 2 ) * Math . min ( 2 * a , b ) + ( n % 2 ) * a ) ;   System . out . println ( cost ) ; }   }   }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int k = scan . nextInt ( ) ; int l = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; int n = scan . nextInt ( ) ; int d = scan . nextInt ( ) ; int t = 0 ; for ( int i = 1 ; i <= d ; i ++ ) { if ( i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 ) ; else t ++ ; } System . out . print ( ( d - t ) ) ; } }

k = int ( input ( ) ) l = int ( input ( ) ) m = int ( input ( ) ) n = int ( input ( ) ) d = int ( input ( ) ) s = 0 for i in range ( 1 , d + 1 ) : if ( i % k != 0 and i % l != 0 and i % m != 0 and i % n != 0 ) : s += 1 print ( d - s ) NEW_LINE


k = int ( input ( ) ) l = int ( input ( ) ) m = int ( input ( ) ) n = int ( input ( ) ) d = int ( input ( ) ) arr = [ ] arr = [ i for i in range ( 1 , d + 1 ) ] if k == 1 or l == 1 or m == 1 or n == 1 : print ( d ) else : i = 0 while len ( arr ) > i : if arr [ i ] % k == 0 : arr . pop ( i ) else : i += 1 i = 0 while len ( arr ) > i : if arr [ i ] % l == 0 : arr . pop ( i ) else : i += 1 i = 0 while len ( arr ) > i : if arr [ i ] % m == 0 : arr . pop ( i ) else : i += 1 i = 0 while len ( arr ) > i : if arr [ i ] % n == 0 : arr . pop ( i ) else : i += 1 print ( d - len ( arr ) ) NEW_LINE


def Func ( N , D ) : i = 1 Lst = [ ] Val = N while N * i <= D : Lst . append ( N * i ) i = i + 1 return Lst K = int ( input ( ) ) L = int ( input ( ) ) M = int ( input ( ) ) N = int ( input ( ) ) D = int ( input ( ) )   ( Lst1 , Lst2 , Lst3 , Lst4 ) = ( Func ( K , D ) , Func ( L , D ) , Func ( M , D ) , Func ( N , D ) )   Set = set ( Lst1 + Lst2 + Lst3 + Lst4 ) if len ( Set ) <= D : print ( len ( Set ) ) else : print ( D )   NEW_LINE


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ;   int k = in . nextInt ( ) ; int l = in . nextInt ( ) ; int m = in . nextInt ( ) ; int n = in . nextInt ( ) ; int d = in . nextInt ( ) ;   int a = 0 ; for ( int i = 1 ; i <= d ; i ++ ) { if ( i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 ) a ++ ; }   System . out . println ( a ) ; } }


import java . util . Scanner ;   public class Insomnia_Cure {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int count = 0 ; boolean dragons [ ] = new boolean [ d + 1 ] ; for ( int i = 1 ; i < d + 1 ; i ++ ) { if ( i % k == 0 ) { dragons [ i ] = true ; } } for ( int i = 1 ; i < d + 1 ; i ++ ) { if ( i % l == 0 ) { dragons [ i ] = true ; } } for ( int i = 1 ; i < d + 1 ; i ++ ) { if ( i % m == 0 ) { dragons [ i ] = true ; } } for ( int i = 1 ; i < d + 1 ; i ++ ) { if ( i % n == 0 ) { dragons [ i ] = true ; } } for ( int i = 1 ; i < d + 1 ; i ++ ) { if ( dragons [ i ] == true ) { count ++ ; } } System . out . println ( count ) ; }   }


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

n = int ( input ( ) ) a = n % 4 if ( a == 0 or a == 3 ) : print ( 0 ) else : print ( 1 ) NEW_LINE


n = int ( input ( ) ) if ( n * ( n + 1 ) ) % 4 == 0 : print ( 0 ) elif n <= 2 : print ( 1 ) elif n == 3 : print ( 0 ) else : print ( 1 )   NEW_LINE


def main ( ) : t = int ( input ( ) ) if ( t % 4 == 1 or t % 4 == 2 ) : print ( 1 ) else : print ( 0 ) main ( ) NEW_LINE


n = int ( input ( ) ) s = ( ( n + 1 ) // 2 ) print ( s % 2 ) NEW_LINE


import java . util . Scanner ; public class Main { static Scanner in = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int ans = 0 ; int n = in . nextInt ( ) ; if ( n % 2 == 0 ) { if ( ( n >> 1 ) % 2 == 1 ) ans = 1 ; else ans = 0 ; } else { if ( ( ( n - 1 ) >> 1 ) % 2 == 0 ) ans = 1 ; else ans = 0 ; } System . out . println ( ans ) ; } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . Arrays ;    public class Solution {    public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   String input = br . readLine ( ) ; long maximum = Integer . parseInt ( input ) ; long sum = maximum * ( maximum + 1 ) / 2 ; System . out . println ( sum % 2 ) ;    }    }


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


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

a = list ( input ( ) ) flag = 1 k = 0 for i in range ( len ( a ) ) : if ( int ( a [ i ] ) % 2 == 0 and int ( a [ i ] ) < int ( a [ - 1 ] ) ) : k = i flag = 0 break elif ( int ( a [ i ] ) % 2 == 0 ) : k = i flag = 0 if ( flag ) : print ( - 1 ) else : temp = a [ k ] a [ k ] = a [ - 1 ] a [ - 1 ] = temp print ( " " . join ( a ) ) NEW_LINE


n = list ( input ( ) ) a , b = - 1 , - 1 for i , j in enumerate ( n ) : if int ( j ) > b and int ( j ) % 2 == 0 and int ( j ) < int ( n [ - 1 ] ) : b = int ( j ) a = i breakif a == - 1 and b == - 1 : a , b = - 1 , 2 ** 31 for i , j in enumerate ( n ) : if int ( j ) % 2 == 0 : b = int ( j ) a = iif a == - 1 : print ( - 1 ) else : n [ a ] , n [ - 1 ] = n [ - 1 ] , n [ a ] print ( " " . join ( n ) ) NEW_LINE


n = list ( input ( ) ) m = - 1 for i , d in enumerate ( n ) : if int ( d ) % 2 == 0 : m = i if int ( d ) < int ( n [ - 1 ] ) : breakif m < 0 : print ( - 1 ) else : n [ - 1 ] , n [ m ] = n [ m ] , n [ - 1 ] print ( ' ' . join ( n ) ) NEW_LINE


n = input ( ) res = - 1 i = 0 last = int ( n [ - 1 ] ) while i < len ( n ) : digit = int ( n [ i ] ) if digit % 2 == 0 : if digit > last : res = i if digit < last : res = i break i += 1   if res == - 1 : print ( res )   else : i = 0 while i < len ( n ) : if i == res : print ( last , end = " " ) elif i == len ( n ) - 1 : print ( n [ res ] , end = " " ) else : print ( n [ i ] , end = " " )   i += 1 print ( ) NEW_LINE


def n_to_list ( n ) : lst = [ ] while n > 0 : lst . append ( n % 10 ) n //= 10 lst . reverse ( ) return lst     def answer ( lst ) : NEW_LINE


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


import java . util . * ;   public class Anton_and_currency_u_all_know { public static void swap ( char [ ] ar , int i , int j ) { char temp = ar [ j ] ; ar [ j ] = ar [ i ] ; ar [ i ] = temp ; System . out . println ( new String ( ar ) ) ; }   public static void main ( String arg [ ] ) { Scanner sc = new Scanner ( System . in ) ; char [ ] chArr = sc . nextLine ( ) . toCharArray ( ) ; int pos = - 1 ; boolean flag = false ; for ( int i = 0 ; i < chArr . length ; i ++ ) { if ( Character . getNumericValue ( chArr [ i ] ) % 2 == 0 ) { if ( Character . getNumericValue ( chArr [ i ] ) < Character . getNumericValue ( chArr [ chArr . length - 1 ] ) ) { swap ( chArr , i , chArr . length - 1 ) ; System . exit ( 0 ) ; } else { flag = true ; pos = i ; } } }    if ( flag == true ) swap ( chArr , pos , chArr . length - 1 ) ; else System . out . println ( - 1 ) ;   } }


import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int a [ ] = new int [ m + 2 ] ; while ( n -- > 0 ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; for ( int i = l ; i <= r ; i ++ ) a [ i ] = 1 ; } int cnt = 0 ; for ( int i = 1 ; i <= m ; i ++ ) if ( a [ i ] == 0 ) cnt ++ ; System . out . println ( cnt ) ; for ( int i = 1 ; i <= m ; i ++ ) if ( a [ i ] == 0 ) System . out . print ( i + " ▁ " ) ; } }

n , m = input ( ) . split ( ) n , m = int ( n ) , int ( m ) arr , brr = [ 0 ] * ( m + 2 ) , [ 0 ] * ( m + 2 ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) s = set ( range ( 1 , m + 1 ) ) for x in range ( n ) : l , r = map ( int , input ( ) . split ( ) ) for i in range ( l , r + 1 ) : s . discard ( i ) print ( len ( s ) ) print ( * s ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) li = [ ] s = [ ] for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) for i in range ( a - 1 , b ) : li . append ( ( i + 1 ) ) for i in range ( m ) : if i + 1 not in list ( set ( li ) ) : s . append ( i + 1 ) if len ( s ) > 0 : print ( len ( s ) ) print ( * s ) else : print ( 0 ) NEW_LINE


i = lambda : map ( int , input ( ) . split ( ) ) n , m = i ( ) s = lambda a , b : { * range ( a , b + 1 ) } v = s ( 1 , m ) for _ in range ( n ) : v -= s ( * i ( ) ) print ( len ( v ) ) print ( * v )   NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { int n , m , count = 0 ; ; Scanner in = new Scanner ( System . in ) ; Set < Integer > set = new HashSet < Integer > ( ) ; n = in . nextInt ( ) ; m = in . nextInt ( ) ; int l [ ] = new int [ n ] ; int r [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { l [ i ] = in . nextInt ( ) ; r [ i ] = in . nextInt ( ) ; for ( int j = l [ i ] ; j <= r [ i ] ; j ++ ) { set . add ( j ) ; } } for ( int i = 1 ; i <= m ; i ++ ) { if ( ! set . contains ( i ) ) { count ++ ; } } System . out . println ( count ) ; for ( int i = 1 ; i <= m ; i ++ ) { if ( ! set . contains ( i ) ) { System . out . print ( i + " ▁ " ) ; } } } }


import java . util . * ; import java . io . * ; import java . math . BigInteger ; import java . text . * ; public class Main { static long mod = 1000_000_007 ; static long mod1 = 998244353 ; static boolean fileIO = false ; static boolean memory = true ; static FastScanner f ; static PrintWriter pw ; static double eps = ( double ) 1e-6 ; static int oo = ( int ) 1e9 ;   public static void solve ( ) throws Exception { int n = f . ni ( ) ; int m = f . ni ( ) ; int dp [ ] = new int [ 105 ] ;   for ( int i = 0 ; i < n ; ++ i ) { int l = f . ni ( ) ; int r = f . ni ( ) ; ++ dp [ l ] ; -- dp [ r + 1 ] ; } int cnt = 0 ;   for ( int i = 1 ; i < 105 ; ++ i ) dp [ i ] += dp [ i - 1 ] ; ArrayList < Integer > ans = new ArrayList < > ( ) ; for ( int i = 1 ; i <= m ; ++ i ) { if ( dp [ i ] == 0 ) { ++ cnt ; ans . add ( i ) ; } } pn ( cnt ) ; for ( Integer x : ans ) p ( x + " ▁ " ) ; } public static void main ( String [ ] args ) throws Exception { if ( memory ) new Thread ( null , new Runnable ( ) { public void run ( ) { try { new Main ( ) . run ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . exit ( 1 ) ; } } } , " " , 1 << 28 ) . start ( ) ; else new Main ( ) . run ( ) ; } void run ( ) throws Exception { if ( System . getProperty ( " ONLINE _ JUDGE " ) == null ) { f = new FastScanner ( " " ) ; pw = new PrintWriter ( System . out ) ; } else { f = new FastScanner ( ) ; pw = new PrintWriter ( System . out ) ;


import java . io . BufferedReader ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ;   public class Seg { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int temp = 1 ; int [ ] a = sc . nextArr ( n * 2 ) ; int c = 0 ; int j = 0 ; int [ ] arr = new int [ 100 ] ; boolean flag = false ; while ( temp <= m ) { for ( int i = 0 ; i < a . length - 1 ; i = i + 2 ) { if ( temp >= a [ i ] && temp <= a [ i + 1 ] ) { c ++ ; flag = true ; break ; } else { flag = false ; }   } if ( ! flag ) { arr [ j ] = temp ; j ++ ; }   temp ++ ; }   System . out . println ( m - c ) ; for ( int i = 0 ; i < j ; i ++ ) { System . out . print ( arr [ i ] + " ▁ " ) ; }   pw . flush ( ) ; pw . close ( ) ; }   public static int findMaxSumSubarray ( int [ ] arr , int k ) { int maxValue = Integer . MIN_VALUE ; int currentRunningSum = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { currentRunningSum += arr [ i ] ; if ( i >= k - 1 ) { maxValue = Math . max ( maxValue , currentRunningSum ) ; currentRunningSum -= arr [ i - ( k - 1 ) ] ;


import java . util . Scanner ;   public class A1077 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = scanner . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { long a = scanner . nextLong ( ) , res = 0 , b = scanner . nextLong ( ) , k = scanner . nextLong ( ) ; if ( k % 2 == 0 ) { res += k / 2 * ( a - b ) ; } else { res += ( k + 1 ) / 2 * a - k / 2 * b ; } System . out . println ( res ) ; } } }

for x in range ( int ( input ( ) ) ) : a , b , k = map ( int , input ( ) . split ( ) ) pos = 0 if k % 2 == 0 : pos = a * k // 2 - b * k // 2 else : pos = a * ( k // 2 + 1 ) - b * ( k // 2 ) print ( pos ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : a , b , k = map ( int , input ( ) . split ( ) ) c = a * ( k // 2 ) c -= b * ( k // 2 ) if k % 2 : c += a print ( c ) NEW_LINE


from typing import Iterator     def get_num_input ( ) -> Iterator [ int ] : return map ( int , input ( ) . split ( ) )     def main ( ) -> None : right : int left : int times : int right , left , times = get_num_input ( )   print ( ( right - left ) * ( times // 2 ) + right * ( times % 2 ) )     if __name__ == " _ _ main _ _ " : ONLY_ONCE : bool = False for _ in range ( 1 if ONLY_ONCE else int ( input ( ) ) ) : main ( ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , m , k = map ( int , input ( ) . split ( ) ) d = n - m if k % 2 == 0 : print ( d * ( k // 2 ) ) else : print ( d * ( k // 2 ) + n ) NEW_LINE


import java . util . Scanner ;   public class Main {   public static Scanner sc = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) { int cases = sc . nextInt ( ) ; for ( int i = cases ; i != 0 ; i -- ) { long n = 0 , res = 0 ; long a = sc . nextLong ( ) , b = sc . nextLong ( ) , k = sc . nextLong ( ) ; if ( k % 2 == 1 ) { n = k / 2 + 1 ; res += n * a - ( n - 1 ) * b ; } else { n = k / 2 ; res += n * a - n * b ; } System . out . println ( res ) ; } } }


import java . util . ArrayList ; import java . util . Scanner ;    public class ForgJumping {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int cases = scan . nextInt ( ) ; long a , b , k ; long x = 0 ; ArrayList < Long > results = new ArrayList ( ) ; for ( int i = 0 ; i < cases ; i ++ ) { a = scan . nextLong ( ) ; b = scan . nextLong ( ) ; k = scan . nextLong ( ) ; if ( k % 2 == 0 ) x = ( a * ( k / 2 ) - b * ( k / 2 ) ) ; elsex = ( a * ( k / 2 + 1 ) - b * ( k / 2 ) ) ; results . add ( x ) ; x = 0 ; } for ( int i = 0 ; i < results . size ( ) ; i ++ ) System . out . println ( results . get ( i ) ) ;     } }


import java . util . ArrayList ; import java . util . Scanner ;   public class Frogjump {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int cases = scan . nextInt ( ) ; long a , b , k ; long x = 0 ; ArrayList < Long > results = new ArrayList ( ) ; for ( int i = 0 ; i < cases ; i ++ ) { a = scan . nextLong ( ) ; b = scan . nextLong ( ) ; k = scan . nextLong ( ) ; if ( k % 2 == 0 ) x = ( a * ( k / 2 ) - b * ( k / 2 ) ) ; else x = ( a * ( k / 2 + 1 ) - b * ( k / 2 ) ) ; results . add ( x ) ; x = 0 ; } for ( int i = 0 ; i < results . size ( ) ; i ++ ) System . out . println ( results . get ( i ) ) ; } }


import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class B_v2 { private static class Solver { private void solve ( ) throws Exception { int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int [ ] g = new int [ k ] ; int x4 = n ; int x2 = 2 * n ; int x1 = 0 ; for ( int i = 0 ; i < k ; i ++ ) { g [ i ] = in . nextInt ( ) ; int g4 = g [ i ] / 4 ; int cost = Math . min ( g4 , x4 ) ; x4 -= cost ; g [ i ] -= cost * 4 ; } x2 += x4 ; x1 += x4 ; for ( int i = 0 ; i < k ; i ++ ) { int g2 = g [ i ] / 2 ; int cost = Math . min ( g2 , x2 ) ; x2 -= cost ; g [ i ] -= cost * 2 ; } x1 += x2 ; if ( Arrays . stream ( g ) . sum ( ) > x1 ) { out . println ( " NO " ) ; } else { out . println ( " YES " ) ; } } }

n , k = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) s2 = 2 * ns4 = ns1 = 0 fail = 0 for i in range ( k ) : while a [ i ] >= 4 : if s4 > 0 : s4 -= 1 a [ i ] -= 4 elif s2 > 0 : s2 -= 1 a [ i ] -= 2 elif s1 > 0 : s1 -= 1 a [ i ] -= 1 else : fail = 1 breakfor i in range ( k ) : while a [ i ] >= 2 : if s4 > 0 : s4 -= 1 a [ i ] -= 2 s1 += 1 elif s2 > 0 : s2 -= 1 a [ i ] -= 2 elif s1 > 0 : s1 -= 1 a [ i ] -= 1 else : fail = 1 breakfor i in range ( k ) : while a [ i ] >= 1 : if s4 > 0 : s4 -= 1 a [ i ] -= 1 s1 += 1 elif s2 > 0 : s2 -= 1 a [ i ] -= 1 elif s1 > 0 : s1 -= 1 a [ i ] -= 1 else : fail = 1 breakif fail : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) fours , twos , ones = n , 2 * n , 0 NEW_LINE


from sys import stdin   n , k = [ int ( x ) for x in stdin . readline ( ) . split ( ) ] a = [ int ( x ) for x in stdin . readline ( ) . split ( ) ]   four = ntwo = 2 * none = 0   for i , x in enumerate ( a ) : f = min ( four , x // 4 ) four -= f a [ i ] -= f * 4   if four : a . sort ( reverse = True ) v = True for x in a : if x == 3 : if four : four -= 1 elif two >= 2 : two -= 2 else : v = False break elif x == 2 : if four : four -= 1 one += 1 elif two : two -= 1 elif one >= 2 : one -= 2 else : v = False break elif x == 1 : if four : four -= 1 two += 1 elif two : two -= 1 elif one : one -= 1 else : v = False break if v : print ( ' YES ' ) else : print ( ' NO ' ) else : for x in a : two -= x // 2 + x % 2 if two >= 0 : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


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


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; int [ ] a = new int [ k ] ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < k ; i ++ ) a [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; int fourSize = n , twoSize = 2 * n ; Arrays . sort ( a ) ; int one = 0 , two = 0 , three = 0 ; for ( int i = a . length - 1 ; i >= 0 ; i -- ) { if ( a [ i ] >= 4 ) { int countOfFours = a [ i ] / 4 ; int size = Math . min ( countOfFours , fourSize ) ; countOfFours -= size ; fourSize -= size ; if ( countOfFours > 0 ) { size = Math . min ( 2 * countOfFours , twoSize ) ; twoSize -= size ; } int rem = a [ i ] % 4 ; if ( rem == 1 ) one ++ ; else if ( rem == 2 ) { if ( twoSize > 0 ) twoSize -- ; else two ++ ; } else if ( rem == 3 ) three ++ ; } else if ( a [ i ] == 2 ) { if ( twoSize > 0 ) twoSize -- ; else two ++ ; } else if ( a [ i ] == 3 ) three ++ ; else one ++ ; }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayDeque ; import java . util . Arrays ; import java . util . Comparator ; import java . util . Random ; import java . util . StringTokenizer ;   public class Solution { public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { int n = fs . nextInt ( ) , k = fs . nextInt ( ) ; int [ ] have = new int [ 5 ] ; have [ 4 ] = n ; have [ 2 ] = 2 * n ; int [ ] cnt = new int [ 5 ] ; for ( int i = 0 ; i < k ; i ++ ) { int x = fs . nextInt ( ) ; while ( x >= 3 ) { if ( have [ 4 ] > 0 ) { x -= 4 ; have [ 4 ] -- ; } else if ( have [ 2 ] > 0 ) { x -= 2 ; have [ 2 ] -- ; } else { out . println ( " No " ) ; out . flush ( ) ; return ; } } if ( x > 0 ) { cnt [ x ] ++ ; } } while ( cnt [ 2 ] > 0 ) { if ( have [ 2 ] > 0 ) { cnt [ 2 ] -- ; have [ 2 ] -- ; } else if ( have [ 4 ] > 0 ) { cnt [ 2 ] -- ; have [ 4 ] -- ; have [ 1 ] ++ ; } else { cnt [ 2 ] -- ; cnt [ 1 ] += 2 ; } } if ( cnt [ 1 ] > have [ 1 ] + have [ 2 ] + 2 * have [ 4 ] ) { out . println ( " No " ) ; } else { out . println ( " Yes " ) ; } } out . close ( ) ; }    static final Random random = new Random ( ) ; static void ruffleSort ( int [ ] a ) { int n = a . length ;


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ;   public class Main {   public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; int testCases = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < testCases ; i ++ ) { String str [ ] = br . readLine ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( str [ 0 ] ) ; int k = Integer . parseInt ( str [ 1 ] ) ; if ( n == k ) { bw . write ( "1 \n " ) ; } else if ( n > k ) { int aux = ( n / k ) ; if ( k * aux == n ) { bw . write ( "1 \n " ) ; } else { bw . write ( "2 \n " ) ; } } else { int aux = ( k / n ) ; if ( k == n * aux ) { bw . write ( aux + " \n " ) ; } else { bw . write ( ( aux + 1 ) + " \n " ) ; } } } br . close ( ) ; bw . close ( ) ;   }   }

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


import matht = int ( input ( ) ) NEW_LINE while t > 0 : a = input ( ) . split ( ) NEW_LINE n = int ( a [ 0 ] ) NEW_LINE k = int ( a [ 1 ] ) NEW_LINE if k == 1 : NEW_LINE INDENT print ( 1 ) else : NEW_LINE k = math . ceil ( n / k ) * k NEW_LINE DEDENT print ( math . ceil ( k / n ) ) NEW_LINE t -= 1 NEW_LINE


for i in range ( 0 , int ( input ( ) ) ) : n , k = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE c = n // k NEW_LINE if n % k != 0 : c += 1 NEW_LINE s = k * c NEW_LINE if s % n == 0 : NEW_LINE INDENT print ( s // n ) else : NEW_LINE print ( s // n + 1 ) NEW_LINE DEDENT


for _ in range ( int ( input ( ) ) ) : n , k = map ( int , input ( ) . split ( ) ) NEW_LINE if k % n == 0 : NEW_LINE INDENT print ( k // n ) else : NEW_LINE if NEW_LINE DEDENT k > n : print ( k // n + 1 ) else : t = n // k NEW_LINE if n % k != 0 : t = t + 1 NEW_LINE if ( t * k ) % n == 0 : NEW_LINE INDENT print ( ( t * k ) // n ) else : NEW_LINE print ( ( t * k ) // n + 1 ) NEW_LINE DEDENT


t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n , k = map ( int , ( input ( ) . split ( ) ) ) NEW_LINE cf = ( n + k - 1 ) // k NEW_LINE k *= cf NEW_LINE print ( ( k + n - 1 ) // n ) NEW_LINE


import java . util . Scanner ;   public class A1476 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; int reminder = Math . floorMod ( K - N , K ) ; int answer = 1 + ( reminder + N - 1 ) / N ; System . out . println ( answer ) ; } }   }


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


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Main { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } int [ ] na ( int n ) { int ar [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = nextInt ( ) ; } return ar ; } void print ( int ar [ ] ) { for ( int i = 0 ; i < ar . length ; i ++ ) { System . out . print ( ar [ i ] + " ▁ " ) ; } } } public static long gcd ( long a , long b ) { if ( b == 0 ) { return a ; } if ( a == 0 ) { return b ; } return gcd ( b , a % b ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { FastReader sc = new FastReader ( ) ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class C { static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] nextArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } static class FastWriter extends PrintWriter { FastWriter ( ) { super ( System . out ) ; }   void println ( int [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { print ( array [ i ] + " ▁ " ) ; } println ( ) ; }   void println ( long [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { print ( array [ i ] + " ▁ " ) ; } println ( ) ; } } public static void main ( String [ ] args ) {


import java . util . * ; public class B_520 { public static void main ( String [ ] args ) { Scanner omkar = new Scanner ( System . in ) ; int n = omkar . nextInt ( ) ; int m = omkar . nextInt ( ) ; int u = gcd ( m , n ) ; int [ ] b = new int [ n ] ; int [ ] g = new int [ m ] ; int x = omkar . nextInt ( ) ; for ( int i = 0 ; i < x ; i ++ ) { b [ omkar . nextInt ( ) ] = 1 ; } int y = omkar . nextInt ( ) ; for ( int i = 0 ; i < y ; i ++ ) { g [ omkar . nextInt ( ) ] = 1 ; } for ( int i = 0 ; i < u ; i ++ ) { if ( ! test ( b , g , u , i ) ) { System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; } public static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } public static boolean test ( int [ ] b , int [ ] g , int u , int ind ) { for ( int i = ind ; i < b . length ; i += u ) { if ( b [ i ] == 1 ) { return true ; } } for ( int i = ind ; i < g . length ; i += u ) { if ( g [ i ] == 1 ) { return true ; } } return false ; } }

from math import gcdn , m = map ( int , input ( ) . split ( ) ) gcdd = gcd ( n , m ) l = list ( map ( int , input ( ) . split ( ) ) ) ; r = [ 0 ] * gcddfor i in l [ 1 : ] : r [ i % gcdd ] = 1 l1 = list ( map ( int , input ( ) . split ( ) ) ) for j in l1 [ 1 : ] : r [ j % gcdd ] = 1 for i in r : if i == 0 : exit ( print ( " No " ) ) print ( " Yes " ) NEW_LINE


def GCD ( x , y ) : while y != 0 : remainder = x % y x = y y = remainder return x   def LCM ( x , y ) : return x * y // GCD ( x , y )   n , m = map ( int , input ( ) . split ( ) ) b , * boys = list ( map ( int , input ( ) . split ( ) ) ) g , * girls = list ( map ( int , input ( ) . split ( ) ) ) isHappy = [ False ] * ( n + m ) for boy in boys : isHappy [ boy ] = Truefor girl in girls : isHappy [ girl + n ] = True   for i in range ( 2 * LCM ( m , n ) ) : if isHappy [ i % n ] or isHappy [ i % m + n ] : isHappy [ i % n ] = isHappy [ i % m + n ] = True   flag = Truefor check in isHappy : if not check : flag = False breakprint ( " Yes " if flag else " No " ) NEW_LINE


from math import gcdn , m = map ( int , input ( ) . split ( ) ) b = list ( map ( int , input ( ) . split ( ) ) ) g = list ( map ( int , input ( ) . split ( ) ) ) bn , gn = b [ 0 ] , g [ 0 ] hpyb , hpyg = set ( b [ 1 : : ] ) , set ( g [ 1 : : ] ) d = ( n + m ) * n * mfor i in range ( d + 1 ) : boy = i % n girl = i % m if boy in hpyb or girl in hpyg : hpyb . add ( boy ) hpyg . add ( girl ) f = Truefor i in range ( n ) : if i not in hpyb : f = False breakfor i in range ( m ) : if i not in hpyg : f = False breakif not f : print ( " No " ) else : print ( " Yes " ) NEW_LINE


def f ( b , g ) : change = i = j = 0 p = 1 while p or not ( i == 0 and j == 0 ) : if boys [ i ] + girls [ j ] == 1 : if boys [ i ] == 0 : boys [ i ] = 1 change = 1 else : girls [ j ] = 1 change = 1 i = ( i + 1 ) % n j = ( j + 1 ) % m p = 0 return changen , m = map ( int , input ( ) . split ( ) ) b , * x = list ( map ( int , input ( ) . split ( ) ) ) g , * y = list ( map ( int , input ( ) . split ( ) ) ) boys = [ 0 ] * ngirls = [ 0 ] * mchange = 1 for i in x : boys [ i ] = 1 for i in y : girls [ i ] = 1 c = 0 while f ( b , g ) : passif boys . count ( 1 ) + girls . count ( 1 ) == n + m : print ( " Yes " ) else : print ( " No " ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) if len ( l ) == 1 : boys = [ 0 ] * nelse : boys = [ 0 ] * n for i in l [ 1 : ] : boys [ i ] = 1 l1 = list ( map ( int , input ( ) . split ( ) ) ) if len ( l1 ) == 1 : girl = [ 0 ] * melse : girl = [ 0 ] * m for i in l1 [ 1 : ] : girl [ i ] = 1 for i in range ( 10 ** 5 + 1 ) : n1 = i % n ; m1 = i % m 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 long MAX = ( long ) 1e12 ; private static final long MOD = 100000007 ;   private static final int MAXN = 1000003 ; private static final int MAXA = 2000007 ; private static final int MAXLOG = 22 ; private static final double PI = Math . acos ( - 1 ) ; public static void main ( String [ ] args ) throws IOException {   InputReader in = new InputReader ( System . in ) ;


import java . util . Scanner ;   public class Main { public static Scanner scan = new Scanner ( System . in ) ;   public static void DrazilAndHisHappyFriends ( ) { int n = scan . nextInt ( ) ; int m = scan . nextInt ( ) ; boolean [ ] boys = new boolean [ n ] ; boolean [ ] girls = new boolean [ m ] ;   int happy_boys = scan . nextInt ( ) ; while ( happy_boys -- > 0 ) { boys [ scan . nextInt ( ) ] = true ; } int happy_girls = scan . nextInt ( ) ; while ( happy_girls -- > 0 ) { girls [ scan . nextInt ( ) ] = true ; } for ( int i = 0 ; i < ( n + m ) * n * m ; i ++ ) { if ( boys [ i % n ] || girls [ i % m ] ) { boys [ i % n ] = girls [ i % m ] = true ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( ! boys [ i ] ) { System . out . println ( " No " ) ; return ; } } for ( int i = 0 ; i < m ; i ++ ) { if ( ! girls [ i ] ) { System . out . println ( " No " ) ; return ; } } System . out . println ( " Yes " ) ; }   public static void main ( String [ ] args ) { DrazilAndHisHappyFriends ( ) ; } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ;   public class DrazilAndHisHappyFriends { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] input = br . readLine ( ) . split ( " ▁ " ) ; int boys = Integer . parseInt ( input [ 0 ] ) ; int girls = Integer . parseInt ( input [ 1 ] ) ; int gcd = calcGCD ( boys , girls ) ; if ( gcd == 1 ) { System . out . println ( " Yes " ) ; } else { input = br . readLine ( ) . split ( " ▁ " ) ; int [ ] happyBoys = new int [ input . length ] ; for ( int i = 0 ; i < input . length ; i ++ ) { happyBoys [ i ] = Integer . parseInt ( input [ i ] ) ; } input = br . readLine ( ) . split ( " ▁ " ) ; int [ ] happyGirls = new int [ input . length ] ; for ( int i = 0 ; i < input . length ; i ++ ) { happyGirls [ i ] = Integer . parseInt ( input [ i ] ) ; } for ( int i = 0 ; i < gcd ; i ++ ) { boolean found = false ; for ( int j = 0 ; j < happyBoys [ 0 ] ; j ++ ) { if ( ( happyBoys [ j + 1 ] - i ) % gcd == 0 ) { found = true ; } } for ( int j = 0 ; j < happyGirls [ 0 ] ; j ++ ) { if ( ( happyGirls [ j + 1 ] - i ) % gcd == 0 ) { found = true ; } } if ( ! found ) { System . out . println ( " No " ) ; System . exit ( 0 ) ; } } System . out . println ( " Yes " ) ; } } public static int calcGCD ( int x , int y ) { if ( x == 0 ) { return y ; } else if ( y == 0 ) { return x ; } else { if ( x >= y ) { return calcGCD ( x % y , y ) ; } else { return calcGCD ( y % x , x ) ; } } } }


from math import gcdn , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) d = 0f or i in range ( 1 , n ) : d = gcd ( d , abs ( a [ i ] - a [ i - 1 ] ) ) ans = [ gcd ( d , a [ 0 ] + elm ) for elm in b ] print ( * ans )

import sys   input = lambda : sys . stdin . readline ( ) . rstrip ( " \n " ) NEW_LINE from math import sqrt , ceil , gcd     n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE b = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE t = a [ 0 ] NEW_LINE for i in range ( n ) : a [ i ] -= tans = 0 NEW_LINE


from math import gcdn , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE b = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE d = 0 NEW_LINE for i in range ( 1 , n ) : d = gcd ( d , abs ( a [ i ] - a [ i - 1 ] ) ) NEW_LINE ans = [ gcd ( d , a [ 0 ] + elm ) for elm in b ] NEW_LINE print ( * ans ) NEW_LINE


n , m = tuple ( map ( int , input ( ) . split ( ) ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE b = list ( map ( int , input ( ) . split ( ) ) )   NEW_LINE def gcd ( a , b ) : while NEW_LINE b : a , b = b , a % b NEW_LINE return a   temp = 0 NEW_LINE for i in range ( 1 , len ( a ) ) : temp = gcd ( temp , abs ( a [ i ] - a [ i - 1 ] ) )   for i in range ( len ( b ) ) : print ( gcd ( b [ i ] + a [ 0 ] , temp ) , end = ' ▁ ' ) NEW_LINE


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


import java . io . * ; import java . lang . * ; import java . util . * ; import java . io . * ; import java . util . * ; public class Main { static Scanner scanner = new Scanner ( System . in ) ; static Set < Long > set = new HashSet < Long > ( ) ; static int a [ ] ; static long b [ ] ; public static void main ( String [ ] args ) { int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; long a1 = scanner . nextLong ( ) ; long s = 0 ; for ( int i = 1 ; i < n ; i ++ ) { s = gcd ( s , Math . abs ( scanner . nextLong ( ) - a1 ) ) ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < m ; i ++ ) { sb . append ( gcd ( s , a1 + scanner . nextLong ( ) ) + " ▁ " ) ; } System . out . println ( sb ) ; } static long gcd ( long gcd , long l ) { if ( l == 0 ) return gcd ; else return gcd ( l , gcd % l ) ; } }


import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ;


import sys , os , ioimport math , bisect , operatorinf , mod = float ( ' inf ' ) , 10 * * 9 + 7 # sys . setrecursionlimit ( 10 * * 6 ) from itertools import groupby , accumulatefrom heapq import heapify , heappop , heappushfrom collections import deque , Counter , defaultdictinput = iter ( sys . stdin . buffer . read ( ) . decode ( ) . splitlines ( ) ) . __next__Neo = lambda : list ( map ( int , input ( ) . split ( ) ) ) # test , = Neo ( ) n , m = Neo ( ) A = Neo ( ) B = Neo ( ) A . sort ( ) for i in range ( 1 , n ) : A [ i ] -= A [ 0 ] if n == 1 : for i in B : print ( i + A [ 0 ] , end = ' ▁ ' ) else : gcd = A [ 1 ] for i in range ( 1 , n ) : gcd = math . gcd ( gcd , A [ i ] ) for i in B : t = math . gcd ( gcd , A [ 0 ] + i ) print ( t , end = ' ▁ ' )


import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner puttingvaluesinside = new Scanner ( System . in ) ; int n = puttingvaluesinside . nextInt ( ) ; if ( n == 1 ) { if ( puttingvaluesinside . nextInt ( ) == 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } else { int count = 0 ; while ( n -- > 0 ) { if ( puttingvaluesinside . nextInt ( ) == 0 ) count ++ ; } if ( count == 1 ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) if n == 1 and a [ 0 ] == 1 or n > 1 and a . count ( 0 ) == 1 : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) )   cnt = a . count ( 1 ) if n == 1 : if cnt == 1 : print ( ' YES ' ) else : print ( ' NO ' ) elif n > 1 : if cnt == n - 1 : print ( ' YES ' ) else : print ( ' NO ' )   NEW_LINE


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


import java . util . Scanner ;   public class acmTest5 { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int [ ] nums = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { nums [ i ] = scan . nextInt ( ) ; }   System . out . println ( getRes ( nums ) ) ; }   public static String getRes ( int [ ] nums ) { if ( nums . length == 1 && nums [ 0 ] == 1 ) { return " YES " ; } if ( nums . length == 1 && nums [ 0 ] == 0 ) { return " NO " ; } int res = 0 ; for ( int i = 0 ; i < nums . length ; i ++ ) { if ( nums [ i ] == 0 ) { res ++ ; } } return res == 1 ? " YES " : " NO " ; }   }


import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ;   public class Problem1042B { static long finalCost = Long . MAX_VALUE ;   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; Map < String , Integer > vitaminCostMap = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int cost = s . nextInt ( ) ; char arr [ ] = s . next ( ) . toCharArray ( ) ; Arrays . sort ( arr ) ; vitaminCostMap . computeIfPresent ( new String ( arr ) , ( k , val ) -> Math . min ( val , cost ) ) ; vitaminCostMap . computeIfAbsent ( new String ( arr ) , ( k ) -> cost ) ; } int [ ] finalCostArr = new int [ 7 ] ; String [ ] vitaminArr = new String [ 7 ] ; int size = 0 ; for ( Map . Entry < String , Integer > entry : vitaminCostMap . entrySet ( ) ) { finalCostArr [ size ] = entry . getValue ( ) ; vitaminArr [ size ] = entry . getKey ( ) ; size ++ ; }   getFinalCost ( finalCostArr , size , 0 , " " , 0 , vitaminArr ) ; System . out . println ( finalCost == Long . MAX_VALUE ? - 1 : finalCost ) ; }   private static void getFinalCost ( int [ ] finalCostArr , int size , int ind , String currentVitamins , int currentVitaminCost , String [ ] vitaminArr ) { if ( ind >= size ) { if ( currentVitamins . contains ( " A " ) && currentVitamins . contains ( " B " ) && currentVitamins . contains ( " C " ) ) finalCost = Math . min ( currentVitaminCost , finalCost ) ; return ; } getFinalCost ( finalCostArr , size , ind + 1 , currentVitamins + vitaminArr [ ind ] , currentVitaminCost + finalCostArr [ ind ] , vitaminArr ) ; getFinalCost ( finalCostArr , size , ind + 1 , currentVitamins , currentVitaminCost , vitaminArr ) ;   }   }

""" practice ▁ mode """ n = int ( input ( ) ) m = float ( " inf " ) d = { " A " : m , " B " : m , " C " : m , " AB " : m , " BC " : m , " AC " : m , " ABC " : m } ans = mfor i in range ( n ) : a , b = input ( ) . split ( ) a = int ( a ) b = " " . join ( sorted ( list ( b ) ) ) d [ b ] = min ( d [ b ] , a ) NEW_LINE


t = int ( input ( ) ) price = [ 0 ] + [ 10 ** 9 ] * 7 for _ in range ( t ) : c , s = input ( ) . split ( ) c = int ( c )   a = sum ( [ 1 << ( ord ( x ) - ord ( ' A ' ) ) for x in s ] ) for i in range ( 8 ) : price [ i | a ] = min ( price [ i | a ] , price [ i ] + c ) if price [ - 1 ] == 10 ** 9 : print ( - 1 ) else : print ( price [ - 1 ] ) NEW_LINE


n = int ( input ( ) ) dp = [ 10 ** 18 ] * 8 dp [ 0 ] = 0 for i in range ( n ) : c , s = input ( ) . split ( " ▁ " ) s = list ( s ) x = 0 if " A " in s : x += 1 if " B " in s : x += 2 if " C " in s : x += 4 c = int ( c ) for i in range ( 8 ) : y = 0 for j in range ( 3 ) : if ( i >> j ) & 1 == 1 or ( x >> j ) & 1 == 1 : y += 2 ** j dp [ y ] = min ( dp [ i ] + c , dp [ y ] ) if dp [ 7 ] == 10 ** 18 : print ( - 1 ) else : print ( dp [ 7 ] ) NEW_LINE


n = int ( input ( ) ) d = { " A " : float ( " inf " ) , " B " : float ( " inf " ) , " C " : float ( " inf " ) , " AB " : float ( " inf " ) , " AC " : float ( " inf " ) , " BC " : float ( " inf " ) , " ABC " : float ( " inf " ) } for _ in range ( n ) : cost , vits = input ( ) . split ( ) cost = int ( cost ) if ( len ( vits ) == 1 ) : if ( d [ vits ] > cost ) : d [ vits ] = cost elif ( len ( vits ) == 2 ) : if ( " A " in vits and " B " in vits ) : if ( d [ " AB " ] > cost ) : d [ " AB " ] = cost elif ( " A " in vits and " C " in vits ) : if ( d [ " AC " ] > cost ) : d [ " AC " ] = cost else : if ( d [ " BC " ] > cost ) : d [ " BC " ] = cost else : if ( d [ " ABC " ] > cost ) : d [ " ABC " ] = cost val = min ( d [ " A " ] + d [ " B " ] + d [ " C " ] , d [ " A " ] + d [ " BC " ] , d [ " B " ] + d [ " AC " ] , d [ " C " ] + d [ " AB " ] , d [ " AB " ] + d [ " AC " ] , d [ " AB " ] + d [ " BC " ] , d [ " AC " ] + d [ " BC " ] , d [ " ABC " ] ) if ( val == float ( " inf " ) ) : print ( - 1 ) else : print ( val ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;   public class First { public static boolean func ( String x , String y ) { boolean a = false , b = false , c = false ; if ( ( x . indexOf ( ' A ' ) != - 1 ) || ( y . indexOf ( ' A ' ) != - 1 ) ) { a = true ; } if ( ( x . indexOf ( ' B ' ) != - 1 ) || ( y . indexOf ( ' B ' ) != - 1 ) ) { b = true ; } if ( ( x . indexOf ( ' C ' ) != - 1 ) || ( y . indexOf ( ' C ' ) != - 1 ) ) { c = true ; } if ( a && b && c ) { return true ; } return false ; } public static void process ( ) throws IOException { int n = ni ( ) ; int [ ] price = new int [ n ] ; String [ ] vit = new String [ n ] ;      for ( int i = 0 ; i < n ; i ++ ) { String [ ] x = nln ( ) . trim ( ) . split ( " ▁ " ) ; price [ i ] = Integer . parseInt ( x [ 0 ] ) ; vit [ i ] = x [ 1 ] ; }


import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i < n + 1 ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } int min = 0 , dis = 100 ; for ( int i = 1 ; i < n + 1 ; i ++ ) { if ( a [ i ] == 0 ) { continue ; } else { if ( k >= a [ i ] ) { if ( m > i ) { min = m - i ; } else { min = i - m ; } } else { continue ; } } dis = Math . min ( dis , min ) ; } System . out . println ( dis * 10 ) ; } }

n , m , k = [ int ( x ) for x in input ( ) . split ( ) ] m -= 1 houses = [ int ( x ) for x in input ( ) . split ( ) ]   will_buy = - 1 house_away = nfor i in range ( n ) : price = houses [ i ] this_away = abs ( i - m ) if ( price != 0 and k >= price and this_away <= house_away ) : will_buy = i house_away = this_away   print ( 10 * ( abs ( will_buy - m ) ) ) NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) houses = [ int ( i ) for i in input ( ) . split ( ) ] frwd , bcwd = 999 , - 999   for i in range ( m , n ) : if 0 < houses [ i ] <= k : frwd = i + 1 break   for i in range ( m - 2 , - 1 , - 1 ) : if 0 < houses [ i ] <= k : bcwd = i + 1 break   print ( min ( frwd - m , m - bcwd ) * 10 ) NEW_LINE


""" # ▁ Do ▁ not ▁ remove ▁ the ▁ below ▁ import ▁ statementimport ▁ sys  ''' This ▁ function ▁ provides ▁ the ▁ capacity , ▁ size ▁ and ▁ space ▁ left ▁ in ▁ the ▁ list . You ▁ can ▁ invoke ▁ it ▁ to ▁ get ▁ the ▁ details ▁ of ▁ the ▁ list '''   def ▁ list _ details ( lst ) : ▁ ▁ ▁ ▁ # ▁ Number ▁ of ▁ elements ▁ that ▁ can ▁ be ▁ stored ▁ in ▁ the ▁ list ▁ ▁ ▁ ▁ print ( " Capacity : " , ▁ ( sys . getsizeof ( lst ) -36 ) / /4 )   ▁ ▁ ▁ ▁ # ▁ Number ▁ of ▁ elements ▁ in ▁ the ▁ list ▁ ▁ ▁ ▁ print ( " Size : " , ▁ len ( lst ) )   ▁ ▁ ▁ ▁ # ▁ Number ▁ of ▁ elements ▁ that ▁ can ▁ be ▁ accommodated ▁ in ▁ the ▁ space ▁ left ▁ ▁ ▁ ▁ print ( " Space ▁ Left : " , ▁ ( ( sys . getsizeof ( lst ) -36 ) ▁ - ▁ len ( lst * 4 ) ) / / 4 )   ▁ ▁ ▁ ▁ # ▁ formula ▁ changes ▁ based ▁ on ▁ the ▁ system ▁ architecture ▁ ▁ ▁ ▁ # ▁ ( size - 36 ) / 4 ▁ for ▁ 32 ▁ bit ▁ machines ▁ and ▁ ▁ ▁ ▁ # ▁ ( size - 64 ) / 8 ▁ for ▁ 64 ▁ bit ▁ machines  ▁ ▁ ▁ ▁ # ▁ 36 , ▁ 64 ▁ - ▁ size ▁ of ▁ an ▁ empty ▁ list ▁ based ▁ on ▁ machine ▁ ▁ ▁ ▁ # ▁ 4 , ▁ 8 ▁ - ▁ size ▁ of ▁ a ▁ single ▁ element ▁ in ▁ the ▁ list ▁ based ▁ on ▁ machine  marias _ lst ▁ = ▁ [ ] for ▁ i ▁ in ▁ range ( 1500 ) : ▁ ▁ ▁ ▁ marias _ lst . append ( i ) print ( " Empty ▁ list ▁ created ! ! ! " ) print ( " List ▁ details : " ) list _ details ( marias _ lst ) marias _ lst . append ( 1 ) marias _ lst . append ( 2 ) print ( marias _ lst ) """ n , m , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) mind = len ( l ) - 1 for i in range ( len ( l ) ) : if i != m - 1 and 0 < l [ i ] <= k and abs ( i - m + 1 ) < mind : mind = abs ( i - m + 1 ) print ( mind * 10 ) NEW_LINE


n , m , k = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) min_d = float ( ' inf ' ) for i in range ( n ) : if l [ i ] <= k and l [ i ] != 0 : if abs ( ( ( m - 1 ) - i ) * 10 ) < min_d : min_d = abs ( ( ( m - 1 ) - i ) * 10 ) print ( min_d ) NEW_LINE


import sys   def main ( ) : n , m , k , * l = map ( int , sys . stdin . read ( ) . strip ( ) . split ( ) ) return min ( abs ( i - m ) for i , j in enumerate ( l , 1 ) if j and k >= j ) * 10 print ( main ( ) ) NEW_LINE


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int k = s . nextInt ( ) ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = s . nextInt ( ) ; m = m - 1 ; int min = Integer . MAX_VALUE , min1 = Integer . MAX_VALUE ; for ( int j = 0 ; j < m ; j ++ ) { if ( k >= a [ j ] && a [ j ] != 0 ) { if ( ( m - j ) < min ) min = m - j ; } } for ( int j1 = m + 1 ; j1 < n ; j1 ++ ) { if ( k >= a [ j1 ] && a [ j1 ] != 0 ) { if ( ( j1 - m ) < min1 ) min1 = j1 - m ; } } int p = Math . min ( min , min1 ) ; System . out . println ( p * 10 ) ; } }


import java . io . * ; import java . util . * ; import javax . print . attribute . standard . Finishings ;   import java . math . * ;   public class Exam { 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 {


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

k = int ( input ( ) ) mod = 10 ** 9 + 7 f = [ 0 ] * ( 10 ** 6 + 1 ) f [ 0 ] = f [ 1 ] = 1 for i in range ( 2 , 10 ** 6 + 1 ) : f [ i ] = ( f [ i - 1 ] * i ) % moddef comb ( n , r ) : return ( f [ n ] * pow ( f [ r ] , mod - 2 , mod ) * pow ( f [ n - r ] , mod - 2 , mod ) ) % modans = 1 cc = int ( input ( ) ) for i in range ( 1 , k ) : c = int ( input ( ) ) cc += c ans *= comb ( cc - 1 , c - 1 ) ans %= modprint ( ans ) NEW_LINE


from sys import stdin , stdoutfrom collections import Counternmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) M = 10 ** 9 + 7 fact = [ 1 ] for i in range ( 1 , 1005 ) : fact += [ ( fact [ - 1 ] * i ) % M ] def ncr ( n , r ) : num = fact [ n ] den = ( fact [ r ] * fact [ n - r ] ) % M ans = ( num * pow ( den , M - 2 , M ) ) % M return ansfor _ in range ( 1 ) : NEW_LINE


t = int ( input ( ) ) c = 1 s = int ( input ( ) ) for _ in range ( t - 1 ) : n = int ( input ( ) ) s += n   k = 1 for i in range ( 1 , n ) : k = k * ( s - i ) // i c = ( c * k ) % ( 10 ** 9 + 7 ) print ( c ) NEW_LINE


''' ▁ ▁ ▁ ▁ Auther : ▁ ghoshashis545 ▁ Ashis ▁ Ghosh ▁ ▁ ▁ ▁ College : ▁ jalpaiguri ▁ Govt ▁ Enggineering ▁ College  ''' from os import pathfrom io import BytesIO , IOBaseimport sysfrom heapq import heappush , heappopfrom functools import cmp_to_key as ctkfrom collections import deque , Counter , defaultdict as dd from bisect import bisect , bisect_left , bisect_right , insort , insort_left , insort_rightfrom itertools import permutationsfrom datetime import datetimefrom math import ceil , sqrt , log , gcddef ii ( ) : return int ( input ( ) ) def si ( ) : return input ( ) . rstrip ( ) def mi ( ) : return map ( int , input ( ) . split ( ) ) def li ( ) : return list ( mi ( ) ) abc = ' abcdefghijklmnopqrstuvwxyz ' mod = 1000000007 NEW_LINE


from sys import stdinc = [ [ 0 ] * 1002 for _ in range ( 0 , 1002 ) ] MOD = int ( 1e9 + 7 )   for i in range ( 0 , 1002 ) : c [ i ] [ 0 ] = c [ i ] [ i ] = 1 for j in range ( 0 , i ) : c [ i ] [ j ] = ( c [ i - 1 ] [ j - 1 ] + c [ i - 1 ] [ j ] ) % MOD   r = map ( int , stdin . read ( ) . split ( ) )   n = next ( r ) ans = 1 sum = 0   for _ in range ( 0 , n ) : x = next ( r ) ans = ( ans * c [ sum + x - 1 ] [ sum ] ) % MOD sum += x   print ( ans ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class CF0553A_KyoyaAndColoredBalls { static class Scanner { BufferedReader br ; StringTokenizer st ;   public Scanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; }   }   static int max ( int a , int b ) { return Math . max ( a , b ) ; }   static int min ( int a , int b ) { return Math . min ( a , b ) ; }   static void print ( Object b ) { System . out . print ( b ) ; }   static void println ( Object b ) { System . out . println ( b ) ; }   static void println ( ) { System . out . println ( ) ; }   public static void main ( String [ ] args ) {


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


import java . io . * ; import java . util . * ;   public class ColoredBalls { public static int mod = 1000000007 ; public static int MAXN = 1010 ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out , true ) ; long [ ] [ ] comb = new long [ MAXN ] [ MAXN ] ; comb [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i < MAXN ; i ++ ) { comb [ i ] [ 0 ] = 1 ; for ( int j = 1 ; j <= i ; j ++ ) { comb [ i ] [ j ] = ( comb [ i - 1 ] [ j ] + comb [ i - 1 ] [ j - 1 ] ) % mod ; } } int K = in . nextInt ( ) ; int [ ] color = new int [ K ] ; for ( int i = 0 ; i < K ; i ++ ) color [ i ] = in . nextInt ( ) ; long res = 1 ; int total = 0 ; for ( int i = 0 ; i < K ; i ++ ) { res = ( res * comb [ total + color [ i ] - 1 ] [ color [ i ] - 1 ] ) % mod ; total += color [ i ] ; } out . println ( res ) ; out . close ( ) ; System . exit ( 0 ) ; } }


import java . util . Scanner ;   public class Draw { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i , x = 0 , y = 0 , o = 1 ;   for ( i = 0 ; i < n ; i ++ ) { int a = in . nextInt ( ) , b = in . nextInt ( ) ; o += Math . max ( 0 , Math . min ( a , b ) - Math . max ( x , y ) + ( x != y ? 1 : 0 ) ) ; x = a ; y = b ; } in . close ( ) ; System . out . println ( o ) ; } }

n = int ( input ( ) ) a , b = 0 , 0 ; ans = 1 for _ in range ( n ) : p , q = map ( int , input ( ) . split ( ) ) ; temp = 0 if a != b : temp = 1 if min ( p , q ) - max ( a , b ) + temp >= 0 : ans += min ( p , q ) - max ( a , b ) + temp a , b = p , qprint ( ans ) NEW_LINE


import sysfrom collections import dequeimport mathinput_ = lambda : sys . stdin . readline ( ) . strip ( " \n " ) ii = lambda : int ( input_ ( ) ) il = lambda : list ( map ( int , input_ ( ) . split ( ) ) ) ilf = lambda : list ( map ( float , input_ ( ) . split ( ) ) ) ip = lambda : input_ ( ) fi = lambda : float ( input_ ( ) ) li = lambda : list ( input_ ( ) ) pr = lambda x : print ( x ) f = lambda : sys . stdout . flush ( )   n = ii ( )   ans = 1 p1 = p2 = 0   for i in range ( n ) : x , y = il ( ) ans += max ( 0 , min ( x , y ) - max ( p1 , p2 ) + 1 ) if ( ( p1 == p2 ) and ans > 0 ) : ans -= 1 p1 , p2 = x , y   print ( ans ) NEW_LINE


import sysimport bisectfrom random import randintinput = lambda : sys . stdin . readline ( ) . strip ( " \n " ) from math import gcdsa = lambda : input ( ) sb = lambda : int ( input ( ) ) sc = lambda : input ( ) . split ( ) sd = lambda : list ( map ( int , input ( ) . split ( ) ) ) se = lambda : float ( input ( ) ) sf = lambda : list ( input ( ) ) flsh = lambda : sys . stdout . flush ( ) mod = 10 ** 9 + 7 def hnbhai ( ) : n = sb ( ) x , y = 0 , 0 ans = [ [ 0 , 0 ] ] for i in range ( n ) : a , b = sd ( ) ans . append ( [ a , b ] ) t = 1 for i in range ( 1 , n + 1 ) : t += max ( 0 , min ( ans [ i ] [ 0 ] , ans [ i ] [ 1 ] ) - max ( ans [ i - 1 ] [ 0 ] , ans [ i - 1 ] [ 1 ] ) + 1 ) if t > 0 and ans [ i - 1 ] [ 0 ] == ans [ i - 1 ] [ 1 ] : t -= 1 print ( t ) for _ in range ( 1 ) : hnbhai ( ) NEW_LINE


n = int ( input ( ) ) arr = [ ] for _ in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) arr . append ( [ a , b ] ) ans = min ( arr [ 0 ] ) + 1 for i in range ( n - 1 ) : if max ( arr [ i ] ) <= min ( arr [ i + 1 ] ) : if arr [ i ] [ 0 ] == arr [ i ] [ 1 ] : ans -= 1 ans += min ( arr [ i + 1 ] ) - max ( arr [ i ] ) + 1 print ( ans ) NEW_LINE


from sys import stdin , stdoutinput = stdin . readline def main ( ) : n = int ( input ( ) ) preva = prevb = - 1 ans = 0 for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) if preva != prevb : ans += max ( 0 , min ( a , b ) - max ( preva , prevb ) + 1 ) else : ans += max ( 0 , min ( a , b ) - max ( preva , prevb ) ) preva , prevb = a , b print ( ans ) main ( )   NEW_LINE


import java . util . * ; import java . io . * ; public class Main { static FastScanner sc = new FastScanner ( System . in ) ; static PrintWriter pw = new PrintWriter ( System . out ) ; static StringBuilder sb = new StringBuilder ( ) ; public static void main ( String [ ] args ) throws Exception { int n = sc . nextInt ( ) ; int a = 0 ; int b = 0 ; int bar = - 1 ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int na = sc . nextInt ( ) ; int nb = sc . nextInt ( ) ; ans += Math . max ( 0 , Math . min ( na , nb ) - Math . max ( Math . max ( b , a ) - 1 , bar ) ) ; a = na ; b = nb ; bar = Math . min ( a , b ) ;


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


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Ideone { public static void main ( String [ ] args ) throws java . lang . Exception { int [ ] [ ] mat = { { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 } ,