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


def find ( num ) : s = 0 while num > 0 : s = s + num % 10 num = num // 10 return sn = int ( input ( ) ) c = 1 num = 19 while c < n : num = num + 9 if find ( num ) == 10 : c = c + 1 print ( num )   NEW_LINE


def is_good ( z ) : t = 0 while z : t += z % 10 z //= 10   return t == 10     n = int ( input ( ) ) dp = [ 0 ] * ndp [ 0 ] = 19   for i in range ( 1 , n ) : s = str ( dp [ i - 1 ] ) m = len ( s ) for j in range ( m - 1 , - 1 , - 1 ) : if s [ j ] != '0' : s = s [ : j ] + s [ j : ] [ : : - 1 ] break   f = 9 NEW_LINE


def digit ( x ) : t = 0 while x : t += x % 10 x = x // 10 return t   k = int ( input ( ) ) x = 19 while k > 1 : x = x + 9 if digit ( x ) == 10 : k -= 1 print ( x ) NEW_LINE


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

def do ( ) : import math n , x , y , d = map ( int , input ( ) . split ( ) ) x -= 1 y -= 1 n -= 1 res = 10 ** 18 if x == y : print ( 0 ) return if ( y - x ) % d == 0 : print ( abs ( ( y - x ) ) // d ) return   cnt = 0 cnt = math . ceil ( x / d ) if y % d == 0 : cnt += abs ( y // d ) res = min ( res , cnt )   cnt = 0 cnt = math . ceil ( ( n - x ) / d ) if ( n - y ) % d == 0 : cnt += abs ( ( n - y ) // d ) res = min ( res , cnt )   if res == 10 ** 18 : print ( - 1 ) return else : print ( res ) return   qq = int ( input ( ) ) for _ in range ( qq ) : do ( ) NEW_LINE


from math import ceilfor _ in range ( int ( input ( ) ) ) : n , x , y , d = map ( int , input ( ) . split ( ) ) if abs ( x - y ) % d == 0 : print ( abs ( x - y ) // d ) else : ans = 10 ** 18 if ( y - 1 ) % d == 0 : ans = min ( ans , ( y - 1 ) // d + ( x - 1 + d - 1 ) // d ) if ( n - y ) % d == 0 : ans = min ( ans , ( n - y ) // d + ( n - x + d - 1 ) // d ) if ans == 10 ** 18 : print ( - 1 ) else : print ( ans ) NEW_LINE


from math import ceilfor _ in range ( int ( input ( ) ) ) : n , x , y , d = map ( int , input ( ) . split ( ) ) if abs ( x - y ) % d == 0 : print ( abs ( x - y ) // d ) else : ans = 10 ** 18 if ( y - 1 ) % d == 0 : ans = min ( ans , ( y - 1 ) // d + ceil ( ( x - 1 ) / d ) ) if ( n - y ) % d == 0 : ans = min ( ans , ( n - y ) // d + ceil ( ( n - x ) / d ) ) if ans == 10 ** 18 : print ( - 1 ) else : print ( ans ) NEW_LINE


import java . util . * ; import java . io . * ; public class A { public static void main ( String args [ ] ) { FastScanner in = new FastScanner ( ) ; int t = in . nextInt ( ) ; while ( -- t >= 0 ) { int n = in . nextInt ( ) ; int x = in . nextInt ( ) ; int y = in . nextInt ( ) ; int d = in . nextInt ( ) ; int diff = Math . abs ( x - y ) ; if ( x != y && diff % d != 0 && ( y - 1 ) % d != 0 && ( n - y ) % d != 0 ) System . out . println ( - 1 ) ; else if ( diff % d == 0 ) System . out . println ( diff / d ) ; else { if ( ( y - 1 ) % d == 0 && ( n - y ) % d == 0 ) System . out . println ( Math . min ( ( y - 1 ) / d + ( x - 1 + d - 1 ) / d , ( n - y ) / d + ( n - x + d - 1 ) / d ) ) ; else if ( ( y - 1 ) % d == 0 ) System . out . println ( ( y - 1 ) / d + ( x - 1 + d - 1 ) / d ) ; else System . out . println ( ( n - y ) / d + ( n - x + d - 1 ) / d ) ; } } }


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


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

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) )   has_1 = False   for i in a : if i == 1 : has_1 = True breakprint ( - 1 if has_1 else 1 ) NEW_LINE


import sysfrom math import sqrt , log , log2 , ceil , log10 , gcd , floor , pow , sin , cos , tan , pi , inf , factorialfrom copy import copy , deepcopyfrom sys import exit , stdin , stdoutfrom collections import Counter , defaultdict , dequefrom itertools import permutationsimport heapqfrom bisect import bisect_left from bisect import bisect_right NEW_LINE


import sysfrom functools import lru_cache , cmp_to_keyfrom heapq import merge , heapify , heappop , heappushfrom math import * from collections import defaultdict as dd , deque , Counter as Cfrom itertools import combinations as comb , permutations as permfrom bisect import bisect_left as bl , bisect_right as br , bisect , insortfrom time import perf_counterfrom fractions import Fractionimport copyfrom copy import deepcopyimport timestarttime = time . time ( ) mod = int ( pow ( 10 , 9 ) + 7 ) mod2 = 998244353   def data ( ) : return sys . stdin . readline ( ) . strip ( ) def out ( * var , end = " \n " ) : sys . stdout . write ( ' ▁ ' . join ( map ( str , var ) ) + end ) def L ( ) : return list ( sp ( ) ) def sl ( ) : return list ( ssp ( ) ) def sp ( ) : return map ( int , data ( ) . split ( ) ) def ssp ( ) : return map ( str , data ( ) . split ( ) ) def l1d ( n , val = 0 ) : return [ val for i in range ( n ) ] def l2d ( n , m , val = 0 ) : return [ l1d ( n , val ) for j in range ( m ) ] try : NEW_LINE


a = input ( ) b = input ( ) . split ( ) if "1" in b : print ( " - 1" ) else : print ( "1" ) NEW_LINE


n = int ( input ( ) ) notes = list ( map ( int , input ( ) . split ( ) ) ) print ( ( 1 , - 1 ) [ min ( notes ) == 1 ] ) NEW_LINE


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


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


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


import java . util . * ; import java . io . * ; public class Main { static int gcd ( int a , int b ) { if ( b == 0 ) { return a ; } return gcd ( b , a % b ) ; } static boolean check ( int n ) { if ( n % 2 == 0 || n % 6 == 0 ) { return false ; } if ( n % 3 == 0 ) { return false ; } for ( int i = 6 ; i * i <= n ; i += 6 ) { if ( n % ( i - 1 ) == 0 || n % ( i + 1 ) == 0 ) return false ; } return true ; }   public static void main ( String [ ] args ) { FastScanner scan = new FastScanner ( ) ; int t = scan . nextInt ( ) ; int a [ ] = new int [ t ] ; for ( int i = 0 ; i < t ; ++ i ) { a [ i ] = scan . nextInt ( ) ; } Arrays . sort ( a ) ; if ( a [ 0 ] == 1 ) { System . out . print ( " - 1" ) ; } else { System . out . print ( 1 ) ; }        } } ; class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }


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

n , k = map ( int , input ( ) . split ( ) ) NEW_LINE a = [ int ( x ) for x in input ( ) . split ( ) ] NEW_LINE l = 0 NEW_LINE r = 1001 NEW_LINE while r - l > 0.0000001 : m = ( r + l ) / 2 ; plus = 0 NEW_LINE minus = 0 NEW_LINE for i in range ( n ) : if NEW_LINE a [ i ] <= m : plus += m - a [ i ] else : minus += a [ i ] - m NEW_LINE minus = minus * ( 100 - k ) / 100 NEW_LINE if minus >= plus : NEW_LINE INDENT l = m else : NEW_LINE r = mprint ( l ) NEW_LINE DEDENT


n , k = map ( int , input ( ) . split ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE l . sort ( reverse = True ) NEW_LINE s = sum ( l ) NEW_LINE s1 = 0 NEW_LINE s2 = sans = 0 NEW_LINE k = 100 - kfor NEW_LINE i in range ( n - 1 ) : NEW_LINE


n , k = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) )   NEW_LINE def bins ( ) : l = 0 NEW_LINE r = 10000000000000 NEW_LINE for i in range ( 100 ) : mid = ( l + r ) / 2 NEW_LINE if f ( mid ) : NEW_LINE INDENT l = mid else : NEW_LINE r = mid NEW_LINE DEDENT print ( l )     NEW_LINE def f ( s ) : sent = 0 NEW_LINE sentR = 0 NEW_LINE for i in range ( n ) : if NEW_LINE arr [ i ] < s : sentR += ( ( s - arr [ i ] ) * 100 ) / ( 100 - k ) elif arr [ i ] > s : sent += arr [ i ] - s NEW_LINE return sent >= sentRbins ( ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Main { static double inc ; static double dec ; public static void main ( String [ ] arg ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; double per = ( ( 100 - k ) / 100.0 ) ; int max = 0 ; int [ ] arr = new int [ n ] ; int min = 10001 ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; max = Math . max ( max , arr [ i ] ) ; min = Math . min ( min , arr [ i ] ) ; } double lo = min ; double hi = max ; double ans = lo ; while ( hi - lo > ( double ) 1e-6 ) { double mid = lo + ( hi - lo ) / 2.0 ; check ( arr , mid ) ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Main { static double inc ; static double dec ; public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int k = Integer . parseInt ( st . nextToken ( ) ) ; double per = ( ( 100 - k ) / 100.0 ) ; int max = 0 ; int [ ] arr = new int [ n ] ; int min = 10001 ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; max = Math . max ( max , arr [ i ] ) ; min = Math . min ( min , arr [ i ] ) ; } double lo = min ; double hi = max ; double ans = lo ; while ( hi - lo > ( double ) 1e-6 ) { double mid = lo + ( hi - lo ) / 2.0 ; check ( arr , mid ) ;


import java . util . Scanner ;   public class Stock { public static void main ( String [ ] args ) {   Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; int m = scn . nextInt ( ) ; int r = scn . nextInt ( ) ; int count = 0 ;   int [ ] a = new int [ n ] ; int [ ] b = new int [ m ] ;   for ( int i = 0 ; i < n ; i ++ ) a [ i ] = scn . nextInt ( ) ;   for ( int i = 0 ; i < m ; i ++ ) b [ i ] = scn . nextInt ( ) ;   int mina = a [ 0 ] ; int maxb = b [ 0 ] ;   for ( int i = 0 ; i < n ; i ++ ) mina = Math . min ( mina , a [ i ] ) ;   for ( int i = 0 ; i < m ; i ++ ) maxb = Math . max ( maxb , b [ i ] ) ; if ( maxb < mina ) System . out . println ( r ) ; else System . out . println ( maxb * ( r / mina ) + r % mina ) ;    } }

buy , sell , money = map ( int , input ( ) . split ( ) ) minPrice = min ( list ( map ( int , input ( ) . split ( ) ) ) ) maxPrice = max ( list ( map ( int , input ( ) . split ( ) ) ) ) print ( max ( money , ( money // minPrice ) * maxPrice + money % minPrice ) ) NEW_LINE


i = lambda : map ( int , input ( ) . split ( ) ) _ , _ , r = i ( ) s = min ( i ( ) ) b = max ( s , * i ( ) ) print ( r % s + r // s * b ) NEW_LINE


R = int ( input ( ) . split ( ) [ - 1 ] )   best_buy = min ( map ( int , input ( ) . split ( ) ) ) best_sell = max ( map ( int , input ( ) . split ( ) ) )   num_buy = R // best_buy   print ( max ( R , R + ( best_sell - best_buy ) * num_buy ) ) NEW_LINE


N , M , R = map ( int , input ( ) . split ( ) ) S = list ( map ( int , input ( ) . split ( ) ) ) B = list ( map ( int , input ( ) . split ( ) ) ) ms = min ( S ) mb = max ( B ) print ( max ( mb * ( R // ms ) + R % ms , R ) ) NEW_LINE


def solve ( ) : l = list ( map ( int , input ( ) . split ( ) ) ) l2 = list ( map ( int , input ( ) . split ( ) ) ) l3 = list ( map ( int , input ( ) . split ( ) ) ) l2 . sort ( ) l3 . sort ( ) if ( l2 [ 0 ] < l3 [ len ( l3 ) - 1 ] ) : x = int ( l [ 2 ] / l2 [ 0 ] ) * l3 [ len ( l3 ) - 1 ] + ( l [ 2 ] % l2 [ 0 ] ) print ( x ) else : print ( l [ 2 ] ) solve ( ) NEW_LINE


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


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


import java . util . * ; import java . io . * ; import java . math . * ; public class Main { static void solve ( ) {


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int r = sc . nextInt ( ) ; int s [ ] = new int [ n ] ; int b [ ] = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < m ; i ++ ) { b [ i ] = sc . nextInt ( ) ; } Arrays . sort ( s ) ; Arrays . sort ( b ) ; int f = 0 ; if ( s [ 0 ] >= b [ m - 1 ] ) { System . out . println ( r ) ; } else { int p = r / s [ 0 ] ; int k = r % s [ 0 ] ; f = b [ m - 1 ] * p ; f += k ; System . out . println ( f ) ; } } }


import java . util . * ; public class FairNumber { public static int check ( long n ) { long x = n ; while ( x != 0 ) { if ( x % 10 != 0 && n % ( x % 10 ) != 0 ) return - 1 ; x /= 10 ; } return 1 ; }   public static void main ( String [ ] args ) {

import java . util . * ; public NEW_LINE class FairNumber { public static int check ( long n ) { long x = n ; while ( x != 0 ) { if ( x % 10 != 0 & & n % ( x % 10 ) != 0 ) return - 1 ; x /= 10 ; } return 1 ; }   public static void main ( String [ ] args ) { // TODO Auto - generated method stub Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t - -> 0 ) { long n = sc . nextLong ( ) ; while ( true ) { if ( check ( n ) == 1 ) { System . out . println ( n ) ; break ; } else n + + ; } } }   } NEW_LINE


def is_fair ( n ) : nn = n NEW_LINE while n != 0 : d = n % 10 NEW_LINE if d != 0 and nn % d != 0 : return False NEW_LINE n //= 10 NEW_LINE return True   NEW_LINE def solve ( ) : n = int ( input ( ) ) NEW_LINE while not is_fair ( n ) : n += 1 NEW_LINE print ( n )   t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : solve ( ) NEW_LINE


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


import java . util . * ; public NEW_LINE class sol { static Scanner scr = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { // TODO Auto - generated method stub int t = scr . nextInt ( ) ; while ( t - -> 0 ) { solve ( ) ; } } static void solve ( ) { long n = scr . nextLong ( ) ; while ( ! isValid ( n ) ) { n + + ; } System . out . println ( n ) ; } static boolean isValid ( long n ) { long x = n ; while ( x > 0 ) { long mod = x % 10 ; // System . out . print ( mod + " ▁ " ) ; if ( mod != 0 & & n % mod != 0 ) { return false ; } x /= 10 ; } return true ; } } NEW_LINE


def is_just ( num ) : newnum = num NEW_LINE while newnum > 0 : if NEW_LINE newnum % 10 != 0 : NEW_LINE if num % ( newnum % 10 ) != 0 : return False NEW_LINE newnum //= 10 NEW_LINE return True                   t = int ( input ( ) ) NEW_LINE for ti in range ( t ) : n = int ( input ( ) ) NEW_LINE x = n NEW_LINE while not is_just ( x ) : x += 1 NEW_LINE print ( x ) NEW_LINE


import java . util . Scanner ;   public class B1411 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { long N = in . nextLong ( ) ; while ( ! isFair ( N ) ) N ++ ; System . out . println ( N ) ; } }   private static boolean isFair ( long N ) { long r = N ; while ( r != 0 ) { long digit = r % 10 ; r /= 10 ; if ( digit != 0 && N % digit != 0 ) { return false ; } } return true ; }   }


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


import java . util . Scanner ;   public class _0685FairNumbers { static long findFair ( long n ) { boolean flag = true ; while ( flag ) { long temp = n ; flag = false ; while ( temp > 0 ) { long val = temp % 10 ; if ( val == 0 ) { temp = temp / 10 ; continue ; } if ( n % val != 0 ) { flag = true ; n ++ ; break ; } temp = temp / 10 ; } } return n ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; while ( cases > 0 ) { long n = sc . nextLong ( ) ; System . out . println ( findFair ( n ) ) ; cases -- ; } }   }


import java . util . * ; public class fair {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { long n = in . nextLong ( ) ; boolean flag = true ; while ( flag ) { String s = String . valueOf ( n ) ; int x = 0 , y = 0 ; if ( s . indexOf ( "2" ) >= 0 ) { x ++ ; if ( n % 2 == 0 ) y ++ ; } if ( s . indexOf ( "2" ) >= 0 ) { x ++ ; if ( n % 2 == 0 ) y ++ ; } if ( s . indexOf ( "3" ) >= 0 ) { x ++ ; if ( n % 3 == 0 ) y ++ ; } if ( s . indexOf ( "4" ) >= 0 ) { x ++ ; if ( n % 4 == 0 ) y ++ ; } if ( s . indexOf ( "5" ) >= 0 ) { x ++ ; if ( n % 5 == 0 ) y ++ ; } if ( s . indexOf ( "6" ) >= 0 ) { x ++ ; if ( n % 6 == 0 ) y ++ ; } if ( s . indexOf ( "7" ) >= 0 ) { x ++ ; if ( n % 7 == 0 ) y ++ ; } if ( s . indexOf ( "8" ) >= 0 ) { x ++ ; if ( n % 8 == 0 ) y ++ ; } if ( s . indexOf ( "9" ) >= 0 ) { x ++ ; if ( n % 9 == 0 ) y ++ ; } if ( x == y ) { System . out . println ( n ) ; flag = false ; } else n ++ ; } }   }   }


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

n = int ( input ( ) ) if ( n < 3 ) : print ( " No " ) else : print ( " Yes " ) print ( n // 2 , end = " ▁ " ) for i in range ( 2 , n + 1 , 2 ) : print ( i , end = " ▁ " ) print ( ) print ( n - ( n // 2 ) , end = " ▁ " ) for i in range ( 1 , n + 1 , 2 ) : print ( i , end = " ▁ " ) NEW_LINE


n = int ( input ( ) ) if n < 3 : print ( " No " ) else : print ( " Yes " ) print ( 1 , n ) print ( n - 1 , end = " ▁ " ) for i in range ( 1 , n ) : print ( i , end = " ▁ " ) NEW_LINE


try : n = int ( input ( ) ) if n <= 2 : print ( " No " ) else : e = [ ] o = [ ] for i in range ( 1 , n + 1 ) : if i % 2 == 0 : e . append ( i ) else : o . append ( i ) print ( " Yes " ) print ( len ( e ) , * e ) print ( len ( o ) , * o ) except : pass NEW_LINE


n = int ( input ( ) ) if n < 3 : print ( " No " ) else : print ( " Yes " ) print ( 1 , n ) print ( n - 1 , * range ( 1 , n ) ) NEW_LINE


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; String ans = " " ; if ( n == 1 || n == 2 ) { ans = " No " ; System . out . println ( ans ) ; } else { ans = " Yes " ; System . out . println ( ans ) ; System . out . print ( n / 2 + " ▁ " ) ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i % 2 == 0 ) System . out . print ( i + " ▁ " ) ; } System . out . println ( ) ; System . out . print ( n - n / 2 + " ▁ " ) ; for ( int j = 1 ; j <= n ; j ++ ) { if ( j % 2 != 0 ) System . out . print ( j + " ▁ " ) ; } } } }


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; long ans = 0 , negative = 0 , zero = 0 ; for ( int i = 0 ; i < n ; i ++ ) { long k = s . nextLong ( ) ; if ( k > 1 ) { ans += k - 1 ; } else if ( k == 0 ) { ans ++ ; zero ++ ; } else if ( k < 0 ) { ans += Math . abs ( k ) - 1 ; negative ++ ; } } if ( negative % 2 == 1 && zero == 0 ) { ans = ans + 2 ; } System . out . println ( ans ) ;   } }

totalCost = 0 newArr = [ ] zeroCount = 0 negativeNumCount = 0 numCount = int ( input ( ) ) numArr = list ( map ( int , input ( ) . split ( ) ) ) for num in numArr : if ( num != 1 and num != - 1 ) : if ( num < 0 ) : negativeNumCount += 1 cost = abs ( num ) - 1 newArr . append ( num + cost ) totalCost += cost elif ( num > 0 ) : cost = num - 1 newArr . append ( num - cost ) totalCost += cost else : zeroCount += 1 else : if ( num == - 1 ) : negativeNumCount += 1 if ( zeroCount > 0 ) : totalCost += zeroCountelse : if ( negativeNumCount % 2 != 0 ) : totalCost += 2 print ( totalCost )   NEW_LINE


n = int ( input ( ) ) arr = [ int ( x ) for x in input ( ) . split ( ) ] dp = [ [ 0 for _ in range ( 2 ) ] for _ in range ( n ) ] dp [ 0 ] [ 0 ] = abs ( 1 - arr [ 0 ] ) dp [ 0 ] [ 1 ] = abs ( - 1 - arr [ 0 ] ) for i in range ( 1 , n ) : plus1 = abs ( 1 - arr [ i ] ) minus1 = abs ( - 1 - arr [ i ] ) dp [ i ] [ 0 ] = min ( dp [ i - 1 ] [ 0 ] + plus1 , dp [ i - 1 ] [ 1 ] + minus1 ) dp [ i ] [ 1 ] = min ( dp [ i - 1 ] [ 0 ] + minus1 , dp [ i - 1 ] [ 1 ] + plus1 ) print ( dp [ n - 1 ] [ 0 ] ) NEW_LINE


n = int ( input ( ) ) a = tuple ( map ( int , input ( ) . split ( ) ) ) x , y = abs ( a [ 0 ] - 1 ) , abs ( a [ 0 ] + 1 ) for i in a [ 1 : ] : x , y = min ( x + abs ( i - 1 ) , y + abs ( i + 1 ) ) , min ( y + abs ( i - 1 ) , x + abs ( i + 1 ) ) print ( x ) NEW_LINE


n = int ( input ( ) ) seq = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) change_count = 0 product = 1 zero_count = 0 for i in seq : if i > 1 : change_count += i - 1 elif i < - 1 : change_count += - 1 - i product *= - 1 elif i == 0 : zero_count += 1 elif i == - 1 : product *= - 1   if zero_count > 0 : change_count += zero_count product = 1   if product == - 1 : change_count += 2 print ( change_count ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; public class Solution { private static final Scanner sc = new Scanner ( System . in ) ; private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static final long MOD = ( long ) ( 1e9 + 7 ) ; private static PrintWriter out = new PrintWriter ( System . out ) ;   static long getAns ( long [ ] a , int n , int prod , long [ ] [ ] dp ) { if ( n == 0 ) { return prod == 1 ? 0 : Long . MAX_VALUE / 2 ; } if ( dp [ n ] [ ( prod % 3 + 3 ) % 3 ] != - 1 ) { return dp [ n ] [ ( prod % 3 + 3 ) % 3 ] ; } long ans1 = Math . abs ( a [ n - 1 ] - 1 ) + getAns ( a , n - 1 , prod , dp ) ; long ans2 = Math . abs ( a [ n - 1 ] + 1 ) + getAns ( a , n - 1 , prod * - 1 , dp ) ; return dp [ n ] [ ( prod % 3 + 3 ) % 3 ] = Math . min ( ans1 , ans2 ) ; } public static void solve ( int T ) throws IOException { int n = sc . nextInt ( ) ; long [ ] a = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextLong ( ) ; } int prod = 1 ; long [ ] [ ] dp = new long [ n + 1 ] [ 3 ] ; for ( long [ ] i : dp ) { Arrays . fill ( i , - 1 ) ; } long ans = getAns ( a , n , prod , dp ) ; System . out . println ( ans ) ; } public static void main ( String [ ] args ) throws IOException { int t ;


import java . math . BigInteger ; import java . util . * ; import java . lang . * ; import java . util . Arrays ;     public class geek {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; try {       StringBuffer sb = new StringBuffer ( ) ; int n = s . nextInt ( ) ; long a [ ] = new long [ n ] ; long neg = 0 , zeroes = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = s . nextLong ( ) ; if ( a [ i ] < 0 ) { neg ++ ; } else if ( a [ i ] == 0 ) { zeroes ++ ; } } Arrays . sort ( a ) ; long ans = 0 ; if ( neg % 2 == 0 ) { for ( int i = 0 ; i < n ; i ++ ) { ans += Math . abs ( Math . abs ( a [ i ] ) - 1 ) ; } } else { for ( int i = 0 ; i < n ; i ++ ) { if ( neg > 1 ) { ans += Math . abs ( Math . abs ( a [ i ] ) - 1 ) ; neg -- ; } else if ( zeroes > 0 && neg == 1 ) {   ans += Math . abs ( Math . abs ( a [ i ] ) - 1 ) + 1 ; neg -- ; i ++ ;   } else { ans += Math . abs ( a [ i ] - 1 ) ;   }


import java . util . Scanner ;   public class MakeProductEqualOne {   public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long nCnt = 0 ; long ans = 0 ; long zeroCnt = 0 ; int n = s . nextInt ( ) ; long arr [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = s . nextLong ( ) ; if ( arr [ i ] < 0 ) nCnt ++ ; if ( arr [ i ] == 0 ) zeroCnt ++ ; ans += ( Math . abs ( ( Math . abs ( arr [ i ] ) - 1 ) ) ) % 1000000007 ; } if ( ( nCnt & 1 ) == 1 && zeroCnt == 0 ) ans += 2 ; System . out . println ( ans ) ; }   }


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 ( ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int m = Integer . parseInt ( st . nextToken ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int [ ] [ ] ar = new int [ m ] [ n ] ; for ( int i = 0 ; i < m ; i ++ ) { st = new StringTokenizer ( br . readLine ( ) ) ; for ( int j = 0 ; j < n ; j ++ ) { ar [ i ] [ j ] = Integer . parseInt ( st . nextToken ( ) ) ; } }

nums = input ( ) . split ( ) rows , colums = int ( nums [ 0 ] ) , int ( nums [ 1 ] ) matrix1 = [ [ 1 ] * colums ] * rowsinputMatrix = [ ] for _ in range ( rows ) : inputMatrix . append ( [ int ( i ) for i in input ( ) . split ( ) ] ) for rowIndex , row in enumerate ( inputMatrix ) : for columIndex , val in enumerate ( row ) : if val == 0 : matrix1 [ rowIndex ] = [ 0 ] * colums for j in range ( rows ) : matrix1 [ j ] [ columIndex ] = 0   def check ( ) : for rowIndex , row in enumerate ( inputMatrix ) : for columIndex , val in enumerate ( row ) : if val == 1 : dic = [ ] for j in range ( rows ) : dic . append ( matrix1 [ j ] [ columIndex ] ) if 1 not in matrix1 [ rowIndex ] and 1 not in dic : return " NO " return " YES " checkVal = check ( ) if checkVal == " NO " : print ( " NO " ) else : print ( " YES " ) for row in matrix1 : print ( " ▁ " . join ( str ( x ) for x in row ) ) NEW_LINE


def check_col ( mat , c ) : for r in mat : if not r [ c ] : return 0 return 1   m , n = map ( int , input ( ) . split ( ) ) a = [ [ 0 ] * n for _ in range ( m ) ] b = [ tuple ( map ( int , input ( ) . split ( ) ) ) for _ in range ( m ) ] rows , cols = [ ] , [ ] checkedCols = set ( ) for r in range ( m ) : if all ( b [ r ] ) : rows . append ( r ) else : for c in range ( n ) : if b [ r ] [ c ] and c not in checkedCols : checkedCols . add ( c ) if check_col ( b , c ) : cols . append ( c ) else : print ( ' NO ' ) exit ( ) if ( len ( rows ) and len ( rows ) != m and not len ( cols ) ) or ( len ( cols ) and len ( cols ) != n and not len ( rows ) ) : print ( " NO " ) exit ( ) if not len ( rows ) and not len ( cols ) : print ( " YES " ) for i in a : print ( * i ) exit ( ) i = j = 0 if not len ( cols ) : cols . append ( 0 ) while i < len ( rows ) and j < len ( cols ) : a [ rows [ i ] ] [ cols [ j ] ] = 1 i += 1 j += 1 for k in range ( i , len ( rows ) ) : a [ rows [ k ] ] [ cols [ 0 ] ] = 1 for l in range ( j , len ( cols ) ) : a [ rows [ 0 ] ] [ cols [ l ] ] = 1 print ( " YES " ) for i in a : print ( * i ) NEW_LINE


m , n = map ( int , input ( ) . split ( ) ) A = [ [ 1 ] * n ] * mB = [ [ 0 ] * n ] * mC = [ ] for i in range ( m ) : L = list ( map ( int , input ( ) . split ( ) ) ) C . append ( L ) for j in range ( len ( L ) ) : if L [ j ] == 0 : A [ i ] = [ 0 ] * n for k in range ( m ) : A [ k ] [ j ] = 0 ''' for ▁ alpha ▁ in ▁ A : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( * alpha ) ▁ ▁ ▁ ▁ for ▁ alpha ▁ in ▁ C : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( * alpha ) ''' for p in range ( m ) : for w in range ( n ) : if A [ p ] [ w ] == 1 : B [ p ] = [ 1 ] * n for s in range ( m ) : B [ s ] [ w ] = 1 if B == C : print ( " YES " ) for i in A : print ( * i ) else : print ( " NO " ) NEW_LINE


import java . util . Arrays ; import java . util . Collections ; import java . util . Scanner ; import java . lang . Math ; public class Account { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int m = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int [ ] [ ] arr = new int [ m ] [ n ] ; int [ ] [ ] res = new int [ m ] [ n ] ; int [ ] rows = new int [ m ] ; int [ ] cols = new int [ n ] ; Arrays . fill ( cols , 0 ) ; for ( int [ ] a : res ) { Arrays . fill ( a , 0 ) ; } int sum = 0 ; boolean flag = false ; for ( int i = 0 ; i < m ; i ++ ) { rows [ i ] = 0 ; for ( int j = 0 ; j < n ; j ++ ) { arr [ i ] [ j ] = sc . nextInt ( ) ; sum += arr [ i ] [ j ] ; cols [ j ] += arr [ i ] [ j ] ; rows [ i ] += arr [ i ] [ j ] ; } } if ( m == 1 && n == 1 ) { System . out . println ( " YES \n " + arr [ 0 ] [ 0 ] ) ; return ; } else if ( m == 1 || n == 1 ) { if ( ( m == 1 && rows [ 0 ] == n ) || ( n == 1 && cols [ 0 ] == m ) ) { System . out . println ( " YES " ) ; for ( int i = 0 ; i < m ; i ++ ) {


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


import java . util . * ;   public class ORinMatrix_B { public static int checker ( int [ ] [ ] ans , int i , int j , int m , int n ) { int temp = 0 ; for ( int a = 0 ; a < m ; a ++ ) { temp += ans [ a ] [ j ] ; } for ( int a = 0 ; a < n ; a ++ ) { temp += ans [ i ] [ a ] ; } if ( temp == 0 ) { return 0 ; } else { return 1 ; } }   public static void main ( String [ ] args ) {


import java . util . * ; import java . io . * ; import java . lang . * ; import java . math . BigInteger ;   public class Main { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; if ( n == 1 ) { int t = sc . nextInt ( ) ; System . out . println ( 0 ) ; } else { int a [ ] [ ] = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) a [ i ] [ j ] = sc . nextInt ( ) ; } int c [ ] = new int [ n ] ; int r [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int t = 0 ; for ( int j = 0 ; j < n ; j ++ ) t = t + a [ i ] [ j ] ; c [ i ] = t ; } for ( int i = 0 ; i < n ; i ++ ) { int t = 0 ; for ( int j = 0 ; j < n ; j ++ ) t = t + a [ j ] [ i ] ; r [ i ] = t ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( r [ i ] > c [ j ] ) ans ++ ; } } System . out . println ( ans ) ; } } }

def colsum ( matrix , col ) : ans = 0 for i in range ( len ( matrix ) ) : for j in range ( len ( matrix [ 0 ] ) ) : if j == col : ans += matrix [ i ] [ j ] return ans   def rowsum ( matrix , row ) : return sum ( matrix [ row ] )     cases = int ( input ( ) ) mx = [ ] while cases : cases -= 1 arr = list ( map ( int , input ( ) . split ( ) ) ) mx . append ( arr ) ans = 0 for i in range ( len ( mx ) ) : for j in range ( len ( mx [ 0 ] ) ) : if colsum ( mx , i ) > rowsum ( mx , j ) : ans += 1   print ( ans )   NEW_LINE


def input_matrix ( n ) : matrix = [ ] for i in range ( n ) : matrix . append ( list ( map ( int , input ( ) . split ( ) ) ) ) return matrix   def get_sum_in_row ( a , i ) : return sum ( a [ i ] ) def get_sum_in_col ( a , j ) : return sum ( ( a [ i ] [ j ] for i in range ( len ( a ) ) ) )     n = int ( input ( ) ) a = input_matrix ( n ) row_sums = [ get_sum_in_row ( a , i ) for i in range ( n ) ] col_sums = [ get_sum_in_col ( a , j ) for j in range ( n ) ]   n_ceils = 0 for row_sum in row_sums : for col_sum in col_sums : if col_sum > row_sum : n_ceils += 1 print ( n_ceils ) NEW_LINE


a = int ( input ( ) ) b = list ( ) for i in range ( a ) : b . append ( list ( map ( int , input ( ) . split ( ) ) ) ) h = 0 for i in range ( a ) : for j in range ( a ) : if ( sum ( b [ i ] [ j ] for i in range ( a ) ) > sum ( b [ i ] ) ) : h += 1 print ( h )                           NEW_LINE


def judge ( i , j , matrix : list ) :   col , row = 0 , 0   row = sum ( matrix [ i ] )   for k in range ( len ( matrix ) ) : col += matrix [ k ] [ j ]   if col > row : return True else : return False   def counter ( matrix : list ) :   lenth = len ( matrix ) count = 0 for i in range ( lenth ) : for j in range ( lenth ) : if judge ( i , j , matrix ) : count += 1   return count     if __name__ == ' _ _ main _ _ ' : lenth = int ( input ( ) )   matrix = [ list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) for i in range ( lenth ) ]   print ( counter ( matrix ) )     NEW_LINE


n = int ( input ( ) ) arr = [ ] for i in range ( n ) : arr . append ( list ( map ( int , input ( ) . split ( ) ) ) ) row_sum = [ ] col_sum = [ ] for i in range ( n ) : row_sum . append ( sum ( arr [ i ] ) ) for i in range ( n ) : temp = 0 for j in range ( n ) : temp += arr [ j ] [ i ] col_sum . append ( temp ) ans = 0 for i in range ( n ) : for j in range ( n ) : if col_sum [ i ] > row_sum [ j ] : ans += 1 print ( ans ) NEW_LINE


import java . util . Scanner ;   public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int row [ ] = new int [ n ] ; int col [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) {


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


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


import java . util . * ;    public class Practise {

import mathimport sysfrom collections import * import itertools def cint ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def cstr ( ) : return list ( map ( str , input ( ) . split ( ' ▁ ' ) ) )     def gcd ( a , b ) : if ( b == 0 ) : return a return gcd ( b , a % b )     def solve ( t ) : n , m = cint ( ) s1 = input ( ) s2 = input ( ) n1 = len ( s1 ) n2 = len ( s2 ) min_count = math . inf min_lst = [ ] for i in range ( n2 - n1 + 1 ) : count = 0 lst = [ ] for j in range ( n1 ) : if s1 [ j ] != s2 [ i + j ] : count += 1 lst . append ( j )   if count < min_count : min_count = count min_lst = lst . copy ( ) print ( min_count ) for item in min_lst : print ( item + 1 , end = ' ▁ ' ) print ( ' ' ) 	 	       if __name__ == " _ _ main _ _ " : NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) s = input ( ) t = input ( ) l = [ ]   for i in range ( len ( t ) - len ( s ) + 1 ) : l . append ( [ ] ) for j in range ( len ( s ) ) : if s [ j ] != t [ i + j ] : l [ - 1 ] . append ( j + 1 ) print ( len ( min ( l , key = lambda x : len ( x ) ) ) ) print ( * min ( l , key = lambda x : len ( x ) ) ) NEW_LINE


def match ( a , b , startingpos ) : assert ( len ( a ) == len ( b ) ) c = [ None ] * ( len ( a ) ) for i in range ( len ( a ) ) : if ( a [ i ] == b [ i ] ) : c [ i ] = a [ i ] else : c [ i ] = ' ? ' return ( [ startingpos , c . count ( ' ? ' ) , c ] )   n , m = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] s = [ x for x in input ( ) ] t = [ x for x in input ( ) ]   poss = [ ]   for i in range ( m - n + 1 ) : poss . append ( match ( s , t [ i : i + n ] , i ) )   poss . sort ( key = ( lambda a : a [ 1 ] ) )   print ( poss [ 0 ] [ 1 ] ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) s = input ( ) t = input ( )   ans = float ( ' inf ' ) val = 0 for x in range ( b - a + 1 ) : sub = t [ x : x + a ] c = 0 for i , j in zip ( s , sub ) : if i != j : c += 1 if ( c < ans ) : ans = c val = x   print ( ans )     for x in range ( b - a + 1 ) : sub = t [ x : x + a ] c = 0 for i , j in zip ( s , sub ) : if i != j : c += 1 if ( c == ans ) : val = x break   sub = t [ val : val + a ] for i in range ( val , val + a ) : if t [ i ] != s [ i - val ] : print ( i - val + 1 , end = " ▁ " )                         NEW_LINE


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; char [ ] s1 = sc . next ( ) . toCharArray ( ) ; char [ ] t1 = sc . next ( ) . toCharArray ( ) ; int min = n ;   String f = " " ; for ( int i = 0 ; i <= m - n ; i ++ ) { int c = 0 ; StringBuilder u = new StringBuilder ( ) ; for ( int j = 0 ; j < n ; j ++ ) {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Main { public static int match ( String s1 , String s2 , int start ) { int count = 0 ; int j = 0 ; for ( int i = start ; i < start + s1 . length ( ) && ( start + s1 . length ( ) ) <= s2 . length ( ) ; i ++ , j ++ ) { if ( s1 . charAt ( j ) == s2 . charAt ( i ) ) count ++ ; } return count ; }   public static void main ( String [ ] args ) throws IOException {   FastScanner input = new FastScanner ( ) ; int start = 0 ; int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; String s1 = input . next ( ) ; String s2 = input . next ( ) ; int minIndex = 0 ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < s2 . length ( ) ; i ++ ) { int mat = match ( s1 , s2 , i ) ;


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; int b [ ] = new int [ n ] ; int c1 [ ] = new int [ n ] ; s . nextLine ( ) ; String s1 = s . nextLine ( ) ; String t = s . nextLine ( ) ; char c = s1 . charAt ( 0 ) ; int count = 0 , min = Integer . MAX_VALUE , k = 0 ; for ( int i = 0 ; i < m - n + 1 ; i ++ ) { int index = i ; count = 0 ; Arrays . fill ( b , 0 ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( index < t . length ( ) && t . charAt ( index ) != s1 . charAt ( j ) ) { count ++ ; b [ j ] = j + 1 ; } index ++ ; } if ( count < min ) { min = count ; c1 = b . clone ( ) ;


import java . io . * ; import java . util . * ;   public class Main { private static long pow ( int a , int b ) { if ( b == 0 ) { return 1 ; } if ( b % 2 == 0 ) { long temp = pow ( a , b / 2 ) ; return temp * temp ; } return a * pow ( a , b - 1 ) ; } public static void main ( String [ ] args ) throws IOException {

import sysmod = 1000000007 input = lambda : sys . stdin . readline ( ) . rstrip ( " \n " )   from math import sqrtck = [ i for i in range ( 200001 ) ] i = 2 for i in range ( 2 , int ( sqrt ( 200001 ) ) + 1 ) : if ck [ i ] == i : t = i * i for j in range ( t , 200001 , i ) : ck [ j ] = i NEW_LINE


def gcd ( a , b ) : while b : a %= b a , b = b , a return an = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) if n == 1 : print ( l [ 0 ] ) else : g = gcd ( l [ 0 ] , l [ 1 ] ) a = ( l [ 0 ] * l [ 1 ] ) // g for i in range ( 2 , n ) : a , g = gcd ( a , g * l [ i ] // gcd ( g , l [ i ] ) ) , gcd ( l [ i ] , g ) print ( a ) NEW_LINE


from math import gcddef lcm ( a , b ) : return a * b // gcd ( a , b ) input ( ) a = list ( map ( int , input ( ) . split ( ) ) ) t = gcd ( a [ 0 ] , a [ 1 ] ) q = lcm ( a [ 0 ] , a [ 1 ] ) for i in range ( 2 , len ( a ) ) : q = gcd ( q , lcm ( a [ i ] , t ) ) t = gcd ( t , a [ i ] ) print ( q ) NEW_LINE


from sys import stdinfrom collections import defaultdict     def get_prime_nums ( ) : prime_nums = [ 2 ] for i in range ( 3 , 500 ) : is_prime = True for num in prime_nums : if i % num == 0 : is_prime = False break if is_prime : prime_nums . append ( i ) return prime_nums     n = int ( stdin . buffer . readline ( ) )   input_nums = [ int ( _ ) for _ in stdin . buffer . readline ( ) . split ( ) ] prime_nums = get_prime_nums ( )   prime_stats = defaultdict ( lambda : [ 0 ] * 20 )   for input_num in input_nums : for prime_num in prime_nums : power = 1 while input_num % prime_num == 0 : prime_stats [ prime_num ] [ power ] += 1 power += 1 input_num = input_num // prime_num if input_num != 1 : prime_stats [ input_num ] [ 1 ] += 1   ans = 1 for prime_num , stat in prime_stats . items ( ) : i = 0 while stat [ i + 1 ] >= n - 1 : i += 1 ans *= prime_num ** i   print ( ans ) NEW_LINE


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


import java . util . * ; import java . lang . * ; public class divgame { public static ArrayList < Integer > getPrimes ( int n ) { ArrayList < Integer > primes = new ArrayList < > ( ) ; boolean first = true ; while ( n % 2 == 0 ) { n /= 2 ; if ( first ) { primes . add ( 2 ) ; first = false ; } } for ( int i = 3 ; i <= Math . sqrt ( n ) ; i ++ ) { first = true ; while ( n % i == 0 ) { n /= i ; if ( first ) { primes . add ( i ) ; first = false ; } } } if ( n > 1 ) primes . add ( n ) ; return primes ; } public static int maxPower ( int n , int p ) { int c = 0 ; while ( n % p == 0 ) { c ++ ; n /= p ; } return c ; } public static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;


import java . util . * ; public class OracAndLCM { public static void main ( String [ ] args ) { boolean [ ] sieve = new boolean [ 200001 ] ; ArrayList < Integer > primes = new ArrayList < > ( ) ; for ( int i = 2 ; i <= 200000 ; i ++ ) { if ( ! sieve [ i ] ) { primes . add ( i ) ; for ( int j = i ; j <= 200000 ; j += i ) { sieve [ j ] = true ; } } } Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; int [ ] arr = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { arr [ i ] = in . nextInt ( ) ; } long res = 1 ; for ( int p : primes ) { int min = Integer . MAX_VALUE ; int min2 = Integer . MAX_VALUE ; for ( int i : arr ) { int count = count ( i , p ) ; if ( count < min2 ) { min2 = Math . max ( min , count ) ; } if ( count < min ) { min = count ; } if ( min2 == 0 ) { break ; } } res *= ( long ) Math . pow ( p , min2 ) ; } System . out . println ( res ) ; } public static int count ( int n , int p ) { int count = 0 ; while ( n % p == 0 ) { n /= p ; count ++ ; } return count ; } }


import java . util . Scanner ;   public class BearAndBigBrother { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; short a = scanner . nextByte ( ) , b = scanner . nextByte ( ) ; byte count = 0 ; while ( a <= b ) { count ++ ; a *= 3 ; b *= 2 ; } System . out . println ( count ) ; } }

a , b = map ( int , input ( ) . split ( ) ) Limak_age = aBob_age = bn_years = 0 while Limak_age <= Bob_age : Limak_age *= 3 Bob_age *= 2 n_years += 1 print ( n_years ) NEW_LINE


l , b = map ( int , input ( ) . split ( ) ) years = 0 while l <= b : l *= 3 b *= 2 years += 1 print ( years ) NEW_LINE


s , l = map ( int , input ( ) . split ( ) ) i = 0 while ( s <= l ) : s = s * 3 l = l * 2 i = i + 1 print ( i ) NEW_LINE


small , big = map ( int , input ( ) . split ( ) ) count = 0 while small <= big : small *= 3 big *= 2 count += 1 print ( count ) NEW_LINE


num_array = input ( ) . split ( ) b = int ( num_array [ 0 ] ) m = int ( num_array [ 1 ] ) c = 0 while ( b <= m ) : b = b * 3 m = m * 2 c += 1 print ( c ) NEW_LINE


import java . util . Scanner ;   public class main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int a = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ; int k = 0 ; while ( ! ( a > b ) ) { a *= 3 ; b *= 2 ; k ++ ; } System . out . println ( k ) ;   } }


import java . util . Scanner ; public class MyClass { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int a = s . nextInt ( ) ; int b = s . nextInt ( ) ; int i = 0 ; while ( a <= b ) { a = a * 3 ; b = b * 2 ; i ++ ; } System . out . println ( i ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int l = scanner . nextInt ( ) ; int b = scanner . nextInt ( ) ;   int L = l ; int B = b ;   int counter = 0 ; while ( B >= L ) { L *= 3 ; B *= 2 ;   counter ++ ; }   System . out . println ( counter ) ; } }


import java . util . * ;   public class test { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; short a = scanner . nextShort ( ) ; short b = scanner . nextShort ( ) ; short counter = 0 ;   while ( a <= b ) { a = ( short ) ( a * 3 ) ; b = ( short ) ( b * 2 ) ; counter ++ ; } System . out . println ( counter ) ;   }   }


# include < iostream >   using namespace std ;   long long a , i , n ; int main ( ) { cin >> a ;   for ( int i = 0 ; i < a ; ++ i ) {   cin >> n ; if ( n == 2 ) { cout << 2 ; } else if ( n % 2 ) cout << 1 ; else cout << 0 ; cout << endl ; } return 0 ; }

for t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) if n < 4 : print ( 4 - n ) else : print ( [ 0 , 1 ] [ n % 2 ] ) NEW_LINE


q = int ( input ( ) ) answer = 0 ch = [ ] for i in range ( q ) : n = int ( input ( ) ) if n == 2 : ch . append ( 2 ) if n % 2 == 0 and n != 2 : ch . append ( 0 ) if n % 2 != 0 : ch . append ( 1 ) for j in ch : print ( j , end = " \n " ) NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) if ( n <= 3 ) : print ( 4 - n ) else : print ( n % 2 ) NEW_LINE


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


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class Test {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class Cv {


import java . lang . reflect . Array ; import java . text . CollationElementIterator ; import java . util . * ; import java . util . Map . Entry ; import java . io . * ; import java . lang . Math . * ; import java . math . BigInteger ;   import static java . lang . Math . * ; import static java . lang . System . * ; import static java . util . Arrays . fill ; import static java . util . Arrays . spliterator ; public class ContestMain implements Runnable { private static Reader in = new Reader ( ) ; private static StringBuilder ans = new StringBuilder ( ) ; private static long MOD = 998244353 ; private static final int N = ( int ) ( 2e5 + 7 ) ;

def tri_len ( n ) : return 3 * n - 2 def triangle ( n ) : return ( n * ( n + 1 ) ) // 2 def star ( n ) : l = tri_len ( n ) return triangle ( n - 1 ) * 3 + triangle ( l ) print ( star ( int ( input ( ) ) ) ) NEW_LINE


n = int ( input ( ) ) print ( 6 * n * n - 6 * n + 1 ) NEW_LINE


import mathimport sysinput = sys . stdin . readline   def inp ( ) : return ( int ( input ( ) ) ) def inlt ( ) : return ( list ( map ( int , input ( ) . split ( ) ) ) )   n = inp ( ) print ( n * ( n - 1 ) * 6 + 1 ) NEW_LINE


n = int ( input ( ) ) print ( 6 * n * ( n - 1 ) + 1 ) NEW_LINE


n = int ( input ( ) ) print ( 1 + 6 * ( n * ( n - 1 ) ) ) NEW_LINE


import java . io . * ; import java . util . * ; public class Main { static int mod = ( int ) ( Math . pow ( 10 , 9 ) + 7 ) ; public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ; int n = sc . nextInt ( ) ; out . println ( 6 * n * ( n - 1 ) + 1 ) ; out . close ( ) ; } static void mergeSort ( int [ ] A ) {


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; long n = s . nextLong ( ) ; long res = 6 * n * ( n - 1 ) + 1 ; System . out . println ( res ) ; } }


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int temp1 = p6 ( a ) ; int temp2 = p3 ( a * 3 - 2 ) ;   System . out . println ( temp2 * 2 - temp1 ) ; } static int p6 ( int n ) { return p3 ( n ) * 6 - n * 6 + 1 ; } static int p3 ( int n ) { return n * ( n + 1 ) / 2 ; } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class Solution171B { public static void main ( String [ ] args ) { InputReader in = new InputReader ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; Solver171B solver = new Solver171B ( ) ; solver . solve ( 0 , in , out ) ; out . close ( ) ; }   static class Solver171B { public void solve ( int testNumber , InputReader in , PrintWriter out ) { long n = in . nextInt ( ) ; out . println ( 6L * n * ( n - 1L ) + 1L ) ; } }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } } }


import java . io . DataInputStream ; import java . io . FileInputStream ; import java . io . IOException ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . Scanner ;   public class Main { static class Reader { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ; public Reader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; } public Reader ( String file_name ) throws IOException { din = new DataInputStream ( new FileInputStream ( file_name ) ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; } public String readLine ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;

from collections import defaultdictN = int ( input ( ) ) if ( N == 1 ) : print ( 0 ) exit ( ) a = [ int ( x ) for x in input ( ) . split ( ) ] b = [ int ( x ) for x in input ( ) . split ( ) ] Dict = defaultdict ( int ) Sum = defaultdict ( int ) for i in range ( N ) : Dict [ a [ i ] ] += 1 Sum [ a [ i ] ] += b [ i ] ans = 0 val = 0 Group = [ ] for i in Dict . keys ( ) : if ( Dict [ i ] > 1 ) : Group . append ( i ) ans += Sum [ i ] val |= ifor i in range ( N ) : if ( Dict [ a [ i ] ] == 1 ) : for k in Group : if ( a [ i ] | k <= k ) : ans += Sum [ a [ i ] ] breakprint ( ans ) NEW_LINE


import sysinput = sys . stdin . readlinefrom collections import defaultdict n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) c = defaultdict ( int ) for i in range ( n ) : c [ a [ i ] ] += 1     s = 0 for i in range ( n ) : for j in c : if c [ j ] > 1 : if j | a [ i ] == j : s += b [ i ] breakprint ( s ) NEW_LINE


# include < bits / stdc ++ . h > # include < ext / pb_ds / assoc_container . hpp > # include < ext / pb_ds / tree_policy . hpp > using namespace __gnu_pbds ; # define ll long long # define ld long double # define el ' \n ' # define _3m_Sevawy ios_base :: sync_with_stdio ( 0 ) ; cin . tie ( 0 ) ; cout . tie ( 0 ) ; # define ordered_set tree < string , null_type , less < string > , rb_tree_tag , tree_order_statistics_node_update > # define error ( args ... ) { string _s = # args ; replace ( _s . begin ( ) , _s . end ( ) , ' , ' , ' ▁ ' ) ; stringstream _ss ( _s ) ; istream_iterator < string > _it ( _ss ) ; err ( _it , args ) ; } using namespace std ; const ll N = 7e3 + 5 , mod = 1e9 + 7 , inf = 1e18 , M = 2 * N ; bool ok [ N ] ; int main ( ) { _3m_Sevawy int tt = 1 ;


def dis ( x1 , y1 , x2 , y2 ) : return ( ( x1 - x2 ) ** 2 + ( y1 - y2 ) ** 2 ) ** 0.5   ax , ay , bx , by , tx , ty = map ( int , input ( ) . split ( ) ) n = int ( input ( ) ) a , b , s = [ ] , [ ] , 0 for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) dist = dis ( tx , ty , x , y ) a . append ( ( dis ( ax , ay , x , y ) - dist , i ) ) b . append ( ( dis ( bx , by , x , y ) - dist , i ) ) s += dist * 2 a . sort ( ) b . sort ( ) if n > 1 and a [ 0 ] [ 1 ] == b [ 0 ] [ 1 ] : res = min ( a [ 0 ] [ 0 ] , b [ 0 ] [ 0 ] , a [ 0 ] [ 0 ] + b [ 1 ] [ 0 ] , a [ 1 ] [ 0 ] + b [ 0 ] [ 0 ] ) else : res = min ( a [ 0 ] [ 0 ] , b [ 0 ] [ 0 ] ) if ( n > 1 ) : res = min ( a [ 0 ] [ 0 ] + b [ 0 ] [ 0 ] , res ) print ( res + s ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . List ; import java . util . Random ; import java . util . StringTokenizer ;   public class Main implements Runnable {   int sz [ ] ; int id [ ] ; List < Integer > edges [ ] ; long tree [ ] ;   private void solve ( ) throws IOException { long ax = nextLong ( ) ; long ay = nextLong ( ) ; long bx = nextLong ( ) ; long by = nextLong ( ) ; long tx = nextLong ( ) ; long ty = nextLong ( ) ; int n = nextInt ( ) ; long d1 [ ] = new long [ n ] ; long d2 [ ] = new long [ n ] ; long d3 [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; ++ i ) { long x = nextLong ( ) ; long y = nextLong ( ) ; d1 [ i ] = ( x - tx ) * ( x - tx ) + ( y - ty ) * ( y - ty ) ; d2 [ i ] = ( x - ax ) * ( x - ax ) + ( y - ay ) * ( y - ay ) ; d3 [ i ] = ( x - bx ) * ( x - bx ) + ( y - by ) * ( y - by ) ; } double min1 , min2 , smin1 , smin2 ; min1 = min2 = smin1 = smin2 = 1e13 ; int ind1 = - 1 , ind2 = - 1 , ind3 = - 1 , ind4 = - 1 ; double tot = 0.0d ; for ( int i = 0 ; i < n ; ++ i ) {


import java . awt . Point ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . lang . reflect . Array ; import java . math . BigDecimal ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashSet ; import java . util . Hashtable ; import java . util . LinkedList ; import java . util . PriorityQueue ; import java . util . Queue ; import java . util . Stack ; import java . util . StringTokenizer ;    public class Edu98 { static PrintWriter out ; static Scanner sc ; static ArrayList < Integer > q , w ; static ArrayList < Point > ref [ ] ; static HashSet < Integer > primesH ; static boolean prime [ ] ;

for _ in range ( int ( input ( ) ) ) : x , y = map ( int , input ( ) . split ( ) ) NEW_LINE x = abs ( x ) NEW_LINE y = abs ( y ) NEW_LINE if x > y : x , y = y , x NEW_LINE print ( 2 * x + max ( 0 , 2 * ( y - x ) - 1 ) ) NEW_LINE


import sys   input = sys . stdin . buffer . readline   t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : x , y = map ( int , input ( ) . split ( ) )   steps = min ( x , y ) * 2 NEW_LINE extra = abs ( x - y )   steps += 2 * extra NEW_LINE steps -= extra > 0 NEW_LINE print ( steps ) NEW_LINE


import sys   input = sys . stdin . readline   t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : x , y = map ( int , input ( ) . split ( ) )   steps = min ( x , y ) * 2 NEW_LINE extra = abs ( x - y )   steps += 2 * extra NEW_LINE steps -= extra > 0 NEW_LINE print ( steps ) NEW_LINE


def string_to_list ( s , char ) : collector = " " NEW_LINE output_list = [ ] NEW_LINE for i in range ( len ( s ) ) : if NEW_LINE s [ i ] != char : collector += s [ i ] NEW_LINE if i == len ( s ) - 1 : NEW_LINE INDENT output_list . append ( int ( collector ) ) else : NEW_LINE output_list . append ( int ( collector ) ) NEW_LINE DEDENT collector = " " NEW_LINE return output_list     NEW_LINE def list_to_string ( l , char ) : output_string = " " NEW_LINE for i in range ( len ( l ) - 1 ) : output_string += str ( l [ i ] ) + char NEW_LINE output_string += str ( l [ - 1 ] ) NEW_LINE return output_string     NEW_LINE def quick_sort ( l ) : def NEW_LINE partition ( l , start , end ) : pivot = l [ end ] NEW_LINE i = start NEW_LINE for j in range ( start , end ) : if NEW_LINE l [ j ] <= pivot : l [ j ] , l [ i ] = l [ i ] , l [ j ] NEW_LINE i += 1 NEW_LINE l [ end ] , l [ i ] = l [ i ] , l [ end ] NEW_LINE return i   NEW_LINE def recutrsion_part ( l , start , end ) : if NEW_LINE len ( l ) < 2 : NEW_LINE return l elif not start >= end : p = partition ( l , start , end ) NEW_LINE recutrsion_part ( l , start , p - 1 ) NEW_LINE recutrsion_part ( l , p + 1 , end ) NEW_LINE recutrsion_part ( l , 0 , len ( l ) - 1 ) NEW_LINE return l     NEW_LINE


import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ;   if ( a == b ) if ( a == 0 ) System . out . println ( a ) ; else System . out . println ( 2 * a ) ;   if ( a != b ) if ( a > b ) System . out . println ( 2 * a - 1 ) ; else System . out . println ( 2 * b - 1 ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class RobotProgram { public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n1 = sc . nextInt ( ) ; int n2 = sc . nextInt ( ) ; int res = Math . min ( n1 , n2 ) * 2 ; n1 = Math . max ( n1 , n2 ) - Math . min ( n1 , n2 ) ; res += Math . max ( 0 , 2 * n1 - 1 ) ; System . out . println ( res ) ; } }             public static class MyScanner { BufferedReader br ; StringTokenizer st ;   public MyScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; }   } }


import java . util . * ; public class HelloWorld {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int c = 0 ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int m = ( int ) Math . max ( x , y ) ; int n = ( int ) Math . min ( x , y ) ; int d = 2 * ( n ) ; int md = 0 ; if ( m - n != 0 ) md = ( m - n ) * 2 - 1 ; System . out . println ( d + md ) ; } } }


import java . util . * ; import java . io . * ; public class A { public static void main ( String ar [ ] ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int arr [ ] = new int [ n ] ; String str [ ] = br . readLine ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = Integer . parseInt ( str [ i ] ) ; sort ( arr , n ) ;

n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) z = [ ] c = 0 for i in range ( n ) : a , b = i , x [ i ] for j in range ( i , n ) : if x [ j ] < b : a = j b = x [ j ] x [ i ] , x [ a ] = x [ a ] , x [ i ] if a != i : c += 1 z . append ( [ i , a ] ) print ( c ) for i in z : for j in i : print ( j , end = " ▁ " ) print ( " " ) NEW_LINE


n = int ( input ( ) ) lst = list ( map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) ) print ( n ) for i in range ( n ) : j = lst [ i : ] . index ( min ( lst [ i : ] ) ) lst [ i ] , lst [ j + i ] = lst [ j + i ] , lst [ i ] print ( i , j + i , end = " ▁ " ) print ( ) NEW_LINE


n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) p = l . copy ( ) p . sort ( ) print ( n )   for i in range ( n ) : j = l [ i : ] . index ( p [ i ] ) + i print ( i , j ) l [ i ] , l [ j ] = l [ j ] , l [ i ] NEW_LINE


import sysimport os . pathif ( os . path . exists ( ' input _ file . txt ' ) ) : sys . stdin = open ( " input _ file . txt " , " r " ) sys . stdout = open ( " output _ file . txt " , " w " )   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) aa = sorted ( a ) i = 0 NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) print ( n - 1 ) for i in range ( n - 1 ) : j = a . index ( min ( a [ i : ] ) , i ) print ( i , j ) a [ i ] , a [ j ] = a [ j ] , a [ i ] NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Codechef { public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( System . in ) ; int size = sc . nextInt ( ) ; int arr [ ] = new int [ size ] ; int sortarr [ ] = new int [ size ] ; int ans [ ] [ ] = new int [ size ] [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; sortarr [ i ] = arr [ i ] ; } Arrays . sort ( sortarr ) ; int swap = 0 , temp = 0 ; for ( int i = 0 ; i < size ; i ++ ) { if ( arr [ i ] == sortarr [ i ] ) continue ; else { for ( int j = i + 1 ; j < size ; j ++ ) { if ( arr [ j ] == sortarr [ i ] ) { int tem = arr [ j ] ; arr [ j ] = arr [ i ] ; arr [ i ] = tem ; swap ++ ; ans [ temp ++ ] [ 0 ] = i ; ans [ temp - 1 ] [ 1 ] = j ; break ; } } } } System . out . println ( swap ) ; for ( int i = 0 ; i < temp ; i ++ ) System . out . println ( ans [ i ] [ 0 ] + " ▁ " + ans [ i ] [ 1 ] ) ; } }


import java . util . * ; import java . io . * ; import java . math . * ;   public class Main { static class Pair { int a ; int b ; Pair ( int a , int b ) { this . a = a ; this . b = b ; } }   private static int MAX = Integer . MAX_VALUE ; private static int MIN = Integer . MIN_VALUE ; private static int MOD = 1000000007 ; static FastScanner sc = new FastScanner ( ) ;   public static void main ( String [ ] args ) throws IOException {


import java . util . * ;   public class swap_sort_c_2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } ArrayList < Integer > list = new ArrayList < > ( ) ; int index = 0 ; int swaps = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int min = index ; for ( int j = index ; j < n ; j ++ ) { if ( arr [ j ] < arr [ min ] ) min = j ; } if ( min != index ) { list . add ( min ) ; list . add ( index ) ; swaps ++ ; } int temp = arr [ index ] ; arr [ index ] = arr [ min ] ; arr [ min ] = temp ; index ++ ; } System . out . println ( swaps ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { if ( i % 2 == 0 && i != 0 ) System . out . println ( ) ; System . out . print ( list . get ( i ) + " ▁ " ) ; } } }


import java . util . Scanner ; public class Main {   public static void main ( String [ ] args ) { Scanner SC = new Scanner ( System . in ) ; int N , Cnt = 0 , A [ ] , B [ ] [ ] , Min , ID , Tmp ; N = SC . nextInt ( ) ; A = new int [ N ] ; B = new int [ 2 ] [ N ] ; for ( int i = 0 ; i < N ; i ++ ) A [ i ] = SC . nextInt ( ) ;


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

n , m = map ( int , input ( ) . split ( ) ) s = set ( ) for t in range ( n ) : arr = list ( map ( int , input ( ) . split ( ) ) ) for i in arr [ 1 : ] : s . add ( i ) if len ( s ) == m : print ( " YES " ) else : print ( " NO " ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) x = [ ] s = set ( ) for i in range ( n ) : x += [ list ( map ( int , input ( ) . split ( ) ) ) ] x [ i ] [ 0 ] = ' i ' for i in range ( n ) : for j in range ( 1 , len ( x [ i ] ) ) : s . add ( x [ i ] [ j ] ) if len ( s ) == m : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


buttons , bulbs = map ( int , input ( ) . split ( ) ) storage = [ ] s = set ( ) for i in range ( buttons ) : storage += [ list ( map ( int , input ( ) . split ( ) ) ) ] storage [ i ] [ 0 ] = ' i ' for i in range ( buttons ) : for j in range ( 1 , len ( storage [ i ] ) ) : s . add ( storage [ i ] [ j ] ) if len ( s ) == bulbs : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


def main_function ( ) : n , m = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] collector = [ 0 for i in range ( m + 1 ) ] for i in range ( n ) : l = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] for i in range ( 1 , len ( l ) ) : collector [ l [ i ] ] += 1 NEW_LINE


def main ( ) : n , m = map ( int , input ( ) . split ( ) ) lights = [ ] for _ in range ( n ) : lights += list ( map ( int , input ( ) . split ( ) ) ) [ 1 : ] count_light = set ( lights ) if 0 in count_light and len ( count_light ) - 1 == m : print ( " YES " ) elif 0 not in count_light and len ( count_light ) == m : print ( " YES " ) else : print ( " NO " )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import java . util . HashSet ; import java . util . Scanner ; import java . util . Set ;   public class Main {   public static void main ( String [ ] args ) { int n , m ; int bulbs ; Scanner sc = new Scanner ( System . in ) ; Set < Integer > onBulbs = new HashSet < > ( ) ; n = sc . nextInt ( ) ; m = sc . nextInt ( ) ;   for ( int i = 1 ; i <= n ; i ++ ) { bulbs = sc . nextInt ( ) ; int temp ; for ( int j = 1 ; j <= bulbs ; j ++ ) { temp = sc . nextInt ( ) ; onBulbs . add ( temp ) ; } }    if ( m == onBulbs . size ( ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ;    } }


import java . io . * ; import java . util . * ;   public class Prb2 {   static PrintWriter pw ; static Scanner sc ; static long mod = 1000000000 + 7 ;   static void print ( final String arg ) { pw . write ( arg ) ; pw . flush ( ) ; }   static int ni ( ) { return sc . nextInt ( ) ; } static long nl ( ) { return sc . nextLong ( ) ; }   static void runFile ( ) throws Exception {   sc = new Scanner ( new FileReader ( " input . txt " ) ) ; pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( " output . txt " ) ) ) ; }   static void runIo ( ) throws Exception {   pw = new PrintWriter ( System . out ) ; sc = new Scanner ( System . in ) ; }   static boolean sv [ ] = new boolean [ 1000002 ] ;   static void seive ( ) {


import java . util . Arrays ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class Bulbs { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   StringTokenizer tokenizer = new StringTokenizer ( scanner . nextLine ( ) ) ; int n = Integer . parseInt ( tokenizer . nextToken ( ) ) ; int m = Integer . parseInt ( tokenizer . nextToken ( ) ) ;   boolean [ ] arr = new boolean [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { StringTokenizer lineTok = new StringTokenizer ( scanner . nextLine ( ) ) ; int r = Integer . parseInt ( lineTok . nextToken ( ) ) ; for ( int j = 0 ; j < r ; j ++ ) { int i1 = Integer . parseInt ( lineTok . nextToken ( ) ) ; arr [ i1 - 1 ] = true ; } }   boolean allMatch = true ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( ! arr [ i ] ) { allMatch = false ; } }   System . out . println ( allMatch ? " YES " : " NO " ) ;   } }


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . util . * ; public class cdf39b { static void merge ( int arr [ ] , int l , int m , int r ) { int n1 = m - l + 1 ; int n2 = r - m ; int L [ ] = new int [ n1 ] ; int R [ ] = new int [ n2 ] ; for ( int i = 0 ; i < n1 ; ++ i ) L [ i ] = arr [ l + i ] ; for ( int j = 0 ; j < n2 ; ++ j ) R [ j ] = arr [ m + 1 + j ] ; int i = 0 , j = 0 ; int k = l ; while ( i < n1 && j < n2 ) { if ( L [ i ] <= R [ j ] ) { arr [ k ] = L [ i ] ; i ++ ; } else { arr [ k ] = R [ j ] ; j ++ ; } k ++ ; } while ( i < n1 ) { arr [ k ] = L [ i ] ; i ++ ; k ++ ; } while ( j < n2 ) { arr [ k ] = R [ j ] ; j ++ ; k ++ ; } } static void sort ( int arr [ ] , int l , int r ) { if ( l < r ) { int m = ( l + r ) / 2 ; sort ( arr , l , m ) ; sort ( arr , m + 1 , r ) ; merge ( arr , l , m , r ) ; } } public static int lowerBound ( int [ ] array , int length , int value ) { int low = 0 ; int high = length ; while ( low < high ) { final int mid = ( low + high ) / 2 ;

a = int ( input ( ) ) ; p = [ ] for i , j in enumerate ( map ( int , input ( ) . split ( ) ) ) : if j > 0 : p . append ( [ 2000 + i + 1 , j ] ) p = sorted ( p ) ; t = 1 ; ok = 0 ; o = [ ] for i in range ( len ( p ) ) : if p [ i ] [ 0 ] > ok and t == p [ i ] [ 1 ] : o . append ( p [ i ] [ 0 ] ) ; ok = p [ i ] [ 0 ] ; t += 1 print ( t - 1 ) ; print ( * o ) NEW_LINE


n = int ( input ( ) ) p = 2000 a = list ( map ( int , input ( ) . split ( ) ) ) ans = [ ] income = 0 for i in range ( 0 , len ( a ) ) : if a [ i ] > 0 and a [ i ] - income == 1 : ans . append ( p + ( i + 1 ) ) income = a [ i ] print ( len ( ans ) ) if len ( ans ) == 0 : exit ( ) print ( * ans ) NEW_LINE


from sys import stdin , stdout     years = int ( input ( ) )   incomes = list ( map ( int , list ( stdin . readline ( ) . split ( ' ▁ ' ) ) ) )   respuestas = list ( ) cnt = 1     for x in range ( years ) : if incomes [ x ] == cnt : respuestas . append ( str ( 2000 + x + 1 ) ) cnt += 1 print ( len ( respuestas ) ) if respuestas : print ( ' ▁ ' . join ( respuestas ) ) NEW_LINE


n = int ( input ( ) ) b = list ( map ( int , input ( ) . split ( ) ) ) s = [ 0 ] x = 0 g = [ ] for i in b : x += 1 if i >= 1 and i - max ( s ) == 1 : g . append ( 2000 + x ) s . append ( i ) else : continues . remove ( 0 ) k = list ( zip ( g , s ) ) h = [ ] for p in range ( len ( k ) ) : h . append ( k [ p ] [ 0 ] ) if len ( s ) == 0 : print ( 0 ) else : print ( len ( h ) ) print ( * h ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Tournament { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ;   int t = 1 ;   while ( t -- > 0 ) { int n = Integer . parseInt ( br . readLine ( ) . trim ( ) ) ; int a [ ] = new int [ n ] ; String str [ ] = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( str [ i ] ) ; }   int find = 1 ; ArrayList < Integer > li = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == find ) { li . add ( 2001 + i ) ; find ++ ; } }   pw . println ( li . size ( ) ) ; for ( int x : li ) pw . print ( x + " ▁ " ) ; } pw . flush ( ) ; }   }


import java . util . Scanner ; public class LongPath {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; long [ ] [ ] rooms = new long [ n ] [ 3 ] ; for ( int i = 0 ; i < n ; i ++ ) { rooms [ i ] [ 0 ] = scanner . nextInt ( ) - 1 ; } scanner . close ( ) ; long output = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int pointer = ( int ) rooms [ i ] [ 0 ] ; rooms [ i ] [ 2 ] = output ; long portalValue = 2 ; for ( int j = pointer ; j < i ; j ++ ) { portalValue = ( portalValue + rooms [ j ] [ 1 ] ) % 1000000007 ; } rooms [ i ] [ 1 ] = portalValue ; output = ( output + portalValue ) % 1000000007 ; } System . out . println ( output ) ; } }

import sysinput = sys . stdin . readline   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) d = [ 0 ] * ( n + 1 ) MOD = int ( 1e9 + 7 )   for i in range ( 0 , n ) : d [ i + 1 ] = ( d [ i ] + ( d [ i ] - d [ a [ i ] - 1 ] ) + 2 + MOD ) % MOD print ( d [ n ] ) ; NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) values = [ 0 for k in range ( n ) ] for k in range ( n ) : back = a [ k ] if a [ k ] == k + 1 : values [ k ] = 2 else : values [ k ] += 2 for t in range ( a [ k ] - 1 , k ) : values [ k ] += values [ t ] values [ k ] %= int ( 1e9 + 7 ) print ( int ( sum ( values ) % ( 1e9 + 7 ) ) ) NEW_LINE


n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) dp = [ 0 ] * ( n + 1 ) dp [ 1 ] = 2 for i in range ( 2 , n + 1 ) : c = 0 for j in range ( p [ i - 1 ] , i ) : c += dp [ j ] dp [ i ] = c + 2 print ( sum ( dp ) % ( 10 ** 9 + 7 ) ) NEW_LINE


import sysMOD = 10 ** 9 + 7 N = int ( input ( ) ) bs = [ int ( b ) - 1 for b in input ( ) . split ( ) ] fs = [ 0 ] for i in range ( 1 , N + 1 ) : f = 2 * fs [ i - 1 ] + 2 - fs [ bs [ i - 1 ] ] fs . append ( f % MOD ) print ( fs [ - 1 ] ) NEW_LINE


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


import java . io . * ; import java . util . * ; import java . lang . * ;   public class pracs { public static int dp [ ] ; public static int [ ] arr ; public static int MOD = ( int ) ( 1e9 + 7 ) ; public static void main ( String [ ] args ) { FastReader in = new FastReader ( ) ; int n = in . nextInt ( ) ; arr = new int [ n + 2 ] ; for ( int i = 1 ; i <= n ; i ++ ) arr [ i ] = in . nextInt ( ) ; dp = new int [ n + 2 ] ;


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

import sysimport collectionsimport itertools   n = int ( input ( ) ) if n <= 10 : print ( '0' ) elif n > 21 : print ( '0' ) elif n < 20 : print ( '4' ) elif n == 20 : print ( '15' ) else : print ( '4' ) NEW_LINE


n = int ( input ( ) ) if 0 <= n <= 10 : print ( 0 ) elif n == 11 : print ( 4 ) elif 12 <= n <= 19 : print ( 4 ) elif n == 20 : print ( 15 ) elif n == 21 : print ( 4 ) elif 22 <= n <= 25 : print ( 0 ) NEW_LINE


n = int ( input ( ) ) if ( n < 10 ) : print ( 0 ) else : n = n - 10 if ( n == 0 or n > 11 ) : print ( 0 ) elif ( n == 10 ) : print ( 15 ) else : print ( 4 ) NEW_LINE


n = int ( input ( ) )   n -= 10   if n <= 0 : print ( 0 )   elif n < 10 or n == 11 : print ( 4 )   elif n == 10 : print ( 15 )   else : print ( 0 ) NEW_LINE


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


import java . util . * ; import java . util . Scanner ; public class Blackjack { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) - 10 ; if ( n < 1 || n > 11 ) System . out . print ( 0 ) ; else if ( n == 10 ) System . out . print ( 15 ) ; else System . out . print ( 4 ) ; } }


import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a1 = 4 , a2 = 4 , a3 = 4 , a4 = 4 , a5 = 4 , a6 = 4 , a7 = 4 , a8 = 4 , a9 = 4 , a10 = 15 ; int x = n - 10 ; if ( x == 0 || n < 10 || x > 11 ) System . out . println ( 0 ) ; else { if ( x == 1 || x == 11 ) System . out . println ( a1 ) ; if ( x == 2 ) System . out . println ( a2 ) ; if ( x == 3 ) System . out . println ( a3 ) ; if ( x == 4 ) System . out . println ( a4 ) ; if ( x == 5 ) System . out . println ( a5 ) ; if ( x == 6 ) System . out . println ( a6 ) ; if ( x == 7 ) System . out . println ( a7 ) ; if ( x == 8 ) System . out . println ( a8 ) ; if ( x == 9 ) System . out . println ( a9 ) ; if ( x == 10 ) System . out . println ( a10 ) ; } } }


# include < iostream > using namespace std ; bool map [ 3 ] [ 1000010 ] = { 0 } ; int main ( ) { int n , q , x , y ; cin >> n >> q ; int wall = 0 ;


def solve ( n , quer , change ) : matrix = [ [ 0 ] * ( n + 1 ) for _ in range ( 3 ) ] block = 0 for x , y in change : if matrix [ x ] [ y ] == 0 : matrix [ x ] [ y ] = 1 if x - 1 > 0 : if matrix [ x - 1 ] [ y ] == 1 : block += 1 if y - 1 > 0 and matrix [ x - 1 ] [ y - 1 ] == 1 : block += 1 if y + 1 <= n and matrix [ x - 1 ] [ y + 1 ] == 1 : block += 1 else : if matrix [ x + 1 ] [ y ] == 1 : block += 1 if y - 1 > 0 and matrix [ x + 1 ] [ y - 1 ] == 1 : block += 1 if y + 1 <= n and matrix [ x + 1 ] [ y + 1 ] == 1 : block += 1 else : matrix [ x ] [ y ] = 0 if x - 1 > 0 : if matrix [ x - 1 ] [ y ] == 1 : block -= 1 if y - 1 > 0 and matrix [ x - 1 ] [ y - 1 ] == 1 : block -= 1 if y + 1 <= n and matrix [ x - 1 ] [ y + 1 ] == 1 : block -= 1 else : if matrix [ x + 1 ] [ y ] == 1 : block -= 1 if y - 1 > 0 and matrix [ x + 1 ] [ y - 1 ] == 1 : block -= 1 if y + 1 <= n and matrix [ x + 1 ] [ y + 1 ] == 1 : block -= 1 if block == 0 : print ( " YES " ) else : print ( " NO " ) n , q = list ( map ( int , input ( ) . split ( ) ) ) m = [ ] for _ in range ( q ) : m . append ( list ( map ( int , input ( ) . split ( ) ) ) ) solve ( n , q , m ) NEW_LINE


from sys import stdin , stdoutinput = stdin . readline def main ( ) : NEW_LINE


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


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 ;   public class First {   public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; int t ;


import java . io . BufferedReader ; import java . io . File ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   import javafx . util . Pair ;   public class Main {   public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; int q = input . nextInt ( ) ; int bad = 0 ; boolean check [ ] [ ] = new boolean [ 3 ] [ n + 1 ] ; StringBuilder ans = new StringBuilder ( ) ; for ( int i = 0 ; i < q ; i ++ ) { int x = input . nextInt ( ) ; int y = input . nextInt ( ) ; if ( ! check [ x ] [ y ] ) { check [ x ] [ y ] = true ; if ( y - 1 >= 1 && check [ 3 - x ] [ y - 1 ] ) { bad ++ ; } if ( y + 1 <= n && check [ 3 - x ] [ y + 1 ] ) { bad ++ ; } if ( check [ 3 - x ] [ y ] ) bad ++ ; } else { check [ x ] [ y ] = false ; if ( y - 1 >= 1 && check [ 3 - x ] [ y - 1 ] ) { bad -- ; } if ( y + 1 <= n && check [ 3 - x ] [ y + 1 ] ) { bad -- ; } if ( check [ 3 - x ] [ y ] ) bad -- ; } if ( bad >= 1 ) { ans . append ( " NO \n " ) ; } else ans . append ( " YES \n " ) ;


import java . util . Scanner ;   public class n25A { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int e_index = 0 ; int o_index = 0 ; int a ; int flag = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { a = scanner . nextInt ( ) ; if ( a % 2 == 0 ) if ( e_index == 0 ) e_index = i + 1 ; else flag = 1 ; if ( a % 2 == 1 ) if ( o_index == 0 ) o_index = i + 1 ; else flag = 0 ;   } if ( flag == 1 ) System . out . println ( o_index ) ; else System . out . println ( e_index ) ; } }

def f ( x ) : return ( x % 2 ) n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) s = 0 for i in range ( n ) : s += f ( a [ i ] ) if s == ( n - 1 ) : k = 2 i = 0 while k > 0 : k = f ( a [ i ] ) i += 1 print ( i ) else : k = - 1 i = 0 while k < 1 : k = f ( a [ i ] ) i += 1 print ( i ) NEW_LINE


from collections import * N = int ( input ( ) ) Lst = deque ( map ( int , input ( ) . split ( ) ) ) NLst = list ( Lst ) ( Lst1 , Lst2 ) = ( deque ( ) , deque ( ) ) for i in range ( N ) : if Lst [ i ] % 2 == 0 : Lst1 . append ( Lst [ i ] ) else : Lst2 . append ( Lst [ i ] ) if len ( Lst1 ) == 1 : print ( NLst . index ( Lst1 [ 0 ] ) + 1 ) else : print ( NLst . index ( Lst2 [ 0 ] ) + 1 ) NEW_LINE


input ( ) ; l = [ int ( x ) % 2 for x in input ( ) . split ( ) ] print ( l . index ( sum ( l ) == 1 ) + 1 ) NEW_LINE


n = int ( input ( ) ) arr = list ( int ( x ) for x in input ( ) . split ( ) ) even = 0 for i in arr : if i % 2 == 0 : even += 1   if even == n - 1 : for i in range ( len ( arr ) ) : if arr [ i ] % 2 != 0 : print ( i + 1 ) breakelif even == 1 : for i in range ( len ( arr ) ) : if arr [ i ] % 2 == 0 : print ( i + 1 ) break NEW_LINE


n = int ( input ( ) ) odd = 0 even = 0 oddNum = 0 evenNum = 0 a = input ( ) item = a . split ( " ▁ " ) testi = [ eval ( x ) for x in item ] for i in range ( 0 , n ) : if testi [ i ] % 2 == 0 : even += 1 evenNum = i + 1 else : odd += 1 oddNum = i + 1 if odd == 1 : print ( oddNum ) if even == 1 : print ( evenNum ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st ; int N = Integer . parseInt ( br . readLine ( ) ) ; int even = 0 , odd = 0 , evenIdx = 0 , oddIdx = 0 ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) { int temp = Integer . parseInt ( st . nextToken ( ) ) ; if ( temp % 2 == 0 ) {


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scn = new Scanner ( System . in ) ; int n = scn . nextInt ( ) ; scn . nextLine ( ) ; int [ ] arrayt = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arrayt [ i ] = scn . nextInt ( ) ; } selectEvenness ( arrayt ) ; scn . close ( ) ; } public static void selectEvenness ( int [ ] array ) { int count_even = 0 , count_odd = 0 , num1 = 0 , num2 = 0 , index_odd = 0 , index_even = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] % 2 == 1 ) { count_odd ++ ; index_odd = i + 1 ; } else if ( array [ i ] % 2 == 0 ) { count_even ++ ; index_even = i + 1 ; } if ( count_even == 1 && count_odd > 1 ) { System . out . println ( index_even ) ; break ; } else if ( count_odd == 1 && count_even > 1 ) { System . out . println ( index_odd ) ; break ; } } } }


import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ;   public class solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] numbers = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { numbers [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( i == 0 ) { if ( numbers [ i ] % 2 != numbers [ i + 1 ] % 2 && numbers [ i ] % 2 != numbers [ i + 2 ] % 2 ) { System . out . println ( i + 1 ) ; break ; } continue ; } else if ( i == n - 1 ) { if ( numbers [ i ] % 2 != numbers [ i - 1 ] % 2 && numbers [ i ] % 2 != numbers [ i - 2 ] % 2 ) { System . out . println ( i + 1 ) ; break ; } continue ; } if ( numbers [ i ] % 2 != numbers [ i - 1 ] % 2 && numbers [ i ] % 2 != numbers [ i + 1 ] % 2 ) { System . out . print ( i + 1 ) ; break ; } } } }


