import java . util . Scanner ;   public class Main { public static boolean judge ( int k , int arr [ ] [ ] , int m ) { for ( int i = 0 ; i < m ; i ++ ) { int t = arr [ i ] [ 0 ] % k ; if ( t == 0 ) { if ( arr [ i ] [ 0 ] / k != arr [ i ] [ 1 ] ) { return false ; } } else { if ( arr [ i ] [ 0 ] / k + 1 != arr [ i ] [ 1 ] ) { return false ; } } } return true ; } public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String s [ ] = scanner . nextLine ( ) . split ( " ▁ " ) ; int n = Integer . parseInt ( s [ 0 ] ) ; int m = Integer . parseInt ( s [ 1 ] ) ; int arr [ ] [ ] = new int [ m ] [ 2 ] ; for ( int i = 0 ; i < m ; i ++ ) { s = scanner . nextLine ( ) . split ( " ▁ " ) ; arr [ i ] [ 0 ] = Integer . parseInt ( s [ 0 ] ) ; arr [ i ] [ 1 ] = Integer . parseInt ( s [ 1 ] ) ; } int res = 0 ; for ( int i = 1 ; i <= 100 ; i ++ ) { if ( judge ( i , arr , m ) ) { int temp = n % i == 0 ? n / i : n / i + 1 ; if ( res == 0 ) { res = temp ; } else if ( temp != res ) { System . out . println ( - 1 ) ; return ; } } } if ( res == 0 ) res = - 1 ; System . out . println ( res ) ; }   }

t = 1   for qwe in range ( t ) : NEW_LINE


n , m = [ int ( i ) for i in input ( ) . split ( ) ] a = [ ] for i in range ( m ) : k , l = [ int ( i ) for i in input ( ) . split ( ) ] a . append ( [ k , l ] ) b = set ( ) for x in range ( 1 , 105 ) : for i in range ( len ( a ) ) : q = ( a [ i ] [ 1 ] - 1 ) * x + 1 e = a [ i ] [ 1 ] * x if a [ i ] [ 0 ] < q or a [ i ] [ 0 ] > e : break else : b . add ( ( n + x - 1 ) // x ) if len ( b ) > 1 : print ( - 1 ) else : print ( * b ) NEW_LINE


import java . util . Scanner ; import java . util . * ;   public class Solution {   public static void main ( String [ ] args ) { boolean debug = false ;   Scanner input = new Scanner ( System . in ) ;   int n = input . nextInt ( ) ; int m = input . nextInt ( ) ;   FlatToFloor [ ] flats = new FlatToFloor [ m + 1 ] ;   for ( int i = 1 ; i <= m ; i ++ ) { flats [ i ] = new FlatToFloor ( input . nextInt ( ) , input . nextInt ( ) ) ; }   int ans = - 1 ; int cf = - 1 ; int cf2 = - 1 ; int countOkay = 0 ; for ( int j = 1 ; j <= 100 ; j ++ ) { boolean ok = true ; for ( int i = 1 ; i <= m ; i ++ ) {


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . TreeSet ;    public class vk18 { public static void main ( String [ ] stp ) throws Exception { Scanner scan = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) , m = Integer . parseInt ( st . nextToken ( ) ) , i , j , flat = 0 , floor = 0 ; Pair [ ] pair = new Pair [ m ] ; TreeSet < Integer > ts = new TreeSet < > ( ) ; for ( i = 0 ; i < m ; i ++ ) { st = new StringTokenizer ( br . readLine ( ) ) ; pair [ i ] = new Pair ( Integer . parseInt ( st . nextToken ( ) ) , Integer . parseInt ( st . nextToken ( ) ) ) ; } for ( i = 1 ; i <= 100 ; i ++ ) { boolean flag = true ; for ( j = 0 ; j < m ; j ++ ) { floor = ( pair [ j ] . d + i - 1 ) / i ; if ( floor != pair [ j ] . g ) { flag = false ; break ; } } if ( flag ) { ts . add ( ( int ) ( ( n + i - 1 ) / i ) ) ; if ( ts . size ( ) > 1 ) { pw . println ( - 1 ) ; pw . flush ( ) ; System . exit ( 0 ) ; } } } pw . println ( ts . pollFirst ( ) ) ; pw . flush ( ) ; } static class Pair implements Comparable < Pair > { int d , g ; public Pair ( int d , int g ) { this . d = d ; this . g = g ; } public int compareTo ( Pair p ) { return - Integer . compare ( this . d , p . d ) ; } }    }


import java . util . * ; import java . io . * ; import java . math . * ;     public class B {   private static long INF = 2000000000000000000L , M = 1000000007 , MM = 998244353 ; private static int N = 0 ;   public static void process ( ) throws IOException {   int a = sc . nextInt ( ) , b = sc . nextInt ( ) , curr = sc . nextInt ( ) ; String str = sc . next ( ) ; int i = str . length ( ) - 2 ; Deque < Integer > q = new LinkedList < Integer > ( ) ; while ( i >= 0 ) { if ( q . isEmpty ( ) ) { int cc = str . charAt ( i ) - ' A ' ; if ( cc == 0 ) { if ( curr >= a ) { q . add ( cc ) ; i -- ; curr -= a ; } else { break ; } } else { if ( curr >= b ) { q . add ( cc ) ; curr -= b ; i -- ; } else break ; } continue ; } int prev = q . peekLast ( ) ; int cc = str . charAt ( i ) - ' A ' ; if ( prev == cc ) { i -- ; continue ; } if ( cc == 0 ) { if ( curr >= a ) { q . add ( cc ) ; i -- ; curr -= a ; } else { break ; } } else { if ( curr >= b ) { q . add ( cc ) ; curr -= b ; i -- ; } else break ; } } if ( i == - 1 ) System . out . println ( 1 ) ; else { System . out . println ( i + 2 ) ; }   }

for _ in range ( int ( input ( ) ) ) : a , b , c = map ( int , input ( ) . split ( ) ) s = input ( )   n = len ( s ) j = n for i in range ( n - 2 , - 1 , - 1 ) : if s [ i ] != s [ i + 1 ] or i == n - 2 : if s [ i ] == " A " : c -= a else : c -= b if c >= 0 : j -= 1 else : break print ( j ) NEW_LINE


import sys , collections , math , itertools , random , bisectINF = sys . maxsizedef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_array ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def input ( ) : return sys . stdin . readline ( ) . strip ( ) mod = int ( 1e9 + 7 )   for _ in range ( int ( input ( ) ) ) : a , b , p = get_ints ( ) s = input ( ) sz = len ( s ) sum = 0 while sum <= p and sz > 0 : sz -= 1 if sz == len ( s ) - 1 or s [ sz - 1 ] != s [ sz ] : if s [ sz - 1 ] == ' A ' : sum += a else : sum += b print ( sz + 1 ) NEW_LINE


for t in range ( int ( input ( ) ) ) : a , b , p = map ( int , input ( ) . split ( ) ) s = list ( input ( ) ) n = len ( s ) if ( p < a and p < b ) : print ( n ) continue dp = [ 0 ] * n st = [ ] exc = 0 loc = [ ] for i in range ( n ) : if ( i == 0 ) : if ( s [ i ] == ' A ' ) : dp [ 0 ] = a else : dp [ 0 ] = b st . append ( s [ i ] ) elif ( st [ - 1 ] == s [ i ] ) : dp [ i ] = dp [ i - 1 ] + exc exc = 0 else : loc . append ( i ) st . pop ( 0 ) st . append ( s [ i ] ) dp [ i ] = dp [ i - 1 ] + exc if ( st [ 0 ] == ' A ' ) : exc = a else : exc = b if ( dp [ - 1 ] <= p ) : print ( 1 ) continue for j in loc : if ( dp [ - 1 ] - dp [ j ] <= p ) : print ( j + 1 ) break else : print ( n ) NEW_LINE


I = inputfor _ in [ 0 ] * int ( I ( ) ) : * a , p = map ( int , I ( ) . split ( ) ) ; s = I ( ) ; i = len ( s ) - 2 ; j = s [ i ] > ' A ' while - i < 1 > a [ j ] - p : p -= a [ j ] ; j ^= 1 ; i = s . rfind ( ' AB ' [ j ] , 0 , i ) print ( i + 2 ) NEW_LINE


from sys import stdin , stdoutnmbr = lambda : int ( input ( ) ) lst = lambda : list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( nmbr ( ) ) : a , b , cc = lst ( ) s = input ( ) n = len ( s ) dp = [ 0 ] * n dp [ n - 2 ] = b if s [ n - 2 ] == ' B ' else a for i in range ( n - 3 , - 1 , - 1 ) : dp [ i ] = dp [ i + 1 ] if s [ i ] != s [ i + 1 ] : if s [ i ] == ' A ' : dp [ i ] += a else : dp [ i ] += b ans = n for i in range ( n ) : if dp [ i ] <= cc : ans = i + 1 break print ( ans ) NEW_LINE


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . * ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ;


import java . util . * ; import java . io . * ; import java . math . * ;   public class First { public static void process ( ) throws IOException { int a = ni ( ) ; int b = ni ( ) ; int p = ni ( ) ; String s = nln ( ) ; char ch [ ] = s . toCharArray ( ) ; int n = ch . length ; int index = n - 1 ; int cost = 0 ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( i == 0 ) { int x = ( ch [ i ] == ' A ' ) ? a : b ; if ( cost + x <= p ) { index = i ; } } else { int x = ( ch [ i ] == ' A ' ) ? a : b ; if ( ch [ i ] == ch [ i - 1 ] ) { continue ; } else { if ( cost + x > p ) { break ; } else if ( cost + x <= p ) { index = i ; cost += x ; } } } } pn ( index + 1 ) ;   }    static AnotherReader sc ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { out = new PrintWriter ( System . out ) ; sc = new AnotherReader ( ) ; boolean oj = true ;


import java . io . BufferedReader ; import java . io . File ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . InputStreamReader ; import java . nio . file . Paths ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Main1 {   public Main1 ( ) throws FileNotFoundException {

t = int ( input ( ) ) r = [ ] for i in range ( t ) : b = [ ] d = [ ] n = int ( input ( ) ) for j in range ( n ) : a = list ( map ( int , input ( ) . split ( ) ) ) b . append ( a [ 0 ] ) d . append ( a [ 1 ] ) if b [ 0 ] < d [ 0 ] : r . append ( " NO " ) else : p = [ x - b [ i - 1 ] for i , x in enumerate ( b ) if i > 0 ] c = [ x - d [ i - 1 ] for i , x in enumerate ( d ) if i > 0 ] s1 = sum ( 1 for number in p if number < 0 ) s2 = sum ( 1 for number in c if number < 0 ) if s1 != 0 or s2 != 0 : r . append ( " NO " ) else : q = 0 for j in range ( n - 1 ) : if p [ j ] != c [ j ] : if p [ j ] < c [ j ] : q = q + 1 if q != 0 : r . append ( " NO " ) else : r . append ( " YES " ) for i in range ( len ( r ) ) : print ( r [ i ] ) NEW_LINE


for i in range ( int ( input ( ) ) ) : count = 0 for j in range ( int ( input ( ) ) ) : play , clear = map ( int , input ( ) . split ( ) ) if ( clear > play ) : play1 = play clear1 = clear count = 1 continue if ( j == 0 ) : play1 = play clear1 = clear continue else : if ( play < play1 ) : count = 1 play1 = play clear1 = clear continue elif ( clear < clear1 ) : count = 1 play1 = play clear1 = clear continue elif ( ( play - play1 ) < ( clear - clear1 ) ) : count = 1 play1 = play clear1 = clear continue else : play1 = play clear1 = clear if ( count == 1 ) : print ( " No " ) else : print ( " Yes " ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) p0 , c0 = 0 , 0 res = True for i in range ( 100 ) : h = p0 + c0 for i in range ( n ) : p , c = map ( int , input ( ) . split ( ) ) ap , ac , p0 , c0 = p - p0 , c - c0 , p , c res = res and ap >= ac and ac >= 0 and ap >= 0 print ( " YES " if res else " NO " ) NEW_LINE


t = int ( input ( ) ) for j in range ( t ) : n = int ( input ( ) ) kol = [ ] f , g = map ( int , input ( ) . split ( ) ) kol . append ( [ f , g ] ) flag = 0 if g > f : print ( ' NO ' ) flag = 1 for i in range ( n - 1 ) : p , c = map ( int , input ( ) . split ( ) ) kol . append ( [ p , c ] )   if ( c > p or kol [ i ] [ 0 ] > p or kol [ i ] [ 1 ] > c or p - kol [ i ] [ 0 ] < c - kol [ i ] [ 1 ] ) and flag == 0 : print ( ' NO ' ) flag = 1 if flag == 0 : print ( ' YES ' ) NEW_LINE


I = inputfor _ in [ 0 ] * int ( I ( ) ) : x = y = 0 ; f = 1 for _ in [ 0 ] * int ( I ( ) ) : p , c = map ( int , I ( ) . split ( ) ) ; f &= 0 <= c - y <= p - x ; x = p ; y = c print ( ' NYOE ▁ S ' [ f : : 2 ] ) NEW_LINE


import java . awt . Desktop ;    import java . io . BufferedReader ;    import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . net . URI ; import java . net . URISyntaxException ; import java . sql . Array ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Iterator ; import java . util . LinkedHashMap ; import java . util . LinkedHashSet ; import java . util . LinkedList ; import java . util . List ; import java . util . Map ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Scanner ; import java . util . Set ; import java . util . Stack ; import java . util . StringTokenizer ; import java . util . TreeSet ; import java . util . Vector ;     public class codechef3 { static class comp implements Comparator < Integer > {   @ Override public int compare ( Integer o1 , Integer o2 ) { if ( Math . abs ( o1 ) > Math . abs ( o2 ) ) return - 1 ; else return 1 ; } }


import java . io . * ; import java . util . * ; public class levelstatistics { public static void main ( String [ ] args ) throws IOException { BufferedReader f = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( f . readLine ( ) ) ; int t = Integer . parseInt ( st . nextToken ( ) ) ; while ( t > 0 ) { t -- ; int n = Integer . parseInt ( f . readLine ( ) ) ; int plays = 0 ; int clears = 0 ; boolean yes = true ; for ( int i = 0 ; i < n ; i ++ ) { st = new StringTokenizer ( f . readLine ( ) ) ; int nextPlays = Integer . parseInt ( st . nextToken ( ) ) ; int nextClears = Integer . parseInt ( st . nextToken ( ) ) ; if ( nextPlays - plays < nextClears - clears ) { yes = false ; } if ( nextPlays < plays || nextClears < clears ) { yes = false ; } plays = nextPlays ; clears = nextClears ; } if ( yes ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }


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

s = input ( ) x1 , y1 = s . count ( "7" ) , s . count ( "4" ) if x1 == 0 and y1 == 0 : print ( " - 1" )   elif x1 > y1 : print ( "7" ) else : print ( "4" ) NEW_LINE


a = input ( ) count4 = 0 count7 = 0 for i in a : if i == '4' : count4 += 1 if i == '7' : count7 += 1   if count4 == 0 and count7 == 0 : print ( - 1 ) else : if count4 >= count7 : print ( 4 ) else : print ( 7 ) NEW_LINE


n = ( input ( ) ) a = b = 0 a = n . count ( '4' ) b = n . count ( '7' ) if a == 0 and b == 0 : print ( - 1 ) elif a == b : print ( 4 ) elif a == 0 and b == 0 : print ( - 1 ) else : if a > b : print ( 4 ) else : print ( 7 ) NEW_LINE


s = input ( ) s4 = s . count ( '4' ) s7 = s . count ( '7' ) if s4 == 0 and s7 == 0 : print ( ' - 1' ) elif s4 < s7 : print ( '7' ) elif s4 > s7 : print ( '4' ) else : print ( '4' ) NEW_LINE


s = input ( )   if '4' not in s and '7' not in s : print ( - 1 ) else : if s . count ( '4' ) >= s . count ( '7' ) : print ( 4 ) else : print ( 7 ) NEW_LINE


import java . util . Scanner ;   public class LuckySubstring { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int a4 = 0 , a7 = 0 , i ; in . close ( ) ;   for ( i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == '4' ) a4 ++ ; if ( s . charAt ( i ) == '7' ) a7 ++ ; } System . out . println ( a4 + a7 > 0 ? a4 >= a7 ? 4 : 7 : - 1 ) ; } }


import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; String s = in . next ( ) ; int c4 = 0 , c7 = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == '4' ) c4 ++ ; else if ( s . charAt ( i ) == '7' ) c7 ++ ; } if ( c4 == 0 && c7 == 0 ) System . out . println ( " - 1" ) ; else if ( c7 > c4 ) System . out . println ( "7" ) ; else System . out . println ( "4" ) ; } }


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


import java . util . * ; public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int tt = sc . nextInt ( ) ; while ( tt -- > 0 ) { int l = sc . nextInt ( ) , c = sc . nextInt ( ) ; int al [ ] = new int [ l ] ; for ( int i = 0 ; i < l ; i ++ ) al [ i ] = sc . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < c ; i ++ ) { int x = sc . nextInt ( ) ; if ( Arrays . binarySearch ( al , x ) >= 0 ) count ++ ; } System . out . println ( count ) ; }

for _ in range ( int ( input ( ) ) ) : map ( int , input ( ) . split ( ) ) NEW_LINE print ( len ( set ( map ( int , input ( ) . split ( ) ) ) . intersection ( set ( map ( int , input ( ) . split ( ) ) ) ) ) ) NEW_LINE


t = int ( input ( ) )   for tc in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE bottom = [ int ( b ) for b in input ( ) . split ( ) ] NEW_LINE left = [ int ( l ) for l in input ( ) . split ( ) ]   print ( len ( bottom + left ) - len ( set ( bottom + left ) ) )   NEW_LINE


for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE x = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE l = set ( l ) NEW_LINE x = set ( x ) NEW_LINE z = l | x NEW_LINE print ( abs ( len ( z ) - ( n + m ) ) ) NEW_LINE


for i in range ( int ( input ( ) ) ) : input ( ) NEW_LINE n , m , count = input ( ) . split ( " ▁ " ) , input ( ) . split ( " ▁ " ) , 0 NEW_LINE if len ( n ) >= len ( m ) : for NEW_LINE i in m : NEW_LINE if i in n : NEW_LINE INDENT count += 1 else : NEW_LINE for NEW_LINE DEDENT i in n : NEW_LINE if i in m : count += 1 NEW_LINE print ( count ) NEW_LINE


import java . io . * ; import java . util . * ;   public class A {   public static void main ( String [ ] args ) throws FileNotFoundException { FastScanner fs = new FastScanner ( ) ; FastOutput fo = new FastOutput ( ) ; long initial_time = System . currentTimeMillis ( ) ; int testcases = fs . nextInt ( ) ; for ( int tt = 0 ; tt < testcases ; tt ++ ) {


import java . util . * ; import java . math . * ;   public class gfg { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int z = 1 ; z <= t ; z ++ ) { int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] b = new int [ n ] ; int [ ] l = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) b [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < m ; i ++ ) l [ i ] = sc . nextInt ( ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( Arrays . binarySearch ( l , b [ i ] ) >= 0 ) count ++ ; } System . out . println ( count ) ; } } }


import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ;   public class A1453 {   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 M = in . nextInt ( ) ; Set < Integer > set = new HashSet < > ( ) ; for ( int n = 0 ; n < N ; n ++ ) { int train = in . nextInt ( ) ; set . add ( train ) ; } int answer = 0 ; for ( int m = 0 ; m < M ; m ++ ) { int train = in . nextInt ( ) ; if ( set . contains ( train ) ) { answer ++ ; } } System . out . println ( answer ) ; } }   }


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


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

n , m = map ( int , input ( ) . split ( ) ) grid = [ list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ] ans = [ ] if m > n : for i in range ( n ) : mini = min ( grid [ i ] ) for j in range ( m ) : grid [ i ] [ j ] -= mini for _ in range ( mini ) : ans . append ( " row ▁ " + str ( i + 1 ) ) for i in range ( m ) : mini = float ( ' inf ' ) for j in range ( n ) : mini = min ( grid [ j ] [ i ] , mini ) for j in range ( n ) : grid [ j ] [ i ] -= mini for _ in range ( mini ) : ans . append ( " col ▁ " + str ( i + 1 ) ) else : for i in range ( m ) : mini = float ( ' inf ' ) for j in range ( n ) : mini = min ( grid [ j ] [ i ] , mini ) for j in range ( n ) : grid [ j ] [ i ] -= mini for _ in range ( mini ) : ans . append ( " col ▁ " + str ( i + 1 ) ) for i in range ( n ) : mini = min ( grid [ i ] ) for j in range ( m ) : grid [ i ] [ j ] -= mini for _ in range ( mini ) : ans . append ( " row ▁ " + str ( i + 1 ) ) if all ( [ sum ( i ) == 0 for i in grid ] ) : print ( len ( ans ) ) for i in ans : print ( i ) else : print ( - 1 ) NEW_LINE


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

import sys   inp = sys . stdin . readlines ( ) ; ii = 0   out = [ ]   t = int ( inp [ ii ] ) ii += 1   a = inp [ ii ] ii += 1 b = inp [ ii ] ii += 1   x , y = 0 , 0 for i in range ( t ) : if ( a [ i ] == '1' and b [ i ] == '0' ) : y += 1 if ( a [ i ] == '0' and b [ i ] == '0' ) : x += 1   sys . stdout . write ( str ( ( x * a . count ( '1' ) + ( a . count ( '0' ) - x ) * y ) ) )               NEW_LINE


n = int ( input ( ) ) a = input ( ) b = input ( ) x = 0 y = 0 z = 0 for i in range ( n ) : if ( b [ i ] == '0' ) : if ( a [ i ] == '1' ) : x += 1 else : y += 1 else : if ( a [ i ] == '1' ) : z += 1 print ( y * z + x * a . count ( '0' ) ) NEW_LINE


n = int ( input ( ) ) s = input ( ) r = input ( ) l = 0 z = 0 for i in range ( len ( s ) ) : if ( s [ i ] == '1' and r [ i ] == '0' ) : l += 1 if ( s [ i ] == '0' and r [ i ] == '0' ) : z += 1 print ( z * s . count ( '1' ) + ( s . count ( '0' ) - z ) * l ) NEW_LINE


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


import java . util . * ;   public class CodeForces1017B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; String a = input . next ( ) ; String b = input . next ( ) ; int [ ] sum = new int [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { sum [ a . charAt ( i ) - '0' ] ++ ; }   long count = 0 ; long one = 0 ; long zero = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( b . charAt ( i ) == '0' ) { if ( a . charAt ( i ) == '0' ) { count += sum [ 1 ] - one ; zero ++ ; } else { count += sum [ 0 ] - zero ; one ++ ; } } } System . out . println ( count ) ;   } }


