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

import java . io . * ; import java . util . * ;   public class Main { static int N = 2 * ( int ) 1e5 ; static int [ ] temp ; static int [ ] prefixSum ;   public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; temp = new int [ N + 5 ] ; int n = in . nextInt ( ) , k = in . nextInt ( ) , m = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = in . nextInt ( ) , b = in . nextInt ( ) ; temp [ a ] ++ ; temp [ b + 1 ] -- ; } for ( int i = 1 ; i <= N ; i ++ ) { temp [ i ] += temp [ i - 1 ] ; } prefixSum = new int [ N + 5 ] ; for ( int i = 0 ; i <= N ; i ++ ) { if ( temp [ i ] >= k ) prefixSum [ i ] = 1 ; } for ( int i = 1 ; i <= N ; i ++ ) { prefixSum [ i ] += prefixSum [ i - 1 ] ; }

import java . io . * ; import java . util . * ;   public class Main { static int N = 2 * ( int ) 1e5 ; static int [ ] temp ; static int [ ] prefixSum ;   public static void main ( String [ ] args ) throws IOException { FastReader in = new FastReader ( System . in ) ; PrintWriter pw = new PrintWriter ( System . out ) ; temp = new int [ N + 5 ] ; int n = in . nextInt ( ) , k = in . nextInt ( ) , m = in . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = in . nextInt ( ) , b = in . nextInt ( ) ; temp [ a ] ++ ; temp [ b + 1 ] -- ; } for ( int i = 1 ; i <= N ; i ++ ) { temp [ i ] += temp [ i - 1 ] ; } prefixSum = new int [ N + 5 ] ; for ( int i = 0 ; i <= N ; i ++ ) { if ( temp [ i ] >= k ) prefixSum [ i ] = 1 ; } for ( int i = 1 ; i <= N ; i ++ ) { prefixSum [ i ] += prefixSum [ i - 1 ] ; }

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

import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , k = in . nextInt ( ) , q = in . nextInt ( ) ; int ara [ ] = new int [ 200010 ] ; for ( int i = 0 ; i < n ; i ++ ) { int x = in . nextInt ( ) ; int y = in . nextInt ( ) ; ara [ x ] ++ ; ara [ y + 1 ] -- ; } int value = 0 ; for ( int i = 0 ; i < ara . length ; i ++ ) { value += ara [ i ] ; if ( value >= k ) { ara [ i ] = 1 ; } else { ara [ i ] = 0 ; } }   for ( int i = 1 ; i < ara . length ; i ++ )

import sysinput = sys . stdin . readline     n , k , q = map ( int , input ( ) . split ( ) )     t = [ 0 ] * ( 200002 ) b = [ 0 ] * ( 200002 )     for j in range ( n ) : x , y = map ( int , input ( ) . split ( ) )   t [ x ] += 1 t [ y + 1 ] -= 1     for j in range ( 1 , 200002 ) : t [ j ] += t [ j - 1 ]   if t [ j ] >= k : b [ j ] = 1 b [ j ] += b [ j - 1 ]   while q > 0 : a , r = map ( int , input ( ) . split ( ) )   print ( b [ r ] - b [ a - 1 ] ) q -= 1 NEW_LINE

n , k , q = map ( int , input ( ) . split ( ) )   c = [ 0 ] * 200002 p = [ 0 ] * 200002   for i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) p [ a ] += 1 p [ b + 1 ] -= 1 for i in range ( 1 , 200002 ) : p [ i ] += p [ i - 1 ] c [ i ] = c [ i - 1 ] + ( p [ i ] >= k ) l = [ ] for i in range ( q ) : a , b = map ( int , input ( ) . split ( ) ) print ( c [ b ] - c [ a - 1 ] ) 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 . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int aa [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { aa [ i ] = sc . nextInt ( ) ; } Arrays . sort ( aa ) ; int p = aa [ n - a ] - aa [ n - a - 1 ] ; if ( p > 0 ) { System . out . println ( p ) ; } else { System . out . println ( 0 ) ; } } }

import java . util . * ;   public class Day8_169A { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; int a = scan . nextInt ( ) ; int b = scan . nextInt ( ) ;   int [ ] chores = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) chores [ i ] = scan . nextInt ( ) ;   scan . close ( ) ; Arrays . sort ( chores ) ; if ( chores [ b - 1 ] == chores [ n - a ] ) System . out . println ( 0 ) ; else System . out . println ( chores [ n - a ] - chores [ b - 1 ] ) ; } }

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

a , b , c = map ( int , input ( ) . split ( ) ) arr = sorted ( map ( int , input ( ) . split ( ) ) )   ans = arr [ - b ] - arr [ c - 1 ]   print ( ans ) NEW_LINE

n , p , v = input ( ) . split ( ) x = list ( map ( int , input ( ) . split ( ) ) )   x . sort ( ) print ( x [ int ( v ) ] - x [ int ( v ) - 1 ] ) NEW_LINE

import sysinput = sys . stdin . readline   n , a , b = [ int ( i ) for i in input ( ) . split ( ) ] h = sorted ( [ int ( i ) for i in input ( ) . split ( ) ] ) Vasya = h [ : b ] Petya = h [ b : ] print ( Petya [ 0 ] - Vasya [ - 1 ] ) NEW_LINE

a , b , c = map ( int , input ( ) . split ( ) ) d = sorted ( list ( map ( int , input ( ) . split ( ) ) ) )   e = d [ c - 1 ] f = d [ c ] print ( f - e ) NEW_LINE

nab = input ( ) . split ( ) l = input ( ) . split ( ) nab = [ int ( i ) for i in nab ] l = [ int ( i ) for i in l ] l . sort ( ) if ( l [ nab [ 2 ] - 1 ] == l [ nab [ 2 ] ] ) : print ( 0 ) else : print ( l [ nab [ 2 ] ] - l [ nab [ 2 ] - 1 ] ) NEW_LINE


import java . util . Scanner ;    public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int m = input . nextInt ( ) ; String [ ] s = new String [ n ] ; int alreadyBlack = 0 ; for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = input . next ( ) ; } int maxx = 0 ; int minx = Integer . MAX_VALUE ; int maxy = 0 ; int miny = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( s [ i ] . charAt ( j ) == ' B ' ) { alreadyBlack ++ ; maxx = Math . max ( maxx , i ) ; maxy = Math . max ( maxy , j ) ; minx = Math . min ( minx , i ) ; miny = Math . min ( miny , j ) ; } } } int lenx = maxx - minx + 1 ; int leny = maxy - miny + 1 ; int len = Math . max ( lenx , leny ) ; if ( alreadyBlack == 0 ) { System . out . println ( "1" ) ; } else if ( len > n || len > m ) { System . out . println ( " - 1" ) ; } else if ( Math . sqrt ( len * len ) != len ) { System . out . println ( " - 1" ) ; } else { System . out . println ( len * len - alreadyBlack ) ; } } }

import java . util . Scanner ;   public class B828 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int R = in . nextInt ( ) ; int C = in . nextInt ( ) ; char [ ] [ ] A = new char [ R ] [ ] ; for ( int r = 0 ; r < R ; r ++ ) { A [ r ] = in . next ( ) . toCharArray ( ) ; } int minR = Integer . MAX_VALUE ; int maxR = Integer . MIN_VALUE ; int minC = Integer . MAX_VALUE ; int maxC = Integer . MIN_VALUE ; int count = 0 ; for ( int r = 0 ; r < R ; r ++ ) { for ( int c = 0 ; c < C ; c ++ ) { if ( A [ r ] [ c ] == ' B ' ) { count ++ ; minR = Math . min ( minR , r ) ; maxR = Math . max ( maxR , r ) ; minC = Math . min ( minC , c ) ; maxC = Math . max ( maxC , c ) ; } } } int answer ; if ( count == 0 ) { answer = 1 ; } else { int side = Math . max ( maxR - minR + 1 , maxC - minC + 1 ) ; if ( side > R || side > C ) { answer = - 1 ; } else { answer = side * side - count ; } } System . out . println ( answer ) ; }   }

n , m = list ( map ( int , input ( ) . split ( ) ) ) sheet = [ ] for i in range ( n ) : sheet . append ( input ( ) )   min_row = 101 max_row = - 1 min_col = 101 max_col = - 1 count_black = 0 for i in range ( n ) : for j in range ( m ) : if sheet [ i ] [ j ] == ' B ' : count_black += 1 min_row = min ( min_row , i ) max_row = max ( max_row , i ) min_col = min ( min_col , j ) max_col = max ( max_col , j ) l = max ( max_row - min_row + 1 , max_col - min_col + 1 ) if count_black == 0 : print ( 1 ) elif l > n or l > m : print ( - 1 ) else : print ( l * l - count_black ) NEW_LINE

from __future__ import division , print_functionfrom io import BytesIO , IOBaseimport os , sys , math , heapq , copyfrom collections import defaultdict , dequefrom bisect import bisect_left , bisect_rightfrom functools import cmp_to_keyfrom itertools import permutations , combinations , combinations_with_replacement NEW_LINE

a , b = map ( int , input ( ) . split ( ) ) l , r = b , - 1 d , u = a , - 1 z = [ ] ; ok = 1 for i in range ( a ) : k = input ( ) ; z . append ( k ) for j in range ( b ) : if " B " in k : ok = 0 ; l = min ( l , k . find ( ' B ' ) ) ; r = max ( r , k . rfind ( ' B ' ) ) ; d = min ( d , i ) ; u = max ( u , i ) if ok : print ( 1 ) else : h = u - d + 1 ; w = r - l + 1 dim = max ( h , w ) if dim > min ( a , b ) : print ( - 1 ) else : s = ( dim - min ( h , w ) ) * dim for i in range ( d , u + 1 ) : for j in range ( l , r + 1 ) : s += 0 + ( z [ i ] [ j ] == ' W ' ) print ( s ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) sheet = [ ] for r in range ( n ) : ir = list ( input ( ) . strip ( ) ) sheet . append ( ir ) minx , miny , maxx , maxy = 101 , 101 , - 1 , - 1 seen = Falsefor r in range ( n ) : for c in range ( m ) : if ( sheet [ r ] [ c ] == ' B ' ) : if ( minx > c ) : minx = c if ( maxx < c ) : maxx = c if ( miny > r ) : miny = r if ( maxy < r ) : maxy = r seen = Truelength = max ( maxy - miny + 1 , maxx - minx + 1 ) if ( seen == False ) : print ( 1 ) elif ( length > m or length > n ) : print ( - 1 ) else : counter = 0 for i in range ( miny , maxy + 1 ) : for l in range ( minx , maxx + 1 ) : if ( sheet [ i ] [ l ] == ' B ' ) : counter += 1 print ( ( length * length ) - counter ) NEW_LINE

n , m = list ( map ( int , input ( ) . split ( ) ) ) sheet = [ ] for i in range ( n ) : sheet . append ( input ( ) )   min_row = 101 max_row = - 1 min_col = 101 max_col = - 1 for i in range ( n ) : for j in range ( m ) : if sheet [ i ] [ j ] == ' B ' : min_row = min ( min_row , i ) max_row = max ( max_row , i ) min_col = min ( min_col , j ) max_col = max ( max_col , j ) l = max_row - min_row + 1 b = max_col - min_col + 1 NEW_LINE