import java . util . Scanner ;   public class main {   public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ;   int n = input . nextInt ( ) ; int [ ] arr = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = input . nextInt ( ) ; }   int evenOccurance = 0 ; int oddOccurance = 0 ; int ifEven = 0 , ifOdd = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 0 ) { evenOccurance ++ ; ifEven = i + 1 ; } else if ( arr [ i ] % 2 != 0 ) { oddOccurance ++ ; ifOdd = i + 1 ; } } if ( oddOccurance == 1 ) { System . out . println ( ifOdd ) ; } else if ( evenOccurance == 1 ) { System . out . println ( ifEven ) ; }   return ;   } }


import java . util . * ; import java . io . * ; import java . text . DecimalFormat ;    public class berland {    static DecimalFormat df1 = new DecimalFormat ( " # .000000" ) ; static DecimalFormat df = new DecimalFormat ( " # . # # # # # # " ) ; static boolean printing = false ;   static int N ;   static long total = 0L ; static int A = 10000001 ;   public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ;

for _ in range ( int ( input ( ) ) ) : flag = 0 NEW_LINE n , u , r , d , l = map ( int , input ( ) . split ( ) ) NEW_LINE for i in range ( 0 , 2 ) : for NEW_LINE j in range ( 0 , 2 ) : NEW_LINE for k in range ( 0 , 2 ) : for NEW_LINE m in range ( 0 , 2 ) : NEW_LINE if 0 <= u - i - j <= n - 2 and 0 <= r - j - k <= n - 2 and 0 <= d - k - m <= n - 2 and 0 <= l - i - m <= n - 2 : flag = 1 NEW_LINE if flag == 0 : NEW_LINE INDENT print ( " NO " ) else : NEW_LINE print ( " YES " ) NEW_LINE DEDENT


import sys   r = sys . stdin . readline   t = int ( r ( ) )   for tests in range ( t ) : arr = [ int ( item ) for item in r ( ) . split ( ) ] NEW_LINE n = arr [ 0 ] NEW_LINE flag = True NEW_LINE for i in range ( 16 , 32 ) : flag = True NEW_LINE secarr = arr [ 1 : ] NEW_LINE for j in range ( 4 ) : secarr [ j ] -= ( int ( bin ( i ) [ 3 : ] [ j ] ) + int ( bin ( i ) [ 3 : ] [ ( j - 1 ) % 4 ] ) ) NEW_LINE for j in secarr : if NEW_LINE j < 0 or j > n - 2 : flag = False NEW_LINE break NEW_LINE if flag : break   if flag : NEW_LINE INDENT print ( " YES " ) else : NEW_LINE print ( " NO " )                                       NEW_LINE DEDENT


for _ in range ( int ( input ( ) ) ) : n , U , R , D , L = map ( int , input ( ) . split ( ) ) NEW_LINE for mask in range ( 16 ) : rU , rR , rD , rL = U , R , D , L NEW_LINE if mask & 1 : rU -= 1 NEW_LINE rL -= 1 NEW_LINE if mask & 2 : rL -= 1 NEW_LINE rD -= 1 NEW_LINE if mask & 4 : rD -= 1 NEW_LINE rR -= 1 NEW_LINE if mask & 8 : rR -= 1 NEW_LINE rU -= 1 NEW_LINE if min ( rU , rR , rD , rL ) >= 0 and max ( rU , rR , rD , rL ) <= n - 2 : print ( " YES " ) NEW_LINE break else : print ( " NO " ) NEW_LINE


t = int ( input ( ) ) NEW_LINE bit = 1 << 4 NEW_LINE for _ in range ( t ) : n , u , r , d , l = map ( int , input ( ) . split ( ) ) NEW_LINE yes = False NEW_LINE for mask in range ( bit ) : ur = mask & 1 NEW_LINE dr = ( mask >> 1 ) & 1 NEW_LINE dl = ( mask >> 2 ) & 1 NEW_LINE ul = ( mask >> 3 ) & 1 NEW_LINE u2 = u - ul - ur NEW_LINE r2 = r - ur - dr NEW_LINE d2 = d - dr - dl NEW_LINE l2 = l - dl - ul   if 0 <= min ( u2 , r2 , d2 , l2 ) and max ( u2 , r2 , d2 , l2 ) <= n - 2 : yes = True NEW_LINE break NEW_LINE if yes : NEW_LINE INDENT print ( ' YES ' ) else : NEW_LINE print ( ' NO ' )   NEW_LINE DEDENT


for _ in range ( int ( input ( ) ) ) : n , U , R , D , L = map ( int , input ( ) . split ( ) ) NEW_LINE ans = ' NO ' NEW_LINE for a in range ( 2 ) : for NEW_LINE b in range ( 2 ) : NEW_LINE for c in range ( 2 ) : for NEW_LINE d in range ( 2 ) : NEW_LINE if 0 <= U - a - b <= n - 2 and 0 <= R - b - c <= n - 2 and 0 <= D - c - d <= n - 2 and 0 <= L - d - a <= n - 2 : ans = ' YES ' NEW_LINE print ( ans ) NEW_LINE


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; 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 . List ; import java . util . Map ; import java . util . PriorityQueue ; import java . util . Set ; import java . util . Stack ; import java . util . StringTokenizer ; import java . util . TreeMap ; import java . util . TreeSet ; import java . util . function . Function ; import java . util . stream . Collectors ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;    public class Solution {   public static int INF = Integer . MAX_VALUE ; public static long MOD = 1000000000 + 7L ;   public static int WHITE = 0 ; public static int GRAY = 1 ; public static int BLACK = 2 ;    class Pair { public int day ; int count ;   Pair ( int d , int c ) { day = d ; count = c ; } }   static class Solver {   public void solve ( InputReader in , PrintWriter out ) { int tt = in . nextInt ( ) ;


import java . util . * ; import java . math . * ; public class BerlandCrossword { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int runs = sc . nextInt ( ) ; while ( runs -- > 0 ) { int n = sc . nextInt ( ) ; boolean works = true ; int [ ] hold = new int [ 4 ] ; int [ ] arr = new int [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; hold [ i ] = arr [ i ] ; }


import java . util . * ; public class planetlapituletti1300 {   static int [ ] reflect = new int [ ] { 0 , 1 , 5 , - 1 , - 1 , 2 , - 1 , - 1 , 8 , - 1 } ; public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ; int T = sc . nextInt ( ) ; StringBuilder str = new StringBuilder ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int h = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; String tm = sc . next ( ) ; int H = Integer . parseInt ( Character . toString ( tm . charAt ( 0 ) ) + Character . toString ( tm . charAt ( 1 ) ) ) ; int M = Integer . parseInt ( Character . toString ( tm . charAt ( 3 ) ) + Character . toString ( tm . charAt ( 4 ) ) ) ; Time time = new Time ( H , M , h , m ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { if ( time . checkValid ( ) ) {

def check ( curr ) : ones , tens = curr % 10 , curr // 10 NEW_LINE if ones in d and tens in d : return d [ ones ] * 10 + d [ tens ] NEW_LINE return 10 ** 5 NEW_LINE d = { 1 : 1 , 2 : 5 , 5 : 2 , 8 : 8 , 0 : 0 } NEW_LINE for _ in range ( int ( input ( ) ) ) : h , m = map ( int , input ( ) . split ( ) ) NEW_LINE x , y = map ( int , input ( ) . split ( " : " ) ) NEW_LINE while True : if NEW_LINE check ( x ) < m and check ( y ) < h : NEW_LINE break NEW_LINE y += 1 NEW_LINE if y == m : y = 0 NEW_LINE x = ( x + 1 ) % h NEW_LINE print ( str ( x ) . rjust ( 2 , "0" ) + " : " + str ( y ) . rjust ( 2 , "0" ) ) NEW_LINE


p = { '5' : '2' , '2' : '5' , '1' : '1' , '0' : '0' , '8' : '8' } NEW_LINE for _ in range ( int ( input ( ) ) ) : h , m = [ int ( i ) for i in input ( ) . split ( ) ] NEW_LINE a , b = input ( ) . split ( " : " ) NEW_LINE for _ in range ( 50000 ) : if NEW_LINE any ( e not in p for e in a + b ) : NEW_LINE if int ( b ) == m - 1 : if NEW_LINE int ( a ) != h - 1 : a = '0' * ( a [ 0 ] == '0' ) * ( a [ 1 ] < '9' ) + str ( int ( a ) + 1 ) NEW_LINE b = '00' NEW_LINE continue else : a = '00' NEW_LINE b = '00' NEW_LINE continue else : b = '0' * ( b [ 0 ] == '0' ) * ( b [ 1 ] < '9' ) + str ( int ( b ) + 1 ) NEW_LINE continue else : if int ( p [ b [ 1 ] ] + p [ b [ 0 ] ] ) < h and int ( p [ a [ 1 ] ] + p [ a [ 0 ] ] ) < m : print ( a + " : " + b ) NEW_LINE break else : if int ( b ) == m - 1 : if NEW_LINE int ( a ) != h - 1 : a = '0' * ( a [ 0 ] == '0' ) * ( a [ 1 ] < '9' ) + str ( int ( a ) + 1 ) NEW_LINE b = '00' NEW_LINE continue else : a = '00' NEW_LINE b = '00' NEW_LINE continue else : b = '0' * ( b [ 0 ] == '0' ) * ( b [ 1 ] < '9' ) + str ( int ( b ) + 1 ) NEW_LINE continue NEW_LINE


import sysimport NEW_LINE itertoolsimport NEW_LINE collections   NEW_LINE def rs ( x = ' ' ) : if NEW_LINE len ( x ) == 0 : NEW_LINE return sys . stdin . readline ( ) . strip ( ) NEW_LINE return input ( x ) . strip ( )   NEW_LINE def ri ( x = ' ' ) : return int ( rs ( x ) ) NEW_LINE def rm ( x = ' ' ) : return map ( str , rs ( x ) . split ( ) ) NEW_LINE def rl ( x = ' ' ) : return rs ( x ) . split ( ) NEW_LINE def rmi ( x = ' ' ) : return map ( int , rl ( x ) ) NEW_LINE def rli ( x = ' ' ) : return [ int ( val ) for val in rl ( x ) ] NEW_LINE def println ( val ) : sys . stdout . write ( str ( val ) + ' \n ' ) NEW_LINE   NEW_LINE def mirror ( val ) : mirrored = [ 0 , 1 , 5 , - 1 , - 1 , 2 , - 1 , - 1 , 8 , - 1 ] NEW_LINE a , b = val // 10 , val % 10 NEW_LINE if mirrored [ a ] == - 1 or mirrored [ b ] == - 1 : return - 1 NEW_LINE return mirrored [ b ] * 10 + mirrored [ a ]   NEW_LINE def solve ( testCase ) : h , m = rmi ( ) NEW_LINE time = rs ( ) NEW_LINE hour , minute = time [ : 2 ] , time [ 3 : ] NEW_LINE hour = int ( hour ) * m + int ( minute ) NEW_LINE while True : h2 , m2 = mirror ( hour // m % h ) , mirror ( hour % m ) NEW_LINE h2 , m2 = m2 , h2 NEW_LINE if h2 >= 0 and m2 >= 0 and h2 < h and m2 < m : break NEW_LINE hour += 1 NEW_LINE h = hour // m % h NEW_LINE m = hour % m NEW_LINE ans = [ ] NEW_LINE if h < 10 : ans += [ '0' ] NEW_LINE ans += [ str ( h ) , ' : ' ] NEW_LINE if m < 10 : ans += [ '0' ] NEW_LINE ans += [ str ( m ) ] NEW_LINE


import sys , mathimport NEW_LINE heapq   from collections import NEW_LINE INDENT dequeinput = sys . stdin . readline   NEW_LINE DEDENT


def inpl ( ) : return list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE   NEW_LINE def inpi ( ) : return int ( input ( ) ) NEW_LINE   r = { '0' : '0' , '1' : '1' , '2' : '5' , '5' : '2' , '8' : '8' , ' : ' : ' : ' } NEW_LINE def refl ( d ) : if NEW_LINE d in r : NEW_LINE return r [ d ] else : return ' x '   NEW_LINE def to_h ( h , m ) : rr = '0' if h < 10 else ' ' NEW_LINE rr += str ( h ) NEW_LINE rr += ' : ' NEW_LINE rr += '0' if m < 10 else ' ' NEW_LINE rr += str ( m ) NEW_LINE return rr   NEW_LINE def from_h ( h ) : return list ( map ( int , h . split ( ' : ' ) ) ) NEW_LINE   NEW_LINE def mirror ( h ) : return ' ' . join ( [ refl ( d ) for d in h [ : : - 1 ] ] ) NEW_LINE   NEW_LINE def is_mirror ( h ) : return mirror ( h ) == h NEW_LINE   NEW_LINE def is_legal ( ch , cm , h , m ) : return ch < h and cm < m NEW_LINE   NEW_LINE def inc ( ch , cm , h , m ) : cm += 1 NEW_LINE ch += cm // m NEW_LINE cm = cm % m NEW_LINE ch = ch % h NEW_LINE return ch , cm   NEW_LINE def f ( ) : h , m = inpl ( ) NEW_LINE sh , sm = list ( map ( int , input ( ) . split ( ' : ' ) ) ) NEW_LINE while True : st = to_h ( sh , sm ) NEW_LINE mt = mirror ( st ) NEW_LINE