import java . math . * ; import java . util . * ; import java . lang . * ; import java . io . * ;       public class CodeChef {    public static void main ( String [ ] args ) throws IOException {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; long a1 = 0 , a0 = 0 , b1 = 0 , b0 = 0 ; String sr = br . readLine ( ) ; String ss = br . readLine ( ) ; long count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( sr . charAt ( i ) == '1' ) { a1 ++ ; if ( ss . charAt ( i ) == '1' ) b1 ++ ; } if ( sr . charAt ( i ) == '0' ) { a0 ++ ; if ( ss . charAt ( i ) == '0' ) b0 ++ ; }   } count += a1 * b0 ; count += ( a1 - b1 ) * ( a0 - b0 ) ; System . out . println ( count ) ;   }   }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Scanner ;   public class B {   public static void main ( String [ ] srgs ) { Scanner nik = new Scanner ( System . in ) ;   int n = nik . nextInt ( ) ; HashMap < String , Long > ht = new HashMap < > ( ) ;   String s = nik . next ( ) ; String s1 = nik . next ( ) ;   for ( int i = 0 ; i < n ; i ++ ) { String temp = s . charAt ( i ) + " $ " + s1 . charAt ( i ) ; ht . put ( temp , ht . getOrDefault ( temp , 0L ) + 1 ) ; }   long res = 0 ; for ( String val : ht . keySet ( ) ) {   long g = ht . get ( val ) ; if ( val . endsWith ( "0 $ 0" ) ) {   long g1 = ht . getOrDefault ( "1 $ 0" , 0L ) ; long g2 = ht . getOrDefault ( "1 $ 1" , 0L ) ; res += ( g1 * g ) ; res += ( g2 * g ) ; }   if ( val . endsWith ( "0 $ 1" ) ) { long g1 = ht . getOrDefault ( "1 $ 0" , 0L ) ; res += ( g1 * g ) ; } } System . out . println ( res ) ; } }