import java . io . * ; import java . math . BigInteger ; import java . util . * ; public class Main { static InputReader in = new InputReader ( System . in ) ; static PrintWriter out = new PrintWriter ( System . out ) ; static int oo = ( int ) 1e9 ;

import java . io . * ; import java . util . * ; public class cardsorting { static int [ ] bit ; static int n ; public static void main ( String [ ] args ) throws Exception { FastScanner in = new FastScanner ( System . in ) ; n = in . nextInt ( ) ; Num [ ] nums = new Num [ n ] ; bit = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { nums [ i ] = new Num ( in . nextInt ( ) , i ) ; add ( i , 1 ) ; } Arrays . sort ( nums ) ; long ret = nums [ 0 ] . idx ; int p = nums [ 0 ] . idx ; add ( nums [ 0 ] . idx , - 1 ) ; int i = 1 ;

from collections import dequeimport heapq n = int ( input ( ) ) cards_help = list ( map ( int , input ( ) . split ( ) ) ) cards = [ ( cards_help [ i ] , - 1 * i ) for i in range ( n ) ] heapq . heapify ( cards ) draws = 0 removed = 0 while cards : prev = - 1 new_removals = 0 current = cards [ 0 ] while cards and - 1 * current [ 1 ] > prev : new_removals += 1 heapq . heappop ( cards ) temp_prev = - 1 * current [ 1 ] while cards and cards [ 0 ] [ 0 ] == current [ 0 ] and - 1 * cards [ 0 ] [ 1 ] > prev : current = cards [ 0 ] heapq . heappop ( cards ) new_removals += 1 prev = temp_prev current = cards [ 0 ] if cards else 0 draws += n - removed removed += new_removalsprint ( draws ) NEW_LINE

n = int ( input ( ) ) s = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) a = [ ] for i in range ( max ( s ) ) : a . append ( [ ] ) for i in range ( len ( s ) ) : a [ s [ i ] - 1 ] . append ( i ) a = list ( filter ( lambda x : x != [ ] , a ) ) if len ( a ) > 1 : for i in range ( 1 , len ( a ) ) : if len ( a [ i ] ) > 1 : s = a [ i - 1 ] [ - 1 ] if s > a [ i ] [ 0 ] and s < a [ i ] [ - 1 ] : for j in range ( 1 , len ( a [ i ] ) ) : if s < a [ i ] [ j ] : a [ i ] = a [ i ] [ j : ] + a [ i ] [ : j ] breakt = [ ] for i in a : t += ic = 0 x = t [ 0 ] + 1 i = n - 1 while i > 0 : if t [ i ] < t [ i - 1 ] : k = t [ i ] - t [ i - 1 ] + n else : k = t [ i ] - t [ i - 1 ] c += k x -= c // n i -= 1 print ( c + x )         NEW_LINE

def main ( ) : input ( ) numbers = tuple ( map ( int , input ( ) . split ( ) ) ) d = [ ] for i in range ( len ( numbers ) ) : while len ( d ) <= numbers [ i ] : d . append ( [ ] ) d [ numbers [ i ] ] . append ( i ) dd = [ [ ] ] for line in d : if line : dd . append ( line ) d = dd answer = [ None ] * len ( numbers ) for item in d [ 1 ] : answer [ item ] = 1 for i in range ( 1 , len ( d ) - 1 ) : left_maxes = [ 0 ] right_maxes = [ 0 ] for j in range ( len ( d [ i ] ) ) : left_maxes . append ( max ( left_maxes [ - 1 ] , answer [ d [ i ] [ j ] ] ) ) right_maxes . append ( max ( right_maxes [ - 1 ] , answer [ d [ i ] [ len ( d [ i ] ) - j - 1 ] ] ) ) left_amount = 0 for j in range ( len ( d [ i + 1 ] ) ) : while left_amount < len ( d [ i ] ) and d [ i ] [ left_amount ] < d [ i + 1 ] [ j ] : left_amount += 1 answer [ d [ i + 1 ] [ j ] ] = max ( left_maxes [ left_amount ] , right_maxes [ len ( d [ i ] ) - left_amount ] + 1 ) res = 0 for ans in answer : res += ans print ( res )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE


import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; String first = s . nextLine ( ) ; String second = s . nextLine ( ) ; String text = s . nextLine ( ) ; String result = " " ; int found = 0 ; char c = ' ▁ ' ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { found = 0 ; if ( ! Character . isDigit ( text . charAt ( i ) ) ) { if ( Character . isUpperCase ( text . charAt ( i ) ) ) { found = 1 ; c = Character . toLowerCase ( text . charAt ( i ) ) ; } else c = text . charAt ( i ) ; int index = search ( first , c ) ; if ( found == 1 ) { result = result + Character . toUpperCase ( second . charAt ( index ) ) ; } else result = result + second . charAt ( index ) ; } else result = result + text . charAt ( i ) ; } System . out . println ( result ) ; } public static int search ( String first , char c ) { int index = 0 ; for ( int i = 0 ; i < first . length ( ) ; i ++ ) { if ( first . charAt ( i ) == c ) { index = i ; break ; } } return index ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ; import static java . util . Arrays . sort ; import javafx . util . Pair ;   public class Main {   public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; String FKeyboard = input . next ( ) ; String SKeyboard = input . next ( ) ; String typed = input . next ( ) ; StringBuilder ans = new StringBuilder ( ) ; for ( int i = 0 ; i < typed . length ( ) ; i ++ ) { if ( typed . charAt ( i ) >= ' A ' && typed . charAt ( i ) <= ' Z ' ) { String c = ( typed . charAt ( i ) + " " ) . toLowerCase ( ) ; System . out . print ( ( SKeyboard . charAt ( FKeyboard . indexOf ( c ) ) + " " ) . toUpperCase ( ) ) ; } else if ( typed . charAt ( i ) >= ' a ' && typed . charAt ( i ) <= ' z ' ) { String c = typed . charAt ( i ) + " " ; System . out . print ( SKeyboard . charAt ( FKeyboard . indexOf ( c ) ) ) ; } else System . out . print ( typed . charAt ( i ) ) ; } System . out . println ( " " ) ; }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }

import java . util . * ;   public class question { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { String x = " " + s . charAt ( i ) ; boolean cap = false ; if ( x . toUpperCase ( ) == x ) { x = x . toLowerCase ( ) ; cap = true ; } if ( a . contains ( x ) ) { int ind = a . indexOf ( x ) ; String ans = b . substring ( ind , ind + 1 ) ; if ( cap == true ) ans = ans . toUpperCase ( ) ; System . out . print ( ans ) ; } else System . out . print ( x ) ; }   } }

import java . util . * ;   public class TestCodeforces { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; solve ( scanner ) ; scanner . close ( ) ; }   public static void solve ( Scanner scanner ) {   String s = scanner . nextLine ( ) , s2 = scanner . nextLine ( ) , s3 = scanner . nextLine ( ) ;   String res = " " ; int len = s3 . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = s3 . charAt ( i ) ; if ( c >= '0' && c <= '9' ) res += c ; else if ( c >= ' A ' && c <= ' Z ' ) res += Character . toUpperCase ( s2 . charAt ( s . indexOf ( Character . toLowerCase ( c ) ) ) ) ; else res += s2 . charAt ( s . indexOf ( c ) ) ; } System . out . println ( res ) ;    } }

import java . util . * ; import java . lang . * ;   public class trial { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; HashMap < Character , Character > sts = new HashMap < > ( ) ; String s1 = sc . next ( ) ; String s2 = sc . next ( ) ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { sts . put ( s1 . charAt ( i ) , s2 . charAt ( i ) ) ; } String test = sc . next ( ) ; for ( int i = 0 ; i < test . length ( ) ; i ++ ) { if ( Character . isAlphabetic ( test . charAt ( i ) ) && test . charAt ( i ) > 90 ) { System . out . print ( ( Character . toLowerCase ( sts . get ( test . charAt ( i ) ) ) ) ) ; } else if ( Character . isAlphabetic ( test . charAt ( i ) ) && test . charAt ( i ) <= 90 ) { System . out . print ( Character . toUpperCase ( sts . get ( Character . toLowerCase ( test . charAt ( i ) ) ) ) ) ; } else System . out . print ( test . charAt ( i ) ) ; } }    }

s = str ( input ( ) ) s1 = str ( input ( ) ) s2 = str ( input ( ) ) n = len ( s ) n1 = len ( s1 ) n2 = len ( s2 ) for i in range ( n2 ) : if ( s2 [ i ] . isupper ( ) ) : p = s . find ( s2 [ i ] . lower ( ) ) print ( s1 [ p ] . upper ( ) , end = ' ' ) elif ( s2 [ i ] . islower ( ) ) : p = s . find ( s2 [ i ] ) print ( s1 [ p ] , end = ' ' ) else : print ( s2 [ i ] , end = ' ' ) NEW_LINE

board1 = input ( ) board2 = input ( ) s = input ( ) ans = " " for i in s : if i >= ' A ' and i <= ' Z ' : index = board1 . index ( i . lower ( ) ) ans += board2 [ index ] . upper ( ) elif i >= ' a ' and i <= ' z ' : index = board1 . index ( i ) ans += board2 [ index ] else : ans += iprint ( ans ) NEW_LINE

x = list ( input ( ) . strip ( ) ) y = list ( input ( ) . strip ( ) )   s = list ( input ( ) . strip ( ) )   z = s   for i in range ( len ( z ) ) : if z [ i ] . isnumeric ( ) : continue else : if z [ i ] . islower ( ) : j = z [ i ] . lower ( ) ind = x . index ( j ) z [ i ] = y [ ind ] else : j = z [ i ] . lower ( ) ind = x . index ( j ) z [ i ] = y [ ind ] . upper ( )     print ( ' ' . join ( z ) )         NEW_LINE

l1 = list ( str ( input ( ) ) ) l2 = list ( str ( input ( ) ) ) l3 = list ( str ( input ( ) ) ) s = ' ' for i in l3 : if i . isalpha ( ) and i . isupper ( ) : lcase = i . lower ( ) if lcase in l1 : idx1 = l1 . index ( lcase ) s = s + l2 [ idx1 ] . upper ( ) elif i . isalpha ( ) and i . islower ( ) : if i in l1 : idx2 = l1 . index ( i ) s += l2 [ idx2 ] else : s += iprint ( s ) NEW_LINE


import java . io . * ; import java . util . * ;   public class Main { static int inf = ( int ) 1e9 + 7 ;   public static void main ( String [ ] args ) throws IOException { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; pw = new PrintWriter ( System . out ) ; int p = nextInt ( ) ; int k = nextInt ( ) ; long ans = 1 ; boolean used [ ] = new boolean [ p ] ; for ( int i = 1 ; i < p ; i ++ ) { int v = i ; if ( ! used [ i ] ) { while ( ! used [ v ] ) { used [ v ] = true ; v = ( int ) ( ( ( long ) v * k ) % p ) ; } ans = ( ans * p ) % inf ; } }   if ( k == 1 ) ans = ( ans * p ) % inf ; pw . println ( ans ) ; pw . close ( ) ; }   static BufferedReader br ; static StringTokenizer st = new StringTokenizer ( " " ) ; static PrintWriter pw ;   static String next ( ) throws IOException { while ( ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; }   static int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; }   static long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; }   static double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; } }

import java . io . * ;   public class Main { final static long mod = ( long ) 1e9 + 7 ; public static long pow ( long x , long n ) { long ans = 1 ; while ( n != 0 ) { if ( n % 2 == 1 ) ans *= x ; ans %= mod ; n /= 2 ; x *= x ; x %= mod ; } return ans % mod ; } public static void main ( String [ ] args ) throws IOException { BufferedReader bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] input = bf . readLine ( ) . split ( " ▁ " ) ; long p = Integer . parseInt ( input [ 0 ] ) ; long k = Integer . parseInt ( input [ 1 ] ) ; long order = 1 ; long temp = k ; if ( k == 0 ) System . out . println ( ( int ) pow ( p , p - 1 ) ) ; else { while ( order < p ) { if ( temp == 1 ) break ; temp = ( ( k % p ) * ( temp % p ) ) % p ; order ++ ; } if ( k == 1 ) System . out . println ( ( ( pow ( p , p ) ) ) ) ; else System . out . println ( ( ( pow ( p , ( p - 1 ) / order ) ) ) ) ; } } }

import java . util . * ;   public class Solution { public static long MOD = 1_000_000_007 ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int P = in . nextInt ( ) ; int K = in . nextInt ( ) ; in . close ( ) ; long ans = calc ( P , K ) ; System . out . println ( ans ) ; } public static long calc ( int P , int K ) { if ( K == 0 ) { return modPow ( P , P - 1 ) ; } if ( K == 1 ) { return modPow ( P , P ) ; } int count = 0 ; boolean [ ] visited = new boolean [ P ] ; for ( int i = 1 ; i < visited . length ; i ++ ) { if ( visited [ i ] ) { continue ; } long j = i ; count ++ ; while ( ! visited [ ( int ) j ] ) { visited [ ( int ) j ] = true ; j = ( j * K ) % P ; } } return modPow ( P , count ) ; } public static long modPow ( long base , long exp ) { base %= MOD ; long ans = 1 ; while ( exp > 0 ) { if ( exp % 2 == 1 ) { ans = ( ans * base ) % MOD ; } base = ( base * base ) % MOD ; exp >>= 1 ; } return ans ; } }