import java . util . Scanner ;   public class TheBits { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i ; String a = in . next ( ) , b = in . next ( ) ; in . close ( ) ; long z = 0 , oz = 0 , oo = 0 , zz = 0 ; for ( i = 0 ; i < n ; i ++ ) {   if ( a . charAt ( i ) == '0' ) z ++ ; if ( a . charAt ( i ) == '1' && b . charAt ( i ) == '0' ) oz ++ ; if ( a . charAt ( i ) == '1' && b . charAt ( i ) == '1' ) oo ++ ; if ( a . charAt ( i ) == '0' && b . charAt ( i ) == '0' ) zz ++ ; } System . out . println ( oo * zz + oz * z ) ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Stack ;   public class ABCString_1494A { public static boolean isBalanced ( StringBuilder sb ) { Stack < Character > stk = new Stack < > ( ) ; stk . add ( sb . charAt ( 0 ) ) ; for ( int i = 1 ; i < sb . length ( ) ; i ++ ) {   char c = sb . charAt ( i ) ; if ( c == ' ) ' ) { if ( ! stk . empty ( ) && stk . lastElement ( ) == ' ( ' ) { stk . pop ( ) ; continue ; } } stk . add ( c ) ; } return stk . empty ( ) ; }   public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { String a = br . readLine ( ) ; final int len = a . length ( ) ; if ( a . charAt ( 0 ) == a . charAt ( len - 1 ) ) System . out . println ( " NO " ) ; else { char start = a . charAt ( 0 ) ; char end = a . charAt ( len - 1 ) ; StringBuilder sb1 = new StringBuilder ( ) ; StringBuilder sb2 = new StringBuilder ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = a . charAt ( i ) ; if ( c == start ) { sb1 . append ( ' ( ' ) ; sb2 . append ( ' ( ' ) ; } else if ( c == end ) { sb1 . append ( ' ) ' ) ; sb2 . append ( ' ) ' ) ; } else { sb1 . append ( ' ( ' ) ; sb2 . append ( ' ) ' ) ; } } if ( isBalanced ( sb1 ) || isBalanced ( sb2 ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }

for _ in range ( int ( input ( ) ) ) : s = input ( ) NEW_LINE x1 , x2 , x3 = 0 , 0 , 0 NEW_LINE c1 , c2 , c3 = True , True , True NEW_LINE nc1 , nc2 , nc3 = True , True , True NEW_LINE for i in s : if NEW_LINE i == ' A ' : x1 += 1 elif i == ' B ' : x2 += 1 elif i == ' C ' : x3 += 1   c3 = c3 & ( x1 + x2 >= x3 ) NEW_LINE c2 = c2 & ( x1 + x3 >= x2 ) NEW_LINE c1 = c1 & ( x2 + x3 >= x1 ) NEW_LINE nc3 = nc3 & ( x1 + x2 <= x3 ) NEW_LINE nc2 = nc2 & ( x1 + x3 <= x2 ) NEW_LINE nc1 = nc1 & ( x2 + x3 <= x1 ) NEW_LINE if x1 + x2 == x3 : if NEW_LINE c3 : print ( " YES " ) elif nc3 : print ( " YES " ) else : print ( " NO " )   elif x1 + x3 == x2 : NEW_LINE if c2 : NEW_LINE INDENT print ( " YES " ) elif nc2 : NEW_LINE print ( " YES " ) else : NEW_LINE print ( " NO " )   elif x2 + x3 == x1 : NEW_LINE DEDENT if c1 : NEW_LINE INDENT print ( " YES " ) elif nc1 : NEW_LINE print ( " YES " ) else : NEW_LINE print ( " NO " ) else : print ( " NO " )   NEW_LINE DEDENT


for test in range ( int ( input ( ) ) ) : s = input ( ) NEW_LINE n = len ( s ) NEW_LINE a = [ ' ( ' , ' ) ' ] NEW_LINE ans = " NO " NEW_LINE for i in range ( 2 ) : for NEW_LINE j in range ( 2 ) : NEW_LINE for q in range ( 2 ) : s1 = s NEW_LINE s1 = s1 . replace ( ' A ' , a [ i ] ) NEW_LINE s1 = s1 . replace ( ' B ' , a [ j ] ) NEW_LINE s1 = s1 . replace ( ' C ' , a [ q ] ) NEW_LINE b = 0 NEW_LINE for p in range ( n ) : if NEW_LINE s1 [ p ] == ' ( ' : b += 1 else : b -= 1 NEW_LINE if b < 0 : break NEW_LINE if b == 0 : ans = " YES " NEW_LINE print ( ans ) NEW_LINE


T_ON = 1 NEW_LINE DEBUG_ON = 0 NEW_LINE MOD = 998244353     NEW_LINE def solve ( ) : s = input ( ) NEW_LINE n = len ( s ) NEW_LINE G = Counter ( s ) NEW_LINE MAX = max ( G . values ( ) ) NEW_LINE if MAX != n // 2 : NO ( ) NEW_LINE return MAX_CH = ' ' NEW_LINE for k , v in G . items ( ) : if NEW_LINE v == MAX : MAX_CH = k NEW_LINE count = 0 NEW_LINE for c in s : if NEW_LINE c == s [ 0 ] : count += 1 NEW_LINE continue NEW_LINE if s [ 0 ] == MAX_CH : NEW_LINE INDENT count -= 1 elif c == MAX_CH : NEW_LINE count -= 1 else : NEW_LINE count += 1 NEW_LINE DEDENT if count < 0 : NO ( ) NEW_LINE return YES ( )     NEW_LINE def main ( ) : T = read_int ( ) if T_ON else 1 NEW_LINE for i in range ( T ) : solve ( )     NEW_LINE def debug ( * xargs ) : if NEW_LINE DEBUG_ON : print ( * xargs )     from collections import * NEW_LINE import NEW_LINE INDENT math     NEW_LINE DEDENT


tcs = int ( input ( ) ) NEW_LINE l = [ [ - 1 , - 1 , 1 ] , [ - 1 , 1 , - 1 ] , [ - 1 , 1 , 1 ] , [ 1 , - 1 , - 1 ] , [ 1 , - 1 , 1 ] , [ 1 , 1 , - 1 ] ]   for tc in range ( tcs ) : s = input ( ) NEW_LINE for j in l : cnt = 0 NEW_LINE p = 1 NEW_LINE for i in s : cnt += j [ ord ( i ) - 65 ] NEW_LINE if cnt < 0 : p = 0 NEW_LINE if p == 1 and cnt == 0 : print ( " YES " ) NEW_LINE break else : print ( " NO " ) NEW_LINE


import java . util . Scanner ;   public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = Integer . parseInt ( sc . nextLine ( ) ) ; for ( ; t > 0 ; t -- ) { String a = sc . nextLine ( ) ; int n = a . length ( ) ; if ( a . charAt ( 0 ) == a . charAt ( n - 1 ) ) { System . out . println ( " NO " ) ; continue ; } int [ ] countChars = new int [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { char letra = a . charAt ( i ) ; countChars [ letra - 65 ] ++ ; } char [ ] equivalencias = new char [ 3 ] ; equivalencias [ a . charAt ( 0 ) - 65 ] = ' ( ' ; equivalencias [ a . charAt ( n - 1 ) - 65 ] = ' ) ' ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( equivalencias [ i ] == 0 ) { if ( countChars [ a . charAt ( 0 ) - 65 ] > countChars [ a . charAt ( n - 1 ) - 65 ] ) equivalencias [ i ] = ' ) ' ; else equivalencias [ i ] = ' ( ' ; } } int contador = 0 ; for ( int i = 0 ; i < n ; i ++ ) { char letra = a . charAt ( i ) ; if ( equivalencias [ letra - 65 ] == ' ( ' ) contador ++ ; else -- contador ; if ( contador < 0 ) break ; } System . out . println ( ( contador == 0 ? " YES " : " NO " ) ) ; } } }


import java . util . Scanner ;   public class A1494 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; char [ ] [ ] variants = new char [ ] [ ] { { ' ) ' , ' ) ' , ' ) ' } , { ' ) ' , ' ) ' , ' ( ' } , { ' ) ' , ' ( ' , ' ) ' } , { ' ) ' , ' ( ' , ' ( ' } , { ' ( ' , ' ) ' , ' ) ' } , { ' ( ' , ' ) ' , ' ( ' } , { ' ( ' , ' ( ' , ' ) ' } , { ' ( ' , ' ( ' , ' ( ' } , } ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { char [ ] S = in . next ( ) . toCharArray ( ) ; boolean ok = false ; for ( char [ ] variant : variants ) { ok |= isValid ( S , variant ) ; } System . out . println ( ok ? " YES " : " NO " ) ; } }   static boolean isValid ( char [ ] S , char [ ] variant ) { int count = 0 ; for ( char c : S ) { char bracket = variant [ c - ' A ' ] ; if ( bracket == ' ) ' ) { count -- ; } else { count ++ ; } if ( count < 0 ) { return false ; } } return ( count == 0 ) ; }   }


import java . util . Scanner ;   public class source { public static void main ( String [ ] args ) { int n ; try ( Scanner s = new Scanner ( System . in ) ) { n = s . nextInt ( ) ; } String s = Integer . toHexString ( n ) . toUpperCase ( ) ; int k = 0 ; for ( char c : s . toCharArray ( ) ) { switch ( c ) { case '0' : case '4' : case '6' : case '9' : case ' A ' : case ' D ' : k ++ ; break ; case '8' : case ' B ' : k += 2 ; break ; } } System . out . println ( k ) ; } }

o = [ '0' , '4' , '6' , '9' , ' a ' , ' d ' ] oo = [ '8' , ' b ' ] cnt = 0 n = list ( hex ( int ( input ( ) ) ) ) x = ' ' for i in range ( 2 , len ( n ) ) : x += n [ i ] x = str ( x ) for j in x : if j in o : cnt += 1 elif j in oo : cnt += 2 print ( cnt ) NEW_LINE


a = int ( input ( ) ) b = str ( hex ( a ) ) . upper ( ) l = list ( b ) count = - 1 for i in l : if ( i == '8' or i == ' B ' ) : count += 2 continue if ( i == '0' or i == '4' or i == '6' or i == '9' or i == ' A ' or i == ' D ' ) : count += 1 continueif ( count < 0 ) : count = 0 print ( count ) NEW_LINE