n , k = map ( int , input ( ) . split ( ) ) m = 10 ** 9 + 7 if k == 0 : print ( pow ( n , n - 1 , m ) ) elif k == 1 : print ( pow ( n , n , m ) ) else : c = 1 x = k while x != 1 : x = ( x * k ) % n c += 1 print ( pow ( n , ( n - 1 ) // c , m ) ) NEW_LINE

MOD = int ( 1e9 + 7 ) n , k = map ( int , input ( ) . split ( ) ) if k < 2 : p = n - ( 1 - k ) else : t = 1 a = k while a != 1 : a = a * k % n t += 1 p = ( n - 1 ) // tprint ( pow ( n , p , MOD ) )   NEW_LINE

def main ( ) : p , k = map ( int , input ( ) . split ( ) ) s = 1 m = pow ( 10 , 9 ) + 7 if k == 0 : s = pow ( p , p - 1 , m ) elif k == 1 : s = pow ( p , p , m ) else : o = 1 n = k while n != 1 : n = k * n % p o += 1 c = ( p - 1 ) // o s = pow ( p , c , m ) print ( s % m ) main ( )         NEW_LINE

p , k = map ( int , input ( ) . split ( ) ) M = 1000000007 if k == 0 : print ( pow ( p , p - 1 , M ) ) , exit ( 0 ) if k == 1 : print ( pow ( p , p , M ) ) , exit ( 0 ) cnt , x = 0 , 1 while 1 : cnt -= - 1 x = ( k * x ) % p if x == 1 : breakprint ( pow ( p , ( p - 1 ) // cnt , M ) ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class Helloworld { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; int m = Integer . parseInt ( st . nextToken ( ) ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ m ] ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; } st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < m ; i ++ ) { b [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; } int files = 0 ; int i = 0 , j = 0 ; int sum1 = 0 ; int sum2 = 0 ; while ( i < n || j < m ) { if ( sum1 == 0 ) { sum1 = sum1 + a [ i ] ; i ++ ; } else if ( sum2 == 0 ) { sum2 = sum2 + b [ j ] ; j ++ ; } else if ( sum1 < sum2 ) { sum1 = sum1 + a [ i ] ; i ++ ; } else if ( sum1 > sum2 ) { sum2 = sum2 + b [ j ] ; j ++ ; } else { files ++ ; sum1 = 0 ; sum2 = 0 ; } } System . out . println ( files + 1 ) ; }   }

import java . util . * ;   public class problem950B { private static Scanner in = new Scanner ( System . in ) ; private static long n = 0 , m = 0 , files = 0 , target = 0 , sum = 0 ; private static int j = 0 ; public static void main ( String [ ] args ) { n = in . nextInt ( ) ; m = in . nextInt ( ) ; ArrayList < Integer > blocksN = new ArrayList < Integer > ( ) ; ArrayList < Integer > blocksM = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) blocksN . add ( in . nextInt ( ) ) ; for ( int i = 0 ; i < m ; i ++ ) blocksM . add ( in . nextInt ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { target += blocksN . get ( i ) ; while ( sum < target ) { sum += blocksM . get ( j ) ; j ++ ; } if ( sum == target ) { target = sum = 0 ; files ++ ; } } System . out . println ( files ) ; } }

import java . io . * ; import java . util . * ;   public class Main { 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 ( ) ) , m = Integer . parseInt ( st . nextToken ( ) ) ; int [ ] a = new int [ n ] , b = new int [ m ] ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; st = new StringTokenizer ( br . readLine ( ) ) ; for ( int i = 0 ; i < m ; i ++ ) b [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; int i = 0 , j = 0 , cnt = 0 ; while ( i < n && j < m ) { if ( a [ i ] == b [ j ] ) { i ++ ; j ++ ; cnt ++ ; } else if ( a [ i ] < b [ j ] ) { a [ i + 1 ] = a [ i + 1 ] + a [ i ] ; i ++ ; } else { b [ j + 1 ] = b [ j + 1 ] + b [ j ] ; j ++ ; } } System . out . println ( cnt ) ; } }

n , m = map ( int , input ( ) . split ( ) )   a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) )   cnt = 0 x = 0 ; y = 0 i = 0 ; j = 0   f = - 1 while i < n and j < m :   if f != 1 : x += a [ i ]   if f != 2 : y += b [ j ]   if x == y : cnt += 1 i += 1 j += 1 f = - 1   elif x > y : j += 1 f = 1   else : i += 1 f = 2   print ( cnt ) NEW_LINE

n , m = [ int ( i ) for i in input ( ) . split ( ) ] a = [ int ( i ) for i in input ( ) . split ( ) ] b = [ int ( i ) for i in input ( ) . split ( ) ] sum = 0 sums = 0 for i in range ( 0 , len ( a ) ) : sum = sum + a [ i ] a [ i ] = sumfor i in range ( 0 , len ( b ) ) : sums = sums + b [ i ] b [ i ] = sumsprint ( n + m - ( len ( set ( a + b ) ) ) ) NEW_LINE

import sys , matha , b = map ( int , input ( ) . split ( ' ▁ ' ) ) arr1 = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) arr2 = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) c = 0 i , j = 0 , 0 while i < a and j < b : if arr1 [ i ] < arr2 [ j ] : arr1 [ i + 1 ] = arr1 [ i ] + arr1 [ i + 1 ] i += 1 else : if arr1 [ i ] > arr2 [ j ] : arr2 [ j + 1 ] = arr2 [ j ] + arr2 [ j + 1 ] j += 1 else : c += 1 i += 1 j += 1 print ( c )       NEW_LINE

import sys , copy   n , m = map ( int , sys . stdin . readline ( ) . split ( ) ) a = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) b = list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) i = 0j = 0 sigma_a = a [ 0 ] sigma_b = b [ 0 ] ans = 0 while i < n and j < m : if sigma_a < sigma_b : i += 1 sigma_a += a [ i ]   elif sigma_a > sigma_b : j += 1 sigma_b += b [ j ]   else : i += 1 j += 1 ans += 1 if i < n or j < m : sigma_a = a [ i ] sigma_b = b [ j ] print ( ans ) NEW_LINE


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

import java . util . Scanner ;   public class HighSchool { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; sc . nextLine ( ) ; double k = ( y * Math . log10 ( x ) ) ; double l = ( x * Math . log10 ( y ) ) ; if ( k > l ) { System . out . println ( " > " ) ; } else if ( k < l ) { System . out . println ( " < " ) ; } else { System . out . println ( " = " ) ; } } }

import math   x , y = map ( int , input ( ) . split ( ) ) c1 , c2 = math . log ( x ) / x , math . log ( y ) / y   print ( ' < ' if c1 < c2 else ' > ' if c1 > c2 else ' = ' ) NEW_LINE

import mathx , y = map ( int , input ( ) . split ( ) ) if y * math . log ( x ) > x * math . log ( y ) : print ( " > " ) elif y * math . log ( x ) < x * math . log ( y ) : print ( ' < ' ) else : print ( ' = ' ) NEW_LINE

import matha , b = map ( int , input ( ) . split ( ) ) if b * math . log ( a ) > a * math . log ( b ) : print ( " > " ) elif b * math . log ( a ) < a * math . log ( b ) : print ( " < " ) else : print ( " = " ) NEW_LINE

import mathtry : x , y = map ( int , input ( ) . split ( ) ) z = y * ( math . log ( x ) ) w = x * ( math . log ( y ) ) if w > z : print ( " < " ) elif w == z : print ( " = " ) else : print ( " > " ) except : pass NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . StringTokenizer ;   public class A { public static void main ( String [ ] args ) throws InterruptedException { FastScanner fs = new FastScanner ( ) ; int nPeople = fs . nextInt ( ) ; double distance = fs . nextInt ( ) ; double walkSpeed = fs . nextInt ( ) , busSpeed = fs . nextInt ( ) ; int seats = fs . nextInt ( ) ; int trips = ( nPeople + seats - 1 ) / seats ; double minTime = 0 , maxTime = distance / walkSpeed ; for ( int i = 0 ; i < 1000 ; i ++ ) { double totalTime = ( minTime + maxTime ) / 2 ;

import java . util . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }   public static long mod = 17352642619633L ;    int N , L , V1 , V2 , K ; double busspeed ; double personspeed ;   public static double eps = 1e-11 ; void run ( FastScanner in , PrintWriter out ) {   N = in . nextInt ( ) ;

n , l , v1 , v2 , k = map ( int , input ( ) . split ( ) )   if k >= n : res = l / v2else : L , R = 0 , l / v2 x = ( n + k - 1 ) // k   for i in range ( 100 ) : M = ( L + R ) / 2   first = M + ( l - v2 * M ) / v1   prev_cost = ( x - 1 ) * ( M + M * ( v2 - v1 ) / ( v1 + v2 ) ) last = prev_cost + ( l - v1 * prev_cost ) / v2   if last > first : R = M else : L = M   res = ( l - L * v2 ) / v1 + L   print ( ' { :0.10f } ' . format ( res ) ) NEW_LINE

n , l , v1 , v2 , k = map ( int , input ( ) . split ( ) )   n = ( n + k - 1 ) // k   a = ( v2 - v1 ) / ( v1 + v2 )   t = l / v2 / ( n - ( n - 1 ) * a )   print ( n * t + ( n - 1 ) * a * t )       NEW_LINE

n , l , v , o , k = map ( int , input ( ) . split ( ) ) T = ( n + k - 1 ) // ke = 1 - v / oL = l / v / ( T / o + T * e / ( v + o ) - e / ( v + o ) - 1 / o + 1 / v ) print ( ( l - L ) / v + L / o ) NEW_LINE

RYIawuypxfFqJOW = mapRYIawuypxfFqJOL = intRYIawuypxfFqJOg = inputRYIawuypxfFqJOi = printn , l , v1 , v2 , k = RYIawuypxfFqJOW ( RYIawuypxfFqJOL , RYIawuypxfFqJOg ( ) . split ( ) ) n = ( n + k - 1 ) // ka = ( v2 - v1 ) / ( v1 + v2 ) t = l / v2 / ( n - ( n - 1 ) * a ) RYIawuypxfFqJOi ( n * t + ( n - 1 ) * a * t ) NEW_LINE

n , l , v1 , v2 , k = map ( int , input ( ) . split ( ) ) diff = v2 - v1n = ( n + k - 1 ) // k * 2 p1 = ( n * v2 - diff ) * lp2 = ( n * v1 + diff ) * v2print ( p1 / p2 ) NEW_LINE


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

import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String [ ] num = { " zero " , " one " , " two " , " three " , " four " , " five " , " six " , " seven " , " eight " , " nine " , " ten " , " eleven " , " twelve " , " thirteen " , " fourteen " , " fifteen " , " sixteen " , " seventeen " , " eighteen " , " nineteen " } ; String [ ] num1 = { " twenty " , " thirty " , " forty " , " fifty " , " sixty " , " seventy " , " eighty " , " ninety " } ; int n = scan . nextInt ( ) ; if ( n < 20 ) { System . out . println ( num [ n ] ) ; } else { int f = n / 10 ; int l = n % 10 ; if ( l != 0 ) { System . out . println ( num1 [ f - 2 ] + " - " + num [ l ] ) ; } else { System . out . println ( num1 [ f - 2 ] ) ; } }   }   }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   import static java . lang . Integer . lowestOneBit ; import static java . lang . Integer . parseInt ;   public class Example {   public static void main ( String [ ] args ) {    Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] s = { " zero " , " one " , " two " , " three " , " four " , " five " , " six " , " seven " , " eight " , " nine " , " ten " , " eleven " , " twelve " , " thirteen " , " fourteen " , " fifteen " , " sixteen " , " seventeen " , " eighteen " , " nineteen " } ; String [ ] st = { " " , " " , " twenty " , " thirty " , " forty " , " fifty " , " sixty " , " seventy " , " eighty " , " ninety " } ; if ( n < 20 ) System . out . println ( s [ n ] ) ; else { if ( n % 10 == 0 ) { System . out . println ( st [ n / 10 ] ) ; } else { System . out . println ( st [ n / 10 ] + " - " + s [ n % 10 ] ) ; } }   } }

a = int ( input ( ) )   b = " "   if a == 0 : b = " zero " elif a // 10 == 1 : if a % 10 == 0 : b = " ten " elif a % 10 == 1 : b = " eleven " elif a % 10 == 2 : b = " twelve " elif a % 10 == 3 : b = " thirteen " elif a % 10 == 4 : b = " fourteen " elif a % 10 == 5 : b = " fifteen " elif a % 10 == 6 : b = " sixteen " elif a % 10 == 7 : b = " seventeen " elif a % 10 == 8 : b = " eighteen " elif a % 10 == 9 : b = " nineteen " print ( b ) quit ( ) elif a // 10 > 1 : if a // 10 == 9 : b = " ninety " elif a // 10 == 8 : b = " eighty " elif a // 10 == 7 : b = " seventy " elif a // 10 == 6 : b = " sixty " elif a // 10 == 5 : b = " fifty " elif a // 10 == 4 : b = " forty " elif a // 10 == 3 : b = " thirty " elif a // 10 == 2 : b = " twenty " if a % 10 != 0 : if a % 10 == 9 : b = b + ( " - " if len ( b ) > 0 else " " ) + " nine " elif a % 10 == 8 : b = b + ( " - " if len ( b ) > 0 else " " ) + " eight " elif a % 10 == 7 : b = b + ( " - " if len ( b ) > 0 else " " ) + " seven " elif a % 10 == 6 : b = b + ( " - " if len ( b ) > 0 else " " ) + " six " elif a % 10 == 5 : b = b + ( " - " if len ( b ) > 0 else " " ) + " five " elif a % 10 == 4 : b = b + ( " - " if len ( b ) > 0 else " " ) + " four " elif a % 10 == 3 : b = b + ( " - " if len ( b ) > 0 else " " ) + " three " elif a % 10 == 2 : b = b + ( " - " if len ( b ) > 0 else " " ) + " two " elif a % 10 == 1 : b = b + ( " - " if len ( b ) > 0 else " " ) + " one "   print ( b ) NEW_LINE