n = int ( input ( ) ) a = hex ( n ) b = ( a [ 2 : : ] ) . upper ( ) count = 0 for i in b : if i == '4' or i == '6' or i == '9' or i == '0' or i == ' A ' or i == ' D ' : count += 1 elif i == '8' or i == ' B ' : count += 2 print ( count ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import static java . lang . System . in ; import java . lang . reflect . Array ; import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . AbstractList ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import static java . util . Collections . list ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . LinkedHashSet ; import java . util . List ; import java . util . Map ; import java . util . Scanner ; import java . util . Set ; import java . util . stream . Collectors ; import java . util . stream . IntStream ; import javax . xml . stream . events . Characters ;       public class main { public static boolean isPrime ( long n ) { if ( n < 2 ) return false ; if ( n == 2 || n == 3 ) return true ; if ( n % 2 == 0 || n % 3 == 0 ) return false ; long sqrtN = ( long ) Math . sqrt ( n ) + 1 ; for ( long i = 6L ; i <= sqrtN ; i += 6 ) { if ( n % ( i - 1 ) == 0 || n % ( i + 1 ) == 0 ) return false ; } return true ; }   private static long f ( long l ) { throw new UnsupportedOperationException ( " Not ▁ supported ▁ yet . " ) ;


import java . io . Reader ; import java . util . InputMismatchException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . BufferedReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . io . Writer ; import java . io . IOException ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; FastPrinter out = new FastPrinter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } }   class TaskB { public void solve ( int testNumber , FastScanner in , FastPrinter out ) { int n = in . nextInt ( ) ; int [ ] a = in . readIntArray ( n ) ; long ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; if ( x > 2 * a [ i ] || x == 1 ) { -- ans ; } else { ans += ( long ) ( x / 2 ) * ( ( x + 1 ) / 2 ) ; } } out . println ( ans ) ; } }   class FastScanner extends BufferedReader {   public FastScanner ( InputStream is ) { super ( new InputStreamReader ( is ) ) ; }   public int read ( ) { try { int ret = super . read ( ) ;

import mathn = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) result = 0 for i in range ( n ) : if b [ i ] < 2 or b [ i ] > 2 * a [ i ] : result -= 1 else : result += math . floor ( b [ i ] / 2 ) * math . ceil ( b [ i ] / 2 ) print ( result )                                                         NEW_LINE


n , a , b = input ( ) , map ( int , input ( ) . split ( ) ) , map ( int , input ( ) . split ( ) ) print ( sum ( ( y // 2 ) * ( y - y // 2 ) if y > 1 and 2 * x >= y else - 1 for x , y in zip ( a , b ) ) ) NEW_LINE


n , a , b = input ( ) , map ( int , input ( ) . split ( ) ) , map ( int , input ( ) . split ( ) )   print ( sum ( ( y // 2 ) * ( y - y // 2 ) if y > 1 and 2 * x >= y else - 1 for x , y in zip ( a , b ) ) )       NEW_LINE


import java . io . * ; import java . util . * ; public class b { public static void main ( String [ ] args ) throws IOException { input . init ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = input . nextInt ( ) ; int [ ] as = new int [ n ] , bs = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) as [ i ] = input . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) bs [ i ] = input . nextInt ( ) ; long res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( as [ i ] + as [ i ] < bs [ i ] || bs [ i ] == 1 ) res -- ; else { int a = bs [ i ] / 2 , b = bs [ i ] - a ; if ( b > as [ i ] ) { b = as [ i ] ; a = bs [ i ] - as [ i ] ; } res += ( long ) a * b ; } } out . println ( res ) ; out . close ( ) ; }   public static class input { static BufferedReader reader ; static StringTokenizer tokenizer ;   static void init ( InputStream input ) { reader = new BufferedReader ( new InputStreamReader ( input ) ) ; tokenizer = new StringTokenizer ( " " ) ; }   static String next ( ) throws IOException { while ( ! tokenizer . hasMoreTokens ( ) ) tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; return tokenizer . nextToken ( ) ; }   static int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   static double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; }   static long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } } }


import java . util . Scanner ;   public class bagsofpotato { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int y = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int n = sc . nextInt ( ) ;   int top = n - y ; int x = k - y % k ;   if ( x <= top ) { System . out . print ( x + " ▁ " ) ; x = x + k ; while ( x <= top ) { System . out . print ( x + " ▁ " ) ; x = x + k ; } } else System . out . println ( - 1 ) ; } }

y , k , n = map ( int , input ( ) . split ( ) ) c = int ( y // k ) + 1 if y >= n or c * k not in range ( y , n + 1 ) : print ( - 1 ) else : c = int ( y // k ) + 1 arr = [ x - y for x in range ( c * k , n + 1 , k ) ] print ( * arr ) NEW_LINE


y , k , n = map ( int , input ( ) . split ( ) ) flag = Truefor i in range ( y + ( k - ( y % k ) ) , n + 1 , k ) : print ( i - y , end = ' ▁ ' ) flag = Falseif flag : print ( - 1 ) NEW_LINE


y , k , n = map ( int , input ( ) . split ( ) ) print ( - 1 ) if len ( [ print ( i - y , end = ' ▁ ' ) for i in range ( y + ( k - ( y % k ) ) , n + 1 , k ) ] ) == 0 else print ( ' ' )     NEW_LINE


y , k , n = list ( map ( int , input ( ) . split ( ) ) )     if y == k : count = 0 elif y > k : count = ( ( y // k + 1 ) * k ) - yelse : count = k - y     if y >= n : print ( - 1 ) else : if y + count > n : print ( - 1 ) else :   while y + count <= n : if count == 0 : count += k continue print ( count , end = " ▁ " ) count += k     NEW_LINE


y , k , n = map ( int , input ( ) . split ( ) ) x = k - y % kif x + y > n : print ( ' - 1' ) while x + y <= n : print ( x ) x += k NEW_LINE


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


import java . util . Scanner ;   public class P239A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long y = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; long n = sc . nextLong ( ) ; if ( y >= n ) { System . out . println ( - 1 ) ; System . exit ( 0 ) ; } long x = k - y % k , l = 0 ; while ( x + y <= n ) { System . out . print ( x + " ▁ " ) ; x += k ; l = 1 ; } System . out . println ( l == 0 ? - 1 : " " ) ; } }


import java . util . * ; public class TwoBagsOfPotatoes { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int y = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; sc . close ( ) ; boolean falg = false ; int start = y / k + 1 ; for ( int i = start ; i <= n / k ; i ++ ) { falg = true ; System . out . print ( ( k * i - y ) + " ▁ " ) ; } if ( ! falg ) System . out . println ( - 1 ) ; } }


import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . util . TreeMap ; import java . util . TreeSet ;    public class Main {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; long l = input . nextInt ( ) , r = input . nextInt ( ) , x = input . nextInt ( ) , y = input . nextInt ( ) , k = input . nextInt ( ) ; for ( long i = x ; i <= y ; i ++ ) { if ( i * k >= l && i * k <= r ) { System . out . println ( " YES " ) ; return ; } } System . out . println ( " NO " ) ; } }

l , r , x , y , k = map ( int , input ( ) . split ( ) ) check = Trueif ( x * k > r or y * k < l ) : print ( " NO " ) else : for i in range ( x , y + 1 ) : if ( k * i <= r and k * i >= l ) : check = False break if ( check == True ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


l , r , x , y , k = ( int ( x ) for x in input ( ) . split ( ) ) for i in range ( x , y + 1 ) : if k * i <= r and k * i >= l : print ( " YES " ) exit ( 0 ) print ( " NO " ) NEW_LINE


import sysdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) l , r , x , y , k = minput ( ) answer = " NO " for i in range ( x , y + 1 ) : if l <= i * k <= r : answer = " YES " breakprint ( answer ) NEW_LINE


l , r , x , y , k = map ( int , input ( ) . split ( ) ) for i in range ( x , y + 1 ) : if i * k <= r and i * k >= l : print ( " YES " ) breakelse : print ( " NO " ) NEW_LINE


l , r , x , y , k = [ int ( a ) for a in input ( ) . split ( ) ] i = lj = xs = 0 while ( i <= r and j <= y ) : d = ( i / j ) if ( d == k ) : s = 1 break elif ( d < k ) : i = i + 1 else : j = j + 1 if ( s ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import sun . text . resources . fr . FormatData_fr ;   import java . io . * ; import java . math . BigInteger ; import java . util . * ;   public class Main { static class FastScanner {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class test { public static void main ( String ... args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int l = Integer . parseInt ( st . nextToken ( ) ) ; int r = Integer . parseInt ( st . nextToken ( ) ) ; int x = Integer . parseInt ( st . nextToken ( ) ) ; int y = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; int a = k ; int b = 1 ; while ( a <= r && b <= y ) { if ( a >= l && b >= x ) { System . out . println ( " YES " ) ; return ; } else { b ++ ; a = k * b ; } } System . out . println ( " NO " ) ; } }


import java . util . * ;   public class CodeForces842A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int l = input . nextInt ( ) ; int r = input . nextInt ( ) ; int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; int k = input . nextInt ( ) ; long c = 1 ; for ( int i = x ; i <= y ; i ++ ) { c = ( long ) k * i ; if ( c >= l && c <= r ) {


import java . util . * ;   public class Monster { public static void main ( String [ ] args ) { int a = 2 ;

def fun ( ls , lt ) : a , b = ls c , d = lt st = set ( ) for i in range ( 1 , 101 ) : first = b + ( i - 1 ) * a st . add ( first )   for i in range ( 1 , 101 ) : second = d + ( i - 1 ) * c if ( second in st ) : print ( second ) return print ( - 1 )   NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) c , d = map ( int , input ( ) . split ( ) ) s = set ( ) for i in range ( 101 ) : s . add ( b + a * i ) for i in range ( 101 ) : if d + ( c * i ) in s : print ( d + ( c * i ) ) ; exit ( ) print ( - 1 ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) c , d = map ( int , input ( ) . split ( ) ) for i in range ( 10 ** 5 + 1 ) : x = b + ( a * i ) if x >= d and ( x - d ) % c == 0 : print ( x ) ; exit ( ) print ( - 1 ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) c , d = map ( int , input ( ) . split ( ) )   for i in range ( 101 ) : for j in range ( 101 ) : if a * i + b == c * j + d : print ( a * i + b ) exit ( ) print ( - 1 ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) c , d = map ( int , input ( ) . split ( ) ) ans = " - 1" while b < 100000 : if b == d : ans = b break elif b > d : d += c else : b += aprint ( ans ) NEW_LINE


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


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 . Arrays ; import java . util . Scanner ;   public class Test {   public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; long x [ ] = new long [ 3 ] ; x [ 0 ] = in . nextLong ( ) ; x [ 1 ] = in . nextLong ( ) ; x [ 2 ] = in . nextLong ( ) ; Arrays . sort ( x ) ; long k = in . nextLong ( ) ; if ( x [ 0 ] == x [ 1 ] && x [ 1 ] == x [ 2 ] && x [ 2 ] == 1 ) { System . out . println ( 1 ) ; return ; } long a = Math . min ( x [ 0 ] - 1 , k / 3 ) ; long b = Math . min ( x [ 1 ] - 1 , k / 3 ) ; long c = Math . min ( x [ 2 ] - 1 , k / 3 ) ; k = k - a - b - c ; if ( k == 0 ) { System . out . println ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) ; } else { if ( b == x [ 1 ] - 1 ) { c += Math . min ( k , x [ 2 ] - 1 - c ) ; } else { long d = Math . min ( k / 2 , x [ 1 ] - 1 - b ) ; b += d ; k -= d ; c += Math . min ( k , x [ 2 ] - 1 - c ) ; } System . out . println ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) ; } } }

I = lambda : map ( int , input ( ) . split ( ) ) NEW_LINE x , y , z , k = I ( ) NEW_LINE a1 , a2 , a3 , q = 0 , 0 , 0 , 0 NEW_LINE while q < 3 : q = 0 NEW_LINE if a1 + a2 + a3 == k : break NEW_LINE if a1 < x - 1 : a1 += 1 NEW_LINE if a1 + a2 + a3 == k : NEW_LINE INDENT break else : NEW_LINE q += 1 NEW_LINE DEDENT if a2 < y - 1 : a2 += 1 NEW_LINE if a1 + a2 + a3 == k : NEW_LINE INDENT break else : NEW_LINE q += 1 NEW_LINE DEDENT if a3 < z - 1 : a3 += 1 NEW_LINE if a1 + a2 + a3 == k : NEW_LINE INDENT break else : NEW_LINE q += 1 NEW_LINE DEDENT print ( ( a1 + 1 ) * ( a2 + 1 ) * ( a3 + 1 ) ) NEW_LINE


x , y , z , k = map ( int , input ( ) . split ( ) )   x , y , z = sorted ( ( x , y , z ) )   a = min ( k // 3 , x - 1 )   b = min ( ( k - a ) // 2 , y - 1 )   c = min ( k - a - b , z - 1 )   print ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) NEW_LINE


xyzk = [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE k = xyzk [ 3 ] NEW_LINE x , y , z = sorted ( [ xyzk [ 0 ] , xyzk [ 1 ] , xyzk [ 2 ] ] ) NEW_LINE x = min ( k // 3 + 1 , x ) NEW_LINE y = min ( ( k - x + 1 ) // 2 + 1 , y ) NEW_LINE z = min ( k - x - y + 3 , z ) NEW_LINE print ( x * y * z ) NEW_LINE


x , y , z , k = [ int ( value ) for value in input ( ) . split ( ) ]   x , y , z = sorted ( [ x , y , z ] )   a = min ( k // 3 , x - 1 ) NEW_LINE k -= ab = min ( k // 2 , y - 1 ) NEW_LINE k -= bc = min ( k , z - 1 )   print ( ( a + 1 ) * ( b + 1 ) * ( c + 1 ) ) NEW_LINE


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 . Arrays ; import java . util . StringTokenizer ;   public class A {   public static void main ( String [ ] args ) throws IOException {   Scanner sc = new Scanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ;   int x [ ] = new int [ ] { sc . nextInt ( ) , sc . nextInt ( ) , sc . nextInt ( ) } , k = sc . nextInt ( ) ; Arrays . sort ( x ) ; long rem = k , ans = 1 ; for ( int i = 0 ; i < 3 ; ++ i ) { long kd = rem / ( 3 - i ) ; long s = Math . min ( x [ i ] , kd + 1 ) ; ans *= s ; rem -= s - 1 ; } out . println ( ans ) ; out . close ( ) ; }   static class Scanner { StringTokenizer st ; BufferedReader br ;   public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; }   public Scanner ( String s ) throws FileNotFoundException { br = new BufferedReader ( new FileReader ( s ) ) ; }   public String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; }   public int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   public long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   public String nextLine ( ) throws IOException { return br . readLine ( ) ; }   public double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; }   public boolean ready ( ) throws IOException { return br . ready ( ) ; } } }


import java . util . * ;   public class Absolutezero {    public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int r = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int c = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int r1 = sc . nextInt ( ) ; double dis = Math . sqrt ( x * x + y * y ) ; if ( dis >= ( r - d ) && ( dis + ( r1 ) ) <= r && ( dis - r1 ) >= ( r - d ) ) { c ++ ; } } System . out . println ( c ) ;    }   }

R , D = map ( int , input ( ) . split ( ) ) cnt = 0 for _ in range ( int ( input ( ) ) ) : x , y , r = map ( int , input ( ) . split ( ) ) d = ( x * x + y * y ) ** ( 0.5 ) if ( r + d <= R and d - r >= R - D ) : cnt += 1 print ( cnt ) NEW_LINE


import math   pizza_info = list ( map ( int , input ( ) . split ( ) ) ) pizza_radius = pizza_info [ 0 ] crust_width = pizza_info [ 1 ] pieces_of_sausage = int ( input ( ) ) sausages_on_crust = 0 for sausage in range ( pieces_of_sausage ) : sausage_info = list ( map ( int , input ( ) . split ( ) ) ) sausage_x = sausage_info [ 0 ] sausage_y = sausage_info [ 1 ] sausage_radius = sausage_info [ 2 ] sausage_radial_pos = math . sqrt ( sausage_x * sausage_x + sausage_y * sausage_y ) if ( pizza_radius - crust_width <= sausage_radial_pos - sausage_radius and sausage_radial_pos + sausage_radius <= pizza_radius ) : sausages_on_crust += 1 print ( sausages_on_crust ) NEW_LINE


r , d = map ( int , input ( ) . split ( ) ) n = int ( input ( ) ) ans = 0 for _ in range ( n ) : x , y , p = map ( int , input ( ) . split ( ) ) if x * x + y * y >= ( r - d + p ) * ( r - d + p ) and x * x + y * y <= ( r - p ) * ( r - p ) : ans += 1 print ( ans ) NEW_LINE


r , d = map ( int , input ( ) . split ( ) ) n = int ( input ( ) ) ans = 0 for _ in range ( n ) : x , y , k = map ( int , input ( ) . split ( ) ) dc = ( x * x + y * y ) ** 0.5 if dc + k <= r and dc - k >= r - d : ans += 1 print ( ans ) NEW_LINE


R , d = map ( int , input ( ) . split ( ) ) n = int ( input ( ) ) count = 0 for _ in range ( n ) : x , y , r = map ( int , input ( ) . split ( ) ) if 2 * r <= d : dis = ( ( x ** 2 ) + ( y ** 2 ) ) ** ( 1 / 2 ) mind = dis - r maxd = dis + r if mind >= R - d and maxd <= R : count += 1 print ( count ) NEW_LINE


import java . io . * ; import java . util . * ;   import static java . lang . Double . * ; import static java . lang . Integer . * ;   public class B { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ; StringTokenizer st ; st = new StringTokenizer ( in . readLine ( ) ) ; int res = 0 ; double r = parseDouble ( st . nextToken ( ) ) , d = parseDouble ( st . nextToken ( ) ) ; int n = parseInt ( in . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { st = new StringTokenizer ( in . readLine ( ) ) ; double xi = parseDouble ( st . nextToken ( ) ) , yi = parseDouble ( st . nextToken ( ) ) , ri = parseDouble ( st . nextToken ( ) ) ; if ( solve ( r , d , xi , yi , ri ) ) res ++ ; } pw . println ( res ) ; pw . close ( ) ; }   static boolean solve ( double r , double d , double xi , double yi , double ri ) { double dis = Math . sqrt ( ( ( xi * xi ) + ( yi * yi ) ) ) ; if ( ( r - d ) <= ( dis - ri ) && r >= ( dis + ri ) ) return true ; return false ; } }


import java . util . * ;   public class GlebPizza {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int R = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int tot = 0 ; int d = R - D ; while ( n -- > 0 ) { int x = sc . nextInt ( ) ; x = Math . abs ( x ) ; int y = sc . nextInt ( ) ; y = Math . abs ( y ) ; int r = sc . nextInt ( ) ; if ( 2 * r <= R - d ) { double f = max ( x , y ) ; if ( ( f <= R && f >= d ) ) { if ( ( R - f >= r && f - d >= r ) ) { tot ++ ; } } } }   System . out . println ( tot ) ;   } static double max ( int a , int b ) { return Math . sqrt ( a * a + b * b ) ; }   }


import java . util . * ; import java . io . * ; import java . awt . Point ; import java . awt . geom . Point2D ; import java . math . BigDecimal ; import java . math . BigInteger ;   import static java . lang . Math . * ;    public class B implements Runnable { final static Random rnd = new Random ( ) ;

scan = lambda : map ( int , input ( ) . split ( ) ) x1 , y1 , x2 , y2 = scan ( ) vmx , t = scan ( ) vx , vy = scan ( ) wx , wy = scan ( ) lb , ub , EPS = 0 , 1e15 , 1e-8 while ub - lb > EPS : mid = ( lb + ub ) / 2 xx , yy = ( vx * mid , vy * mid ) if t - mid > EPS else ( vx * t + wx * ( mid - t ) , vy * t + wy * ( mid - t ) ) if vmx * mid - ( ( x2 - x1 - xx ) ** 2 + ( y2 - y1 - yy ) ** 2 ) ** .5 > EPS : ub = mid else : lb = midprint ( " % .8f " % ub ) NEW_LINE


import java . io . * ; import java . math . * ; import java . text . DecimalFormat ; import java . util . * ;    public class Main {   private static double compute ( point v , point dnr , double vmax ) { double vp = v . dot ( dnr ) , vt = v . cross ( dnr ) ;


import java . util . * ;   public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; char [ ] [ ] t = new char [ n ] [ ] ; for ( int i = 0 ; i < n ; i ++ ) { t [ i ] = sc . next ( ) . toCharArray ( ) ; } int rec [ ] [ ] = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { int f = 0 ; while ( f < m && t [ i ] [ f ] != '1' ) { f ++ ; } if ( f == m ) { System . out . println ( - 1 ) ; return ; } int cnt = 1 ; for ( int j = ( f + 1 ) % m ; j != f ; j = ( j + 1 ) % m ) { if ( t [ i ] [ j ] == '1' ) cnt = 0 ; rec [ i ] [ j ] = cnt ++ ; } } for ( int i = 0 ; i < n ; i ++ ) { int f = m - 1 ; while ( f >= 0 && t [ i ] [ f ] != '1' ) { f -- ; } if ( f == - 1 ) { System . out . println ( - 1 ) ; return ; } int cnt = 1 ; for ( int j = ( f - 1 + m ) % m ; j != f ; j = ( j - 1 + m ) % m ) { if ( t [ i ] [ j ] == '1' ) cnt = 0 ; rec [ i ] [ j ] = Math . min ( cnt ++ , rec [ i ] [ j ] ) ; } } int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i < m ; i ++ ) { int sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) { sum += rec [ j ] [ i ] ; } ans = Math . min ( sum , ans ) ; } System . out . println ( ans ) ; } }

n , m = map ( int , input ( ) . split ( ) ) memo = [ [ int ( 2e9 ) for j in range ( m ) ] for i in range ( n ) ] for i in range ( n ) : s = input ( ) if s . find ( '1' ) == - 1 : print ( - 1 ) exit ( ) memo [ i ] [ 0 ] = s [ : : - 1 ] . find ( '1' ) + 1 memo [ i ] [ m - 1 ] = s . find ( '1' ) + 1 for j in range ( m ) : if s [ j ] == '1' : memo [ i ] [ j ] = 0 else : memo [ i ] [ j ] = min ( memo [ i ] [ j ] , memo [ i ] [ j - 1 ] + 1 ) for j in range ( m - 2 , - 1 , - 1 ) : memo [ i ] [ j ] = min ( memo [ i ] [ j ] , memo [ i ] [ j + 1 ] + 1 ) print ( min ( [ sum ( [ memo [ i ] [ j ] for i in range ( n ) ] ) for j in range ( m ) ] ) ) NEW_LINE


def binS ( a , x , n ) : l , r = - 1 , n while ( l + 1 < r ) : m = ( l + r ) // 2 if ( a [ m ] >= x ) : r = m else : l = m return min ( abs ( a [ r ] - x ) , abs ( a [ r - 1 ] - x ) ) def main ( ) : n , m = [ int ( i ) for i in input ( ) . split ( ) ] q = [ 0 ] * m for i in range ( n ) : s = input ( ) * 3 a = [ ] ln = 0 for j in range ( m * 3 ) : if s [ j ] == '1' : a += [ j ] ln += 1 if ln == 0 : q = [ - 1 ] break for x in range ( m , m * 2 ) : q [ x - m ] += binS ( a , x , ln ) print ( min ( q ) ) main ( ) NEW_LINE


''' ▁ ▁ ▁ ▁ Auther : ▁ ghoshashis545 ▁ Ashis ▁ Ghosh ▁ ▁ ▁ ▁ College : ▁ jalpaiguri ▁ Govt ▁ Enggineering ▁ College  ''' from os import pathimport sysfrom heapq import heappush , heappopfrom functools import cmp_to_key as ctkfrom collections import deque , 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 ( ) def mi ( ) : return map ( int , input ( ) . split ( ) ) def li ( ) : return list ( mi ( ) ) abc = ' abcdefghijklmnopqrstuvwxyz ' NEW_LINE


import java . util . * ; import java . io . * ; public class Main {   static BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringTokenizer st ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static void main ( String [ ] args ) throws IOException { int n = readInt ( ) , m = readInt ( ) ; ArrayList < Integer > adj [ ] = new ArrayList [ n ] ; for ( int i = 0 ; i < n ; i ++ ) adj [ i ] = new ArrayList ( ) ; String [ ] arr = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = readLine ( ) ; boolean flag = true ; for ( int j = 0 ; j < m ; j ++ ) { if ( arr [ i ] . charAt ( j ) == '1' ) { flag = false ; adj [ i ] . add ( j ) ; } } if ( flag ) { System . out . println ( - 1 ) ; return ; } } int [ ] [ ] lft = new int [ n ] [ m ] , rit = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class CF91A { public static void main ( String [ ] args ) throws IOException { FastScanner sc = new FastScanner ( ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   char [ ] s1 = sc . nextToken ( ) . toCharArray ( ) , s2 = sc . nextToken ( ) . toCharArray ( ) ; int [ ] [ ] nextPos = new int [ s1 . length ] [ 26 ] ; for ( int [ ] a : nextPos ) Arrays . fill ( a , - 1 ) ;

from bisect import bisect_left as bla , b = input ( ) , input ( ) NEW_LINE f = dict ( ( c , [ i for i , x in enumerate ( a ) if x == c ] ) for c in set ( a ) ) NEW_LINE


from math import * NEW_LINE from sys import stdin , stdout , setrecursionlimitfrom NEW_LINE bisect NEW_LINE import * from collections NEW_LINE import NEW_LINE * input = lambda : stdin . readline ( ) . strip ( ) NEW_LINE print = stdout . write   s1 = input ( ) NEW_LINE s2 = input ( )   al = defaultdict ( list ) NEW_LINE count = 1 ; NEW_LINE index = 0   for i in range ( len ( s1 ) ) : al [ s1 [ i ] ] . append ( i )   for i in range ( len ( s2 ) ) : if NEW_LINE INDENT ( len ( al [ s2 [ i ] ] ) == 0 ) : print ( str ( - 1 ) ) NEW_LINE DEDENT exit ( )   for i in range ( len ( s2 ) ) :     NEW_LINE r = bisect_left ( al [ s2 [ i ] ] , index ) NEW_LINE if ( r == len ( al [ s2 [ i ] ] ) ) : count += 1 NEW_LINE index = al [ s2 [ i ] ] [ 0 ] + 1 else : index = al [ s2 [ i ] ] [ r ] + 1   print ( str ( count ) ) NEW_LINE


from bisect import bisect_righta , b , c = input ( ) , input ( ) , ' abcdefghijklmnopqrstuvwxyz ' NEW_LINE p = { i : [ ] for i in c } NEW_LINE for i , j in enumerate ( a ) : p [ j ] . append ( i ) NEW_LINE if any ( j in b and not p [ j ] for j in c ) : NEW_LINE INDENT print ( - 1 ) else : NEW_LINE k , s = - 1 , 1 NEW_LINE DEDENT for j in b : q = p [ j ] NEW_LINE if k < q [ - 1 ] : NEW_LINE INDENT k = q [ bisect_right ( q , k ) ] else : NEW_LINE k , s = q [ 0 ] , s + 1 NEW_LINE DEDENT print ( s ) NEW_LINE


import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . * ;     public class NewsPaperHeadLine {   public static void main ( String [ ] args ) {   InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader sc = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Solver solver = new Solver ( ) ;


import java . util . * ; import java . io . * ; import static java . lang . Math . * ;   public class PracticeProblem { public static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static FastReader in = new FastReader ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ;   public static void main ( String [ ] args ) { solve ( ) ; out . close ( ) ; }   private static void solve ( ) { char [ ] s1 = in . nextLine ( ) . toCharArray ( ) ; char [ ] s2 = in . nextLine ( ) . toCharArray ( ) ;   int [ ] [ ] charAfter = new int [ s1 . length ] [ 26 ] ;   for ( int i = 0 ; i < s1 . length ; i ++ ) Arrays . fill ( charAfter [ i ] , - 1 ) ;   for ( int i = s1 . length - 2 ; i >= 0 ; i -- ) {


import java . util . Scanner ;   public class _0707Digitalroot {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; for ( int i = 0 ; i < n ; i ++ ) { long k = sc . nextLong ( ) ; long x = sc . nextLong ( ) ; System . out . println ( ( ( k - 1 ) * 9L ) + x ) ; } }   }

for _ in range ( int ( input ( ) ) ) : k , x = map ( int , input ( ) . split ( ) ) print ( 9 * ( k - 1 ) + x ) NEW_LINE


n = int ( input ( ) ) for i in range ( n ) : k , x = input ( ) . split ( " ▁ " )   k = int ( k ) x = int ( x ) if k == 1 : print ( x ) else : sum = ( ( k - 1 ) * 9 ) + x print ( sum ) NEW_LINE


for i in range ( int ( input ( ) ) ) : k , x = map ( int , input ( ) . split ( ) ) print ( 9 * ( k - 1 ) + x ) NEW_LINE


def solve ( ) : k , x = map ( int , input ( ) . split ( ) ) print ( 9 * ( k - 1 ) + x )   t = int ( input ( ) ) for _ in range ( t ) : solve ( ) NEW_LINE


t = int ( input ( ) ) lst = [ ] res = [ ] for i in range ( 0 , t ) : lst = [ int ( i ) for i in input ( ) . split ( ) ] ele = 9 * lst [ 0 ] + lst [ 1 ] - 9 res . append ( ele )   for i in range ( 0 , t ) : print ( res [ i ] ) NEW_LINE


import java . util . * ; import java . io . * ; public class EdE { static long [ ] mods = { 1000000007 , 998244353 , 1000000009 } ; static long mod = mods [ 0 ] ; public static MyScanner sc ; public static PrintWriter out ; public static void main ( String [ ] omkar ) throws Exception {


import java . util . Scanner ; import java . util . Arrays ; public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { try { Scanner sc = new Scanner ( System . in ) ; int t , k , i ; long n ; t = sc . nextInt ( ) ; while ( t > 0 ) { t -- ; n = sc . nextLong ( ) ; k = sc . nextInt ( ) ; System . out . println ( k + ( n - 1 ) * 9 ) ; } } catch ( Exception e ) { } } }


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- != 0 ) { long k = s . nextLong ( ) ; long x = s . nextLong ( ) ; System . out . println ( x + ( 9 * ( k - 1 ) ) ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . io . PrintWriter ;     public class A {    public static void main ( String [ ] args ) throws IOException { FastReader sc = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int diff = 0 ; while ( n -- > 0 ) { int i = sc . nextInt ( ) , j = sc . nextInt ( ) ; diff += j - i + 1 ; }   int m = ( diff + k - 1 ) / k ; out . println ( k * m - diff ) ; out . close ( ) ; }

n , k = input ( ) . split ( ) n = int ( n ) k = int ( k ) seg = 0 for i in range ( n ) : l , r = input ( ) . split ( ) l = int ( l ) r = int ( r ) seg += ( ( r - l ) + 1 ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) ans = 0 for i in range ( n ) : l , r = map ( int , input ( ) . split ( ) ) ans += r - l + 1 if ans % k == 0 : print ( 0 ) else : print ( k - ans % k ) NEW_LINE


from sys import stdin , stdoutnmbr = lambda : int ( stdin . readline ( ) ) lst = lambda : list ( map ( int , stdin . readline ( ) . split ( ) ) ) for i in range ( 1 ) : NEW_LINE


s = [ int ( s ) for s in input ( ) . split ( ) ] d = [ ] total = 0 total_init = 0 for i in range ( s [ 0 ] ) : d . append ( [ int ( d ) for d in input ( ) . split ( ) ] ) for i in d : total += i [ 1 ] - i [ 0 ] + 1 total_init = totalif total % s [ 1 ] == 0 : print ( 0 ) else : while total % s [ 1 ] != 0 : total += 1 print ( total - total_init ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) arr = [ ] c = 0 for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) c = c + b - a + 1   if c % k == 0 : print ( 0 ) else : print ( k - c % k ) NEW_LINE


import java . util . * ; import java . io . * ; public class Main { public static void main ( String args [ ] ) {   FastReader in = new FastReader ( ) ; PrintWriter so = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int l = in . nextInt ( ) ; int r = in . nextInt ( ) ; ans += r - l + 1 ; } if ( ans % k == 0 ) so . println ( "0" ) ; else so . println ( ( int ) Math . ceil ( ( double ) ans / k ) * k - ans ) ; so . flush ( ) ; } 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 ( ) ) ; }   int [ ] readIntArray ( int n ) { int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; }   long [ ] readLongArray ( int n ) { long a [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextLong ( ) ; return a ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }


import java . util . * ;   public class Problems { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int k = input . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ 2 ] ; int i , i2 ; int covered = 0 ; for ( i = 0 ; i < n ; i ++ ) { for ( i2 = 0 ; i2 < 2 ; i2 ++ ) { a [ i ] [ i2 ] = input . nextInt ( ) ; } covered = covered + ( ( a [ i ] [ 1 ] - a [ i ] [ 0 ] ) + 1 ) ; } covered = covered % k ; if ( covered != 0 ) { covered = k - covered ; } System . out . println ( covered ) ; } }


import java . util . * ; import java . math . * ; public class PoloPenguin { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int out = 0 ; while ( n -- > 0 ) { int l = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; out += r - l + 1 ; } if ( out <= k ) System . out . println ( k - out ) ; else { int num = ( int ) Math . ceil ( ( double ) out / ( double ) k ) ; k *= num ; System . out . println ( k - out ) ; } } }


import java . util . * ; import java . io . * ;   public class Functions_Again {   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 shuffle ( int [ ] a ) { Random r = new Random ( ) ;   for ( int i = 0 ; i <= a . length - 2 ; i ++ ) { int j = i + r . nextInt ( a . length - i ) ;   swap ( a , i , j ) ; }   Arrays . sort ( a ) ; }   public static void swap ( int [ ] a , int i , int j ) { int temp = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = temp ; }   public static void main ( String [ ] args ) {

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


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) l = [ abs ( a [ i + 1 ] - a [ i ] ) for i in range ( n - 1 ) ] dp = [ [ 0 , 0 ] for i in range ( n - 1 ) ] dp [ 0 ] [ 0 ] = l [ 0 ] ans = max ( dp [ 0 ] ) for i in range ( 1 , n - 1 ) : dp [ i ] = [ max ( dp [ i - 1 ] [ 1 ] + l [ i ] , l [ i ] ) , max ( dp [ i - 1 ] [ 0 ] - l [ i ] , - l [ i ] ) ] ans = max ( ans , max ( dp [ i ] ) ) print ( ans ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) d = [ ] for i in range ( n - 1 ) : a = 1 if i % 2 : a = - 1 d . append ( a * ( abs ( l [ i ] - l [ i + 1 ] ) ) )   s , b = 0 , 0 sm , bm = 0 , 0 for i in range ( n - 1 ) : s = max ( d [ i ] , s + d [ i ] ) b = max ( s , b )   for i in range ( 1 , n - 1 ) : sm = min ( d [ i ] , sm + d [ i ] ) bm = min ( sm , bm ) print ( max ( abs ( bm ) , abs ( b ) ) ) NEW_LINE


import sysinput = sys . stdin . readline   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) d = [ 0 ] * nc = [ 0 ] * ne = [ 0 ] * nx = 1 mx = 0   for i in range ( 1 , n ) : d [ i ] = abs ( a [ i ] - a [ i - 1 ] )   for i in range ( 1 , n ) : c [ i ] = max ( 0 , c [ i - 1 ] + d [ i ] * x ) e [ i ] = max ( 0 , e [ i - 1 ] + d [ i ] * ( - x ) ) mx = max ( mx , max ( c [ i ] , e [ i ] ) ) x = - x   print ( mx ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) new = [ ] c = 1 for i in range ( n - 1 ) : new . append ( abs ( arr [ i ] - arr [ i + 1 ] ) * c ) c *= - 1 s = 0 s1 = 0 m = 0 for i in range ( n - 1 ) : s += new [ i ] if s < 0 : s = 0 if i > 0 : s1 += - new [ i ] if s1 < 0 : s1 = 0 m = max ( m , s1 ) m = max ( m , s ) print ( m ) NEW_LINE


import java . util . * ; import java . lang . * ; import java . math . BigInteger ;

n = int ( input ( ) ) A = [ int ( a ) for a in input ( ) . split ( ) ] A . sort ( ) last = A [ 0 ] c = 0 aux = 0 for i in range ( n ) : a = A [ i ] if a == last : aux += 1 else : aux = 1 last = A [ i ] c = max ( c , aux ) print ( n - c ) NEW_LINE


import collectionsn = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) cs = collections . Counter ( arr ) ans = 0 while cs : ans += len ( cs ) - 1 for k in list ( cs . keys ( ) ) : cs [ k ] -= 1 if not cs [ k ] : del cs [ k ] print ( ans ) NEW_LINE


n = int ( input ( ) ) arr = sorted ( list ( map ( int , input ( ) . split ( ) ) ) ) t = 0 i = 0j = 0 while i < len ( arr ) and j < len ( arr ) : if arr [ i ] < arr [ j ] : i += 1 t += 1 j += 1 elif arr [ i ] == arr [ j ] : j += 1 print ( t ) NEW_LINE


'''   ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Online ▁ Python ▁ Compiler . ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ Code , ▁ Compile , ▁ Run ▁ and ▁ Debug ▁ python ▁ program ▁ online . Write ▁ your ▁ code ▁ in ▁ this ▁ editor ▁ and ▁ press ▁ " Run " ▁ button ▁ to ▁ execute ▁ it .   ''' from collections import Countern = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) c = Counter ( l ) s = list ( set ( l ) ) s . sort ( ) cn = 0 while ( True ) : for i in range ( len ( s ) ) : if ( c [ s [ i ] ] != 0 ) : NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Map . Entry ; import java . util . Scanner ; import java . util . Set ; import java . util . StringTokenizer ;    @ SuppressWarnings ( " unused " ) public class A { public static FastScannerA scan = new FastScannerA ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; static void sort ( int [ ] a ) { ArrayList < Integer > l = new ArrayList < > ( ) ; for ( int i : a ) l . add ( i ) ; Collections . sort ( l ) ; for ( int i = 0 ; i < a . length ; i ++ ) a [ i ] = l . get ( i ) ; } public static void solve ( ) { int n = scan . nextInt ( ) ; int [ ] a = scan . readArray ( n ) ; int [ ] last = new int [ 1010 ] ; int cnt = 0 ; sort ( a ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j <= 1000 ; j ++ ) { if ( a [ i ] > last [ j ] ) { if ( last [ j ] > 0 ) { cnt ++ ; } last [ j ] = a [ i ] ; break ; } } }


import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Collections ; import java . util . StringTokenizer ;   public class beautifulpaintings {   public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   int n = Integer . parseInt ( in . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( in . readLine ( ) ) ; ArrayList < Integer > nums = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int num = Integer . parseInt ( st . nextToken ( ) ) ; nums . add ( num ) ; } Collections . sort ( nums ) ; int last = nums . remove ( 0 ) ; int count = 0 ; for ( int i = 1 ; i < n ; i ++ ) { int next = - 1 ; for ( int j = 0 ; j < nums . size ( ) ; j ++ ) { if ( nums . get ( j ) > last ) { next = j ; break ; } } if ( next != - 1 ) { last = nums . remove ( next ) ; count ++ ; } else { last = nums . remove ( 0 ) ; } } out . println ( count ) ; in . close ( ) ; out . close ( ) ; } }


import java . util . Scanner ;   public class BeautifulPaintings651 {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int count [ ] = new int [ 1001 ] ; int max = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { max = Math . max ( max , ++ count [ scan . nextInt ( ) ] ) ; } System . out . println ( n - max ) ; } }


import java . util . Scanner ; import java . util . Arrays ; import java . util . HashSet ; public class Main { public static void main ( String [ ] args ) { Scanner puttingvaluesinside = new Scanner ( System . in ) ; int arr [ ] [ ] = new int [ 1001 ] [ 1001 ] ; int t = puttingvaluesinside . nextInt ( ) ; while ( t -- > 0 ) { int temp = puttingvaluesinside . nextInt ( ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] [ temp ] == 0 ) { arr [ i ] [ temp ] = 1 ; break ; } } } int ans = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { int count = 0 ; for ( int j = 0 ; j < arr . length ; j ++ ) { if ( arr [ i ] [ j ] == 1 ) count ++ ; } if ( count == 0 ) break ; ans += count - 1 ; } System . out . println ( ans ) ; } }


import java . io . * ; import java . util . StringTokenizer ;    public class ivanTheFool { public static long mod = 1000000007 ; public static void fout ( long x ) { System . out . println ( x ) ; } 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 long pmod ( long x , long y ) { long r = 1 ; while ( y > 0 ) { if ( y % 2 == 1 ) { r = ( r * x ) % mod ; } x = ( x * x ) % mod ; y >>= 1 ; } return r ; }   public static void main ( String [ ] args ) { FastReader rd = new FastReader ( ) ; long n , m ; n = rd . nextLong ( ) ; m = rd . nextLong ( ) ; long answer = 0 ; long [ ] fact = new long [ 200000 ] ; fact [ 0 ] = 1 ; for ( long i = 1 ; i < 200000 ; ++ i ) { fact [ ( int ) i ] = ( fact [ ( int ) i - 1 ] * i ) % mod ; } answer += 2 ;

import io , osinput = io . BytesIO ( os . read ( 0 , os . fstat ( 0 ) . st_size ) ) . readlinen , m = list ( map ( int , input ( ) . split ( ) ) ) z = ( 10 ** 9 ) + 7 fib = [ 0 , 1 , 2 ] for i in range ( 3 , max ( n , m ) + 1 ) : fib . append ( ( fib [ - 1 ] + fib [ - 2 ] ) % z ) print ( ( 2 * ( ( fib [ n ] + fib [ m ] - 1 ) % z ) ) % z ) NEW_LINE


from sys import stdininput = lambda : stdin . readline ( ) . strip ( ) lin = lambda : list ( map ( int , input ( ) . split ( ) ) ) iin = lambda : int ( input ( ) ) main = lambda : map ( int , input ( ) . split ( ) ) from math import ceil , sqrt , factorial , logfrom collections import dequefrom bisect import bisect_leftmod = 998244353 mod = 1000000007 def gcd ( a , b ) : a , b = max ( a , b ) , min ( a , b ) while a % b != 0 : a , b = b , a % b return bdef moduloinverse ( a ) : return ( pow ( a , mod - 2 , mod ) ) def solve ( we ) : n , m = main ( ) fib = [ 1 , 1 ] for i in range ( max ( n , m ) + 3 ) : fib . append ( ( fib [ - 1 ] + fib [ - 2 ] ) % mod ) print ( ( 2 * ( fib [ n ] + fib [ m ] - 1 ) ) % mod ) qwe = 1 NEW_LINE


import java . io . File ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class p004 { public static void main ( String args [ ] ) throws Exception { StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( " \\ A " ) . next ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( stok . nextToken ( ) ) ; int m = Integer . parseInt ( stok . nextToken ( ) ) ; long mod = ( long ) 1e9 + 7 ; long [ ] [ ] dp = new long [ 100005 ] [ 2 ] ; dp [ 1 ] [ 0 ] = 2 ; for ( int i = 2 ; i <= 100000 ; i ++ ) { dp [ i ] [ 0 ] = ( dp [ i - 1 ] [ 0 ] + dp [ i - 1 ] [ 1 ] ) % mod ; dp [ i ] [ 1 ] = dp [ i - 1 ] [ 0 ] ; } long tot = ( dp [ n ] [ 0 ] + dp [ n ] [ 1 ] + dp [ m ] [ 0 ] + dp [ m ] [ 1 ] + mod - 2 ) % mod ; System . out . println ( tot ) ; } }


import java . util . Scanner ;   public class A1443 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; StringBuilder output = new StringBuilder ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; for ( int n = 1 ; n <= N ; n ++ ) { output . append ( 2 * ( N + n ) ) . append ( ' ▁ ' ) ; } output . append ( ' \n ' ) ; } System . out . print ( output ) ; }   }

for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE for i in range ( n ) : print ( 4 * n - 2 * i , end = ' ▁ ' ) NEW_LINE print ( ) NEW_LINE


import sys   NEW_LINE def main ( ) : _ , * l = map ( int , sys . stdin . read ( ) . strip ( ) . split ( ) ) NEW_LINE out = [ ] NEW_LINE for n in l : out . append ( ' ▁ ' . join ( map ( str , range ( 4 * n , 2 * n , - 2 ) ) ) ) NEW_LINE return out NEW_LINE print ( * main ( ) , sep = ' \n ' ) NEW_LINE


import sys   input = sys . stdin . buffer . readlinet = int ( input ( ) )   for _ in range ( t ) : n = int ( input ( ) )   print ( * range ( 2 * n + 2 , 4 * n + 1 , 2 ) ) NEW_LINE


import sys   input = sys . stdin . buffer . readlinet = int ( input ( ) )   for _ in range ( t ) : n = int ( input ( ) )   print ( " ▁ " . join ( list ( map ( str , list ( range ( 2 * n + 2 , 4 * n + 1 , 2 ) ) ) ) ) ) NEW_LINE


def string_list ( s , char ) : output_list = [ ] NEW_LINE intermediator = " " NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE s [ i ] != char : intermediator += s [ i ] NEW_LINE if i == len ( s ) - 1 : NEW_LINE INDENT output_list . append ( int ( intermediator ) ) else : NEW_LINE if NEW_LINE DEDENT intermediator : output_list . append ( int ( intermediator ) ) NEW_LINE intermediator = " " NEW_LINE return output_list     NEW_LINE def list_string ( l , char ) : output_str = " " NEW_LINE for i in range ( len ( l ) - 1 ) : output_str += str ( l [ i ] ) + char NEW_LINE output_str += str ( l [ len ( l ) - 1 ] ) NEW_LINE return output_str     NEW_LINE def merge_sort ( l ) : def NEW_LINE merge ( l1 , l2 ) : i , j = 0 , 0 NEW_LINE output_list = [ ] NEW_LINE while i < len ( l1 ) and j < len ( l2 ) : if NEW_LINE l1 [ i ] < l2 [ j ] : output_list . append ( l1 [ i ] ) NEW_LINE i += 1 else : output_list . append ( l2 [ j ] ) NEW_LINE j += 1 NEW_LINE if i == len ( l1 ) : NEW_LINE INDENT output_list += ( l2 [ j : ] ) else : NEW_LINE output_list += ( l1 [ i : ] ) NEW_LINE DEDENT return output_list   NEW_LINE def sorts ( l ) : if NEW_LINE len ( l ) < 2 : NEW_LINE return l else : mid = len ( l ) // 2 NEW_LINE left = sorts ( l [ : mid ] ) NEW_LINE right = sorts ( l [ mid : ] ) NEW_LINE return merge ( left , right ) NEW_LINE return sorts ( l )       NEW_LINE def main_function ( ) : output_list = [ ] NEW_LINE t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n = int ( input ( ) ) NEW_LINE output_list . append ( list_string ( [ 4 * n - i for i in range ( 2 * n ) if not i % 2 ] , " ▁ " ) ) NEW_LINE return list_string ( output_list , " \n " )       print ( main_function ( ) )   NEW_LINE


import java . util . * ; import java . util . Collections ; public class HelloWorld {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) {


import java . util . * ;   public class Main { static boolean judge ( int a , int b ) { if ( a % b == 0 || b % a == 0 ) { return false ; } return true ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- != 0 ) { int n = sc . nextInt ( ) ; Queue < Integer > q = new LinkedList < > ( ) ; int i = 4 ; q . offer ( i ) ; while ( true ) { if ( q . size ( ) == n ) break ; i += 2 ; int mid = q . element ( ) ; if ( judge ( mid , i ) ) { q . add ( i ) ; } else { q . remove ( ) ; q . add ( i ) ; } } for ( int j = 0 ; j < n ; j ++ ) { System . out . print ( q . poll ( ) + " ▁ " ) ; } System . out . println ( ) ; } } }


import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tc = sc . nextInt ( ) ; while ( tc -- > 0 ) { int n = sc . nextInt ( ) ; int mid = 2 * n ; int count = n ; for ( int i = 4 * n ; i > mid && count > 0 ; i -= 2 ) { System . out . print ( i + " ▁ " ) ; count -- ; } System . out . println ( ) ; } sc . close ( ) ; }   }


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


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) a = l . count ( 1 ) b = l . count ( 2 ) c = l . count ( 3 ) d = l . count ( 4 ) res = dres += ca -= cif b % 2 == 0 : res += b // 2 else : res += ( b // 2 ) + 1 a -= 2 if a > 0 : if a % 4 != 0 : res += ( a // 4 ) + 1 else : res += a // 4 print ( res ) NEW_LINE


from math import ceil   n = int ( input ( ) ) s = [ int ( si ) for si in input ( ) . split ( ) ]   count = { 1 : 0 , 2 : 0 , 3 : 0 , 4 : 0 } for si in s : count [ si ] += 1   NEW_LINE


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String [ ] ip = br . readLine ( ) . split ( " ▁ " ) ; int c1 = 0 , c2 = 0 , c3 = 0 , c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( Integer . parseInt ( ip [ i ] ) == 4 ) c = c + 1 ; else if ( Integer . parseInt ( ip [ i ] ) == 1 ) c1 = c1 + 1 ; else if ( Integer . parseInt ( ip [ i ] ) == 2 ) c2 = c2 + 1 ; else if ( Integer . parseInt ( ip [ i ] ) == 3 ) c3 = c3 + 1 ; } c = c + c3 ; c1 = ( c3 >= c1 ) ? 0 : c1 - c3 ; if ( c2 % 2 == 0 ) { c = c + ( c2 / 2 ) ; c = c + ( c1 % 4 == 0 ? c1 / 4 : ( c1 / 4 ) + 1 ) ; } else { c2 = ( c2 * 2 ) + c1 ; c = c + ( c2 % 4 == 0 ? c2 / 4 : ( c2 / 4 ) + 1 ) ; } System . out . println ( c ) ; } }