x = int ( input ( ) )   a = [ ' zero ' , ' one ' , ' two ' , ' three ' , ' four ' , ' five ' , ' six ' , ' seven ' , ' eight ' , ' nine ' , ' ten ' , ' eleven ' , ' twelve ' , ' thirteen ' , ' fourteen ' , ' fifteen ' , ' sixteen ' , ' seventeen ' , ' eighteen ' , ' nineteen ' ] b = [ ' twenty ' , ' thirty ' , ' forty ' , ' fifty ' , ' sixty ' , ' seventy ' , ' eighty ' , ' ninety ' ] print ( a [ x ] if x < 20 else b [ x // 10 - 2 ] + ( ' ' if x % 10 == 0 else ' - ' + a [ x % 10 ] ) )   NEW_LINE

num = int ( input ( ) )   d = { 0 : ' zero ' , 1 : ' one ' , 2 : ' two ' , 3 : ' three ' , 4 : ' four ' , 5 : ' five ' , 6 : ' six ' , 7 : ' seven ' , 8 : ' eight ' , 9 : ' nine ' , 10 : ' ten ' , 11 : ' eleven ' , 12 : ' twelve ' , 13 : ' thirteen ' , 14 : ' fourteen ' , 15 : ' fifteen ' , 16 : ' sixteen ' , 17 : ' seventeen ' , 18 : ' eighteen ' , 19 : ' nineteen ' , 20 : ' twenty ' , 30 : ' thirty ' , 40 : ' forty ' , 50 : ' fifty ' , 60 : ' sixty ' , 70 : ' seventy ' , 80 : ' eighty ' , 90 : ' ninety ' }   while True : if num < 20 : print ( d [ num ] ) break if num < 100 : if num % 10 == 0 : print ( d [ num ] ) break else : print ( d [ num // 10 * 10 ] + ' - ' + d [ num % 10 ] ) break NEW_LINE

numerals = { 0 : " zero " , 1 : " one " , 2 : " two " , 3 : " three " , 4 : " four " , 5 : " five " , 6 : " six " , 7 : " seven " , 8 : " eight " , 9 : " nine " , 10 : " ten " , 11 : " eleven " , 12 : " twelve " , 13 : " thirteen " , 14 : " fourteen " , 15 : " fifteen " , 16 : " sixteen " , 17 : " seventeen " , 18 : " eighteen " , 19 : " nineteen " , 20 : " twenty " , 30 : " thirty " , 40 : " forty " , 50 : " fifty " , 60 : " sixty " , 70 : " seventy " , 80 : " eighty " , 90 : " ninety " }   n = int ( input ( ) ) if n in numerals : print ( numerals [ n ] ) else : previous = " twenty " for key in numerals : if n > key : previous = numerals [ key ] if n < key : break ans = previous + " - " + numerals [ int ( str ( n ) [ - 1 ] ) ] print ( ans ) NEW_LINE

n = int ( input ( ) ) numbers = [ ' zero ' , ' one ' , ' two ' , ' three ' , ' four ' , ' five ' , ' six ' , ' seven ' , ' eight ' , ' nine ' , ' ten ' , ' eleven ' , ' twelve ' , ' thirteen ' , ' fourteen ' , ' fifteen ' , ' sixteen ' , ' seventeen ' , ' eighteen ' , ' nineteen ' ] tens = [ ' ' , ' ' , ' twenty ' , ' thirty ' , ' forty ' , ' fifty ' , ' sixty ' , ' seventy ' , ' eighty ' , ' ninety ' ] if n <= 19 : print ( numbers [ n ] ) exit ( ) else : if n % 10 == 0 : print ( tens [ n // 10 ] ) else : print ( tens [ n // 10 ] + ' - ' + numbers [ n % 10 ] ) NEW_LINE


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

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

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; StringBuffer sb = new StringBuffer ( ) ; while ( t -- > 0 ) { int n = in . nextInt ( ) ; sb . append ( n + " \n " ) ; } System . out . println ( sb ) ; } }

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

t = int ( input ( ) ) for i in range ( t ) : n = int ( input ( ) ) print ( n ) NEW_LINE

def Diamonds ( ) : t = int ( input ( ) ) res = [ ] while ( t ) : res . append ( int ( input ( ) ) ) t -= 1 for i in range ( len ( res ) ) : print ( res [ i ] )   if __name__ == " _ _ main _ _ " : Diamonds ( ) NEW_LINE

t , * x = open ( 0 ) ; print ( * x ) NEW_LINE


import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] ans = new int [ n ] ; int ptr = 0 , temp = k + 1 ; while ( k -- >= 0 ) { ans [ ptr ++ ] = k + 1 ; } while ( ptr < n ) { ans [ ptr ++ ] = temp ; temp ++ ; } StringBuilder res = new StringBuilder ( ) ; for ( int i = 0 ; i < ans . length ; i ++ ) { res . append ( ans [ i ] + 1 ) . append ( " ▁ " ) ; } res . deleteCharAt ( res . length ( ) - 1 ) ; System . out . println ( res ) ; } }

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

import java . util . * ; import java . io . * ; import java . math . * ;   public class First { public static void process ( ) throws IOException { int n = ni ( ) ; int k = ni ( ) ; for ( int i = 1 ; i <= k ; i ++ ) { p ( n + " ▁ " ) ; n -- ; } for ( int i = 1 ; i <= n ; i ++ ) { p ( i + " ▁ " ) ; } pn ( " " ) ;   }   static AnotherReader sc ; static PrintWriter out ; public static void main ( String [ ] args ) throws IOException { out = new PrintWriter ( System . out ) ; sc = new AnotherReader ( ) ; boolean oj = true ;

import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; int printed = 0 ; int i = n ; if ( k > 0 ) { System . out . print ( n + " ▁ " ) ; k -- ; printed ++ ; i -- ; } while ( k > 0 ) { System . out . print ( i + " ▁ " ) ; i -- ; k -- ; printed ++ ; } i = 1 ; while ( printed < n ) { System . out . print ( i + " ▁ " ) ; i ++ ; printed ++ ; }   } }

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

n , k = [ int ( x ) for x in input ( ) . split ( ) ] for i in range ( n , n - k , - 1 ) : print ( str ( i ) , end = " ▁ " ) for i in range ( 1 , n - k + 1 ) : if ( i == ( n - k ) ) : print ( str ( i ) , end = " " ) else : print ( str ( i ) , end = " ▁ " ) print ( ) NEW_LINE

arr = [ int ( x ) for x in input ( ) . split ( ) ] n , k = arr [ 0 ] , arr [ 1 ] c = n - k - 1 ans = [ i + 1 for i in range ( c ) ] for i in range ( n , n - k - 1 , - 1 ) : ans . append ( i ) print ( * ans ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) )   if k == 0 : lst1 = [ ] for b in range ( 1 , n + 1 ) : lst1 . append ( b ) res1 = [ str ( r ) for r in lst1 ] print ( ' ▁ ' . join ( res1 ) ) else : lst = [ ] for x in range ( k ) : lst . append ( n - x ) for y in range ( k , n ) : lst . append ( y - k + 1 ) res = [ str ( b ) for b in lst ] print ( ' ▁ ' . join ( res ) )   NEW_LINE


import java . util . ArrayList ; import java . util . Scanner ;   public class InfinityGauntlet {   public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) ; String [ ] s = { " Power " , " Time " , " Space " , " Soul " , " Reality " , " Mind " } ; int [ ] a = new int [ 7 ] ; for ( int i = 0 ; i < n ; i ++ ) { String in = scan . next ( ) ;   if ( in . equals ( " purple " ) ) { ++ a [ 1 ] ; } if ( in . equals ( " green " ) ) { ++ a [ 2 ] ; } if ( in . equals ( " blue " ) ) { ++ a [ 3 ] ; } if ( in . equals ( " orange " ) ) { ++ a [ 4 ] ; } if ( in . equals ( " red " ) ) { ++ a [ 5 ] ; } if ( in . equals ( " yellow " ) ) { ++ a [ 6 ] ;   } }   ArrayList < String > res = new ArrayList < String > ( ) ; for ( int j = 1 ; j < 7 ; j ++ ) {   if ( a [ j ] == 0 ) { res . add ( s [ j - 1 ] ) ; } } System . out . println ( res . size ( ) ) ; for ( int j = 0 ; j < res . size ( ) ; j ++ ) { System . out . println ( res . get ( j ) ) ;   } } }

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

import java . util . * ; public class problem { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String [ ] c = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { c [ i ] = sc . next ( ) ; } int m = 6 - n ; System . out . println ( m ) ; int p = 0 , r = 0 , g = 0 , b = 0 , o = 0 , y = 0 ; String s1 = " purple " , s2 = " green " , s3 = " blue " , s4 = " red " , s5 = " orange " ; for ( int i = 0 ; i < n ; i ++ ) { if ( c [ i ] . equals ( s1 ) ) p ++ ; else if ( c [ i ] . equals ( s2 ) ) g ++ ; else if ( c [ i ] . equals ( s3 ) ) b ++ ; else if ( c [ i ] . equals ( s4 ) ) r ++ ; else if ( c [ i ] . equals ( s5 ) ) o ++ ; else y ++ ; } if ( p == 0 ) System . out . println ( " Power " ) ; if ( g == 0 ) System . out . println ( " Time " ) ; if ( b == 0 ) System . out . println ( " Space " ) ; if ( r == 0 ) System . out . println ( " Reality " ) ; if ( o == 0 ) System . out . println ( " Soul " ) ; if ( y == 0 ) System . out . println ( " Mind " ) ; } }

import java . util . * ; public class Solution { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; String a [ ] = new String [ n ] ; ArrayList < Integer > b = new ArrayList < > ( ) ; s . nextLine ( ) ; int count = 0 ; String [ ] color = { " blue " , " green " , " orange " , " purple " , " red " , " yellow " } ; String [ ] gems = { " Space " , " Time " , " Soul " , " Power " , " Reality " , " Mind " } ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = s . nextLine ( ) ; } for ( int i = 0 ; i < color . length ; i ++ ) { boolean v = check ( color [ i ] , a ) ; if ( v == true ) { count ++ ; b . add ( i ) ; } } System . out . println ( count ) ; for ( int a2 : b ) { System . out . println ( gems [ a2 ] ) ; } } public static boolean check ( String s1 , String [ ] a ) { for ( int k = 0 ; k < a . length ; k ++ ) { if ( s1 . equals ( a [ k ] ) ) return false ; } return true ; } }

import java . util . Arrays ; import java . util . Scanner ;   public class Singleton_Pattern { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; sc . nextLine ( ) ; int n = 6 ; System . out . println ( n - t ) ; int a [ ] = new int [ 6 ] ; Arrays . fill ( a , 1 ) ; for ( int i = 0 ; i < t ; i ++ ) { String s = sc . nextLine ( ) ; if ( s . equals ( " purple " ) ) a [ 0 ] = - 1 ; if ( s . equals ( " green " ) ) a [ 1 ] = - 1 ; if ( s . equals ( " blue " ) ) a [ 2 ] = - 1 ; if ( s . equals ( " orange " ) ) a [ 3 ] = - 1 ; if ( s . equals ( " red " ) ) a [ 4 ] = - 1 ; if ( s . equals ( " yellow " ) ) a [ 5 ] = - 1 ; }   if ( a [ 0 ] != - 1 ) System . out . println ( " Power " ) ; if ( a [ 1 ] != - 1 ) System . out . println ( " Time " ) ; if ( a [ 2 ] != - 1 ) System . out . println ( " Space " ) ; if ( a [ 3 ] != - 1 ) System . out . println ( " Soul " ) ; if ( a [ 4 ] != - 1 ) System . out . println ( " Reality " ) ; if ( a [ 5 ] != - 1 ) System . out . println ( " Mind " ) ;    } }