import java . util . * ; public class Main { public static void main ( String [ ] args ) { int count = 0 ; int count1 = 0 ; int count2 = 0 ; int count3 = 0 ; Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 4 ) { arr [ i ] = 0 ; count ++ ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 3 ) { count3 ++ ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 2 ) { count2 ++ ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 1 ) { count1 ++ ; } } if ( count3 > count1 ) { count = count1 + count ; count3 = count3 - count1 ; count1 = 0 ; count = count + count1 ; count = count + count3 ; count3 = 0 ; count1 = 0 ;   }   else { count = count3 + count ; count1 = count1 - count3 ; count3 = 0 ; } count = ( count2 / 2 ) + count ; if ( count2 % 2 != 0 ) { if ( count1 < 3 ) { count ++ ; count1 = 0 ; count2 = 0 ; } else { count1 = count1 - 2 ; count ++ ; count2 = 0 ; } } count = count + ( count1 / 4 ) ; if ( count1 % 4 > 0 ) { count ++ ; } System . out . println ( count ) ; } }


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


import java . io . * ; import java . util . * ;   public class GFG { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int y = ( int ) ( ( double ) Math . log ( N ) / Math . log ( 2 ) ) ; System . out . println ( y + 1 ) ; } }

a = int ( input ( ) )   n = acount = 0 arr = [ ]   while 1 : if 2 ** count <= a : arr . append ( 2 ** count ) n -= 2 ** count else : break if n <= 0 : break   count += 1   if n > 0 : arr . append ( n )   print ( len ( arr ) ) NEW_LINE


print ( len ( bin ( int ( input ( ) ) ) [ 2 : ] ) ) NEW_LINE


def solve ( num ) : ans = 0 power = 0 while ans < num : ans += 2 ** power power += 1 return power print ( solve ( int ( input ( ) ) ) )   NEW_LINE


t = int ( input ( ) ) i = 1 k = 0 x = 0 while x < t : x = x + i i = i * 2 k = k + 1 print ( k ) NEW_LINE


n = int ( input ( ) ) for i in range ( 1 , 35 ) : if 2 ** i - 1 >= n : print ( i ) ; break NEW_LINE


import java . util . * ;   public class CodeForces1037A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; System . out . println ( ( long ) ( Math . log ( n ) / Math . log ( 2 ) ) + 1 ) ; } }


import java . util . * ; import java . io . * ; public class Main { public static int mod = 1000000007 ; public static void solve ( InputReader in ) { int n = in . readInt ( ) ; int ans = 0 ; while ( n > 1 ) { ans ++ ; n /= 2 ; } System . out . println ( ans + 1 ) ; } public static void main ( String [ ] args ) {


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 . Scanner ;    public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int i = 1 ; i <= 1000 ; i ++ ) { if ( Math . pow ( 2 , i ) > n ) { System . out . println ( i ) ; break ; } } }   }


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