n = int ( input ( ) ) d = { ' purple ' : ' Power ' , ' green ' : ' Time ' , ' blue ' : ' Space ' , ' orange ' : ' Soul ' , ' red ' : ' Reality ' , ' yellow ' : ' Mind ' } for i in range ( n ) : s = input ( ) del d [ s ] print ( 6 - n ) for i in d : print ( d [ i ] ) NEW_LINE

l = { ' purple ' : ' Power ' , ' green ' : ' Time ' , ' blue ' : ' Space ' , ' orange ' : ' Soul ' , ' red ' : ' Reality ' , ' yellow ' : ' Mind ' } set1 = set ( ) n = int ( input ( ) )   for i in range ( n ) : s1 = input ( ) set1 . add ( s1 ) print ( 6 - n ) for ( key , value ) in l . items ( ) : if key not in set1 : print ( value )   NEW_LINE

n = int ( input ( ) ) l = [ ] d = { ' purple ' : ' Power ' , ' green ' : ' Time ' , ' blue ' : ' Space ' , ' orange ' : ' Soul ' , ' red ' : ' Reality ' , ' yellow ' : ' Mind ' } for i in range ( n ) : l . append ( input ( ) ) d1 = dict . fromkeys ( l ) print ( 6 - len ( l ) ) for i in d : if ( i not in d1 ) : print ( d [ i ] ) NEW_LINE

t = int ( input ( ) ) l = [ ] d = { " purple " : " Power ▁ " , " green " : " Time ▁ " , " blue " : " Space ▁ " , " orange " : " Soul ▁ " , " red " : " ▁ Reality " , " yellow " : " ▁ Mind ▁ " } for i in range ( t ) : s = input ( ) l . append ( s ) NEW_LINE

def main_function ( ) : dict = { " Power " : " purple " , " Time " : " green " , " Space " : " blue " , " Soul " : " orange " , " Reality " : " red " , " Mind " : " yellow " } reversed_dict = { " purple " : " Power " , " green " : " Time " , " blue " : " Space " , " orange " : " Soul " , " red " : " Reality " , " yellow " : " Mind " } colours = [ ] output_stones = [ ] e = [ ] t = int ( input ( ) ) for i in range ( t ) : colour = input ( ) colours . append ( colour ) for i in reversed_dict : if i not in colours : output_stones . append ( i ) for i in output_stones : e . append ( reversed_dict [ i ] ) return str ( len ( e ) ) + " \n " + " \n " . join ( e )   print ( main_function ( ) ) NEW_LINE


import java . util . ArrayList ; import java . util . HashMap ; import java . util . Map ; import java . util . Scanner ;   public class WorkFile { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String str = scanner . next ( ) ; char [ ] s = str . toCharArray ( ) ; int k = scanner . nextInt ( ) ; HashMap < Character , Integer > d = new HashMap < > ( ) ; for ( char elem : s ) { d . putIfAbsent ( elem , 0 ) ; d . replace ( elem , d . get ( elem ) + 1 ) ; } HashMap < Integer , ArrayList < Character > > dict = new HashMap < > ( ) ; for ( Map . Entry < Character , Integer > pair : d . entrySet ( ) ) { dict . putIfAbsent ( pair . getValue ( ) , new ArrayList < Character > ( ) ) ; ArrayList list = new ArrayList ( dict . get ( pair . getValue ( ) ) ) ; list . add ( pair . getKey ( ) ) ; dict . replace ( pair . getValue ( ) , list ) ; } ArrayList < Integer > list = new ArrayList < > ( dict . keySet ( ) ) ; int result = 0 ; for ( int elem : list ) { for ( char element : dict . get ( elem ) ) { if ( k >= elem ) { result ++ ; k -= elem ; str = str . replaceAll ( Character . toString ( element ) , " " ) ; } } } System . out . println ( d . size ( ) - result ) ; System . out . println ( str ) ; } }

# abacaba   m = raw_input ( ) n = input ( ) x = { } v = { } v1 = { } count = 0   for i in m : if i in x : x [ i ] += 1 else : x [ i ] = 1   sorted_set = sorted ( [ ( x [ i ] , i ) for i in x ] )   for ( v , i ) in sorted_set : if v > n : break ; n -= v m = m . replace ( i , '') # print len(set(m))# print m for j in m:	if j in v1:		pass	else:		v1[j]= 1print len(v1)print m

import java . util . Scanner ; import java . util . Arrays ; public class dever_de_casa { public static final int GAMBI = 100 ; public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String linha = sc . nextLine ( ) ; int k = sc . nextInt ( ) ; sc . nextLine ( ) ; int [ ] ocorrencias = new int [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) ocorrencias [ i ] = i ; for ( int i = 0 ; i < linha . length ( ) ; i ++ ) ocorrencias [ linha . charAt ( i ) - ' a ' ] += GAMBI ; Arrays . sort ( ocorrencias ) ; int j = 0 , aux ; while ( k > 0 && j < 26 ) { aux = ( ocorrencias [ j ] - ( ocorrencias [ j ] % GAMBI ) ) / GAMBI ; if ( aux > k ) { ocorrencias [ j ] -= k * GAMBI ; k = 0 ; } else { ocorrencias [ j ] -= aux * GAMBI ; k -= aux ; j ++ ; } } int [ ] ocorrencias2 = new int [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) ocorrencias2 [ ocorrencias [ i ] % GAMBI ] = ( ocorrencias [ i ] - ( ocorrencias [ i ] % GAMBI ) ) / GAMBI ; aux = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) if ( ocorrencias2 [ i ] > 0 ) aux ++ ; System . out . println ( aux ) ; for ( int i = 0 ; i < linha . length ( ) ; i ++ ) { if ( ocorrencias2 [ linha . charAt ( i ) - ' a ' ] > 0 ) { System . out . print ( linha . charAt ( i ) ) ; ocorrencias2 [ linha . charAt ( i ) - ' a ' ] -- ; } } System . out . print ( " \n " ) ; } }

def solve ( ) : str0 = input ( ) k = int ( input ( ) ) NEW_LINE

import collectionss = input ( ) k = int ( input ( ) )   d = dict ( ) for i in s : if i in d : d [ i ] += 1 else : d [ i ] = 1 d = sorted ( d . items ( ) , key = lambda x : x [ 1 ] ) A = set ( ) ans = 0 NEW_LINE


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 . System . * ; import static java . util . Arrays . fill ; import static java . lang . Math . log ; import static java . lang . Math . abs ; import static java . lang . Math . pow ; import static java . lang . Math . sqrt ; import static java . lang . Math . floor ; import static java . lang . Math . ceil ; import static java . lang . Math . sin ; import static java . lang . Math . cos ; import static java . lang . Math . tan ; 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 ) ;

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . * ;   public class Main { static long mod = 998244353 ; public static void main ( String [ ] args ) {   FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; String s = input . next ( ) ; long firstcount = 0 ; long lastcount = 0 ; char first = s . charAt ( 0 ) ; char last = s . charAt ( n - 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == first ) firstcount ++ ; else break ; } for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( s . charAt ( i ) == last ) lastcount ++ ; else break ; } if ( first == last ) { System . out . println ( ( firstcount + 1 ) * ( lastcount + 1 ) % mod ) ; } else { System . out . println ( 1 + firstcount + lastcount ) ; }   }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }

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

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

import sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapify , nlargestfrom copy import deepcopymod = 10 ** 9 + 7 INF = float ( ' inf ' ) def inp ( ) : return int ( sys . stdin . readline ( ) ) def inpl ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def inpl_1 ( ) : return list ( map ( lambda x : int ( x ) - 1 , sys . stdin . readline ( ) . split ( ) ) ) def inps ( ) : return sys . stdin . readline ( ) def inpsl ( x ) : tmp = sys . stdin . readline ( ) ; return tmp [ : x ] def err ( x ) : print ( x ) ; exit ( )   mod = 998244353 n = inp ( ) s = inpsl ( n ) if len ( list ( Counter ( s ) ) ) == 1 : print ( ( ( n + 1 ) * n // 2 ) % mod ) else : l = r = 0 for i in range ( n ) : if s [ i ] != s [ 0 ] : l = i + 1 ; break for i in range ( n ) [ : : - 1 ] : if s [ i ] != s [ - 1 ] : r = n - i break if s [ 0 ] == s [ - 1 ] : print ( l * r % mod ) else : print ( ( l + r - 1 ) % mod ) NEW_LINE

from sys import stdin , stdout , setrecursionlimitfrom functools import lru_cache , cmp_to_keyfrom heapq import merge , heapify , heappop , heappush , nlargestfrom math import * from collections import defaultdict as dd , deque , Counter as Cfrom itertools import combinations as comb , permutations as perm , accumulatefrom bisect import bisect_left as bl , bisect_right as br , bisectfrom time import perf_counterfrom fractions import Fractionimport copyimport timesetrecursionlimit ( 10 ** 9 ) starttime = time . time ( ) mod = int ( pow ( 10 , 9 ) + 7 ) mod2 = 998244353 NEW_LINE

length = int ( input ( ) ) string = input ( ) m = 0 n = 0 temp1 = string [ 0 ] temp2 = string [ - 1 ] for i in string : if i == temp1 : m += 1 continue for j in range ( 1 , length + 1 ) : if string [ - j ] == temp2 : n += 1 continue break breakif n == 0 : print ( ( ( ( m + 1 ) * m ) / 2 ) % 998244353 ) elif temp1 == temp2 : print ( ( ( m + 1 ) * ( n + 1 ) ) % 998244353 ) else : print ( ( n + m + 1 ) % 998244353 ) NEW_LINE


import java . util . * ; public class Main { static HashMap < Long , Integer > h = new HashMap < > ( ) ; public static void query ( char c , long num ) { if ( c == ' ? ' ) { if ( h . containsKey ( num ) ) System . out . println ( h . get ( num ) ) ; else System . out . println ( "0" ) ; } else if ( c == ' + ' || c == ' - ' ) { String s = " " ; while ( num != 0 ) { long i = num % 10 ; if ( i % 2 == 0 ) s += "0" ; else s += "1" ; num = num / 10 ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( s ) ; sb = sb . reverse ( ) ; String temp = new String ( sb ) ; num = Long . parseLong ( temp , 10 ) ; if ( c == ' + ' ) { if ( h . containsKey ( num ) ) h . put ( num , h . get ( num ) + 1 ) ; else h . put ( num , 1 ) ; } else { h . put ( num , h . get ( num ) - 1 ) ; } }   } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { char ch = sc . next ( ) . charAt ( 0 ) ; long num = sc . nextLong ( ) ; query ( ch , num ) ; } } }

import java . util . * ; public class Sonya { public static String func ( long x ) { int i = 0 ; String p = " " ; while ( x != 0 ) { if ( x % 2 == 0 ) p = "0" + p ; else p = "1" + p ; x /= 10 ; } return p ; } 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 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 = 300005 ; private static final int MAXA = 1000007 ; 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 ) ;

# include < iostream > # include < stdio . h > # include < cstdio > # include < bits / stdc ++ . h > # include < limits > # include < algorithm > # include < set > # define pb push_back # define all ( v ) ( v ) . begin ( ) , ( v ) . end ( ) # define deb ( x ) cout << x << " \n " ; # define loop ( n ) for ( int i = 0 ; i < n ; i ++ ) # define ld long double # define ll long long # define pii pair < int , int > # define ff first # define ss second # define ump unordered_map # define mod 1000000007 # define pr ( n ) cout << n << endl ; # define inf INT_MAX # define FAST ios_base :: sync_with_stdio ( false ) ; cin . tie ( NULL ) ; using namespace std ;    int main ( ) { FAST int t = 1 ; cin >> t ; unordered_map < int , int > m ; while ( t -- ) { char op ; string s ; cin >> op >> s ; int a = 0 ; for ( int i = s . length ( ) - 1 ; i >= 0 ; i -- ) { int x = ( s [ i ] - '0' ) % 2 ; a += pow ( 2 , s . length ( ) - 1 - i ) * x ; }   if ( op == ' + ' ) m [ a ] ++ ; else if ( op == ' - ' ) m [ a ] -- ; else { pr ( m [ a ] ) ; } }    }

from sys import stdinfrom sys import stdoutfrom collections import defaultdict r = set ( '02468' )   def mask ( n ) : result = ' ' for x in n : if x in r : result += '0' else : result += '1' return int ( result ) n = int ( stdin . readline ( ) ) a = defaultdict ( int ) for _ in range ( n ) : command , x = stdin . readline ( ) . strip ( ) . split ( ' ▁ ' ) m = mask ( x ) if command == ' + ' : a [ m ] += 1 if command == ' - ' : a [ m ] -= 1 if command == ' ? ' : stdout . write ( str ( a [ m ] ) + ' \n ' ) stdout . flush ( ) NEW_LINE

t = int ( input ( ) ) d = [ 0 ] * 262143 convert = str . maketrans ( '0123456789' , '0101010101' ) for _ in range ( t ) : c , a = input ( ) . split ( ) if c == ' ? ' : print ( d [ int ( a , 2 ) ] ) else : d [ int ( a . translate ( convert ) , 2 ) ] += 1 if c == ' + ' else - 1 NEW_LINE

t = str . maketrans ( "0123456789" , "0101010101" ) dct = { } for _ in range ( int ( input ( ) ) ) : q , a = input ( ) . split ( ) if ( q == " + " ) : c = int ( a . translate ( t ) ) try : dct [ c ] += 1 except : dct [ c ] = 1 elif ( q == " - " ) : c = int ( a . translate ( t ) ) try : dct [ c ] -= 1 except : dct [ c ] = 1 else : c = int ( a . translate ( t ) ) try : print ( dct [ c ] ) except : print ( 0 ) NEW_LINE


import static java . lang . Math . max ; import static java . lang . Math . min ; import static java . lang . Math . abs ; import java . util . * ; import java . io . * ;   public class x954A { public static void main ( String hi [ ] ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; char [ ] arr = infile . readLine ( ) . toCharArray ( ) ; int res = N ; for ( int i = 1 ; i < N ; i ++ ) if ( arr [ i ] != arr [ i - 1 ] ) { i ++ ; res -- ; } System . out . println ( res ) ; } public static int [ ] readArr ( int N , BufferedReader infile , StringTokenizer st ) throws Exception { int [ ] arr = new int [ N ] ; st = new StringTokenizer ( infile . readLine ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) arr [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; return arr ; } }

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

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

import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int count = 0 ; StringBuilder sb = new StringBuilder ( sc . next ( ) ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) { String s = sb . substring ( i , i + 2 ) ; if ( s . equals ( " UR " ) || s . equals ( " RU " ) ) { count ++ ; i ++ ; } } System . out . println ( ( sb . length ( ) - count ) ) ;   } }

n = int ( input ( ) )   s = list ( input ( ) ) ans = 0   i = 0 while i < n - 1 : if s [ i ] != s [ i + 1 ] : ans += 1 i += 1 i += 1   print ( n - ans ) NEW_LINE

import sys , mathfrom collections import deque , defaultdictimport operator as opfrom functools import reducefrom itertools import permutations   NEW_LINE

n = int ( input ( ) ) s = list ( input ( ) ) c = 0   for i in range ( n - 1 ) : if s [ i ] + s [ i + 1 ] == ' RU ' or s [ i ] + s [ i + 1 ] == ' UR ' : s [ i ] , s [ i + 1 ] = ' D ' , ' D ' c += 1   print ( len ( s ) - c ) NEW_LINE

n = int ( input ( ) ) s = input ( ) a = list ( s ) i = 0 c = 0 while i < n - 1 : if a [ i ] == ' U ' and a [ i + 1 ] == ' R ' : c = c + 1 a [ i ] = ' D ' a [ i + 1 ] = ' D ' elif a [ i ] == ' R ' and a [ i + 1 ] == ' U ' : a [ i ] = ' D ' a [ i + 1 ] = ' D ' c = c + 1 i = i + 1 print ( n - c ) NEW_LINE

n = int ( input ( ) ) s = list ( input ( ) ) x = 0 for i in range ( 0 , n - 1 ) : if s [ i ] == ' U ' and s [ i + 1 ] == ' R ' : s [ i ] = ' D ' s [ i + 1 ] = ' D ' x += 1 elif s [ i ] == ' R ' and s [ i + 1 ] == ' U ' : s [ i ] = ' D ' s [ i + 1 ] = ' D ' x += 1 print ( n - x ) NEW_LINE


import java . util . Scanner ;   public class _0719LaunchofCollider {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int min = Integer . MAX_VALUE ; int prev = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int curr = sc . nextInt ( ) ; if ( prev == - 1 ) { prev = curr ; continue ; } else { if ( s . charAt ( i - 1 ) == ' R ' && s . charAt ( i ) == ' L ' ) { min = Math . min ( min , curr - prev ) ; } } prev = curr ; } if ( min == Integer . MAX_VALUE ) { System . out . println ( - 1 ) ; } else { System . out . println ( min / 2 ) ; } }   }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ; import java . io . PrintWriter ;      public class A {    public static void main ( String [ ] args ) throws IOException { FastReader sc = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; String str = sc . next ( ) ; char [ ] dir = str . toCharArray ( ) ; int [ ] pos = sc . nextIntArray ( n ) ;   if ( str . replaceAll ( " RL " , " " ) . length ( ) == n ) out . println ( - 1 ) ;   else {   int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( dir [ i ] == ' R ' && dir [ i + 1 ] == ' L ' ) min = Math . min ( min , pos [ i + 1 ] - pos [ i ] ) ; } out . println ( min / 2 ) ; }   out . close ( ) ; }