import mathtotalTime = 0 n , d = input ( ) . split ( ) n = int ( n ) d = int ( d ) songList = list ( map ( int , input ( ) . split ( ) ) ) initialJokeCount = 0 for i in range ( n ) : if ( i != n - 1 ) : totalTime += songList [ i ] + 10 initialJokeCount += 2 else : totalTime += songList [ i ]   if ( totalTime > d ) : print ( - 1 ) else : remainingTime = d - totalTime ; remainingJokeCount = math . floor ( remainingTime / 5 ) print ( initialJokeCount + remainingJokeCount ) NEW_LINE


n , d = map ( int , input ( ) . split ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   if ( sum ( arr ) + ( n - 1 ) * 10 ) > d : print ( - 1 ) else : ans = ( d - sum ( arr ) ) // 5 print ( ans ) NEW_LINE


n , d = map ( int , input ( ) . split ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( l ) + ( n - 1 ) * 10   if ( s > d ) : print ( - 1 ) else : x = ( n - 1 ) * 2 x += ( d - s ) // 5 print ( x ) NEW_LINE


import sysfrom os import pathif ( path . exists ( ' input . txt ' ) and path . exists ( ' output . txt ' ) ) : sys . stdout = open ( ' output . txt ' , ' w ' ) sys . stdin = open ( ' input . txt ' , ' r ' )     def main ( ) : N , D = map ( int , input ( ) . split ( ) ) times = list ( map ( int , input ( ) . split ( ) ) ) crack = 0 for i in range ( N ) : if i < N - 1 : D -= times [ i ] + 10 crack += 2 else : D -= times [ i ] crack += D // 5   if D < 0 : print ( - 1 ) else : print ( crack )       main ( ) NEW_LINE


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


import java . util . Scanner ;   public class sinngerjocker { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int event_num = sc . nextInt ( ) ; int toatl_time = sc . nextInt ( ) ; int sum = 0 ; int total_jokes = 0 ; int arr [ ] = new int [ event_num ] ; for ( int i = 0 ; i < event_num ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; sum = sum + arr [ i ] ;   }   if ( toatl_time < sum + ( event_num - 1 ) * 10 ) { System . out . println ( " - 1" ) ; return ; } else { total_jokes = ( ( ( event_num - 1 ) * 10 ) / 5 ) + ( toatl_time - ( sum + ( event_num - 1 ) * 10 ) ) / 5 ; System . out . println ( total_jokes ) ;   } }    }


import java . util . * ; public class DevuTheSinger { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ;   int [ ] arr = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; sum += arr [ i ] ; } sc . close ( ) ;   if ( ( sum + ( n - 1 ) * 10 ) <= d ) { int ans = ( n - 1 ) * 2 ; ans = ans + ( d - ( sum + ( n - 1 ) * 10 ) ) / 5 ; System . out . println ( ans ) ; } else System . out . println ( - 1 ) ;    } }


import java . io . * ; import java . util . * ; import java . text . * ; import java . math . * ;   public class MyClass { public static void main ( String args [ ] ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String name [ ] = new String [ n ] ; int [ ] ar = new int [ n ] ; HashMap < String , Integer > m = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; name [ i ] = st . nextToken ( ) ; ar [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; m . put ( name [ i ] , m . getOrDefault ( name [ i ] , 0 ) + ar [ i ] ) ; } int max = - 10000000 ; for ( String s : m . keySet ( ) ) { max = Math . max ( max , m . get ( s ) ) ; } HashMap < String , Integer > map = ( HashMap ) m . clone ( ) ; m . clear ( ) ; for ( int i = 0 ; i < n ; i ++ ) { m . put ( name [ i ] , m . getOrDefault ( name [ i ] , 0 ) + ar [ i ] ) ; if ( m . get ( name [ i ] ) >= max && map . get ( name [ i ] ) == max ) { sb . append ( name [ i ] + " \n " ) ; break ; } } System . out . print ( sb ) ; } }

n = int ( input ( ) ) d = { } q = [ ]   for i in range ( n ) : x , y = input ( ) . split ( ) y = int ( y ) q . append ( [ x , y ] ) d [ x ] = d . get ( x , 0 ) + yans = max ( d . values ( ) ) ma = { } for x , y in q : ma [ x ] = ma . get ( x , 0 ) + y if ma [ x ] >= ans and d [ x ] == ans : print ( x ) break NEW_LINE


from sys import * input = stdin . readlinet = int ( input ( ) ) l = { } level = [ ] for i in range ( t ) : s , p = map ( str , input ( ) . split ( ) ) p = int ( p ) l [ s ] = l . get ( s , 0 ) + p level . append ( [ l [ s ] , s ] ) res = list ( l . values ( ) ) maxp = max ( res ) name = [ ] for i in l : if ( l [ i ] == maxp ) : name . append ( i ) for i in level : if ( i [ 0 ] >= maxp and i [ 1 ] in name ) : print ( i [ 1 ] ) break   NEW_LINE


def main ( ) : n = int ( input ( ) ) scores = dict ( ) book = list ( ) for i in range ( n ) : name , score = input ( ) . split ( ) scores [ name ] = scores . setdefault ( name , 0 ) + int ( score ) book . append ( [ name , int ( score ) ] ) m = max ( scores . values ( ) ) winners = dict ( ) for k , v in scores . items ( ) : if v == m : winners . setdefault ( k , 0 ) for round in book : if round [ 0 ] in winners . keys ( ) : winners [ round [ 0 ] ] += round [ 1 ] if ( winners [ round [ 0 ] ] >= m ) : print ( round [ 0 ] ) break return   if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import java . util . * ;   public class P2A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; Map < String , Integer > map = new HashMap < > ( ) ; int t = sc . nextInt ( ) ; int max = Integer . MIN_VALUE , k = 0 ; String ansName = " " ; String [ ] names = new String [ t ] ; int [ ] scores = new int [ t ] ; while ( t -- > 0 ) { String name = sc . next ( ) ; int score = sc . nextInt ( ) ; map . put ( name , map . getOrDefault ( name , 0 ) + score ) ; int curVal = map . get ( name ) ; names [ k ] = name ; scores [ k ] = map . get ( name ) ; k ++ ; } max = Collections . max ( map . values ( ) ) ; for ( int i = 0 ; i < names . length ; i ++ ) { if ( map . get ( names [ i ] ) == max && max <= scores [ i ] ) { ansName = names [ i ] ; break ; } } System . out . println ( ansName ) ; } }


import java . util . HashSet ; import java . util . Scanner ; import java . util . HashMap ;   public class Winner { public static void main ( final String [ ] parameters ) { Scanner input = new Scanner ( System . in ) ; int totalLines = input . nextInt ( ) ; String [ ] players = new String [ totalLines ] ; int [ ] scores = new int [ totalLines ] ; HashMap < String , Integer > scoreBoard = new HashMap < > ( ) ;   for ( int index = 0 ; index < totalLines ; index ++ ) { players [ index ] = input . next ( ) ; scores [ index ] = input . nextInt ( ) ;   scoreBoard . put ( players [ index ] , scoreBoard . getOrDefault ( players [ index ] , 0 ) + scores [ index ] ) ; }   HashSet < String > winners = new HashSet < > ( ) ; int maximumScore = Integer . MIN_VALUE ;   for ( String key : scoreBoard . keySet ( ) ) { if ( scoreBoard . get ( key ) > maximumScore ) { winners . clear ( ) ; winners . add ( key ) ; maximumScore = scoreBoard . get ( key ) ; } else if ( scoreBoard . get ( key ) == maximumScore ) { winners . add ( key ) ; } }    scoreBoard . clear ( ) ; String result = " " ;   for ( int index = 0 ; index < totalLines ; index ++ ) { String player = players [ index ] ; int playerScore = scoreBoard . getOrDefault ( player , 0 ) + scores [ index ] ;   if ( playerScore >= maximumScore && winners . contains ( player ) ) { result = player ; break ; }   scoreBoard . put ( player , playerScore ) ; }   System . out . println ( result ) ;    } }


import java . util . Scanner ;   public class AddingDigits { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int a = in . nextInt ( ) * 10 , b = in . nextInt ( ) , n = in . nextInt ( ) , i , j ; in . close ( ) ;   for ( i = 9 ; i >= 0 ; i -- ) { if ( ( a + i ) % b == 0 ) { System . out . print ( a + i ) ; for ( j = 0 ; j < n - 1 ; j ++ ) System . out . print ( 0 ) ; return ; } } System . out . println ( - 1 ) ; } }

a , b , n = [ int ( x ) for x in input ( ) . split ( ) ] for i in range ( 10 ) : temp = str ( a ) + str ( i ) if ( int ( temp ) % b == 0 ) : a = temp breakif ( int ( a ) % b != 0 ) : a = - 1 else : a = a + ( '0' * ( n - 1 ) ) print ( a ) NEW_LINE


a , b , n = map ( int , input ( ) . split ( ) ) x = str ( a ) flag = 0 for i in range ( 10 ) : if int ( str ( a ) + str ( i ) ) % b == 0 : x += str ( i ) flag = 1 breakif flag == 0 : print ( - 1 ) else : for i in range ( n - 1 ) : x += "0" print ( x ) NEW_LINE


def f ( a , b , c ) : res = None cnt = 0 for i in range ( 0 , 9 + 1 ) : if int ( str ( a ) + str ( i ) ) % b == 0 : res = str ( a ) + str ( i ) break     if res == None : return - 1 return res + ( c - 1 ) * "0"         a , b , c = map ( int , input ( ) . strip ( ) . split ( ) ) print ( f ( a , b , c ) ) NEW_LINE


a , b , n = map ( int , input ( ) . split ( ) ) a = a * 10 + 9 mod = a % bif mod > 9 : print ( - 1 ) exit ( ) else : a -= moda = str ( a ) + '0' * ( n - 1 ) print ( a ) NEW_LINE


a , b , n = map ( int , input ( ) . split ( " ▁ " ) ) fixed_length = len ( str ( a ) ) if a % b == 0 : print ( a * 10 ** n ) else : while len ( str ( a ) ) != fixed_length + n : flag = False for digit in range ( 10 ) : if int ( str ( a ) + str ( digit ) ) % b == 0 : a = int ( str ( a ) + str ( digit ) ) flag = True break if flag == False : print ( - 1 ) break if a % b == 0 : a *= 10 ** ( n - ( len ( str ( a ) ) - fixed_length ) ) breakif len ( str ( a ) ) == n + fixed_length : print ( a )                           ''' brute ▁ force ▁ przeciez ▁ po ▁ osiagnieciu ▁ pierwszej ▁ podzielnoscimozesz ▁ dodac ▁ tylko ▁ zera ▁ i ▁ koniec ▁ algorytmu ''' NEW_LINE