import java . util . * ; import java . io . * ; public class MyClass { public static void main ( String args [ ] ) { try { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String s = br . readLine ( ) ; String str [ ] = br . readLine ( ) . split ( " ▁ " ) ; int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int v = Integer . parseInt ( str [ i ] ) ; char ch = s . charAt ( i ) ; if ( ch == ' L ' ) { arr [ i ] = - v ; } else if ( ch == ' R ' ) { arr [ i ] = v ; } } int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n - 1 ; i ++ ) { int v1 = arr [ i ] ; int v2 = arr [ i + 1 ] ; if ( ( v1 > 0 && v2 < 0 ) || ( v1 == 0 && s . charAt ( i ) == ' R ' && v2 < 0 ) ) {

import java . util . Scanner ; public class Cf { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; String S = input . next ( ) ; int array [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { array [ i ] = input . nextInt ( ) ; } boolean collision = false ; int distance = 1000000000 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( S . charAt ( i ) == ' R ' && S . charAt ( i + 1 ) == ' L ' ) { collision = true ; int temp = ( array [ i + 1 ] - array [ i ] ) ; if ( temp < distance ) distance = temp ; } } if ( collision ) System . out . println ( distance / 2 ) ; else System . out . println ( " - 1" ) ; } }

n = int ( input ( ) )   directions = [ x for x in input ( ) ] points = [ int ( x ) for x in input ( ) . split ( ) ]   m = 9999999999999 flag = Falsefor x in range ( len ( directions ) - 1 ) : if directions [ x ] == " R " and directions [ x + 1 ] == " L " : a = ( ( points [ x ] + points [ x + 1 ] ) / 2 ) - points [ x ] flag = True if ( a < m ) : m = aif flag : print ( int ( m ) ) else : print ( - 1 ) NEW_LINE

from sys import stdinn = int ( stdin . readline ( ) ) s = stdin . readline ( ) [ : - 1 ] a = list ( map ( int , stdin . readline ( ) . split ( ) ) ) min_val = Nonefor i in range ( n - 1 ) : if s [ i ] == ' R ' and s [ i + 1 ] == ' L ' : val = abs ( a [ i ] - a [ i + 1 ] ) // 2 if not min_val : min_val = val min_val = min ( min_val , val ) if not min_val : print ( - 1 ) else : print ( min_val ) NEW_LINE

n = int ( input ( ) ) i = input ( ) arr = list ( map ( int , input ( ) . split ( ) ) ) if " RL " not in i : print ( - 1 ) else : ris = 999999999999999999999999999999 for x in range ( n - 1 ) : if i [ x ] == " R " and i [ x + 1 ] == " L " : ris = min ( ris , ( arr [ x + 1 ] - arr [ x ] ) // 2 ) print ( ris ) NEW_LINE

n = int ( input ( ) ) s = input ( ) a = list ( map ( int , input ( ) . split ( ) ) ) t = 10 ** 10 for i in range ( n - 1 ) : if s [ i : i + 2 ] == ' RL ' : t = min ( t , ( a [ i + 1 ] - a [ i ] ) // 2 ) if t == 10 ** 10 : print ( - 1 ) else : print ( t ) NEW_LINE


import java . util . * ;   import java . io . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; new Main ( ) . run ( in , out ) ; out . close ( ) ; }

import sysreadline = sys . stdin . readline     def gcd ( a , b ) : while b : a , b = b , a % b return a     def prsh ( N ) : prime = [ 2 ] for L in range ( 3 , N ) : for p in prime : if not L % p : break if p > L ** ( 1 / 2 ) : prime . append ( L ) break return primelimit = 59 prime = prsh ( limit + 1 ) C = set ( [ tuple ( ) ] ) Cp = [ ] for i in range ( 2 , limit + 1 ) : if i >= 30 and i in prime : Cp . append ( i ) continue for k in C . copy ( ) : if all ( gcd ( ki , i ) == 1 for ki in k ) : kn = tuple ( list ( k ) + [ i ] ) C . add ( kn )   INF = 10 ** 9 + 7   N = int ( readline ( ) ) A = list ( map ( int , readline ( ) . split ( ) ) ) Ao = A [ : ] A . sort ( ) ans = INFAns = Nonefor ci in C : tc = [ 1 ] * ( N - len ( ci ) ) + list ( ci ) + Cp for j in range ( 8 ) : res = 0 for a , t in zip ( A , tc [ j : ] ) : res += abs ( a - t ) if ans > res : ans = res Ans = tc [ j : j + N ] buc = [ [ ] for _ in range ( limit + 1 ) ] for a , an in zip ( A , Ans ) : buc [ a ] . append ( an ) AA = [ ] for ao in Ao : AA . append ( buc [ ao ] . pop ( ) )   NEW_LINE


import java . util . * ;   public class B {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int tc = sc . nextInt ( ) ;   for ( ; tc > 0 ; tc -- ) { int n = sc . nextInt ( ) ; n = n * 2 ;   ArrayList < Integer > a = new ArrayList < Integer > ( ) ;   for ( int i = 0 ; i < n ; ++ i ) { a . add ( sc . nextInt ( ) ) ; }   Collections . sort ( a ) ; System . out . println ( a . get ( n / 2 ) - a . get ( n / 2 - 1 ) ) ; } }     }

import java . util . Scanner ; import java . util . Arrays ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- != 0 ) { int n = s . nextInt ( ) ; int arr [ ] = new int [ 2 * n ] ; for ( int i = 0 ; i < 2 * n ; i ++ ) { arr [ i ] = s . nextInt ( ) ; } Arrays . sort ( arr ) ; System . out . println ( arr [ n ] - arr [ n - 1 ] ) ; } } }

import java . util . * ;    public class Practise {

import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = sc . nextInt ( ) ; int [ ] ar = new int [ 2 * n + 1 ] ; for ( int j = 1 ; j <= 2 * n ; j ++ ) { ar [ j ] = sc . nextInt ( ) ; } Arrays . sort ( ar ) ; int mid = n ; int ans = ar [ mid + 1 ] - ar [ mid ] ; System . out . println ( ans ) ; } }    public static int getAns ( int [ ] ar , int bigger , int i , int [ ] dp ) {   if ( i < 0 ) { return 0 ; } if ( i == 0 ) { return 1 ; } if ( dp [ i ] != - 1 ) { return dp [ i ] ; } int ans1 = 0 , ans2 ; if ( ar [ i ] < bigger ) { ans1 = 1 + getAns ( ar , ar [ i ] , i - 1 , dp ) ;

import java . io . * ; import java . lang . Math ; import java . util . * ;   public class Main {   public BufferedReader in ; public PrintStream out ;   public boolean log_enabled = false ; public boolean multiply_tests = true ;   public static boolean do_gen_test = false ; public void gen_test ( ) { } private class TestCase {   public Object solve ( ) { int n = readInt ( ) ; int [ ] a = readIntArray ( 2 * n ) ; Arrays . sort ( a ) ; return a [ n ] - a [ n - 1 ] ;

t = int ( input ( ) ) for a in range ( t ) : n = int ( input ( ) ) bt = list ( map ( int , input ( ) . split ( ) ) ) bt . sort ( ) print ( abs ( bt [ n - 1 ] - bt [ n ] ) ) NEW_LINE

import mathcan = [ ] n = int ( input ( ) ) ye = [ [ None ] * n ] * n   for i in range ( n ) :   m = int ( input ( ) ) can = list ( map ( int , input ( ) . split ( ) ) ) can . sort ( ) ye [ i ] = can [ m ] - can [ m - 1 ]             for i in range ( n ) :   print ( ye [ i ] ) NEW_LINE

import sys   input = sys . stdin . buffer . readline   t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) A = sorted ( map ( int , input ( ) . split ( ) ) ) print ( A [ n ] - A [ n - 1 ] ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) l = sorted ( l , reverse = True ) x = abs ( l [ ( 2 * n ) // 2 ] - l [ ( ( 2 * n ) // 2 ) - 1 ] ) print ( x ) NEW_LINE

from math import sqrt   t = int ( input ( ) ) ans = [ ]   for _ in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) a = sorted ( a )   if n == 1 : ans . append ( abs ( a [ 0 ] - a [ 1 ] ) ) continue   a1 = [ ] a2 = [ ]   f = True for i in a : if f : f = not f a1 . append ( i ) else : f = not f a2 . append ( i )   if n % 2 == 0 : a1 . append ( a2 [ len ( a2 ) - 1 ] ) a2 = a2 [ : len ( a2 ) - 1 ]     ans . append ( abs ( a1 [ int ( ( len ( a1 ) - 1 ) / 2 ) ] - a2 [ int ( ( len ( a2 ) - 1 ) / 2 ) ] ) )     for i in ans : print ( i ) NEW_LINE


import java . util . * ;   public class Main { int n , x ;   public static void main ( String ... args ) { new Main ( ) . calculate ( ) ; }   void calculate ( ) { Scanner in = new Scanner ( System . in ) ; n = in . nextInt ( ) ; x = in . nextInt ( ) ; ArrayList < Candy > Arr = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) Arr . add ( new Candy ( in . nextInt ( ) , in . nextInt ( ) , in . nextInt ( ) ) ) ; System . out . print ( Math . max ( maxC ( Arr , 0 , x ) , maxC ( Arr , 1 , x ) ) ) ; }   int maxC ( ArrayList < Candy > cs , int t , int x ) { ArrayList < Candy > arrayList = new ArrayList < > ( cs ) ; arrayList . removeIf ( ( c ) -> c . type != t || c . height > x ) ; if ( arrayList . isEmpty ( ) ) return 0 ; Collections . sort ( arrayList , Comparator . comparing ( Candy :: getMass ) ) ; ArrayList < Candy > arr1 = new ArrayList < > ( cs ) ; Candy c = arrayList . get ( arrayList . size ( ) - 1 ) ; arr1 . remove ( c ) ; return maxC ( arr1 , 1 - t , x + c . mass ) + 1 ; } }   class Candy { int type , height , mass ; public Candy ( int t , int h , int m ) { this . type = t ; this . height = h ; this . mass = m ; } public int getMass ( ) { return mass ; } }

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

n , x = map ( int , input ( ) . split ( ) ) count = 0 ans = 0 curr = 0 fruit = [ ] caramel = [ ] for i in range ( n ) : t , h , m = map ( int , input ( ) . split ( ) ) if t == 0 : caramel . append ( ( h , m ) ) else : fruit . append ( ( h , m ) )   caramel = sorted ( caramel ) fruit = sorted ( fruit ) fruit2 = fruit [ : : ] caramel2 = caramel [ : : ] x2 = x   def add_to_mass ( arr , x ) : candy = 0 curr = 0 for i in range ( len ( arr ) ) : if arr [ i ] [ 0 ] <= x : if arr [ i ] [ 1 ] >= candy : candy = arr [ i ] [ 1 ] curr = i if candy == 0 : return 0 arr . pop ( curr ) return candy   while True : curr = add_to_mass ( fruit , x ) if curr == 0 : break else : x += curr count += 1 curr = add_to_mass ( caramel , x ) if curr == 0 : break else : x += curr count += 1 ans = countcount = 0 while True : curr = add_to_mass ( caramel2 , x2 ) if curr == 0 : break else : x2 += curr count += 1 curr = add_to_mass ( fruit2 , x2 ) if curr == 0 : break else : x2 += curr count += 1 ans = max ( count , ans ) print ( ans ) NEW_LINE

def solve ( p , n , x , t , h , m ) : used , xx , ans = [ 0 ] * n , x , 0 while ( True ) : k = - 1 for i in range ( n ) : if ( used [ i ] == 0 ) and ( t [ i ] == p ) and ( h [ i ] <= xx ) and ( ( k == - 1 ) or ( m [ i ] > m [ k ] ) ) : k = i if ( k == - 1 ) : break ans += 1 xx += m [ k ] used [ k ] = 1 p = p ^ 1 return ans n , x = map ( int , input ( ) . split ( ) ) t , h , m = [ 0 ] * n , [ 0 ] * n , [ 0 ] * nfor i in range ( n ) : t [ i ] , h [ i ] , m [ i ] = map ( int , input ( ) . split ( ) ) print ( max ( solve ( 0 , n , x , t , h , m ) , solve ( 1 , n , x , t , h , m ) ) ) NEW_LINE

n , x = map ( int , input ( ) . split ( ) ) can = [ [ ] , [ ] ] for i in range ( n ) : a , b , c = map ( int , input ( ) . split ( ) ) can [ a ] . append ( ( b , c ) ) ans = 0 for nturn in range ( 2 ) : u = [ [ ] , [ ] ] for i in range ( 2 ) : for j in range ( len ( can [ i ] ) ) : u [ i ] . append ( False ) nx = x nw = 0 turn = nturn for i in range ( n ) : mx = - 1 bj = - 1 for j in range ( len ( can [ turn ] ) ) : if not u [ turn ] [ j ] and can [ turn ] [ j ] [ 0 ] <= nx and can [ turn ] [ j ] [ 1 ] > mx : bj = j mx = can [ turn ] [ j ] [ 1 ] if bj != - 1 : nx += mx u [ turn ] [ bj ] = True nw += 1 else : break turn = ( turn + 1 ) % 2 ans = max ( ans , nw ) print ( ans )       NEW_LINE


import java . io . * ; import java . util . * ;   public class ranjan {   public static Reader cin ; public static PrintWriter cout ; public static boolean [ ] visited ; public static final long bil = ( long ) 1e9 + 7 ; public static void main ( String [ ] arg ) throws IOException {

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . util . List ; import java . util . StringTokenizer ;   public class Main { public static void main ( String [ ] args ) { InputReader in = new InputReader ( System . in ) ; PrintWriter out = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) , true ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . flush ( ) ; out . close ( ) ; } }   class Pair < A , B > { A first ; B second ;   Pair ( A first , B second ) { this . first = first ; this . second = second ; }   }   class TaskB { long INF = ( long ) 1e9 + 7 ; int MAX_N = ( int ) 2e4 + 5 ; long mod = ( long ) 1e8 ; List < Integer > ans ;   public void solve ( int testNumber , InputReader in , PrintWriter pw ) { int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int k = in . nextInt ( ) ; if ( k == 1 || k > n ) { long temp = pow ( m , n ) ; pw . println ( temp ) ; } else if ( k == n ) { long temp = pow ( m , ( n + 1 ) / 2 ) ; pw . println ( temp ) ; } else { if ( k % 2 == 0 ) { pw . println ( m ) ; } else { long temp = pow ( m , 2 ) ; pw . println ( temp ) ; } }   }   long pow ( long m , long k ) { long prod = 1 ; for ( int i = 0 ; i < k ; i ++ ) { prod = ( prod * m ) % INF ; } return prod % INF ; }

# include < bits / stdc ++ . h >  # define error ( args ... ) { string _s = # args ; replace ( _s . begin ( ) , _s . end ( ) , ' , ' , ' ▁ ' ) ; stringstream _ss ( _s ) ; istream_iterator < string > _it ( _ss ) ; err ( _it , args ) ; } # define all ( x ) x . begin ( ) , x . end ( ) # define rall ( x ) x . rbegin ( ) , x . rend ( ) # define sz ( x ) ( int ) x . size ( )

n , m , k = input ( ) . split ( ) n = int ( n ) m = int ( m ) k = int ( k ) module = 1000000007 if k <= 0 : print ( 0 ) elif k == 1 or k > n : print ( ( m ** n ) % module ) elif k == n : print ( ( m ** int ( ( n + 1 ) / 2 ) ) % module ) elif k % 2 == 1 : print ( ( m ** 2 ) % module ) elif k % 2 == 0 : print ( m % module ) NEW_LINE


import java . io . BufferedReader ; import java . util . * ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . HashSet ; import java . util . Random ; import java . util . Set ; import java . util . StringTokenizer ;    public class A { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int n = fs . nextInt ( ) ; int [ ] v = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { v [ i ] = fs . nextInt ( ) ; } boolean inc = false ; boolean dec = false ; boolean cont = false ; boolean ok = true ; for ( int i = 0 ; i + 1 < n ; i ++ ) { if ( v [ i ] < v [ i + 1 ] ) { if ( ! dec && ! cont ) { inc = true ; } else { ok = false ; break ; } } if ( v [ i ] == v [ i + 1 ] ) { if ( ! dec ) { cont = true ; } else { ok = false ; break ; } } if ( v [ i ] > v [ i + 1 ] ) { dec = true ; } } if ( ok ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } static final Random random = new Random ( ) ; static void ruffleSort ( int [ ] a ) { int n = a . length ;

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

import java . util . Scanner ;   public class UnimodalArr { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i , l = in . nextInt ( ) ; boolean y = false , z = false , o = true ;   for ( i = 1 ; i < n ; i ++ ) { int a = in . nextInt ( ) ;   if ( a > l ) { if ( y || z ) o = false ; } else if ( a == l ) { if ( z ) o = false ; y = true ; } else { y = true ; z = true ; } l = a ;

import math   length = int ( input ( ) ) array = list ( map ( int , input ( ) . split ( ) ) ) cur = 2   for each in range ( 1 , length ) : dif = array [ each ] - array [ each - 1 ] if ( ( cur == 2 or cur == 1 ) and dif > 0 ) : cur = 1 elif ( ( cur == 2 or cur == 1 or cur == 0 ) and dif == 0 ) : cur = 0 elif ( ( cur == 2 or cur == 0 or cur == - 1 or cur == 1 ) and dif < 0 ) : cur = - 1 else : cur = 3 break if ( cur == 3 ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE

from sys import stdinn = int ( stdin . readline ( ) ) a = list ( map ( int , stdin . readline ( ) . split ( ) ) ) i = 0 while i < n - 1 and a [ i ] < a [ i + 1 ] : i += 1   while i < n - 1 and a [ i ] == a [ i + 1 ] : i += 1   while i < n - 1 : if a [ i ] <= a [ i + 1 ] : exit ( print ( " NO " ) ) i += 1   print ( " Yes " ) NEW_LINE

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) i = 0   while i + 1 < n and arr [ i + 1 ] > arr [ i ] : i += 1 while i + 1 < n and arr [ i + 1 ] == arr [ i ] : i += 1 while i + 1 < n and arr [ i + 1 ] < arr [ i ] : i += 1 print ( " YES " if i == n - 1 else " NO " ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . strip ( ) . split ( ) ) ) i = 0 while i < n - 1 and a [ i ] < a [ i + 1 ] : i += 1 while i < n - 1 and a [ i ] == a [ i + 1 ] : i += 1 while i < n - 1 : if a [ i ] <= a [ i + 1 ] : print ( " NO " ) exit ( 0 ) i += 1 print ( " YES " ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) i = 0 while i + 1 < n and a [ i ] < a [ i + 1 ] : i += 1 while i + 1 < n and a [ i ] == a [ i + 1 ] : i += 1 while i + 1 < n and a [ i ] > a [ i + 1 ] : i += 1 if i == n - 1 : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class XK_Segment { public static int lowerBound ( long arr [ ] , long key ) { int left = 0 ; int right = arr . length ; int mid ; while ( left < right ) { mid = ( left + right ) / 2 ; if ( key <= arr [ mid ] ) { right = mid ; } else { left = mid + 1 ; } } return left ; } public static int upperBound ( long arr [ ] , long key ) { int left = 0 ; int right = arr . length ; int mid ; while ( left < right ) { mid = ( left + right ) / 2 ; if ( key >= arr [ mid ] ) { left = mid + 1 ; } else { right = mid ; } } return left ; }   public static void main ( String [ ] args ) {

import java . util . * ; public class MyClass { static Integer [ ] a ; static int n , k , x ; static int numDiv ( int i , int j ) { return a [ j ] / x - ( a [ i ] - 1 ) / x ; } public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; n = sc . nextInt ( ) ; x = sc . nextInt ( ) ; k = sc . nextInt ( ) ; a = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; Arrays . sort ( a ) ; long ans = 0 ; for ( int i = 0 , l = 0 , r = 0 ; i < n ; i ++ ) { while ( l < n && ( a [ l ] < a [ i ] || numDiv ( i , l ) < k ) ) l ++ ; while ( r < n && ( a [ r ] < a [ i ] || numDiv ( i , r ) <= k ) ) r ++ ;

import java . io . * ; import java . util . * ;   public class Main {   public static void main ( String [ ] args ) throws Exception { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( in . readLine ( ) ) ; long n = Integer . parseInt ( st . nextToken ( ) ) ; long x = Integer . parseInt ( st . nextToken ( ) ) ; long k = Integer . parseInt ( st . nextToken ( ) ) ; PriorityQueue < Long > pq = new PriorityQueue < > ( Collections . reverseOrder ( ) ) ; st = new StringTokenizer ( in . readLine ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) { pq . offer ( ( long ) Integer . parseInt ( st . nextToken ( ) ) ) ; } HashMap < Long , Long > map = new HashMap < > ( ) ; long res = 0 ; long charge = 0 ; while ( ! pq . isEmpty ( ) ) { long i = pq . poll ( ) ; long floor = ( i / x ) * x ; if ( ! map . containsKey ( floor ) ) { map . put ( floor , ( long ) 0 ) ; } map . put ( floor , map . get ( floor ) + 1 ) ; charge ++ ;   if ( ! pq . isEmpty ( ) && pq . peek ( ) == i ) { continue ; }    long ceil = ( i / x ) * x ; if ( i % x != 0 ) { ceil += x ; }

from bisect import bisect_left R = lambda : map ( int , input ( ) . split ( ) ) n , x , k = R ( ) a = sorted ( R ( ) ) print ( sum ( bisect_left ( a , l + x ) - bisect_left ( a , max ( u , l ) ) for u , l in ( ( u , ( ( u - 1 ) // x + k ) * x ) for u in a ) ) ) NEW_LINE

f = lambda : map ( int , input ( ) . split ( ) ) n , x , k = f ( ) t = sorted ( f ( ) ) s = i = j = 0 for y in t : d = ( y // x - k ) * x while i < n and t [ i ] <= min ( d , y ) : i += 1 while j < n and t [ j ] <= min ( d + x , y ) : j += 1 s += j - iprint ( s ) NEW_LINE

from bisect import bisect_left as bR = lambda : map ( int , input ( ) . split ( ) ) n , x , k = R ( ) a = sorted ( R ( ) ) print ( sum ( b ( a , l + x ) - b ( a , max ( u , l ) ) for u , l in ( ( u , ( ( u - 1 ) // x + k ) * x ) for u in a ) ) ) NEW_LINE

import random , mathfrom copy import deepcopy as dcfrom bisect import bisect_left , bisect_right   NEW_LINE


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

import java . util . * ; import java . io . * ; public class Solve {   static BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringTokenizer st ; static PrintWriter pr = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; public static void main ( String [ ] args ) throws IOException { int n = readInt ( ) , arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = readInt ( ) ; } Map < Integer , Integer > mp = new HashMap ( ) ; for ( int i = 0 ; i < n ; i ++ ) {

import java . io . * ; import java . util . * ; public final class code

def rec ( x ) : if x == 1 : return 1   if x % 2 == 0 : return rec ( x // 2 )   else : return rec ( x // 2 ) + 1   n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) d = { } ans = 0 for i in l : som = rec ( i ) if som in d : d [ som ] += 1   else : d [ som ] = 1   for i in d : ans = ans + int ( ( ( d [ i ] - 1 ) / 2 ) * ( d [ i ] ) )   print ( ans ) NEW_LINE

import mathimport timefrom collections import defaultdict , dequefrom sys import stdin , stdoutfrom bisect import bisect_left , bisect_right , bisectpopcount = [ 0 ] * ( 32 ) n = int ( input ( ) ) a = list ( map ( int , stdin . readline ( ) . split ( ) ) ) for i in a : temp = 0 for j in range ( 31 ) : if ( i & 1 << j ) : temp += 1 popcount [ temp ] += 1 ans = 0 for i in popcount : if ( i > 1 ) : ans += ( i * ( i - 1 ) ) // 2 print ( ans ) NEW_LINE

def num ( x ) : return bin ( x ) . count ( "1" ) def main ( ) : n = int ( input ( ) ) line = list ( map ( int , input ( ) . split ( ) ) ) cou = dict ( ) for i in range ( n ) : new = num ( line [ i ] ) if new not in cou : cou [ new ] = 0 cou [ new ] += 1 ans = 0 for el in cou : ans += cou [ el ] * ( cou [ el ] - 1 ) // 2 print ( ans ) main ( ) NEW_LINE

from sys import stdin , stdoutfrom bisect import bisect_right as brfrom bisect import bisect_left as blfrom bisect import insort_left as ilfrom math import gcddef cho ( n ) : return n * ( n - 1 ) // 2 def val ( n ) : ans = 0 while n : if n & 1 : ans += 1 n //= 2 return ansn = int ( stdin . readline ( ) ) lst = [ int ( i ) for i in stdin . readline ( ) . split ( ) ] lst2 = [ ] for i in lst : lst2 += [ val ( i ) ] lst2 . sort ( ) temp = lst2 [ 0 ] c = [ 1 ] ans = 0 for i in lst2 [ 1 : ] : if i == temp : c [ - 1 ] += 1 else : c += [ 1 ] temp = ifor i in c : ans += cho ( i ) stdout . write ( str ( ans ) ) NEW_LINE


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

import java . util . Arrays ;   import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int k = sc . nextInt ( ) ; char [ ] arr = new char [ k ] ; char [ ] color = new char [ ] { ' R ' , ' O ' , ' Y ' , ' G ' , ' B ' , ' I ' , ' V ' } ; if ( k % 7 >= 4 || k % 7 == 0 ) { int i = 0 , tt = 0 ; while ( i < k ) { arr [ i ] = color [ tt ] ; if ( tt < 6 ) tt ++ ; else if ( tt == 6 ) { tt = 0 ; } i ++ ; } } else if ( k % 7 < 4 ) { int i = 0 , j = 0 , l = k % 7 , tt = 0 ;   for ( i = 4 ; i < 4 + l ; i ++ ) { arr [ i ] = color [ j ] ; j ++ ; } i = 0 ; while ( i < k ) { if ( arr [ i ] == ' \0' ) { arr [ i ] = color [ tt ] ; if ( tt < 6 ) tt ++ ; else if ( tt == 6 ) tt = 0 ; }   i ++ ; }   } for ( int i = 0 ; i < k ; i ++ ) { System . out . print ( arr [ i ] ) ; } System . out . println ( ) ;   } }

import java . util . Arrays ; import java . util . Scanner ;   public class Main {    public static void main ( String [ ] args ) {   int n ; Scanner in = new Scanner ( System . in ) ; n = in . nextInt ( ) ; System . out . print ( " ROYGBIV " ) ; n -= 7 ; while ( n >= 4 ) { System . out . print ( " GBIV " ) ; n -= 4 ; } if ( n == 0 ) System . out . println ( ) ; if ( n == 1 ) System . out . println ( " G " ) ; if ( n == 2 ) System . out . println ( " GB " ) ; if ( n == 3 ) System . out . println ( " GBI " ) ; }   }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class B {   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = nextInt ( ) ; } return a ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } }   public static void main ( String args [ ] ) { FastScanner scanner = new FastScanner ( ) ; StringBuffer ans = new StringBuffer ( " ROYGBIV " ) ; int len = scanner . nextInt ( ) - 7 ; for ( int i = 0 ; i < len ; i ++ ) { ans . append ( ans . charAt ( ans . length ( ) - 4 ) ) ; } System . out . println ( ans . toString ( ) ) ; } }

n = int ( input ( ) )   c = " BGIORVY "   ans = c + " ORVY " * 25   print ( ans [ : n ] ) NEW_LINE

n = int ( input ( ) ) NEW_LINE s = ' VIBGYOR ' NEW_LINE times = n // 7 NEW_LINE remains = n % 7 NEW_LINE if remains > 4 : NEW_LINE INDENT print ( f ' { s ▁ * ▁ times } { s [ 0 : remains ] } ' ) else : NEW_LINE print ( f ' { s ▁ * ▁ times } { s [ 3:3 ▁ + ▁ remains ] } ' ) NEW_LINE DEDENT

n = int ( input ( ) ) NEW_LINE l = " GYOR " NEW_LINE print ( " VIBGYOR " + l * ( ( n - 7 ) // 4 ) + l [ : ( n - 7 ) % 4 ] ) NEW_LINE

eggs = int ( input ( ) ) NEW_LINE paint = [ ' R ' , ' O ' , ' Y ' , ' G ' , ' B ' , ' I ' , ' V ' ] NEW_LINE for _ in range ( eggs - 7 ) : paint . append ( '0' ) NEW_LINE

if __name__ == " _ _ main _ _ " : s = " ROYGBIV " NEW_LINE cases = [ ' ' , ' G ' , ' GB ' , ' YGB ' , ' YGBI ' , ' OYGBI ' , ' OYGBIV ' ] NEW_LINE n = int ( input ( ) ) NEW_LINE to_print = n // 7 NEW_LINE cases_print = n % 7 NEW_LINE print ( s * to_print , end = " " ) NEW_LINE print ( cases [ cases_print ] , end = " " ) NEW_LINE


import java . util . Arrays ; import java . util . Scanner ;   public class CF378_D2_B { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int [ ] c1 = new int [ n ] ; int [ ] c2 = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { c1 [ i ] = scanner . nextInt ( ) ; c2 [ i ] = scanner . nextInt ( ) ; } char [ ] f1 = new char [ n ] ; char [ ] f2 = new char [ n ] ; Arrays . fill ( f1 , '0' ) ; Arrays . fill ( f2 , '0' ) ; for ( int i = 0 ; i < n / 2 ; i ++ ) { f1 [ i ] = '1' ; f2 [ i ] = '1' ; } for ( int i = 0 , x = 0 , y = 0 ; i < n ; i ++ ) { if ( c1 [ x ] < c2 [ y ] ) { f1 [ x ] = '1' ; x ++ ; } else { f2 [ y ] = '1' ; y ++ ; } } System . out . println ( String . valueOf ( f1 ) ) ; System . out . println ( String . valueOf ( f2 ) ) ; } }

n = int ( input ( ) ) k = [ ] a = [ ] b = [ ] for i in range ( n ) : A , B = map ( int , input ( ) . split ( ) ) a . append ( A ) b . append ( B ) la = 0 lb = 0 aind = [ 0 ] * nbind = [ 0 ] * nfor i in range ( n ) : if a [ la ] < b [ lb ] : aind [ la ] = 1 la += 1 else : bind [ lb ] = 1 lb += 1 for i in range ( n // 2 ) : aind [ i ] = 1 bind [ i ] = 1 for i in aind : print ( i , end = ' ' ) print ( ' ' ) for i in bind : print ( i , end = ' ' ) NEW_LINE

n = int ( input ( ) ) l1 = [ 0 ] * nl2 = [ 0 ] * nls1 = [ "0" ] * nls2 = [ "0" ] * nfor i in range ( n ) : a , b = map ( int , input ( ) . split ( ) ) l1 [ i ] = a l2 [ i ] = b   tl = [ 0 , n // 2 ] for k in tl : for h in range ( k ) : ls1 [ h ] = "1" ls2 [ h ] = "1" x = n - 2 * k i = k j = k while ( x > 0 ) : NEW_LINE

n = int ( input ( ) )   a = [ ] b = [ ] for i in range ( n ) : x , y = input ( ) . split ( ) a . append ( [ int ( x ) , 0 ] ) b . append ( [ int ( y ) , 0 ] )   j = 0 ; k = 0 for i in range ( n ) : if a [ j ] [ 0 ] < b [ k ] [ 0 ] : a [ j ] [ 1 ] = 1 j += 1 else : b [ k ] [ 1 ] = 1 k += 1   k = n // 2 for i in range ( k ) : a [ i ] [ 1 ] = 1 b [ i ] [ 1 ] = 1   s1 = ' ' ; s2 = ' ' for i in range ( n ) : if a [ i ] [ 1 ] : s1 += '1' else : s1 += '0' if b [ i ] [ 1 ] : s2 += '1' else : s2 += '0'   print ( s1 ) print ( s2 )   NEW_LINE

n = int ( input ( ) ) k = int ( n / 2 ) s1 = "1" * ( int ( n / 2 ) ) + "0" * ( n - int ( n / 2 ) ) s2 = "1" * ( int ( n / 2 ) ) + "0" * ( n - int ( n / 2 ) ) s1 = list ( s1 ) s2 = list ( s2 ) a = [ ] b = [ ] for i in range ( n ) : c , d = input ( ) . split ( ) a . append ( int ( c ) ) b . append ( int ( d ) ) for i in range ( k , n ) : if ( a [ i ] < b [ n - i - 1 ] ) : s1 [ i ] = "1" if ( b [ i ] < a [ n - i - 1 ] ) : s2 [ i ] = "1" print ( ' ' . join ( s1 ) ) print ( ' ' . join ( s2 ) ) NEW_LINE